|
|
|
@ -55,14 +55,28 @@ |
|
|
|
/> |
|
|
|
<el-table-column label="操作" align="center" fixed="right"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
icon="el-icon-document" |
|
|
|
@click="handleReport(scope.row)" |
|
|
|
> |
|
|
|
查看报告单 |
|
|
|
</el-button> |
|
|
|
<el-popover placement="bottom" trigger="click"> |
|
|
|
<el-button |
|
|
|
slot="reference" |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
icon="el-icon-document" |
|
|
|
> |
|
|
|
查看报告单 |
|
|
|
</el-button> |
|
|
|
<div> |
|
|
|
<div v-for="(item, index) in reportTemplateList" :key="index"> |
|
|
|
<el-button |
|
|
|
@click="handleReportTemplate(scope.row, item.id, item.type)" |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
> |
|
|
|
{{ item.name }}({{ item.type ? "pdf" : "word" }}) |
|
|
|
</el-button> |
|
|
|
</div> |
|
|
|
<div v-if="!reportTemplateList.length">暂无报告模板</div> |
|
|
|
</div> |
|
|
|
</el-popover> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
@ -79,7 +93,10 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import { exportPdf, queryPdfUrl } from "@/api/report.js"; |
|
|
|
|
|
|
|
import { |
|
|
|
reportTemplateQuery, |
|
|
|
reportExportAll, |
|
|
|
} from "@/api/reportTemplate/index.js"; |
|
|
|
export default { |
|
|
|
name: "Notice", |
|
|
|
|
|
|
|
@ -95,7 +112,9 @@ export default { |
|
|
|
pageSize: 10, |
|
|
|
param: {}, |
|
|
|
}, |
|
|
|
reportTemplateList: [], |
|
|
|
qzUrl: process.env.VUE_APP_BASE_API, |
|
|
|
templateLoading: false, |
|
|
|
}; |
|
|
|
}, |
|
|
|
created() { |
|
|
|
@ -108,8 +127,34 @@ export default { |
|
|
|
}; |
|
|
|
|
|
|
|
this.getList(); |
|
|
|
this.getReportTemplate(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 获取报告单列表 |
|
|
|
getReportTemplate() { |
|
|
|
reportTemplateQuery({ |
|
|
|
pageNum: -1, |
|
|
|
param: { code: "DOCTOR" }, |
|
|
|
}).then((response) => { |
|
|
|
this.reportTemplateList = response.data || []; |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 导出报告单 |
|
|
|
handleReportTemplate(row, id, type) { |
|
|
|
this.loading = true; |
|
|
|
reportExportAll({ |
|
|
|
templateId: id, |
|
|
|
reportId: row.reportId, |
|
|
|
}) |
|
|
|
.then((res) => { |
|
|
|
this.loading = false; |
|
|
|
let path = type ? res.data.path : res.data.word; |
|
|
|
window.open(this.qzUrl + path); |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
this.loading = false; |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 查看报告单 |
|
|
|
handleReport(row) { |
|
|
|
queryPdfUrl({ |
|
|
|
|