|
@@ -5,6 +5,36 @@
|
5
|
5
|
<el-button type="primary" @click="$router.back(-1)">返回</el-button>
|
6
|
6
|
</div>
|
7
|
7
|
<div class="app-container">
|
|
8
|
+
|
|
9
|
+ <div class="cell clearfix">
|
|
10
|
+ <label class="title">
|
|
11
|
+ <span class="name">病人搜索</span> :
|
|
12
|
+ </label>
|
|
13
|
+ <div >
|
|
14
|
+
|
|
15
|
+ <el-form :inline="true" :model="listQuery">
|
|
16
|
+ <el-form-item label>
|
|
17
|
+ <el-autocomplete
|
|
18
|
+ class="checkSearch"
|
|
19
|
+ style="margin-top: 20px;"
|
|
20
|
+ popper-class="my-autocomplete"
|
|
21
|
+ v-model="search_value"
|
|
22
|
+ :fetch-suggestions="querySearchAsync"
|
|
23
|
+ :trigger-on-focus="false"
|
|
24
|
+ placeholder="请输入病人名字"
|
|
25
|
+ @select="handleSelect"
|
|
26
|
+ >
|
|
27
|
+ <i class="el-icon-search el-input__icon" slot="suffix"></i>
|
|
28
|
+ <template slot-scope="{ item }">
|
|
29
|
+ <div class="name">{{ item.name }}</div>
|
|
30
|
+ </template>
|
|
31
|
+ </el-autocomplete>
|
|
32
|
+ </el-form-item>
|
|
33
|
+ </el-form>
|
|
34
|
+ </div>
|
|
35
|
+
|
|
36
|
+ </div>
|
|
37
|
+
|
8
|
38
|
<div class="cell clearfix">
|
9
|
39
|
<label class="title">
|
10
|
40
|
<span class="name">日期</span> :
|
|
@@ -56,7 +86,8 @@
|
56
|
86
|
<div class="tableTitle">患者列表</div>
|
57
|
87
|
<div class="tableTitle">当前患者: {{patient_name}}</div>
|
58
|
88
|
|
59
|
|
- <el-table ref="table" :data="patientsData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }"
|
|
89
|
+ <el-table ref="table" :data="patientsData" border style="width: 100%;" height="500"
|
|
90
|
+ :row-style="{ color: '#303133' }"
|
60
|
91
|
:header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
|
61
|
92
|
highlight-current-row
|
62
|
93
|
@current-change="handleChange">
|
|
@@ -100,6 +131,7 @@
|
100
|
131
|
GetPatientInspectionIndexChart,
|
101
|
132
|
GetRangeValue
|
102
|
133
|
} from '@/api/common/statistics'
|
|
134
|
+ import { PostSearch } from '@/api/patient'
|
103
|
135
|
|
104
|
136
|
export default {
|
105
|
137
|
name: 'dialysisTotal',
|
|
@@ -110,7 +142,7 @@
|
110
|
142
|
data() {
|
111
|
143
|
return {
|
112
|
144
|
custom_chart_data_color: [],
|
113
|
|
- patient_name:"",
|
|
145
|
+ patient_name: '',
|
114
|
146
|
options2: {
|
115
|
147
|
title: {
|
116
|
148
|
text: 'ECharts 入门示例'
|
|
@@ -252,10 +284,37 @@
|
252
|
284
|
{ value: 3, label: '近半年', state: 3 },
|
253
|
285
|
{ value: 4, label: '近一年', state: 4 },
|
254
|
286
|
{ value: 5, label: '自定义', state: 5 }
|
255
|
|
- ]
|
|
287
|
+ ],
|
|
288
|
+ search_value: ''
|
256
|
289
|
}
|
257
|
290
|
},
|
258
|
291
|
methods: {
|
|
292
|
+ handleSelect(val) {
|
|
293
|
+ this.query.patient_id = val.id
|
|
294
|
+ this.patient_name = val.name
|
|
295
|
+ this.GetPatientInspectionIndexChart(this.query)
|
|
296
|
+ for (let i = 0; i < this.patientsData.length; i++) {
|
|
297
|
+ if (this.patientsData[i].id == val.id) {
|
|
298
|
+ this.$refs.table.setCurrentRow(this.patientsData[i])
|
|
299
|
+ }
|
|
300
|
+ }
|
|
301
|
+
|
|
302
|
+ },
|
|
303
|
+ querySearchAsync(keyword, cb) {
|
|
304
|
+ let key = ''
|
|
305
|
+ if (keyword != undefined) {
|
|
306
|
+ key = keyword
|
|
307
|
+ }
|
|
308
|
+ let searchArray = []
|
|
309
|
+ PostSearch(key).then(response => {
|
|
310
|
+ if (response.data.state == 1) {
|
|
311
|
+ searchArray = response.data.data.patient
|
|
312
|
+ cb(searchArray)
|
|
313
|
+ } else {
|
|
314
|
+ cb([])
|
|
315
|
+ }
|
|
316
|
+ })
|
|
317
|
+ },
|
259
|
318
|
selectStateType(val) {
|
260
|
319
|
this.stateType = val
|
261
|
320
|
switch (val) {
|
|
@@ -321,8 +380,8 @@
|
321
|
380
|
var patients = response.data.data.patients
|
322
|
381
|
this.patientsData = patients
|
323
|
382
|
|
324
|
|
- for (let i = 0;i < this.patientsData.length; i++){
|
325
|
|
- if (this.patientsData[i].id == this.query.patient_id){
|
|
383
|
+ for (let i = 0; i < this.patientsData.length; i++) {
|
|
384
|
+ if (this.patientsData[i].id == this.query.patient_id) {
|
326
|
385
|
this.patient_name = this.patientsData[i].name
|
327
|
386
|
this.$refs.table.setCurrentRow(this.patientsData[i])
|
328
|
387
|
}
|
|
@@ -410,10 +469,10 @@
|
410
|
469
|
|
411
|
470
|
})
|
412
|
471
|
|
413
|
|
- }, getTimestamp(time) {
|
|
472
|
+ }, getTimestamp(time) {
|
414
|
473
|
// 把时间日期转成时间戳
|
415
|
|
- return new Date(time).getTime() / 1000;
|
416
|
|
- },
|
|
474
|
+ return new Date(time).getTime() / 1000
|
|
475
|
+ }
|
417
|
476
|
|
418
|
477
|
},
|
419
|
478
|
created() {
|