Browse Source

统计配置开发

XMLWAN 4 years ago
parent
commit
502ae482ae

+ 19 - 11
src/xt_pages/qcd/treatmentControlAnalysis/components/CheckPersonal.vue View File

@@ -7,14 +7,6 @@
7 7
           <el-button type="primary" @click="onSearch" icon="el-icon-search">搜索</el-button>
8 8
         </el-form-item>
9 9
       </el-form>
10
-      <el-select v-model="value" placeholder="请选择" style="width:120px;margin-right:20px">
11
-        <el-option
12
-          v-for="item in options"
13
-          :key="item.value"
14
-          :label="item.label"
15
-          :value="item.value"
16
-        ></el-option>
17
-      </el-select>
18 10
       <label class="title">
19 11
         <span class="name">日期查询</span> :
20 12
       </label>
@@ -47,9 +39,13 @@
47 39
     <el-container>
48 40
       <div style="width:150px">
49 41
         <div class="tableTitle">患者列表</div>
50
-        <el-table :data="tableData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
51
-          <el-table-column prop="date" label="日期" width="70"></el-table-column>
52
-          <el-table-column prop="name" label="姓名" width="80"></el-table-column>
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">
44
+            <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
45
+          </el-table-column>
46
+          <el-table-column prop="name" label="姓名" width="80">
47
+            <template slot-scope="scope">{{ scope.row.name }}</template>
48
+          </el-table-column>
53 49
         </el-table>
54 50
       </div>
55 51
       <div style="padding-left:10px;flex:1">
@@ -66,6 +62,7 @@
66 62
 <script>
67 63
 import echarts from "echarts";
68 64
 import LineChart from "../../components/LineChart";
65
+import { getCurrentOrgPatients } from "@/api/common/common";
69 66
 export default {
70 67
   components: {
71 68
     LineChart
@@ -151,6 +148,7 @@ export default {
151 148
           name: "王小虎"
152 149
         }
153 150
       ],
151
+      patientsData:[],
154 152
       chart: {
155 153
         title: {
156 154
           text: "ECharts 入门示例"
@@ -249,7 +247,17 @@ export default {
249 247
         this.listQuery.end_time = "";
250 248
       } else {
251 249
       }
250
+    },
251
+    getCurrentOrgPatients(){
252
+      getCurrentOrgPatients().then(response=>{
253
+         var patients = response.data.data.patients
254
+         this.patientsData = patients
255
+      })
252 256
     }
257
+  },
258
+  created(){
259
+   //获取该机构下的所有患者
260
+     this.getCurrentOrgPatients()
253 261
   }
254 262
 };
255 263
 </script>

+ 81 - 7
src/xt_pages/qcd/treatmentControlAnalysis/components/TimeAll.vue View File

@@ -98,7 +98,7 @@
98 98
     </div>
99 99
   </div>
100 100
 </template>
101
-  
101
+
102 102
 <script>
103 103
 import echarts from "echarts";
104 104
 import LineChart from "../../components/LineChart";
@@ -210,7 +210,16 @@ export default {
210 210
     };
211 211
   },
