scanning_djEnd.vue 15 KB

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