瀏覽代碼

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

XMLWAN 4 年之前
父節點
當前提交
f30323ad9f
共有 1 個文件被更改,包括 52 次插入18 次删除
  1. 52 18
      src/xt_pages/qcd/treatmentControlAnalysis/components/TimePersonal.vue

+ 52 - 18
src/xt_pages/qcd/treatmentControlAnalysis/components/TimePersonal.vue 查看文件

@@ -40,10 +40,10 @@
40 40
       <div style="width:150px">
41 41
         <div class="tableTitle">患者列表</div>
42 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 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 47
             <template slot-scope="scope">{{ scope.row.name }}</template>
48 48
           </el-table-column>
49 49
         </el-table>
@@ -51,19 +51,21 @@
51 51
       <div style="padding-left:10px;flex:1">
52 52
         <div class="tableTitle">统计表</div>
53 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 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 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 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 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 69
         </el-table>
68 70
 
69 71
         <el-pagination
@@ -71,7 +73,7 @@
71 73
           @size-change="handleSizeChange"
72 74
           @current-change="handleCurrentChange"
73 75
           :current-page="listQuery.page"
74
-          :page-sizes="[20, 40, 60,80, 100]"
76
+          :page-sizes="[20, 40, 60, 80, 100]"
75 77
           :page-size="10"
76 78
           background
77 79
           style="margin-top:20px;"
@@ -187,13 +189,45 @@ export default {
187 189
               }
188 190
            }
189 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 232
   created(){
199 233
     var nowDate = new Date();