bigScreen.vue 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851
  1. <template>
  2. <view class="toolbar" :class="!isNumberKey?'fixed-class':''" @click="Scanning()" hover-class="seimin-btn-hover">
  3. <text class="toolbar-icon newicon newicon-saoma"></text>
  4. <text class="toolbar-sao">扫一扫</text>
  5. <!-- 填写交接人工号弹窗 -->
  6. <selectAccount @click.stop.native v-if="hosModels.disjunctor" :disjunctor="hosModels.disjunctor" @ok="hosOk"
  7. @cancel="hosCancel">
  8. </selectAccount>
  9. </view>
  10. </template>
  11. <script>
  12. import {
  13. post,
  14. SM
  15. } from "../../http/http.js";
  16. export default {
  17. data() {
  18. return {
  19. hosId: uni.getStorageSync('userData').user.currentHospital.id,
  20. // 填写交接人工号弹窗model
  21. hosModels: {
  22. disjunctor: false,
  23. },
  24. userId: {
  25. ids: [],
  26. },
  27. workData: [],
  28. infoDATA: {},
  29. tabType: "", //当前选中项
  30. selectArr: [], //选中项
  31. code: "",
  32. currentCode: '', //当前小扫描的科室二维码
  33. SMFlag: true,
  34. }
  35. },
  36. props:{
  37. isNumberKey:Boolean
  38. },
  39. methods: {
  40. // 填写交接人工号-确认
  41. hosOk(data) {
  42. console.log(data);
  43. const {
  44. accountName,
  45. account,
  46. accountId
  47. } = data;
  48. if (!accountName && !account) {
  49. //没有填写交接人
  50. uni.showModal({
  51. title: "提示",
  52. content: "请填写交接人工号!",
  53. showCancel: false,
  54. success: function(res) {
  55. if (res.confirm) {
  56. console.log("用户点击确定");
  57. } else if (res.cancel) {
  58. console.log("用户点击取消");
  59. }
  60. },
  61. });
  62. return;
  63. } else if ((!accountName && account) || (accountName && !account)) {
  64. //没有填写交接人
  65. uni.showModal({
  66. title: "提示",
  67. content: "请填写正确的交接人工号!",
  68. showCancel: false,
  69. success: function(res) {
  70. if (res.confirm) {
  71. console.log("用户点击确定");
  72. } else if (res.cancel) {
  73. console.log("用户点击取消");
  74. }
  75. },
  76. });
  77. return;
  78. }
  79. this.hosModels.disjunctor = false;
  80. this.orderDeptHandler(false, data);
  81. },
  82. // 填写交接人工号-取消
  83. hosCancel() {
  84. this.hosModels.disjunctor = false;
  85. this.flag = true;
  86. },
  87. // 填写交接人工号弹窗
  88. showSelectAccount() {
  89. this.hosModels = {
  90. disjunctor: true,
  91. };
  92. },
  93. // 标本配送-待送达-运输过程-标本数字交接,则,科室签到不需要填写交接人
  94. validateHandoverSpecimen(){
  95. return post("/simple/data/fetchDataList/taskType", {
  96. "idx": 0,
  97. "sum": 1,
  98. "taskType": {
  99. "hosId": {
  100. "id": this.hosId
  101. },
  102. "associationType": {
  103. "key": "association_types",
  104. "value": "specimen"
  105. }
  106. }
  107. });
  108. },
  109. //科室签到
  110. //trueBigScanner----判断是否大扫描
  111. //bigScanner----判断是否需要交接人
  112. //accountObj----弹窗填写的交接人信息
  113. async orderDeptHandler(bigScanner, accountObj) {
  114. console.log(this.infoDATA);
  115. uni.showLoading({
  116. title: "加载中",
  117. mask: true,
  118. });
  119. if(this.tabType === 'specimen' && this.infoDATA.specimen && this.infoDATA.specimen[0].gdState.value == 5){
  120. let result = await this.validateHandoverSpecimen();
  121. if (result.status == 200) {
  122. if(result.list.length){
  123. // 标本-运送过程-终点科室-标本数字交接
  124. if(result.list[0].carryingCourses[1].checkoutMethod.value == 3){
  125. bigScanner = false;
  126. }
  127. }else{
  128. uni.showToast({
  129. icon: "none",
  130. title: "请配置标本配送任务类型!",
  131. });
  132. uni.hideLoading();
  133. return;
  134. }
  135. }
  136. }
  137. let type = "orderSign/" + this.code;
  138. let list = {
  139. ids: this.userId.ids,
  140. trueBigScanner: ['666']
  141. };
  142. bigScanner && (list.bigScanner = ['666']);
  143. if (accountObj) {
  144. list.handover = [accountObj.accountId];
  145. }
  146. post("/workerOrder/" + type, list).then((res) => {
  147. console.log(this.tabType)
  148. uni.hideLoading();
  149. if (res.status == 200) {
  150. if (this.tabType == 'specimenPlan') {
  151. // -----------------------------
  152. console.log(this.selectArr, '选中工单')
  153. let gd = this.infoDATA.specimenPlan.find(v => v.id == this.selectArr[0]);
  154. let startDeptId = gd.startDept.id; //起点科室id
  155. let isDigitalHandover = gd.taskType.isDigitalHandover; //是否数字交接开关
  156. let signDeptId = res.deptId; //签到的科室id
  157. let gdId = gd.id;
  158. let gdState = gd.gdState.value;
  159. let endDepts = gd.endDepts.map(v => v.id).toString();
  160. uni.navigateTo({
  161. url: `../scanning_djEnd/scanning_djEnd?type=${
  162. this.tabType
  163. }&type1=${res.type}&code=${this.code}&dept=${
  164. res.dept
  165. }&ids=${encodeURIComponent(
  166. JSON.stringify(this.userId.ids)
  167. )}&model=${encodeURIComponent(JSON.stringify(res))}&accountObj=${encodeURIComponent(JSON.stringify(accountObj))}&deptId=${res.deptId}&startDeptId=${startDeptId}&isDigitalHandover=${isDigitalHandover}&signDeptId=${signDeptId}&gdId=${gdId}&gdState=${gdState}&endDepts=${endDepts}`,
  168. });
  169. } else if (this.tabType == 'specimen') {
  170. // 同济是false
  171. if (res.deptType && res.deptType.value === 'middleRoom') {
  172. // if (false) {
  173. // 如果是中转科室
  174. uni.navigateTo({
  175. url: `../checkAfterBigScreen/checkAfterBigScreen?type=${
  176. this.tabType
  177. }&type1=${res.type}&code=${this.code}&dept=${
  178. res.dept
  179. }&ids=${encodeURIComponent(
  180. JSON.stringify(this.userId.ids)
  181. )}&model=${encodeURIComponent(JSON.stringify(res))}&accountObj=${encodeURIComponent(JSON.stringify(accountObj))}&deptId=${res.deptId}`,
  182. });
  183. } else if(res.type === 'spe-dsd-4'){
  184. // 检验方式是标本数字交接
  185. uni.navigateTo({
  186. url: `/pages/specimenHandoverNew/specimenHandoverNew?type=${
  187. this.tabType
  188. }&type1=${res.type}&code=${this.code}&dept=${
  189. res.dept
  190. }&ids=${encodeURIComponent(
  191. JSON.stringify(this.userId.ids)
  192. )}&model=${encodeURIComponent(JSON.stringify(res))}&accountObj=${encodeURIComponent(JSON.stringify(accountObj))}&deptId=${res.deptId}`,
  193. });
  194. } else{
  195. uni.navigateTo({
  196. url: `../scanning_djEnd/scanning_djEnd?type=${
  197. this.tabType
  198. }&type1=${res.type}&code=${this.code}&dept=${
  199. res.dept
  200. }&ids=${encodeURIComponent(
  201. JSON.stringify(this.userId.ids)
  202. )}&model=${encodeURIComponent(JSON.stringify(res))}&accountObj=${encodeURIComponent(JSON.stringify(accountObj))}&deptId=${res.deptId}`,
  203. });
  204. }
  205. }
  206. } else if (res.status == "0000") {
  207. this.showSelectAccount();
  208. } else {
  209. this.flag = true;
  210. uni.navigateTo({
  211. url: `../scanning_djEnd/scanning_djEnd?type=${this.tabType}&type1=${
  212. res.type
  213. }&code=${this.code}&dept=${res.dept}&ids=${encodeURIComponent(
  214. JSON.stringify(this.userId.ids)
  215. )}&model=${encodeURIComponent(JSON.stringify(res))}&deptId=${res.deptId}`,
  216. });
  217. }
  218. });
  219. },
  220. //获取药包信息
  221. getInfo(responeseData, code){
  222. console.log(responeseData);
  223. uni.showLoading({
  224. title: "加载中",
  225. mask: true,
  226. });
  227. post(`/transflow/scanInfo`, {type: responeseData.drugsBagType, id: responeseData.drugsBagId, orderStateValue: responeseData.orderStateValue}).then(res => {
  228. uni.hideLoading();
  229. if(res.state == 200){
  230. if(res.data){
  231. let drugsBag = res.data.dto || {};
  232. let orderId = responeseData.orderId;
  233. let config = res.data.taskTypeConfig || {};
  234. console.log(res);
  235. if(responeseData.orderStateValue == 2 || responeseData.orderStateValue == 3 || (responeseData.orderStateValue == 4 && responeseData.workerId == uni.getStorageSync('userData').user.id)){
  236. // 待抢单、待接单、待到达(本人),进入起点科室流程
  237. uni.navigateTo({
  238. url: `/pages/newDrug/createOrder/createOrder?drugsBagType=${responeseData.drugsBagType}&drugsBagId=${responeseData.drugsBagId}&orderId=${responeseData.orderId || ''}&type=receive`,
  239. });
  240. }else if(responeseData.orderStateValue == 5 && responeseData.workerId == uni.getStorageSync('userData').user.id){
  241. // 待送达(本人),进入终点科室流程
  242. this.pageNavigateByConfig(config, responeseData, responeseData, code)
  243. }else{
  244. // 查看药包信息
  245. uni.navigateTo({
  246. url: `/pages/newDrug/createOrder/createOrder?drugsBagType=${responeseData.drugsBagType}&drugsBagId=${responeseData.drugsBagId}&type=view`,
  247. });
  248. }
  249. }
  250. }else{
  251. uni.showToast({
  252. icon: "none",
  253. title: res.msg || "接口获取数据失败!",
  254. });
  255. }
  256. })
  257. },
  258. //获取标本打包信息
  259. getSpecimenPackageInfo(responeseData, code){
  260. console.log(responeseData);
  261. uni.showLoading({
  262. title: "加载中",
  263. mask: true,
  264. });
  265. post(`/transflow/scanInfo`, {type: responeseData.packageType, id: responeseData.data.id, orderStateValue: responeseData.orderStateValue}).then(res => {
  266. uni.hideLoading();
  267. if(res.state == 200){
  268. if(res.data){
  269. let orderId = responeseData.orderId;
  270. let config = res.data.taskTypeConfig || {};
  271. console.log(res);
  272. if(responeseData.orderStateValue == 2 || responeseData.orderStateValue == 3 || (responeseData.orderStateValue == 4 && responeseData.workerId == uni.getStorageSync('userData').user.id)){
  273. // 待抢单、待接单、待到达(本人),进入起点科室流程
  274. uni.navigateTo({
  275. url: `/pages/specimenPackage/createOrder/createOrder?packageType=${responeseData.packageType}&packageId=${responeseData.data.id}&orderId=${responeseData.orderId || ''}&type=receive`,
  276. });
  277. }else if(responeseData.orderStateValue == 5 && responeseData.workerId == uni.getStorageSync('userData').user.id){
  278. // 待送达(本人),进入终点科室流程
  279. this.pageSpecimenPackageNavigateByConfig(config, responeseData, responeseData, code)
  280. }else{
  281. // 查看标本包信息
  282. uni.navigateTo({
  283. url: `/pages/specimenPackage/createOrder/createOrder?packageType=${responeseData.packageType}&packageId=${responeseData.data.id}&type=view`,
  284. });
  285. }
  286. }
  287. }else{
  288. uni.showToast({
  289. icon: "none",
  290. title: res.msg || "接口获取数据失败!",
  291. });
  292. }
  293. })
  294. },
  295. // 工单完成
  296. completeOrder(responseData, queryObj){
  297. console.log(responseData, queryObj)
  298. uni.showLoading({
  299. title: "加载中",
  300. mask: true,
  301. });
  302. let postData = {
  303. "type": queryObj.drugsBagType,
  304. "orderId": responseData.orderId,
  305. };
  306. post('/transflow/checkComplete', postData).then(res => {
  307. uni.hideLoading();
  308. if(res.state == 200){
  309. uni.showToast({
  310. icon: "none",
  311. title: responseData.orderStateValue == 4 ? "交接成功,请尽快送达科室!" : (responseData.orderStateValue == 5 ? "交接成功,完成配送!" : ""),
  312. duration: 60000,
  313. mask: true,
  314. complete(){
  315. setTimeout(() => {
  316. uni.hideToast();
  317. uni.redirectTo({
  318. url: `/pages/receiptpage/receiptpage`,
  319. });
  320. }, 2000)
  321. }
  322. });
  323. }else{
  324. uni.showToast({
  325. icon: "none",
  326. title: res.msg || "接口获取数据失败!",
  327. });
  328. }
  329. })
  330. },
  331. // 标本打包-工单完成
  332. completeSpecimenPackageOrder(responseData, queryObj){
  333. console.log(responseData, queryObj)
  334. uni.showLoading({
  335. title: "加载中",
  336. mask: true,
  337. });
  338. let postData = {
  339. "type": queryObj.packageType,
  340. "packageId": responseData.dto.id,
  341. "orderId": responseData.orderId,
  342. };
  343. post('/transflow/checkComplete', postData).then(res => {
  344. uni.hideLoading();
  345. if(res.state == 200){
  346. uni.showToast({
  347. icon: "none",
  348. title: responseData.orderStateValue == 4 ? "交接成功,请尽快送达科室!" : (responseData.orderStateValue == 5 ? "交接成功,完成配送!" : ""),
  349. duration: 60000,
  350. mask: true,
  351. complete(){
  352. setTimeout(() => {
  353. uni.hideToast();
  354. uni.redirectTo({
  355. url: `/pages/receiptpage/receiptpage`,
  356. });
  357. }, 2000)
  358. }
  359. });
  360. }else{
  361. uni.showToast({
  362. icon: "none",
  363. title: res.msg || "接口获取数据失败!",
  364. });
  365. }
  366. })
  367. },
  368. // 根据配置跳转页面
  369. pageNavigateByConfig(config, responseData, queryObj, code){
  370. let drugsBagType = queryObj.drugsBagType;
  371. let orderId = responseData.orderId;
  372. let drugsBagId = responseData.drugsBagId;
  373. let orderStateValue = responseData.orderStateValue;
  374. if(config.drugsModel === 1){
  375. // 一单一码
  376. if(responseData.orderStateValue == 4){
  377. // 待到达
  378. if(config.drugsStartCheck === 1){
  379. // 起点科室支持核对
  380. uni.navigateTo({
  381. url: `/pages/newDrug/checkPage/checkPage?drugsBagType=${drugsBagType}&orderId=${orderId}`,
  382. });
  383. }else{
  384. // 起点科室不支持核对
  385. if(config.drugsStartPhoto === 1){
  386. // 起点科室支持拍照留存
  387. uni.navigateTo({
  388. url: `/pages/newDrug/photoRetention/photoRetention?drugsBagType=${drugsBagType}&orderId=${orderId}`,
  389. });
  390. }else{
  391. // 起点科室不支持拍照留存
  392. this.completeOrder(responseData, queryObj);
  393. }
  394. }
  395. }else if(responseData.orderStateValue == 5){
  396. // 待送达
  397. uni.showLoading({
  398. title: "加载中",
  399. mask: true,
  400. });
  401. post("/transflow/scanBind", { type: drugsBagType, orderId, code }).then((ress) => {
  402. uni.hideLoading();
  403. if (ress.state == 200) {
  404. if(ress.data.msg){
  405. uni.showToast({
  406. icon: "none",
  407. title: ress.data.msg || "接口获取数据失败!",
  408. });
  409. }else{
  410. if(config.drugsEndCheck === 1){
  411. // 终点科室支持核对
  412. uni.navigateTo({
  413. url: `/pages/newDrug/checkPage/checkPage?drugsBagType=${drugsBagType}&orderId=${orderId}`,
  414. });
  415. }else{
  416. // 终点科室不支持核对
  417. if(config.drugsEndPhoto === 1){
  418. // 终点科室支持拍照留存
  419. uni.navigateTo({
  420. url: `/pages/newDrug/photoRetention/photoRetention?drugsBagType=${drugsBagType}&orderId=${orderId}`,
  421. });
  422. }else{
  423. // 终点科室不支持拍照留存
  424. this.completeOrder(responseData, queryObj);
  425. }
  426. }
  427. }
  428. } else {
  429. uni.showToast({
  430. icon: "none",
  431. title: ress.msg || "接口获取数据失败!",
  432. });
  433. }
  434. });
  435. }
  436. }else if(config.drugsModel === 2){
  437. // 一单多码
  438. uni.showLoading({
  439. title: "加载中",
  440. mask: true,
  441. });
  442. post("/transflow/scanBind", { type: drugsBagType, orderId, code }).then((ress) => {
  443. uni.hideLoading();
  444. if (ress.state == 200) {
  445. if(ress.data.msg){
  446. uni.showToast({
  447. icon: "none",
  448. title: ress.data.msg || "接口获取数据失败!",
  449. });
  450. }else{
  451. if(config.drugsEndCountMethod && config.drugsEndCountMethod==2){
  452. uni.navigateTo({
  453. url: `/pages/newDrug/checkPage/checkPage?drugsBagType=${drugsBagType}&orderId=${orderId}`,
  454. });
  455. }else{
  456. if(config.drugsScanHandover === 1){
  457. // 终点科室开通一扫交接
  458. uni.navigateTo({
  459. url: `/pages/newDrug/checkPage/checkPage?drugsBagType=${drugsBagType}&orderId=${orderId}`,
  460. });
  461. }else{
  462. uni.navigateTo({
  463. url: `/pages/newDrug/continueScanning/continueScanning?drugsBagType=${drugsBagType}&orderId=${orderId}&drugsBagId=${drugsBagId}&orderStateValue=${orderStateValue}`,
  464. });
  465. }
  466. }
  467. }
  468. } else {
  469. uni.showToast({
  470. icon: "none",
  471. title: ress.msg || "接口获取数据失败!",
  472. });
  473. }
  474. });
  475. }
  476. },
  477. // 标本打包-根据配置跳转页面
  478. pageSpecimenPackageNavigateByConfig(config, responseData, queryObj, code){
  479. let packageType = queryObj.packageType;
  480. let orderId = responseData.orderId;
  481. let packageId = responseData.data.id;
  482. let orderStateValue = responseData.orderStateValue;
  483. if(config.spePackageModel === 1){
  484. // 一单一包
  485. if(responseData.orderStateValue == 5){
  486. // 待送达
  487. uni.showLoading({
  488. title: "加载中",
  489. mask: true,
  490. });
  491. post("/transflow/scanBind", { type: packageType, orderId, code }).then((ress) => {
  492. uni.hideLoading();
  493. if (ress.state == 200) {
  494. if(ress.data.msg){
  495. uni.showToast({
  496. icon: "none",
  497. title: ress.data.msg || "接口获取数据失败!",
  498. });
  499. }else{
  500. if(config.drugsEndCheck === 1){
  501. // 终点科室支持核对
  502. uni.navigateTo({
  503. url: `/pages/specimenPackage/createOrder/createOrder?packageType=${packageType}&packageId=${packageId}&orderId=${orderId}&type=end`,
  504. });
  505. }else{
  506. // 终点科室不支持核对
  507. this.completeSpecimenPackageOrder(responseData, queryObj);
  508. }
  509. }
  510. } else {
  511. uni.showToast({
  512. icon: "none",
  513. title: ress.msg || "接口获取数据失败!",
  514. });
  515. }
  516. });
  517. }
  518. }
  519. },
  520. // 底部扫描
  521. Scanning(qrcodePrefix = '') {
  522. // 起点科室-综合交接
  523. // this.ScanningCommon('', '1011103648');
  524. // 起点科室-非综合交接
  525. // this.ScanningCommon('', '5465456466546546565');
  526. // 终点科室-综合交接
  527. // this.ScanningCommon('', '7868686868688');
  528. // 发起中转配送
  529. // this.ScanningCommon('', '05ae81fc-3f07-4b8a-bbcb-53c40ede7d3d');
  530. // 快捷建单-轮巡工单码
  531. // this.ScanningCommon('', '3330ec8e-76eb-413e-b000-995f08d2ff96');
  532. // 中转科室码--金银湖流转中心
  533. // this.ScanningCommon('', '7d047a94-e102-446c-b477-94f977faaebd');
  534. // 终点科室核对码--本部住院检验科
  535. // this.ScanningCommon('', '95c5de27-c05f-11ea-8cfe-000c29097622');
  536. if (!this.SMFlag) {
  537. return;
  538. }
  539. this.SMFlag = false;
  540. SM().then((content) => {
  541. this.ScanningCommon(qrcodePrefix, content);
  542. }).catch(err => {
  543. this.SMFlag = true;
  544. });
  545. },
  546. //底部扫描-无须扫码
  547. ScanningCommon(qrcodePrefix = '', content){
  548. uni.showLoading({
  549. title: "加载中",
  550. mask: true,
  551. });
  552. //检验二维码的有效性(扫码前必须验证)
  553. post("/dept/scanning", {
  554. content,
  555. })
  556. .then((result) => {
  557. this.currentCode = result.code;
  558. this.SMFlag = true;
  559. // 200检测通过,201没有有效期也通过。
  560. if (result.state == 200 || result.state == 201) {
  561. let data = {
  562. code: result.code, //二维码
  563. };
  564. //微信—大扫描(科室码,患者码,标本码,快捷建单码,药包码)
  565. let code = result.code.includes(qrcodePrefix) ? result.code : qrcodePrefix + result.code;
  566. post("/workerOrder/scanCode", { code, hosId: this.hosId })
  567. .then((res) => {
  568. uni.hideLoading();
  569. if (res.status == 200) {
  570. // 扫描标本码
  571. if (res.type == "specimen") {
  572. let infoDATA = {
  573. stype: res.data.stype,
  574. scode: res.data.scode,
  575. patientName: res.data.patientName,
  576. sickRoom: res.data.sickRoom ?
  577. res.data.sickRoom.dept : "-",
  578. checkDept: res.data.checkDept ?
  579. res.data.checkDept.dept : "-",
  580. bedNum: res.data.bedNum,
  581. };
  582. uni.navigateTo({
  583. url: `../scanning_B/scanning_B?res=${encodeURIComponent(
  584. JSON.stringify(res)
  585. )}&infoDATA=${encodeURIComponent(
  586. JSON.stringify(infoDATA)
  587. )}`,
  588. });
  589. } else if (res.type == "patient") {
  590. //如果是患者腕带码
  591. // code: data.code //二维码
  592. res.workOrder = res.workOrder ? res.workOrder : []; //liao
  593. uni.navigateTo({
  594. url: `../scanning_ins/scanning_ins?code=${
  595. data.code
  596. }&infoDATA=${encodeURIComponent(
  597. JSON.stringify(res.data)
  598. )}&workData=${encodeURIComponent(
  599. JSON.stringify(res.workOrder)
  600. )}&patientOrders=${encodeURIComponent(
  601. JSON.stringify(res.patientOrders)
  602. )}`,
  603. });
  604. } else if (res.type == "quickOrder") {
  605. //快捷建单
  606. if(res.data.isDigitalHandover == 1){
  607. uni.navigateTo({
  608. url: `../specimenChecking/specimenChecking?infoDATA=${encodeURIComponent(
  609. JSON.stringify(res.data)
  610. )}`,
  611. });
  612. }else{
  613. uni.navigateTo({
  614. url: `../shortcutbuildOrders/shortcutbuildOrders?infoDATA=${encodeURIComponent(
  615. JSON.stringify(res.data)
  616. )}`,
  617. });
  618. }
  619. } else if (res.type == "dept") {
  620. // 扫描科室码
  621. // code: data.code //二维码
  622. let infoDATA = res.data;
  623. console.log(infoDATA)
  624. if(res.sign === 'bloodTake'){
  625. //新血制品-扫科室
  626. uni.navigateTo({
  627. url: `/pages/newBlood/startOrderSignBlood/startOrderSignBlood?deptId=${res.deptId}&deptName=${res.deptName}&taskTypeId=${res.taskTypeId}`,
  628. });
  629. }else if(Object.keys(infoDATA).length === 1 && (infoDATA.specimen || (infoDATA.specimenPlan && infoDATA.specimenPlan.length === 1))){
  630. // 判断是否是标本配送,并且仅仅只有这一种业务类型,默认全选,并跳转到下一步;
  631. // 判断是否是标本轮巡 ,并且仅仅只有这一种业务类型,并且只有一个工单,默认选中,并跳转到下一步;
  632. this.infoDATA = infoDATA;
  633. this.workData = infoDATA.specimen || infoDATA.specimenPlan;
  634. this.tabType = infoDATA.specimen ? 'specimen' : 'specimenPlan';
  635. this.code = data.code;
  636. this.selectArr = [];
  637. for (var i = 0; i < this.workData.length; i++) {
  638. this.selectArr.push(this.workData[i].id);
  639. }
  640. this.userId.ids = this.selectArr;
  641. this.orderDeptHandler(true);
  642. }else if(res.deptHandoverType && res.deptHandoverType.value == 'clinicalWaste'){
  643. // 医废
  644. uni.navigateTo({
  645. url: `/pages/medicalWaste/medicalWasteSignIn/medicalWasteSignIn?code=${data.code}&deptName=${res.deptName}&deptId=${res.deptId}`,
  646. });
  647. }else if(res.sign === 'patientIntelligentScan'){
  648. // 患者陪检和患者其他服务智能扫码
  649. uni.navigateTo({
  650. url: `/pages/newSendBack/sendBackOrder/sendBackOrder?deptId=${res.deptId}&code=${data.code}`,
  651. });
  652. }else{
  653. uni.navigateTo({
  654. url: `../scanning_all/scanning_all?infoDATA=${encodeURIComponent(
  655. JSON.stringify(infoDATA)
  656. )}&code=${data.code}&deptName=${res.deptName}&deptId=${res.deptId}`,
  657. });
  658. }
  659. } else if (res.type == 'drugsBag') {
  660. if (res.drugsBagType == 'drugsJpbag' || res.drugsBagType == 'drugsWestern' || res.drugsBagType == 'drugsReturn' || res.drugsBagType == 'drugsPoison' || res.drugsBagType == 'drugsHerbal') {
  661. //新药品-扫静配|西药|退药|毒麻|中草药
  662. if(res.newOrderId){
  663. // 待送达合并工单
  664. uni.navigateTo({
  665. url: `/pages/newDrug/createOrder/createOrder?drugsBagType=${res.drugsBagType}&drugsBagId=${res.drugsBagId}&orderId=${res.orderId || ''}&type=merge&newOrderId=${res.newOrderId || ''}`,
  666. });
  667. }else{
  668. if(res.orderId){
  669. // 有工单
  670. this.getInfo(res, code);
  671. }else{
  672. // 没有工单,进入起点科室流程
  673. uni.navigateTo({
  674. url: `/pages/newDrug/createOrder/createOrder?drugsBagType=${res.drugsBagType}&drugsBagId=${res.drugsBagId}&type=build`,
  675. });
  676. }
  677. }
  678. }else{
  679. //扫药包码
  680. uni.navigateTo({
  681. url: `/pages/scanning_drug/scanning_drug?drugsBagId=${res.drugsBagId}&drugsBagBatchNo=${res.drugsBagBatchNo}`,
  682. });
  683. }
  684. } else if (res.type == 'specimenPackage') {
  685. res.packageType = res.type;
  686. //标本打包
  687. if(res.data.status.value === '0'){
  688. // 未配置状态的标本包-查看标本包信息
  689. uni.navigateTo({
  690. url: `/pages/specimenPackage/createOrder/createOrder?packageType=${res.packageType}&packageId=${res.data.id}&type=view`,
  691. });
  692. }else if(res.orderId){
  693. // 有工单
  694. this.getSpecimenPackageInfo(res, code);
  695. }else{
  696. // 没有工单,进入起点科室流程
  697. uni.navigateTo({
  698. url: `/pages/specimenPackage/createOrder/createOrder?packageType=${res.packageType}&packageId=${res.data.id}&type=build`,
  699. });
  700. }
  701. } else if (res.type == 'nucleicAcid') {
  702. //扫核酸码
  703. uni.navigateTo({
  704. url: `/pages/scanning_nucleicAcid/scanning_nucleicAcid?qrcode=${data.code}`,
  705. });
  706. } else if (res.type == 'blood') {
  707. //扫血制品
  708. // 判断size,多个则进入新页面选择
  709. if(res.size > 1){
  710. uni.navigateTo({
  711. url: `/pages/bloodSelect/bloodSelect?qrcode=${data.code}&navigateTo=scanning_blood`,
  712. });
  713. } else {
  714. uni.navigateTo({
  715. url: `/pages/scanning_blood/scanning_blood?qrcode=${data.code}`,
  716. });
  717. }
  718. } else if (res.type == 'receiveOrder') {
  719. //扫快捷接单
  720. uni.showModal({
  721. title: "提示",
  722. content: `您本次接单包括${res.names.join('、')},一共含有${res.data.length}个工单,是否确认接单?`,
  723. success: function(result) {
  724. if (result.confirm) {
  725. uni.showLoading({
  726. title: "加载中",
  727. mask: true,
  728. });
  729. post("/workerOrder/receiveOrders", {ids: res.data.toString()}).then((result) => {
  730. uni.hideLoading();
  731. if (result.status == 200) {
  732. uni.showModal({
  733. title: "提示",
  734. content: `本次接单包括${res.names.join('、')},${res.data.length}个工单已接单完成`,
  735. showCancel: false,
  736. success: function(res) {
  737. if (res.confirm) {
  738. console.log("用户点击确定");
  739. uni.redirectTo({
  740. url: "../receiptpage/receiptpage",
  741. });
  742. } else if (res.cancel) {
  743. console.log("用户点击取消");
  744. }
  745. },
  746. });
  747. } else {
  748. uni.showToast({
  749. icon: "none",
  750. title: result.msg || "接口获取数据失败!",
  751. });
  752. }
  753. });
  754. } else if (result.cancel) {
  755. console.log("用户点击取消");
  756. }
  757. },
  758. });
  759. } else if(res.type == 'clinicalWaste'){
  760. // 医废
  761. if(res.wasteDetails){
  762. uni.navigateTo({
  763. url: `/pages/medicalWaste/medicalWasteDetail/medicalWasteDetail?qrcode=${res.code}`,
  764. });
  765. }else{
  766. uni.navigateTo({
  767. url: `/pages/medicalWaste/medicalWasteBind/medicalWasteBind?qrcode=${res.code}`,
  768. });
  769. }
  770. // 扫描中转交接码/终点科室-综合交接
  771. } else if(res.type == 'businessHandover'){
  772. uni.navigateTo({
  773. url: `/pages/transferConnect/transferConnect?data=${JSON.stringify(res)}`,
  774. });
  775. // 扫描中转配送建单
  776. } else if(res.type == 'quickOrderBusinessHandover'){
  777. uni.navigateTo({
  778. url: `/pages/transferDistribution/transferDistribution?data=${JSON.stringify(res)}`,
  779. });
  780. }
  781. } else {
  782. if(res.bigScanSpecialMsg){
  783. uni.navigateTo({
  784. url: `../scanning_big_Result/scanning_big_Result?msg=${res.msg || ''}&qrcode=${this.currentCode}&bigScanSpecialMsg=${encodeURIComponent(JSON.stringify(res.bigScanSpecialMsg))}`,
  785. });
  786. }else{
  787. uni.navigateTo({
  788. url: `../scanning_Result/scanning_Result?status=${res.status}&msg=${res.msg}&qrcode=${this.currentCode}`,
  789. });
  790. }
  791. }
  792. });
  793. } else {
  794. uni.hideLoading();
  795. uni.showToast({
  796. icon: "none",
  797. title: result.info || "接口获取数据失败!",
  798. });
  799. }
  800. })
  801. },
  802. },
  803. onShow() {
  804. this.SMFlag = true;
  805. }
  806. };
  807. </script>
  808. <style lang="less">
  809. // 底部扫一扫
  810. .fixed-class{
  811. position: fixed;
  812. }
  813. .toolbar {
  814. // position: fixed;
  815. left: 0;
  816. right: 0;
  817. bottom: 30rpx;
  818. z-index: 999;
  819. height: 88rpx;
  820. display: flex;
  821. justify-content: center;
  822. align-items: center;
  823. box-sizing: border-box;
  824. border-radius: 4rpx;
  825. // box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.24);
  826. // background-color: #e5e9ed;
  827. .toolbar-icon {
  828. font-size: 52rpx;
  829. margin-right: 16rpx;
  830. color: #07863c;
  831. }
  832. .toolbar-sao {
  833. font-size: 36rpx;
  834. color: #333;
  835. }
  836. }
  837. </style>