|
|
|
@ -195,8 +195,8 @@ export default { |
|
|
|
|
|
|
|
//体检报告 |
|
|
|
async btnReport(isPreview) { |
|
|
|
if (!this.dataTransOpts.tableS.patient_register.id) { |
|
|
|
this.$message.warning({ showClose: true, message: "请先选择记录!" }) |
|
|
|
if (!this.dataTransOpts.tableS.patient_register.id || !(this.dataTransOpts.tableM.patient_register && this.dataTransOpts.tableM.patient_register.length > 0)) { |
|
|
|
this.$message.warning({ showClose: true, message: "请先勾选或选择记录(优先打印勾选人员的报告)!" }) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
@ -205,9 +205,22 @@ export default { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
///3a0c990e-5756-2dc0-19d5-69a617fe4048 |
|
|
|
///3a0c990e-5756-2dc0-19d5-69a617fe4048 isPatientOccupationalDisease patientRegisterId completeFlag isAudit |
|
|
|
let rds = [] |
|
|
|
if (this.dataTransOpts.tableM.patient_register && this.dataTransOpts.tableM.patient_register.length > 0) { |
|
|
|
rds = this.dataTransOpts.tableM.patient_register |
|
|
|
} else { |
|
|
|
rds.push({ |
|
|
|
patientRegisterId: this.dataTransOpts.tableS.patient_register.id, |
|
|
|
isPatientOccupationalDisease: this.dataTransOpts.tableS.patient_register.isPatientOccupationalDisease, |
|
|
|
completeFlag: this.dataTransOpts.tableS.patient_register.completeFlag, |
|
|
|
isAudit: this.dataTransOpts.tableS.patient_register.isAudit, |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
let ReportCode = '0005'; |
|
|
|
if (this.dataTransOpts.tableS.patient_register.isPatientOccupationalDisease == 'Y') ReportCode = '0006' |
|
|
|
if (rds[0].isPatientOccupationalDisease == 'Y') ReportCode = '0006' |
|
|
|
|
|
|
|
let token = window.sessionStorage.getItem('token'); |
|
|
|
let user = window.sessionStorage.getItem('user'); |
|
|
|
let toOutShell = { |
|
|
|
@ -215,22 +228,22 @@ export default { |
|
|
|
isBuildImage: 'N', |
|
|
|
IsUploadPdf: 'N', |
|
|
|
preViewCanPrint: 'Y', |
|
|
|
BusinessCode: this.dataTransOpts.tableS.patient_register.id, |
|
|
|
BusinessCode: rds[0].patientRegisterId, |
|
|
|
Parameters: [ |
|
|
|
{ Name: 'printer', Value: user }, |
|
|
|
{ Name: 'LTS', Value: 'Y' }, //Y、N N只看不能打印 |
|
|
|
{ Name: "firstPage", Value: "pic/peisReportFirstPage.jpg" }, |
|
|
|
{ Name: "pageHeader", Value: "pic/peisReportPageHeader.jpg" }, |
|
|
|
{ Name: "pageFooter", Value: "pic/peisReportPageFooter.jpg" }, |
|
|
|
{ Name: "orgSign", Value: this.dataTransOpts.tableS.patient_register.isPatientOccupationalDisease == 'Y' ? "pic/orgSignOcc.png" : "pic/orgSign.png" }, |
|
|
|
{ Name: "orgSign", Value: rds[0].isPatientOccupationalDisease == 'Y' ? "pic/orgSignOcc.png" : "pic/orgSign.png" }, |
|
|
|
{ Name: 'picExtOne', Value: 'pic/hisLog.jpg' }, |
|
|
|
{ Name: 'resultSign', Value: 'pic/resultSign.png' }, |
|
|
|
], |
|
|
|
}; |
|
|
|
|
|
|
|
// 总检审核后才能打印 |
|
|
|
if (this.dataTransOpts.tableS.patient_register.completeFlag != '3') toOutShell.preViewCanPrint = 'N' |
|
|
|
if (toOutShell.preViewCanPrint == 'Y' && this.dataTransOpts.tableS.patient_register.isAudit == 'N') { |
|
|
|
if (rds[0].completeFlag != '3') toOutShell.preViewCanPrint = 'N' |
|
|
|
if (toOutShell.preViewCanPrint == 'Y' && rds[0].isAudit == 'N') { |
|
|
|
let sysParmId = "medical_report_print_after_summary_check_is_audit" |
|
|
|
let sysParam = await postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId }) |
|
|
|
if (sysParam.data.toUpperCase() == 'Y') toOutShell.preViewCanPrint = 'N' |
|
|
|
@ -253,28 +266,34 @@ export default { |
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
if (toOutShell.preViewCanPrint == 'N') { |
|
|
|
this.$message.warning({ showClose: true, message: '未总检或未审核,不可打印报告' }) |
|
|
|
return |
|
|
|
} |
|
|
|
this.$peisAPI.print(JSONtoOutShell) |
|
|
|
.then(res => { |
|
|
|
if (JSON.parse(res).code < 0) { |
|
|
|
this.$message.warning({ showClose: true, message: JSON.parse(res).message }); |
|
|
|
for (let i = 0; i < rds.length; i++) { |
|
|
|
let rd = rds[i]; |
|
|
|
|
|
|
|
toOutShell.ReportCode = rd.isPatientOccupationalDisease == 'Y' ? '0006' : '0005' |
|
|
|
toOutShell.BusinessCode = rd.patientRegisterId |
|
|
|
if (rd.completeFlag != '3') toOutShell.preViewCanPrint = 'N' |
|
|
|
if (toOutShell.preViewCanPrint == 'Y' && rd.isAudit == 'N') { |
|
|
|
let sysParmId = "medical_report_print_after_summary_check_is_audit" |
|
|
|
let sysParam = await postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId }) |
|
|
|
if (sysParam.data.toUpperCase() == 'Y') toOutShell.preViewCanPrint = 'N' |
|
|
|
} |
|
|
|
|
|
|
|
if (toOutShell.preViewCanPrint == 'N') { |
|
|
|
this.$message.warning({ showClose: true, message: '未总检或未审核,不可打印报告' }) |
|
|
|
continue |
|
|
|
} |
|
|
|
JSONtoOutShell = JSON.stringify(toOutShell) |
|
|
|
try { |
|
|
|
let lres = await this.$peisAPI.print(JSONtoOutShell) |
|
|
|
if (JSON.parse(lres).code < 0) { |
|
|
|
this.$message.warning({ showClose: true, message: JSON.parse(lres).message }); |
|
|
|
} else { |
|
|
|
return postapi('/api/app/patientregister/updatepatientregisterreportprinttimesmany', [this.dataTransOpts.tableS.patient_register.id]); |
|
|
|
postapi('/api/app/patientregister/updatepatientregisterreportprinttimesmany', [rd.patientRegisterId]) |
|
|
|
} |
|
|
|
}) |
|
|
|
.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}` }); |
|
|
|
}); |
|
|
|
|
|
|
|
} catch (error) { |
|
|
|
this.$message.warning({ showClose: true, message: error }); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|