Browse Source

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

XMLWAN 4 years ago
parent
commit
86c18bade8
1 changed files with 91 additions and 54 deletions
  1. 91 54
      src/xt_pages/qcd/treatmentControlAnalysis/components/TimePersonal.vue

+ 91 - 54
src/xt_pages/qcd/treatmentControlAnalysis/components/TimePersonal.vue View File

@@ -56,7 +56,7 @@
56 56
         <el-table :data="DialysisData" style="width: 100%" border :row-style="{ color: '#303133' }" 
57 57
         :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
58 58
         >
59
-          <el-table-column fixed prop="name" label="姓名" width="140">
59
+          <el-table-column prop="name" label="姓名" width="140">
60 60
             <!-- <template slot-scope="scope">{{ scope.row.name }}</template> -->
61 61
           </el-table-column>
62 62
           <el-table-column  label="年龄" width="140">
@@ -67,7 +67,7 @@
67 67
           </el-table-column>
68 68
           <el-table-column prop="mode_id" label="透析模式">
69 69
               <template slot-scope="scope">
70
-                <span>{{ scope.row.child.join("、") }}</span>
70
+                <span>{{ scope.row.mode_id.join("、") }}</span>
71 71
               </template>
72 72
            </el-table-column>
73 73
           <el-table-column prop="address" label="透析总次数" width="140">
@@ -232,50 +232,7 @@ export default {
232 232
          // console.log("totallist",totallist)
233 233
           this.total = totallist  
234 234
           var prescriptionList = response.data.data.prescriptionList
235
-          for(let i=0;i<prescriptionList.length;i++){
236
-            if(prescriptionList[i].mode_id == 1){
237
-              prescriptionList[i].mode_id = "HD"
238
-            }else if(prescriptionList[i].mode_id == 2){
239
-              prescriptionList[i].mode_id = "HDF"
240
-            }else if(prescriptionList[i].mode_id == 3){
241
-              prescriptionList[i].mode_id = "HD+HP"
242
-            }else if(prescriptionList[i].mode_id == 4){
243
-              prescriptionList[i].mode_id = "HP"
244
-            }else if(prescriptionList[i].mode_id == 5){
245
-              prescriptionList[i].mode_id = "HF"
246
-            }else if(prescriptionList[i].mode_id == 6){
247
-              prescriptionList[i].mode_id = "SCUF"
248
-            }else if(prescriptionList[i].mode_id == 7){
249
-              prescriptionList[i].mode_id = "IUF"
250
-            }else if(prescriptionList[i].mode_id == 8){
251
-              prescriptionList[i].mode_id = "HFHD"
252
-            }else if(prescriptionList[i].mode_id == 9){
253
-              prescriptionList[i].mode_id = "HFHD+HP"
254
-            }else if(prescriptionList[i].mode_id == 10){
255
-              prescriptionList[i].mode_id = "PHF"
256
-            }else if(prescriptionList[i].mode_id == 11){
257
-              prescriptionList[i].mode_id = "HFR"
258
-            }else if(prescriptionList[i].mode_id == 12){
259
-              prescriptionList[i].mode_id = "HDF+HP"
260
-            }else if(prescriptionList[i].mode_id == 13){
261
-              prescriptionList[i].mode_id = "CRRT"
262
-            }else if(prescriptionList[i].mode_id == 14){
263
-              prescriptionList[i].mode_id = "腹水回输"
264
-            }else if(prescriptionList[i].mode_id == 15){
265
-               prescriptionList[i].mode_id = "HD前置换"
266
-            }
267
-            else if(prescriptionList[i].mode_id == 16){
268
-               prescriptionList[i].mode_id = "HD后置换"
269
-            }
270
-            else if(prescriptionList[i].mode_id == 17){
271
-               prescriptionList[i].mode_id = "HDF前置换"
272
-            }
273
-            else if(prescriptionList[i].mode_id == 18){
274
-               prescriptionList[i].mode_id = "HDF后置换"
275
-            }else if(prescriptionList[i].mode_id == 19){
276
-              prescriptionList[i].mode_id = "IUF+HD"
277
-            }
278
-          }
235
+          this.getModeId(prescriptionList)
279 236
           
280 237
          // console.log("prescriptionList",prescriptionList)
281 238
           for(let i=0;i<this.prescriptionList.length;i++){
@@ -296,7 +253,7 @@ export default {
296 253
                 dialysis_no:item.dialysis_no,
297 254
                 total_dialysis:item.total_dialysis,
298 255
                 user_sys_before_count:item.user_sys_before_count,
299
-                child: []
256
+                mode_id: []
300 257
               }
301 258
             }
302 259
           })
