|
|
|
@ -16,6 +16,9 @@ |
|
|
|
<div class="listBtn"> |
|
|
|
<el-button type="primary" class="commonbutton" @click="btnReport(false)">打印报告</el-button> |
|
|
|
</div> |
|
|
|
<div class="listBtn"> |
|
|
|
<el-button type="primary" class="commonbutton" @click="btnReportExport(false)">导出 pdf 报告</el-button> |
|
|
|
</div> |
|
|
|
<div class="listBtn"> |
|
|
|
<el-button type="primary" class="commonbutton" @click="btnGetReport">领用报告</el-button> |
|
|
|
</div> |
|
|
|
@ -169,7 +172,7 @@ export default { |
|
|
|
let res2 = await postapi('/api/app/TransToWebPeis/TransPatientRegisterByPatientRegisterId', { patientRegisterId }) |
|
|
|
if (res2.code == -1) { |
|
|
|
console.log('TransToWebPeis err', res2) |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
// 上传成功 ,更新备单状态 |
|
|
|
e.isUploadAppoint = 'Y' |
|
|
|
} |
|
|
|
@ -276,6 +279,82 @@ export default { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 导出 pdf 报告 |
|
|
|
btnReportExport() { |
|
|
|
if (!this.$peisAPI) { |
|
|
|
this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!" }) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (!(this.dataTransOpts.tableM.patient_register && this.dataTransOpts.tableM.patient_register.length > 0)) { |
|
|
|
this.$message.warning({ showClose: true, message: "请勾选择记录!" }) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
this.$peisAPI.openDirectoryDialog() |
|
|
|
.then(res => { |
|
|
|
let lres = JSON.parse(res) |
|
|
|
if (lres.code > -1 && lres.data) { |
|
|
|
this.report2pdf(JSON.parse(lres.data).directory) |
|
|
|
} |
|
|
|
console.log('lres', lres) |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
this.$message.error(err) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
async report2pdf(path) { |
|
|
|
this.elProgress.display = true; |
|
|
|
this.elProgress.percentage = 0; |
|
|
|
|
|
|
|
let ReportCode = '0005'; |
|
|
|
let token = window.sessionStorage.getItem('token'); |
|
|
|
let user = window.sessionStorage.getItem('user'); |
|
|
|
let toOutShell = { |
|
|
|
ReportCode, token, |
|
|
|
isBuildImage: 'N', |
|
|
|
IsUploadPdf: 'N', |
|
|
|
preViewCanPrint: 'Y', |
|
|
|
BusinessCode: '', |
|
|
|
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: "pic/orgSign.png" }, |
|
|
|
{ Name: 'picExtOne', Value: 'pic/hisLog.jpg' }, |
|
|
|
], |
|
|
|
IsHealthReport: 'Y' |
|
|
|
}; |
|
|
|
|
|
|
|
for (let i = 0; i < this.dataTransOpts.tableM.patient_register.length; i++) { |
|
|
|
|
|
|
|
let e = this.dataTransOpts.tableM.patient_register[i]; |
|
|
|
this.elProgress.percentage = Math.floor(((i + 1) * 100) / this.dataTransOpts.tableM.patient_register.length); |
|
|
|
|
|
|
|
// 导出pdf |
|
|
|
try { |
|
|
|
if (e.completeFlag == '3') { |
|
|
|
toOutShell.BusinessCode = e.patientRegisterId |
|
|
|
toOutShell.ExportDirectory = `${path}\\${e.patientRegisterNo + e.patientName}.pdf` |
|
|
|
let jsonToOutShell = JSON.stringify(toOutShell) |
|
|
|
console.log('toOutShell', jsonToOutShell) |
|
|
|
let res = await this.$peisAPI.exportToPdfPre(jsonToOutShell) |
|
|
|
if (JSON.parse(res).code < 0) { |
|
|
|
console.log('this.$peisAPI.exportToPdfPre err', res) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} catch (error) { |
|
|
|
console.log('error', error) |
|
|
|
this.$message.warning({ showClose: true, message: error }); |
|
|
|
} |
|
|
|
} |
|
|
|
this.elProgress.display = false; |
|
|
|
}, |
|
|
|
|
|
|
|
//按条码号查个人数据 |
|
|
|
getPatientRegister(patientRegisterNo) { |
|
|
|
if (!patientRegisterNo) return |
|
|
|
|