Ver código fonte

Merge branch 'vue_statistics_branch' of http://git.shengws.com/csx/Vue_New into vue_statistics_branch

XMLWAN 4 anos atrás
pai
commit
775d370c04

+ 149 - 183
src/xt_pages/qcd/treatmentControlAnalysis/components/TimePersonal.vue Ver arquivo

@@ -39,21 +39,18 @@
39 39
     <el-container>
40 40
       <div style="width:150px">
41 41
         <div class="tableTitle">患者列表</div>
42
-        <el-table :data="patientsData" border style="width: 100%;" 
43
-            height="500" 
44
-            highlight-current-row
45
-            @current-change="handleChange">
46
-          <el-table-column prop="dialysis_no" label="透析号" width="80" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
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'}">
43
+          <el-table-column prop="dialysis_no" label="透析号" width="80">
47 44
             <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
48 45
           </el-table-column>
49
-          <el-table-column prop="name" label="姓名" width="80" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
46
+          <el-table-column prop="name" label="姓名" width="80">
50 47
             <template slot-scope="scope">{{ scope.row.name }}</template>
51 48
           </el-table-column>
52 49
         </el-table>
53 50
       </div>
54 51
       <div style="padding-left:10px;flex:1">
55 52
         <div class="tableTitle">统计表</div>
56
-        <el-table :data="DialysisData" style="width: 100%" border>
53
+        <el-table :data="DialysisData" style="width: 100%" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
57 54
           <el-table-column fixed prop="name" label="姓名" width="140">
58 55
             <!-- <template slot-scope="scope">{{ scope.row.name }}</template> -->
59 56
           </el-table-column>
@@ -65,8 +62,7 @@
65 62
           </el-table-column>
66 63
           <el-table-column prop="mode_id" label="透析模式">
67 64
               <template slot-scope="scope">
68
-                <!--<span>{{ scope.row.mode_id.join("、") }}</span>-->
69
-                <span>{{scope.row.patient_id}}</span>
65
+                <span>{{ scope.row.child.join("、") }}</span>
70 66
               </template>
71 67
            </el-table-column>
72 68
           <el-table-column prop="address" label="透析总次数" width="140">
@@ -95,7 +91,7 @@
95 91
 
96 92
 
97 93
 <script>
98
- import { getCurrentOrgPatients,getDialysisList,getDialysisDetailById } from "@/api/common/common";
94
+ import { getCurrentOrgPatients,getDialysisList } from "@/api/common/common";
99 95
  import { uParseTime } from "@/utils/tools";
