Browse Source

report

master
pengjun 1 year ago
parent
commit
082dd59d3f
  1. 1
      src/components/common/LocalConfig.vue
  2. 113
      src/components/patientRegister/PatientRegisterEdit.vue
  3. 75
      src/components/report/BtnReport.vue

1
src/components/common/LocalConfig.vue

@ -47,6 +47,7 @@
<el-form-item label="保存打指引单与条码">
<el-checkbox-group v-model="printGuideLabel">
<el-checkbox label="guide">指引单</el-checkbox>
<el-checkbox label="patient">人员条码</el-checkbox>
<el-checkbox label="pacs">检查条码</el-checkbox>
<el-checkbox label="lis">检验条码</el-checkbox>
</el-checkbox-group>

113
src/components/patientRegister/PatientRegisterEdit.vue

@ -1784,7 +1784,7 @@ export default {
//
if (this.completeFlag == '0' && this.form.completeFlag != '0') {
if (Array.isArray(this.LocalConfig.patientRegister.printGuideLabel) && this.LocalConfig.patientRegister.printGuideLabel.length > 0) {
this.$confirm("是否打印 指引单、检验条码及 Pacs 条码?", "提示", {
this.$confirm("是否打印 指引单、人员条码、检验条码及 Pacs 条码?", "提示", {
confirmButtonText: "是",
cancelButtonText: "否",
type: "warning",
@ -2214,11 +2214,57 @@ export default {
Parameters: [
{ Name: 'printer', Value: user },
{ Name: 'hisLog', Value: 'pic/hisLog.jpg' },
{ Name: 'pageFooter', Value: 'pic/peisQrCode.jpg' }
],
};
this.printing = true
if (this.LocalConfig.patientRegister.printGuideLabel.indexOf('lis') > -1 && this.LocalConfig.patientRegister.printGuideLabel.indexOf('pacs') > -1) {
if (this.LocalConfig.patientRegister.printGuideLabel.indexOf('patient') > -1 && this.LocalConfig.patientRegister.printGuideLabel.indexOf('lis') > -1 && this.LocalConfig.patientRegister.printGuideLabel.indexOf('pacs') > -1) {
this.guidePrintEasy('0008', isPreview, toOutShell)
.then(res => {
return this.lisPrint('0002', isPreview, toOutShell)
})
.then(res => {
return this.pacsPrint('0004', isPreview, toOutShell)
})
.then(res => {
resolve(res)
})
.catch(err => {
reject(err)
})
.finally(() => {
this.printing = false
})
} else if (this.LocalConfig.patientRegister.printGuideLabel.indexOf('patient') > -1 && this.LocalConfig.patientRegister.printGuideLabel.indexOf('lis') > -1 ) {
this.guidePrintEasy('0008', isPreview, toOutShell)
.then(res => {
return this.lisPrint('0002', isPreview, toOutShell)
})
.then(res => {
resolve(res)
})
.catch(err => {
reject(err)
})
.finally(() => {
this.printing = false
})
} else if (this.LocalConfig.patientRegister.printGuideLabel.indexOf('patient') > -1 && this.LocalConfig.patientRegister.printGuideLabel.indexOf('pacs') > -1) {
this.guidePrintEasy('0008', isPreview, toOutShell)
.then(res => {
return this.pacsPrint('0004', isPreview, toOutShell)
})
.then(res => {
resolve(res)
})
.catch(err => {
reject(err)
})
.finally(() => {
this.printing = false
})
} else if (this.LocalConfig.patientRegister.printGuideLabel.indexOf('lis') > -1 && this.LocalConfig.patientRegister.printGuideLabel.indexOf('pacs') > -1) {
this.lisPrint('0002', isPreview, toOutShell)
.then(res => {
return this.pacsPrint('0004', isPreview, toOutShell)
@ -2232,7 +2278,18 @@ export default {
.finally(() => {
this.printing = false
})
} else if (this.LocalConfig.patientRegister.printGuideLabel.indexOf('lis') > -1) {
} else if (this.LocalConfig.patientRegister.printGuideLabel.indexOf('patient') > -1) {
this.guidePrintEasy('0008', isPreview, toOutShell)
.then(res => {
resolve(res)
})
.catch(err => {
reject(err)
})
.finally(() => {
this.printing = false
})
} else if (this.LocalConfig.patientRegister.printGuideLabel.indexOf('lis') > -1) {
this.lisPrint('0002', isPreview, toOutShell)
.then(res => {
resolve(res)
@ -2261,6 +2318,56 @@ export default {
})
},
// lis
guidePrintEasy(ReportCode, isPreview, toOutShell) {
return new Promise((resolve, reject) => {
toOutShell.ReportCode = ReportCode
console.log('this.$peisAPI.print', JSON.stringify(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(lres).message });
reject(JSON.parse(res).message)
} else {
resolve(res)
}
})
.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/patientregister/updatepatientregisterguideprinttimesmany', [this.form.id])
}
})
.then(res => {
if (res && res.code > -1) {
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;
} else {
this.patientRegister.prList[lfind].guidePrintTimes = 1;
}
}
resolve(res)
} else {
reject(res.message)
}
})
.catch(err => {
reject(err)
})
}
})
},
// lis
lisPrint(ReportCode, isPreview, toOutShell) {
return new Promise((resolve, reject) => {

75
src/components/report/BtnReport.vue

@ -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' }, //YN 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 });
}
}
}
},

Loading…
Cancel
Save