3 changed files with 173 additions and 57 deletions
@ -0,0 +1,77 @@ |
|||
<template> |
|||
<div class="container" v-loading="loading"> |
|||
<div v-if="pdfPath"> |
|||
<pdf :pdfPath="pdfPath"></pdf> |
|||
</div> |
|||
<div v-else class="zw">未查询到报告单</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { exportPdf } from "@/api/report.js"; |
|||
import pdf from "./components/pdf.vue"; |
|||
export default { |
|||
components: { |
|||
pdf, |
|||
}, |
|||
data() { |
|||
return { |
|||
loading: false, |
|||
qzUrl: process.env.VUE_APP_BASE_API, |
|||
pdfPath: null, |
|||
}; |
|||
}, |
|||
|
|||
methods: { |
|||
// 下载 |
|||
handleDownload() { |
|||
if (this.pdfPath) { |
|||
window.open(this.pdfPath); |
|||
} |
|||
}, |
|||
// 查询 |
|||
async getExportPdf() { |
|||
this.loading = true; |
|||
exportPdf({ |
|||
patientNo: this.$route.query.patient_no, |
|||
emplCode: this.$route.query.empl_code, |
|||
}) |
|||
.then((res) => { |
|||
this.loading = false; |
|||
this.pdfPath = null; |
|||
if (res.data) { |
|||
this.$modal.msgSuccess("查询成功"); |
|||
this.pdfPath = this.qzUrl + res.data; |
|||
} |
|||
}) |
|||
.catch((error) => { |
|||
this.loading = false; |
|||
this.$modal.msgError("查询失败"); |
|||
}); |
|||
}, |
|||
}, |
|||
created() { |
|||
let deptId = this.$route.query.deptId || 106; |
|||
localStorage.setItem("hospitalId", deptId); |
|||
this.getExportPdf(); |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.zw { |
|||
font-size: 100px; |
|||
color: #b0b0b0; |
|||
} |
|||
.container { |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
height: 100vh; |
|||
padding: 16px; |
|||
background: url("./back.png"); |
|||
background-size: cover; |
|||
background-repeat: no-repeat; |
|||
} |
|||
</style> |
|||
<style></style> |
|||
Loading…
Reference in new issue