瀏覽代碼

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

csx 4 年之前
父節點
當前提交
af80fc6b92
共有 1 個文件被更改,包括 67 次插入8 次删除
  1. 67 8
      src/xt_pages/qcd/indicatorControlAnalysis/patientInspectionDetail.vue

+ 67 - 8
src/xt_pages/qcd/indicatorControlAnalysis/patientInspectionDetail.vue 查看文件

@@ -4,6 +4,36 @@
4 4
       <bread-crumb :crumbs="crumbs"></bread-crumb>
5 5
     </div>
6 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 37
       <div class="cell clearfix">
8 38
         <label class="title">
9 39
           <span class="name">日期</span> :
@@ -55,7 +85,8 @@
55 85
           <div class="tableTitle">患者列表</div>
56 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 90
                     :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
60 91
                     highlight-current-row
61 92
                     @current-change="handleChange">
@@ -99,6 +130,7 @@
99 130
     GetPatientInspectionIndexChart,
100 131
     GetRangeValue
101 132
   } from '@/api/common/statistics'
133
+  import { PostSearch } from '@/api/patient'
102 134
 
103 135
   export default {
104 136
     name: 'dialysisTotal',
@@ -109,7 +141,7 @@
109 141
     data() {
110 142
       return {
111 143
         custom_chart_data_color: [],
112
-        patient_name:"",
144
+        patient_name: '',
113 145
         options2: {
114 146
           title: {
115 147
             text: 'ECharts 入门示例'
@@ -251,10 +283,37 @@
251 283
           { value: 3, label: '近半年', state: 3 },
252 284
           { value: 4, label: '近一年', state: 4 },
253 285
           { value: 5, label: '自定义', state: 5 }
254
-        ]
286
+        ],
287
+        search_value: ''
255 288
       }
256 289
     },
257 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 317
       selectStateType(val) {
259 318
         this.stateType = val
260 319
         switch (val) {
@@ -320,8 +379,8 @@
320 379
             var patients = response.data.data.patients
321 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 384
                 this.patient_name = this.patientsData[i].name
326 385
                 this.$refs.table.setCurrentRow(this.patientsData[i])
327 386
               }
@@ -409,10 +468,10 @@
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 477
     created() {