Parcourir la source

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

csx il y a 4 ans
Parent
révision
2536638995

+ 11 - 0
src/router/modules/qcd.js Voir le fichier

@@ -395,6 +395,17 @@ export default {
395 395
         title: "口服药",
396 396
         noCache: true
397 397
       }
398
+    },  {
399
+      path: "/qcd/inspection/detail",
400
+      hidden: true,
401
+      is_menu: false,
402
+      component: () =>
403
+        import("@/xt_pages/qcd/indicatorControlAnalysis/patientInspectionDetail"),
404
+      name: "patientInspectionDetail",
405
+      meta: {
406
+        title: "化验指标详情",
407
+        noCache: true
408
+      }
398 409
     }
399 410
   ]
400 411
 };

+ 0 - 272
src/xt_pages/qcd/a.vue Voir le fichier

@@ -1,272 +0,0 @@
1
-<template>
2
-  <div class="main-contain">
3
-    <div class="position">
4
-      <bread-crumb :crumbs="crumbs"></bread-crumb>
5
-    </div>
6
-    <div class="app-container">
7
-      <div class="cell clearfix">
8
-        <label class="title">
9
-          <span class="name">转归状态</span> :
10
-        </label>
11
-        <div class="time">
12
-          <ul class>
13
-            <li
14
-              :class="item.state == stateType ? 'active' : ''"
15
-              @click="selectLapseTo(item.state)"
16
-              v-for="item in month"
17
-              :key="item.value"
18
-            >{{ item.label }}</li>
19
-          </ul>
20
-        </div>
21
-        <el-date-picker
22
-          v-model="listQuery.start_time"
23
-          prefix-icon="el-icon-date"
24
-          @change="changeTime"
25
-          :editable="false"
26
-          style="width: 196px;"
27
-          type="date"
28
-          placeholder="选择日期时间"
29
-          align="right"
30
-          format="yyyy-MM-dd"
31
-          value-format="yyyy-MM-dd"
32
-          :picker-options="pickerOptions"
33
-        ></el-date-picker>
34
-        <span class>-</span>
35
-        <el-date-picker
36
-          v-model="listQuery.end_time"
37
-          prefix-icon="el-icon-date"
38
-          @change="changeEndTime"
39
-          :editable="false"
40
-          style="width: 196px;"
41
-          type="date"
42
-          placeholder="选择日期时间"
43
-          align="right"
44
-          format="yyyy-MM-dd"
45
-          value-format="yyyy-MM-dd"
46
-          :picker-options="pickerOptions"
47
-        ></el-date-picker>
48
-      </div>
49
-       <el-container>
50
-      <div style="width:150px">
51
-        <div class="tableTitle">患者列表</div>
52
-        <el-table :data="patientsData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }"
53
-         :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
54
-          highlight-current-row
55
-          @current-change="handleChange">
56
-          <el-table-column prop="dialysis_no" label="透析号" width="80">
57
-            <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
58
-          </el-table-column>
59
-          <el-table-column prop="name" label="姓名" width="80">
60
-            <template slot-scope="scope">{{ scope.row.name }}</template>
61
-          </el-table-column>
62
-        </el-table>
63
-      </div>
64
-      <div style="padding-left:10px;flex:1">
65
-         <div class="tableTitle">统计图</div>
66
-           <div>
67
-            <line-chart :options="chart"></line-chart>
68
-           </div>
69
-      </div>
70
-    </el-container>
71
-    </div>
72
-  </div>
73
-</template>
74
-
75
-
76
-
77
-<script>
78
-const moment = require('moment')
79
-import { GetOICData } from "@/api/qcd";
80
-import PieChart from "../qcd/components/BarChart";
81
-import { uParseTime } from "@/utils/tools";
82
-import BreadCrumb from "@/xt_pages/components/bread-crumb";
83
-export default {
84
-  name: "dialysisTotal",
85
-  components: {
86
-    PieChart,
87
-    BreadCrumb
88
-  },
89
-  data() {
90
-    return {
91
-       pickerOptions: {
92
-        disabledDate(time) {
93
-          let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
94
-          return time.getTime() > Date.now() || time.getTime() < threeMonths;;
95
-        }
96
-      }, 
97
-      crumbs: [
98
-        { path: false, name: "质控管理" },
99
-        { path: false, name: "基本信息统计" }
100
-      ],
101
-      listQuery: {
102
-        start_time: "",
103
-        end_time: "",
104
-        page: 1,
105
-        limit: 10
106
-      },
107
-      stateType: 0,
108
-      month: [
109
-        { value: 0, label: "本月", state: 0 },
110
-        { value: 1, label: "近三个月", state: 1 },
111
-        { value: 2, label: "近半年", state: 2 },
112
-        { value: 3, label: "近一年", state: 3 },
113
-        { value:4,label:"自定义",state:4}
114
-      ],
115
-    };
116
-  },
117
-  methods: {
118
-  
119
-  },
120
-  created() {
121
-     
122
-  },
123
-};
124
-</script>
125
-
126
- <style rel="stylesheet/scss" lang="scss" scoped>
127
- .tableTitle {
128
-  font-size: 16px;
129
-  color: #000;
130
-  font-weight: bold;
131
-  margin-bottom: 10px;
132
-}
133
-.infoBox {
134
-  display: flex;
135
-  flex-wrap: wrap;
136
-  .infoOne {
137
-    margin-right: 30px;
138
-    margin-top: 30px;
139
-    .titleBox {
140
-      display: flex;
141
-      align-items: center;
142
-    }
143
-    .point {
144
-      display: inline-block;
145
-      width: 7px;
146
-      height: 7px;
147
-      background: linear-gradient(
148
-        90deg,
149
-        rgba(169, 224, 243, 1),
150
-        rgba(159, 189, 252, 1)
151
-      );
152
-      border-radius: 50%;
153
-    }
154
-    .point1 {
155
-      width: 7px;
156
-      height: 7px;
157
-      background: linear-gradient(
158
-        90deg,
159
-        rgba(255, 215, 192, 1),
160
-        rgba(255, 153, 148, 1)
161
-      );
162
-      border-radius: 50%;
163
-    }
164
-    .point2 {
165
-      width: 7px;
166
-      height: 7px;
167
-      background: linear-gradient(
168
-        90deg,
169
-        rgba(215, 195, 253, 1),
170
-        rgba(179, 168, 247, 1)
171
-      );
172
-      border-radius: 50%;
173
-    }
174
-    .infoTitle {
175
-      font-size: 16px;
176
-      font-weight: bold;
177
-      margin-left: 5px;
178
-      color: #000;
179
-    }
180
-    .borderBox {
181
-      width: 340px;
182
-      min-height: 140px;
183
-      background: rgba(255, 255, 255, 1);
184
-      border: 1px solid rgba(229, 229, 229, 1);
185
-      border-radius: 10px;
186
-      padding: 0 14px 20px;
187
-      margin-top: 10px;
188
-      p {
189
-        font-size: 14px;
190
-        color: #000;
191
-        margin: 10px 0 3px;
192
-      }
193
-    }
194
-    .borderBox1 {
195
-      width: 340px;
196
-      min-height: 140px;
197
-      background: rgba(255, 255, 255, 1);
198
-      border: 1px solid rgba(229, 229, 229, 1);
199
-      border-radius: 10px;
200
-      padding: 0 14px 20px;
201
-      margin-top: 10px;
202
-      p {
203
-        font-size: 14px;
204
-        color: #000;
205
-        margin: 10px 0 3px;
206
-      }
207
-    }
208
-    .borderBox2 {
209
-      width: 340px;
210
-      min-height: 140px;
211
-      background: rgba(255, 255, 255, 1);
212
-      border: 1px solid rgba(229, 229, 229, 1);
213
-      border-radius: 10px;
214
-      padding: 0 14px 20px;
215
-      margin-top: 10px;
216
-      p {
217
-        font-size: 14px;
218
-        color: #000;
219
-        margin: 10px 0 3px;
220
-      }
221
-    }
222
-  }
223
-}
224
-</style>
225
-
226
-<style lang="scss">
227
-.infoBox {
228
-  .infoOne {
229
-    .borderBox {
230
-      .el-progress-bar__inner {
231
-        background: linear-gradient(
232
-          90deg,
233
-          rgba(169, 224, 243, 1),
234
-          rgba(159, 189, 252, 1)
235
-        );
236
-      }
237
-      .el-progress-bar{
238
-        margin-right: -59px;
239
-        padding-right: 60px;
240
-      }
241
-    }
242
-    .borderBox1 {
243
-      .el-progress-bar__inner {
244
-        background: linear-gradient(
245
-          90deg,
246
-          rgba(255, 215, 192, 1),
247
-          rgba(255, 153, 148, 1)
248
-        );
249
-      }
250
-      .el-progress-bar{
251
-        margin-right: -59px;
252
-        padding-right: 60px;
253
-      }
254
-    }
255
-    .borderBox2 {
256
-      .el-progress-bar__inner {
257
-        background: linear-gradient(
258
-          90deg,
259
-          rgba(215, 195, 253, 1),
260
-          rgba(179, 168, 247, 1)
261
-        );
262
-      }
263
-      .el-progress-bar{
264
-        margin-right: -59px;
265
-        padding-right: 60px;
266
-      }
267
-    }
268
-  }
269
-}
270
-</style>
271
-
272
-

