scanning_djEnd.vue 14 KB

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