From bcf4881dac9ba4e5c7db59090c10a3a10a451de8 Mon Sep 17 00:00:00 2001 From: pengjun <158915633@qq.com> Date: Mon, 15 Jul 2024 16:43:36 +0800 Subject: [PATCH] dj --- .../patientRegister/PatientRegisterList.vue | 301 +++++++++--------- 1 file changed, 142 insertions(+), 159 deletions(-) diff --git a/src/components/patientRegister/PatientRegisterList.vue b/src/components/patientRegister/PatientRegisterList.vue index 5479475..dbd03b8 100644 --- a/src/components/patientRegister/PatientRegisterList.vue +++ b/src/components/patientRegister/PatientRegisterList.vue @@ -176,8 +176,7 @@ 指引单预览
- 人员检验检查条码 + 人员检验检查条码
人员信息导出 @@ -657,6 +656,42 @@ export default { }) }, + + + printGuideLisPacs(row) { + return new Promise((resolve, reject) => { + this.guidePrintPromise("0008", false, row) + .then(res => { + resolve(res) + }) + .catch(err => { + reject(err) + }) + }) + }, + + + async printPromise() { + this.elProgress.display = true; + this.elProgress.percentage = 0; + + for (let i = 0; i < this.multipleSelection.length; i++) { + let row = this.multipleSelection[i] + try { + await printGuideLisPacs(row) + } catch (error) { + console.log('printPromise', error) + } + + this.elProgress.percentage = Math.floor( + ((i + 1) * 100) / this.multipleSelection.length + ); + } + this.elProgress.display = false; + }, + + + handleSelectionChange(rows) { //this.multipleSelection = rows; //// console.log('this.multipleSelection',this.multipleSelection) @@ -1308,173 +1343,121 @@ export default { this.lisPrint(row, "0003", false); }, - //检验条码打印 + //检验条码打印 改造成 promise lisPrint(row, ReportCode, isPreview) { - if (row.completeFlag == '0') { - this.$message.info({ showClose: true, message: "预登记人员,不可执行此操作!" }); - return; - } + return new Promise((resolve, reject) => { + if (!this.$peisAPI) reject("此功能,需要在壳客户端才可运行!"); + if (row.completeFlag || row.completeFlag == '0') reject("预登记人员,不可执行此操作!") - if (!this.$peisAPI) { - this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!" }); - return; - } - let token = window.sessionStorage.getItem("token"); - let user = window.sessionStorage.getItem("user"); - let toOutShell = { - ReportCode, - token, - IsMoreLabel: 'Y', - isBuildImage: 'N', - IsUploadPdf: 'N', - preViewCanPrint: "N", - Parameters: [ - { Name: "printer", Value: user }, - { Name: "hisLog", Value: "pic/hisLog.jpg" }, - ], - BusinessCode: row.id - }; - console.log('this.$peisAPI.print', toOutShell) - if (isPreview) { - /* - postapi( - `/ api / app / printreport / getlisrequestreport ? PatientRegisterId = ${ prId }` - ) - .then((res) => { - if (res.code != -1) { - toOutShell.ReportTable = { lisRequest: res.data }; - // console.log( - "JSON.stringify(toOutShell)", - JSON.stringify(toOutShell) - ); - return this.$peisAPI.printPre(JSON.stringify(toOutShell)); - } - }) - .catch((err) => { - this.$message.warning(err); - }); - */ - this.$peisAPI.printPre(JSON.stringify(toOutShell)) - .then(res => { - // console.log('this.$peisAPI.printPre', res) - if (JSON.parse(res).code < 0) { - this.$message.warning({ showClose: true, message: JSON.parse(res).message }); - } - }) - .catch((err) => { - // console.log('打印检验条码错误', err) - this.$message.warning({ showClose: true, message: `${err}` }); - }); + let token = window.sessionStorage.getItem("token"); + let user = window.sessionStorage.getItem("user"); + let toOutShell = { + ReportCode, + token, + IsMoreLabel: 'Y', + isBuildImage: 'N', + IsUploadPdf: 'N', + preViewCanPrint: "N", + Parameters: [ + { Name: "printer", Value: user }, + { Name: "hisLog", Value: "pic/hisLog.jpg" }, + ], + BusinessCode: row.id + }; - } else { - /* - postapi( - `/ api / app / printreport / getlisrequestreport ? PatientRegisterId = ${ prId }` - ) - .then((res) => { - if (res.code != -1) { - toOutShell.ReportTable = { lisRequest: res.data }; - // console.log( - "JSON.stringify(toOutShell)", - JSON.stringify(toOutShell) - ); - return this.$peisAPI.print(JSON.stringify(toOutShell)); - } - }) - .then((res) => { - //// console.log("res", res); - if (JSON.parse(res).code >= 0) { - //更新打印状态 /api/app/lisrequest/updatelisrequestisprint - // { - // "operateType": 0, 操作类型(1.按PatientRegisterId 2.按LisRequestId) - // "patientRegisterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - // "lisRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6" - // } - return postapi("/api/app/lisrequest/updatelisrequestisprint", { - operateType: 1, - patientRegisterId: prId, - }); - } - }) - .catch((err) => { - this.$message.warning(err); - }); - */ - this.$peisAPI.print(JSON.stringify(toOutShell)) - .then(res => { - if (JSON.parse(res).code < 0) { - this.$message.warning({ showClose: true, message: JSON.parse(res).message }); - } else { - return postapi("/api/app/lisrequest/updatelisrequestisprint", { - operateType: 1, - patientRegisterId: row.id, - }); - } - }) - .then(res => { - if (res && res.code < 0) { - this.$message.error({ showClose: true, message: `${res.message}` }); - } - }) - .catch((err) => { - // console.log('打印检验条码错误', err) - this.$message.error({ showClose: true, message: `${err}` }); - }); - } + + if (isPreview) { + this.$peisAPI.printPre(JSON.stringify(toOutShell)) + .then(res => { + // console.log('this.$peisAPI.printPre', res) + if (JSON.parse(res).code > -1) { + resolve(JSON.parse(res)) + } else { + reject(JSON.parse(res).message); + } + }) + .catch((err) => { + reject(err); + }); + } else { + + this.$peisAPI.print(JSON.stringify(toOutShell)) + .then(res => { + if (JSON.parse(res).code < 0) { + reject(JSON.parse(res).message); + } else { + return postapi("/api/app/lisrequest/updatelisrequestisprint", { + operateType: 1, + patientRegisterId: row.id, + }); + } + }) + .then(res => { + if (res && res.code < 0) { + reject(res.message); + } else { + resolve(res) + } + }) + .catch((err) => { + reject(err); + }); + } + }) }, //pacs条码打印 pacsPrint(row, ReportCode, isPreview) { - if (row.completeFlag == '0') { - this.$message.info({ showClose: true, message: "预登记人员,不可执行此操作!" }); - return; - } - if (!this.$peisAPI) { - this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!" }); - return; - } - let token = window.sessionStorage.getItem("token"); - let user = window.sessionStorage.getItem("user"); - let toOutShell = { - ReportCode, - token, - IsMoreLabel: 'Y', - isBuildImage: 'N', - IsUploadPdf: 'N', - preViewCanPrint: "N", - Parameters: [ - { Name: "printer", Value: user }, - { Name: "hisLog", Value: "pic/hisLog.jpg" }, - ], - BusinessCode: row.id - }; - console.log('this.$peisAPI.print', toOutShell) - if (isPreview) { - this.$peisAPI.printPre(JSON.stringify(toOutShell)) - .then(res => { - if (JSON.parse(res).code < 0) { - this.$message.warning({ showClose: true, message: JSON.parse(res).message }); - } - }) - .catch((err) => { - // console.log('打印pacs条码错误', err) - this.$message.warning({ showClose: true, message: `${err}` }); - }); - } else { - this.$peisAPI.print(JSON.stringify(toOutShell)) - .then(res => { - if (JSON.parse(res).code < 0) { - this.$message.warning({ showClose: true, message: JSON.parse(res).message }); - } - }) - .catch((err) => { - // console.log('打印pacs条码错误', err) - this.$message.error({ showClose: true, message: `${err}` }); - }); - } + return new Promise((resolve, reject) => { + if (!this.$peisAPI) reject("此功能,需要在壳客户端才可运行!"); + if (row.completeFlag || row.completeFlag == '0') reject("预登记人员,不可执行此操作!") + + let token = window.sessionStorage.getItem("token"); + let user = window.sessionStorage.getItem("user"); + let toOutShell = { + ReportCode, + token, + IsMoreLabel: 'Y', + isBuildImage: 'N', + IsUploadPdf: 'N', + preViewCanPrint: "N", + Parameters: [ + { Name: "printer", Value: user }, + { Name: "hisLog", Value: "pic/hisLog.jpg" }, + ], + BusinessCode: row.id + }; + // console.log('this.$peisAPI.print', toOutShell) + if (isPreview) { + this.$peisAPI.printPre(JSON.stringify(toOutShell)) + .then(res => { + if (JSON.parse(res).code > -1) { + resolve(res) + } else { + reject(JSON.parse(res).message); + } + }) + .catch((err) => { + reject(err); + }); + } else { + this.$peisAPI.print(JSON.stringify(toOutShell)) + .then(res => { + if (JSON.parse(res).code > -1) { + resolve(res) + } else { + reject(JSON.parse(res).message); + } + }) + .catch((err) => { + reject(err); + }); + } + }) }, + // 导入检查检验结果 importResult(checkType, row) { let url = '/api/app/ImportLisResult/ImportResultByPatientRegisterId'