|
@@ -3,8 +3,7 @@
|
3
|
3
|
<div class="cell clearfix">
|
4
|
4
|
<el-form :inline="true" :model="listQuery">
|
5
|
5
|
<el-form-item label>
|
6
|
|
- <!-- <el-input v-model.trim="listQuery.search" placeholder="姓名/透析号" style="width:150px"></el-input>
|
7
|
|
- <el-button type="primary" @click="onSearch" icon="el-icon-search">搜索</el-button> -->
|
|
6
|
+
|
8
|
7
|
<el-autocomplete
|
9
|
8
|
class="checkSearch"
|
10
|
9
|
popper-class="my-autocomplete"
|
|
@@ -70,6 +69,7 @@
|
70
|
69
|
</div>
|
71
|
70
|
<div style="padding-left:10px;flex:1">
|
72
|
71
|
<div class="tableTitle">统计表</div>
|
|
72
|
+ <div><el-button type="primary" @click="exportList">导出</el-button></div>
|
73
|
73
|
<el-table :data="DialysisData" style="width: 100%" border :row-style="{ color: '#303133' }"
|
74
|
74
|
:header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
|
75
|
75
|
>
|
|
@@ -280,7 +280,7 @@ export default {
|
280
|
280
|
}
|
281
|
281
|
})
|
282
|
282
|
let list = Object.values(dataInfo)
|
283
|
|
- // console.log("arr",list)
|
|
283
|
+
|
284
|
284
|
list.map(item => {
|
285
|
285
|
for (let i = 0; i < prescriptionList.length; i++) {
|
286
|
286
|
if (item.patient_id === prescriptionList[i].patient_id) {
|
|
@@ -462,7 +462,40 @@ export default {
|
462
|
462
|
var strs = str.substring(0, str.length - 1)
|
463
|
463
|
|
464
|
464
|
return strs
|
465
|
|
- }
|
|
465
|
+ },
|
|
466
|
+ exportList(){
|
|
467
|
+ console.log("DialysisData",this.DialysisData)
|
|
468
|
+ for(let i=0;i<this.DialysisData.length;i++){
|
|
469
|
+ this.DialysisData[i].index = i+1
|
|
470
|
+ this.DialysisData[i].dialysis_mode = this.getModeIdCount(this.DialysisData[i].patient_id)
|
|
471
|
+ this.DialysisData[i].age = this.getAge(this.DialysisData[i].id_card_no)
|
|
472
|
+ }
|
|
473
|
+ import('@/vendor/Export2Excel').then(excel => {
|
|
474
|
+ const tHeader = ['序号','姓名', '年龄', '透析号','透析模式','透析总次数']
|
|
475
|
+ const filterVal = ['index','name', 'age', 'dialysis_no','dialysis_mode','total_dialysis']
|
|
476
|
+
|
|
477
|
+ const data = this.formatJson(filterVal, this.DialysisData)
|
|
478
|
+
|
|
479
|
+ excel.export_json_to_excel({
|
|
480
|
+ header: tHeader,
|
|
481
|
+ data,
|
|
482
|
+ filename: '透析详情'
|
|
483
|
+ })
|
|
484
|
+ this.downloadLoading = false
|
|
485
|
+ })
|
|
486
|
+ },
|
|
487
|
+ formatJson(filterVal, jsonData) {
|
|
488
|
+ return jsonData.map(v =>
|
|
489
|
+ filterVal.map(j => {
|
|
490
|
+ if (j === "timestamp") {
|
|
491
|
+ return parseTime(v[j]);
|
|
492
|
+ } else {
|
|
493
|
+ return v[j];
|
|
494
|
+ }
|
|
495
|
+ })
|
|
496
|
+ );
|
|
497
|
+ }
|
|
498
|
+
|
466
|
499
|
},
|
467
|
500
|
created(){
|
468
|
501
|
var nowDate = new Date();
|