Selaa lähdekoodia

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

XMLWAN 4 vuotta sitten
vanhempi
commit
cdfc6d62cd

+ 67 - 8
src/xt_pages/qcd/indicatorControlAnalysis/patientInspectionDetail.vue Näytä tiedosto

5
       <el-button type="primary" @click="$router.back(-1)">返回</el-button>
5
       <el-button type="primary" @click="$router.back(-1)">返回</el-button>
6
     </div>
6
     </div>
7
     <div class="app-container">
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
       <div class="cell clearfix">
38
       <div class="cell clearfix">
9
         <label class="title">
39
         <label class="title">
10
           <span class="name">日期</span> :
40
           <span class="name">日期</span> :
56
           <div class="tableTitle">患者列表</div>
86
           <div class="tableTitle">患者列表</div>
57
           <div class="tableTitle">当前患者: {{patient_name}}</div>
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
                     :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
91
                     :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
61
                     highlight-current-row
92
                     highlight-current-row
62
                     @current-change="handleChange">
93
                     @current-change="handleChange">
100
     GetPatientInspectionIndexChart,
131
     GetPatientInspectionIndexChart,
101
     GetRangeValue
132
     GetRangeValue
102
   } from '@/api/common/statistics'
133
   } from '@/api/common/statistics'
134
+  import { PostSearch } from '@/api/patient'
103
 
135
 
104
   export default {
136
   export default {
105
     name: 'dialysisTotal',
137
     name: 'dialysisTotal',
110
     data() {
142
     data() {
111
       return {
143
       return {
112
         custom_chart_data_color: [],
144
         custom_chart_data_color: [],
113
-        patient_name:"",
145
+        patient_name: '',
114
         options2: {
146
         options2: {
115
           title: {
147
           title: {
116
             text: 'ECharts 入门示例'
148
             text: 'ECharts 入门示例'
252
           { value: 3, label: '近半年', state: 3 },
284
           { value: 3, label: '近半年', state: 3 },
253
           { value: 4, label: '近一年', state: 4 },
285
           { value: 4, label: '近一年', state: 4 },
254
           { value: 5, label: '自定义', state: 5 }
286
           { value: 5, label: '自定义', state: 5 }
255
-        ]
287
+        ],
288
+        search_value: ''
256
       }
289
       }
257
     },
290
     },
258
     methods: {
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
       selectStateType(val) {
318
       selectStateType(val) {
260
         this.stateType = val
319
         this.stateType = val
261
         switch (val) {
320
         switch (val) {
321
             var patients = response.data.data.patients
380
             var patients = response.data.data.patients
322
             this.patientsData = patients
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
                 this.patient_name = this.patientsData[i].name
385
                 this.patient_name = this.patientsData[i].name
327
                 this.$refs.table.setCurrentRow(this.patientsData[i])
386
                 this.$refs.table.setCurrentRow(this.patientsData[i])
328
               }
387
               }
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
     created() {
478
     created() {