+ 8 - 0
src/xt_pages/qcd/indicatorControlAnalysis/components/office.vue Voir le fichier

@@ -241,6 +241,14 @@
241 241
       }
242 242
     },
243 243
     methods: {
244
+      getTimestamp(time) {
245
+        // 把时间日期转成时间戳
246
+        return new Date(time).getTime() / 1000;
247
+      },
248
+      jumpDetail(row){
249
+        // this.$router.push("/qcd/indicatorControlAnalysis/bloodPressureDetails?id="+patient_id)
250
+        this.$router.push("/qcd/inspection/detail?project_id="+row.project_id+"&item_id="+row.item_id+"&range_type="+row.inspect_type+"&patient_id="+row.patient.id)
251
+      },
244 252
       handleSizeChange(limit) {
245 253
         this.query.limit = limit
246 254
         this.GetInspectionIndexTable(this.query)

+ 21 - 12
src/xt_pages/qcd/indicatorControlAnalysis/components/personal.vue Voir le fichier

@@ -344,13 +344,21 @@
344 344
         }
345 345
 
346 346
       }
347
-    },handleSelect(val) {
348
-      this.query.patient_id = val.id
349
-      this.query.page = 1
350
-      this.GetPatientInspectionIndexBarChart(this.query)
351
-      this.GetPatientInspectionIndexChart(this.query)
352 347
     },