212 212
   methods: {
213
-    changeTime() {},
213
+    changeTime(val) {
214
+      var time = this.getTimestamp(val) - this.getTimestamp(this.listQuery.end_time);
215
+      if (time > 0) {
216
+        this.$message.error("结束时间不能小于开始时间");
217
+        this.listQuery.start_time = "";
218
+      } else {
219
+        this.geStatistics()
220
+      }
221
+
222
+    },
214 223
     changeEndTime(val) {
215 224
       var time =
216 225
         this.getTimestamp(val) - this.getTimestamp(this.listQuery.start_time);
@@ -218,8 +227,13 @@ export default {
218 227
         this.$message.error("结束时间不能小于开始时间");
219 228
         this.listQuery.end_time = "";
220 229
       } else {
230
+        this.geStatistics()
221 231
       }
222 232
     },
233
+    getTimestamp(time) {
234
+      // 把时间日期转成时间戳
235
+      return new Date(time).getTime() / 1000;
236
+    },
223 237
     handleSizeChange(limit) {
224 238
       this.listQuery.limit = limit;
225 239
       this.geStatistics();
@@ -236,7 +250,7 @@ export default {
236 250
       geStatistics(this.listQuery).then(response=>{
237 251
         if(response.data.state === 1){
238 252
           var dtd =  response.data.data.statistics
239
-          console.log("statistics",dtd)
253
+         console.log("dtd",dtd)
240 254
             var dd = {};
241 255
           for (const index in dtd) {
242 256
             if (!(dtd[index].date in dd)) {
@@ -272,10 +286,70 @@ export default {
272 286
             this.tableData.push({ date: key, data: dd[key], total: total });
273 287
           }
274 288
           var ttd = response.data.data.ttd
275
-          console.log("ttd",ttd)
276
-        
289
+         console.log("ttd",ttd)
290
+         // for(let i=0;i<ttd.length;i++){
291
+         //    if(ttd[i].mode_id == "1"){
292
+         //       ttd[i].mode_id == "HD"
293
+         //    }
294
+         //     if(ttd[i].mode_id == "2"){
295
+         //       ttd[i].mode_id == "HDF"
296
+         //    }
297
+         //     if(ttd[i].mode_id == "3"){
298
+         //       ttd[i].mode_id == "HD+HP"
299
+         //    }
300
+         //     if(ttd[i].mode_id == "4"){
301
+         //       ttd[i].mode_id == "HP"
302
+         //    }
303
+         //     if(ttd[i].mode_id == "5"){
304
+         //       ttd[i].mode_id == "HF"
305
+         //    }
306
+         //     if(ttd[i].mode_id == "6"){
307
+         //       ttd[i].mode_id == "SCUF"
308
+         //    }
309
+         //     if(ttd[i].mode_id == "7"){
310
+         //       ttd[i].mode_id == "IUF"
311
+         //    }
312
+         //     if(ttd[i].mode_id == "8"){
313
+         //       ttd[i].mode_id == "HFHD"
314
+         //    }
315
+         //     if(ttd[i].mode_id == "9"){
316
+         //       ttd[i].mode_id == "HFHD+HP"
317
+         //    }
318
+         //     if(ttd[i].mode_id == "10"){
319
+         //       ttd[i].mode_id == "PHF"
320
+         //    }
321
+         //     if(ttd[i].mode_id == "11"){
322
+         //       ttd[i].mode_id == "HFR"
323
+         //    }
324
+         //     if(ttd[i].mode_id == "12"){
325
+         //       ttd[i].mode_id == "HDF+HP"
326
+         //    }
327
+         //    if(ttd[i].mode_id == "13"){
328
+         //       ttd[i].mode_id == "CRRT"
329
+         //    }
330
+         //      if(ttd[i].mode_id == "14"){
331
+         //       ttd[i].mode_id == "腹水回输"
332
+         //    }
333
+         //      if(ttd[i].mode_id == "15"){
334
+         //       ttd[i].mode_id == "HD前置换"
335
+         //    }
336
+         //      if(ttd[i].mode_id == "16"){
337
+         //       ttd[i].mode_id == "HD后置换"
338
+         //    }
339
+         //      if(ttd[i].mode_id == "17"){
340
+         //       ttd[i].mode_id == "HDF前置换"
341
+         //    }
342
+         //      if(ttd[i].mode_id == "18"){
343
+         //       ttd[i].mode_id == "HDF后置换"
344
+         //    }
345
+         //
346
+         //      if(ttd[i].mode_id == "19"){
347
+         //       ttd[i].mode_id == IUF+HD
348
+         //    }
349
+        // }
350
+
277 351
           this.total =  response.data.data.total
278
-         
352
+           console.log("total",this.total)
279 353
 
280 354
         }
281 355
       })
@@ -283,7 +357,7 @@ export default {
283 357
   },
284 358
   created(){
285 359
     this.modeOptions = this.$store.getters.treatment_mode;
286
-    
360
+
287 361
     var nowDate = new Date();
288 362
     var nowYear = nowDate.getFullYear();
289 363
     var nowMonth = nowDate.getMonth() + 1;

+ 15 - 1
src/xt_pages/qcd/treatmentControlAnalysis/components/TimePersonal.vue View File

@@ -127,7 +127,16 @@ export default {
127 127
     };
128 128
   },
129 129
   methods: {
130
-    changeTime() {},
130
+    changeTime(val) {
131
+       var time = this.getTimestamp(val) - this.getTimestamp(this.listQuery.end_time);
132
+      if (time > 0) {
133
+        this.$message.error("结束时间不能小于开始时间");
134
+        this.listQuery.start_time = "";
135
+      } else {
136
+        this.getDialysisList()
137
+      }
138
+      
139
+    },
131 140
     changeEndTime(val) {
132 141
       var time =
133 142
         this.getTimestamp(val) - this.getTimestamp(this.listQuery.start_time);
@@ -135,8 +144,13 @@ export default {
135 144
         this.$message.error("结束时间不能小于开始时间");
136 145
         this.listQuery.end_time = "";
137 146
       } else {
147
+        this.getDialysisList()
138 148
       }
139 149
     },
150
+   getTimestamp(time) {
151
+      // 把时间日期转成时间戳
152
+      return new Date(time).getTime() / 1000;
153
+    },
140 154
     getCurrentOrgPatients(){
141 155
       getCurrentOrgPatients().then(response=>{
142 156
          if(response.data.state == 1){