|
|
|
@ -18,7 +18,7 @@ |
|
|
|
import moment from "moment"; |
|
|
|
import { mapState } from "vuex"; |
|
|
|
import { getapi, postapi, putapi, deletapi } from "@/api/api"; |
|
|
|
import { arrayExistObj, deepCopy,parseID } from "../../utlis/proFunc"; |
|
|
|
import { arrayExistObj, deepCopy, parseID } from "../../utlis/proFunc"; |
|
|
|
|
|
|
|
//import PatientRegisterList from "../doctorCheck/PatientRegisterList.vue"; |
|
|
|
export default { |
|
|
|
@ -95,7 +95,6 @@ export default { |
|
|
|
this.$message.warning("请先选择记录!") |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
this.dataTransOpts.tableS.patient_register.completeFlag = '2' |
|
|
|
}, |
|
|
|
|
|
|
|
@ -119,7 +118,9 @@ export default { |
|
|
|
let user = window.sessionStorage.getItem('user'); |
|
|
|
let toOutShell = { |
|
|
|
ReportCode, token, |
|
|
|
isBuildImage: 'N', |
|
|
|
preViewCanPrint: this.patientRegister.patientRegisterRd.isAudit, |
|
|
|
BusinessCode: this.patientRegister.patientRegisterId, |
|
|
|
Parameters: [ |
|
|
|
{ Name: 'printer', Value: user }, |
|
|
|
{ Name: 'hisLog', Value: 'pic/hisLog.jpg' }, |
|
|
|
@ -129,23 +130,40 @@ export default { |
|
|
|
], |
|
|
|
}; |
|
|
|
|
|
|
|
try { |
|
|
|
let res = await postapi(`/api/app/printreport/getpeisreport?PatientRegisterId=${this.patientRegister.patientRegisterId}`) |
|
|
|
toOutShell.ReportTable = res.data |
|
|
|
|
|
|
|
if (isPreview) { |
|
|
|
this.$peisAPI.printPre(JSON.stringify(toOutShell)); |
|
|
|
} else { |
|
|
|
this.$peisAPI.print(JSON.stringify(toOutShell)).then(res => { |
|
|
|
if (res.code != -1) { |
|
|
|
//更新打印次数 |
|
|
|
return postapi('/api/app/patientregister/updatepatientregisterguideprinttimesmany', [this.patientRegister.patientRegisterId]) |
|
|
|
|
|
|
|
// let res = await postapi(`/api/app/printreport/getpeisreport?PatientRegisterId=${this.patientRegister.patientRegisterId}`) |
|
|
|
// toOutShell.ReportTable = res.data |
|
|
|
if (isPreview) { |
|
|
|
this.$peisAPI.printPre(JSON.stringify(toOutShell)) |
|
|
|
.then(res => { |
|
|
|
if (JSON.parse(res).code < 0) { |
|
|
|
this.$message.warning({ showClose: true, message: JSON.parse(res).message }); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
console.log('预览体检报告错误', err) |
|
|
|
this.$message.warning({ showClose: true, message: `${err}` }); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
} catch (error) { |
|
|
|
this.$message.warning(error); |
|
|
|
} else { |
|
|
|
this.$peisAPI.print(JSON.stringify(toOutShell)) |
|
|
|
.then(res => { |
|
|
|
if (JSON.parse(res).code < 0) { |
|
|
|
this.$message.warning({ showClose: true, message: JSON.parse(res).message }); |
|
|
|
} else { |
|
|
|
return postapi('/api/app/patientregister/updatepatientregisterguideprinttimesmany', [this.patientRegister.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}` }); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|