scanning_djInfo.vue 14 KB

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