100 96
 export default {
101 97
   data() {
@@ -113,8 +109,6 @@ export default {
113 109
       DialysisData: [],
114 110
       patientsData:[],
115 111
       prescriptionList:[],
116
-      limit:1000,
117
-      page:1,
118 112
     };
119 113
   },
120 114
   methods: {
@@ -151,171 +145,155 @@ export default {
151 145
     getDialysisList(){
152 146
       getDialysisList(this.listQuery.start_time,this.listQuery.end_time,this.listQuery.page,this.listQuery.limit).then(response=>{
153 147
          if(response.data.state === 1){
154
-           var  dialysislist =  response.data.data.dialysislist
155
-           for(let i=0;i<dialysislist.length;i++){
156
-              if(dialysislist[i].mode_id == 1){
157
-                dialysislist[i].mode_id = "HD"
158
-              }
159
-               if(dialysislist[i].mode_id == 2){
160
-                dialysislist[i].mode_id = "HDF"
161
-              }
162
-               if(dialysislist[i].mode_id == 3){
163
-                dialysislist[i].mode_id = "HD+HP"
164
-              }
165
-               if(dialysislist[i].mode_id == 4){
166
-                dialysislist[i].mode_id = "HP"
167
-              }
168
-               if(dialysislist[i].mode_id == 5){
169
-                dialysislist[i].mode_id = "HF"
170
-              }
171
-               if(dialysislist[i].mode_id == 6){
172
-                dialysislist[i].mode_id = "SCUF"
173
-              }
174
-               if(dialysislist[i].mode_id == 7){
175
-                dialysislist[i].mode_id = "IUF"
176
-              }
177
-               if(dialysislist[i].mode_id == 8){
178
-                dialysislist[i].mode_id = "HFHD"
179
-              }
180
-               if(dialysislist[i].mode_id == 9){
181
-                dialysislist[i].mode_id = "HFHD+HP"
182
-              }
183
-               if(dialysislist[i].mode_id == 10){
184
-                dialysislist[i].mode_id = "PHF"
185
-              }
186
-               if(dialysislist[i].mode_id == 11){
187
-                dialysislist[i].mode_id = "HFR"
188
-              }
189
-              if(dialysislist[i].mode_id == 12){
190
-                dialysislist[i].mode_id = "HDF+HP"
191
-              }
192
-              if(dialysislist[i].mode_id == 13){
193
-                dialysislist[i].mode_id = "CRRT"
194
-              }
195
-             if(dialysislist[i].mode_id == 14){
196
-                dialysislist[i].mode_id = "腹水回输"
197
-              }
198
-              if(dialysislist[i].mode_id == 19){
199
-                dialysislist[i].mode_id = "IUF+HD"
148
+          //  var  dialysislist =  response.data.data.dialysislist
149
+          //  for(let i=0;i<dialysislist.length;i++){
150
+          //     if(dialysislist[i].mode_id == 1){
151
+          //       dialysislist[i].mode_id = "HD"
152
+          //     }
153
+          //      if(dialysislist[i].mode_id == 2){
154
+          //       dialysislist[i].mode_id = "HDF"
155
+          //     }
156
+          //      if(dialysislist[i].mode_id == 3){
157
+          //       dialysislist[i].mode_id = "HD+HP"
158
+          //     }
159
+          //      if(dialysislist[i].mode_id == 4){
160
+          //       dialysislist[i].mode_id = "HP"
161
+          //     }
162
+          //      if(dialysislist[i].mode_id == 5){
163
+          //       dialysislist[i].mode_id = "HF"
164
+          //     }
165
+          //      if(dialysislist[i].mode_id == 6){
166
+          //       dialysislist[i].mode_id = "SCUF"
167
+          //     }
168
+          //      if(dialysislist[i].mode_id == 7){
169
+          //       dialysislist[i].mode_id = "IUF"
170
+          //     }
171
+          //      if(dialysislist[i].mode_id == 8){
172
+          //       dialysislist[i].mode_id = "HFHD"
173
+          //     }
174
+          //      if(dialysislist[i].mode_id == 9){
175
+          //       dialysislist[i].mode_id = "HFHD+HP"
176
+          //     }
177
+          //      if(dialysislist[i].mode_id == 10){
178
+          //       dialysislist[i].mode_id = "PHF"
179
+          //     }
180
+          //      if(dialysislist[i].mode_id == 11){
181
+          //       dialysislist[i].mode_id = "HFR"
182
+          //     }
183
+          //     if(dialysislist[i].mode_id == 12){
184
+          //       dialysislist[i].mode_id = "HDF+HP"
185
+          //     }
186
+          //     if(dialysislist[i].mode_id == 13){
187
+          //       dialysislist[i].mode_id = "CRRT"
188
+          //     }
189
+          //    if(dialysislist[i].mode_id == 14){
190
+          //       dialysislist[i].mode_id = "腹水回输"
191
+          //     }
192
+          //     if(dialysislist[i].mode_id == 19){
193
+          //       dialysislist[i].mode_id = "IUF+HD"
194
+          //     }
195
+          //  }
196
+          //  console.log("dialysislist",dialysislist)
197
+          //  var hash = {};
198
+          //  var i = 0;
199
+          //  var res = [];
200
+          //  dialysislist.forEach(function(item) {
201
+          //   var patient_id = item.patient_id;
202
+          //   hash[patient_id] ? res[hash[patient_id] - 1].mode_id.push(item.mode_id) : hash[patient_id] = ++i && res.push({
203
+          //       mode_id: [item.mode_id],
204
+          //       patient_id: patient_id,
205
+          //       dialysis_no: item.dialysis_no,
206
+          //       name:item.name,
207
+          //       age:item.id_card_no,
208
+          //       total_dialysis:item.total_dialysis,
209
+          //       user_sys_before_count:item.user_sys_before_count,
210
+          //   })
211
+          //  });
212
+          //  res.map(item => {
213
+          //    item.age = this.getAge(item.age)
214
+          //  })
215
+          //  console.log(res)
216
+          //  //this.DialysisData = res
217
+ 
218
+          //   var total = response.data.data.total
219
+          //   console.log("total",total) 
220
+          //  // this.total = total
221
+
222
+            
223
+          var list = response.data.data.list
224
+          console.log("list",list)
225
+          var totallist  =  response.data.data.totallist
226
+          console.log("totallist",totallist)
227
+          this.total = totallist  
228
+          var prescriptionList = response.data.data.prescriptionList
229
+          for(let i=0;i<prescriptionList.length;i++){
230
+            if(prescriptionList[i].mode_id == 1){
231
+              prescriptionList[i].mode_id = "HD"
232
+            }else if(prescriptionList[i].mode_id == 2){
233
+              prescriptionList[i].mode_id = "HDF"
234
+            }else if(prescriptionList[i].mode_id == 3){
235
+              prescriptionList[i].mode_id = "HD+HP"
236
+            }else if(prescriptionList[i].mode_id == 4){
237
+              prescriptionList[i].mode_id = "HP"
238
+            }else if(prescriptionList[i].mode_id == 5){
239
+              prescriptionList[i].mode_id = "HF"
240
+            }else if(prescriptionList[i].mode_id == 6){
241
+              prescriptionList[i].mode_id = "SCUF"
242
+            }else if(prescriptionList[i].mode_id == 7){
243
+              prescriptionList[i].mode_id = "IUF"
244
+            }else if(prescriptionList[i].mode_id == 8){
245
+              prescriptionList[i].mode_id = "HFHD"
246
+            }else if(prescriptionList[i].mode_id == 9){
247
+              prescriptionList[i].mode_id = "HFHD+HP"
248
+            }else if(prescriptionList[i].mode_id == 10){
249
+              prescriptionList[i].mode_id = "PHF"
250
+            }else if(prescriptionList[i].mode_id == 11){
251
+              prescriptionList[i].mode_id = "HFR"
252
+            }else if(prescriptionList[i].mode_id == 12){
253
+              prescriptionList[i].mode_id = "HDF+HP"
254
+            }else if(prescriptionList[i].mode_id == 13){
255
+              prescriptionList[i].mode_id = "CRRT"
256
+            }else if(prescriptionList[i].mode_id == 14){
257
+              prescriptionList[i].mode_id = "腹水回输"
258
+            }else if(prescriptionList[i].mode_id == 19){
259
+              prescriptionList[i].mode_id = "IUF+HD"
260
+            }
261
+          }
262
+          
263
+          console.log("prescriptionList",prescriptionList)
264
+          for(let i=0;i<this.prescriptionList.length;i++){
265
+            for(let j=0;j<list.length;j++){
266
+              if(this.prescriptionList[i].patient_id == list[j].patient_id){
267
+                arr.push(this.prescriptionList[i])
200 268
               }
201
-           }
202
-           console.log("dialysislist",dialysislist)
203
-           var hash = {};
204
-           var i = 0;
205
-           var res = [];
206
-           dialysislist.forEach(function(item) {
207
-            var patient_id = item.patient_id;
208
-            hash[patient_id] ? res[hash[patient_id] - 1].mode_id.push(item.mode_id) : hash[patient_id] = ++i && res.push({
209
-                mode_id: [item.mode_id],
210
-                patient_id: patient_id,
211
-                dialysis_no: item.dialysis_no,
269
+            }
270
+          }
271
+          let dataInfo = {}
272
+          list.forEach((item, index) => {
273
+            let { patient_id } = item
274
+            if (!dataInfo[patient_id]) {
275
+              dataInfo[patient_id] = {
276
+                patient_id,
212 277
                 name:item.name,
213
-                age:item.id_card_no,
278
+                id_card_no:item.id_card_no,
279
+                dialysis_no:item.dialysis_no,
214 280
                 total_dialysis:item.total_dialysis,
215 281
                 user_sys_before_count:item.user_sys_before_count,
216
-            })
217
-           });
218
-           res.map(item => {
219
-             item.age = this.getAge(item.age)
220
-           })
221
-           console.log(res)
222
-           //this.DialysisData = res
223
- 
224
-            var total = response.data.data.total
225
-            console.log("total",total) 
226
-           // this.total = total
227
-            
228
-            var list = response.data.data.list
229
-             for(let i=0;i<list.length;i++){
230
-              if(list[i].mode_id == 1){
231
-                list[i].mode_id = "HD"
232
-              }
233
-               if(list[i].mode_id == 2){
234
-                list[i].mode_id = "HDF"
235
-              }
236
-               if(list[i].mode_id == 3){
237
-                list[i].mode_id = "HD+HP"
238
-              }
239
-               if(list[i].mode_id == 4){
240
-                list[i].mode_id = "HP"
241
-              }
242
-               if(list[i].mode_id == 5){
243
-                list[i].mode_id = "HF"
244
-              }
245
-               if(list[i].mode_id == 6){
246
-                list[i].mode_id = "SCUF"
247
-              }
248
-               if(list[i].mode_id == 7){
249
-                list[i].mode_id = "IUF"
250
-              }
251
-               if(list[i].mode_id == 8){
252
-                list[i].mode_id = "HFHD"
253
-              }
254
-               if(list[i].mode_id == 9){
255
-                list[i].mode_id = "HFHD+HP"
256
-              }
257
-               if(list[i].mode_id == 10){
258
-                list[i].mode_id = "PHF"
259
-              }
260
-               if(list[i].mode_id == 11){
261
-                list[i].mode_id = "HFR"
282
+                child: []
262 283
               }
263
-              if(list[i].mode_id == 12){
264
-                list[i].mode_id = "HDF+HP"
265
-              }
266
-              if(list[i].mode_id == 13){
267
-                list[i].mode_id = "CRRT"
268
-              }
269
-             if(list[i].mode_id == 14){
270
-                list[i].mode_id = "腹水回输"
271
-              }
272
-              if(list[i].mode_id == 19){
273
-                list[i].mode_id = "IUF+HD"
274
-              }
275
-           }
276
-            console.log("list",list)
277
-            
278
-            var totallist  =  response.data.data.totallist
279
-             console.log("totallist",totallist)
280
-            this.total = totallist  
281
-            var prescriptionList = response.data.data.prescriptionList
282
-            
283
-            console.log("prescriptionList",prescriptionList)
284
-            for(let i=0;i<this.prescriptionList.length;i++){
285
-             for(let j=0;j<list.length;j++){
286
-               if(this.prescriptionList[i].patient_id == list[j].patient_id){
287
-                  arr.push(this.prescriptionList[i])
288
-               }
289
-             }
290 284
             }
291
-             let dataInfo = {}
292
-              list.forEach((item, index) => {
293
-                let { patient_id } = item
294
-                if (!dataInfo[patient_id]) {
295
-                  dataInfo[patient_id] = {
296
-                    patient_id,
297
-                    name:item.name,
298
-                    id_card_no:item.id_card_no,
299
-                    dialysis_no:item.dialysis_no,
300
-                    total_dialysis:item.total_dialysis,
301
-                    user_sys_before_count:item.user_sys_before_count,
302
-                    child: []
303
-                  }
304
-                }
305
-              })
306
-             let list = Object.values(dataInfo)
307
-            console.log("arr",list)    
308
-            list.map(item => {
309
-              for (let i = 0; i < prescriptionList.length; i++) {
310
-                if (
311
-                  item.patient_id === prescriptionList[i].patient_id
312
-                ) {
313
-                  item.child.push(prescriptionList[i])
314
-                }
285
+          })
286
+          let list = Object.values(dataInfo)
287
+          console.log("arr",list)    
288
+          list.map(item => {
289
+            for (let i = 0; i < prescriptionList.length; i++) {
290
+              if (item.patient_id === prescriptionList[i].patient_id) {
291
+                item.child.push(prescriptionList[i].mode_id)
315 292
               }
316
-            })
317
-            console.log("list---",list)
318
-            this.DialysisData = list
293
+            }
294
+          })
295
+          console.log("list---",list)
296
+          this.DialysisData = list
319 297
          }
320 298
       })
321 299
     },
@@ -336,19 +314,7 @@ export default {
336 314
     unique(arr) {
337 315
         const res = new Map();
338 316
         return arr.filter((arr) => !res.has(arr.mode_id) && res.set(arr.mode_id, 1));
339
-    },
340
-    //获取每个病人的数据
341
-    handleChange(val){
342
-       console.log("val---",val)
343
-       getDialysisDetailById(val.patient_id,this.listQuery.start_time,this.listQuery.end_time,this.limit,this.page).then(response=>{
344
-          if(response.data.state === 1){
345
-            var patients =  response.data.data.patients
346
-            console.log("patients",patients)
347
-            var total = response.data.data.total
348
-            console.log("total",total)
349
-          }
350
-       })
351
-    }
317
+      },
352 318
   },
353 319
   created(){
354 320
     var nowDate = new Date();