|
|
|
@ -60,60 +60,76 @@ |
|
|
|
<el-button @click="onPrint" size="small" class="commonbutton">打印</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-show="format == 0" ref="imageDom0"> |
|
|
|
<div v-show="format == 0" ref="imageDom0" id="imageDom0"> |
|
|
|
<div style="background-color: #fff; padding: 15px; border-radius: 8px;"> |
|
|
|
<div style="font-size: 14px;"> |
|
|
|
<div>阳性结果人员清单</div> |
|
|
|
<div>{{ "开始时间: " + (summary.startDate || '') + " 结束时间: " + (summary.endDate || '') }}</div> |
|
|
|
<div style="display: flex;justify-content: space-between;"> |
|
|
|
<div>{{ "阳性人数:男性:" + summary.maleCount + "人 女性: " + summary.femaleCount + "人;共:" + |
|
|
|
(summary.maleCount + summary.femaleCount) + "人。" }}</div> |
|
|
|
<div>{{ "检查人数:男性:" + |
|
|
|
summary.registerMaleCount + "人 女性: " + summary.registerFemaleCount + "人;共:" + |
|
|
|
(summary.registerMaleCount + summary.registerFemaleCount) + "人。" }}</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-table border :height="flag |
|
|
|
? window.pageHeight < 600 |
|
|
|
? 415 |
|
|
|
: window.pageHeight - 185 - 25 : '' |
|
|
|
? 350 |
|
|
|
: window.pageHeight - 185 - 90 : '' |
|
|
|
" :data="dataList" id="projectTableData" ref="projectTableData" style="width: 100%" show-summary |
|
|
|
:summary-method="getSummaries"> |
|
|
|
<el-table-column label="阳性结果人员清单"> |
|
|
|
<el-table-column |
|
|
|
align="left"> |
|
|
|
<template slot="header"> |
|
|
|
<div> |
|
|
|
<div>{{ "开始时间: " + summary.startDate || '' +" 结束时间: " + summary.endDate || ''}}</div> |
|
|
|
<div>{{ "阳性人数:男性:" + summary.maleCount + "人 女性: " + summary.femaleCount + "人;总人数:男性:" + summary.registerMaleCount + "人 女性: " + summary.registerFemaleCount + "人。"}}</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<el-table-column align="left"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-table :data="scope.row.patientRegisters" border :span-method="objectProjectSpanMethod" |
|
|
|
show-summary :summary-method="summarizeRegisterCount"> |
|
|
|
<el-table-column :label="scope.row.diagnosisName"> |
|
|
|
<el-table-column label="部门名称" prop="departmentName" width="300"></el-table-column> |
|
|
|
<el-table-column label="姓名" prop="patientName"></el-table-column> |
|
|
|
<el-table-column label="性别" prop="sexName"></el-table-column> |
|
|
|
<el-table-column prop="age" label="年龄"> |
|
|
|
<el-table-column label="姓名" prop="patientName" align="center"></el-table-column> |
|
|
|
<el-table-column label="性别" prop="sexName" align="center"></el-table-column> |
|
|
|
<el-table-column prop="age" label="年龄" align="center"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="patientRegisterNo" label="条码号"> |
|
|
|
<el-table-column prop="patientRegisterNo" label="条码号" align="center" |
|
|
|
:formatter="forceStringFormatter"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="patientNo" label="档案号"> |
|
|
|
<el-table-column prop="patientNo" label="档案号" align="center" :formatter="forceStringFormatter"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="medicalTimes" label="体检次数"> |
|
|
|
<el-table-column prop="medicalTimes" label="体检次数" align="center"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="telephone" label="电话"> |
|
|
|
<el-table-column prop="telephone" label="电话" align="center" :formatter="forceStringFormatter"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="mobileTelephone" label="手机号"> |
|
|
|
<el-table-column prop="mobileTelephone" label="手机号" align="center" |
|
|
|
:formatter="forceStringFormatter"> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-show="format == 1" ref="imageDom1"> |
|
|
|
<div v-show="format == 1" ref="imageDom1" id="imageDom1"> |
|
|
|
<div style="background-color: #fff; padding: 15px; border-radius: 8px;"> |
|
|
|
<div style="font-size: 14px;"> |
|
|
|
<div>阳性结果人员清单</div> |
|
|
|
<div>{{ "开始时间: " + (summary.startDate || '') + " 结束时间: " + (summary.endDate || '') }}</div> |
|
|
|
<div style="display: flex;justify-content: space-between;"> |
|
|
|
<div>{{ "阳性人数:男性:" + summary.maleCount + "人 女性: " + summary.femaleCount + "人;共:" + |
|
|
|
(summary.maleCount + summary.femaleCount) + "人。" }}</div> |
|
|
|
<div>{{ "检查人数:男性:" + |
|
|
|
summary.registerMaleCount + "人 女性: " + summary.registerFemaleCount + "人;共:" + |
|
|
|
(summary.registerMaleCount + summary.registerFemaleCount) + "人。" }}</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-table border :height="flag |
|
|
|
? window.pageHeight < 600 ? 415 : window.pageHeight - 185 - 25 : '' |
|
|
|
? window.pageHeight < 600 ? 350 : window.pageHeight - 185 - 90 : '' |
|
|
|
" :data="dataLists" id="standardTableData" ref="standardTableData" style="width: 100%" show-summary |
|
|
|
:summary-method="getSummaris"> |
|
|
|
<el-table-column label="阳性结果人员清单"> |
|
|
|
<el-table-column |
|
|
|
:label="`开始时间: ${summary.startDate || ''} 结束时间:${summary.endDate || ''}体检人员共计: ${(summary.maleCount + summary.femaleCount)}人 男性: ${summary.maleCount}人 女性: ${summary.femaleCount}人`" |
|
|
|
align="left"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-table-column prop="diagnosisName" label="诊断名称"></el-table-column> |
|
|
|
<el-table-column prop="patientNameDetail" label="人员清单"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
@ -130,8 +146,8 @@ |
|
|
|
<span>{{ scope.row.percentage }}%</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
|
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -154,6 +170,7 @@ import moment from "moment"; |
|
|
|
import { mapState, mapActions } from "vuex"; |
|
|
|
import { getapi, postapi, putapi, deletapi } from "@/api/api"; |
|
|
|
import { exportToExcel } from "../../utlis/Export2Excel"; |
|
|
|
import FileSaver from 'file-saver'; |
|
|
|
import html2canvas from "html2canvas"; |
|
|
|
import printJs from "print-js"; |
|
|
|
import { |
|
|
|
@ -208,6 +225,14 @@ export default { |
|
|
|
methods: { |
|
|
|
moment, |
|
|
|
dddw, |
|
|
|
|
|
|
|
// 强制将单元格值转换为字符串 |
|
|
|
forceStringFormatter(row, column, cellValue) { |
|
|
|
// console.log('row, column, cellValue',row, column.property, cellValue) |
|
|
|
// 如果 cellValue 存在,则转为字符串;否则返回原值 |
|
|
|
return cellValue ? "\u200C" + String(cellValue) : cellValue |
|
|
|
}, |
|
|
|
|
|
|
|
//数据初始化 |
|
|
|
dictInit() { |
|
|
|
//体检中心 |
|
|
|
@ -455,6 +480,8 @@ export default { |
|
|
|
this.summary.endDate = res.data.endDate; |
|
|
|
this.summary.femaleCount = res.data.femaleCount; |
|
|
|
this.summary.maleCount = res.data.maleCount; |
|
|
|
this.summary.registerMaleCount = res.data.registerMaleCount; |
|
|
|
this.summary.registerFemaleCount = res.data.registerFemaleCount; |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.standardTableData.doLayout(); |
|
|
|
}); |
|
|
|
@ -497,18 +524,37 @@ page-break-before: avoid;}}`, // 去除页眉页脚 |
|
|
|
}); |
|
|
|
}, |
|
|
|
handleExport() { |
|
|
|
if (this.format == 0) { |
|
|
|
let index = 3; |
|
|
|
let list = []; |
|
|
|
list.push(index); |
|
|
|
for (let i = 0; i < this.dataList.length - 1; i++) { |
|
|
|
index += this.dataList[i].patientRegisters.length + 4; |
|
|
|
list.push(index); |
|
|
|
} |
|
|
|
exportToExcel("#projectTableData", "阳性结果人员清单", true, list); |
|
|
|
} else if (this.format == 1) { |
|
|
|
exportToExcel("#standardTableData", "阳性结果人员清单", false); |
|
|
|
} |
|
|
|
// if (this.format == 0) { |
|
|
|
// let index = 3; |
|
|
|
// let list = []; |
|
|
|
// list.push(index); |
|
|
|
// for (let i = 0; i < this.dataList.length - 1; i++) { |
|
|
|
// index += this.dataList[i].patientRegisters.length + 4; |
|
|
|
// list.push(index); |
|
|
|
// } |
|
|
|
// exportToExcel("#projectTableData", "阳性结果人员清单", true, list); |
|
|
|
// } else if (this.format == 1) { |
|
|
|
// exportToExcel("#standardTableData", "阳性结果人员清单", false); |
|
|
|
// } |
|
|
|
|
|
|
|
//通用导出 |
|
|
|
// 获取HTML元素(表格) |
|
|
|
// let table = document.getElementById(elId); //.cloneNode(true) |
|
|
|
this.$nextTick(() => { |
|
|
|
// let refsTable = this.$refs[elId] //.cloneNode(true) true |
|
|
|
let table = document.getElementById('imageDom' + String(this.format)) |
|
|
|
// console.log('table,refsTable', table, refsTable) |
|
|
|
|
|
|
|
let tableData = table.innerHTML |
|
|
|
let fileName = moment(new Date()).format('yyyyMMDDHHmmss') |
|
|
|
|
|
|
|
let blob = new Blob([tableData], { type: "text/plain;charset=utf-8" }); |
|
|
|
|
|
|
|
FileSaver.saveAs(blob, fileName + '.xls'); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|