|
@@ -21,6 +21,7 @@
|
21
|
21
|
align="right"
|
22
|
22
|
format="yyyy-MM-dd"
|
23
|
23
|
value-format="yyyy-MM-dd"
|
|
24
|
+ :picker-options="pickerOptions"
|
24
|
25
|
></el-date-picker>
|
25
|
26
|
<span class>-</span>
|
26
|
27
|
<el-date-picker
|
|
@@ -34,12 +35,18 @@
|
34
|
35
|
align="right"
|
35
|
36
|
format="yyyy-MM-dd"
|
36
|
37
|
value-format="yyyy-MM-dd"
|
|
38
|
+ :picker-options="pickerOptions"
|
37
|
39
|
></el-date-picker>
|
38
|
40
|
</div>
|
39
|
41
|
<el-container>
|
40
|
42
|
<div style="width:150px">
|
41
|
43
|
<div class="tableTitle">患者列表</div>
|
42
|
|
- <el-table :data="patientsData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
|
|
44
|
+ <el-table :data="patientsData" border style="width: 100%;"
|
|
45
|
+ height="500" :row-style="{ color: '#303133' }"
|
|
46
|
+ :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
|
|
47
|
+ highlight-current-row
|
|
48
|
+ @current-change="handleChange"
|
|
49
|
+ >
|
43
|
50
|
<el-table-column prop="dialysis_no" label="透析号" width="80">
|
44
|
51
|
<template slot-scope="scope">{{scope.row.dialysis_no}}</template>
|
45
|
52
|
</el-table-column>
|
|
@@ -62,7 +69,7 @@
|
62
|
69
|
<script>
|
63
|
70
|
import echarts from "echarts";
|
64
|
71
|
import LineChart from "../../components/LineChart";
|
65
|
|
-import { getCurrentOrgPatients } from "@/api/common/common";
|
|
72
|
+import { getCurrentOrgPatients,getInspectionTotalCount,getInspectionDetailById,getSearchPatientInfo } from "@/api/common/common";
|
66
|
73
|
export default {
|
67
|
74
|
components: {
|
68
|
75
|
LineChart
|
|
@@ -75,80 +82,9 @@ export default {
|
75
|
82
|
page: 1,
|
76
|
83
|
limit: 10
|
77
|
84
|
},
|
78
|
|
- options: [
|
79
|
|
- {
|
80
|
|
- value: "选项1",
|
81
|
|
- label: "黄金糕"
|
82
|
|
- },
|
83
|
|
- {
|
84
|
|
- value: "选项2",
|
85
|
|
- label: "双皮奶"
|
86
|
|
- },
|
87
|
|
- {
|
88
|
|
- value: "选项3",
|
89
|
|
- label: "蚵仔煎"
|
90
|
|
- },
|
91
|
|
- {
|
92
|
|
- value: "选项4",
|
93
|
|
- label: "龙须面"
|
94
|
|
- },
|
95
|
|
- {
|
96
|
|
- value: "选项5",
|
97
|
|
- label: "北京烤鸭"
|
98
|
|
- }
|
99
|
|
- ],
|
100
|
85
|
value: "请选项",
|
101
|
|
- tableData: [
|
102
|
|
- {
|
103
|
|
- date: "2016",
|
104
|
|
- name: "王小虎"
|
105
|
|
- },
|
106
|
|
- {
|
107
|
|
- date: "2016",
|
108
|
|
- name: "王小虎"
|
109
|
|
- },
|
110
|
|
- {
|
111
|
|
- date: "2016",
|
112
|
|
- name: "王小虎"
|
113
|
|
- },
|
114
|
|
- {
|
115
|
|
- date: "2016",
|
116
|
|
- name: "王小虎"
|
117
|
|
- },
|
118
|
|
- {
|
119
|
|
- date: "2016",
|
120
|
|
- name: "王小虎"
|
121
|
|
- },
|
122
|
|
- {
|
123
|
|
- date: "2016",
|
124
|
|
- name: "王小虎"
|
125
|
|
- },
|
126
|
|
- {
|
127
|
|
- date: "2016",
|
128
|
|
- name: "王小虎"
|
129
|
|
- },
|
130
|
|
- {
|
131
|
|
- date: "2016",
|
132
|
|
- name: "王小虎"
|
133
|
|
- },
|
134
|
|
- {
|
135
|
|
- date: "2016",
|
136
|
|
- name: "王小虎"
|
137
|
|
- },
|
138
|
|
- {
|
139
|
|
- date: "2016",
|
140
|
|
- name: "王小虎"
|
141
|
|
- },
|
142
|
|
- {
|
143
|
|
- date: "2016",
|
144
|
|
- name: "王小虎"
|
145
|
|
- },
|
146
|
|
- {
|
147
|
|
- date: "2016",
|
148
|
|
- name: "王小虎"
|
149
|
|
- }
|
150
|
|
- ],
|
151
|
86
|
patientsData:[],
|
|
87
|
+ tableData:[],
|
152
|
88
|
chart: {
|
153
|
89
|
title: {
|
154
|
90
|
text: "ECharts 入门示例"
|
|
@@ -234,7 +170,13 @@ export default {
|
234
|
170
|
}
|
235
|
171
|
}
|
236
|
172
|
]
|
237
|
|
- }
|
|
173
|
+ },
|
|
174
|
+ pickerOptions: {
|
|
175
|
+ disabledDate(time) {
|
|
176
|
+ let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
|
|
177
|
+ return time.getTime() > Date.now() || time.getTime() < threeMonths;;
|
|
178
|
+ }
|
|
179
|
+ },
|
238
|
180
|
};
|
239
|
181
|
},
|
240
|
182
|
methods: {
|
|
@@ -253,11 +195,93 @@ export default {
|
253
|
195
|
var patients = response.data.data.patients
|
254
|
196
|
this.patientsData = patients
|
255
|
197
|
})
|
|
198
|
+ },
|
|
199
|
+ getInspectionTotalCount(){
|
|
200
|
+ getInspectionTotalCount(this.listQuery.start_time,this.listQuery.end_time).then(response=>{
|
|
201
|
+ if(response.data.state === 1){
|
|
202
|
+ var Inspection = response.data.data.Inspection
|
|
203
|
+ this.tableData = Inspection
|
|
204
|
+ console.log("Inspection",Inspection)
|
|
205
|
+ var counts = response.data.data.counts
|
|
206
|
+ console.log("counts",counts)
|
|
207
|
+ var arr = []
|
|
208
|
+ for(let i=0;i<Inspection.length;i++){
|
|
209
|
+ for(let j=0;j<counts.length;j++){
|
|
210
|
+ if(Inspection[i].inspection_major == counts[j].ProjectId){
|
|
211
|
+ arr.push(counts[j])
|
|
212
|
+ }
|
|
213
|
+ }
|
|
214
|
+ }
|
|
215
|
+ console.log("arr",arr)
|
|
216
|
+
|
|
217
|
+ }
|
|
218
|
+ })
|
|
219
|
+ },
|
|
220
|
+
|
|
221
|
+ //获取单个病人数据
|
|
222
|
+ handleChange(val){
|
|
223
|
+ getInspectionDetailById(val.id,this.listQuery.start_time,this.listQuery.end_time).then(response=>{
|
|
224
|
+ if(response.data.state === 1){
|
|
225
|
+ var patientdetail = response.data.data.patientdetail
|
|
226
|
+ console.log("patientdetail",patientdetail)
|
|
227
|
+ var arr=[]
|
|
228
|
+ for(let i=0;i<this.tableData.length;i++){
|
|
229
|
+ for(let j=0;j<patientdetail.length;j++){
|
|
230
|
+ if(this.tableData[i].inspection_major == patientdetail[j].ProjectId){
|
|
231
|
+ arr.push(patientdetail[j])
|
|
232
|
+ }
|
|
233
|
+ }
|
|
234
|
+ }
|
|
235
|
+ console.log("arr",arr)
|
|
236
|
+ }
|
|
237
|
+ })
|
|
238
|
+ },
|
|
239
|
+
|
|
240
|
+ //搜索功能
|
|
241
|
+ onSearch(){
|
|
242
|
+ getSearchPatientInfo(this.listQuery.search,this.listQuery.start_time,this.listQuery.end_time).then(response=>{
|
|
243
|
+ if(response.data.state === 1){
|
|
244
|
+ var PatientsInfo = response.data.data.PatientsInfo
|
|
245
|
+ console.log("PatientsInfo",PatientsInfo)
|
|
246
|
+ var arr = []
|
|
247
|
+ for(let i=0;i<this.tableData.length;i++){
|
|
248
|
+ for(let j=0;j<PatientsInfo.length;j++){
|
|
249
|
+ if(this.tableData[i].inspection_major == PatientsInfo[j].ProjectId){
|
|
250
|
+ arr.push(PatientsInfo[j])
|
|
251
|
+ }
|
|
252
|
+ }
|
|
253
|
+ }
|
|
254
|
+ console.log("arr",arr)
|
|
255
|
+ }
|
|
256
|
+ })
|
256
|
257
|
}
|
257
|
258
|
},
|
258
|
259
|
created(){
|
|
260
|
+ var nowDate = new Date();
|
|
261
|
+ var nowYear = nowDate.getFullYear();
|
|
262
|
+ var nowMonth = nowDate.getMonth() + 1;
|
|
263
|
+ var nowDay = nowDate.getDate();
|
|
264
|
+ this.listQuery.end_time =
|
|
265
|
+ nowYear +
|
|
266
|
+ "-" +
|
|
267
|
+ (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
|
|
268
|
+ "-" +
|
|
269
|
+ (nowDay < 10 ? "0" + nowDay : nowDay);
|
|
270
|
+ nowDate.setMonth(nowDate.getMonth() - 3);
|
|
271
|
+ nowYear = nowDate.getFullYear();
|
|
272
|
+ nowMonth = nowDate.getMonth() + 1;
|
|
273
|
+ nowDay = nowDate.getDate();
|
|
274
|
+ this.listQuery.start_time =
|
|
275
|
+ nowYear +
|
|
276
|
+ "-" +
|
|
277
|
+ (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
|
|
278
|
+ "-" +
|
|
279
|
+ (nowDay < 10 ? "0" + nowDay : nowDay);
|
|
280
|
+
|
259
|
281
|
//获取该机构下的所有患者
|
260
|
282
|
this.getCurrentOrgPatients()
|
|
283
|
+ //获取检验检查项目
|
|
284
|
+ this.getInspectionTotalCount()
|
261
|
285
|
}
|
262
|
286
|
};
|
263
|
287
|
</script>
|