scanning_B.vue 32 KB

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