@@ -305,7 +262,7 @@ export default {
305 262
           list.map(item => {
306 263
             for (let i = 0; i < prescriptionList.length; i++) {
307 264
               if (item.patient_id === prescriptionList[i].patient_id) {
308
-                item.child.push(prescriptionList[i].mode_id)
265
+                item.mode_id.push(prescriptionList[i].mode_id)
309 266
               }
310 267
             }
311 268
           })
@@ -330,10 +287,28 @@ export default {
330 287
     onSearch(){
331 288
       getPrescriptionByName(this.listQuery.search,this.listQuery.start_time,this.listQuery.end_time,this.limit,this.page).then(response=>{
332 289
          if(response.data.state === 1){
333
-           var patient =  response.data.data.patient
334
-           //console.log("patient",patient)
335
-           var total = response.data.data.total
336
-           //console.log("total",total)
290
+           var patients =  response.data.data.patient
291
+           this.getModeId(patients)
292
+           console.log("patient",patients)
293
+           var hash = {};
294
+           var i = 0;
295
+           var res = [];
296
+           patients.forEach(function(item) {
297
+            var patient_id = item.patient_id;
298
+            hash[patient_id] ? res[hash[patient_id] - 1].mode_id.push(item.mode_id) : hash[patient_id] = ++i && res.push({
299
+                mode_id: [item.mode_id],
300
+                patient_id: patient_id,
301
+                dialysis_no: item.dialysis_no,
302
+                name:item.name,
303
+                id_card_no:item.id_card_no,
304
+                total_dialysis:item.total_dialysis,
305
+                user_sys_before_count:item.user_sys_before_count,
306
+            })
307
+           });
308
+           this.DialysisData = res
309
+           var total =  response.data.data.total
310
+           this.total = res.length
311
+           console.log("total",total)
337 312
          }
338 313
       })
339 314
     },
@@ -345,12 +320,74 @@ export default {
345 320
        getDialysisDetailById(val.id,this.listQuery.start_time,this.listQuery.end_time,this.limit,this.page).then(response=>{
346 321
           if(response.data.state === 1){
347 322
             var patients =  response.data.data.patients
348
-            console.log("patients",patients)
323
+            this.getModeId(patients)
324
+            // console.log("patients",patients)
325
+            var hash = {};
326
+            var i = 0;
327
+            var res = [];
328
+            patients.forEach(function(item) {
329
+              var patient_id = item.patient_id;
330
+              hash[patient_id] ? res[hash[patient_id] - 1].mode_id.push(item.mode_id) : hash[patient_id] = ++i && res.push({
331
+                  mode_id: [item.mode_id],
332
+                  patient_id: patient_id,
333
+                  dialysis_no: item.dialysis_no,
334
+                  name:item.name,
335
+                  id_card_no:item.id_card_no,
336
+                  total_dialysis:item.total_dialysis,
337
+                  user_sys_before_count:item.user_sys_before_count,
338
+              })
339
+            });
340
+            this.DialysisData = res
341
+            console.log(res)
349 342
             var total =  response.data.data.total
350
-            console.log("total",total)
343
+            this.total = res.length
344
+            // console.log("total",total)
351 345
           }
352 346
        })
353 347
      
348
+    },
349
+    getModeId(patients){
350
+      for(let i=0;i<patients.length;i++){
351
+        if(patients[i].mode_id == 1){
352
+          patients[i].mode_id = "HD"
353
+        }else if(patients[i].mode_id == 2){
354
+          patients[i].mode_id = "HDF"
355
+        }else if(patients[i].mode_id == 3){
356
+          patients[i].mode_id = "HD+HP"
357
+        }else if(patients[i].mode_id == 4){
358
+          patients[i].mode_id = "HP"
359
+        }else if(patients[i].mode_id == 5){
360
+          patients[i].mode_id = "HF"
361
+        }else if(patients[i].mode_id == 6){
362
+          patients[i].mode_id = "SCUF"
363
+        }else if(patients[i].mode_id == 7){
364
+          patients[i].mode_id = "IUF"
365
+        }else if(patients[i].mode_id == 8){
366
+          patients[i].mode_id = "HFHD"
367
+        }else if(patients[i].mode_id == 9){
368
+          patients[i].mode_id = "HFHD+HP"
369
+        }else if(patients[i].mode_id == 10){
370
+          patients[i].mode_id = "PHF"
371
+        }else if(patients[i].mode_id == 11){
372
+          patients[i].mode_id = "HFR"
373
+        }else if(patients[i].mode_id == 12){
374
+          patients[i].mode_id = "HDF+HP"
375
+        }else if(patients[i].mode_id == 13){
376
+          patients[i].mode_id = "CRRT"
377
+        }else if(patients[i].mode_id == 14){
378
+          patients[i].mode_id = "腹水回输"
379
+        }else if(patients[i].mode_id == 15){
380
+            patients[i].mode_id = "HD前置换"
381
+        }else if(patients[i].mode_id == 16){
382
+            patients[i].mode_id = "HD后置换"
383
+        }else if(patients[i].mode_id == 17){
384
+            patients[i].mode_id = "HDF前置换"
385
+        }else if(patients[i].mode_id == 18){
386
+            patients[i].mode_id = "HDF后置换"
387
+        }else if(patients[i].mode_id == 19){
388
+          patients[i].mode_id = "IUF+HD"
389
+        }
390
+      }
354 391
     }
355 392
   },
356 393
   created(){