scanning_djEnd.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  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. if (this.modelFlag === "complete") {
  173. //完成扫描
  174. let postType = "";
  175. if (this.queryObj.type1 == "plan-spe-ddd-2") {
  176. postType = "finishPlanSpes";
  177. } else if (this.queryObj.type1 == "spe-ddd-2") {
  178. postType = "finishSpes";
  179. }
  180. let data = {
  181. type: this.queryObj.type1,
  182. ids: this.wcId,
  183. };
  184. uni.showLoading({
  185. title: '加载中',
  186. mask: true,
  187. });
  188. post("/workerOrder/" + postType, data).then((res) => {
  189. uni.hideLoading();
  190. this.models.disjunctor = false;
  191. if (res.status == 200) {
  192. uni.reLaunch({
  193. url: "../receiptpage/receiptpage",
  194. });
  195. } else {
  196. uni.showToast({
  197. icon: "none",
  198. title: "请求失败!",
  199. });
  200. }
  201. });
  202. } else if (this.modelFlag === "complete1") {
  203. //1对1标本完成工单
  204. let ids = this.wcId;
  205. uni.showLoading({
  206. title: '加载中',
  207. mask: true,
  208. });
  209. post("/workerOrder/finishSpeOrder", ids).then((res) => {
  210. uni.hideLoading();
  211. this.models.disjunctor = false;
  212. if (res.status == 200) {
  213. uni.reLaunch({
  214. url: "../receiptpage/receiptpage",
  215. });
  216. } else {
  217. uni.showToast({
  218. icon: "none",
  219. title: "请求失败!",
  220. });
  221. }
  222. });
  223. }
  224. },
  225. // 取消
  226. cancel() {
  227. this.models.disjunctor = false;
  228. },
  229. //完成扫描
  230. Scanning_complete(id) {
  231. this.modelFlag = "complete";
  232. if (
  233. this.queryObj.type1 == "plan-spe-ddd-2" ||
  234. this.queryObj.type1 == "spe-ddd-2"
  235. ) {
  236. this.wcId = id;
  237. this.models = {
  238. disjunctor: true,
  239. title: "提示",
  240. content: "是否确定标本已扫描完成?",
  241. icon: "warn",
  242. operate: {
  243. ok: "确定",
  244. cancel: "取消",
  245. },
  246. };
  247. } else {
  248. uni.navigateTo({
  249. url: `../scanning/scanning?type=${this.queryObj.type}&type1=${
  250. this.queryObj.type1
  251. }&deptCode=${this.queryObj.code}&dept=${
  252. this.queryObj.dept
  253. }&id=${encodeURIComponent(JSON.stringify(this.ids))}`,
  254. });
  255. }
  256. },
  257. //一对一完成工单
  258. Scanning_complete1(id) {
  259. this.modelFlag = "complete1";
  260. this.wcId = id;
  261. this.models = {
  262. disjunctor: true,
  263. title: "提示",
  264. content: "是否确定标本配送完成?",
  265. icon: "warn",
  266. operate: {
  267. ok: "确定",
  268. cancel: "取消",
  269. },
  270. };
  271. },
  272. //继续扫描
  273. Scanning_again() {
  274. SM().then((ress1) => {
  275. // ----------------
  276. //检验二维码的有效性
  277. post("/dept/scanning", {
  278. content: ress1,
  279. }).then((result) => {
  280. if (result.state == 200 || result.state == 201) {
  281. let ress = result.code;
  282. let speCode = ress;
  283. let data = {
  284. code: speCode,
  285. type: this.queryObj.type1,
  286. deptCode: this.code,
  287. ids: this.ids,
  288. };
  289. let postType = "";
  290. if (this.type == "jPBag" || this.type == "drugsBag") {
  291. postType = "handleDrugsAndJp";
  292. }
  293. if (this.type == "specimen") {
  294. postType = "handleSpes";
  295. data["speCode"] = data.code;
  296. delete data.code;
  297. }
  298. if (this.type == "specimenPlan") {
  299. postType = "handlePlanSpes";
  300. data["speCode"] = data.code;
  301. delete data.code;
  302. }
  303. if (this.type == "inspect") {
  304. postType = "handleIns";
  305. }
  306. if (this.type == "patientTransport") {
  307. postType = "handleTrans";
  308. }
  309. post("/workerOrder/" + postType, data).then((ress) => {
  310. if (ress.status == 200) {
  311. this.speNum++;
  312. uni.navigateTo({
  313. url: `../scanning_djInfo/scanning_djInfo?type=${
  314. this.queryObj.type
  315. }&type1=${this.queryObj.type1}&infoData=${encodeURIComponent(
  316. JSON.stringify(ress.data)
  317. )}&status=${ress.status}&msg=${ress.msg}&deptCode=${
  318. this.queryObj.code
  319. }&dept=${this.queryObj.dept}&ids=${encodeURIComponent(
  320. JSON.stringify(this.ids)
  321. )}&speNum=${this.speNum}&model=${encodeURIComponent(
  322. JSON.stringify(ress)
  323. )}`,
  324. });
  325. uni.setStorageSync("speNum", this.speNum);
  326. } else {
  327. uni.navigateTo({
  328. url: `../scanning_djInfo/scanning_djInfo?type=${
  329. this.queryObj.type
  330. }&type1=${this.queryObj.type1}&status=${ress.status}&msg=${
  331. ress.msg
  332. }&deptCode=${this.queryObj.code}&dept=${
  333. this.queryObj.dept
  334. }&ids=${encodeURIComponent(
  335. JSON.stringify(this.ids)
  336. )}&speNum=${this.speNum}&infoData=${encodeURIComponent(
  337. JSON.stringify(ress.data)
  338. )}&model=${encodeURIComponent(JSON.stringify(ress))}`,
  339. });
  340. }
  341. });
  342. } else {
  343. uni.showToast({
  344. icon: "none",
  345. title: "请求失败!",
  346. });
  347. }
  348. });
  349. // ------------------------------
  350. });
  351. },
  352. // 知道了
  353. showAlert() {
  354. uni.navigateTo({
  355. url: "../receiptpage/receiptpage",
  356. });
  357. },
  358. },
  359. onLoad(options) {
  360. console.log(options, "djEnd");
  361. this.queryObj = options;
  362. let list = JSON.parse(options.model); //签到返回的信息
  363. this.code = options.code; //二维码code
  364. this.ids = options.ids && JSON.parse(options.ids); //科室ID数组
  365. this.infoDATA = list;
  366. if (options.type) {
  367. //关联类型
  368. this.type = options.type;
  369. } else {
  370. this.type = list.type;
  371. }
  372. this.type1 = options.type1;
  373. if (options.speNum) {
  374. this.speNum = options.speNum;
  375. } else {
  376. this.speNumLocal = uni.getStorageSync("speNum");
  377. // 本地存在speNum的时候
  378. if (this.speNumLocal) {
  379. this.speNum = Number(this.speNumLocal);
  380. }
  381. }
  382. // #ifdef APP-PLUS
  383. webHandle("no", "app");
  384. // #endif
  385. // #ifdef H5
  386. webHandle("no", "wx");
  387. // #endif
  388. },
  389. };
  390. </script>
  391. <style lang="less">
  392. .Scanning_djEnd {
  393. padding: 0px 74rpx;
  394. .Scanning_top {
  395. height: 270rpx;
  396. .Scanning_top_icon {
  397. width: 140rpx;
  398. height: 140rpx;
  399. margin: 0 auto;
  400. // margin-top: 116rpx;
  401. border-radius: 50%;
  402. line-height: 140rpx;
  403. .cubeic-ok {
  404. font-size: 140rpx;
  405. color: #35b34a;
  406. }
  407. .cubeic-close {
  408. font-size: 140rpx;
  409. color: #ff3b53;
  410. }
  411. }
  412. .Scanning_top_text {
  413. .text1 {
  414. margin-top: 40rpx;
  415. font-size: 48rpx;
  416. text-align: center;
  417. }
  418. }
  419. }
  420. .Scanning_cont {
  421. font-size: 32rpx;
  422. text-align: center;
  423. view {
  424. margin-bottom: 16rpx;
  425. }
  426. .text {
  427. margin-top: 24rpx;
  428. color: #35b34a;
  429. }
  430. .text1 {
  431. margin-top: 24rpx;
  432. color: #ff3b53;
  433. }
  434. }
  435. .foot_btn {
  436. line-height: 88rpx;
  437. height: 100rpx;
  438. margin-top: 40rpx;
  439. text-align: center;
  440. view {
  441. height: 88rpx;
  442. width: 45%;
  443. background-image: linear-gradient(to right, #72c172, #3bb197);
  444. color: #fff;
  445. border-radius: 8rpx;
  446. font-size: 32rpx;
  447. margin-top: 16rpx;
  448. }
  449. .btn1 {
  450. float: left;
  451. }
  452. .btn2 {
  453. float: right;
  454. }
  455. .btn3 {
  456. margin: 0 auto;
  457. }
  458. }
  459. }
  460. </style>