pengjun 4 weeks ago
parent
commit
91829bdc78
  1. 184
      src/views/customerReport/positiveResultsList.vue
  2. 2
      src/views/customerReport/unitSettlement.vue
  3. 117
      src/views/report/report.vue

184
src/views/customerReport/positiveResultsList.vue

@ -60,78 +60,94 @@
<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>
<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>
<el-table-column prop="patientRegisterNo" label="条码号">
</el-table-column>
<el-table-column prop="patientNo" label="档案号">
</el-table-column>
<el-table-column prop="medicalTimes" label="体检次数">
</el-table-column>
<el-table-column prop="telephone" label="电话">
</el-table-column>
<el-table-column prop="mobileTelephone" label="手机号">
</el-table-column>
<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" 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="条码号" align="center"
:formatter="forceStringFormatter">
</el-table-column>
<el-table-column prop="patientNo" label="档案号" align="center" :formatter="forceStringFormatter">
</el-table-column>
</el-table>
</template>
</el-table-column>
<el-table-column prop="medicalTimes" label="体检次数" align="center">
</el-table-column>
<el-table-column prop="telephone" label="电话" align="center" :formatter="forceStringFormatter">
</el-table-column>
<el-table-column prop="mobileTelephone" label="手机号" align="center"
:formatter="forceStringFormatter">
</el-table-column>
</el-table-column>
</el-table>
</template>
</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">
<div style="display: flex;flex-direction: row;flex-wrap: wrap;">
<span v-for="(item, index) in scope.row.patientNameDetail" :key="index"
style="width:20%;text-align: center;">{{ item }}{{ index + 1 ==
scope.row.patientNameDetail.length ? '' : ',' }}</span>
</div>
</template>
</el-table-column>
<el-table-column prop="patientCount" label="人数" align="center"></el-table-column>
<el-table-column prop="percentage" label="占百分比" align="center">
<template slot-scope="scope">
<span>{{ scope.row.percentage }}%</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="diagnosisName" label="诊断名称"></el-table-column>
<el-table-column prop="patientNameDetail" label="人员清单">
<template slot-scope="scope">
<div style="display: flex;flex-direction: row;flex-wrap: wrap;">
<span v-for="(item, index) in scope.row.patientNameDetail" :key="index"
style="width:20%;text-align: center;">{{ item }}{{ index + 1 ==
scope.row.patientNameDetail.length ? '' : ',' }}</span>
</div>
</template>
</el-table-column>
<el-table-column prop="patientCount" label="人数" align="center"></el-table-column>
<el-table-column prop="percentage" label="占百分比" align="center">
<template slot-scope="scope">
<span>{{ scope.row.percentage }}%</span>
</template>
</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');
})
},
},

2
src/views/customerReport/unitSettlement.vue

