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