Explorar el Código

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

XMLWAN hace 4 años
padre
commit
96ac0ce614

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1165 - 1164
src/store/modules/globalConfig.js


+ 3 - 0
src/xt_pages/dialysis/details/assessmentAfter.vue Ver fichero

@@ -433,6 +433,9 @@ export default {
433 433
         case 3:
434 434
           return "住院";
435 435
           break;
436
+        case 4:
437
+          return "门诊";
438
+          break;
436 439
 
437 440
         default:
438 441
           return "-";

+ 4 - 6
src/xt_pages/qcd/indicatorControlAnalysis/bloodPressure.vue Ver fichero

@@ -364,6 +364,10 @@
364 364
       }
365 365
     },
366 366
     methods: {
367
+      jumpDetail(patient_id){
368
+        this.$router.push("/qcd/indicatorControlAnalysis/bloodPressureDetails?id="+patient_id)
369
+
370
+      },
367 371
       changeProject(val){
368 372
         this.query.statistics_type = val
369 373
         this.query.page = 1
@@ -442,12 +446,6 @@
442 446
       },
443 447
       getModeName(mode_id){
444 448
         return this.$store.getters.treatment_mode[mode_id] != undefined ? this.$store.getters.treatment_mode[mode_id].name: ""
445
-      },
446
-      changeTime() {
447
-
448
-      }, changeEndTime() {
449
-
450
-
451 449
       }, GetDialysisBloodPressureTableData(params) {
452 450
         this.loading = true
453 451
         this.tableData = []

+ 258 - 174
src/xt_pages/qcd/indicatorControlAnalysis/bloodPressureDetails.vue Ver fichero

@@ -8,47 +8,64 @@
8 8
         <div class="cell clearfix" style="margin:0">
9 9
           <el-form :inline="true" :model="listQuery">
10 10
             <el-form-item label>
11
-              <el-input v-model.trim="listQuery.search" placeholder="姓名/透析号" style="width:150px"></el-input>
12
-              <el-button type="primary" @click="onSearch" icon="el-icon-search">搜索</el-button>
11
+              <el-autocomplete
12
+                class="checkSearch"
13
+                popper-class="my-autocomplete"
14
+                v-model="search_value"
15
+                :fetch-suggestions="querySearchAsync"
16
+                :trigger-on-focus="false"
17
+                placeholder="请输入病人名字"
18
+                @select="handleSelect"
19
+              >
20
+                <i class="el-icon-search el-input__icon" slot="suffix"></i>
21
+                <template slot-scope="{ item }">
22
+                  <div class="name">{{ item.name }}</div>
23
+                </template>
24
+              </el-autocomplete>
13 25
             </el-form-item>
14 26
           </el-form>
15 27
         </div>
16 28
         <el-container>
17 29
           <div style="width:150px">
18 30
             <div class="tableTitle">患者列表</div>
19
-            <el-table :data="tableData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
20
-              <el-table-column prop="date" label="日期" width="70"></el-table-column>
21
-              <el-table-column prop="name" label="姓名" width="80"></el-table-column>
31
+            <el-table :data="patientsData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }"
32
+                      :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
33
+                      highlight-current-row
34
+                      @current-change="handleChange">
35
+              <el-table-column prop="dialysis_no" label="透析号" width="80">
36
+                <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
37
+              </el-table-column>
38
+              <el-table-column prop="name" label="姓名" width="80">
39
+                <template slot-scope="scope">{{ scope.row.name }}</template>
40
+              </el-table-column>
22 41
             </el-table>
42
+
23 43
           </div>
24 44
           <div class="containerRight" style="flex:1;overflow: hidden">
25 45
             <div class="cell clearfix">
26 46
               <label class="title" style="text-align:left">
27 47
                 <span class="name">血压阶段</span> :
28 48
               </label>
29
-              <el-select
30
-                v-model="value"
31
-                placeholder="请选择"
32
-                @change="chooseType"
33
-                style="width:110px;margin-right:10px"
34
-              >
49
+              <el-select v-model="query.statistics_type" placeholder="请选择" style="width:110px;margin-right:10px" @change="changeProject">
35 50
                 <el-option
36 51
                   v-for="item in options"
37 52
                   :key="item.value"
38
-                  :label="item.label"
53
+                  :label="item.name"
39 54
                   :value="item.value"
55
+
40 56
                 ></el-option>
41 57
               </el-select>
42 58
               <label class="title">
43 59
                 <span class="name">日期查询</span> :
44 60
               </label>
45 61
               <el-date-picker
46
-                v-model="listQuery.start_time"
62
+                v-model="query.start_time"
47 63
                 prefix-icon="el-icon-date"
48 64
                 @change="changeTime"
49 65
                 :editable="false"
66
+                style="width: 150px;"
50 67
                 type="date"
51
-                style="max-width:160px"
68
+                :picker-options="pickerOptions"
52 69
                 placeholder="选择日期时间"
53 70
                 align="right"
54 71
                 format="yyyy-MM-dd"
@@ -56,12 +73,13 @@
56 73
               ></el-date-picker>
57 74
               <span class>-</span>
58 75
               <el-date-picker
59
-                v-model="listQuery.end_time"
76
+                v-model="query.end_time"
60 77
                 prefix-icon="el-icon-date"
61 78
                 @change="changeEndTime"
62 79
                 :editable="false"
80
+                :picker-options="pickerOptions"
81
+                style="width: 150px;"
63 82
                 type="date"
64
-                style="max-width:160px"
65 83
                 placeholder="选择日期时间"
66 84
                 align="right"
67 85
                 format="yyyy-MM-dd"
@@ -74,18 +92,69 @@
74 92
             </div>
75 93
             <div class="tableTitle">统计表</div>
76 94
             <div>
77
-              <el-table :data="tableData1" style="width: 100%" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
78
-                <el-table-column fixed prop="date" label="日期"></el-table-column>
79
-                <el-table-column prop="name" label="姓名"></el-table-column>
80
-                <el-table-column prop="province" label="省份"></el-table-column>
81
-                <el-table-column prop="city" label="市区"></el-table-column>
95
+              <el-table :data="tableData" style="width: 100%" :height="tableHeight" >
96
+                <el-table-column fixed label="日期" align="center">
97
+                  <template slot-scope="scope">
98
+                    {{scope.row.schedule_date | parseTime("{y}-{m}-{d}") }}
99
+                  </template>
100
+                </el-table-column>
101
+
102
+                <el-table-column label="姓名" align="center">
103
+                  <template slot-scope="scope">
104
+                    {{scope.row.patient.name}}
105
+                  </template>
106
+                </el-table-column>
107
+
108
+                <el-table-column label="状态" align="center">
109
+                  <template slot-scope="scope">
110
+                    {{scope.row.patient.lapseto == 1 ? '留治':'转出'}}
111
+                  </template>
112
+                </el-table-column>
113
+
114
+                <el-table-column label="透前血压" align="center">
115
+                  <template slot-scope="scope">
116
+                    <div v-if="scope.row.before.systolic_blood_pressure">{{scope.row.before.systolic_blood_pressure}} / {{scope.row.before.diastolic_blood_pressure}}</div>
117
+                  </template>
118
+                </el-table-column>
119
+
120
+                <el-table-column label="透析中最低血压" align="center">
121
+                  <template slot-scope="scope">
122
+                    <div v-if="scope.row.min_monitor.systolic_blood_pressure">{{ scope.row.min_monitor.systolic_blood_pressure}} /{{ scope.row.min_monitor.diastolic_blood_pressure}}</div>
123
+                  </template>
124
+                </el-table-column>
125
+
126
+                <el-table-column label="透析中最高血压" align="center">
127
+                  <template slot-scope="scope">
128
+                    <div v-if="scope.row.max_monitor.systolic_blood_pressure">{{ scope.row.max_monitor.systolic_blood_pressure}} /{{ scope.row.max_monitor.diastolic_blood_pressure}}</div>
129
+
130
+
131
+                  </template>
132
+                </el-table-column>
133
+
134
+                <el-table-column label="透后血压" align="center">
135
+                  <template slot-scope="scope">
136
+                    <div v-if="scope.row.after.systolic_blood_pressure"> {{ scope.row.after.systolic_blood_pressure}} /{{scope.row.after.diastolic_blood_pressure}}</div>
137
+                  </template>
138
+                </el-table-column>
139
+
140
+                <el-table-column fixed="right" label="趋势" align="center">
141
+                  <template slot-scope="scope">
142
+                    <el-button
143
+                      @click.native.prevent="jumpDetail(scope.row.patient.id)"
144
+                      type="text"
145
+                      size="small"
146
+                    >详情</el-button>
147
+                  </template>
148
+                </el-table-column>
149
+
82 150
               </el-table>
83 151
 
152
+
84 153
               <el-pagination
85 154
                 align="right"
86 155
                 @size-change="handleSizeChange"
87 156
                 @current-change="handleCurrentChange"
88
-                :current-page="listQuery.page"
157
+                :current-page="query.page"
89 158
                 :page-sizes="[10, 20, 50, 100]"
90 159
                 :page-size="10"
91 160
                 background
@@ -105,6 +174,11 @@
105 174
 import echarts from "echarts";
106 175
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
107 176
 import LineChart from "../../qcd/components/LineChart";
177
+import { getCurrentOrgPatients } from "@/api/common/common";
178
+import {GetDialysisPatientBloodPressureChartData,GetDialysisBloodPressureTableData} from "@/api/common/statistics"
179
+import { PostSearch } from '@/api/patient'
180
+import { uParseTime } from "@/utils/tools";
181
+
108 182
 export default {
109 183
   components: {
110 184
     LineChart,
@@ -112,77 +186,47 @@ export default {
112 186
   },
113 187
   data() {
114 188
     return {
189
+      pickerOptions: {
190
+        disabledDate(time) {
191
+          let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
192
+          return time.getTime() > Date.now() || time.getTime() < threeMonths;;
193
+        }
194
+      },
195
+      patientsData:[],
196
+      tableData: [
197
+      ],
198
+      loading: false,
199
+      search_value: '',
200
+      total: '',
201
+      query: {
202
+        patient_id: '',
203
+        statistics_type: 1,
204
+        start_time: '',
205
+        end_time: '',
206
+        limit: 10,
207
+        page: 1
208
+      },
209
+      options: [
210
+        { value: 1, name: '透前血压' },
211
+        { value: 2, name: '透后血压' },
212
+      ],
213
+
115 214
       crumbs: [
116 215
         { path: false, name: "科室质控" },
117 216
         { path: false, name: "患者血压详情" }
118 217
       ],
119
-      tableData: [
120
-        {
121
-          date: "2016",
122
-          name: "王小虎"
123
-        },
124
-        {
125
-          date: "2016",
126
-          name: "王小虎"
127
-        },
128
-        {
129
-          date: "2016",
130
-          name: "王小虎"
131
-        },
132
-        {
133
-          date: "2016",
134
-          name: "王小虎"
135
-        },
136
-        {
137
-          date: "2016",
138
-          name: "王小虎"
139
-        },
140
-        {
141
-          date: "2016",
142
-          name: "王小虎"
143
-        },
144
-        {
145
-          date: "2016",
146
-          name: "王小虎"
147
-        },
148
-        {
149
-          date: "2016",
150
-          name: "王小虎"
151
-        },
152
-        {
153
-          date: "2016",
154
-          name: "王小虎"
155
-        },
156
-        {
157
-          date: "2016",
158
-          name: "王小虎"
159
-        },
160
-        {
161
-          date: "2016",
162
-          name: "王小虎"
163
-        },
164
-        {
165
-          date: "2016",
166
-          name: "王小虎"
167
-        }
168
-      ],
169
-      listQuery: {
170
-        start_time: "",
171
-        end_time: "",
172
-        page: 1,
173
-        limit: 10
174
-      },
218
+
175 219
       chart: {
176 220
         title: {
177 221
           text: "ECharts 入门示例"
178 222
         },
179 223
         tooltip: {},
180 224
         legend: {
181
-          data: ["收缩压", "舒张压"],
225
+          data: [],
182 226
           left: 0
183 227
         },
184 228
         xAxis: {
185
-          data: ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
229
+          data: []
186 230
         },
187 231
         yAxis: {
188 232
           axisLabel: {
@@ -195,22 +239,14 @@ export default {
195 239
             name: "收缩压",
196 240
             type: "line",
197 241
             data: [
198
-              "78.57",
199
-              "50",
200
-              "80",
201
-              "93.33",
202
-              "92.86",
203
-              "100",
204
-              "12",
205
-              "77",
206
-              "37"
242
+
207 243
             ],
208 244
             barWidth: 30,
209 245
             label: {
210 246
               normal: {
211 247
                 show: true,
212 248
                 position: "top",
213
-                formatter: "{c}"
249
+                formatter: "{c}"
214 250
               }
215 251
             },
216 252
             //配置样式
@@ -226,13 +262,13 @@ export default {
226 262
           {
227 263
             name: "舒张压",
228 264
             type: "line",
229
-            data: ["10", "20", "30", "53.33", "42.86", "100", "60", "27", "97"],
265
+            data: [],
230 266
             barWidth: 30,
231 267
             label: {
232 268
               normal: {
233 269
                 show: true,
234 270
                 position: "top",
235
-                formatter: "{c}"
271
+                formatter: "{c}"
236 272
               }
237 273
             },
238 274
             //配置样式
@@ -247,97 +283,145 @@ export default {
247 283
           }
248 284
         ]
249 285
       },
250
-      tableData1: [
251
-        {
252
-          date: "2016-05-03",
253
-          name: "王小虎",
254
-          province: "上海",
255
-          city: "普陀区",
256
-          address: "上海市普陀区金沙江路 1518 弄",
257
-          zip: 200333
258
-        },
259
-        {
260
-          date: "2016-05-02",
261
-          name: "王小虎",
262
-          province: "上海",
263
-          city: "普陀区",
264
-          address: "上海市普陀区金沙江路 1518 弄",
265
-          zip: 200333
266
-        },
267
-        {
268
-          date: "2016-05-04",
269
-          name: "王小虎",
270
-          province: "上海",
271
-          city: "普陀区",
272
-          address: "上海市普陀区金沙江路 1518 弄",
273
-          zip: 200333
274
-        },
275
-        {
276
-          date: "2016-05-01",
277
-          name: "王小虎",
278
-          province: "上海",
279
-          city: "普陀区",
280
-          address: "上海市普陀区金沙江路 1518 弄",
281
-          zip: 200333
282
-        },
283
-        {
284
-          date: "2016-05-08",
285
-          name: "王小虎",
286
-          province: "上海",
287
-          city: "普陀区",
288
-          address: "上海市普陀区金沙江路 1518 弄",
289
-          zip: 200333
290
-        },
291
-        {
292
-          date: "2016-05-06",
293
-          name: "王小虎",
294
-          province: "上海",
295
-          city: "普陀区",
296
-          address: "上海市普陀区金沙江路 1518 弄",
297
-          zip: 200333
298
-        },
299
-        {
300
-          date: "2016-05-07",
301
-          name: "王小虎",
302
-          province: "上海",
303
-          city: "普陀区",
304
-          address: "上海市普陀区金沙江路 1518 弄",
305
-          zip: 200333
306
-        },
307
-        {
308
-          date: "2016-05-08",
309
-          name: "王小虎",
310
-          province: "上海",
311
-          city: "普陀区",
312
-          address: "上海市普陀区金沙江路 1518 弄",
313
-          zip: 200333
314
-        },
315
-        {
316
-          date: "2016-05-06",
317
-          name: "王小虎",
318
-          province: "上海",
319
-          city: "普陀区",
320
-          address: "上海市普陀区金沙江路 1518 弄",
321
-          zip: 200333
322
-        },
323
-        {
324
-          date: "2016-05-07",
325
-          name: "王小虎",
326
-          province: "上海",
327
-          city: "普陀区",
328
-          address: "上海市普陀区金沙江路 1518 弄",
329
-          zip: 200333
330
-        }
331
-      ]
332 286
     };
333 287
   },
334 288
   methods: {
289
+    GetDialysisBloodPressureTableData(params) {
290
+      this.loading = true
291
+      this.tableData = []
292
+      GetDialysisBloodPressureTableData(params)
293
+        .then(rs => {
294
+          var resp = rs.data
295
+          if (resp.state == 1) {
296
+            this.loading = false
297
+
298
+            for (let i = 0; i < resp.data.data.length; i++) {
299
+              this.tableData.push(resp.data.data[i])
300
+            }
301
+          } else {
302
+            this.loading = false
303
+          }
304
+        })
305
+        .catch(error => {
306
+
307
+        })
308
+    },
309
+    changeProject(val){
310
+      this.query.statistics_type = val
311
+      this.query.page = 1
312
+      this.GetDialysisPatientBloodPressureChartData(this.query)
313
+
314
+    },
315
+    handleChange(val){
316
+      this.query.patient_id = val.id
317
+      this.query.page = 1
318
+      this.GetDialysisBloodPressureTableData(this.query)
319
+      this.GetDialysisPatientBloodPressureChartData(this.query)
320
+    },
321
+    handleSizeChange(limit) {
322
+      this.query.limit = limit;
323
+
324
+    },
325
+    handleCurrentChange(page) {
326
+      this.query.page = page;
327
+
328
+    },changeTime(val) {
329
+      var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time);
330
+      if (time > 0) {
331
+        this.$message.error("结束时间不能小于开始时间");
332
+        this.query.start_time = "";
333
+      } else {
334
+        // this.getDialysisList()
335
+        this.query.page = 1;
336
+        this.GetDialysisBloodPressureChartData(this.query)
337
+        this.GetDialysisBloodPressureTableData(this.query)
338
+
339
+      }
340
+
341
+    },
342
+    changeEndTime(val) {
343
+      var time =
344
+        this.getTimestamp(val) - this.getTimestamp(this.query.start_time);
345
+      if (time < 0) {
346
+        this.$message.error("结束时间不能小于开始时间");
347
+        this.query.end_time = "";
348
+      } else {
349
+        this.query.page = 1;
350
+        this.GetDialysisBloodPressureChartData(this.query)
351
+        this.GetDialysisBloodPressureTableData(this.query)
352
+
353
+      }
354
+    },  getTimestamp(time) {
355
+      // 把时间日期转成时间戳
356
+      return new Date(time).getTime() / 1000;
357
+    },GetDialysisPatientBloodPressureChartData(params) {
358
+
359
+      this.chart.xAxis.data = []
360
+      this.chart.series[0].data = []
361
+      this.chart.series[1].data = []
362
+      GetDialysisPatientBloodPressureChartData(params)
363
+        .then(rs => {
364
+          var resp = rs.data
365
+          if (resp.state == 1) {
366
+            for (let i = 0; i < resp.data.data.length; i++) {
367
+              this.chart.xAxis.data.push(resp.data.data[i].date)
368
+              this.chart.series[0].data.push(resp.data.data[i].systolic_blood_pressure)
369
+              this.chart.series[1].data.push(resp.data.data[i].diastolic_blood_pressure)
370
+            }
371
+          } else {
372
+          }
373
+        })
374
+        .catch(error => {
375
+        })
376
+    }, handleSelect(val) {
377
+      this.query.patient_id = val.id
378
+      this.query.page = 1
379
+      this.GetDialysisPatientBloodPressureChartData(this.query)
380
+      this.GetDialysisBloodPressureTableData(this.query)
381
+
382
+    },  querySearchAsync(keyword, cb) {
383
+      let key = ''
384
+      if (keyword != undefined) {
385
+        key = keyword
386
+      }
387
+      let searchArray = []
388
+      PostSearch(key).then(response => {
389
+        if (response.data.state == 1) {
390
+          searchArray = response.data.data.patient
391
+          cb(searchArray)
392
+        } else {
393
+          cb([])
394
+        }
395
+      })
396
+    },getCurrentOrgPatients(){
397
+      getCurrentOrgPatients().then(response=>{
398
+        if(response.data.state == 1){
399
+          var patients = response.data.data.patients
400
+          this.patientsData = patients
401
+        }
402
+      })
403
+    },
404
+
335 405
     chooseMonth(month) {
336 406
       this.monthType = month;
337 407
     },
338 408
     clickQuality(index) {
339 409
       this.quality = index;
340 410
     }
411
+  },created() {
412
+    var date = new Date()
413
+    var year = date.getFullYear() //获取完整的年份(4位)
414
+    var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
415
+    var day = date.getDate() < 0 ? '0' + date.getDate().toString() : date.getDate() //获取当前日(1-31)
416
+    var last_month = date.getMonth() < 10 ? '0' + date.getMonth().toString() : date.getMonth() //获取当前月份(0-11,0代表1月)
417
+    this.query.patient_id = this.$route.query.id
418
+    this.query.end_time = year + '-' + month + '-' + day
419
+    this.query.start_time = year + '-' + last_month + '-' + day
420
+    this.query.statistics_type = 1
421
+    this.GetDialysisPatientBloodPressureChartData(this.query)
422
+    this.GetDialysisBloodPressureTableData(this.query)
423
+    this.getCurrentOrgPatients()
424
+
341 425
   }
342 426
 };
343 427
 </script>

+ 1 - 10
src/xt_pages/qcd/indicatorControlAnalysis/process.vue Ver fichero

@@ -90,7 +90,7 @@
90 90
             </div>
91 91
             <div class="tableTitle">统计表</div>
92 92
             <div>
93
-              <el-table :data="tableData"  :height="tableHeight"   v-loading="loading">
93
+              <el-table :data="tableData"    v-loading="loading">
94 94
                 <el-table-column  fixed label="透析日期" align="center">
95 95
                   <template slot-scope="scope">
96 96
                     {{scope.row.schedule_date | parseTime("{y}-{m}-{d}") }}
@@ -469,10 +469,7 @@
469 469
       }
470 470
     },
471 471
     methods: {
472
-      jumpDetail(patient_id){
473
-        this.$router.push("/dqc/bloodpressure/detail?id="+patient_id)
474 472
 
475
-      },
476 473
       changeProject(val){
477 474
         this.query.statistics_type = val
478 475
         this.query.page = 1
@@ -552,12 +549,6 @@
552 549
       },
553 550
       getModeName(mode_id){
554 551
         return this.$store.getters.treatment_mode[mode_id] != undefined ? this.$store.getters.treatment_mode[mode_id].name: ""
555
-      },
556
-      changeTime() {
557
-
558
-      }, changeEndTime() {
559
-
560
-
561 552
       }, GetDialysisProcessIndexTableData(params) {
562 553
         this.loading = true
563 554
         this.tableData = []

+ 4 - 6
src/xt_pages/qcd/indicatorControlAnalysis/weight.vue Ver fichero

@@ -375,6 +375,10 @@
375 375
       }
376 376
     },
377 377
     methods: {
378
+      jumpDetail(patient_id){
379
+        this.$router.push("/qcd/indicatorControlAnalysis/weightDetails?id="+patient_id)
380
+
381
+      },
378 382
       changeProject(val){
379 383
         this.query.statistics_type = val
380 384
         this.query.page = 1
@@ -453,12 +457,6 @@
453 457
       },
454 458
       getModeName(mode_id){
455 459
         return this.$store.getters.treatment_mode[mode_id] != undefined ? this.$store.getters.treatment_mode[mode_id].name: ""
456
-      },
457
-      changeTime() {
458
-
459
-      }, changeEndTime() {
460
-
461
-
462 460
       }, GetDialysisWeightTableData(params) {
463 461
         this.loading = true
464 462
         this.tableData = []

+ 263 - 197
src/xt_pages/qcd/indicatorControlAnalysis/weightDetails.vue Ver fichero

@@ -8,47 +8,66 @@
8 8
         <div class="cell clearfix" style="margin:0">
9 9
           <el-form :inline="true" :model="listQuery">
10 10
             <el-form-item label>
11
-              <el-input v-model.trim="listQuery.search" placeholder="姓名/透析号" style="width:150px"></el-input>
12
-              <el-button type="primary" @click="onSearch" icon="el-icon-search">搜索</el-button>
11
+              <el-autocomplete
12
+                class="checkSearch"
13
+                popper-class="my-autocomplete"
14
+                v-model="search_value"
15
+                :fetch-suggestions="querySearchAsync"
16
+                :trigger-on-focus="false"
17
+                placeholder="请输入病人名字"
18
+                @select="handleSelect"
19
+              >
20
+                <i class="el-icon-search el-input__icon" slot="suffix"></i>
21
+                <template slot-scope="{ item }">
22
+                  <div class="name">{{ item.name }}</div>
23
+                </template>
24
+              </el-autocomplete>
25
+
13 26
             </el-form-item>
14 27
           </el-form>
15 28
         </div>
16 29
         <el-container>
17 30
           <div style="width:150px">
18 31
             <div class="tableTitle">患者列表</div>
19
-            <el-table :data="tableData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
20
-              <el-table-column prop="date" label="日期" width="70"></el-table-column>
21
-              <el-table-column prop="name" label="姓名" width="80"></el-table-column>
32
+            <el-table :data="patientsData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }"
33
+                      :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
34
+                      highlight-current-row
35
+                      @current-change="handleChange">
36
+              <el-table-column prop="dialysis_no" label="透析号" width="80">
37
+                <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
38
+              </el-table-column>
39
+              <el-table-column prop="name" label="姓名" width="80">
40
+                <template slot-scope="scope">{{ scope.row.name }}</template>
41
+              </el-table-column>
22 42
             </el-table>
43
+
44
+
23 45
           </div>
24 46
           <div class="containerRight" style="flex:1;overflow: hidden">
25 47
             <div class="cell clearfix">
26 48
               <label class="title" style="text-align:left">
27
-                <span class="name">血压阶段</span> :
49
+                <span class="name">体重类型</span> :
28 50
               </label>
29
-              <el-select
30
-                v-model="value"
31
-                placeholder="请选择"
32
-                @change="chooseType"
33
-                style="width:110px;margin-right:10px"
34
-              >
51
+              <el-select v-model="query.statistics_type" placeholder="请选择" style="width:110px;margin-right:10px" @change="changeProject">
35 52
                 <el-option
36 53
                   v-for="item in options"
37 54
                   :key="item.value"
38
-                  :label="item.label"
55
+                  :label="item.name"
39 56
                   :value="item.value"
57
+
40 58
                 ></el-option>
41 59
               </el-select>
42 60
               <label class="title">
43 61
                 <span class="name">日期查询</span> :
44 62
               </label>
45 63
               <el-date-picker
46
-                v-model="listQuery.start_time"
64
+                v-model="query.start_time"
47 65
                 prefix-icon="el-icon-date"
48 66
                 @change="changeTime"
49 67
                 :editable="false"
68
+                style="width: 150px;"
50 69
                 type="date"
51
-                style="max-width:160px"
70
+                :picker-options="pickerOptions"
52 71
                 placeholder="选择日期时间"
53 72
                 align="right"
54 73
                 format="yyyy-MM-dd"
@@ -56,12 +75,13 @@
56 75
               ></el-date-picker>
57 76
               <span class>-</span>
58 77
               <el-date-picker
59
-                v-model="listQuery.end_time"
78
+                v-model="query.end_time"
60 79
                 prefix-icon="el-icon-date"
61 80
                 @change="changeEndTime"
62 81
                 :editable="false"
82
+                :picker-options="pickerOptions"
83
+                style="width: 150px;"
63 84
                 type="date"
64
-                style="max-width:160px"
65 85
                 placeholder="选择日期时间"
66 86
                 align="right"
67 87
                 format="yyyy-MM-dd"
@@ -74,18 +94,68 @@
74 94
             </div>
75 95
             <div class="tableTitle">统计表</div>
76 96
             <div>
77
-              <el-table :data="tableData1" style="width: 100%" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
78
-                <el-table-column fixed prop="date" label="日期"></el-table-column>
79
-                <el-table-column prop="name" label="姓名"></el-table-column>
80
-                <el-table-column prop="province" label="省份"></el-table-column>
81
-                <el-table-column prop="city" label="市区"></el-table-column>
97
+              <el-table :data="tableData" style="width: 100%" :height="tableHeight" >
98
+                <el-table-column fixed label="日期" align="center">
99
+                  <template slot-scope="scope">
100
+                    {{scope.row.assessment_date | parseTime("{y}-{m}-{d}") }}
101
+                  </template>
102
+                </el-table-column>
103
+
104
+                <el-table-column label="姓名" align="center">
105
+                  <template slot-scope="scope">
106
+                    {{scope.row.patient.name}}
107
+                  </template>
108
+                </el-table-column>
109
+
110
+                <el-table-column label="干体重" align="center">
111
+                  <template slot-scope="scope">
112
+                    {{scope.row.dry_weight?scope.row.dry_weight:''}}
113
+
114
+                    <!--{{// scope.row.patient.lapseto == 1 ? '留治':'转出'}}-->
115
+                  </template>
116
+                </el-table-column>
117
+
118
+                <el-table-column label="前次透后体重" align="center">
119
+                  <template slot-scope="scope">
120
+                    {{scope.row.last_after_weight?scope.row.last_after_weight:''}}
121
+
122
+                    <!--<div v-if="scope.row.before.systolic_blood_pressure">{{scope.row.before.systolic_blood_pressure}} / {{scope.row.before.diastolic_blood_pressure}}</div>-->
123
+                  </template>
124
+                </el-table-column>
125
+
126
+                <el-table-column label="透前体重" align="center">
127
+                  <template slot-scope="scope">
128
+                    {{scope.row.weight_before?scope.row.weight_before:''}}
129
+
130
+                    <!--<div v-if="scope.row.min_monitor.systolic_blood_pressure">{{ scope.row.min_monitor.systolic_blood_pressure}} /{{ scope.row.min_monitor.diastolic_blood_pressure}}</div>-->
131
+                  </template>
132
+                </el-table-column>
133
+
134
+                <el-table-column label="透后体重" align="center">
135
+                  <template slot-scope="scope">
136
+                    <!--<div v-if="scope.row.max_monitor.systolic_blood_pressure">{{ scope.row.max_monitor.systolic_blood_pressure}} /{{ scope.row.max_monitor.diastolic_blood_pressure}}</div>-->
137
+                    {{scope.row.after.weight_after?scope.row.after.weight_after:''}}
138
+
139
+
140
+                  </template>
141
+                </el-table-column>
142
+
143
+                <el-table-column label="体重增加" align="center">
144
+                  <template slot-scope="scope">
145
+                    <div v-if="scope.row.weight_before && scope.row.last_after_weight">{{scope.row.weight_before - scope.row.last_after_weight}}</div>
146
+
147
+                    <!--{{scope.row.weight_before - scope.row.last_after_weight}}-->
148
+                    <!--<div v-if="scope.row.after.systolic_blood_pressure"> {{ scope.row.after.systolic_blood_pressure}} /{{scope.row.after.diastolic_blood_pressure}}</div>-->
149
+                  </template>
150
+                </el-table-column>
151
+
82 152
               </el-table>
83 153
 
84 154
               <el-pagination
85 155
                 align="right"
86 156
                 @size-change="handleSizeChange"
87 157
                 @current-change="handleCurrentChange"
88
-                :current-page="listQuery.page"
158
+                :current-page="query.page"
89 159
                 :page-sizes="[10, 20, 50, 100]"
90 160
                 :page-size="10"
91 161
                 background
@@ -105,6 +175,13 @@
105 175
 import echarts from "echarts";
106 176
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
107 177
 import LineChart from "../../qcd/components/LineChart";
178
+
179
+import { getCurrentOrgPatients } from "@/api/common/common";
180
+import {GetDialysisPatientWeightChartData,GetDialysisWeightTableData} from "@/api/common/statistics"
181
+import { PostSearch } from '@/api/patient'
182
+import { uParseTime } from "@/utils/tools";
183
+
184
+
108 185
 export default {
109 186
   components: {
110 187
     LineChart,
@@ -112,77 +189,49 @@ export default {
112 189
   },
113 190
   data() {
114 191
     return {
192
+      pickerOptions: {
193
+        disabledDate(time) {
194
+          let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
195
+          return time.getTime() > Date.now() || time.getTime() < threeMonths;;
196
+        }
197
+      },
198
+      patientsData:[],
199
+      tableData: [
200
+      ],
201
+      loading: false,
202
+      search_value: '',
203
+      total: '',
204
+      query: {
205
+        patient_id: '',
206
+        statistics_type: 1,
207
+        start_time: '',
208
+        end_time: '',
209
+        limit: 10,
210
+        page: 1
211
+      },
212
+      options: [
213
+        { value: 1, name: '干体重' },
214
+        { value: 2, name: '透前体重' },
215
+        { value: 3, name: '体重增加' },
216
+        { value: 4, name: '透后体重' },
217
+      ],
218
+
115 219
       crumbs: [
116 220
         { path: false, name: "科室质控" },
117 221
         { path: false, name: "患者血压详情" }
118 222
       ],
119
-      tableData: [
120
-        {
121
-          date: "2016",
122
-          name: "王小虎"
123
-        },
124
-        {
125
-          date: "2016",
126
-          name: "王小虎"
127
-        },
128
-        {
129
-          date: "2016",
130
-          name: "王小虎"
131
-        },
132
-        {
133
-          date: "2016",
134
-          name: "王小虎"
135
-        },
136
-        {
137
-          date: "2016",
138
-          name: "王小虎"
139
-        },
140
-        {
141
-          date: "2016",
142
-          name: "王小虎"
143
-        },
144
-        {
145
-          date: "2016",
146
-          name: "王小虎"
147
-        },
148
-        {
149
-          date: "2016",
150
-          name: "王小虎"
151
-        },
152
-        {
153
-          date: "2016",
154
-          name: "王小虎"
155
-        },
156
-        {
157
-          date: "2016",
158
-          name: "王小虎"
159
-        },
160
-        {
161
-          date: "2016",
162
-          name: "王小虎"
163
-        },
164
-        {
165
-          date: "2016",
166
-          name: "王小虎"
167
-        }
168
-      ],
169
-      listQuery: {
170
-        start_time: "",
171
-        end_time: "",
172
-        page: 1,
173
-        limit: 10
174
-      },
223
+
175 224
       chart: {
176 225
         title: {
177 226
           text: "ECharts 入门示例"
178 227
         },
179 228
         tooltip: {},
180 229
         legend: {
181
-          data: ["透前体重", "透后体重"],
230
+          data: [],
182 231
           left: 0
183 232
         },
184 233
         xAxis: {
185
-          data: ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
234
+          data: []
186 235
         },
187 236
         yAxis: {
188 237
           axisLabel: {
@@ -192,25 +241,17 @@ export default {
192 241
         },
193 242
         series: [
194 243
           {
195
-            name: "透前体重",
244
+            name: "",
196 245
             type: "line",
197 246
             data: [
198
-              "78.57",
199
-              "50",
200
-              "80",
201
-              "93.33",
202
-              "92.86",
203
-              "100",
204
-              "12",
205
-              "77",
206
-              "37"
247
+
207 248
             ],
208 249
             barWidth: 30,
209 250
             label: {
210 251
               normal: {
211 252
                 show: true,
212 253
                 position: "top",
213
-                formatter: "{c}"
254
+                formatter: "{c}"
214 255
               }
215 256
             },
216 257
             //配置样式
@@ -223,112 +264,8 @@ export default {
223 264
               }
224 265
             }
225 266
           },
226
-          {
227
-            name: "透后体重",
228
-            type: "line",
229
-            data: ["10", "20", "30", "53.33", "42.86", "100", "60", "27", "97"],
230
-            barWidth: 30,
231
-            label: {
232
-              normal: {
233
-                show: true,
234
-                position: "top",
235
-                formatter: "{c}次"
236
-              }
237
-            },
238
-            //配置样式
239
-            itemStyle: {
240
-              normal: {
241
-                color: "#dd7383", //折点颜色
242
-                lineStyle: {
243
-                  color: "#dd7383" //折线颜色
244
-                }
245
-              }
246
-            }
247
-          }
248 267
         ]
249 268
       },
250
-      tableData1: [
251
-        {
252
-          date: "2016-05-03",
253
-          name: "王小虎",
254
-          province: "上海",
255
-          city: "普陀区",
256
-          address: "上海市普陀区金沙江路 1518 弄",
257
-          zip: 200333
258
-        },
259
-        {
260
-          date: "2016-05-02",
261
-          name: "王小虎",
262
-          province: "上海",
263
-          city: "普陀区",
264
-          address: "上海市普陀区金沙江路 1518 弄",
265
-          zip: 200333
266
-        },
267
-        {
268
-          date: "2016-05-04",
269
-          name: "王小虎",
270
-          province: "上海",
271
-          city: "普陀区",
272
-          address: "上海市普陀区金沙江路 1518 弄",
273
-          zip: 200333
274
-        },
275
-        {
276
-          date: "2016-05-01",
277
-          name: "王小虎",
278
-          province: "上海",
279
-          city: "普陀区",
280
-          address: "上海市普陀区金沙江路 1518 弄",
281
-          zip: 200333
282
-        },
283
-        {
284
-          date: "2016-05-08",
285
-          name: "王小虎",
286
-          province: "上海",
287
-          city: "普陀区",
288
-          address: "上海市普陀区金沙江路 1518 弄",
289
-          zip: 200333
290
-        },
291
-        {
292
-          date: "2016-05-06",
293
-          name: "王小虎",
294
-          province: "上海",
295
-          city: "普陀区",
296
-          address: "上海市普陀区金沙江路 1518 弄",
297
-          zip: 200333
298
-        },
299
-        {
300
-          date: "2016-05-07",
301
-          name: "王小虎",
302
-          province: "上海",
303
-          city: "普陀区",
304
-          address: "上海市普陀区金沙江路 1518 弄",
305
-          zip: 200333
306
-        },
307
-        {
308
-          date: "2016-05-08",
309
-          name: "王小虎",
310
-          province: "上海",
311
-          city: "普陀区",
312
-          address: "上海市普陀区金沙江路 1518 弄",
313
-          zip: 200333
314
-        },
315
-        {
316
-          date: "2016-05-06",
317
-          name: "王小虎",
318
-          province: "上海",
319
-          city: "普陀区",
320
-          address: "上海市普陀区金沙江路 1518 弄",
321
-          zip: 200333
322
-        },
323
-        {
324
-          date: "2016-05-07",
325
-          name: "王小虎",
326
-          province: "上海",
327
-          city: "普陀区",
328
-          address: "上海市普陀区金沙江路 1518 弄",
329
-          zip: 200333
330
-        }
331
-      ]
332 269
     };
333 270
   },
334 271
   methods: {
@@ -337,7 +274,136 @@ export default {
337 274
     },
338 275
     clickQuality(index) {
339 276
       this.quality = index;
340
-    }
277
+    },  changeProject(val){
278
+      this.query.statistics_type = val
279
+      this.query.page = 1
280
+      this.GetDialysisPatientWeightChartData(this.query)
281
+
282
+    },
283
+    handleChange(val){
284
+      this.query.patient_id = val.id
285
+      this.query.page = 1
286
+      this.GetDialysisWeightTableData(this.query)
287
+      this.GetDialysisPatientWeightChartData(this.query)
288
+    },
289
+    handleSizeChange(limit) {
290
+      this.query.limit = limit;
291
+
292
+    },
293
+    handleCurrentChange(page) {
294
+      this.query.page = page;
295
+
296
+    },
297
+    changeTime(val) {
298
+      var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time);
299
+      if (time > 0) {
300
+        this.$message.error("结束时间不能小于开始时间");
301
+        this.query.start_time = "";
302
+      } else {
303
+        // this.getDialysisList()
304
+        this.query.page = 1;
305
+        this.GetDialysisPatientWeightChartData(this.query)
306
+        this.GetDialysisWeightTableData(this.query)
307
+
308
+      }
309
+
310
+    },
311
+    changeEndTime(val) {
312
+      var time =
313
+        this.getTimestamp(val) - this.getTimestamp(this.query.start_time);
314
+      if (time < 0) {
315
+        this.$message.error("结束时间不能小于开始时间");
316
+        this.query.end_time = "";
317
+      } else {
318
+        this.query.page = 1;
319
+        this.GetDialysisPatientWeightChartData(this.query)
320
+        this.GetDialysisWeightTableData(this.query)
321
+
322
+      }
323
+    },
324
+    getTimestamp(time) {
325
+      // 把时间日期转成时间戳
326
+      return new Date(time).getTime() / 1000;
327
+    },GetDialysisWeightTableData(params) {
328
+      this.loading = true
329
+      this.tableData = []
330
+      GetDialysisWeightTableData(params)
331
+        .then(rs => {
332
+          var resp = rs.data
333
+          if (resp.state == 1) {
334
+            this.loading = false
335
+
336
+            for (let i = 0; i < resp.data.data.length; i++) {
337
+              this.tableData.push(resp.data.data[i])
338
+            }
339
+          } else {
340
+            this.loading = false
341
+          }
342
+        })
343
+        .catch(error => {
344
+
345
+        })
346
+    },
347
+    GetDialysisPatientWeightChartData(params) {
348
+      this.chart.xAxis.data = []
349
+      this.chart.series[0].data = []
350
+      GetDialysisPatientWeightChartData(params)
351
+        .then(rs => {
352
+          var resp = rs.data
353
+          if (resp.state == 1) {
354
+            for (let i = 0; i < resp.data.data.length; i++) {
355
+              this.chart.xAxis.data.push(resp.data.data[i].date)
356
+              this.chart.series[0].data.push(resp.data.data[i].value)
357
+            }
358
+          } else {
359
+          }
360
+        })
361
+        .catch(error => {
362
+        })
363
+    },
364
+    handleSelect(val) {
365
+      this.query.patient_id = val.id
366
+      this.query.page = 1
367
+      this.GetDialysisPatientWeightChartData(this.query)
368
+      this.GetDialysisWeightTableData(this.query)
369
+
370
+    },
371
+    querySearchAsync(keyword, cb) {
372
+      let key = ''
373
+      if (keyword != undefined) {
374
+        key = keyword
375
+      }
376
+      let searchArray = []
377
+      PostSearch(key).then(response => {
378
+        if (response.data.state == 1) {
379
+          searchArray = response.data.data.patient
380
+          cb(searchArray)
381
+        } else {
382
+          cb([])
383
+        }
384
+      })
385
+    }, getCurrentOrgPatients(){
386
+      getCurrentOrgPatients().then(response=>{
387
+        if(response.data.state == 1){
388
+          var patients = response.data.data.patients
389
+          this.patientsData = patients
390
+        }
391
+      })
392
+    },
393
+  },created() {
394
+    var date = new Date()
395
+    var year = date.getFullYear() //获取完整的年份(4位)
396
+    var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
397
+    var day = date.getDate() < 0 ? '0' + date.getDate().toString() : date.getDate() //获取当前日(1-31)
398
+    var last_month = date.getMonth() < 10 ? '0' + date.getMonth().toString() : date.getMonth() //获取当前月份(0-11,0代表1月)
399
+    this.query.patient_id = this.$route.query.id
400
+    this.query.end_time = year + '-' + month + '-' + day
401
+    this.query.start_time = year + '-' + last_month + '-' + day
402
+    this.query.statistics_type = 1
403
+    this.GetDialysisPatientWeightChartData(this.query)
404
+    this.GetDialysisWeightTableData(this.query)
405
+    this.getCurrentOrgPatients()
406
+
341 407
   }
342 408
 };
343 409
 </script>

+ 213 - 146
src/xt_pages/qcd/workAnalysis/doctor.vue Ver fichero

@@ -10,24 +10,25 @@
10 10
           <el-tab-pane label="护士" name="second"></el-tab-pane>
11 11
         </el-tabs>
12 12
         <div class="cell clearfix">
13
-          <el-select v-model="value" placeholder="请选择" style="width:120px;margin-right:20px">
13
+          <el-select v-model="query.admin_user_id" placeholder="请选择" style="width:120px;margin-right:20px"               @change="changeDoctor"
14
+          >
14 15
             <el-option
15
-              v-for="item in options"
16
-              :key="item.value"
17
-              :label="item.label"
18
-              :value="item.value"
16
+              v-for="item in doctor_options"
17
+              :key="item.id"
18
+              :label="item.user_name"
19
+              :value="item.admin_user_id"
19 20
             ></el-option>
20 21
           </el-select>
21 22
           <el-select
22
-            v-model="value"
23
+            v-model="query.statistics_type"
23 24
             placeholder="请选择"
24
-            @change="chooseType"
25
+            @change="changeProject"
25 26
             style="width:120px;margin-right:20px"
26 27
           >
27 28
             <el-option
28
-              v-for="item in options"
29
+              v-for="item in project_options"
29 30
               :key="item.value"
30
-              :label="item.label"
31
+              :label="item.name"
31 32
               :value="item.value"
32 33
             ></el-option>
33 34
           </el-select>
@@ -35,12 +36,13 @@
35 36
             <span class="name">日期查询</span> :
36 37
           </label>
37 38
           <el-date-picker
38
-            v-model="listQuery.start_time"
39
+            v-model="query.start_time"
39 40
             prefix-icon="el-icon-date"
40 41
             @change="changeTime"
41 42
             :editable="false"
42
-            style="width: 196px;"
43
+            style="width: 150px;"
43 44
             type="date"
45
+            :picker-options="pickerOptions"
44 46
             placeholder="选择日期时间"
45 47
             align="right"
46 48
             format="yyyy-MM-dd"
@@ -48,11 +50,12 @@
48 50
           ></el-date-picker>
49 51
           <span class>-</span>
50 52
           <el-date-picker
51
-            v-model="listQuery.end_time"
53
+            v-model="query.end_time"
52 54
             prefix-icon="el-icon-date"
53 55
             @change="changeEndTime"
54 56
             :editable="false"
55
-            style="width: 196px;"
57
+            :picker-options="pickerOptions"
58
+            style="width: 150px;"
56 59
             type="date"
57 60
             placeholder="选择日期时间"
58 61
             align="right"
@@ -62,31 +65,53 @@
62 65
         </div>
63 66
         <div class="tableTitle">统计图</div>
64 67
         <div>
65
-          <line-chart :options="chart"></line-chart>
68
+          <line-chart :options="bar"></line-chart>
66 69
         </div>
67 70
         <div class="tableTitle">统计表</div>
68 71
         <div>
69
-          <el-table :data="tableData" style="width: 100%" border show-summary :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
70
-            <el-table-column fixed prop="date" label="日期"></el-table-column>
71
-            <el-table-column prop="name" label="姓名"></el-table-column>
72
-            <el-table-column prop="province" label="省份"></el-table-column>
73
-            <el-table-column prop="city" label="市区"></el-table-column>
74
-            <el-table-column prop="address" label="地址"></el-table-column>
75
-            <el-table-column prop="zip" label="邮编"></el-table-column>
72
+          <el-table :data="tableData" style="width: 100%" :height="tableHeight">
73
+            <el-table-column fixed label="姓名" align="center">
74
+              <template slot-scope="scope">
75
+                {{scope.row.user_name}}
76
+
77
+              </template>
78
+            </el-table-column>
79
+
80
+            <el-table-column label="治疗人次" align="center">
81
+              <template slot-scope="scope">
82
+                {{scope.row.p_count?scope.row.p_count:''}}
83
+
84
+              </template>
85
+            </el-table-column>
86
+
87
+            <el-table-column label="病程记录" align="center">
88
+              <template slot-scope="scope">
89
+                {{scope.row.course_count?scope.row.course_count:''}}
90
+
91
+                <!--{{// scope.row.patient.lapseto == 1 ? '留治':'转出'}}-->
92
+              </template>
93
+            </el-table-column>
94
+
95
+            <el-table-column label="抢救记录" align="center">
96
+              <template slot-scope="scope">
97
+                {{scope.row.rescue_count?scope.row.rescue_count:''}}
98
+
99
+                <!--{{scope.row.last_after_weight?scope.row.last_after_weight:''}}-->
100
+
101
+                <!--<div v-if="scope.row.before.systolic_blood_pressure">{{scope.row.before.systolic_blood_pressure}} / {{scope.row.before.diastolic_blood_pressure}}</div>-->
102
+              </template>
103
+            </el-table-column>
104
+
105
+            <el-table-column label="合计" align="center">
106
+              <template slot-scope="scope">
107
+                {{scope.row.p_count + scope.row.course_count + scope.row.rescue_count?scope.row.p_count + scope.row.course_count + scope.row.rescue_count:''}}
108
+
109
+                <!--<div v-if="scope.row.min_monitor.systolic_blood_pressure">{{ scope.row.min_monitor.systolic_blood_pressure}} /{{ scope.row.min_monitor.diastolic_blood_pressure}}</div>-->
110
+              </template>
111
+            </el-table-column>
112
+
76 113
           </el-table>
77 114
 
78
-          <el-pagination
79
-            align="right"
80
-            @size-change="handleSizeChange"
81
-            @current-change="handleCurrentChange"
82
-            :current-page="listQuery.page"
83
-            :page-sizes="[10, 20, 50, 100]"
84
-            :page-size="10"
85
-            background
86
-            style="margin-top:20px;"
87
-            layout="total, sizes, prev, pager, next, jumper"
88
-            :total="total"
89
-          ></el-pagination>
90 115
         </div>
91 116
       </div>
92 117
     </div>
@@ -97,6 +122,9 @@
97 122
 import echarts from "echarts";
98 123
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
99 124
 import LineChart from "../../qcd/components/LineChart";
125
+
126
+import {GetDoctorWorkloadChartData,GetDoctorWorkloadTableData,GetAllAdminUser} from "@/api/common/statistics";
127
+
100 128
 export default {
101 129
   components: {
102 130
     BreadCrumb,
@@ -104,6 +132,32 @@ export default {
104 132
   },
105 133
   data() {
106 134
     return {
135
+      pickerOptions: {
136
+        disabledDate(time) {
137
+          let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
138
+          return time.getTime() > Date.now() || time.getTime() < threeMonths;;
139
+        }
140
+      },
141
+      tableData: [
142
+      ],
143
+      loading: false,
144
+      total: '',
145
+      query: {
146
+        admin_user_id: "",
147
+        statistics_type: 1,
148
+        start_time: "",
149
+        end_time: "",
150
+        limit:20,
151
+        page:1,
152
+      },
153
+
154
+
155
+      doctor_options:[],
156
+      project_options:[
157
+        {value:1, name:"治疗"},
158
+        {value:2, name:"病程记录"},
159
+        {value:3, name:"抢救记录"}
160
+      ],
107 161
       crumbs: [
108 162
         { path: false, name: "科室质控" },
109 163
         { path: false, name: "工作量分析统计" },
@@ -116,122 +170,19 @@ export default {
116 170
         page: 1,
117 171
         limit: 10
118 172
       },
119
-      options: [
120
-        {
121
-          value: "选项1",
122
-          label: "黄金糕"
123
-        },
124
-        {
125
-          value: "选项2",
126
-          label: "双皮奶"
127
-        },
128
-        {
129
-          value: "选项3",
130
-          label: "蚵仔煎"
131
-        },
132
-        {
133
-          value: "选项4",
134
-          label: "龙须面"
135
-        },
136
-        {
137
-          value: "选项5",
138
-          label: "北京烤鸭"
139
-        }
140
-      ],
173
+
141 174
       value: "请选项",
142
-      tableData: [
143
-        {
144
-          date: "2016-05-03",
145
-          name: "王小虎",
146
-          province: "上海",
147
-          city: "普陀区",
148
-          address: "上海市普陀区金沙江路 1518 弄",
149
-          zip: 200333
150
-        },
151
-        {
152
-          date: "2016-05-02",
153
-          name: "王小虎",
154
-          province: "上海",
155
-          city: "普陀区",
156
-          address: "上海市普陀区金沙江路 1518 弄",
157
-          zip: 200333
158
-        },
159
-        {
160
-          date: "2016-05-04",
161
-          name: "王小虎",
162
-          province: "上海",
163
-          city: "普陀区",
164
-          address: "上海市普陀区金沙江路 1518 弄",
165
-          zip: 200333
166
-        },
167
-        {
168
-          date: "2016-05-01",
169
-          name: "王小虎",
170
-          province: "上海",
171
-          city: "普陀区",
172
-          address: "上海市普陀区金沙江路 1518 弄",
173
-          zip: 200333
174
-        },
175
-        {
176
-          date: "2016-05-08",
177
-          name: "王小虎",
178
-          province: "上海",
179
-          city: "普陀区",
180
-          address: "上海市普陀区金沙江路 1518 弄",
181
-          zip: 200333
182
-        },
183
-        {
184
-          date: "2016-05-06",
185
-          name: "王小虎",
186
-          province: "上海",
187
-          city: "普陀区",
188
-          address: "上海市普陀区金沙江路 1518 弄",
189
-          zip: 200333
190
-        },
191
-        {
192
-          date: "2016-05-07",
193
-          name: "王小虎",
194
-          province: "上海",
195
-          city: "普陀区",
196
-          address: "上海市普陀区金沙江路 1518 弄",
197
-          zip: 200333
198
-        },
199
-        {
200
-          date: "2016-05-08",
201
-          name: "王小虎",
202
-          province: "上海",
203
-          city: "普陀区",
204
-          address: "上海市普陀区金沙江路 1518 弄",
205
-          zip: 200333
206
-        },
207
-        {
208
-          date: "2016-05-06",
209
-          name: "王小虎",
210
-          province: "上海",
211
-          city: "普陀区",
212
-          address: "上海市普陀区金沙江路 1518 弄",
213
-          zip: 200333
214
-        },
215
-        {
216
-          date: "2016-05-07",
217
-          name: "王小虎",
218
-          province: "上海",
219
-          city: "普陀区",
220
-          address: "上海市普陀区金沙江路 1518 弄",
221
-          zip: 200333
222
-        }
223
-      ],
224
-      chart: {
175
+      bar: {
225 176
         title: {
226 177
           text: "ECharts 入门示例"
227 178
         },
228 179
         tooltip: {},
229 180
         legend: {
230
-          data: ["次数"],
181
+          data: [],
231 182
           left: 0
232 183
         },
233 184
         xAxis: {
234
-          data: ["达标", "未达标"]
185
+          data: []
235 186
         },
236 187
         yAxis: {
237 188
           axisLabel: {
@@ -241,15 +192,15 @@ export default {
241 192
         },
242 193
         series: [
243 194
           {
244
-            name: "次数",
195
+            name: "",
245 196
             type: "bar",
246
-            data: ["78.57", "50"],
197
+            data: [],
247 198
             barWidth: 30,
248 199
             label: {
249 200
               normal: {
250 201
                 show: true,
251 202
                 position: "top",
252
-                formatter: "{c}"
203
+                formatter: "{c}"
253 204
               }
254 205
             },
255 206
             //配置样式
@@ -293,14 +244,115 @@ export default {
293 244
     };
294 245
   },
295 246
   methods: {
296
-    changeTime() {},
247
+    changeDoctor(val){
248
+      this.query.admin_user_id = val
249
+      this.query.page = 1
250
+      this.GetDoctorWorkloadTableData(this.query)
251
+
252
+    },
253
+    GetAllDoctor(){
254
+      GetAllAdminUser().then(response => {
255
+        if (response.data.state == 1) {
256
+          var adminUser = response.data.data.admin
257
+          this.admin_user  = adminUser
258
+          for (let i = 0; i < adminUser.length; i++){
259
+            if(adminUser[i].user_type == 2){
260
+              this.doctor_options.push(adminUser[i])
261
+            }
262
+          }
263
+        } else {
264
+          this.$message.error('请求数据失败')
265
+          return false
266
+        }
267
+      })
268
+
269
+    },
270
+    changeProject(val){
271
+      this.query.statistics_type = val
272
+      this.query.page = 1
273
+      this.GetDoctorWorkloadChartData(this.query)
274
+      // this.GetDialysisProcessIndexTableData(this.query)
275
+
276
+    },
277
+    handleSizeChange(limit) {
278
+      this.query.limit = limit;
279
+      this.GetDoctorWorkloadTableData(this.query)
280
+    },
281
+    handleCurrentChange(page) {
282
+      this.query.page = page;
283
+      this.GetDoctorWorkloadTableData(this.query)
284
+    },GetDoctorWorkloadTableData(params) {
285
+      this.loading = true
286
+      this.tableData = []
287
+      GetDoctorWorkloadTableData(params)
288
+        .then(rs => {
289
+          var resp = rs.data
290
+          if (resp.state == 1) {
291
+            this.loading = false
292
+            for (let i = 0; i < resp.data.data.length; i++) {
293
+              this.tableData.push(resp.data.data[i])
294
+            }
295
+          } else {
296
+            this.loading = false
297
+          }
298
+        })
299
+        .catch(error => {
300
+
301
+        })
302
+    },
303
+    changeTime(val) {
304
+      var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time);
305
+      if (time > 0) {
306
+        this.$message.error("结束时间不能小于开始时间");
307
+        this.query.start_time = "";
308
+      } else {
309
+        // this.getDialysisList()
310
+        this.query.page = 1;
311
+        this.GetDoctorWorkloadChartData(this.query)
312
+        this.GetDoctorWorkloadTableData(this.query)
313
+
314
+      }
315
+
316
+    },  GetDoctorWorkloadChartData(params) {
317
+
318
+      this.bar.xAxis.data = []
319
+      this.bar.series[0].data = []
320
+      GetDoctorWorkloadChartData(params)
321
+        .then(rs => {
322
+          var resp = rs.data
323
+          if (resp.state == 1) {
324
+
325
+            for (let i = 0;  i < resp.data.data.length;i++){
326
+              this.bar.xAxis.data.push(resp.data.data[i].user_name)
327
+              if(this.query.statistics_type == 1){
328
+
329
+                this.bar.series[0].data.push(resp.data.data[i].p_count)
330
+
331
+              }else if(this.query.statistics_type == 2){
332
+                this.bar.series[0].data.push(resp.data.data[i].course_count)
333
+
334
+              }else if(this.query.statistics_type == 3){
335
+                this.bar.series[0].data.push(resp.data.data[i].rescue_count)
336
+
337
+              }
338
+            }
339
+          } else {
340
+          }
341
+        })
342
+        .catch(error => {
343
+        })
344
+    },
297 345
     changeEndTime(val) {
298 346
       var time =
299
-        this.getTimestamp(val) - this.getTimestamp(this.listQuery.start_time);
347
+        this.getTimestamp(val) - this.getTimestamp(this.query.start_time);
300 348
       if (time < 0) {
301 349
         this.$message.error("结束时间不能小于开始时间");
302
-        this.listQuery.end_time = "";
350
+        this.query.end_time = "";
303 351
       } else {
352
+        this.query.page = 1;
353
+        this.GetDoctorWorkloadChartData(this.query)
354
+        this.GetDoctorWorkloadTableData(this.query)
355
+
304 356
       }
305 357
     },
306 358
     handleClick() {
@@ -308,6 +360,21 @@ export default {
308 360
         this.$router.push({ path: "/qcd/workAnalysis/nurse" });
309 361
       }
310 362
     }
363
+  },created(){
364
+    var date = new Date()
365
+    var year = date.getFullYear() //获取完整的年份(4位)
366
+    var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
367
+    var day = date.getDate() < 0 ? '0' + date.getDate().toString() : date.getDate() //获取当前日(1-31)
368
+    var last_month = date.getMonth() < 10 ? '0' + date.getMonth().toString() : date.getMonth() //获取当前月份(0-11,0代表1月)
369
+    this.query.patient_id = 0
370
+    this.query.end_time = year + '-' + month + '-' + day
371
+    this.query.start_time = year + '-' + last_month + '-' + day
372
+    this.query.statistics_type = 1
373
+    this.GetAllDoctor()
374
+    this.GetDoctorWorkloadChartData(this.query)
375
+    this.GetDoctorWorkloadTableData(this.query)
376
+
377
+
311 378
   }
312 379
 };
313 380
 </script>

+ 355 - 238
src/xt_pages/qcd/workAnalysis/nurse.vue Ver fichero

@@ -10,24 +10,25 @@
10 10
           <el-tab-pane label="护士" name="second"></el-tab-pane>
11 11
         </el-tabs>
12 12
         <div class="cell clearfix">
13
-          <el-select v-model="value" placeholder="请选择" style="width:120px;margin-right:20px">
13
+          <el-select v-model="query.admin_user_id" placeholder="请选择" style="width:120px;margin-right:20px"               @change="changeNurse"
14
+          >
14 15
             <el-option
15
-              v-for="item in options"
16
-              :key="item.value"
17
-              :label="item.label"
18
-              :value="item.value"
16
+              v-for="item in nurse_options"
17
+              :key="item.id"
18
+              :label="item.user_name"
19
+              :value="item.admin_user_id"
19 20
             ></el-option>
20 21
           </el-select>
21 22
           <el-select
22
-            v-model="value"
23
+            v-model="query.statistics_type"
23 24
             placeholder="请选择"
24
-            @change="chooseType"
25
+            @change="changeProject"
25 26
             style="width:120px;margin-right:20px"
26 27
           >
27 28
             <el-option
28
-              v-for="item in options"
29
+              v-for="item in project_options"
29 30
               :key="item.value"
30
-              :label="item.label"
31
+              :label="item.name"
31 32
               :value="item.value"
32 33
             ></el-option>
33 34
           </el-select>
@@ -35,12 +36,13 @@
35 36
             <span class="name">日期查询</span> :
36 37
           </label>
37 38
           <el-date-picker
38
-            v-model="listQuery.start_time"
39
+            v-model="query.start_time"
39 40
             prefix-icon="el-icon-date"
40 41
             @change="changeTime"
41 42
             :editable="false"
42
-            style="width: 196px;"
43
+            style="width: 150px;"
43 44
             type="date"
45
+            :picker-options="pickerOptions"
44 46
             placeholder="选择日期时间"
45 47
             align="right"
46 48
             format="yyyy-MM-dd"
@@ -48,11 +50,12 @@
48 50
           ></el-date-picker>
49 51
           <span class>-</span>
50 52
           <el-date-picker
51
-            v-model="listQuery.end_time"
53
+            v-model="query.end_time"
52 54
             prefix-icon="el-icon-date"
53 55
             @change="changeEndTime"
54 56
             :editable="false"
55
-            style="width: 196px;"
57
+            :picker-options="pickerOptions"
58
+            style="width: 150px;"
56 59
             type="date"
57 60
             placeholder="选择日期时间"
58 61
             align="right"
@@ -62,254 +65,368 @@
62 65
         </div>
63 66
         <div class="tableTitle">统计图</div>
64 67
         <div>
65
-          <line-chart :options="chart"></line-chart>
68
+          <line-chart :options="bar"></line-chart>
66 69
         </div>
67 70
         <div class="tableTitle">统计表</div>
68 71
         <div>
69
-          <el-table :data="tableData" style="width: 100%" border show-summary :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
70
-            <el-table-column fixed prop="date" label="日期"></el-table-column>
71
-            <el-table-column prop="name" label="姓名"></el-table-column>
72
-            <el-table-column prop="province" label="省份"></el-table-column>
73
-            <el-table-column prop="city" label="市区"></el-table-column>
74
-            <el-table-column prop="address" label="地址"></el-table-column>
75
-            <el-table-column prop="zip" label="邮编"></el-table-column>
72
+          <!--<el-table :data="tableData" style="width: 100%" :height="tableHeight">-->
73
+            <!--<el-table-column fixed label="姓名" align="center">-->
74
+              <!--<template slot-scope="scope">-->
75
+                <!--{{scope.row.user_name}}-->
76
+
77
+              <!--</template>-->
78
+            <!--</el-table-column>-->
79
+
80
+            <!--<el-table-column label="治疗人次" align="center">-->
81
+              <!--<template slot-scope="scope">-->
82
+                <!--{{scope.row.p_count?scope.row.p_count:''}}-->
83
+
84
+              <!--</template>-->
85
+            <!--</el-table-column>-->
86
+
87
+            <!--<el-table-column label="病程记录" align="center">-->
88
+              <!--<template slot-scope="scope">-->
89
+                <!--{{scope.row.course_count?scope.row.course_count:''}}-->
90
+
91
+                <!--&lt;!&ndash;{{// scope.row.patient.lapseto == 1 ? '留治':'转出'}}&ndash;&gt;-->
92
+              <!--</template>-->
93
+            <!--</el-table-column>-->
94
+
95
+            <!--<el-table-column label="抢救记录" align="center">-->
96
+              <!--<template slot-scope="scope">-->
97
+                <!--{{scope.row.rescue_count?scope.row.rescue_count:''}}-->
98
+
99
+                <!--&lt;!&ndash;{{scope.row.last_after_weight?scope.row.last_after_weight:''}}&ndash;&gt;-->
100
+
101
+                <!--&lt;!&ndash;<div v-if="scope.row.before.systolic_blood_pressure">{{scope.row.before.systolic_blood_pressure}} / {{scope.row.before.diastolic_blood_pressure}}</div>&ndash;&gt;-->
102
+              <!--</template>-->
103
+            <!--</el-table-column>-->
104
+
105
+            <!--<el-table-column label="合计" align="center">-->
106
+              <!--<template slot-scope="scope">-->
107
+                <!--{{scope.row.p_count + scope.row.course_count + scope.row.rescue_count?scope.row.p_count + scope.row.course_count + scope.row.rescue_count:''}}-->
108
+
109
+                <!--&lt;!&ndash;<div v-if="scope.row.min_monitor.systolic_blood_pressure">{{ scope.row.min_monitor.systolic_blood_pressure}} /{{ scope.row.min_monitor.diastolic_blood_pressure}}</div>&ndash;&gt;-->
110
+              <!--</template>-->
111
+            <!--</el-table-column>-->
112
+
113
+
114
+          <!--</el-table>-->
115
+          <el-table :data="tableData" style="width: 100%" :height="tableHeight" >
116
+            <el-table-column fixed label="姓名" align="center">
117
+              <template slot-scope="scope">
118
+                {{scope.row.user_name}}
119
+
120
+              </template>
121
+            </el-table-column>
122
+
123
+            <el-table-column label="穿刺" align="center">
124
+              <template slot-scope="scope">
125
+                {{scope.row.puncture_count?scope.row.puncture_count:''}}
126
+
127
+              </template>
128
+            </el-table-column>
129
+
130
+            <el-table-column label="换药" align="center">
131
+              <template slot-scope="scope">
132
+                {{scope.row.change_medicine_count?scope.row.change_medicine_count:''}}
133
+
134
+                <!--{{// scope.row.patient.lapseto == 1 ? '留治':'转出'}}-->
135
+              </template>
136
+            </el-table-column>
137
+
138
+            <el-table-column label="治疗" align="center">
139
+              <template slot-scope="scope">
140
+                {{scope.row.cure_count?scope.row.cure_count:''}}
141
+
142
+              </template>
143
+            </el-table-column>
144
+
145
+
146
+            <el-table-column label="宣教/小结" align="center">
147
+              <template slot-scope="scope">
148
+                {{scope.row.mission_count?scope.row.mission_count:''}}
149
+              </template>
150
+            </el-table-column>
151
+
152
+            <el-table-column label="合计" align="center">
153
+              <template slot-scope="scope">
154
+                {{scope.row.puncture_count + scope.row.change_medicine_count + scope.row.cure_count + scope.row.mission_count ?scope.row.puncture_count + scope.row.change_medicine_count + scope.row.cure_count + scope.row.mission_count:''}}
155
+              </template>
156
+            </el-table-column>
76 157
           </el-table>
77 158
 
78
-          <el-pagination
79
-            align="right"
80
-            @size-change="handleSizeChange"
81
-            @current-change="handleCurrentChange"
82
-            :current-page="listQuery.page"
83
-            :page-sizes="[10, 20, 50, 100]"
84
-            :page-size="10"
85
-            background
86
-            style="margin-top:20px;"
87
-            layout="total, sizes, prev, pager, next, jumper"
88
-            :total="total"
89
-          ></el-pagination>
90 159
         </div>
91 160
       </div>
92 161
     </div>
93 162
   </div>
94 163
 </template>
95
-
96 164
 <script>
97
-import echarts from "echarts";
98
-import BreadCrumb from "@/xt_pages/components/bread-crumb";
99
-import LineChart from "../../qcd/components/LineChart";
100
-export default {
101
-  components: {
102
-    BreadCrumb,
103
-    LineChart
104
-  },
105
-  data() {
106
-    return {
107
-      crumbs: [
108
-        { path: false, name: "科室质控" },
109
-        { path: false, name: "工作量分析统计" },
110
-        { path: false, name: "护士" }
111
-      ],
112
-      activeName: "second",
113
-      listQuery: {
114
-        start_time: "",
115
-        end_time: "",
116
-        page: 1,
117
-        limit: 10
118
-      },
119
-      options: [
120
-        {
121
-          value: "选项1",
122
-          label: "黄金糕"
123
-        },
124
-        {
125
-          value: "选项2",
126
-          label: "双皮奶"
127
-        },
128
-        {
129
-          value: "选项3",
130
-          label: "蚵仔煎"
131
-        },
132
-        {
133
-          value: "选项4",
134
-          label: "龙须面"
135
-        },
136
-        {
137
-          value: "选项5",
138
-          label: "北京烤鸭"
139
-        }
140
-      ],
141
-      value: "请选项",
142
-      tableData: [
143
-        {
144
-          date: "2016-05-03",
145
-          name: "王小虎",
146
-          province: "上海",
147
-          city: "普陀区",
148
-          address: "上海市普陀区金沙江路 1518 弄",
149
-          zip: 200333
150
-        },
151
-        {
152
-          date: "2016-05-02",
153
-          name: "王小虎",
154
-          province: "上海",
155
-          city: "普陀区",
156
-          address: "上海市普陀区金沙江路 1518 弄",
157
-          zip: 200333
158
-        },
159
-        {
160
-          date: "2016-05-04",
161
-          name: "王小虎",
162
-          province: "上海",
163
-          city: "普陀区",
164
-          address: "上海市普陀区金沙江路 1518 弄",
165
-          zip: 200333
166
-        },
167
-        {
168
-          date: "2016-05-01",
169
-          name: "王小虎",
170
-          province: "上海",
171
-          city: "普陀区",
172
-          address: "上海市普陀区金沙江路 1518 弄",
173
-          zip: 200333
174
-        },
175
-        {
176
-          date: "2016-05-08",
177
-          name: "王小虎",
178
-          province: "上海",
179
-          city: "普陀区",
180
-          address: "上海市普陀区金沙江路 1518 弄",
181
-          zip: 200333
182
-        },
183
-        {
184
-          date: "2016-05-06",
185
-          name: "王小虎",
186
-          province: "上海",
187
-          city: "普陀区",
188
-          address: "上海市普陀区金沙江路 1518 弄",
189
-          zip: 200333
190
-        },
191
-        {
192
-          date: "2016-05-07",
193
-          name: "王小虎",
194
-          province: "上海",
195
-          city: "普陀区",
196
-          address: "上海市普陀区金沙江路 1518 弄",
197
-          zip: 200333
198
-        },
199
-        {
200
-          date: "2016-05-08",
201
-          name: "王小虎",
202
-          province: "上海",
203
-          city: "普陀区",
204
-          address: "上海市普陀区金沙江路 1518 弄",
205
-          zip: 200333
206
-        },
207
-        {
208
-          date: "2016-05-06",
209
-          name: "王小虎",
210
-          province: "上海",
211
-          city: "普陀区",
212
-          address: "上海市普陀区金沙江路 1518 弄",
213
-          zip: 200333
214
-        },
215
-        {
216
-          date: "2016-05-07",
217
-          name: "王小虎",
218
-          province: "上海",
219
-          city: "普陀区",
220
-          address: "上海市普陀区金沙江路 1518 弄",
221
-          zip: 200333
222
-        }
223
-      ],
224
-      chart: {
225
-        title: {
226
-          text: "ECharts 入门示例"
165
+  import echarts from "echarts";
166
+  import BreadCrumb from "@/xt_pages/components/bread-crumb";
167
+  import LineChart from "../../qcd/components/LineChart";
168
+
169
+  import {GetNurseWorkloadChartData,GetNurseWorkloadTableData,GetAllAdminUser} from "@/api/common/statistics";
170
+
171
+  export default {
172
+    components: {
173
+      BreadCrumb,
174
+      LineChart
175
+    },
176
+    data() {
177
+      return {
178
+        pickerOptions: {
179
+          disabledDate(time) {
180
+            let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
181
+            return time.getTime() > Date.now() || time.getTime() < threeMonths;;
182
+          }
227 183
         },
228
-        tooltip: {},
229
-        legend: {
230
-          data: ["次数"],
231
-          left: 0
184
+        tableData: [
185
+        ],
186
+        loading: false,
187
+        total: '',
188
+        query: {
189
+          admin_user_id: "",
190
+          statistics_type: 1,
191
+          start_time: "",
192
+          end_time: "",
193
+          limit:20,
194
+          page:1,
232 195
         },
233
-        xAxis: {
234
-          data: ["达标", "未达标"]
196
+
197
+
198
+        nurse_options:[],
199
+        project_options:[
200
+          {value:1, name:"治疗"},
201
+          {value:2, name:"穿刺"},
202
+          {value:3, name:"换药"},
203
+          {value:4, name:"宣教/小结"},
204
+        ],
205
+        crumbs: [
206
+          { path: false, name: "科室质控" },
207
+          { path: false, name: "工作量分析统计" },
208
+          { path: false, name: "医生" }
209
+        ],
210
+        activeName: "first",
211
+        listQuery: {
212
+          start_time: "",
213
+          end_time: "",
214
+          page: 1,
215
+          limit: 10
235 216
         },
236
-        yAxis: {
237
-          axisLabel: {
238
-            formatter: "{value} %"
217
+
218
+        value: "请选项",
219
+        bar: {
220
+          title: {
221
+            text: "ECharts 入门示例"
239 222
           },
240
-          show: false
241
-        },
242
-        series: [
243
-          {
244
-            name: "次数",
245
-            type: "bar",
246
-            data: ["78.57", "50"],
247
-            barWidth: 30,
248
-            label: {
249
-              normal: {
250
-                show: true,
251
-                position: "top",
252
-                formatter: "{c}次"
253
-              }
223
+          tooltip: {},
224
+          legend: {
225
+            data: [],
226
+            left: 0
227
+          },
228
+          xAxis: {
229
+            data: []
230
+          },
231
+          yAxis: {
232
+            axisLabel: {
233
+              formatter: "{value} %"
254 234
             },
255
-            //配置样式
256
-            itemStyle: {
257
-              //通常情况下:
258
-
259
-              //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
260
-              normal: {
261
-                color: function(params) {
262
-                  //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
263
-                  var colorList = [
264
-                    ["#A9E0F3", "#9FBDFC"],
265
-
266
-                    ["#FFD7C0", "#FF9994"]
267
-                  ];
268
-
269
-                  var index = params.dataIndex;
270
-                  if (params.dataIndex >= colorList.length) {
271
-                    index = params.dataIndex % colorList.length;
272
-                  }
273
-
274
-                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
275
-                    { offset: 0, color: colorList[index][0] },
276
-                    // { offset: 0.5, color: colorList[index][1] },
277
-                    { offset: 1, color: colorList[index][1] }
278
-                  ]);
279
-                },
280
-                barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
235
+            show: false
236
+          },
237
+          series: [
238
+            {
239
+              name: "",
240
+              type: "bar",
241
+              data: [],
242
+              barWidth: 30,
243
+              label: {
244
+                normal: {
245
+                  show: true,
246
+                  position: "top",
247
+                  formatter: "{c}"
248
+                }
281 249
               },
250
+              //配置样式
251
+              itemStyle: {
252
+                //通常情况下:
253
+
254
+                //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
255
+                normal: {
256
+                  color: function(params) {
257
+                    //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
258
+                    var colorList = [
259
+                      ["#A9E0F3", "#9FBDFC"],
260
+
261
+                      ["#FFD7C0", "#FF9994"]
262
+                    ];
282 263
 
283
-              //鼠标悬停时:
284
-              emphasis: {
285
-                shadowBlur: 10,
286
-                shadowOffsetX: 0,
287
-                shadowColor: "rgba(0, 0, 0, 0.5)"
264
+                    var index = params.dataIndex;
265
+                    if (params.dataIndex >= colorList.length) {
266
+                      index = params.dataIndex % colorList.length;
267
+                    }
268
+
269
+                    return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
270
+                      { offset: 0, color: colorList[index][0] },
271
+                      // { offset: 0.5, color: colorList[index][1] },
272
+                      { offset: 1, color: colorList[index][1] }
273
+                    ]);
274
+                  },
275
+                  barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
276
+                },
277
+
278
+                //鼠标悬停时:
279
+                emphasis: {
280
+                  shadowBlur: 10,
281
+                  shadowOffsetX: 0,
282
+                  shadowColor: "rgba(0, 0, 0, 0.5)"
283
+                }
288 284
               }
289 285
             }
290
-          }
291
-        ]
292
-      }
293
-    };
294
-  },
295
-  methods: {
296
-    changeTime() {},
297
-    changeEndTime(val) {
298
-      var time =
299
-        this.getTimestamp(val) - this.getTimestamp(this.listQuery.start_time);
300
-      if (time < 0) {
301
-        this.$message.error("结束时间不能小于开始时间");
302
-        this.listQuery.end_time = "";
303
-      } else {
304
-      }
286
+          ]
287
+        }
288
+      };
305 289
     },
306
-    handleClick() {
307
-      if (this.activeName == "first") {
308
-        this.$router.push({ path: "/qcd/workAnalysis/doctor" });
290
+    methods: {
291
+      changeNurse(val){
292
+        this.query.admin_user_id = val
293
+        this.query.page = 1
294
+        this.GetNurseWorkloadTableData(this.query)
295
+
296
+      },
297
+      GetAllNurse(){
298
+        GetAllAdminUser().then(response => {
299
+          if (response.data.state == 1) {
300
+            var adminUser = response.data.data.admin
301
+            this.admin_user  = adminUser
302
+            for (let i = 0; i < adminUser.length; i++){
303
+              if(adminUser[i].user_type == 3){
304
+                this.nurse_options.push(adminUser[i])
305
+              }
306
+            }
307
+          } else {
308
+            this.$message.error('请求数据失败')
309
+            return false
310
+          }
311
+        })
312
+
313
+      },
314
+      changeProject(val){
315
+        this.query.statistics_type = val
316
+        this.query.page = 1
317
+        this.GetNurseWorkloadChartData(this.query)
318
+        // this.GetDialysisProcessIndexTableData(this.query)
319
+
320
+      },
321
+      handleSizeChange(limit) {
322
+        this.query.limit = limit;
323
+        this.GetNurseWorkloadTableData(this.query)
324
+      },
325
+      handleCurrentChange(page) {
326
+        this.query.page = page;
327
+        this.GetNurseWorkloadTableData(this.query)
328
+      },GetNurseWorkloadTableData(params) {
329
+        this.loading = true
330
+        this.tableData = []
331
+        GetNurseWorkloadTableData(params)
332
+          .then(rs => {
333
+            var resp = rs.data
334
+            if (resp.state == 1) {
335
+              this.loading = false
336
+              for (let i = 0; i < resp.data.data.length; i++) {
337
+                this.tableData.push(resp.data.data[i])
338
+              }
339
+            } else {
340
+              this.loading = false
341
+            }
342
+          })
343
+          .catch(error => {
344
+
345
+          })
346
+      },
347
+      changeTime(val) {
348
+        var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time);
349
+        if (time > 0) {
350
+          this.$message.error("结束时间不能小于开始时间");
351
+          this.query.start_time = "";
352
+        } else {
353
+          // this.getDialysisList()
354
+          this.query.page = 1;
355
+          this.GetNurseWorkloadChartData(this.query)
356
+          this.GetNurseWorkloadTableData(this.query)
357
+
358
+        }
359
+
360
+      },  GetNurseWorkloadChartData(params) {
361
+
362
+        this.bar.xAxis.data = []
363
+        this.bar.series[0].data = []
364
+        GetNurseWorkloadChartData(params)
365
+          .then(rs => {
366
+            var resp = rs.data
367
+            if (resp.state == 1) {
368
+
369
+              for (let i = 0;  i < resp.data.data.length;i++){
370
+                this.bar.xAxis.data.push(resp.data.data[i].user_name)
371
+                if(this.query.statistics_type == 1){
372
+
373
+                  this.bar.series[0].data.push(resp.data.data[i].puncture_count)
374
+
375
+                }else if(this.query.statistics_type == 2){
376
+
377
+                  this.bar.series[0].data.push(resp.data.data[i].change_medicine_count)
378
+
379
+
380
+                }else if(this.query.statistics_type == 3){
381
+                  this.bar.series[0].data.push(resp.data.data[i].cure_count)
382
+
383
+                }else if(this.query.statistics_type == 4){
384
+                  this.bar.series[0].data.push(resp.data.data[i].mission_count)
385
+
386
+                }
387
+              }
388
+
389
+            } else {
390
+            }
391
+          })
392
+          .catch(error => {
393
+          })
394
+      },
395
+      changeEndTime(val) {
396
+        var time =
397
+          this.getTimestamp(val) - this.getTimestamp(this.query.start_time);
398
+        if (time < 0) {
399
+          this.$message.error("结束时间不能小于开始时间");
400
+          this.query.end_time = "";
401
+        } else {
402
+          this.query.page = 1;
403
+          this.GetNurseWorkloadChartData(this.query)
404
+          this.GetNurseWorkloadTableData(this.query)
405
+
406
+        }
407
+      },
408
+      handleClick() {
409
+        if (this.activeName == "first") {
410
+          this.$router.push({ path: "/qcd/workAnalysis/doctor" });
411
+        }
309 412
       }
413
+    },created(){
414
+      var date = new Date()
415
+      var year = date.getFullYear() //获取完整的年份(4位)
416
+      var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
417
+      var day = date.getDate() < 0 ? '0' + date.getDate().toString() : date.getDate() //获取当前日(1-31)
418
+      var last_month = date.getMonth() < 10 ? '0' + date.getMonth().toString() : date.getMonth() //获取当前月份(0-11,0代表1月)
419
+      this.query.patient_id = 0
420
+      this.query.end_time = year + '-' + month + '-' + day
421
+      this.query.start_time = year + '-' + last_month + '-' + day
422
+      this.query.statistics_type = 1
423
+      this.GetAllNurse()
424
+      this.GetNurseWorkloadChartData(this.query)
425
+      this.GetNurseWorkloadTableData(this.query)
426
+
427
+
310 428
     }
311
-  }
312
-};
429
+  };
313 430
 </script>
314 431
 
315 432
 <style lang="scss" scoped>

+ 13 - 13
src/xt_permission.js Ver fichero

@@ -12,19 +12,19 @@ const permissionWhiteList = loginWhiteList.concat(["/"]); // 权限验证白名
12 12
 
13 13
 router.beforeEach((to, from, next) => {
14 14
   // 线上注释
15
-  // if (!store.getters.configlist || store.getters.configlist === undefined || store.getters.configlist.length <= 0) {
16
-  //  store.dispatch('VerifyConfigList', []).then(() => {
17
-  //    next()
18
-  // })
19
-  // }
20
-  // if (store.getters.permission_routers === undefined) {
21
-  //  store.dispatch('xt_GenerateRoutes', []).then(() => {
22
-  //    next()
23
-  //  })
24
-  // } else {
25
-  //   next()
26
-  // }
27
-  // return
15
+  if (!store.getters.configlist || store.getters.configlist === undefined || store.getters.configlist.length <= 0) {
16
+   store.dispatch('VerifyConfigList', []).then(() => {
17
+     next()
18
+  })
19
+  }
20
+  if (store.getters.permission_routers === undefined) {
21
+   store.dispatch('xt_GenerateRoutes', []).then(() => {
22
+     next()
23
+   })
24
+  } else {
25
+    next()
26
+  }
27
+  return
28 28
   // 线上注释
29 29
 
30 30
   NProgress.start();