353 348
     methods: {
349
+      handleChange(val){
350
+        this.query.patient_id = val.id
351
+        this.query.page = 1
352
+        this.GetPatientInspectionIndexBarChart(this.query)
353
+        this.GetPatientInspectionIndexChart(this.query)
354
+      },
355
+      handleSelect(val) {
356
+        this.query.patient_id = val.id
357
+        this.query.page = 1
358
+        this.GetPatientInspectionIndexBarChart(this.query)
359
+        this.GetPatientInspectionIndexChart(this.query)
360
+
361
+      },
354 362
       querySearchAsync(keyword, cb) {
355 363
         let key = ''
356 364
         if (keyword != undefined) {
@@ -395,15 +403,15 @@
395 403
         this.query.page = 1
396 404
         this.query.item_id = val
397 405
         var projectInfo = this.getPojectInfo(this.query.project_id, val)
398
-        console.log(projectInfo)
399 406
         this.item_name = projectInfo.item_name
400
-
401 407
         this.GetRangeValue(projectInfo.range_type, projectInfo.project_id, projectInfo.id)
402 408
 
403 409
       }, changeRangeValue(val) {
404 410
         this.query.range_value = val
405 411
         this.query.page = 1
406
-        this.GetInspectionIndexTable(this.query)
412
+        // this.GetInspectionIndexTable(this.query)
413
+
414
+
407 415
 
408 416
       }, GetInspectionIndexInit() {
409 417
         GetInspectionIndexInit()
@@ -556,16 +564,17 @@
556 564
               }
557 565
 
558 566
             } else {
559
-              this.$toast({
560
-                message: resp.msg
561
-              })
567
+
562 568
             }
563 569
           })
