scanning_djEnd.vue 15 KB

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