Browse Source

评估报告下载改为打印

new-ays
liuzhipeng 3 months ago
parent
commit
786881b9f4
  1. 23
      acupuncture-前台/src/views/medicalFile/index.vue

23
acupuncture-前台/src/views/medicalFile/index.vue

@ -610,6 +610,12 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-dialog> </el-dialog>
<iframe
:src="reportPath"
frameborder="0"
:id="'codePartIframe' + timestamp"
style="display: none"
></iframe>
</div> </div>
</template> </template>
@ -631,6 +637,9 @@ export default {
dicts: ["sys_normal_disable", "sys_user_sex"], dicts: ["sys_normal_disable", "sys_user_sex"],
data() { data() {
return { return {
reportPath: "",
timestamp: "",
qzUrl: process.env.VUE_APP_API_QZURL, // qzUrl: process.env.VUE_APP_API_QZURL, //
userInfo: {}, userInfo: {},
// //
@ -1096,9 +1105,21 @@ export default {
}, },
// //
handleReport(row) { handleReport(row) {
try {
this.timestamp = new Date().getTime();
exportTreatmentPg({ treatmentId: row.id }).then((res) => { exportTreatmentPg({ treatmentId: row.id }).then((res) => {
window.open(`${process.env.VUE_APP_API_QZURL}${res.data}`); this.reportPath = `${process.env.VUE_APP_API_QZURL}${res.data}`;
var iframe = document.getElementById(
"codePartIframe" + this.timestamp
);
iframe.onload = () => {
iframe.contentWindow.print();
};
// window.open(`${process.env.VUE_APP_API_QZURL}${res.data}`);
}); });
} catch (error) {
console.log("error: ", error);
}
}, },
/** 提交审核 */ /** 提交审核 */
handleExamine(row, _status) { handleExamine(row, _status) {

Loading…
Cancel
Save