scanning_djEnd.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. <template>
  2. <view class="Scanning_djEnd">
  3. <view class="Scanning_top" v-if="infoDATA.status == 200">
  4. <view class="Scanning_top_icon">
  5. <text class="cubeic-ok icon_transport transport-duigou"></text>
  6. </view>
  7. <view class="Scanning_top_text">
  8. <view class="text1">操作成功</view>
  9. </view>
  10. </view>
  11. <view class="Scanning_top" v-if="
  12. infoDATA.status == 10005 ||
  13. infoDATA.status == 100018 ||
  14. infoDATA.status == 10004 ||
  15. infoDATA.status == 100021 ||
  16. infoDATA.status == 500 ||
  17. infoDATA.status == 100031
  18. ">
  19. <view class="Scanning_top_icon">
  20. <text class="cubeic-close icon_transport transport-shibai"></text>
  21. </view>
  22. <view class="Scanning_top_text">
  23. <view class="text1">操作失败</view>
  24. </view>
  25. </view>
  26. <view class="Scanning_cont" v-if="
  27. (infoDATA.status == 200 && type == 'specimenPlan') ||
  28. (infoDATA.status == 200 && type == 'specimen')
  29. "></view>
  30. <view class="Scanning_cont" v-if="
  31. (infoDATA.status == 200 && type == 'patientTransport') ||
  32. (infoDATA.status == 200 && type == 'inspect')
  33. ">扫描患者腕带并将患者送往目标科室.</view>
  34. <view class="Scanning_cont" v-if="
  35. (infoDATA.status == 200 &&
  36. type == 'drugsBag' &&
  37. (type1 == 'drug-ddd-2' || type1 == 'drug-dsd-2')) ||
  38. (infoDATA.status == 200 &&
  39. type == 'jPBag' &&
  40. (type1 == 'jp-ddd-2' || type1 == 'jp-dsd-2'))
  41. ">已到达目标科室,请扫描药包或静配包.</view>
  42. <view class="Scanning_cont" v-if="
  43. (infoDATA.status == 200 &&
  44. type == 'drugsBag' &&
  45. (type1 == 'drug-ddd-1' || type1 == 'drug-dsd-1')) ||
  46. (infoDATA.status == 200 &&
  47. type == 'jPBag' &&
  48. (type1 == 'jp-ddd-1' || type1 == 'jp-dsd-1'))
  49. ">已到达目标科室,请取药包或静配包后送达目标科室.</view>
  50. <view class="Scanning_cont" v-if="
  51. infoDATA.status == 200 && type == 'other' && infoDATA.type == 'qt-ddd-1'
  52. ">已到达目标科室,请执行该工单.</view>
  53. <view class="Scanning_cont" v-if="
  54. (infoDATA.state == 'finish' &&
  55. infoDATA.status == 200 &&
  56. type == 'specimenPlan' &&
  57. infoDATA.type == 'plan-spe-dsd-1') ||
  58. (infoDATA.status == 200 &&
  59. type == 'other' &&
  60. infoDATA.type == 'qt-dsd-1')
  61. ">已到达目标科室,工单已完成.</view>
  62. <view class="Scanning_cont" v-if="
  63. (infoDATA.status == 200 &&
  64. type == 'specimenPlan' &&
  65. infoDATA.type != 'plan-spe-ddd-1' &&
  66. infoDATA.type != 'plan-spe-dsd-1') ||
  67. (infoDATA.status == 200 &&
  68. type == 'specimen' &&
  69. infoDATA.type != 'spe-ddd-1' &&
  70. infoDATA.type != 'spe-dsd-1')
  71. ">已到达目标科室,请扫描标本.</view>
  72. <view class="Scanning_cont" v-if="
  73. (infoDATA.status == 200 &&
  74. type == 'specimenPlan' &&
  75. infoDATA.type == 'plan-spe-ddd-1') ||
  76. (infoDATA.status == 200 &&
  77. type == 'specimen' &&
  78. infoDATA.type == 'spe-ddd-1')
  79. ">已到达目标科室,请取标本后送达目标科室.</view>
  80. <view class="Scanning_cont" v-if="
  81. (infoDATA.state != 'finish' &&
  82. infoDATA.status == 200 &&
  83. type == 'specimenPlan' &&
  84. infoDATA.type == 'plan-spe-dsd-1') ||
  85. (infoDATA.status == 200 &&
  86. type == 'specimen' &&
  87. infoDATA.type == 'spe-dsd-1')
  88. ">已到达目标科室,请放置标本完成该工单.</view>
  89. <view class="Scanning_cont" v-if="infoDATA.status != 200">
  90. <view>{{ infoDATA.msg }}</view>
  91. </view>
  92. <view class="foot_btn" v-if="type == 'inspect' || type == 'patientTransport'">
  93. <view class="btn3" @click="Scanning_again()">继续扫描</view>
  94. </view>
  95. <view class="foot_btn" v-if="type == 'drugsBag' || type == 'jPBag'">
  96. <view class="btn3" @click="Scanning_again()" v-if="
  97. type1 === 'drug-ddd-2' ||
  98. type1 === 'drug-dsd-2' ||
  99. type1 === 'jp-ddd-2' ||
  100. type1 === 'jp-dsd-2'
  101. ">继续扫描</view>
  102. <view class="btn3" @click="showAlert()" v-if="
  103. type1 === 'drug-ddd-1' ||
  104. type1 === 'drug-dsd-1' ||
  105. type1 === 'jp-ddd-1' ||
  106. type1 === 'jp-dsd-1'
  107. ">知道了</view>
  108. </view>
  109. <view class="foot_btn" v-if="
  110. (type == 'specimenPlan' &&
  111. type1 != 'plan-spe-dsd-1' &&
  112. (type1 != 'plan-spe-ddd-1') & (type1 != 'plan-spe-ddd-2')) ||
  113. (type == 'specimen' &&
  114. type1 != 'spe-dsd-1' &&
  115. (type1 != 'spe-ddd-1') & (type1 != 'spe-ddd-2'))
  116. ">
  117. <view class="btn1" @click="Scanning_again()">扫描标本</view>
  118. <view class="btn3" @click="getNoScanSpecimen()" v-show="this.queryObj.speNum">查看未扫描标本</view>
  119. <view class="btn2" @click="Scanning_complete(ids)" v-show="this.queryObj.speNum">完成扫描</view>
  120. </view>
  121. <view class="foot_btn" v-if="
  122. (type == 'specimenPlan' && type1 == 'plan-spe-ddd-2') ||
  123. (type == 'specimen' && type1 == 'spe-ddd-2')
  124. ">
  125. <view class="btn1" @click="Scanning_again()">扫描标本</view>
  126. <view class="btn3" @click="getNoScanSpecimen()" v-show="this.queryObj.speNum">查看未扫描标本</view>
  127. <view class="btn2" @click="Scanning_complete(ids)" v-show="this.queryObj.speNum">完成扫描</view>
  128. </view>
  129. <view class="foot_btn" v-if="
  130. (infoDATA.state != 'finish' &&
  131. type == 'specimenPlan' &&
  132. type1 == 'plan-spe-dsd-1') ||
  133. (type == 'specimen' && type1 == 'spe-dsd-1')
  134. ">
  135. <view class="btn1" @click="Scanning_complete1(ids)">完成工单</view>
  136. <view class="btn2" @click="showAlert()">继续配送</view>
  137. </view>
  138. <view class="foot_btn" v-if="
  139. infoDATA.status != 200 &&
  140. type != 'specimenPlan' &&
  141. type != 'specimen' &&
  142. type !== 'jPBag' &&
  143. type !== 'inspect' &&
  144. type !== 'drugsBag' &&
  145. type !== 'patientTransport'
  146. ">
  147. <view class="btn3" @click="showAlert()">知道了</view>
  148. </view>
  149. <view class="foot_btn" v-if="
  150. (infoDATA.status == 200 && type1 == 'spe-ddd-1') ||
  151. (infoDATA.status == 200 && type1 == 'plan-spe-ddd-1')
  152. ">
  153. <view class="btn3" @click="showAlert()">知道了</view>
  154. </view>
  155. <view class="foot_btn" v-if="
  156. (infoDATA.state == 'finish' &&
  157. infoDATA.status == 200 &&
  158. type == 'specimenPlan' &&
  159. type1 == 'plan-spe-dsd-1') ||
  160. (infoDATA.status == 200 && type == 'other')
  161. ">
  162. <view class="btn3" @click="showAlert()">知道了</view>
  163. </view>
  164. <!-- 弹窗 -->
  165. <showModel :title="models.title" :icon="models.icon" :disjunctor="models.disjunctor" :content="models.content"
  166. @ok="ok" @cancel="cancel" :operate="models.operate"></showModel>
  167. <!-- 弹窗 -->
  168. <showModel :title="models2.title" :icon="models2.icon" :disjunctor="models2.disjunctor" :content="models2.content"
  169. @ok="ok2" @know="know2" @cancel="cancel2" :operate="models2.operate">
  170. </showModel>
  171. </view>
  172. </template>
  173. <script>
  174. import showModel from "../../components/showModel/showModel.vue";
  175. import {
  176. get,
  177. post,
  178. SM,
  179. webHandle
  180. } from "../../http/http.js";
  181. export default {
  182. data() {
  183. return {
  184. SMFlag: true,
  185. // 弹窗model
  186. models: {
  187. disjunctor: false,
  188. },
  189. // 完成扫描弹窗model1
  190. models2: {
  191. disjunctor: false,
  192. },
  193. wcId: "", //工单完成ID
  194. wcFlag: false,
  195. modelFlag: "", //工单完成类型
  196. infoDATA: [],
  197. ids: [],
  198. type: "",
  199. type1: "",
  200. queryObj: {}, //路由传递过来的参数
  201. gotoFlag: true,
  202. speNum: 0,
  203. content:'',
  204. };
  205. },
  206. methods: {
  207. // 查看未扫描标本
  208. getNoScanSpecimen() {
  209. if (!this.gotoFlag) {
  210. return;
  211. }
  212. this.gotoFlag = false;
  213. let id = JSON.parse(this.queryObj.ids)[0];
  214. uni.navigateTo({
  215. url: `../noScanSpecimen/noScanSpecimen?workOrderId=${id}&deptCode=${this.queryObj.deptCode}`,
  216. });
  217. },
  218. // 正常完成扫描
  219. overFinish() {
  220. //完成扫描
  221. let postType = "";
  222. if (
  223. this.queryObj.type1 === "plan-spe-ddd-2" ||
  224. this.queryObj.type1 === "plan-spe-dsd-2" ||
  225. this.queryObj.type1 === "plan-spe-dsd-3"
  226. ) {
  227. postType = "finishPlanSpes";
  228. } else if (this.queryObj.type1 == "spe-ddd-2") {
  229. postType = "finishSpes";
  230. }
  231. let data = {
  232. type: this.queryObj.type1,
  233. ids: this.wcId,
  234. };
  235. uni.showLoading({
  236. title: "加载中",
  237. mask: true,
  238. });
  239. post("/workerOrder/" + postType, data).then((res) => {
  240. if (res.status == 200) {
  241. this.models2 = {
  242. disjunctor: true,
  243. title: "提示",
  244. content: `完成扫描成功`,
  245. icon: "success",
  246. operate: {
  247. know: "知道了",
  248. },
  249. };
  250. } else {
  251. uni.hideLoading();
  252. uni.showToast({
  253. icon: "none",
  254. title: "请求失败!",
  255. });
  256. }
  257. });
  258. },
  259. // 确定
  260. ok() {
  261. this.models.disjunctor = false;
  262. if (this.modelFlag === "complete") {
  263. uni.showLoading({
  264. title: "加载中",
  265. mask: true,
  266. });
  267. let id = JSON.parse(this.queryObj.ids)[0];
  268. let postData = {
  269. ids: [id],
  270. sign: true,
  271. deptQrCode: this.queryObj.deptCode
  272. };
  273. post("/workerOrder/expectedAndActual", postData).then((ress) => {
  274. uni.hideLoading();
  275. if (ress.status == 200) {
  276. if (this.wcFlag) {
  277. //正常完成扫描
  278. this.overFinish()
  279. } else {
  280. this.gotoOver();
  281. }
  282. } else if (ress.status == 1000035) {
  283. let content = '';
  284. if (this.queryObj.type1 === 'spe-ddd-2' || this.queryObj.type1 === 'plan-spe-ddd-2') {
  285. //待到达
  286. content =
  287. `系统内预计标本<strong class="red">${ress.expectReceiveNum}</strong>只,您扫描收取标本<strong class="red">${ress.actualReceiveNum}</strong>只,其中<strong class="red">${ress.notReceiveNum}</strong>只未扫描;`;
  288. } else {
  289. //待送达
  290. this.content =
  291. `本工单已签到<strong class="red">${ress.scanSet?ress.scanSet.join('、'):''}</strong>,剩余需签到科室<strong class="red">${ress.notScanSet?ress.notScanSet.join('、'):''}</strong>,总签收<strong class="red">${ress.totalAcceptance}</strong>只,剩余<strong class="red">${ress.notAcceptance}</strong>只未签收,您确定完成工单吗?`;
  292. content = `您在<strong class="red">${ress.deptName}</strong>检验科扫描了<strong class="red">${ress.deptScanNum}</strong>个标本,还需扫描<strong class="red">${ress.deptNotScanNum}</strong>标本。`;
  293. }
  294. this.models2 = {
  295. disjunctor: true,
  296. title: "提示",
  297. content,
  298. icon: "warn",
  299. operate: {
  300. ok: "确定",
  301. cancel: "取消",
  302. },
  303. };
  304. } else {
  305. uni.showToast({
  306. icon: "none",
  307. title: "请求失败!",
  308. });
  309. }
  310. });
  311. } else if (this.modelFlag === "complete1") {
  312. //1对1标本完成工单
  313. let ids = this.wcId;
  314. uni.showLoading({
  315. title: "加载中",
  316. mask: true,
  317. });
  318. post("/workerOrder/finishSpeOrder", ids).then((res) => {
  319. if (res.status == 200) {
  320. uni.reLaunch({
  321. url: "../receiptpage/receiptpage",
  322. });
  323. } else {
  324. uni.hideLoading();
  325. uni.showToast({
  326. icon: "none",
  327. title: "请求失败!",
  328. });
  329. }
  330. });
  331. }
  332. },
  333. // 取消
  334. cancel() {
  335. this.models.disjunctor = false;
  336. },
  337. // 确定
  338. ok2() {
  339. this.models2.disjunctor = false;
  340. let id = JSON.parse(this.queryObj.ids)[0];
  341. let postData = {
  342. ids: [id],
  343. deptQrCode: this.queryObj.deptCode
  344. };
  345. uni.showLoading({
  346. title: "加载中",
  347. mask: true,
  348. });
  349. post("/workerOrder/expectedAndActual", postData).then((ress) => {
  350. uni.hideLoading();
  351. if (ress.status == 200) {
  352. if (this.wcFlag) {
  353. this.overFinish()
  354. } else {
  355. this.gotoOver();
  356. }
  357. } else {
  358. uni.showToast({
  359. icon: "none",
  360. title: "请求失败!",
  361. });
  362. }
  363. });
  364. },
  365. // 取消
  366. cancel2() {
  367. this.models2.disjunctor = false;
  368. },
  369. know2() {
  370. this.models2.disjunctor = false;
  371. uni.reLaunch({
  372. url: "../receiptpage/receiptpage",
  373. });
  374. },
  375. //完成扫描
  376. Scanning_complete(id) {
  377. this.modelFlag = "complete";
  378. this.wcId = id;
  379. if (
  380. this.queryObj.type1 == "plan-spe-ddd-2" ||
  381. this.queryObj.type1 == "spe-ddd-2"
  382. ) {
  383. this.wcFlag = true;
  384. this.models = {
  385. disjunctor: true,
  386. title: "提示",
  387. content: "是否确定标本已扫描完成?",
  388. icon: "warn",
  389. operate: {
  390. ok: "确定",
  391. cancel: "取消",
  392. },
  393. };
  394. } else if (
  395. this.queryObj.type1 == "plan-spe-dsd-2" ||
  396. this.queryObj.type1 == "plan-spe-dsd-3" ||
  397. this.queryObj.type1 == "spe-dsd-2" ||
  398. this.queryObj.type1 == "spe-dsd-3"
  399. ) {
  400. this.wcFlag = false;
  401. this.models = {
  402. disjunctor: true,
  403. title: "提示",
  404. content: "是否确定标本已扫描完成?",
  405. icon: "warn",
  406. operate: {
  407. ok: "确定",
  408. cancel: "取消",
  409. },
  410. };
  411. } else {
  412. this.gotoOver();
  413. }
  414. },
  415. // 跳转完成工单页面
  416. gotoOver() {
  417. uni.navigateTo({
  418. url: `../scanning/scanning?type=${this.queryObj.type}&type1=${
  419. this.queryObj.type1
  420. }&deptCode=${this.queryObj.code}&dept=${
  421. this.queryObj.dept
  422. }&id=${encodeURIComponent(JSON.stringify(this.wcId))}&content=${this.content}`,
  423. });
  424. },
  425. //一对一完成工单
  426. Scanning_complete1(id) {
  427. this.modelFlag = "complete1";
  428. this.wcId = id;
  429. this.models = {
  430. disjunctor: true,
  431. title: "提示",
  432. content: "是否确定标本配送完成?",
  433. icon: "warn",
  434. operate: {
  435. ok: "确定",
  436. cancel: "取消",
  437. },
  438. };
  439. },
  440. //继续扫描
  441. Scanning_again() {
  442. if (!this.SMFlag) {
  443. return;
  444. }
  445. this.SMFlag = false;
  446. SM().then((ress1) => {
  447. // ----------------
  448. //检验二维码的有效性
  449. post("/dept/scanning", {
  450. content: ress1,
  451. }).then((result) => {
  452. this.SMFlag = true;
  453. if (result.state == 200 || result.state == 201) {
  454. let ress = result.code;
  455. let speCode = ress;
  456. let data = {
  457. code: speCode,
  458. type: this.queryObj.type1,
  459. deptCode: this.code,
  460. ids: this.ids,
  461. };
  462. let postType = "";
  463. if (this.type == "jPBag" || this.type == "drugsBag") {
  464. postType = "handleDrugsAndJp";
  465. }
  466. if (this.type == "specimen") {
  467. postType = "handleSpes";
  468. data["speCode"] = data.code;
  469. delete data.code;
  470. }
  471. if (this.type == "specimenPlan") {
  472. postType = "handlePlanSpes";
  473. data["speCode"] = data.code;
  474. delete data.code;
  475. }
  476. if (this.type == "inspect") {
  477. postType = "handleIns";
  478. }
  479. if (this.type == "patientTransport") {
  480. postType = "handleTrans";
  481. }
  482. post("/workerOrder/" + postType, data).then((ress) => {
  483. if (ress.status == 200) {
  484. this.speNum = ress.specimenCount;
  485. uni.navigateTo({
  486. url: `../scanning_djInfo/scanning_djInfo?type=${
  487. this.queryObj.type
  488. }&type1=${this.queryObj.type1}&infoData=${encodeURIComponent(
  489. JSON.stringify(ress.data)
  490. )}&status=${ress.status}&msg=${ress.msg}&deptCode=${
  491. this.queryObj.code
  492. }&dept=${this.queryObj.dept}&ids=${encodeURIComponent(
  493. JSON.stringify(this.ids)
  494. )}&model=${encodeURIComponent(JSON.stringify(ress))}&speNum=${this.speNum}`,
  495. });
  496. } else {
  497. uni.navigateTo({
  498. url: `../scanning_djInfo/scanning_djInfo?type=${
  499. this.queryObj.type
  500. }&type1=${this.queryObj.type1}&status=${ress.status}&msg=${
  501. ress.msg
  502. }&deptCode=${this.queryObj.code}&dept=${
  503. this.queryObj.dept
  504. }&ids=${encodeURIComponent(
  505. JSON.stringify(this.ids)
  506. )}&infoData=${encodeURIComponent(
  507. JSON.stringify(ress.data)
  508. )}&model=${encodeURIComponent(JSON.stringify(ress))}`,
  509. });
  510. }
  511. });
  512. } else {
  513. uni.showToast({
  514. icon: "none",
  515. title: "请求失败!",
  516. });
  517. }
  518. });
  519. // ------------------------------
  520. }).catch(err => {
  521. this.SMFlag = true;
  522. });
  523. },
  524. // 知道了
  525. showAlert() {
  526. uni.navigateTo({
  527. url: "../receiptpage/receiptpage",
  528. });
  529. },
  530. },
  531. onShow() {
  532. this.SMFlag = true;
  533. this.gotoFlag = true;
  534. },
  535. onLoad(options) {
  536. console.log(options, "djEnd");
  537. if (options.speNum) {
  538. this.speNum = options.speNum;
  539. }
  540. this.queryObj = options;
  541. let list = JSON.parse(options.model); //签到返回的信息
  542. this.code = options.code; //二维码code
  543. this.ids = options.ids && JSON.parse(options.ids); //科室ID数组
  544. this.infoDATA = list;
  545. if (options.type) {
  546. //关联类型
  547. this.type = options.type;
  548. } else {
  549. this.type = list.type;
  550. }
  551. this.type1 = options.type1;
  552. // #ifdef APP-PLUS
  553. webHandle("no", "app");
  554. // #endif
  555. // #ifdef H5
  556. webHandle("no", "wx");
  557. // #endif
  558. },
  559. };
  560. </script>
  561. <style lang="less">
  562. .Scanning_djEnd {
  563. padding: 0px 20rpx;
  564. .Scanning_top {
  565. height: 270rpx;
  566. .Scanning_top_icon {
  567. width: 140rpx;
  568. height: 140rpx;
  569. margin: 0 auto;
  570. // margin-top: 116rpx;
  571. border-radius: 50%;
  572. line-height: 140rpx;
  573. .cubeic-ok {
  574. font-size: 140rpx;
  575. color: #35b34a;
  576. }
  577. .cubeic-close {
  578. font-size: 140rpx;
  579. color: #ff3b53;
  580. }
  581. }
  582. .Scanning_top_text {
  583. .text1 {
  584. margin-top: 40rpx;
  585. font-size: 48rpx;
  586. text-align: center;
  587. }
  588. }
  589. }
  590. .Scanning_cont {
  591. font-size: 32rpx;
  592. text-align: center;
  593. view {
  594. margin-bottom: 16rpx;
  595. }
  596. .text {
  597. margin-top: 24rpx;
  598. color: #35b34a;
  599. }
  600. .text1 {
  601. margin-top: 24rpx;
  602. color: #ff3b53;
  603. }
  604. }
  605. .foot_btn {
  606. line-height: 88rpx;
  607. height: 100rpx;
  608. margin-top: 40rpx;
  609. text-align: center;
  610. display: flex;
  611. view {
  612. height: 88rpx;
  613. flex: 1;
  614. margin: 0 1%;
  615. background-image: linear-gradient(to right, #72c172, #3bb197);
  616. color: #fff;
  617. border-radius: 8rpx;
  618. font-size: 32rpx;
  619. margin-top: 16rpx;
  620. }
  621. }
  622. }
  623. </style>