scanning_djInfo.vue 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013
  1. <template>
  2. <view class="Scanning_djInfo">
  3. <view class="Scanning_top" v-if="res.status == 200">
  4. <view class="Scanning_top_icon">
  5. <view v-if="type == 'specimenPlan' || type == 'specimen'">
  6. <view class="fweight speNum" style="color: red;"> {{ speNum }} </view>
  7. </view>
  8. <text v-else class="cubeic-ok newicon newicon-duigou"></text>
  9. </view>
  10. <view class="Scanning_top_text">
  11. <view class="text1">操作成功</view>
  12. </view>
  13. </view>
  14. <view class="Scanning_top" v-if="res.status == 11111">
  15. <view class="Scanning_top_icon">
  16. <text class="cubeic-close newicon newicon-shibai"></text>
  17. </view>
  18. <view class="Scanning_top_text">
  19. <view class="text1" style="color: red;">操作失败</view>
  20. </view>
  21. </view>
  22. <view class="Scanning_top" v-if="
  23. res.status == 10005 ||
  24. res.status == 100018 ||
  25. res.status == 500 ||
  26. res.status == 10004 ||
  27. res.status == 100021 ||
  28. res.status == 100020 ||
  29. res.status == 100019 ||
  30. res.status == 100031
  31. ">
  32. <view class="Scanning_top_icon">
  33. <text class="cubeic-close newicon newicon-shibai"></text>
  34. </view>
  35. <view class="Scanning_top_text">
  36. <view class="text1">操作失败</view>
  37. <view class="text1 f30" v-if="queryObj.qrcode !== undefined">扫描内容:{{queryObj.qrcode}}</view>
  38. </view>
  39. </view>
  40. <view class="Scanning_cont" v-if="(res.status != 200 || res.msg != '成功!') && res.status != 11111">
  41. <view>{{ res.msg }}</view>
  42. </view>
  43. <view class="Scanning_cont" v-if="
  44. (res.status == 200 && type == 'specimenPlan') ||
  45. (res.status == 200 && type == 'specimen')
  46. ">
  47. <view>{{ infoDATA.data.stype.name }}({{infoDATA.data.scode}})</view>
  48. <view>检验项目 : {{ infoDATA.data.specimenDesc || "-" }}</view>
  49. <view>
  50. {{ infoDATA.data.sickRoom ? infoDATA.data.sickRoom.dept : "" }}
  51. <text style="width: 4em;text-align: center;margin-left: 1em;margin-right: 1em;" class="newicon newicon-arrow-right-full"></text>
  52. <text :class="{ red: isEndDeptRedShow }">{{ infoDATA.data.checkDept ? infoDATA.data.checkDept.dept : "" }}</text>
  53. </view>
  54. <view>患者姓名 : {{ infoDATA.data.patientName}}({{infoDATA.data.bedNum}})</view>
  55. <view v-if="infoDATA.data.residenceNo">住院号 : {{ infoDATA.data.residenceNo }}</view>
  56. <view v-else-if="infoDATA.data.patientNo">门诊号 : {{ infoDATA.data.patientNo }}</view>
  57. </view>
  58. <view class="Scanning_cont" v-if="
  59. (res.status == 11111 && type == 'specimenPlan') ||
  60. (res.status == 11111 && type == 'specimen')
  61. ">
  62. <view>{{ infoDATA.data.stype.name }}({{infoDATA.data.scode}})</view>
  63. <view>检验项目 : {{ infoDATA.data.specimenDesc || "-" }}</view>
  64. <view>标本状态 : <text style="color: red">{{ infoDATA.data.speState ? infoDATA.data.speState.name : '' }}</text></view>
  65. <view>
  66. {{ infoDATA.data.sickRoom ? infoDATA.data.sickRoom.dept : "" }}
  67. <text style="width: 4em;text-align: center;margin-left: 1em;margin-right: 1em;" class="newicon newicon-arrow-right-full"></text>
  68. <text :class="{ red: isEndDeptRedShow }">{{ infoDATA.data.checkDept ? infoDATA.data.checkDept.dept : "" }}</text>
  69. </view>
  70. <view>患者姓名 : {{ infoDATA.data.patientName}}({{infoDATA.data.bedNum}})</view>
  71. <view v-if="infoDATA.data.residenceNo">住院号 : {{ infoDATA.data.residenceNo }}</view>
  72. <view v-else-if="infoDATA.data.patientNo">门诊号 : {{ infoDATA.data.patientNo }}</view>
  73. </view>
  74. <view class="Scanning_cont" v-if="
  75. (res.status == 200 && type == 'inspect') || type == 'patientTransport'
  76. ">
  77. <view v-if="infoDATA.patient">患者姓名 : {{ infoDATA.patient || "-" }}</view>
  78. <view v-if="infoDATA.patient">住院号 : {{ infoDATA.residenceNo || "-" }}</view>
  79. <view v-if="infoDATA.patient">住院科室 : {{ infoDATA.deptName || "-" }}</view>
  80. <view v-if="infoDATA.patient">床号 : {{ infoDATA.bedNum || "-" }}</view>
  81. <view v-if="infoDATA.data">
  82. 检查项目 :
  83. <text v-for="(data, i) in infoDATA.data" :key="i">{{ data.inspectName }},</text>
  84. </view>
  85. <view v-if="
  86. infoType == 'ins-dsd-1' ||
  87. infoType == 'trans-dsd-1' ||
  88. infoDATA.type == 'trans-dsd-1'
  89. ">工单已完成</view>
  90. <view v-if="infoDATA.type == 'ins-half-ok'">已到达检查科室,工单已完成。</view>
  91. </view>
  92. <view class="Scanning_cont" v-if="
  93. (res.status == 200 && type == 'drugsBag') ||
  94. (res.status == 200 && type == 'jPBag')
  95. ">
  96. <view> 药包类型 : {{(infoDATA.data.packType && infoDATA.data.packType !== 0) ? DRUGSBAG_TYPE[infoDATA.data.packType] : "-"}} </view>
  97. <view v-if="type == 'drugsBag'">药包编码 : #{{ infoDATA.data.packid }}</view>
  98. <view v-if="type == 'jPBag'">静配编码 : #{{ infoDATA.data.packid }}</view>
  99. <view>所属科室 : {{ infoDATA.data.target.dept }}</view>
  100. <view v-if="
  101. accountObj && (infoType === 'drug-ddd-2' || infoType === 'drug-dsd-2')
  102. ">
  103. 交接人工号 : {{ accountObj.account }}
  104. </view>
  105. <view v-if="
  106. accountObj && (infoType === 'drug-ddd-2' || infoType === 'drug-dsd-2')
  107. ">
  108. 交接人姓名 : {{ accountObj.accountName }}
  109. </view>
  110. <text v-if="infoType == 'drug-dsd-2' || infoType == 'jp-dsd-2'">工单已完成。</text>
  111. <view class="red"> 如果您当前科室还有药包需要扫描,请点击“继续扫描”! </view>
  112. </view>
  113. <view class="foot_btn_spe" v-if="
  114. res.status == 100018 || type == 'specimen' || type == 'specimenPlan'
  115. ">
  116. <view class="btn1" @click="Scanning_again()">继续扫描</view>
  117. <view class="btn3" @click="hand_again()" v-if="type == 'specimen' || type == 'specimenPlan'">手动录入</view>
  118. <view class="btn3" @click="getNoScanSpecimen(false)" v-if="type == 'specimen' || type == 'specimenPlan'">未扫描标本</view>
  119. <view class="btn3" @click="getNoScanSpecimen(true)" v-if="type == 'specimen' || type == 'specimenPlan'">已扫描标本</view>
  120. <view class="btn2" @click="Scanning_complete(ids)">完成扫描</view>
  121. </view>
  122. <view class="foot_btn" v-if="
  123. type != 'specimen' &&
  124. res.status != 200 &&
  125. type != 'specimenPlan' &&
  126. type !== 'drugsBag' &&
  127. type !== 'jPBag' &&
  128. type !== 'patientTransport'
  129. ">
  130. <view class="btn3" @click="showAlert()">返回</view>
  131. </view>
  132. <view class="foot_btn" v-if="
  133. (res.status != 200 && type == 'drugsBag') ||
  134. (res.status != 200 && type == 'jPBag') ||
  135. (res.status != 200 && type == 'patientTransport')
  136. ">
  137. <view class="btn3" @click="Scanning_again()">继续扫描</view>
  138. <view class="btn3" @click="showAlert()" v-if="type == 'drugsBag'">返回</view>
  139. </view>
  140. <view class="foot_btn" v-if="
  141. res.status == 200 &&
  142. type != 'specimen' &&
  143. type != 'specimenPlan'
  144. ">
  145. <view class="btn3" @click="Scanning_again()" v-if="
  146. (res.status == 200 && type == 'drugsBag') ||
  147. (res.status == 200 && type == 'jPBag')
  148. ">继续扫描</view>
  149. <view class="btn3" @click="showAlert()">返回</view>
  150. </view>
  151. <!-- 弹窗 -->
  152. <showModel :title="models.title" :icon="models.icon" :disjunctor="models.disjunctor" :content="models.content"
  153. @ok="ok" @cancel="cancel" :operate="models.operate"></showModel>
  154. <!-- 弹窗 -->
  155. <showModel :title="models2.title" :icon="models2.icon" :disjunctor="models2.disjunctor" :content="models2.content"
  156. @ok="ok2" @know="know2" @cancel="cancel2" :operate="models2.operate">
  157. </showModel>
  158. <!-- 手动查询标本弹窗 -->
  159. <handViewSpecimen v-if="speModels.disjunctor" :title="speModels.title" :disjunctor="speModels.disjunctor"
  160. @ok="speOk" @cancel="speCancel">
  161. </handViewSpecimen>
  162. <!-- 调查问卷二维码 -->
  163. <questionCode v-if="isQuestionModel" :orderId="gdId" @know="isQuestionModel = false"></questionCode>
  164. <!-- PDA扫描 -->
  165. <scanner></scanner>
  166. </view>
  167. </template>
  168. <script>
  169. import showModel from "../../components/showModel/showModel.vue";
  170. import scanner from "../../components/scanner/scanner.vue";
  171. import questionCode from "../../components/questionCode/questionCode.vue";
  172. import {
  173. get,
  174. post,
  175. SM,
  176. webHandle
  177. } from "../../http/http.js";
  178. import {
  179. DRUGSBAG_TYPE
  180. } from '../../tools/enum.drugsbagType.js';
  181. export default {
  182. components:{
  183. questionCode,
  184. scanner
  185. },
  186. data() {
  187. return {
  188. // 终点科室标红
  189. isEndDeptRedShow: false,
  190. isEndDeptRed: false,
  191. // 调研二维码
  192. isQuestionModel:false,
  193. gdId:null,
  194. DRUGSBAG_TYPE,
  195. currentCode: '', //当前小扫描的科室二维码
  196. // 手动查询标本弹窗model
  197. speModels: {
  198. disjunctor: false,
  199. },
  200. // 交接人信息
  201. accountObj: undefined,
  202. //传给后端查询是否继续扫描
  203. deptId: undefined,
  204. SMFlag: true,
  205. // 弹窗model
  206. models: {
  207. disjunctor: false,
  208. },
  209. // 完成扫描弹窗model1
  210. models2: {
  211. disjunctor: false,
  212. },
  213. wcId: "", //工单完成ID
  214. wcFlag: false,
  215. infoDATA: [],
  216. res: {
  217. status: "",
  218. msg: "",
  219. },
  220. infoType: "",
  221. DEPTCode: "",
  222. RESData: {},
  223. DEPT: "",
  224. dataId: "",
  225. type: "",
  226. model: {},
  227. idsType: 1,
  228. packid: "",
  229. speNum: 0,
  230. queryObj: {}, //路由传递过来的参数
  231. gotoFlag: true,
  232. content: "",
  233. };
  234. },
  235. methods: {
  236. // 手动查询标本-确认
  237. speOk(data) {
  238. console.log(data);
  239. if (!data.id) {
  240. //没有查询到标本
  241. uni.showModal({
  242. title: '提示',
  243. content: "没有查询到标本!",
  244. showCancel: false,
  245. success: function(res) {
  246. if (res.confirm) {
  247. console.log('用户点击确定');
  248. } else if (res.cancel) {
  249. console.log('用户点击取消');
  250. }
  251. }
  252. });
  253. return;
  254. }
  255. this.speModels.disjunctor = false;
  256. this.hand_scanning_common(data.scode, 'hand');
  257. },
  258. // 手动查询标本-取消
  259. speCancel() {
  260. this.speModels.disjunctor = false;
  261. },
  262. // 手动查询标本弹窗
  263. showHandViewSpecimen() {
  264. this.speModels = {
  265. title: '填写标本编码',
  266. disjunctor: true,
  267. }
  268. },
  269. // 手动录入标本
  270. hand_again() {
  271. this.showHandViewSpecimen();
  272. },
  273. // 手动输入标本和扫码公共方法
  274. hand_scanning_common(ress1, type) {
  275. let list = [];
  276. let postType = "";
  277. let ids = [];
  278. if (this.ids && this.ids[0]) {
  279. ids = this.ids;
  280. } else if (this.dataId) {
  281. ids = [];
  282. ids.push(this.dataId);
  283. }
  284. let data = {
  285. ids: ids,
  286. deptCode: this.DEPTCode,
  287. code: "", // 2
  288. };
  289. // ----------------
  290. uni.showLoading({
  291. title: "加载中",
  292. mask: true,
  293. });
  294. //检验二维码的有效性
  295. post("/dept/scanning", {
  296. content: ress1,
  297. }).then((result) => {
  298. this.SMFlag = true;
  299. this.currentCode = result.code;
  300. if (result.state == 200 || result.state == 201) {
  301. let ress = result.code;
  302. if (ress) {
  303. data.code = ress;
  304. if (this.type == "inspect") {
  305. postType = "handleIns";
  306. list = data;
  307. }
  308. if (this.type == "jPBag" || this.type == "drugsBag") {
  309. postType = "handleDrugsAndJp";
  310. data["type"] = this.infoType;
  311. list = data;
  312. if (this.accountObj) {
  313. list.handover = this.accountObj.accountId;
  314. }
  315. list.deptId = this.deptId;
  316. if(this.type == "drugsBag"){
  317. delete list.ids;
  318. }
  319. }
  320. if (this.type == "specimen") {
  321. postType = "handleSpes";
  322. data["speCode"] = data.code;
  323. delete data.code;
  324. data["type"] = this.infoType;
  325. list = data;
  326. if (this.accountObj) {
  327. list.handover = this.accountObj.accountId;
  328. }
  329. }
  330. if (this.type == "specimenPlan") {
  331. postType = "handlePlanSpes";
  332. data["speCode"] = data.code;
  333. delete data.code;
  334. data["type"] = this.infoType;
  335. list = data;
  336. if (this.accountObj) {
  337. list.handover = this.accountObj.accountId;
  338. }
  339. }
  340. if (this.type == "patientTransport") {
  341. postType = "handleTrans";
  342. list = data;
  343. }
  344. post("/workerOrder/" + postType, list).then((res) => {
  345. uni.hideLoading();
  346. if (res.status == 200 || res.status == 11111) {
  347. //标本和标本轮巡工单,扫描标本后会自动调用摄像头,继续扫描,直到status不是200
  348. if ((this.type == "specimenPlan" || this.type == "specimen") && res.status != 11111) {
  349. this.getPageConfigSpecimen((flag, type, res) => {
  350. if(flag){
  351. if (type === 'scan') {
  352. setTimeout(()=>{
  353. // #ifdef H5
  354. this.Scanning_again();
  355. // #endif
  356. },500)
  357. } else if (type === 'hand') {
  358. this.hand_again();
  359. }
  360. }
  361. if(res){
  362. this.isEndDeptRedShow = this.isEndDeptRed;
  363. this.infoDATA = res;
  364. this.speNum = res.specimenCount;
  365. this.res["status"] = res.status;
  366. this.res["msg"] = res.msg;
  367. }
  368. }, type, res.data, res);
  369. return;
  370. }
  371. if (
  372. this.type == "inspect" ||
  373. this.type == "patientTransport"
  374. ) {
  375. if (res.ids) {
  376. for (var i = 0; i < this.ids.length; i++) {
  377. if (this.ids[i] == res.ids[0]) {
  378. this.ids.splice(i, 1);
  379. }
  380. }
  381. if (this.ids.length > 1) {
  382. this.idsType = 1;
  383. } else {
  384. this.idsType = 2;
  385. }
  386. }
  387. this.infoDATA = res;
  388. this.type = this.type;
  389. this.DEPTCode = this.DEPTCode;
  390. } else if (this.type == "drugsBag") {
  391. // this.infoDATA.data.packid = res.data.packid;
  392. this.infoDATA = res;
  393. this.res["status"] = res.status;
  394. this.res["msg"] = res.msg;
  395. } else if (
  396. this.type == "specimenPlan" ||
  397. this.type == "specimen"
  398. ) {
  399. this.infoDATA = res;
  400. this.speNum = res.specimenCount;
  401. // --------------------------
  402. this.res["status"] = res.status;
  403. this.res["msg"] = res.msg;
  404. // --------------------------
  405. } else if (this.type == "jPBag") {
  406. // this.infoDATA.data.packid = res.data.packid;
  407. this.infoDATA = res;
  408. this.res["status"] = res.status;
  409. this.res["msg"] = res.msg;
  410. } else {
  411. uni.navigateTo({
  412. url: `../scanning_djEnd/scanning_djEnd?type=${
  413. this.queryObj.type
  414. }&type1=${this.queryObj.type1}&code=${
  415. this.queryObj.deptCode
  416. }&dept=${this.queryObj.dept}&ids=${encodeURIComponent(
  417. JSON.stringify(this.ids)
  418. )}&model=${encodeURIComponent(
  419. JSON.stringify(res)
  420. )}&accountObj=${encodeURIComponent(
  421. JSON.stringify(this.accountObj)
  422. )}&deptId=${this.deptId}`,
  423. });
  424. }
  425. } else {
  426. uni.navigateTo({
  427. url: `../scanning_djEnd/scanning_djEnd?type=${
  428. this.queryObj.type
  429. }&type1=${this.queryObj.type1}&code=${
  430. this.queryObj.deptCode
  431. }&dept=${this.queryObj.dept}&ids=${encodeURIComponent(
  432. JSON.stringify(this.ids)
  433. )}&model=${encodeURIComponent(
  434. JSON.stringify(res)
  435. )}&speNum=${this.speNum}&accountObj=${encodeURIComponent(
  436. JSON.stringify(this.accountObj)
  437. )}&deptId=${this.deptId}&scanOrHand=${type}&qrcode=${this.currentCode}`,
  438. });
  439. }
  440. });
  441. }
  442. } else {
  443. uni.hideLoading();
  444. uni.showToast({
  445. icon: "none",
  446. title: result.info || "接口获取数据失败!",
  447. });
  448. }
  449. });
  450. // ------------------------------
  451. },
  452. // 查看未扫描标本
  453. // isScan true已扫描标本,false未扫描标本
  454. getNoScanSpecimen(isScan) {
  455. if (!this.gotoFlag) {
  456. return;
  457. }
  458. this.gotoFlag = false;
  459. if(isScan){
  460. uni.navigateTo({
  461. url: `../noScanSpecimen/noScanSpecimen?deptName=${this.queryObj.dept}&workOrderId=${encodeURIComponent(JSON.stringify(this.queryObj.ids))}&deptCode=${this.queryObj.deptCode}&isScan=1`,
  462. });
  463. }else{
  464. uni.navigateTo({
  465. url: `../noScanSpecimen/noScanSpecimen?deptName=${this.queryObj.dept}&workOrderId=${encodeURIComponent(JSON.stringify(this.queryObj.ids))}&deptCode=${this.queryObj.deptCode}`,
  466. });
  467. }
  468. },
  469. overFinish() {
  470. let postType = "";
  471. if (
  472. this.queryObj.type1 === "plan-spe-ddd-2" ||
  473. this.queryObj.type1 === "plan-spe-dsd-2" ||
  474. this.queryObj.type1 === "plan-spe-dsd-3"
  475. ) {
  476. postType = "finishPlanSpes";
  477. } else if (this.queryObj.type1 == "spe-ddd-2") {
  478. postType = "finishSpes";
  479. }
  480. let data = {
  481. type: this.queryObj.type1,
  482. ids: this.wcId,
  483. };
  484. post("/workerOrder/" + postType, data).then((res) => {
  485. if (res.status == 200) {
  486. this.models2 = {
  487. disjunctor: true,
  488. title: "提示",
  489. content: `完成扫描成功`,
  490. icon: "success",
  491. operate: {
  492. know: "返回",
  493. },
  494. };
  495. } else {
  496. uni.showToast({
  497. icon: "none",
  498. title: res.msg || "接口获取数据失败!",
  499. });
  500. }
  501. });
  502. },
  503. // 确定
  504. ok() {
  505. this.models.disjunctor = false;
  506. let postData = {
  507. ids: this.queryObj.ids,
  508. sign: true,
  509. deptQrCode: this.queryObj.deptCode,
  510. };
  511. uni.showLoading({
  512. title: "加载中",
  513. mask: true,
  514. });
  515. post("/workerOrder/expectedAndActual", postData).then((ress) => {
  516. uni.hideLoading();
  517. if (ress.status == 200) {
  518. if (this.wcFlag) {
  519. //正常完成扫描
  520. this.overFinish();
  521. } else {
  522. this.gotoOver();
  523. }
  524. } else if (ress.status == 1000035) {
  525. let content = "";
  526. if (
  527. this.queryObj.type1 === "spe-ddd-2" ||
  528. this.queryObj.type1 === "plan-spe-ddd-2"
  529. ) {
  530. //待到达
  531. content =
  532. `系统内预计标本<strong class="red">${ress.expectReceiveNum}</strong>只,您扫描收取标本<strong class="red">${ress.actualReceiveNum}</strong>只,其中<strong class="red">${ress.notReceiveNum}</strong>只未扫描;`;
  533. } else {
  534. //待送达
  535. this.content = `本工单已签到<strong class="red">${
  536. ress.scanSet ? ress.scanSet.join("、") : ""
  537. }</strong>,剩余需签到科室<strong class="red">${
  538. ress.notScanSet ? ress.notScanSet.join("、") : ""
  539. }</strong>,总签收<strong class="red">${
  540. ress.totalAcceptance
  541. }</strong>只,剩余<strong class="red">${
  542. ress.notAcceptance
  543. }</strong>只未签收,您确定完成工单吗?`;
  544. content =
  545. `您在<strong class="red">${ress.deptName}</strong>检验科扫描了<strong class="red">${ress.deptScanNum}</strong>个标本,还需扫描<strong class="red">${ress.deptNotScanNum}</strong>标本。`;
  546. }
  547. // 取消弹窗 2022年10月10日
  548. this.ok2();
  549. // this.models2 = {
  550. // disjunctor: true,
  551. // title: "提示",
  552. // content,
  553. // icon: "warn",
  554. // operate: {
  555. // ok: "确定",
  556. // cancel: "取消",
  557. // },
  558. // };
  559. } else {
  560. uni.showToast({
  561. icon: "none",
  562. title: ress.msg || "接口获取数据失败!",
  563. });
  564. }
  565. });
  566. },
  567. // 取消
  568. cancel() {
  569. this.models.disjunctor = false;
  570. },
  571. // 确定
  572. ok2() {
  573. this.models2.disjunctor = false;
  574. let postData = {
  575. ids: this.queryObj.ids,
  576. deptQrCode: this.queryObj.deptCode,
  577. };
  578. uni.showLoading({
  579. title: "加载中",
  580. mask: true,
  581. });
  582. post("/workerOrder/expectedAndActual", postData).then((ress) => {
  583. uni.hideLoading();
  584. if (ress.status == 200) {
  585. if (this.wcFlag) {
  586. this.overFinish();
  587. } else {
  588. this.gotoOver();
  589. }
  590. } else {
  591. uni.showToast({
  592. icon: "none",
  593. title: ress.msg || "接口获取数据失败!",
  594. });
  595. }
  596. });
  597. },
  598. // 取消
  599. cancel2() {
  600. this.models2.disjunctor = false;
  601. },
  602. know2() {
  603. this.models2.disjunctor = false;
  604. uni.navigateTo({
  605. url: "../receiptpage/receiptpage",
  606. });
  607. },
  608. //完成扫描
  609. Scanning_complete(id) {
  610. // 如果是标本配送和标本轮巡,则进入标本核对页面
  611. if((this.type === 'specimen' || this.type === 'specimenPlan') && this.queryObj.type1.includes('ddd')){
  612. uni.navigateTo({
  613. url: `../checkAfterScanning/checkAfterScanning?id=${id}&type=${this.queryObj.type}&type1=${this.queryObj.type1}&dept=${this.queryObj.dept}&deptId=${this.queryObj.deptId}&deptCode=${this.queryObj.deptCode}&speNum=${this.speNum}&content=${this.content}`,
  614. });
  615. return;
  616. }
  617. this.wcId = id;
  618. if (
  619. this.queryObj.type1 == "plan-spe-ddd-2" ||
  620. this.queryObj.type1 == "spe-ddd-2"
  621. ) {
  622. this.wcFlag = true;
  623. this.models = {
  624. disjunctor: true,
  625. title: "提示",
  626. content: "是否确定标本已扫描完成?",
  627. icon: "warn",
  628. operate: {
  629. ok: "确定",
  630. cancel: "取消",
  631. },
  632. };
  633. } else if (
  634. this.queryObj.type1 == "plan-spe-dsd-2" ||
  635. this.queryObj.type1 == "plan-spe-dsd-3" ||
  636. this.queryObj.type1 == "spe-dsd-2" ||
  637. this.queryObj.type1 == "spe-dsd-3"
  638. ) {
  639. this.wcFlag = false;
  640. this.models = {
  641. disjunctor: true,
  642. title: "提示",
  643. content: "是否确定标本已扫描完成?",
  644. icon: "warn",
  645. operate: {
  646. ok: "确定",
  647. cancel: "取消",
  648. },
  649. };
  650. } else {
  651. this.gotoOver();
  652. }
  653. },
  654. // 跳转完成工单页面
  655. gotoOver() {
  656. if(this.queryObj.type === 'specimenPlan'){
  657. uni.navigateTo({
  658. url: `../specimenCheckingEnd/specimenCheckingEnd?type=${this.queryObj.type}&type1=${
  659. this.queryObj.type1
  660. }&id=${encodeURIComponent(JSON.stringify(this.wcId))}&deptCode=${
  661. this.queryObj.deptCode
  662. }&dept=${this.queryObj.dept}&content=${this.content}`,
  663. });
  664. }else{
  665. uni.navigateTo({
  666. url: `../scanning/scanning?type=${this.queryObj.type}&type1=${
  667. this.queryObj.type1
  668. }&id=${encodeURIComponent(JSON.stringify(this.wcId))}&deptCode=${
  669. this.queryObj.deptCode
  670. }&dept=${this.queryObj.dept}&content=${this.content}`,
  671. });
  672. }
  673. },
  674. // 继续扫描
  675. Scanning_again() {
  676. if (!this.SMFlag) {
  677. return;
  678. }
  679. this.SMFlag = false;
  680. SM()
  681. .then((ress1) => {
  682. this.hand_scanning_common(ress1, 'scan');
  683. })
  684. .catch((err) => {
  685. this.SMFlag = true;
  686. });
  687. },
  688. // pda扫描
  689. pdaChange(content){
  690. content = content.replace('\n','')
  691. this.hand_scanning_common(content, 'scan');
  692. },
  693. // 返回
  694. showAlert() {
  695. uni.navigateTo({
  696. url: "../receiptpage/receiptpage",
  697. });
  698. },
  699. // 获取问卷配置
  700. getQuestionnaireSet(){
  701. uni.showLoading({
  702. title: "加载中",
  703. mask: true,
  704. });
  705. const userData = uni.getStorageSync("userData");
  706. post("/simple/data/fetchDataList/questionnaireConfig",{
  707. questionnaireConfig:{
  708. hosId:userData.user.currentHospital.id
  709. },
  710. idx:0,
  711. sum:10
  712. }).then((res) => {
  713. uni.hideLoading();
  714. if (res.status == 200) {
  715. let data = res.list[0];
  716. let taskTypeId = this.infoDATA.workOrderList[0].taskType.id
  717. if(data.taskTypeDTOS.length>0 && data.questionnaireDTOS.length>0){
  718. let isQuestion = data.taskTypeDTOS.find(i=> i.id == taskTypeId)
  719. if(isQuestion){
  720. this.isQuestionModel = true
  721. }
  722. }
  723. } else {
  724. uni.showToast({
  725. icon: "none",
  726. title: res.msg || "接口获取数据失败!",
  727. });
  728. }
  729. });
  730. },
  731. // 页面控制-标本
  732. getPageConfigSpecimen(fn, type, specimenDTO, ress){
  733. const userData = uni.getStorageSync("userData");
  734. console.log('userData', userData);
  735. console.log('specimenDTO', specimenDTO);
  736. uni.showLoading({
  737. title: "加载中",
  738. mask: true,
  739. });
  740. // 查询标本配送业务
  741. post("/simple/data/fetchDataList/taskType",{
  742. "idx": 0,
  743. "sum": 10,
  744. "taskType": {
  745. "simpleQuery": true,
  746. "hosId": {
  747. "id": userData.user.currentHospital.id
  748. },
  749. "associationType": {
  750. "key": "association_types",
  751. "value": "specimen"
  752. }
  753. }
  754. }).then((res) => {
  755. if (res.status == 200) {
  756. let taskTypeDTO = res.list[0];
  757. if(taskTypeDTO){
  758. // 查询业务页面控制-标本
  759. post("/simple/data/fetchDataList/taskTypeConfig",{
  760. "idx": 0,
  761. "sum": 10,
  762. "taskTypeConfig": {
  763. taskTypeDTO,
  764. }
  765. }).then((res) => {
  766. uni.hideLoading();
  767. if (res.status == 200) {
  768. let data = res.list[0];
  769. if(data){
  770. let deptNotAlertList = data.deptNotAlertList || [];
  771. deptNotAlertList = deptNotAlertList.map(v => v.id);
  772. if(deptNotAlertList.includes(specimenDTO.checkDept.id)){
  773. this.isEndDeptRed = true;
  774. console.log('红色')
  775. fn(false, type, ress);
  776. }else{
  777. this.isEndDeptRed = false;
  778. fn(true, type, ress);
  779. }
  780. console.log('this.isEndDeptRed', this.isEndDeptRed);
  781. }else{
  782. this.isEndDeptRed = false;
  783. fn(true, type, ress);
  784. }
  785. } else {
  786. uni.showToast({
  787. icon: "none",
  788. title: res.msg || "接口获取数据失败!",
  789. });
  790. }
  791. });
  792. }else{
  793. uni.hideLoading();
  794. uni.showToast({
  795. icon: "none",
  796. title: "未查询到标本配送业务!",
  797. });
  798. }
  799. } else {
  800. uni.hideLoading();
  801. uni.showToast({
  802. icon: "none",
  803. title: res.msg || "接口获取数据失败!",
  804. });
  805. }
  806. });
  807. },
  808. },
  809. onShow() {
  810. this.SMFlag = true;
  811. this.gotoFlag = true;
  812. let that = this;
  813. // #ifdef APP-PLUS
  814. uni.$off('scan') // 每次进来先 移除全局自定义事件监听器
  815. uni.$on('scan', function(data) {
  816. that.pdaChange(data)
  817. })
  818. // #endif
  819. },
  820. onLoad(options) {
  821. this.isEndDeptRedShow = options.isEndDeptRed === 'true';
  822. if (options.status == 200&&options.scanOrHand === 'hand'&&(options.type === "specimen"||options.type === "specimenPlan")) {
  823. this.getPageConfigSpecimen((flag) => {
  824. if(flag){
  825. this.hand_again();
  826. }
  827. });
  828. }
  829. console.log(options, "options");
  830. if (options.speNum) {
  831. this.speNum = options.speNum;
  832. }
  833. if (options.accountObj && options.accountObj != "undefined") {
  834. this.accountObj = JSON.parse(options.accountObj);
  835. }
  836. if (options.deptId && options.deptId != "undefined") {
  837. this.deptId = options.deptId;
  838. }
  839. this.queryObj = options;
  840. if (this.queryObj.model) {
  841. let list = JSON.parse(this.queryObj.model);
  842. this.infoDATA = list;
  843. } else {
  844. this.infoDATA = this.queryObj.infoData;
  845. }
  846. console.log(this.infoDATA, "22222");
  847. this.RESData = this.queryObj.resData;
  848. this.res["status"] = this.queryObj.status;
  849. this.res["msg"] = this.queryObj.msg;
  850. this.res["patient"] = this.queryObj.patient;
  851. this.infoType = this.queryObj.type1;
  852. if (this.queryObj.dept) {
  853. this.DEPT = this.queryObj.dept;
  854. }
  855. this.queryObj.ids = JSON.parse(this.queryObj.ids);
  856. if (this.queryObj.ids) {
  857. this.ids = this.queryObj.ids;
  858. if (this.ids.length > 1) {
  859. this.idsType = 1;
  860. } else {
  861. this.idsType = 2;
  862. }
  863. }
  864. this.DEPTCode = this.queryObj.deptCode;
  865. this.type = this.queryObj.type;
  866. this.taskTypeId = options.taskTypeId
  867. if(options.workOrderList && options.workOrderList!="undefined" && options.workOrderList!=undefined){
  868. this.infoDATA.workOrderList = JSON.parse(options.workOrderList)
  869. }
  870. if(this.queryObj.ids&&this.queryObj.ids.length>0){
  871. this.gdId = this.queryObj.ids[0]
  872. }else{
  873. this.gdId = this.infoDATA.workOrderList[0].id
  874. }
  875. if((this.res.status == 200 && this.type == 'inspect') || this.type == 'patientTransport'){
  876. if(this.infoType == 'ins-dsd-1' ||
  877. this.infoType == 'trans-dsd-1' ||
  878. this.infoDATA.type == 'trans-dsd-1' ||
  879. this.infoDATA.type == 'ins-half-ok'){
  880. this.getQuestionnaireSet()
  881. }
  882. }
  883. if(
  884. (this.res.status == 200 && this.type == 'drugsBag') ||
  885. (this.res.status == 200 && this.type == 'jPBag')){
  886. if(this.infoType == 'drug-dsd-2' || this.infoType == 'jp-dsd-2'){
  887. this.getQuestionnaireSet()
  888. }
  889. }
  890. // #ifdef APP-PLUS
  891. webHandle("no", "app");
  892. // #endif
  893. // #ifdef H5
  894. webHandle("no", "wx");
  895. // #endif
  896. },
  897. };
  898. </script>
  899. <style lang="less">
  900. .Scanning_djInfo {
  901. padding: 0 20rpx;
  902. .Scanning_top {
  903. min-height: 270rpx;
  904. .red {
  905. background-color: #ff3b53 !important;
  906. }
  907. .Scanning_top_icon {
  908. width: 140rpx;
  909. height: 140rpx;
  910. margin: 0 auto;
  911. margin-top: 116rpx;
  912. border-radius: 50%;
  913. line-height: 140rpx;
  914. .speNum{
  915. text-align: center;
  916. font-size: 140rpx;
  917. }
  918. .cubeic-ok {
  919. font-size: 140rpx;
  920. color: #35b34a;
  921. }
  922. .cubeic-close {
  923. font-size: 140rpx;
  924. color: #ff3b53;
  925. }
  926. }
  927. .Scanning_top_text {
  928. .text1 {
  929. margin-top: 40rpx;
  930. font-size: 48rpx;
  931. text-align: center;
  932. }
  933. }
  934. }
  935. .Scanning_cont {
  936. font-size: 32rpx;
  937. text-align: center;
  938. view {
  939. margin-bottom: 16rpx;
  940. }
  941. .text {
  942. margin-top: 24rpx;
  943. color: #35b34a;
  944. }
  945. .text1 {
  946. margin-top: 24rpx;
  947. color: #ff3b53;
  948. }
  949. }
  950. .foot_btn {
  951. line-height: 88rpx;
  952. height: 100rpx;
  953. margin-top: 40rpx;
  954. text-align: center;
  955. display: flex;
  956. .btn1,
  957. .btn2,
  958. .btn3 {
  959. height: 88rpx;
  960. margin: 0 1%;
  961. flex: 1;
  962. background-image: linear-gradient(to right, #72c172, #3bb197);
  963. color: #fff;
  964. border-radius: 8rpx;
  965. font-size: 32rpx;
  966. margin-top: 16rpx;
  967. }
  968. }
  969. .foot_btn_spe {
  970. line-height: 88rpx;
  971. height: 100rpx;
  972. margin-top: 40rpx;
  973. text-align: center;
  974. display: flex;
  975. justify-content: space-between;
  976. flex-wrap: wrap;
  977. &::after {
  978. content: '';
  979. flex: 1;
  980. }
  981. view {
  982. height: 88rpx;
  983. width: 48%;
  984. margin: 0 1%;
  985. background-image: linear-gradient(to right, #72c172, #3bb197);
  986. color: #fff;
  987. border-radius: 8rpx;
  988. font-size: 32rpx;
  989. margin-top: 16rpx;
  990. }
  991. }
  992. }
  993. </style>