|
|
|
@ -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<this.multipleSelection.length;i++){ |
|
|
|
try { |
|
|
|
resPrintData = await postapi(`/api/app/printreport/getpatientregisterguidereport?PatientRegisterId=${this.multipleSelection[i].id}`) |
|
|
|
if(resPrintData.code == -1) continue |
|
|
|
toOutShell.ReportTable = resPrintData.data |
|
|
|
resPeisAPI = await this.$peisAPI.print(JSON.stringify(toOutShell)); |
|
|
|
if (JSON.parse(resPeisAPI).code < 0) continue |
|
|
|
resPrintTimes = postapi("api/app/patientregister/updatepatientregisterguideprinttimesmany",[this.multipleSelection[i].id]); |
|
|
|
if(resPrintTimes.code == -1) continue |
|
|
|
lfind = arrayExistObj(this.patientRegister.prList,"id",this.multipleSelection[i].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; |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
this.$message.warning(err); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
this.$message.error(error) |
|
|
|
} |
|
|
|
|
|
|
|
this.elProgress.percentage = Math.floor( |
|
|
|
((i + 1) * 100) / this.multipleSelection.length |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|