scanning_B.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965
  1. <template>
  2. <view class="Scanning_B">
  3. <view class="Scanning_top" v-if="res.status == 200 || res.status == 666">
  4. <view class="Scanning_top_icon">
  5. <text class="cubeic-ok newicon newicon-duigou"></text>
  6. </view>
  7. <view class="Scanning_top_text">
  8. <view class="text1" v-if="res.status == 200">扫描成功</view>
  9. <view class="text1" v-else-if="res.status == 666">查询成功</view>
  10. </view>
  11. </view>
  12. <view class="Scanning_top" v-if="res.status != 200 && res.status != 666">
  13. <view class="Scanning_top_icon">
  14. <text class="cubeic-close newicon newicon-shibai"></text>
  15. </view>
  16. <view class="Scanning_top_text">
  17. <view class="text1">扫描失败</view>
  18. </view>
  19. </view>
  20. <view class="Scanning_cont" v-if="res.status == 200 || res.status == 666">
  21. <view>标本类型 : {{ infoDATA.stype.name || "-" }} <text v-if="res.data.tubeType">、</text> {{res.data.tubeType && res.data.tubeType.name}}</view>
  22. <view>标本编码 : {{ infoDATA.scode || "-" }}</view>
  23. <view>标本状态 : <text :class="{ red: res.data.speState && res.data.speState.value == 8 }">{{ res.data.speState ? res.data.speState.name : "-" }}</text></view>
  24. <view>申请科室 : {{ infoDATA.sickRoom || "-" }}</view>
  25. <view>检验科室 : {{ infoDATA.checkDept || "-" }}</view>
  26. <view>检验项目 : {{ res.data.specimenDesc || "-" }}</view>
  27. <view>患者姓名 : {{ res.data.patientName}}<text v-if="res.data.bedNum">({{res.data.bedNum}})</text></view>
  28. <view v-if="res.data.residenceNo">住院号 : {{ res.data.residenceNo }}</view>
  29. <view v-else-if="res.data.patientNo">门诊号 : {{ res.data.patientNo }}</view>
  30. </view>
  31. <view class="Scanning_cont" v-else>
  32. <view>{{ res.msg }}</view>
  33. </view>
  34. <view class="foot_btn">
  35. <view class="btn3" @click="showAlert()">返回</view>
  36. <block v-if="res.data && res.data.speState && res.data.speState.value != 8">
  37. <!-- 1, 支持待到达本人,显示接单签到按钮 -->
  38. <!-- 1, 匹配到单子待接单,显示接单签到按钮 -->
  39. <!-- 2, 支持待到达非本人,显示接单签到按钮 -->
  40. <view class="btn3" @click="buildAndOrderSign(res.data.id,res.workOrder.id)" v-if="(bigScanShowSignBtn && res.workOrder && res.workOrder.worker && res.workOrder.gdState.value == 4 && loginUser.id == res.workOrder.worker.id) || (bigScanShowSignBtn && res.workOrder && (res.workOrder.gdState.value == 2 || res.workOrder.gdState.value == 3)) || (bigScanArriveNotOwner && res.workOrder && res.workOrder.worker && res.workOrder.gdState.value == 4 && loginUser.id != res.workOrder.worker.id)">接单并签到</view>
  41. <!-- 没有匹配到单子,显示建单并签到按钮 -->
  42. <view class="btn3" @click="buildAndOrderSign(res.data.id)" v-if="bigScanShowCreateBtn && !res.workOrder">建单并签到</view>
  43. </block>
  44. <view class="btn3" @click="back(res.data,res.data.gdid)"
  45. v-if="res.data && res.data.speState&&(res.data.speState.value == 2||res.data.speState.value == 3||res.data.speState.value == 4||res.data.speState.value == 5)">
  46. 退回</view>
  47. </view>
  48. <!-- 填写交接人工号弹窗 -->
  49. <selectAccount v-if="hosModels.disjunctor" :disjunctor="hosModels.disjunctor" @ok="hosOk"
  50. @cancel="hosCancel">
  51. </selectAccount>
  52. <!-- 退回弹窗 -->
  53. <backModel v-if="backModels.disjunctor" :title="backModels.title" :disjunctor="backModels.disjunctor" @ok="backOk"
  54. @cancel="backCancel">
  55. </backModel>
  56. <!-- 弹窗 -->
  57. <showModel :title="models.title" :icon="models.icon" :disjunctor="models.disjunctor" :content="models.content"
  58. :operate="models.operate" @know="know"></showModel>
  59. <b></b>
  60. <!-- 标本第一次拦截 -->
  61. <uni-popup ref="alertDialog" type="dialog" :mask-click="false">
  62. <uni-popup-dialog type="info" cancelText="否" confirmText="是" title="提示" @confirm="dialogConfirm"
  63. @close="dialogClose">
  64. <text v-html="speContent"></text>
  65. </uni-popup-dialog>
  66. </uni-popup>
  67. <!-- 填写交接人工号弹窗 -->
  68. <selectAccount @click.stop.native v-if="hosModels1.disjunctor" :disjunctor="hosModels1.disjunctor" @ok="hosOk1" @cancel="hosCancel1"></selectAccount>
  69. </view>
  70. </template>
  71. <script>
  72. import {
  73. SM,
  74. get,
  75. post,
  76. webHandle
  77. } from "../../http/http.js";
  78. export default {
  79. data() {
  80. return {
  81. SMFlag:true,
  82. extraData: {},
  83. loginUser: uni.getStorageSync("userData").user,
  84. bigScanShowSignBtn: false,//显示接单签到按钮或待到达本人
  85. bigScanArriveNotOwner: false,//支持待到达非本人
  86. bigScanShowCreateBtn: false,//显示建单并签到按钮
  87. defaultScanSpe: false,//默认扫描标本进入标本扫描页
  88. backParams: {},
  89. workOrderId: 0,
  90. // 弹窗model
  91. models: {
  92. disjunctor: false,
  93. },
  94. backSpecimen: {},
  95. backStatus: '',
  96. infoDATA: {},
  97. res: {},
  98. // 填写交接人工号弹窗model
  99. hosModels: {
  100. disjunctor: false,
  101. },
  102. // 填写交接人工号弹窗model
  103. hosModels1: {
  104. disjunctor: false,
  105. },
  106. // 退回弹窗model
  107. backModels: {
  108. disjunctor: false,
  109. },
  110. currentCode: "",
  111. type: "", //类型,orderSign|buildAndOrderSign
  112. speCollectLimit:null,
  113. speStartCollectShowConfig:null,
  114. speContent:null,
  115. speData:null
  116. };
  117. },
  118. methods: {
  119. // 如果不是患者陪检或患者转运或其他
  120. // 科室签到
  121. nextDeptOrder_s(data, accountObj) {
  122. console.log(data, accountObj);
  123. let ids = [];
  124. let id = data.id;
  125. ids.push(id);
  126. let code = "";
  127. let postData = {
  128. ids,
  129. };
  130. if (this.type === 'buildAndOrderSign' || this.type === 'specimenAssignAndSign') {
  131. postData.specimenOrderSign = data.specimenSet.map(v => v.id); //破坏性,必须扫标本
  132. }
  133. if (accountObj) {
  134. postData.handover = [accountObj.accountId];
  135. }
  136. if (this.currentCode) {
  137. code = this.currentCode;
  138. // 科室签到
  139. post("/workerOrder/orderSign/" + code, postData).then((res) => {
  140. uni.hideLoading();
  141. if (res.status == 200) {
  142. // 跳转到扫描科室
  143. // type1: res.type, //type类型
  144. // id: data.id, //工单ID
  145. // deptCode: code, //二维码
  146. // dept: res.dept //科室名称
  147. uni.navigateTo({
  148. url: `/pages/scanning_code/scanning_code?type=${
  149. data.taskType.associationType.value
  150. }&type1=${res.type}&id=${data.id}&deptCode=${code}&dept=${
  151. res.dept
  152. }&accountObj=${encodeURIComponent(
  153. JSON.stringify(accountObj)
  154. )}&deptId=${res.deptId}&specimenId=${res.specimenId}&fromSpecimenBuild=1`,
  155. });
  156. } else {
  157. uni.navigateTo({
  158. url: `/pages/scanning_Result/scanning_Result?type=${data.taskType.associationType.value}&type1=${res.type}&id=${data.id}&status=600&msg=${res.msg}&isKs=1&qrcode=${this.currentCode}`,
  159. });
  160. }
  161. });
  162. }
  163. },
  164. // 退回
  165. back(specimen, workOrderId) {
  166. this.backSpecimen = specimen;
  167. this.backStatus = 'back';
  168. this.workOrderId = workOrderId;
  169. this.showBack();
  170. },
  171. // 执行工单
  172. // orderSign(workOrder) {
  173. // this.type = 'orderSign';
  174. // uni.showModal({
  175. // title: '提示',
  176. // content: '是否执行工单?',
  177. // success: (res) => {
  178. // if (res.confirm) {
  179. // console.log('用户点击确定');
  180. // uni.showLoading({
  181. // title: "加载中",
  182. // mask: true,
  183. // });
  184. // let postData = {
  185. // content: workOrder.startDept.qrcode,
  186. // taskTypeId: workOrder.taskType.id,
  187. // gdState: workOrder.gdState.id,
  188. // };
  189. // //检验二维码的有效性
  190. // post("/dept/scanning", postData).then((result) => {
  191. // this.currentCode = result.code;
  192. // if (result.state == 200 || result.state == 201) {
  193. // if (result.account) {
  194. // this.nextDeptOrder_s(workOrder, {
  195. // account: result.account,
  196. // accountName: result.name,
  197. // accountId: result.id,
  198. // });
  199. // } else {
  200. // this.nextDeptOrder_s(workOrder);
  201. // }
  202. // } else if (result.state == "0000") {
  203. // uni.hideLoading();
  204. // this.showSelectAccount();
  205. // } else {
  206. // uni.hideLoading();
  207. // uni.showToast({
  208. // icon: "none",
  209. // title: result.info || "接口获取数据失败!",
  210. // });
  211. // }
  212. // });
  213. // } else if (res.cancel) {
  214. // console.log('用户点击取消');
  215. // }
  216. // }
  217. // });
  218. // },
  219. // 接单并签到或建单并签到
  220. buildAndOrderSign(speId, orderId) {
  221. this.type = 'buildAndOrderSign';
  222. if (orderId) {
  223. // 接单并签到
  224. this.type = 'specimenAssignAndSign';
  225. } else {
  226. // 建单并签到
  227. this.type = 'buildAndOrderSign';
  228. }
  229. uni.showModal({
  230. title: '提示',
  231. content: `是否${this.type == 'specimenAssignAndSign'?'接单并签到':'建单并签到'}?`,
  232. success: (res) => {
  233. if (res.confirm) {
  234. console.log('用户点击确定');
  235. uni.showLoading({
  236. title: "加载中",
  237. mask: true,
  238. });
  239. let postData = {
  240. speId,
  241. speVerifyType:null
  242. }
  243. if (orderId) {
  244. // 接单并签到
  245. postData.orderId = orderId;
  246. }
  247. if(this.speData){
  248. postData.speVerifyType = this.speData.speVerifyType
  249. }else{
  250. delete postData.speVerifyType
  251. }
  252. post("/workerOrder/specimenCreateAndSign", postData).then((res) => {
  253. this.speContent = null
  254. this.speData = null
  255. if (res.state == 200 || res.state == 201) {
  256. uni.hideLoading();
  257. this.$refs.alertDialog.close()
  258. if (res.status == 200) {
  259. // 跳转到扫描科室
  260. // type1: res.type, //type类型
  261. // id: data.id, //工单ID
  262. // deptCode: code, //二维码
  263. // dept: res.dept //科室名称
  264. // uni.navigateTo({
  265. // url: `/pages/scanning_code/scanning_code?type=${
  266. // res.workOrder.taskType.associationType.value
  267. // }&type1=${res.type}&id=${res.workOrder.id}&deptCode=${
  268. // this.currentCode
  269. // }&dept=${res.dept}&accountObj=${encodeURIComponent(
  270. // JSON.stringify(undefined)
  271. // )}&deptId=${res.deptId}&specimenId=${speId}&fromSpecimenBuild=1`,
  272. // });
  273. this.breforeJump(res);
  274. } else {
  275. uni.navigateTo({
  276. url: `/pages/scanning_Result/scanning_Result?type=${res.workOrder.taskType.associationType.value}&type1=${res.type}&id=${res.workOrder.id}&status=600&msg=${res.msg}&isKs=1`,
  277. });
  278. }
  279. } else if (res.state == "0000") {
  280. this.$refs.alertDialog.close()
  281. uni.hideLoading();
  282. this.currentCode = res.code;
  283. this.res.workOrder = res.workOrder;
  284. this.showSelectAccount();
  285. } else if(res.status == 515){
  286. uni.hideLoading();
  287. this.$refs.alertDialog.open()
  288. this.speContent = res.msg
  289. this.speData = res
  290. } else {
  291. uni.hideLoading();
  292. uni.showToast({
  293. icon: "none",
  294. title: res.msg || "接口获取数据失败!",
  295. });
  296. }
  297. });
  298. } else if (res.cancel) {
  299. console.log('用户点击取消');
  300. }
  301. }
  302. });
  303. },
  304. dialogConfirm() {
  305. uni.showLoading({
  306. title: "加载中",
  307. mask: true,
  308. });
  309. let postData = {
  310. orderId: null,
  311. speId: this.speData.data.id,
  312. speVerifyType:null
  313. }
  314. if (this.res.workOrder) {
  315. // 接单并签到
  316. postData.orderId = this.res.workOrder.id;
  317. }else{
  318. delete postData.orderId
  319. }
  320. if(this.speData){
  321. postData.speVerifyType = this.speData.speVerifyType
  322. }else{
  323. delete postData.speVerifyType
  324. }
  325. post("/workerOrder/specimenCreateAndSign", postData).then((res) => {
  326. this.speContent = null
  327. this.speData = null
  328. if (res.state == 200 || res.state == 201) {
  329. this.$refs.alertDialog.close()
  330. uni.hideLoading();
  331. if (res.status == 200) {
  332. this.breforeJump(res);
  333. } else {
  334. uni.navigateTo({
  335. url: `/pages/scanning_Result/scanning_Result?type=${res.workOrder.taskType.associationType.value}&type1=${res.type}&id=${res.workOrder.id}&status=600&msg=${res.msg}&isKs=1`,
  336. });
  337. }
  338. } else if (res.state == "0000") {
  339. this.$refs.alertDialog.close()
  340. uni.hideLoading();
  341. this.currentCode = res.code;
  342. this.res.workOrder = res.workOrder;
  343. this.showSelectAccount();
  344. } else if(res.status == 515){
  345. uni.hideLoading();
  346. this.$refs.alertDialog.open()
  347. this.speContent = res.msg
  348. this.speData = res
  349. } else {
  350. uni.hideLoading();
  351. uni.showToast({
  352. icon: "none",
  353. title: res.msg || "接口获取数据失败!",
  354. });
  355. }
  356. });
  357. },
  358. dialogClose() {
  359. this.$refs.alertDialog.close()
  360. this.speContent = null
  361. this.speData = null
  362. },
  363. know() {
  364. this.models.disjunctor = false;
  365. if (this.models.icon === 'success') {
  366. uni.navigateTo({
  367. url: "../receiptpage/receiptpage",
  368. });
  369. }
  370. },
  371. // ==================填写工号 start===============
  372. // 填写交接人工号-确认
  373. hosOk1(data) {
  374. console.log(data);
  375. const {
  376. accountName,
  377. account,
  378. accountId
  379. } = data;
  380. if (!accountName && !account) {
  381. //没有填写交接人
  382. uni.showModal({
  383. title: "提示",
  384. content: "请填写交接人工号!",
  385. showCancel: false,
  386. success: function(res) {
  387. if (res.confirm) {
  388. console.log("用户点击确定");
  389. } else if (res.cancel) {
  390. console.log("用户点击取消");
  391. }
  392. },
  393. });
  394. return;
  395. } else if ((!accountName && account) || (accountName && !account)) {
  396. //没有填写交接人
  397. uni.showModal({
  398. title: "提示",
  399. content: "请填写正确的交接人工号!",
  400. showCancel: false,
  401. success: function(res) {
  402. if (res.confirm) {
  403. console.log("用户点击确定");
  404. } else if (res.cancel) {
  405. console.log("用户点击取消");
  406. }
  407. },
  408. });
  409. return;
  410. }
  411. this.hosModels1.disjunctor = false;
  412. this.validateAccount1(data);
  413. },
  414. // 填写交接人工号-取消
  415. hosCancel1() {
  416. this.hosModels1.disjunctor = false;
  417. this.flag = true;
  418. },
  419. // 填写交接人工号弹窗
  420. showSelectAccount1() {
  421. this.hosModels1 = {
  422. disjunctor: true,
  423. };
  424. },
  425. // 手动填写工号校验
  426. validateAccount1(accountObj){
  427. const { accountName, account, accountId } = accountObj;
  428. this.backHandlerAfter(this.extraData.specimen, this.extraData.workorderId, accountObj)
  429. },
  430. // ==================填写工号 end===============
  431. // 扫科室码
  432. scanDeptCode(){
  433. if (!this.SMFlag) {
  434. return;
  435. }
  436. this.SMFlag = false;
  437. SM().then((content) => {
  438. this.SMFlag = true;
  439. this.backHandlerAfter(this.extraData.specimen, this.extraData.workorderId, this.extraData.data, content)
  440. }).catch(err => {
  441. this.SMFlag = true;
  442. });
  443. },
  444. // 退回接口调用前查询验证方式
  445. backHandler(specimen, workorderId, data){
  446. this.extraData = {
  447. specimen,
  448. workorderId,
  449. data,
  450. }
  451. console.log(this.backParams);
  452. // extra7 验证方式 0无 1科室码 2动态码 3 填写工号
  453. if(this.backParams.reasonForReturn.extra7 == 1){
  454. // 科室码
  455. this.scanDeptCode();
  456. }else if(this.backParams.reasonForReturn.extra7 == 2){
  457. // 动态码
  458. this.scanDeptCode();
  459. }else if(this.backParams.reasonForReturn.extra7 == 3){
  460. // 填写工号
  461. this.showSelectAccount1();
  462. }else{
  463. // 无
  464. this.backHandlerAfter(specimen, workorderId, data)
  465. }
  466. },
  467. // 退回
  468. backHandlerAfter(specimen, workorderId, data, deptCode) {
  469. console.log(specimen, workorderId, data, deptCode);
  470. const {
  471. reasonForReturn,
  472. remarks,
  473. } = this.backParams;
  474. uni.showLoading({
  475. title: '加载中',
  476. mask: true
  477. })
  478. let postData = {
  479. reasonForReturn: reasonForReturn.id,
  480. remarks,
  481. scode: specimen.scode,
  482. hosId: uni.getStorageSync("userData").user.currentHospital.id,
  483. speState: specimen.speState ? specimen.speState.id : undefined,
  484. handoverId: data ? data.accountId : undefined,
  485. handoverName: data ? data.accountName : undefined,
  486. gdId: workorderId || undefined,
  487. deptCode: deptCode || undefined,
  488. }
  489. post('/workerOrder/returnSpecimen', postData).then(res => {
  490. uni.hideLoading();
  491. if (res.state == 200) {
  492. this.models = {
  493. disjunctor: true,
  494. title: "提示",
  495. content: `标本退回成功`,
  496. icon: "success",
  497. };
  498. } else {
  499. this.models = {
  500. disjunctor: true,
  501. title: "提示",
  502. content: res.msg || `标本退回失败`,
  503. icon: "error",
  504. };
  505. }
  506. })
  507. },
  508. // 填写交接人工号-确认
  509. hosOk(data) {
  510. console.log(data);
  511. const {
  512. accountName,
  513. account,
  514. accountId
  515. } = data;
  516. if (!accountName && !account) {
  517. //没有填写交接人
  518. uni.showModal({
  519. title: "提示",
  520. content: "请填写交接人工号!",
  521. showCancel: false,
  522. success: function(res) {
  523. if (res.confirm) {
  524. console.log("用户点击确定");
  525. } else if (res.cancel) {
  526. console.log("用户点击取消");
  527. }
  528. },
  529. });
  530. return;
  531. } else if ((!accountName && account) || (accountName && !account)) {
  532. //没有填写交接人
  533. uni.showModal({
  534. title: "提示",
  535. content: "请填写正确的交接人工号!",
  536. showCancel: false,
  537. success: function(res) {
  538. if (res.confirm) {
  539. console.log("用户点击确定");
  540. } else if (res.cancel) {
  541. console.log("用户点击取消");
  542. }
  543. },
  544. });
  545. return;
  546. }
  547. this.hosModels.disjunctor = false;
  548. uni.showLoading({
  549. title: "加载中",
  550. mask: true,
  551. });
  552. if (this.backStatus = 'back') {
  553. // 退回
  554. this.backHandler(this.backSpecimen, this.res.data.gdid, data);
  555. } else {
  556. this.nextDeptOrder_s(this.res.workOrder, data);
  557. }
  558. },
  559. // 填写交接人工号-取消
  560. hosCancel() {
  561. this.hosModels.disjunctor = false;
  562. },
  563. // 填写交接人工号弹窗
  564. showSelectAccount() {
  565. this.hosModels = {
  566. disjunctor: true,
  567. };
  568. },
  569. // 返回
  570. showAlert() {
  571. uni.navigateTo({
  572. url: "../receiptpage/receiptpage",
  573. });
  574. },
  575. // 退回-确认
  576. backOk(data) {
  577. console.log(data);
  578. this.backParams = data;
  579. this.hosModels.disjunctor = false;
  580. // ====================================
  581. uni.showLoading({
  582. title: "加载中",
  583. mask: true,
  584. });
  585. const userData = uni.getStorageSync("userData");
  586. // 查询标本配送业务
  587. post("/simple/data/fetchDataList/taskType",{
  588. "idx": 0,
  589. "sum": 10,
  590. "taskType": {
  591. "simpleQuery": true,
  592. "hosId": {
  593. "id": userData.user.currentHospital.id
  594. },
  595. "associationType": {
  596. "key": "association_types",
  597. "value": "specimen"
  598. }
  599. }
  600. }).then((res) => {
  601. if (res.status == 200) {
  602. let taskTypeDTO = res.list[0];
  603. if(taskTypeDTO){
  604. // 查询业务页面控制-标本
  605. post("/simple/data/fetchDataList/taskTypeConfig",{
  606. "idx": 0,
  607. "sum": 10,
  608. "taskTypeConfig": {
  609. taskTypeDTO,
  610. }
  611. }).then((res) => {
  612. uni.hideLoading();
  613. if (res.status == 200) {
  614. let data = res.list[0];
  615. if(data){
  616. if (data.returnSpecimenWhetherHandover == 1 && this.backParams.reasonForReturn.extra1 == 1) {
  617. this.backCancel();
  618. this.showSelectAccount();
  619. } else {
  620. this.backHandler(this.backSpecimen, this.workOrderId);
  621. }
  622. }else{
  623. this.backHandler(this.backSpecimen, this.workOrderId);
  624. }
  625. } else {
  626. uni.showToast({
  627. icon: "none",
  628. title: res.msg || "接口获取数据失败!",
  629. });
  630. }
  631. });
  632. }else{
  633. uni.hideLoading();
  634. uni.showToast({
  635. icon: "none",
  636. title: "未查询到标本配送业务!",
  637. });
  638. }
  639. } else {
  640. uni.hideLoading();
  641. uni.showToast({
  642. icon: "none",
  643. title: res.msg || "接口获取数据失败!",
  644. });
  645. }
  646. });
  647. // ====================================
  648. },
  649. // 退回-取消
  650. backCancel() {
  651. this.backStatus = '';
  652. this.backModels.disjunctor = false;
  653. },
  654. // 退回弹窗
  655. showBack() {
  656. this.backModels = {
  657. title: "退回",
  658. disjunctor: true,
  659. };
  660. },
  661. // 页面控制-标本
  662. getPageConfigSpecimen(){
  663. const userData = uni.getStorageSync("userData");
  664. console.log('userData', userData);
  665. uni.showLoading({
  666. title: "加载中",
  667. mask: true,
  668. });
  669. // 查询标本配送业务
  670. post("/simple/data/fetchDataList/taskType",{
  671. "idx": 0,
  672. "sum": 10,
  673. "taskType": {
  674. "simpleQuery": true,
  675. "hosId": {
  676. "id": userData.user.currentHospital.id
  677. },
  678. "associationType": {
  679. "key": "association_types",
  680. "value": "specimen"
  681. }
  682. }
  683. }).then((res) => {
  684. if (res.status == 200) {
  685. let taskTypeDTO = res.list[0];
  686. if(taskTypeDTO){
  687. // 查询业务页面控制-标本
  688. post("/simple/data/fetchDataList/taskTypeConfig",{
  689. "idx": 0,
  690. "sum": 10,
  691. "taskTypeConfig": {
  692. taskTypeDTO,
  693. }
  694. }).then((res) => {
  695. if (res.status == 200) {
  696. let data = res.list[0];
  697. if(data){
  698. this.bigScanShowSignBtn = data.bigScanShowSignBtn === 1;
  699. this.bigScanArriveNotOwner = data.bigScanArriveNotOwner === 1;
  700. this.bigScanShowCreateBtn = data.bigScanShowCreateBtn === 1;
  701. this.defaultScanSpe = data.defaultScanSpe === 1;
  702. this.speCollectLimit = data.speCollectLimit;
  703. this.speStartCollectShowConfig = data.speStartCollectShowConfig;
  704. if(this.defaultScanSpe){
  705. this.defaultJumpPage();
  706. }else{
  707. uni.hideLoading();
  708. }
  709. }else{
  710. uni.hideLoading();
  711. uni.showToast({
  712. icon: "none",
  713. title: "未查询到配置!",
  714. });
  715. }
  716. } else {
  717. uni.hideLoading();
  718. uni.showToast({
  719. icon: "none",
  720. title: res.msg || "接口获取数据失败!",
  721. });
  722. }
  723. });
  724. }else{
  725. uni.hideLoading();
  726. uni.showToast({
  727. icon: "none",
  728. title: "未查询到标本配送业务!",
  729. });
  730. }
  731. } else {
  732. uni.hideLoading();
  733. uni.showToast({
  734. icon: "none",
  735. title: res.msg || "接口获取数据失败!",
  736. });
  737. }
  738. });
  739. },
  740. // 默认情况下标本大扫描匹配到待到达工单,为当前的配送人员,直接进入标本扫描页面
  741. defaultJumpPage(){
  742. let workOrder = this.res.workOrder;
  743. console.log('workOrder:', workOrder)
  744. if(workOrder && workOrder.worker && workOrder.gdState.value == 4 && this.loginUser.id == workOrder.worker.id){
  745. let postData = {
  746. speId: this.res.data.id,
  747. orderId: workOrder.id,
  748. }
  749. post("/workerOrder/specimenCreateAndSign", postData).then((res) => {
  750. if (res.state == 200 || res.state == 201) {
  751. if (res.status == 200) {
  752. // 跳转到扫描科室
  753. // type1: res.type, //type类型
  754. // id: data.id, //工单ID
  755. // deptCode: code, //二维码
  756. // dept: res.dept //科室名称
  757. // uni.navigateTo({
  758. // url: `/pages/scanning_code/scanning_code?type=${
  759. // res.workOrder.taskType.associationType.value
  760. // }&type1=${res.type}&id=${res.workOrder.id}&deptCode=${
  761. // this.currentCode
  762. // }&dept=${res.dept}&accountObj=${encodeURIComponent(
  763. // JSON.stringify(undefined)
  764. // )}&deptId=${res.deptId}&specimenId=${speId}&fromSpecimenBuild=1`,
  765. // });
  766. this.breforeJump(res);
  767. } else {
  768. uni.hideLoading();
  769. uni.navigateTo({
  770. url: `/pages/scanning_Result/scanning_Result?type=${res.workOrder.taskType.associationType.value}&type1=${res.type}&id=${res.workOrder.id}&status=600&msg=${res.msg}&isKs=1`,
  771. });
  772. }
  773. } else if (res.state == "0000") {
  774. uni.hideLoading();
  775. this.currentCode = res.code;
  776. this.res.workOrder = res.workOrder;
  777. this.showSelectAccount();
  778. } else if(res.status == 515){
  779. uni.hideLoading();
  780. this.$refs.alertDialog.open()
  781. this.speContent = res.msg
  782. this.speData = res
  783. }else {
  784. uni.hideLoading();
  785. uni.showToast({
  786. icon: "none",
  787. title: res.msg || "接口获取数据失败!",
  788. });
  789. }
  790. });
  791. }else{
  792. uni.hideLoading();
  793. }
  794. },
  795. // 跳转前统一处理
  796. breforeJump(resObj) {
  797. uni.showLoading({
  798. title: '加载中',
  799. mask: true,
  800. })
  801. post('/workerOrder/getSpecimenCount', {
  802. gdId: resObj.workOrder.id
  803. }).then(res => {
  804. get('/api/fetchData/specimen/' + this.res.data.id).then(ress => {
  805. uni.hideLoading();
  806. console.log(ress);
  807. ress.msg = '成功';
  808. ress.specimenCount = res.specimenCount;
  809. ress.type = resObj.type;
  810. if(this.speCollectLimit==1 && this.speStartCollectShowConfig==1){
  811. let sessData = `type=${
  812. resObj.workOrder.taskType.associationType.value
  813. }&type1=${
  814. resObj.type
  815. }&infoData=${encodeURIComponent(
  816. JSON.stringify(ress.data)
  817. )}&status=${ress.status}&msg=${ress.msg}&deptCode=${
  818. this.currentCode
  819. }&dept=${
  820. resObj.dept
  821. }&taskTypeId=${
  822. resObj.workOrder.taskType.id
  823. }&deptId=${resObj.deptId}&id=${resObj.workOrder.id}&model=${encodeURIComponent(
  824. JSON.stringify(ress)
  825. )}&speNum=${res.specimenCount}`
  826. uni.setStorageSync('gdData', JSON.stringify(sessData))
  827. uni.navigateTo({
  828. url: `../speConfigurationGather/speConfigurationGather?id=${resObj.workOrder.id}`,
  829. });
  830. }else{
  831. uni.navigateTo({
  832. url: `../scanning_Result/scanning_Result?type=${
  833. resObj.workOrder.taskType.associationType.value
  834. }&type1=${
  835. resObj.type
  836. }&infoData=${encodeURIComponent(
  837. JSON.stringify(ress.data)
  838. )}&status=${ress.status}&msg=${ress.msg}&deptCode=${
  839. this.currentCode
  840. }&dept=${
  841. resObj.dept
  842. }&taskTypeId=${
  843. resObj.workOrder.taskType.id
  844. }&deptId=${resObj.deptId}&id=${resObj.workOrder.id}&model=${encodeURIComponent(
  845. JSON.stringify(ress)
  846. )}&speNum=${res.specimenCount}`,
  847. });
  848. }
  849. })
  850. })
  851. },
  852. },
  853. onShow() {
  854. this.SMFlag = true;
  855. let that = this
  856. // #ifdef APP-PLUS
  857. uni.$off('scan') // 每次进来先 移除全局自定义事件监听器
  858. // uni.$on('scan', function(data) {
  859. // that.pdaChange(data)
  860. // })
  861. // #endif
  862. },
  863. onLoad(options) {
  864. this.res = JSON.parse(options.res);
  865. this.getPageConfigSpecimen();
  866. this.infoDATA = JSON.parse(options.infoDATA); //详细信息
  867. console.log(this.infoDATA);
  868. console.log(this.res);
  869. // #ifdef APP-PLUS
  870. webHandle("no", "app");
  871. // #endif
  872. // #ifdef H5
  873. webHandle("no", "wx");
  874. // #endif
  875. },
  876. };
  877. </script>
  878. <style lang="less">
  879. .Scanning_B {
  880. padding: 0px 74rpx;
  881. .uni-modal__btn_primary {
  882. color: #49b856 !important;
  883. }
  884. .Scanning_top {
  885. height: 270rpx;
  886. .Scanning_top_icon {
  887. width: 140rpx;
  888. height: 140rpx;
  889. margin: 0 auto;
  890. margin-top: 116rpx;
  891. border-radius: 50%;
  892. line-height: 140rpx;
  893. text-align: center;
  894. .cubeic-ok {
  895. font-size: 140rpx;
  896. color: #35b34a;
  897. }
  898. .cubeic-close {
  899. font-size: 140rpx;
  900. color: #ff3b53;
  901. }
  902. }
  903. .Scanning_top_text {
  904. .text1 {
  905. margin-top: 40rpx;
  906. font-size: 48rpx;
  907. text-align: center;
  908. }
  909. }
  910. }
  911. .Scanning_cont {
  912. font-size: 32rpx;
  913. view {
  914. margin-bottom: 16rpx;
  915. text-align: center;
  916. }
  917. .text {
  918. margin-top: 24rpx;
  919. color: #35b34a;
  920. }
  921. .text1 {
  922. margin-top: 24rpx;
  923. color: #ff3b53;
  924. }
  925. }
  926. .foot_btn {
  927. line-height: 88rpx;
  928. height: 100rpx;
  929. margin-top: 40rpx;
  930. display: flex;
  931. justify-content: center;
  932. .btn3 {
  933. flex: 1;
  934. height: 88rpx;
  935. background-image: linear-gradient(to right, #72c172, #3bb197);
  936. color: #fff;
  937. border-radius: 8rpx;
  938. font-size: 32rpx;
  939. margin-top: 16rpx;
  940. margin-right: 16rpx;
  941. text-align: center;
  942. &:last-of-type {
  943. margin-right: 0;
  944. }
  945. }
  946. }
  947. }
  948. </style>