scanning_B.vue 29 KB

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