Browse Source

dj seo

master
pengjun 2 years ago
parent
commit
295ccc50e2
  1. 164
      src/components/patientRegister/PatientRegisterEdit.vue

164
src/components/patientRegister/PatientRegisterEdit.vue

@ -1480,23 +1480,27 @@ export default {
if (this.patientRegister.photo && this.patientRegister.photo.indexOf("data:image") > -1) savePeoplePhoto(res.data.id, this.patientRegister.photo);
//
// if (!body.id) {
// this.$confirm(" Pacs ?", "", {
// confirmButtonText: "",
// cancelButtonText: "",
// type: "warning",
// })
// .then(() => {
// this.guidePrint('0001', false)
// this.labelPrint(false)
// })
// .catch((err) => {
// // if (err == "cancel") {
// // this.$message.info({ showClose: true, message: "" });
// // }
// });
// }
if (!body.id) {
this.$confirm("是否打印 指引单、检验条码及 Pacs 条码?", "提示", {
confirmButtonText: "是",
cancelButtonText: "否",
type: "warning",
})
.then(async () => {
try {
await this.guidePrint('0001', false)
await this.labelPrint(false)
} catch (error) {
// this.$message.info({ showClose: true, message: error });
console.log(error)
}
})
.catch((err) => {
// if (err == "cancel") {
// this.$message.info({ showClose: true, message: "" });
// }
});
}
}
}
);
@ -1661,37 +1665,22 @@ export default {
this.$message.warning({ showClose: true, message: err});
});
*/
this.$peisAPI.printPre(JSON.stringify(toOutShell))
.then(res => {
// console.log('this.$peisAPI.printPre', 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}` });
});
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 {
// 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.print(JSON.stringify(toOutShell));
// }
// })
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.form.id])
}
})
.then(res => {
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
}
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) {
@ -1701,14 +1690,11 @@ export default {
this.patientRegister.prList[lfind].guidePrintTimes = 1;
}
}
} else {
this.$message.warning({ showClose: true, message: res.message });
}
})
.catch(err => {
this.$message.warning({ showClose: true, message: err });
});
} catch (error) {
this.$message.warning({ showClose: true, message: `${error}` });
}
}
},
@ -1759,7 +1745,7 @@ export default {
},
//(lis + pacs)
labelPrint(isPreview) {
async labelPrint(isPreview) {
if (!this.form.id) {
this.$message.info({ showClose: true, message: "人员信息尚未保存,不可执行此操作!" });
return;
@ -1782,51 +1768,49 @@ export default {
],
};
// lis
this.lisPrint('0002', isPreview, toOutShell)
try {
// lis
await this.lisPrint('0002', isPreview, toOutShell)
// pacs
await this.pacsPrint('0004', isPreview, toOutShell)
} catch (error) {
console.log(error)
}
// pacs
this.pacsPrint('0004', isPreview, toOutShell)
},
// lis
lisPrint(ReportCode, isPreview, toOutShell) {
async lisPrint(ReportCode, isPreview, toOutShell) {
toOutShell.ReportCode = ReportCode
// console.log('this.$peisAPI.print', toOutShell)
if (isPreview) {
this.$peisAPI.printPre(JSON.stringify(toOutShell))
.then(res => {
let lres = JSON.parse(res)
// console.log('this.$peisAPI.printPre', lres)
if (lres.code < 0) {
// console.log('', lres.message)
this.$message.warning({ showClose: true, message: lres.message });
}
})
.catch((err) => {
// console.log('', 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 {
this.$peisAPI.print(JSON.stringify(toOutShell))
.then(res => {
let lres = JSON.parse(res)
// console.log('', lres)
if (res && lres.code > -1) {
return postapi('/api/app/lisrequest/updatelisrequestisprint', { operateType: 1, patientRegisterId: this.form.id })
} else {
this.$message.warning({ showClose: true, message: lres.message });
}
})
.then(res => {
if (res && res.code < 0) {
this.$message.error({ showClose: true, message: `更新条码打印状态失败,原因:${res.message}` });
}
})
.catch(err => {
this.$message.warning({ showClose: true, message: `${err}` });
});
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
}
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}` });
}
})
} catch (error) {
this.$message.warning({ showClose: true, message: error });
}
}
},

Loading…
Cancel
Save