Просмотр исходного кода

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

csx 4 лет назад
Родитель
Сommit
af80fc6b92
1 измененных файлов: 67 добавлений и 8 удалений
  1. 67 8
      src/xt_pages/qcd/indicatorControlAnalysis/patientInspectionDetail.vue

+ 67 - 8
src/xt_pages/qcd/indicatorControlAnalysis/patientInspectionDetail.vue Просмотреть файл

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