scanning_djEnd.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  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
  12. class="Scanning_top"
  13. v-if="
  14. infoDATA.status == 10005 ||
  15. infoDATA.status == 100018 ||
  16. infoDATA.status == 10004 ||
  17. infoDATA.status == 100021 ||
  18. infoDATA.status == 500 ||
  19. infoDATA.status == 100031
  20. "
  21. >
  22. <view class="Scanning_top_icon">
  23. <text class="cubeic-close icon_transport transport-shibai"></text>
  24. </view>
  25. <view class="Scanning_top_text">
  26. <view class="text1">操作失败</view>
  27. </view>
  28. </view>
  29. <view
  30. class="Scanning_cont"
  31. v-if="
  32. (infoDATA.status == 200 && type == 'specimenPlan') ||
  33. (infoDATA.status == 200 && type == 'specimen')
  34. "
  35. ></view>
  36. <view
  37. class="Scanning_cont"
  38. v-if="
  39. (infoDATA.status == 200 && type == 'patientTransport') ||
  40. (infoDATA.status == 200 && type == 'inspect')
  41. "
  42. >扫描患者腕带并将患者送往目标科室.</view
  43. >
  44. <view
  45. class="Scanning_cont"
  46. v-if="
  47. (infoDATA.status == 200 && type == 'drugsBag') ||
  48. (infoDATA.status == 200 && type == 'jPBag')
  49. "
  50. >已到达目标科室,请扫描药包或静配包.</view
  51. >
  52. <view
  53. class="Scanning_cont"
  54. v-if="
  55. infoDATA.status == 200 && type == 'other' && infoDATA.type == 'qt-ddd-1'
  56. "
  57. >已到达目标科室,请执行该工单.</view
  58. >
  59. <view
  60. class="Scanning_cont"
  61. v-if="
  62. (infoDATA.state == 'finish' &&
  63. infoDATA.status == 200 &&
  64. type == 'specimenPlan' &&
  65. infoDATA.type == 'plan-spe-dsd-1') ||
  66. (infoDATA.status == 200 &&
  67. type == 'other' &&
  68. infoDATA.type == 'qt-dsd-1')
  69. "
  70. >已到达目标科室,工单已完成.</view
  71. >
  72. <view
  73. class="Scanning_cont"
  74. v-if="
  75. (infoDATA.status == 200 &&
  76. type == 'specimenPlan' &&
  77. infoDATA.type != 'plan-spe-ddd-1' &&
  78. infoDATA.type != 'plan-spe-dsd-1') ||
  79. (infoDATA.status == 200 &&
  80. type == 'specimen' &&
  81. infoDATA.type != 'spe-ddd-1' &&
  82. infoDATA.type != 'spe-dsd-1')
  83. "
  84. >已到达目标科室,请扫描标本.</view
  85. >
  86. <view
  87. class="Scanning_cont"
  88. v-if="
  89. (infoDATA.status == 200 &&
  90. type == 'specimenPlan' &&
  91. infoDATA.type == 'plan-spe-ddd-1') ||
  92. (infoDATA.status == 200 &&
  93. type == 'specimen' &&
  94. infoDATA.type == 'spe-ddd-1')
  95. "
  96. >已到达目标科室,请取标本后送达目标科室.</view
  97. >
  98. <view
  99. class="Scanning_cont"
  100. v-if="
  101. (infoDATA.state != 'finish' &&
  102. infoDATA.status == 200 &&
  103. type == 'specimenPlan' &&
  104. infoDATA.type == 'plan-spe-dsd-1') ||
  105. (infoDATA.status == 200 &&
  106. type == 'specimen' &&
  107. infoDATA.type == 'spe-dsd-1')
  108. "
  109. >已到达目标科室,请放置标本完成该工单.</view
  110. >
  111. <view class="Scanning_cont" v-if="infoDATA.status != 200">
  112. <view>{{ infoDATA.msg }}</view>
  113. </view>
  114. <view
  115. class="foot_btn"
  116. v-if="type == 'inspect' || type == 'patientTransport'"
  117. >
  118. <view class="btn3" @click="Scanning_again()">继续扫描</view>
  119. </view>
  120. <view class="foot_btn" v-if="type == 'drugsBag' || type == 'jPBag'">
  121. <view class="btn3" @click="Scanning_again()">继续扫描</view>
  122. </view>
  123. <view
  124. class="foot_btn"
  125. v-if="
  126. (type == 'specimenPlan' &&
  127. type1 != 'plan-spe-dsd-1' &&
  128. (type1 != 'plan-spe-ddd-1') & (type1 != 'plan-spe-ddd-2')) ||
  129. (type == 'specimen' &&
  130. type1 != 'spe-dsd-1' &&
  131. (type1 != 'spe-ddd-1') & (type1 != 'spe-ddd-2'))
  132. "
  133. >
  134. <view class="btn1" @click="Scanning_again()">继续扫描</view>
  135. <view class="btn2" @click="Scanning_complete(ids)">完成扫描</view>
  136. </view>
  137. <view
  138. class="foot_btn"
  139. v-if="
  140. (type == 'specimenPlan' && type1 == 'plan-spe-ddd-2') ||
  141. (type == 'specimen' && type1 == 'spe-ddd-2')
  142. "
  143. >
  144. <view class="btn1" @click="Scanning_again()">继续扫描</view>
  145. <view class="btn2" @click="Scanning_complete(ids)">完成扫描</view>
  146. </view>
  147. <view
  148. class="foot_btn"
  149. v-if="
  150. (infoDATA.state != 'finish' &&
  151. type == 'specimenPlan' &&
  152. type1 == 'plan-spe-dsd-1') ||
  153. (type == 'specimen' && type1 == 'spe-dsd-1')
  154. "
  155. >
  156. <view class="btn1" @click="Scanning_complete1(ids)">完成工单</view>
  157. <view class="btn2" @click="showAlert()">继续配送</view>
  158. </view>
  159. <view
  160. class="foot_btn"
  161. v-if="
  162. infoDATA.status != 200 &&
  163. type != 'specimenPlan' &&
  164. type != 'specimen' &&
  165. type !== 'jPBag' &&
  166. type !== 'inspect' &&
  167. type !== 'drugsBag' &&
  168. type !== 'patientTransport'
  169. "
  170. >
  171. <view class="btn3" @click="showAlert()">知道了</view>
  172. </view>
  173. <view
  174. class="foot_btn"
  175. v-if="
  176. (infoDATA.status == 200 && type1 == 'spe-ddd-1') ||
  177. (infoDATA.status == 200 && type1 == 'plan-spe-ddd-1')
  178. "
  179. >
  180. <view class="btn3" @click="showAlert()">知道了</view>
  181. </view>
  182. <view
  183. class="foot_btn"
  184. v-if="
  185. (infoDATA.state == 'finish' &&
  186. infoDATA.status == 200 &&
  187. type == 'specimenPlan' &&
  188. type1 == 'plan-spe-dsd-1') ||
  189. (infoDATA.status == 200 && type == 'other')
  190. "
  191. >
  192. <view class="btn3" @click="showAlert()">知道了</view>
  193. </view>
  194. <!-- 弹窗 -->
  195. <showModel
  196. :title="models.title"
  197. :icon="models.icon"
  198. :disjunctor="models.disjunctor"
  199. :content="models.content"
  200. @ok="ok"
  201. @cancel="cancel"
  202. :operate="models.operate"
  203. ></showModel>
  204. </view>
  205. </template>
  206. <script>
  207. import showModel from "../../components/showModel/showModel.vue";
  208. import { get, post, SM, webHandle } from "../../http/http.js";
  209. export default {
  210. data() {
  211. return {
  212. // 弹窗model
  213. models: {
  214. disjunctor: false,
  215. },
  216. wcId: "", //工单完成ID
  217. modelFlag: "", //工单完成类型
  218. infoDATA: [],
  219. ids: [],
  220. speNum: 0,
  221. type: "",
  222. type1: "",
  223. queryObj: {}, //路由传递过来的参数
  224. };
  225. },
  226. methods: {
  227. // 确定
  228. ok() {
  229. this.models.disjunctor = false;
  230. if (this.modelFlag === "complete") {
  231. //完成扫描
  232. let postType = "";
  233. if (this.queryObj.type1 == "plan-spe-ddd-2") {
  234. postType = "finishPlanSpes";
  235. } else if (this.queryObj.type1 == "spe-ddd-2") {
  236. postType = "finishSpes";
  237. }
  238. let data = {
  239. type: this.queryObj.type1,
  240. ids: this.wcId,
  241. };
  242. post("/workerOrder/" + postType, data).then((res) => {
  243. if (res.status == 200) {
  244. uni.navigateTo({
  245. url: "../receiptpage/receiptpage",
  246. });
  247. } else {
  248. uni.showToast({
  249. icon: "none",
  250. title: "请求失败!",
  251. });
  252. }
  253. });
  254. } else if (this.modelFlag === "complete1") {
  255. //1对1标本完成工单
  256. let ids = this.wcId;
  257. post("/workerOrder/finishSpeOrder", ids).then((res) => {
  258. if (res.status == 200) {
  259. uni.navigateTo({
  260. url: "../receiptpage/receiptpage",
  261. });
  262. } else {
  263. uni.showToast({
  264. icon: "none",
  265. title: "请求失败!",
  266. });
  267. }
  268. });
  269. }
  270. },
  271. // 取消
  272. cancel() {
  273. this.models.disjunctor = false;
  274. },
  275. //完成扫描
  276. Scanning_complete(id) {
  277. this.modelFlag = "complete";
  278. if (
  279. this.queryObj.type1 == "plan-spe-ddd-2" ||
  280. this.queryObj.type1 == "spe-ddd-2"
  281. ) {
  282. this.wcId = id;
  283. this.models = {
  284. disjunctor: true,
  285. title: "提示",
  286. content: "是否确定标本已扫描完成?",
  287. icon: "warn",
  288. operate: {
  289. ok: "确定",
  290. cancel: "取消",
  291. },
  292. };
  293. } else {
  294. uni.navigateTo({
  295. url: `../scanning/scanning?type=${this.queryObj.type}&type1=${
  296. this.queryObj.type1
  297. }&deptCode=${this.queryObj.code}&dept=${
  298. this.queryObj.dept
  299. }&id=${encodeURIComponent(JSON.stringify(this.ids))}`,
  300. });
  301. }
  302. },
  303. //一对一完成工单
  304. Scanning_complete1(id) {
  305. this.modelFlag = "complete1";
  306. this.wcId = id;
  307. this.models = {
  308. disjunctor: true,
  309. title: "提示",
  310. content: "是否确定标本配送完成?",
  311. icon: "warn",
  312. operate: {
  313. ok: "确定",
  314. cancel: "取消",
  315. },
  316. };
  317. },
  318. //继续扫描
  319. Scanning_again() {
  320. SM().then((ress1) => {
  321. // ----------------
  322. //检验二维码的有效性
  323. post("/dept/scanning", {
  324. content: ress1,
  325. }).then((result) => {
  326. if (result.state == 200 || result.state == 201) {
  327. let ress = result.code;
  328. let speCode = ress;
  329. let data = {
  330. code: speCode,
  331. type: this.queryObj.type1,
  332. deptCode: this.code,
  333. ids: this.ids,
  334. };
  335. let postType = "";
  336. if (this.type == "jPBag" || this.type == "drugsBag") {
  337. postType = "handleDrugsAndJp";
  338. }
  339. if (this.type == "specimen") {
  340. postType = "handleSpes";
  341. data["speCode"] = data.code;
  342. delete data.code;
  343. }
  344. if (this.type == "specimenPlan") {
  345. postType = "handlePlanSpes";
  346. data["speCode"] = data.code;
  347. delete data.code;
  348. }
  349. if (this.type == "inspect") {
  350. postType = "handleIns";
  351. }
  352. if (this.type == "patientTransport") {
  353. postType = "handleTrans";
  354. }
  355. post("/workerOrder/" + postType, data).then((ress) => {
  356. if (ress.status == 200) {
  357. this.speNum++;
  358. uni.navigateTo({
  359. url: `../scanning_djInfo/scanning_djInfo?type=${
  360. this.queryObj.type
  361. }&type1=${this.queryObj.type1}&infoData=${encodeURIComponent(
  362. JSON.stringify(ress.data)
  363. )}&status=${ress.status}&msg=${ress.msg}&deptCode=${
  364. this.queryObj.code
  365. }&dept=${this.queryObj.dept}&ids=${encodeURIComponent(
  366. JSON.stringify(this.ids)
  367. )}&speNum=${this.speNum}&model=${encodeURIComponent(
  368. JSON.stringify(ress)
  369. )}`,
  370. });
  371. uni.setStorageSync("speNum", this.speNum);
  372. } else {
  373. uni.navigateTo({
  374. url: `../scanning_djInfo/scanning_djInfo?type=${
  375. this.queryObj.type
  376. }&type1=${this.queryObj.type1}&status=${ress.status}&msg=${
  377. ress.msg
  378. }&deptCode=${this.queryObj.code}&dept=${
  379. this.queryObj.dept
  380. }&ids=${encodeURIComponent(
  381. JSON.stringify(this.ids)
  382. )}&speNum=${this.speNum}&infoData=${encodeURIComponent(
  383. JSON.stringify(ress.data)
  384. )}&model=${encodeURIComponent(JSON.stringify(ress))}`,
  385. });
  386. }
  387. });
  388. } else {
  389. uni.showToast({
  390. icon: "none",
  391. title: "请求失败!",
  392. });
  393. }
  394. });
  395. // ------------------------------
  396. });
  397. },
  398. // 知道了
  399. showAlert() {
  400. uni.navigateTo({
  401. url: "../receiptpage/receiptpage",
  402. });
  403. },
  404. },
  405. onLoad(options) {
  406. console.log(options, "djEnd");
  407. this.queryObj = options;
  408. let list = JSON.parse(options.model); //签到返回的信息
  409. this.code = options.code; //二维码code
  410. this.ids = options.ids && JSON.parse(options.ids); //科室ID数组
  411. this.infoDATA = list;
  412. if (options.type) {
  413. //关联类型
  414. this.type = options.type;
  415. } else {
  416. this.type = list.type;
  417. }
  418. this.type1 = options.type1;
  419. if (options.speNum) {
  420. this.speNum = options.speNum;
  421. } else {
  422. this.speNumLocal = uni.getStorageSync("speNum");
  423. // 本地存在speNum的时候
  424. if (this.speNumLocal) {
  425. this.speNum = Number(this.speNumLocal);
  426. }
  427. }
  428. // #ifdef APP-PLUS
  429. webHandle("no", "app");
  430. // #endif
  431. // #ifdef H5
  432. webHandle("no", "wx");
  433. // #endif
  434. },
  435. };
  436. </script>
  437. <style lang="less">
  438. .Scanning_djEnd {
  439. padding: 0px 74rpx;
  440. .Scanning_top {
  441. height: 270rpx;
  442. .Scanning_top_icon {
  443. width: 140rpx;
  444. height: 140rpx;
  445. margin: 0 auto;
  446. // margin-top: 116rpx;
  447. border-radius: 50%;
  448. line-height: 140rpx;
  449. .cubeic-ok {
  450. font-size: 140rpx;
  451. color: #35b34a;
  452. }
  453. .cubeic-close {
  454. font-size: 140rpx;
  455. color: #ff3b53;
  456. }
  457. }
  458. .Scanning_top_text {
  459. .text1 {
  460. margin-top: 40rpx;
  461. font-size: 48rpx;
  462. text-align: center;
  463. }
  464. }
  465. }
  466. .Scanning_cont {
  467. font-size: 32rpx;
  468. text-align: center;
  469. view {
  470. margin-bottom: 16rpx;
  471. }
  472. .text {
  473. margin-top: 24rpx;
  474. color: #35b34a;
  475. }
  476. .text1 {
  477. margin-top: 24rpx;
  478. color: #ff3b53;
  479. }
  480. }
  481. .foot_btn {
  482. line-height: 88rpx;
  483. height: 100rpx;
  484. margin-top: 40rpx;
  485. text-align: center;
  486. view {
  487. height: 88rpx;
  488. width: 45%;
  489. background-image: linear-gradient(to right, #72c172, #3bb197);
  490. color: #fff;
  491. border-radius: 8rpx;
  492. font-size: 32rpx;
  493. margin-top: 16rpx;
  494. }
  495. .btn1 {
  496. float: left;
  497. }
  498. .btn2 {
  499. float: right;
  500. }
  501. .btn3 {
  502. margin: 0 auto;
  503. }
  504. }
  505. }
  506. </style>