pengjun 2 years ago
parent
commit
f0e5593014
  1. 220
      src/components/patientRegister/PatientRegisterEdit.vue

220
src/components/patientRegister/PatientRegisterEdit.vue

@ -397,7 +397,8 @@
<el-form-item label="接害因素" label-width="65px">
<el-select v-model="form.poisonIds" size="small"
:style="`width:${Math.floor((window.pageWidth - 222) / 1.41)}px;`" clearable filterable
:filter-method="filterMethodPoison" value-key="id" multiple :disabled="form.completeFlag == '3' ? true : false">
:filter-method="filterMethodPoison" value-key="id" multiple
:disabled="form.completeFlag == '3' ? true : false">
<el-option-group v-for="group in poison" :key="group.poisonTypeName" :label="group.poisonTypeName">
<el-option v-for="item in group.poisonDtos" :key="item.id" :label="item.displayName"
:value="item.id" />
@ -1694,20 +1695,16 @@ export default {
cancelButtonText: "否",
type: "warning",
})
.then(async () => {
try {
await this.labelPrint(false) //
if (this.LocalConfig.patientRegister.printGuideLabel.indexOf('guide') > -1) await this.guidePrint('0001', false)
} catch (error) {
// this.$message.info({ showClose: true, message: error });
console.log(error)
}
.then(() => {
return this.labelPrint(false)
})
.then(res => {
return this.guidePrint('0001', false)
})
.catch((err) => {
if (err != "cancel") {
console.log(err)
this.$message.error({ showClose: true, message: err })
}
})
.finally(() => {
@ -1943,18 +1940,16 @@ export default {
},
// (isPreview)
async guidePrint(ReportCode, isPreview) {
guidePrint(ReportCode, isPreview) {
return new Promise((resolve, reject) => {
if (!this.form.id) {
this.$message.info({ showClose: true, message: "人员信息尚未保存,不可执行此操作!" });
return;
reject("人员信息尚未保存,不可执行此操作!")
}
if (this.form.completeFlag == '0') {
this.$message.info({ showClose: true, message: "预登记人员,不可执行此操作!" });
return;
reject("预登记人员,不可执行此操作!")
}
if (!this.$peisAPI) {
this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!" })
return
reject("此功能,需要在壳客户端才可运行!")
}
let token = window.sessionStorage.getItem('token');
@ -1974,36 +1969,30 @@ export default {
console.log('this.$peisAPI.print', JSON.stringify(toOutShell))
this.printing = true
if (isPreview) {
/*
postapi(`/api/app/printreport/getpatientregisterguidereport?PatientRegisterId=${this.form.id}`)
.then((res) => {
if (res.code != -1) {
toOutShell.ReportTable = res.data;
// console.log('JSON.stringify(toOutShell)', JSON.stringify(toOutShell));
return this.$peisAPI.printPre(JSON.stringify(toOutShell));
this.$peisAPI.printPre(JSON.stringify(toOutShell))
.then(res => {
if (JSON.parse(res).code < 0) {
reject(JSON.parse(res).message)
} else {
resolve(res)
}
})
.catch(err => {
this.$message.warning({ showClose: true, message: err});
});
*/
try {
let lres = await this.$peisAPI.printPre(JSON.stringify(toOutShell))
if (JSON.parse(lres).code < 0) {
this.$message.warning({ showClose: true, message: JSON.parse(lres).message });
}
} catch (error) {
this.$message.warning({ showClose: true, message: `${error}` });
}
} else {
try {
let lres = await this.$peisAPI.print(JSON.stringify(toOutShell))
if (JSON.parse(lres).code < 0) {
this.$message.warning({ showClose: true, message: JSON.parse(lres).message });
reject(err)
})
.finally(() => {
this.printing = false
return
})
} 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])
}
postapi('/api/app/patientregister/updatepatientregisterguideprinttimesmany', [this.form.id]).then(res => {
})
.then(res => {
if (res && res.code > -1) {
let lfind = arrayExistObj(this.patientRegister.prList, 'id', this.form.id)
if (lfind > -1) {
@ -2013,13 +2002,19 @@ export default {
this.patientRegister.prList[lfind].guidePrintTimes = 1;
}
}
resolve(res)
} else {
reject("更新指引单打印错误")
}
})
} catch (error) {
this.$message.warning({ showClose: true, message: `${error}` });
}
}
.catch(err => {
reject(err)
})
.finally(() => {
this.printing = false
})
}
})
},
//
@ -2069,19 +2064,18 @@ export default {
},
//(lis + pacs)
async labelPrint(isPreview) {
labelPrint(isPreview) {
return new Promise((resolve, reject) => {
if (!this.form.id) {
this.$message.info({ showClose: true, message: "人员信息尚未保存,不可执行此操作!" });
return;
reject("人员信息尚未保存,不可执行此操作!");
}
if (this.form.completeFlag == '0') {
this.$message.info({ showClose: true, message: "预登记人员,不可执行此操作!" });
return;
reject("预登记人员,不可执行此操作!");
}
if (!this.$peisAPI) {
this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!" })
return
reject("此功能,需要在壳客户端才可运行!");
}
let token = window.sessionStorage.getItem('token');
let user = window.sessionStorage.getItem('user');
let toOutShell = {
@ -2097,74 +2091,117 @@ export default {
};
this.printing = true
try {
// lis
if (this.LocalConfig.patientRegister.printGuideLabel.indexOf('lis') > -1) await this.lisPrint('0002', isPreview, toOutShell)
// pacs
if (this.LocalConfig.patientRegister.printGuideLabel.indexOf('pacs') > -1) await this.pacsPrint('0004', isPreview, toOutShell)
} catch (error) {
console.log(error)
}
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)
})
.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)
})
.catch(err => {
reject(err)
})
.finally(() => {
this.printing = false
})
} else if (this.LocalConfig.patientRegister.printGuideLabel.indexOf('pacs') > -1) {
this.pacsPrint('0004', isPreview, toOutShell)
.then(res => {
resolve(res)
})
.catch(err => {
reject(err)
})
.finally(() => {
this.printing = false
})
} else {
this.printing = false
resolve("success")
}
})
},
// lis
async lisPrint(ReportCode, isPreview, toOutShell) {
lisPrint(ReportCode, isPreview, toOutShell) {
return new Promise((resolve, reject) => {
toOutShell.ReportCode = ReportCode
console.log('this.$peisAPI.print', JSON.stringify(toOutShell))
if (isPreview) {
try {
let lres = await this.$peisAPI.printPre(JSON.stringify(toOutShell))
if (JSON.parse(lres).code < 0) {
this.$message.warning({ showClose: true, message: JSON.parse(lres).message });
}
} catch (error) {
this.$message.warning({ showClose: true, message: `${error}` });
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 {
try {
let lres = await this.$peisAPI.print(JSON.stringify(toOutShell))
if (JSON.parse(lres).code < 0) {
this.$message.warning({ showClose: true, message: JSON.parse(lres).message });
return
this.$peisAPI.print(JSON.stringify(toOutShell))
.then(res => {
if (JSON.parse(res).code < 0) {
reject(JSON.parse(res).message)
} else {
return postapi('/api/app/lisrequest/updatelisrequestisprint', { operateType: 1, patientRegisterId: this.form.id })
}
postapi('/api/app/lisrequest/updatelisrequestisprint', { operateType: 1, patientRegisterId: this.form.id })
})
.then(res => {
if (res && res.code < 0) {
this.$message.error({ showClose: true, message: `更新条码打印状态失败,原因:${res.message}` });
reject(res.message)
} else {
resolve(res)
}
})
} catch (error) {
this.$message.warning({ showClose: true, message: error });
}
.catch(err => {
reject(err)
})
}
})
},
//pacs
pacsPrint(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(res).message });
// this.$message.warning({ showClose: true, message: JSON.parse(res).message });
reject(JSON.parse(res).message)
} else {
resolve(res)
}
})
.catch((err) => {
// console.log('pacs', err)
this.$message.warning({ showClose: true, message: `${err}` });
reject(err)
});
} 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 });
// this.$message.warning({ showClose: true, message: JSON.parse(res).message });
reject(JSON.parse(res).message)
} else {
return postapi("/api/app/lisrequest/updatelisrequestisprint", {
operateType: 1,
@ -2174,14 +2211,19 @@ export default {
})
.then(res => {
if (res && res.code < 0) {
this.$message.error({ showClose: true, message: `${res.message}` });
// this.$message.error({ showClose: true, message: `${res.message}` });
reject(res.message)
} else {
resolve(res)
}
})
.catch((err) => {
// console.log('pacs', err)
this.$message.error({ showClose: true, message: `${err}` });
// this.$message.error({ showClose: true, message: `${err}` });
reject(err)
});
}
});
},
//

Loading…
Cancel
Save