Browse Source

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

XMLWAN 5 years ago
parent
commit
f30323ad9f
1 changed files with 52 additions and 18 deletions
  1. 52 18
      src/xt_pages/qcd/treatmentControlAnalysis/components/TimePersonal.vue

+ 52 - 18
src/xt_pages/qcd/treatmentControlAnalysis/components/TimePersonal.vue View File

40
       <div style="width:150px">
40
       <div style="width:150px">
41
         <div class="tableTitle">患者列表</div>
41
         <div class="tableTitle">患者列表</div>
42
         <el-table :data="patientsData" border style="width: 100%;" height="500">
42
         <el-table :data="patientsData" border style="width: 100%;" height="500">
43
-          <el-table-column prop="date" label="日期" width="70">
44
-            <template slot-scope="scope">{{getTime(scope.row.created_time)}}</template>
43
+          <el-table-column prop="dialysis_no" label="透析号" width="80" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
44
+            <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
45
           </el-table-column>
45
           </el-table-column>
46
-          <el-table-column prop="name" label="姓名" width="80">
46
+          <el-table-column prop="name" label="姓名" width="80" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
47
             <template slot-scope="scope">{{ scope.row.name }}</template>
47
             <template slot-scope="scope">{{ scope.row.name }}</template>
48
           </el-table-column>
48
           </el-table-column>
49
         </el-table>
49
         </el-table>
51
       <div style="padding-left:10px;flex:1">
51
       <div style="padding-left:10px;flex:1">
52
         <div class="tableTitle">统计表</div>
52
         <div class="tableTitle">统计表</div>
53
         <el-table :data="DialysisData" style="width: 100%" border>
53
         <el-table :data="DialysisData" style="width: 100%" border>
54
-          <el-table-column fixed prop="date" label="姓名">
55
-            <template slot-scope="scope">{{ scope.row.name }}</template>
54
+          <el-table-column fixed prop="name" label="姓名" width="140">
55
+            <!-- <template slot-scope="scope">{{ scope.row.name }}</template> -->
56
           </el-table-column>
56
           </el-table-column>
57
-          <el-table-column prop="name" label="年龄">
58
-             <template slot-scope="scope">{{ scope.row.id_card_no }}</template>
57
+          <el-table-column prop="age" label="年龄" width="140">
58
+             <!-- <template slot-scope="scope">{{ scope.row.id_card_no }}</template> -->
59
           </el-table-column>
59
           </el-table-column>
60
-          <el-table-column prop="province" label="透析号">
61
-              <template slot-scope="scope">{{ scope.row.dialysis_no }}</template>
60
+          <el-table-column prop="dialysis_no" label="透析号" width="140">
61
+              <!-- <template slot-scope="scope">{{ scope.row.dialysis_no }}</template> -->
62
           </el-table-column>
62
           </el-table-column>
63
-          <el-table-column prop="city" label="透析模式">
64
-              <template slot-scope="scope">{{ scope.row.mode_id }}</template>
63
+          <el-table-column prop="mode_id" label="透析模式">
64
+              <template slot-scope="scope">
65
+                <span>{{ scope.row.mode_id.join("、") }}</span>
66
+              </template>
65
            </el-table-column>
67
            </el-table-column>
66
-          <el-table-column prop="address" label="透析总次数"></el-table-column>
68
+          <el-table-column prop="address" label="透析总次数" width="140"></el-table-column>
67
         </el-table>
69
         </el-table>
68
 
70
 
69
         <el-pagination
71
         <el-pagination
71
           @size-change="handleSizeChange"
73
           @size-change="handleSizeChange"
72
           @current-change="handleCurrentChange"
74
           @current-change="handleCurrentChange"
73
           :current-page="listQuery.page"
75
           :current-page="listQuery.page"
74
-          :page-sizes="[20, 40, 60,80, 100]"
76
+          :page-sizes="[20, 40, 60, 80, 100]"
75
           :page-size="10"
77
           :page-size="10"
76
           background
78
           background
77
           style="margin-top:20px;"
79
           style="margin-top:20px;"
187
               }
189
               }
188
            }
190
            }
189
            console.log("dialysislist",dialysislist)
191
            console.log("dialysislist",dialysislist)
190
-           this.DialysisData = dialysislist
191
-           var total = response.data.data.total
192
-           console.log("total",total)
193
-           this.total = total
192
+           var hash = {};
193
+           var i = 0;
194
+           var res = [];
195
+           dialysislist.forEach(function(item) {
196
+            var patient_id = item.patient_id;
197
+            hash[patient_id] ? res[hash[patient_id] - 1].mode_id.push(item.mode_id) : hash[patient_id] = ++i && res.push({
198
+                mode_id: [item.mode_id],
199
+                patient_id: patient_id,
200
+                dialysis_no: item.dialysis_no,
201
+                name:item.name,
202
+                age:item.id_card_no
203
+            })
204
+           });
205
+           res.map(item => {
206
+             item.age = this.getAge(item.age)
207
+           })
208
+           console.log(res)
209
+           this.DialysisData = res
210
+ 
211
+            var total = response.data.data.total
212
+            console.log("total",total)
213
+            this.total = total
194
          }
214
          }
195
       })
215
       })
196
-    }
216
+    },
217
+    getAge(UUserCard) {
218
+			if (UUserCard != null && UUserCard != '') {
219
+				//获取年龄
220
+				var myDate = new Date();
221
+				var month = myDate.getMonth() + 1;
222
+				var day = myDate.getDate();
223
+				var age = myDate.getFullYear() - UUserCard.substring(6, 10) - 1;
224
+				if (UUserCard.substring(10, 12) < month || UUserCard.substring(10, 12) == month && UUserCard.substring(12, 14) <= day) {
225
+					age++;
226
+				}
227
+				return age;
228
+			}
229
+    },
230
+    onSearch(){}
197
   },
231
   },
198
   created(){
232
   created(){
199
     var nowDate = new Date();
233
     var nowDate = new Date();