diff --git a/src/components/patientRegister/PatientRegisterEdit.vue b/src/components/patientRegister/PatientRegisterEdit.vue index cb1b120..9fce327 100644 --- a/src/components/patientRegister/PatientRegisterEdit.vue +++ b/src/components/patientRegister/PatientRegisterEdit.vue @@ -883,7 +883,7 @@ export default { return } this.$peisAPI.peopleIcCard().then(res => { - //console.log('peopleIcCard',res) + console.log('peopleIcCard',res) let lres = JSON.parse(res) if (lres.code >= 0) { let idNos = parsIcCardtoLocal(lres.data, this.dict.sex, this.dict.nation) @@ -1447,7 +1447,6 @@ export default { if (isPreview) { // //this.multipleSelection.forEach((item,index) =>{ - postapi(`/api/app/printreport/getpatientregisterguidereport?PatientRegisterId=${this.form.id}`) .then((res) => { if (res.code != -1) { @@ -1471,14 +1470,15 @@ export default { } }) .then(res => { - if (res.code != -1) { + //console.log('this.$peisAPI.print',res) + if (JSON.parse(res).code >= 0) { //更新打印次数 return postapi('/api/app/patientregister/updatepatientregisterguideprinttimesmany', [this.form.id]) } }) .then(res => { if (res.code != -1) { - lfind = arrayExistObj(this.patientRegister.prList, 'id', this.form.id) + let lfind = arrayExistObj(this.patientRegister.prList, 'id', this.form.id) if (lfind > -1) { if (this.patientRegister.prList[lfind].guidePrintTimes) { this.patientRegister.prList[lfind].guidePrintTimes = Number(this.patientRegister.prList[lfind].guidePrintTimes) + 1; diff --git a/src/components/patientRegister/PatientRegisterList.vue b/src/components/patientRegister/PatientRegisterList.vue index 76ae74d..c7385f2 100644 --- a/src/components/patientRegister/PatientRegisterList.vue +++ b/src/components/patientRegister/PatientRegisterList.vue @@ -607,8 +607,17 @@ export default { }; let lfind = -1; + //选中(取消勾选)start ------------------------- + this.multipleSelection = [] + this.patientRegister.prList.forEach(e =>{ + if(e.choosed){ + this.multipleSelection.push(deepCopy(e)) + } + }) + //选中(取消勾选) end  ------------------------- + if (this.multipleSelection.length < 1) { - this.$message.info("请勾选要打印指引单的人员记录!"); + this.$message.info("请选择要打印指引单的人员记录!"); return; } @@ -629,57 +638,50 @@ export default { return this.$peisAPI.printPre(JSON.stringify(toOutShell)); } }) + .then(res =>{ + console.log('this.$peisAPI.printPre',res) + if(JSON.parse(res).code < 0){ + this.$message.warning(JSON.parse(res).message); + } + }) .catch((err) => { this.$message.warning(err); }); // }); } else { - this.multipleSelection.forEach((item, index) => { - postapi( - `/api/app/printreport/getpatientregisterguidereport?PatientRegisterId=${item.id}` - ) - .then((res) => { - if (res.code != -1) { - toOutShell.ReportTable = res.data; - console.log( - "JSON.stringify(toOutShell)", - JSON.stringify(toOutShell) - ); - return this.$peisAPI.print(JSON.stringify(toOutShell)); - } - }) - .then((res) => { - if (JSON.parse(res).code >= 0) { - //更新打印次数 - return postapi( - "api/app/patientregister/updatepatientregisterguideprinttimesmany", - [item.id] - ); - } - }) - .then((res) => { - if (res.code != -1) { - lfind = arrayExistObj( - this.patientRegister.prList, - "id", - item.id - ); - if (lfind > -1) { - if (this.patientRegister.prList[lfind].guidePrintTimes) { - this.patientRegister.prList[lfind].guidePrintTimes = - Number( - this.patientRegister.prList[lfind].guidePrintTimes - ) + 1; - } else { - this.patientRegister.prList[lfind].guidePrintTimes = 1; - } - } + + this.elProgress.display = true; + this.elProgress.percentage = 0; + let resPrintData,resPeisAPI,resPrintTimes; + + for(let i=0;i -1) { + if (this.patientRegister.prList[lfind].guidePrintTimes) { + this.patientRegister.prList[lfind].guidePrintTimes = + Number( + this.patientRegister.prList[lfind].guidePrintTimes + ) + 1; + } else { + this.patientRegister.prList[lfind].guidePrintTimes = 1; } - }) - .catch((err) => { - this.$message.warning(err); - }); - }); + } + } catch (error) { + this.$message.error(error) + } + + this.elProgress.percentage = Math.floor( + ((i + 1) * 100) / this.multipleSelection.length + ); + } } },