@ -365,7 +365,7 @@ page-break-before: avoid;}}`, // 去除页眉页脚
//
forceStringFormatter(row, column, cellValue) {
console.log('row, column, cellValue',row, column.property, cellValue)
// console.log('row, column, cellValue',row, column.property, cellValue)
// cellValue
return cellValue ? "\u200C" + String(cellValue) : cellValue
},

117
src/views/report/report.vue

@ -23,7 +23,7 @@
<div @contextmenu.prevent="onContextmenu" id="report_tjbg">
<u-table :data="tableDatas" border ref="info" id="info"
:height="(window.pageHeight < 600) ? 230 : (window.pageHeight - 370)" highlight-current-row
@row-click="rowClick" size="small" row-key="patientRegisterId"
@row-click="rowClick" size="small" row-key="patientRegisterId" @sort-change="handleSortChange"
@selection-change="handleSelectionChange" @row-contextmenu="rowContextmenu"
@table-body-scroll="scrollFull" use-virtual :row-height="35" big-data-checkbox
:data-changes-scroll-top="false">
@ -59,7 +59,7 @@
</div>
<!-- String(scope.row[dragCol[index]?.prop]||'') 屏蔽没有字段-->
<div v-else>
{{ '\u200C' + String(scope.row[dragCol[index]?.prop]||'') }}
{{ '\u200C' + String(scope.row[dragCol[index]?.prop] || '') }}
</div>
</template>
@ -75,8 +75,6 @@
</div>
</div>
</div>
</div>
<div :style="'background-color: #fff;padding: 10px;border-radius: 8px;margin-left: 10px;width:' +
Math.floor((window.pageWidth - 110 - 45 - 8) / 4) +
@ -133,7 +131,7 @@
</el-dropdown-menu>
</el-dropdown>
</div>
<div class="listBtn" v-if="false">
<div class="listBtn" v-if="true">
<el-button type="primary" class="commonbutton" @click="btnTest">test</el-button>
</div>
</div>
@ -421,21 +419,56 @@ export default {
// }
// },
//
handleSortChange({column, prop, order}) {
// column:
// prop: prop
// order: 'ascending', 'descending', null
console.log('排序变化:', column, prop, order)
//
if (order) {
this.tableDatas.sort((a, b) => {
let valA = a[prop], valB = b[prop]
if (typeof valA == 'string') {
if (['patientName', 'org', 'dept', 'address', 'remark'].includes(prop)) {
if (order === 'ascending') {
return valA.localeCompare(valB, 'zh');
} else {
return valB.localeCompare(valA, 'zh');
}
} else {
if (order === 'ascending') {
return valA.localeCompare(valB);
} else {
return valB.localeCompare(valA);
}
}
} else {
if (order === 'ascending') {
return valB > valB ? 1 : -1
} else {
return valA < valB ? 1 : -1
}
}
})
}
},
//
chineseSort(a, b, colName) {
// console.log('a, b', a, b)
// const pinyinA = pinyin(a[colName], { style: pinyin.STYLE_NORMAL }).join('');
// const pinyinB = pinyin(b[colName], { style: pinyin.STYLE_NORMAL }).join('');
let valA = a[colName],valB = b[colName]
if (typeof valA == 'string'){
let valA = a[colName], valB = b[colName]
if (typeof valA == 'string') {
//
if(['patientName','org','dept','address','remark'].includes(colName)){
return valA.localeCompare(valB,'zh');
}else{
if (['patientName', 'org', 'dept', 'address', 'remark'].includes(colName)) {
return valA.localeCompare(valB, 'zh');
} else {
return valA.localeCompare(valB);
}
}else{
} else {
return valA - valB
}
},
@ -1123,7 +1156,8 @@ export default {
this.upTsjh()
break;
default: //lis
this.btnExport('report_tjbg')
this.btnExport('report_tjbg') //
this.btnExportV() //
break;
}
},
@ -1645,7 +1679,7 @@ export default {
return rd;
},
//
//
btnExport(elId) {
let table = document.getElementById(elId);
let tableData = table.innerHTML
@ -1654,6 +1688,61 @@ export default {
FileSaver.saveAs(blob, fileName);
},
btnExportV() {
require.ensure([], () => {
const tHeader = [];
const filterVal = [];
this.dragCol.forEach((e) => {
tHeader.push(e.label);
filterVal.push(e.prop);
});
const list = this.tableDatas.map((row, index) => {
const newRow = { ...row }; //
// 使
newRow.sn = index + 1;
if (newRow.completeFlag)
newRow.completeFlag =
newRow.isAudit == "Y"
? "已审核"
: dddw(
this.dict.completeFlag,
"id",
newRow.completeFlag,
"displayName"
);
newRow.isReportPrint = newRow.isReportPrint == "Y" ? "√" : "";
if (newRow.idNo) newRow.idNo = "\u200C" + newRow.idNo;
if (newRow.patientRegisterNo)
newRow.patientRegisterNo = "\u200C" + newRow.patientRegisterNo;
if (newRow.patientNo) newRow.patientNo = "\u200C" + newRow.patientNo;
if (newRow.isLock) newRow.isLock = newRow.isLock == "Y" ? "√" : "";
if (newRow.isVip) newRow.isVip = newRow.isVip == "Y" ? "√" : "";
if (newRow.isUpload)
newRow.isUpload = newRow.isUpload == "Y" ? "√" : "";
if (newRow.isUploadAppoint)
newRow.isUploadAppoint = newRow.isUploadAppoint == "Y" ? "√" : "";
if (newRow.isReceiveReport)
newRow.isReceiveReport = newRow.isReceiveReport == "Y" ? "√" : "";
if (newRow.birthDate)
newRow.birthDate = moment(newRow.birthDate).format("yyyy-MM-DD");
return newRow;
});
const data = list.map((v) => filterVal.map((j) => v[j]));
exportJsonToExcel(
tHeader,
data,
"人员列表" + moment(new Date()).format("yyyyMMDDHHmmss")
); //"excel"
});
},
},
//

Loading…
Cancel
Save