564 570
           .catch(error => {
565 571
 
566 572
           })
567 573
 
568
-      }
574
+      },   getTimestamp(time) {
575
+        // 把时间日期转成时间戳
576
+        return new Date(time).getTime() / 1000;
577
+      },
569 578
 
570 579
     }, created() {
571 580
       var date = new Date()

+ 591 - 0
src/xt_pages/qcd/indicatorControlAnalysis/patientInspectionDetail.vue Voir le fichier

@@ -0,0 +1,591 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+    </div>
6
+    <div class="app-container">
7
+      <div class="cell clearfix">
8
+        <label class="title">
9
+          <span class="name">日期</span> :
10
+        </label>
11
+        <div class="time">
12
+          <ul class>
13
+            <li
14
+              :class="item.state == stateType ? 'active' : ''"
15
+              @click="selectStateType(item.state)"
16
+              v-for="item in month"
17
+              :key="item.value"
18
+            >{{ item.label }}
19
+            </li>
20
+          </ul>
21
+        </div>
22
+        <el-date-picker
23
+          v-if="stateType == 5"
24
+          v-model="query.start_time"
25
+          prefix-icon="el-icon-date"
26
+          @change="changeTime"
27
+          :editable="false"
28
+          style="width: 196px;"
29
+          type="date"
30
+          placeholder="选择日期时间"
31
+          align="right"
32
+          format="yyyy-MM-dd"
33
+          value-format="yyyy-MM-dd"
34
+          :picker-options="pickerOptions"
35
+        ></el-date-picker>
36
+        <span v-if="stateType == 5"
37
+              class>-</span>
38
+        <el-date-picker
39
+          v-if="stateType == 5"
40
+          v-model="query.end_time"
41
+          prefix-icon="el-icon-date"
42
+          @change="changeEndTime"
43
+          :editable="false"
44
+          style="width: 196px;"
45
+          type="date"
46
+          placeholder="选择日期时间"
47
+          align="right"
48
+          format="yyyy-MM-dd"
49
+          value-format="yyyy-MM-dd"
50
+          :picker-options="pickerOptions"
51
+        ></el-date-picker>
52
+      </div>
53
+      <el-container>
54
+        <div style="width:150px">
55
+          <div class="tableTitle">患者列表</div>
56
+          <el-table :data="patientsData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }"
57
+                    :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
58
+                    highlight-current-row
59
+                    @current-change="handleChange">
60
+            <el-table-column prop="dialysis_no" label="透析号" width="80">
61
+              <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
62
+            </el-table-column>
63
+            <el-table-column prop="name" label="姓名" width="80">
64
+              <template slot-scope="scope">{{ scope.row.name }}</template>
65
+            </el-table-column>
66
+          </el-table>
67
+
68
+        </div>
69
+        <div style="padding-left:10px;flex:1">
70
+          <div class="tableTitle">统计图</div>
71
+          <div>
72
+            <!--<line-chart :options="options2"></line-chart>-->
73
+            <line-chart :options="options2"></line-chart>
74
+
75
+          </div>
76
+        </div>
77
+      </el-container>
78
+    </div>
79
+  </div>
80
+</template>
81
+
82
+
83
+<script>
84
+
85
+  const moment = require('moment')
86
+  import echarts from 'echarts'
87
+  import LineChart from '../../qcd/components/LineChart'
88
+  import { uParseTime } from '@/utils/tools'
89
+  import BreadCrumb from '@/xt_pages/components/bread-crumb'
90
+  import { getCurrentOrgPatients } from '@/api/common/common'
91
+  import {
92
+    GetDefalutPatient,
93
+    GetInspectionIndexChart,
94
+    GetInspectionIndexInit,
95
+    GetInspectionIndexTable,
96
+    GetPatientInspectionIndexBarChart,
97
+    GetPatientInspectionIndexChart,
98
+    GetRangeValue
99
+  } from '@/api/common/statistics'
100
+
101
+  export default {
102
+    name: 'dialysisTotal',
103
+    components: {
104
+      LineChart,
105
+      BreadCrumb
106
+    },
107
+    data() {
108
+      return {
109
+        custom_chart_data_color: [],
110
+        options2: {
111
+          title: {
112
+            text: 'ECharts 入门示例'
113
+          },
114
+          tooltip: {},
115
+          legend: {
116
+            data: ['次数'],
117
+            left: 0
118
+          },
119
+          xAxis: {
120
+            data: [],
121
+            axisLine: {
122
+              lineStyle: {
123
+                color: '#FF0000',
124
+                width: 8 //这里是为了突出显示加上的
125
+              }
126
+            },
127
+            axisLabel: {
128
+              interval: 0,
129
+              formatter: function(value) {
130
+                var ret = '' //拼接加\n返回的类目项
131
+                var maxLength = 8 //每项显示文字个数
132
+                var valLength = value.length //X轴类目项的文字个数
133
+                var rowN = Math.ceil(valLength / maxLength) //类目项需要换行的行数
134
+                if (rowN > 1) {
135
+                  //如果类目项的文字大于3,
136
+                  for (var i = 0; i < rowN; i++) {
137
+                    var temp = '' //每次截取的字符串
138
+                    var start = i * maxLength //开始截取的位置
139
+                    var end = start + maxLength //结束截取的位置
140
+                    //这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧
141
+                    temp = value.substring(start, end) + '\n'
142
+                    ret += temp //凭借最终的字符串
143
+                  }
144
+                  return ret
145
+                } else {
146
+                  return value
147
+                }
148
+              }
149
+            }
150
+          },
151
+          yAxis: {
152
+            axisLabel: {
153
+              formatter: '{value} %'
154
+            },
155
+            show: false,
156
+            axisLine: {
157
+              lineStyle: {
158
+                color: '#00FF00',
159
+                width: 8 //这里是为了突出显示加上的
160
+              }
161
+            }
162
+          },
163
+          series: [
164
+            {
165
+              name: '',
166
+              type: 'line',
167
+              data: [],
168
+              barWidth: 30,
169
+              label: {
170
+                normal: {
171
+                  show: true,
172
+                  position: 'top',
173
+                  formatter: '{c}'
174
+                }
175
+              },
176
+              //配置样式
177
+              itemStyle: {
178
+                //通常情况下:
179
+
180
+                //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
181
+                normal: {
182
+                  color: function(params) {
183
+                    //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
184
+                    var colorList = [
185
+                      ['#A9E0F3', '#9FBDFC'],
186
+
187
+                      ['#FFD7C0', '#FF9994']
188
+                    ]
189
+
190
+                    var index = params.dataIndex
191
+                    if (params.dataIndex >= colorList.length) {
192
+                      index = params.dataIndex % colorList.length
193
+                    }
194
+
195
+                    return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
196
+                      { offset: 0, color: colorList[index][0] },
197
+                      // { offset: 0.5, color: colorList[index][1] },
198
+                      { offset: 1, color: colorList[index][1] }
199
+                    ])
200
+                  },
201
+                  barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
202
+                },
203
+
204
+                //鼠标悬停时:
205
+                emphasis: {
206
+                  shadowBlur: 10,
207
+                  shadowOffsetX: 0,
208
+                  shadowColor: 'rgba(0, 0, 0, 0.5)'
209
+                }
210
+              }
211
+            }
212
+          ]
213
+        },
214
+        query: {
215
+          patient_id: this.$route.query.patient_id,
216
+          start_time: '',
217
+          end_time: '',
218
+          limit: 20,
219
+          page: 1,
220
+          project_id: this.$route.query.project_id,
221
+          item_id: this.$route.query.item_id,
222
+          range_type: this.$route.query.range_type,
223
+          range_value: ''
224
+        },
225
+        patientsData: [],
226
+
227
+        pickerOptions: {
228
+          disabledDate(time) {
229
+            let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear() - 1)).getTime() - 24 * 3600 * 1000
230
+            return time.getTime() > Date.now() || time.getTime() < threeMonths
231
+
232
+          }
233
+        },
234
+        crumbs: [
235
+          { path: false, name: '质控管理' },
236
+          { path: false, name: '基本信息统计' }
237
+        ],
238
+        listQuery: {
239
+          start_time: '',
240
+          end_time: '',
241
+          page: 1,
242
+          limit: 10
243
+        },
244
+        stateType: 1,
245
+        month: [
246
+          { value: 1, label: '本月', state: 1 },
247
+          { value: 2, label: '近三个月', state: 2 },
248
+          { value: 3, label: '近半年', state: 3 },
249
+          { value: 4, label: '近一年', state: 4 },
250
+          { value: 5, label: '自定义', state: 5 }
251
+        ]
252
+      }
253
+    },
254
+    methods: {
255
+      selectStateType(val) {
256
+        this.stateType = val
257
+        switch (val) {
258
+          case 1: //本月
259
+
260
+            this.query.start_time = moment().subtract('month', 1).format('YYYY-MM-DD')
261
+            // 本月的结束时间
262
+            this.query.end_time = moment(new Date()).format('YYYY-MM-DD')
263
+            this.query.patient_id = this.$route.query.patient_id
264
+            this.query.project_id = this.$route.query.project_id
265
+            this.query.item_id = this.$route.query.item_id
266
+            this.query.range_type = this.$route.query.range_type
267
+            this.GetPatientInspectionIndexChart(this.query)
268
+
269
+            break
270
+          case 2: //近3个月
271
+            const startDate = moment().subtract('month', 3).format('YYYY-MM-DD')
272
+            this.query.start_time = startDate
273
+            const endDate = moment(new Date()).format('YYYY-MM-DD')
274
+            this.query.patient_id = this.$route.query.patient_id
275
+            this.query.project_id = this.$route.query.project_id
276
+            this.query.item_id = this.$route.query.item_id
277
+            this.query.range_type = this.$route.query.range_type
278
+
279
+            this.GetPatientInspectionIndexChart(this.query)
280
+
281
+            break
282
+          case 3: //近半年
283
+            this.query.start_time = moment().subtract('month', 6).format('YYYY-MM-DD')
284
+            this.query.end_time = moment(new Date()).format('YYYY-MM-DD')
285
+            this.query.patient_id = this.$route.query.patient_id
286
+            this.query.project_id = this.$route.query.project_id
287
+            this.query.item_id = this.$route.query.item_id
288
+            this.query.range_type = this.$route.query.range_type
289
+
290
+            this.GetPatientInspectionIndexChart(this.query)
291
+            break
292
+          case 4: //近一年
293
+            this.query.start_time = moment().subtract('month', 12).format('YYYY-MM-DD')
294
+            this.query.end_time = moment(new Date()).format('YYYY-MM-DD')
295
+            this.query.patient_id = this.$route.query.patient_id
296
+            this.query.project_id = this.$route.query.project_id
297
+            this.query.item_id = this.$route.query.item_id
298
+            this.query.range_type = this.$route.query.range_type
299
+            this.GetPatientInspectionIndexChart(this.query)
300
+            break
301
+          case 5: //自定义
302
+            this.query.start_time = moment().subtract('month', 1).format('YYYY-MM-DD')
303
+            // 本月的结束时间
304
+            this.query.end_time = moment(new Date()).format('YYYY-MM-DD')
305
+            this.query.patient_id = this.$route.query.patient_id
306
+            this.query.project_id = this.$route.query.project_id
307
+            this.query.item_id = this.$route.query.item_id
308
+            this.query.range_type = this.$route.query.range_type
309
+            this.GetPatientInspectionIndexChart(this.query)
310
+            break
311
+        }
312
+
313
+      },
314
+      getCurrentOrgPatients() {
315
+        getCurrentOrgPatients().then(response => {
316
+          if (response.data.state == 1) {
317
+            var patients = response.data.data.patients
318
+            this.patientsData = patients
319
+          }
320
+        })
321
+      }, handleChange(val) {
322
+        this.query.patient_id = val.id
323
+        this.query.page = 1
324
+        this.GetPatientInspectionIndexChart(this.query)
325
+      }, changeTime(val) {
326
+        var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time)
327
+        if (time > 0) {
328
+          this.$message.error('结束时间不能小于开始时间')
329
+        } else {
330
+          console.log(this.query)
331
+          this.GetPatientInspectionIndexChart(this.query)
332
+        }
333
+      },
334
+      changeEndTime(val) {
335
+        var time =
336
+          this.getTimestamp(val) - this.getTimestamp(this.query.start_time)
337
+        if (time < 0) {
338
+          this.$message.error('结束时间不能小于开始时间')
339
+        } else {
340
+          console.log(this.query)
341
+          this.GetPatientInspectionIndexChart(this.query)
342
+
343
+        }
344
+      },
345
+      GetPatientInspectionIndexChart(params) {
346
+        this.options2.xAxis.data = []
347
+        this.options2.series[0].data = []
348
+        GetPatientInspectionIndexChart(params)
349
+          .then(rs => {
350
+            var resp = rs.data
351
+            if (resp.state == 1) {
352
+
353
+              let tempData = []
354
+              let otherData = []
355
+
356
+              for (let i = 0; i < resp.data.data.length; i++) {
357
+                this.options2.xAxis.data.push(resp.data.data[i].date)
358
+
359
+                if (this.query.range_type == 1) {
360
+                  this.options2.series[0].data.push(resp.data.data[i].value)
361
+                } else {
362
+                  this.options2.series[0].data.push('1')
363
+                  tempData.push(resp.data.data[i].value)
364
+                  otherData.push(resp.data.data[i].value)
365
+                }
366
+              }
367
+
368
+              //获取无法确定选项的颜色
369
+              if (this.query.range_type == 2) {
370
+                //去重复
371
+                let obj = {}
372
+                tempData = tempData.reduce((cur, next) => {
373
+                  obj[next] ? '' : (obj[next] = true && cur.push(next))
374
+                  return cur
375
+                }, [])
376
+
377
+                //随机获取颜色值
378
+                let newObj = {}
379
+                for (let i = 0; i < tempData.length; i++) {
380
+                  newObj[tempData[i]] = this.getColor()
381
+                }
382
+
383
+                //匹配对应的颜色值
384
+                for (let i = 0; i < otherData.length; i++) {
385
+                  for (let key in newObj) {
386
+                    if (otherData[i] === key) {
387
+                      this.custom_chart_data_color.push(newObj[key])
388
+                    }
389
+                  }
390
+                }
391
+              }
392
+
393
+            } else {
394
+            }
395
+          })
396
+          .catch(error => {
397
+
398
+          })
399
+
400
+      },  getTimestamp(time) {
401
+        // 把时间日期转成时间戳
402
+        return new Date(time).getTime() / 1000;
403
+      },
404
+
405
+    },
406
+    created() {
407
+
408
+      this.getCurrentOrgPatients()
409
+      this.query.start_time = moment().subtract('month', 1).format('YYYY-MM-DD')
410
+      this.query.end_time = moment(new Date()).format('YYYY-MM-DD')
411
+      this.query.patient_id = this.$route.query.patient_id
412
+      this.query.project_id = this.$route.query.project_id
413
+      this.query.item_id = this.$route.query.item_id
414
+      this.query.range_type = this.$route.query.range_type
415
+      this.GetPatientInspectionIndexChart(this.query)
416
+    }
417
+  }
418
+</script>
419
+
420
+<style rel="stylesheet/scss" lang="scss" scoped>
421
+  .tableTitle {
422
+    font-size: 16px;
423
+    color: #000;
424
+    font-weight: bold;
425
+    margin-bottom: 10px;
426
+  }
427
+
428
+  .infoBox {
429
+    display: flex;
430
+    flex-wrap: wrap;
431
+
432
+  .infoOne {
433
+    margin-right: 30px;
434
+    margin-top: 30px;
435
+
436
+  .titleBox {
437
+    display: flex;
438
+    align-items: center;
439
+  }
440
+
441
+  .point {
442
+    display: inline-block;
443
+    width: 7px;
444
+    height: 7px;
445
+    background: linear-gradient(
446
+      90deg,
447
+      rgba(169, 224, 243, 1),
448
+      rgba(159, 189, 252, 1)
449
+    );
450
+    border-radius: 50%;
451
+  }
452
+
453
+  .point1 {
454
+    width: 7px;
455
+    height: 7px;
456
+    background: linear-gradient(
457
+      90deg,
458
+      rgba(255, 215, 192, 1),
459
+      rgba(255, 153, 148, 1)
460
+    );
461
+    border-radius: 50%;
462
+  }
463
+
464
+  .point2 {
465
+    width: 7px;
466
+    height: 7px;
467
+    background: linear-gradient(
468
+      90deg,
469
+      rgba(215, 195, 253, 1),
470
+      rgba(179, 168, 247, 1)
471
+    );
472
+    border-radius: 50%;
473
+  }
474
+
475
+  .infoTitle {
476
+    font-size: 16px;
477
+    font-weight: bold;
478
+    margin-left: 5px;
479
+    color: #000;
480
+  }
481
+
482
+  .borderBox {
483
+    width: 340px;
484
+    min-height: 140px;
485
+    background: rgba(255, 255, 255, 1);
486
+    border: 1px solid rgba(229, 229, 229, 1);
487
+    border-radius: 10px;
488
+    padding: 0 14px 20px;
489
+    margin-top: 10px;
490
+
491
+  p {
492
+    font-size: 14px;
493
+    color: #000;
494
+    margin: 10px 0 3px;
495
+  }
496
+
497
+  }
498
+  .borderBox1 {
499
+    width: 340px;
500
+    min-height: 140px;
501
+    background: rgba(255, 255, 255, 1);
502
+    border: 1px solid rgba(229, 229, 229, 1);
503
+    border-radius: 10px;
504
+    padding: 0 14px 20px;
505
+    margin-top: 10px;
506
+
507
+  p {
508
+    font-size: 14px;
509
+    color: #000;
510
+    margin: 10px 0 3px;
511
+  }
512
+
513
+  }
514
+  .borderBox2 {
515
+    width: 340px;
516
+    min-height: 140px;
517
+    background: rgba(255, 255, 255, 1);
518
+    border: 1px solid rgba(229, 229, 229, 1);
519
+    border-radius: 10px;
520
+    padding: 0 14px 20px;
521
+    margin-top: 10px;
522
+
523
+  p {
524
+    font-size: 14px;
525
+    color: #000;
526
+    margin: 10px 0 3px;
527
+  }
528
+
529
+  }
530
+  }
531
+  }
532
+</style>
533
+
534
+<style lang="scss">
535
+  .infoBox {
536
+
537
+  .infoOne {
538
+
539
+  .borderBox {
540
+
541
+  .el-progress-bar__inner {
542
+    background: linear-gradient(
543
+      90deg,
544
+      rgba(169, 224, 243, 1),
545
+      rgba(159, 189, 252, 1)
546
+    );
547
+  }
548
+
549
+  .el-progress-bar {
550
+    margin-right: -59px;
551
+    padding-right: 60px;
552
+  }
553
+
554
+  }
555
+  .borderBox1 {
556
+
557
+  .el-progress-bar__inner {
558
+    background: linear-gradient(
559
+      90deg,
560
+      rgba(255, 215, 192, 1),
561
+      rgba(255, 153, 148, 1)
562
+    );
563
+  }
564
+
565
+  .el-progress-bar {
566
+    margin-right: -59px;
567
+    padding-right: 60px;
568
+  }
569
+
570
+  }
571
+  .borderBox2 {
572
+
573
+  .el-progress-bar__inner {
574
+    background: linear-gradient(
575
+      90deg,
576
+      rgba(215, 195, 253, 1),
577
+      rgba(179, 168, 247, 1)
578
+    );
579
+  }
580
+
581
+  .el-progress-bar {
582
+    margin-right: -59px;
583
+    padding-right: 60px;
584
+  }
585
+
586
+  }
587
+  }
588
+  }
589
+</style>
590
+
591
+