Browse Source

bug修改

XMLWAN 4 years ago
parent
commit
003bc93370

+ 13 - 5
src/api/common/common.js View File

@@ -258,14 +258,15 @@ export function getDialysisDetailById(id, startime, endtime, limit, page) {
258 258
   })
259 259
 }
260 260
 
261
-export function getPrescriptionByName(keyword, startime, endtime, limit, page) {
261
+export function getPrescriptionByName(patientid, startime, endtime, limit, page) {
262 262
   const params = {
263
-    keyword: keyword,
263
+    patientid: patientid,
264 264
     startime: startime,
265 265
     endtime: endtime,
266 266
     limit: limit,
267 267
     page: page
268 268
   }
269
+  console.log('params', params)
269 270
   return request({
270 271
     url: '/com/api/getprescriptionbyname',
271 272
     method: 'Get',
@@ -299,7 +300,6 @@ export function getInspectionDetailById(id, startime, endtime) {
299 300
     startime: startime,
300 301
     endtime: endtime
301 302
   }
302
-  console.log('startime', params)
303 303
   return request({
304 304
     url: '/com/api/getinspectionDetailById',
305 305
     method: 'get',
@@ -307,9 +307,9 @@ export function getInspectionDetailById(id, startime, endtime) {
307 307
   })
308 308
 }
309 309
 
310
-export function getSearchPatientInfo(keyword, startime, endtime) {
310
+export function getSearchPatientInfo(patientid, startime, endtime) {
311 311
   const params = {
312
-    keyword: keyword,
312
+    patientid: patientid,
313 313
     startime: startime,
314 314
     endtime: endtime
315 315
   }
@@ -449,3 +449,11 @@ export function GetQualityControl(params) {
449 449
     params: params
450 450
   })
451 451
 }
452
+
453
+export function getTreatlist(params) {
454
+  return request({
455
+    url: '/com/api/gettreatlist',
456
+    method: 'get',
457
+    params: params
458
+  })
459
+}

+ 5 - 16
src/router/modules/qcd.js View File

@@ -259,17 +259,6 @@ export default {
259 259
         noCache: true
260 260
       }
261 261
     },
262
-    {
263
-      path: '/qcd/a',
264
-      hidden: true,
265
-      is_menu: false,
266
-      component: () => import('@/xt_pages/qcd/a'),
267
-      name: 'workAnalysisNurse',
268
-      meta: {
269
-        title: '工作量分析统计护士',
270
-        noCache: true
271
-      }
272
-    },
273 262
     {
274 263
       path: '/qcd/patientanalysis/checkStatistical',
275 264
       hidden: true,
@@ -405,15 +394,15 @@ export default {
405 394
         title: '口服药',
406 395
         noCache: true
407 396
       }
408
-    },  {
409
-      path: "/qcd/inspection/detail",
397
+    }, {
398
+      path: '/qcd/inspection/detail',
410 399
       hidden: true,
411 400
       is_menu: false,
412 401
       component: () =>
413
-        import("@/xt_pages/qcd/indicatorControlAnalysis/patientInspectionDetail"),
414
-      name: "patientInspectionDetail",
402
+        import('@/xt_pages/qcd/indicatorControlAnalysis/patientInspectionDetail'),
403
+      name: 'patientInspectionDetail',
415 404
       meta: {
416
-        title: "化验指标详情",
405
+        title: '化验指标详情',
417 406
         noCache: true
418 407
       }
419 408
     }

+ 1 - 1
src/xt_pages/qcd/components/LineChart.vue View File

@@ -176,7 +176,7 @@ export default {
176 176
             interval: 0,
177 177
             formatter: function(value) {
178 178
               var ret = ""; //拼接加\n返回的类目项
179
-              var maxLength = 8; //每项显示文字个数
179
+              var maxLength = 10; //每项显示文字个数
180 180
               var valLength = value.length; //X轴类目项的文字个数
181 181
               var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数
182 182
               if (rowN > 1) {

+ 18 - 20
src/xt_pages/qcd/officesControlAnalysis/time.vue View File

@@ -40,6 +40,7 @@
40 40
             align="right"
41 41
             format="yyyy-MM-dd"
42 42
             value-format="yyyy-MM-dd"
43
+            :picker-options="pickerOptions"
43 44
           ></el-date-picker>
44 45
           <span class>-</span>
45 46
           <el-date-picker
@@ -53,11 +54,12 @@
53 54
             align="right"
54 55
             format="yyyy-MM-dd"
55 56
             value-format="yyyy-MM-dd"
57
+            :picker-options="pickerOptions"
56 58
           ></el-date-picker>
57 59
         </div>
58 60
       </div>
59 61
       <div class="cell clearfix">
60
-        <div class="time newLi" v-if="type == '按季度对比统计'">
62
+        <div class="time newLi" v-if="type == '按季度统计对比'">
61 63
           <ul class>
62 64
             <li
63 65
               :class="item.state == quarterType ? 'active' : ''"
@@ -67,7 +69,7 @@
67 69
             >{{ item.label }}</li>
68 70
           </ul>
69 71
         </div>
70
-        <div class="time newLi" v-if="type == '按月份对比统计'">
72
+        <div class="time newLi" v-if="type == '按月份统计对比'">
71 73
           <ul class>
72 74
             <li
73 75
               :class="item.state == monthType ? 'active' : ''"
@@ -110,6 +112,12 @@ export default {
110 112
   },
111 113
   data() {
112 114
     return {
115
+      pickerOptions: {
116
+        disabledDate(time) {
117
+          let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
118
+          return time.getTime() > Date.now() || time.getTime() < threeMonths;;
119
+        }
120
+      },  
113 121
       modetype:0,
114 122
       startime:"",
115 123
       endtime:"",
@@ -148,12 +156,12 @@ export default {
148 156
       value: "请选项",
149 157
       options1: [
150 158
         {
151
-          value: "按季度对比统计",
152
-          label: "按季度对比统计"
159
+          value: "按季度统计对比",
160
+          label: "按季度统计对比"
153 161
         },
154 162
         {
155
-          value: "按月份对比统计",
156
-          label: "按月份对比统计"
163
+          value: "按月份统计对比",
164
+          label: "按月份统计对比"
157 165
         },
158 166
         {
159 167
           value: "自定义",
@@ -193,7 +201,7 @@ export default {
193 201
           left: 0
194 202
         },
195 203
         xAxis: {
196
-          data: ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
204
+          data: []
197 205
         },
198 206
         yAxis: {
199 207
           axisLabel: {
@@ -205,17 +213,7 @@ export default {
205 213
           {
206 214
             name: "次数",
207 215
             type: "bar",
208
-            data: [
209
-              "78.57",
210
-              "50",
211
-              "80",
212
-              "93.33",
213
-              "92.86",
214
-              "100",
215
-              "12",
216
-              "77",
217
-              "37"
218
-            ],
216
+            data: [],
219 217
             barWidth: 30,
220 218
             label: {
221 219
               normal: {
@@ -322,11 +320,11 @@ export default {
322 320
     },
323 321
     chooseType(val) {
324 322
       this.type = val;
325
-      if(val == "按月份对比统计"){
323
+      if(val == "按月份统计对比"){
326 324
          this.modetype = 0
327 325
         
328 326
       }
329
-       if(val == "按季度对比统计"){
327
+       if(val == "按季度统计对比"){
330 328
          this.modetype = 1
331 329
          
332 330
       }

+ 52 - 16
src/xt_pages/qcd/patientControlAnalysis.vue View File

@@ -8,8 +8,23 @@
8 8
         <div class="cell clearfix">
9 9
           <el-form :inline="true" :model="listQuery">
10 10
             <el-form-item label>
11
-              <el-input v-model.trim="listQuery.search" placeholder="姓名/透析号" style="width: 200px;"></el-input>
12
-              <el-button type="primary" @click="onSearch" icon="el-icon-search">搜索</el-button>
11
+              <!-- <el-input v-model.trim="listQuery.search" placeholder="姓名/透析号" style="width: 200px;"></el-input>
12
+              <el-button type="primary" @click="onSearch" icon="el-icon-search">搜索</el-button> -->
13
+               <el-autocomplete
14
+                class="checkSearch"
15
+                popper-class="my-autocomplete"
16
+                v-model.trim="listQuery.search"
17
+                :fetch-suggestions="querySearchAsync"
18
+                :trigger-on-focus="false"
19
+                placeholder="输入病人透析号/姓名"
20
+                @select="handleSelect"
21
+              >
22
+                <i class="el-icon-search el-input__icon" slot="suffix"></i>
23
+                <template slot-scope="{ item }">
24
+                  <div class="name">{{ item.name }}</div>
25
+                </template>
26
+              </el-autocomplete>
27
+
13 28
             </el-form-item>
14 29
           </el-form>
15 30
           <el-select v-model="lapstor" placeholder="请选择" style="margin-right:20px;width:100px">
@@ -109,6 +124,7 @@
109 124
 </template>
110 125
 
111 126
 <script>
127
+import { PostSearch} from '@/api/patient'
112 128
 import echarts from "echarts";
113 129
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
114 130
 import LineChart from "../qcd/components/LineChart";
@@ -242,7 +258,8 @@ export default {
242 258
       dataCount:[
243 259
          {id:0,count:0},
244 260
          {id:1,count:0}
245
-      ]
261
+      ],
262
+      patient_id:0,
246 263
     };
247 264
   },
248 265
   methods: {
@@ -321,12 +338,11 @@ export default {
321 338
     onSearch(){
322 339
          const params = {
323 340
             lapstor:this.lapstor,
324
-            keyword:this.listQuery.search,
341
+            patientid:this.patient_id,
325 342
             startime:this.listQuery.start_time,
326 343
             endtime:this.listQuery.end_time,
327 344
 
328 345
          }
329
-         console.log("params",params)
330 346
        getPatientContorlAnalysis(params).then(response=>{
331 347
            if(response.data.state == 1){
332 348
               var control = response.data.data.patientcontorDetail
@@ -541,7 +557,7 @@ export default {
541 557
               item.data = newarr
542 558
              // console.log(1111111111,item.data)
543 559
             })
544
-             console.log("表",this.tableData)
560
+         console.log("表",this.tableData)
545 561
          }
546 562
       })
547 563
     },
@@ -584,7 +600,7 @@ export default {
584 600
                     cart.push(cartogramlist[i])
585 601
                   }
586 602
                }
587
-               console.log("cart",cart)
603
+              //  console.log("cart",cart)
588 604
                let dataInfo = {}
589 605
                 cart.forEach((item, index) => {
590 606
                   let { patient_id } = item
@@ -599,7 +615,7 @@ export default {
599 615
                   }
600 616
                 })
601 617
               let list = Object.values(dataInfo)
602
-              console.log("list",list)
618
+              // console.log("list",list)
603 619
 
604 620
               var arr = []
605 621
               list.map(item=>{
@@ -618,7 +634,7 @@ export default {
618 634
                    arr.push(it)
619 635
                 })
620 636
              })
621
-              console.log("arr",arr)
637
+              // console.log("arr",arr)
622 638
 
623 639
              var arrtwo = []
624 640
              for(let i=0;i<arr.length;i++){
@@ -626,7 +642,7 @@ export default {
626 642
                   arrtwo.push(arr[i])
627 643
                }
628 644
              }
629
-             console.log("arrtwo",arrtwo)
645
+            //  console.log("arrtwo",arrtwo)
630 646
 
631 647
              let objinfo = {}
632 648
                 arrtwo.forEach((item, index) => {
@@ -649,7 +665,7 @@ export default {
649 665
                     }
650 666
                  }
651 667
               })
652
-              console.log("newlist",newlist)
668
+              // console.log("newlist",newlist)
653 669
               newlist.map(item=>{
654 670
                   item.child.map(it=>{
655 671
                     if(parseInt(it.range_min)<= parseInt(it.inspect_value) && parseInt(it.inspect_value)<=parseInt(it.range_max )){
@@ -657,7 +673,7 @@ export default {
657 673
                     }
658 674
                   })
659 675
               })
660
-              console.log("newlist",newlist)
676
+              // console.log("newlist",newlist)
661 677
 
662 678
 
663 679
               var newtotal = 0
@@ -669,9 +685,9 @@ export default {
669 685
                     }
670 686
                  }
671 687
               })
672
-             console.log("newtotal",newtotal)
688
+            //  console.log("newtotal",newtotal)
673 689
              var totalCount = totaltwo - newtotal
674
-              console.log("totalCount",totaltwo)
690
+              // console.log("totalCount",totaltwo)
675 691
              for(let i=0;i<this.dataName.length;i++){
676 692
                 this.modesData.xAxis.push(this.dataName[i].name);
677 693
              }
@@ -695,8 +711,28 @@ export default {
695 711
             this.patientsArr =  response.data.data.patients
696 712
           }
697 713
        })
698
-     }
699
-
714
+     },
715
+    querySearchAsync(keyword, cb) {
716
+        let key = ''
717
+        if (keyword != undefined) {
718
+          key = keyword
719
+        }
720
+        let searchArray = []
721
+        PostSearch(key).then(response => {
722
+          if (response.data.state == 1) {
723
+             searchArray = response.data.data.patient
724
+            cb(searchArray)
725
+          } else {
726
+            cb([])
727
+          }
728
+        })
729
+      },
730
+   handleSelect(val) {
731
+        console.log("val",val)
732
+        this.listQuery.search = val.name
733
+        this.patient_id = val.id
734
+        this.onSearch()
735
+      },
700 736
   },
701 737
   created(){
702 738
     var nowDate = new Date();

+ 16 - 12
src/xt_pages/qcd/statisticalConfiguration.vue View File

@@ -192,7 +192,6 @@ export default {
192 192
 
193 193
     //编辑
194 194
     handleEdit(id) {
195
-      console.log("id",id)
196 195
       this.editDialog = true;
197 196
       getConfigurationDetail(id).then(response=>{
198 197
          if(response.data.state == 1){
@@ -235,6 +234,7 @@ export default {
235 234
     },
236 235
     changeInspectionTwo(id){
237 236
       this.InspectionMinorTwo = []
237
+      this.editform.inspectionMinor = ""
238 238
        getInspectionMinor(id).then(response=>{
239 239
         if(response.data.state == 1){
240 240
          var inspection =  response.data.data.inspection
@@ -294,7 +294,7 @@ export default {
294 294
               configurationlist[i].sort = ""
295 295
             }
296 296
           }
297
-          //console.log("列表",configurationlist)
297
+          console.log("列表",configurationlist)
298 298
           this.configuraData = configurationlist
299 299
           var total = response.data.data.total
300 300
          // console.log("total",total)
@@ -321,16 +321,20 @@ export default {
321 321
         var sort = parseInt(sorts)
322 322
         this.editform.sort = sort
323 323
        }
324
-     
325
-      UpdateConfiguration(this.editform.id,this.editform).then(response=>{
326
-        if(response.data.state == 1){
327
-         var standard =  response.data.data.standard
328
-        // console.log("standard",standard)
329
-         this.$message.success("保存成功")
330
-         this.editDialog = false
331
-         this.getConfigurationList()
332
-        }else{
333
-         this.$message.error("检查小项已存在")
324
+      this.$refs[formName].validate(valid=>{
325
+        if(valid){
326
+         UpdateConfiguration(this.editform.id,this.editform).then(response=>{
327
+            if(response.data.state == 1){
328
+            var standard =  response.data.data.standard
329
+            // console.log("standard",standard)
330
+            this.$message.success("保存成功")
331
+            this.editDialog = false
332
+            this.getConfigurationList()
333
+            this.getAllInspectionMinor()
334
+            }else{
335
+            this.$message.error("检查小项已存在")
336
+            }
337
+          })
334 338
         }
335 339
       })
336 340
     },

+ 0 - 3
src/xt_pages/qcd/treatmentControlAnalysis/check.vue View File

@@ -10,9 +10,6 @@
10 10
           <el-tab-pane label="患者检验检查统计" name="second"></el-tab-pane>
11 11
         </el-tabs>
12 12
         <div class="cell clearfix">
13
-          <label class="title">
14
-            <span class="name">转归状态</span> :
15
-          </label>
16 13
           <div class="time">
17 14
             <ul class>
18 15
               <li

+ 62 - 22
src/xt_pages/qcd/treatmentControlAnalysis/components/CheckAll.vue View File

@@ -3,8 +3,22 @@
3 3
     <div class="cell clearfix">
4 4
       <el-form :inline="true" :model="listQuery">
5 5
         <el-form-item label>
6
-          <el-input v-model.trim="listQuery.search" placeholder="姓名/透析号" style="width:150px"></el-input>
7
-          <el-button type="primary" @click="onSearch" icon="el-icon-search">搜索</el-button>
6
+          <!-- <el-input v-model.trim="listQuery.search" placeholder="姓名/透析号" style="width:150px"></el-input>
7
+          <el-button type="primary" @click="onSearch" icon="el-icon-search">搜索</el-button> -->
8
+           <el-autocomplete
9
+             class="checkSearch"
10
+             popper-class="my-autocomplete"
11
+             v-model.trim="listQuery.search"
12
+             :fetch-suggestions="querySearchAsync"
13
+             :trigger-on-focus="false"
14
+             placeholder="输入病人透析号/姓名"
15
+             @select="handleSelect"
16
+              >
17
+             <i class="el-icon-search el-input__icon" slot="suffix"></i>
18
+               <template slot-scope="{ item }">
19
+                  <div class="name">{{ item.name }}</div>
20
+              </template>
21
+          </el-autocomplete>
8 22
         </el-form-item>
9 23
       </el-form>
10 24
       <label class="title">
@@ -90,6 +104,7 @@
90 104
 
91 105
 
92 106
 <script>
107
+  import { PostSearch} from '@/api/patient'
93 108
   import {getCurrentOrgPatients,getAllMajorInspection,getPatientList,getPatientDetailCheck,SearchDetailCheck } from "@/api/common/common"
94 109
 export default {
95 110
   data() {
@@ -106,6 +121,8 @@ export default {
106 121
       total:0,
107 122
       tableName:[],
108 123
       ObjectData:{},
124
+      patient_id:0,
125
+      patient_name:"",
109 126
     };
110 127
   },
111 128
   methods: {
@@ -122,10 +139,11 @@ export default {
122 139
       }
123 140
     },
124 141
     onSearch(){
125
-      SearchDetailCheck(this.listQuery.search,this.listQuery.start_time,this.listQuery.end_time).then(response=>{
142
+     getPatientDetailCheck(this.patient_id,this.listQuery.start_time,this.listQuery.end_time).then(response=>{
126 143
           if(response.data.state === 1){
127
-           var  checkDetail =  response.data.data.checkDetail
128
-             var arr = []
144
+            var checkDetail =  response.data.data.checkDetail
145
+        
146
+            var arr = []
129 147
             for(let i=0;i<checkDetail.length;i++){
130 148
               for(let j=0;j<this.tableName.length;j++){
131 149
                  if(checkDetail[i].ProjectId == this.tableName[j].inspection_major){
@@ -133,22 +151,23 @@ export default {
133 151
                  }
134 152
               }
135 153
             }
136
-            // let projectArr = []
137
-            // this.newArr.map(item => {
138
-            //   projectArr.push(item.project_name)
139
-            // })
140
-            // console.log("projectArr",projectArr)
141
-            // projectArr.forEach((item,index) => {
142
-            //   if(!(arr[index] && item == arr[index].ProjectName)){
143
-            //     arr.splice(index,0,{Count:0, ProjectName: item,name: val.name})
144
-            //   }
145
-            // })
146
-            // this.tableData = []
147
-            // let obj = {}
148
-            // obj.name = val.name
149
-            // obj.data = arr
150
-            // this.tableData.push(obj)
151
-        
154
+
155
+            let projectArr = []
156
+            this.newArr.map(item => {
157
+              projectArr.push(item.project_name)
158
+            })
159
+            projectArr.forEach((item,index) => {
160
+              if(!(arr[index] && item == arr[index].ProjectName)){
161
+                arr.splice(index,0,{Count:0, ProjectName: item,name: this.listQuery.search})
162
+              }
163
+            })
164
+            this.tableData = []
165
+            let obj = {}
166
+            obj.name = this.listQuery.search
167
+            obj.data = arr
168
+            this.tableData.push(obj)
169
+            this.total = 1
170
+           
152 171
           }
153 172
       })
154 173
     },
@@ -295,7 +314,28 @@ export default {
295 314
     },
296 315
    arrayToObj(arr){
297 316
       return Object.assign({},arr);
298
-    }
317
+    },
318
+  querySearchAsync(keyword, cb) {
319
+        let key = ''
320
+        if (keyword != undefined) {
321
+          key = keyword
322
+        }
323
+        let searchArray = []
324
+        PostSearch(key).then(response => {
325
+          if (response.data.state == 1) {
326
+             searchArray = response.data.data.patient
327
+             console.log("searchArray",searchArray)
328
+            cb(searchArray)
329
+          } else {
330
+            cb([])
331
+          }
332
+        })
333
+      },
334
+   handleSelect(val) {
335
+        this.listQuery.search = val.name
336
+        this.patient_id = val.id
337
+        this.onSearch()
338
+      },
299 339
   },
300 340
   created(){
301 341
      var nowDate = new Date();

+ 61 - 6
src/xt_pages/qcd/treatmentControlAnalysis/components/CheckPersonal.vue View File

@@ -3,8 +3,22 @@
3 3
     <div class="cell clearfix">
4 4
       <el-form :inline="true" :model="listQuery">
5 5
         <el-form-item label>
6
-          <el-input v-model.trim="listQuery.search" placeholder="姓名/透析号" style="width:150px"></el-input>
7
-          <el-button type="primary" @click="onSearch" icon="el-icon-search">搜索</el-button>
6
+          <!-- <el-input v-model.trim="listQuery.search" placeholder="姓名/透析号" style="width:150px"></el-input>
7
+          <el-button type="primary" @click="onSearch" icon="el-icon-search">搜索</el-button> -->
8
+          <el-autocomplete
9
+             class="checkSearch"
10
+             popper-class="my-autocomplete"
11
+             v-model.trim="listQuery.search"
12
+             :fetch-suggestions="querySearchAsync"
13
+             :trigger-on-focus="false"
14
+             placeholder="输入病人透析号/姓名"
15
+             @select="handleSelect"
16
+              >
17
+             <i class="el-icon-search el-input__icon" slot="suffix"></i>
18
+               <template slot-scope="{ item }">
19
+                  <div class="name">{{ item.name }}</div>
20
+              </template>
21
+          </el-autocomplete>
8 22
         </el-form-item>
9 23
       </el-form>
10 24
       <label class="title">
@@ -67,6 +81,7 @@
67 81
 
68 82
 
69 83
 <script>
84
+import { PostSearch} from '@/api/patient'
70 85
 import echarts from "echarts";
71 86
 import LineChart from "../../components/LineChart";
72 87
 import { getCurrentOrgPatients,getInspectionTotalCount,getInspectionDetailById,getSearchPatientInfo } from "@/api/common/common";
@@ -178,7 +193,8 @@ export default {
178 193
         xAxis: [],
179 194
         series: []
180 195
       },
181
-      obj:[]
196
+      obj:[],
197
+      patient_id:0,
182 198
     };
183 199
   },
184 200
   methods: {
@@ -290,7 +306,7 @@ export default {
290 306
        getInspectionDetailById(val.id,this.listQuery.start_time,this.listQuery.end_time).then(response=>{
291 307
           if(response.data.state === 1){
292 308
             var patientdetail = response.data.data.patientdetail
293
-
309
+            console.log("patientdetail",patientdetail)
294 310
             var arr=[]
295 311
             for(let i=0;i<this.tableData.length;i++){
296 312
               for(let j=0;j<patientdetail.length;j++){
@@ -322,10 +338,12 @@ export default {
322 338
 
323 339
     //搜索功能
324 340
     onSearch(){
325
-      getSearchPatientInfo(this.listQuery.search,this.listQuery.start_time,this.listQuery.end_time).then(response=>{
341
+       this.modesData.series = []
342
+       this.modesData.xAxis = []
343
+      getSearchPatientInfo(this.patient_id,this.listQuery.start_time,this.listQuery.end_time).then(response=>{
326 344
          if(response.data.state  === 1){
327 345
            var PatientsInfo = response.data.data.PatientsInfo
328
-          
346
+           console.log("patientsInfo",PatientsInfo)
329 347
            var arr = []
330 348
            for(let i=0;i<this.tableData.length;i++){
331 349
              for(let j=0;j<PatientsInfo.length;j++){
@@ -334,7 +352,22 @@ export default {
334 352
                  }
335 353
              }
336 354
            }
355
+           let time = new Date(this.listQuery.end_time) - new Date(this.listQuery.start_time)
356
+           let day = parseInt(time / (1000 * 60 * 60 * 24))
337 357
        
358
+            for (const key in this.tableData) {
359
+              this.modesData.xAxis.push(this.tableData[key].project_name);
360
+              if (key in arr) {
361
+                this.modesData.series.push(parseInt(arr[key].Count));
362
+                this.obj.push(Math.round(day / arr[key].InspectionFrequency))
363
+                // batotal += parseInt(res[key].Count);
364
+              } else {
365
+                this.modesData.series.push(0);
366
+                this.obj.push(0)
367
+              }
368
+            }
369
+            this.chart.series[0].data = this.modesData.series
370
+            this.chart.xAxis.data = this.modesData.xAxis
338 371
          }
339 372
       })
340 373
     },
@@ -360,6 +393,28 @@ export default {
360 393
         }
361 394
         return result;
362 395
     },
396
+     querySearchAsync(keyword, cb) {
397
+        let key = ''
398
+        if (keyword != undefined) {
399
+          key = keyword
400
+        }
401
+        let searchArray = []
402
+        PostSearch(key).then(response => {
403
+          if (response.data.state == 1) {
404
+             searchArray = response.data.data.patient
405
+             console.log("searchArray",searchArray)
406
+            cb(searchArray)
407
+          } else {
408
+            cb([])
409
+          }
410
+        })
411
+      },
412
+   handleSelect(val) {
413
+        console.log("val",val)
414
+        this.listQuery.search = val.name
415
+        this.patient_id = val.id
416
+        this.onSearch()
417
+      },
363 418
   },
364 419
   created(){
365 420
     var nowDate = new Date();

+ 63 - 38
src/xt_pages/qcd/treatmentControlAnalysis/components/TimeAll.vue View File

@@ -101,7 +101,7 @@
101 101
 <script>
102 102
 import echarts from "echarts";
103 103
 import LineChart from "../../components/LineChart";
104
-import {geStatistics} from "@/api/common/common"
104
+import {geStatistics,getTreatlist} from "@/api/common/common"
105 105
 export default {
106 106
   components: {
107 107
     LineChart
@@ -247,20 +247,76 @@ export default {
247 247
       this.geStatistics();
248 248
     },
249 249
     handleCurrentChange(page) {
250
+      this.tableData = []
250 251
       this.listQuery.page = page;
251 252
       this.geStatistics();
252 253
     },
253 254
    selectChange(val){
255
+     this.tableData=[]
254 256
      this.listQuery.value =val
255 257
      this.geStatistics()
258
+     this.getlist()
256 259
    },
257
-    geStatistics(){
260
+   getlist(){
258 261
       this.modesData.series = []
259 262
       this.modesData.xAxis = []
263
+     getTreatlist(this.listQuery).then(response=>{
264
+        if(response.data.state == 1){
265
+          var ttd =  response.data.data.list
266
+            var modeMap = {};
267
+            var batotal = 0;
268
+            for (const index in ttd) {
269
+              if (ttd[index].mode_id == "0") {
270
+                continue;
271
+              }
272
+              modeMap[ttd[index].mode_id] = ttd[index];
273
+            }
274
+            for (const key in this.modeOptions) {
275
+              this.modesData.xAxis.push(this.modeOptions[key].name);
276
+              if (key in modeMap) {
277
+                this.modesData.series.push(parseInt(modeMap[key].number));
278
+                batotal += parseInt(modeMap[key].number);
279
+              } else {
280
+                this.modesData.series.push(0);
281
+              }
282
+            }
283
+
284
+          this.chart.series[0].data = this.modesData.series
285
+          this.chart.xAxis.data = this.modesData.xAxis
286
+         }
287
+     })
288
+   },
289
+    geStatistics(){
260 290
       geStatistics(this.listQuery).then(response=>{
261 291
         if(response.data.state === 1){
262
-          var dtd =  response.data.data.statistics
263
-        //  console.log("dtd",dtd)
292
+          var statistics =  response.data.data.statistics
293
+          var treatinfo = response.data.data.treatinfo
294
+          this.total =  response.data.data.total
295
+          let dataInfo = {}
296
+           treatinfo.forEach((item, index) => {
297
+             let { date } = item
298
+             if (!dataInfo[date]) {
299
+                dataInfo[date] = {
300
+                   date,
301
+                   child: [],
302
+                 }
303
+                }
304
+            })
305
+         let list = Object.values(dataInfo)
306
+      
307
+         list.map(item=>{
308
+           for(let i=0;i<statistics.length;i++){
309
+             if(item.date == statistics[i].date){
310
+                item.child.push(statistics[i])
311
+             }
312
+           }
313
+         })
314
+         var dtd = []
315
+         list.map(item=>{
316
+           item.child.map(it=>{
317
+              dtd.push(it)
318
+           })
319
+         })
264 320
           var dd = {};
265 321
           for (const index in dtd) {
266 322
             if (!(dtd[index].date in dd)) {
@@ -270,7 +326,6 @@ export default {
270 326
               dd[dtd[index].date][dtd[index].mode_id] = dtd[index];
271 327
             }
272 328
           }
273
-          console.log("ddd",dd)
274 329
           for (const key in dd) {
275 330
             var total = 0;
276 331
             for (const mkey in this.modeOptions) {
@@ -292,44 +347,13 @@ export default {
292 347
             }
293 348
             this.tableData.push({ date: key, data: dd[key], total: total });
294 349
           }
295
-          console.log("tabledata",this.tableData)
296
-          var ttd = response.data.data.ttd
297
-         // console.log("ttd",ttd)
298
-          var modeMap = {};
299
-          var batotal = 0;
300
-          for (const index in ttd) {
301
-            if (ttd[index].mode_id == "0") {
302
-              continue;
303
-            }
304
-            modeMap[ttd[index].mode_id] = ttd[index];
305
-          }
306
-         // console.log(111,modeMap)
307
-          for (const key in this.modeOptions) {
308
-            this.modesData.xAxis.push(this.modeOptions[key].name);
309
-            if (key in modeMap) {
310
-              this.modesData.series.push(parseInt(modeMap[key].number));
311
-              batotal += parseInt(modeMap[key].number);
312
-            } else {
313
-              this.modesData.series.push(0);
314
-            }
315
-          }
316
-
317
-          this.chart.series[0].data = this.modesData.series
318
-          this.chart.xAxis.data = this.modesData.xAxis
319
-         // console.log(this.chart.series[0].data)
320
-         // console.log(this.chart.xAxis.data)
321
-
322
-          this.total =  response.data.data.total
323
-         // console.log("total",this.total)
324
-
325 350
         }
326
-      })
351
+       })
327 352
     },
328 353
  
329 354
   },
330 355
   created(){
331 356
     this.modeOptions = this.$store.getters.treatment_mode;
332
-    console.log("-----",this.modeOptions)
333 357
     var nowDate = new Date();
334 358
     var nowYear = nowDate.getFullYear();
335 359
     var nowMonth = nowDate.getMonth() + 1;
@@ -350,9 +374,10 @@ export default {
350 374
       (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
351 375
       "-" +
352 376
       (nowDay < 10 ? "0" + nowDay : nowDay);
377
+      //获取柱状图数据
378
+      this.getlist()
353 379
       //获取统计列表数据
354 380
       this.geStatistics()
355
-      console.log("activeModes",this.activeModes)
356 381
   },
357 382
   computed: {
358 383
     activeModes: function() {

+ 44 - 89
src/xt_pages/qcd/treatmentControlAnalysis/components/TimePersonal.vue View File

@@ -3,8 +3,22 @@
3 3
     <div class="cell clearfix">
4 4
       <el-form :inline="true" :model="listQuery">
5 5
         <el-form-item label>
6
-          <el-input v-model.trim="listQuery.search" placeholder="姓名/透析号" style="width:150px"></el-input>
7
-          <el-button type="primary" @click="onSearch" icon="el-icon-search">搜索</el-button>
6
+          <!-- <el-input v-model.trim="listQuery.search" placeholder="姓名/透析号" style="width:150px"></el-input>
7
+          <el-button type="primary" @click="onSearch" icon="el-icon-search">搜索</el-button> -->
8
+           <el-autocomplete
9
+             class="checkSearch"
10
+             popper-class="my-autocomplete"
11
+             v-model.trim="listQuery.search"
12
+             :fetch-suggestions="querySearchAsync"
13
+             :trigger-on-focus="false"
14
+             placeholder="输入病人透析号/姓名"
15
+             @select="handleSelect"
16
+              >
17
+             <i class="el-icon-search el-input__icon" slot="suffix"></i>
18
+               <template slot-scope="{ item }">
19
+                  <div class="name">{{ item.name }}</div>
20
+              </template>
21
+          </el-autocomplete>
8 22
         </el-form-item>
9 23
       </el-form>
10 24
       <label class="title">
@@ -98,6 +112,7 @@
98 112
 
99 113
 
100 114
 <script>
115
+ import { PostSearch} from '@/api/patient'
101 116
  import { getCurrentOrgPatients,getDialysisList,getDialysisDetailById,getPrescriptionByName } from "@/api/common/common";
102 117
  import { uParseTime } from "@/utils/tools";
103 118
 export default {
@@ -124,6 +139,7 @@ export default {
124 139
           return time.getTime() > Date.now() || time.getTime() < threeMonths;;
125 140
         }
126 141
       }, 
142
+      patient_id:0,
127 143
     };
128 144
   },
129 145
   methods: {
@@ -173,97 +189,14 @@ export default {
173 189
     getDialysisList(){
174 190
       getDialysisList(this.listQuery.start_time,this.listQuery.end_time,this.listQuery.page,this.listQuery.limit).then(response=>{
175 191
          if(response.data.state === 1){
176
-          //  var  dialysislist =  response.data.data.dialysislist
177
-          //  for(let i=0;i<dialysislist.length;i++){
178
-          //     if(dialysislist[i].mode_id == 1){
179
-          //       dialysislist[i].mode_id = "HD"
180
-          //     }
181
-          //      if(dialysislist[i].mode_id == 2){
182
-          //       dialysislist[i].mode_id = "HDF"
183
-          //     }
184
-          //      if(dialysislist[i].mode_id == 3){
185
-          //       dialysislist[i].mode_id = "HD+HP"
186
-          //     }
187
-          //      if(dialysislist[i].mode_id == 4){
188
-          //       dialysislist[i].mode_id = "HP"
189
-          //     }
190
-          //      if(dialysislist[i].mode_id == 5){
191
-          //       dialysislist[i].mode_id = "HF"
192
-          //     }
193
-          //      if(dialysislist[i].mode_id == 6){
194
-          //       dialysislist[i].mode_id = "SCUF"
195
-          //     }
196
-          //      if(dialysislist[i].mode_id == 7){
197
-          //       dialysislist[i].mode_id = "IUF"
198
-          //     }
199
-          //      if(dialysislist[i].mode_id == 8){
200
-          //       dialysislist[i].mode_id = "HFHD"
201
-          //     }
202
-          //      if(dialysislist[i].mode_id == 9){
203
-          //       dialysislist[i].mode_id = "HFHD+HP"
204
-          //     }
205
-          //      if(dialysislist[i].mode_id == 10){
206
-          //       dialysislist[i].mode_id = "PHF"
207
-          //     }
208
-          //      if(dialysislist[i].mode_id == 11){
209
-          //       dialysislist[i].mode_id = "HFR"
210
-          //     }
211
-          //     if(dialysislist[i].mode_id == 12){
212
-          //       dialysislist[i].mode_id = "HDF+HP"
213
-          //     }
214
-          //     if(dialysislist[i].mode_id == 13){
215
-          //       dialysislist[i].mode_id = "CRRT"
216
-          //     }
217
-          //    if(dialysislist[i].mode_id == 14){
218
-          //       dialysislist[i].mode_id = "腹水回输"
219
-          //     }
220
-          //     if(dialysislist[i].mode_id == 19){
221
-          //       dialysislist[i].mode_id = "IUF+HD"
222
-          //     }
223
-          //  }
224
-          //  console.log("dialysislist",dialysislist)
225
-          //  var hash = {};
226
-          //  var i = 0;
227
-          //  var res = [];
228
-          //  dialysislist.forEach(function(item) {
229
-          //   var patient_id = item.patient_id;
230
-          //   hash[patient_id] ? res[hash[patient_id] - 1].mode_id.push(item.mode_id) : hash[patient_id] = ++i && res.push({
231
-          //       mode_id: [item.mode_id],
232
-          //       patient_id: patient_id,
233
-          //       dialysis_no: item.dialysis_no,
234
-          //       name:item.name,
235
-          //       age:item.id_card_no,
236
-          //       total_dialysis:item.total_dialysis,
237
-          //       user_sys_before_count:item.user_sys_before_count,
238
-          //   })
239
-          //  });
240
-          //  res.map(item => {
241
-          //    item.age = this.getAge(item.age)
242
-          //  })
243
-          //  console.log(res)
244
-          //  //this.DialysisData = res
245
- 
246
-          //   var total = response.data.data.total
247
-          //   console.log("total",total) 
248
-          //  // this.total = total
249
-
250
-            
251 192
           var list = response.data.data.list
252
-          //console.log("list",list)
193
+          console.log("list",list)
253 194
           var totallist  =  response.data.data.totallist
254
-         // console.log("totallist",totallist)
195
+           console.log("totallist",totallist)
255 196
           this.total = totallist  
256 197
           var prescriptionList = response.data.data.prescriptionList
257 198
           this.getModeId(prescriptionList)
258 199
           
259
-         // console.log("prescriptionList",prescriptionList)
260
-          // for(let i=0;i<this.prescriptionList.length;i++){
261
-          //   for(let j=0;j<list.length;j++){
262
-          //     if(this.prescriptionList[i].patient_id == list[j].patient_id){
263
-          //       arr.push(this.prescriptionList[i])
264
-          //     }
265
-          //   }
266
-          // }
267 200
           let dataInfo = {}
268 201
           list.forEach((item, index) => {
269 202
             let { patient_id } = item
@@ -311,7 +244,7 @@ export default {
311 244
          this.getDialysisList()
312 245
          return false
313 246
       }else{
314
-       getPrescriptionByName(this.listQuery.search,this.listQuery.start_time,this.listQuery.end_time,this.limit,this.page).then(response=>{
247
+       getPrescriptionByName(this.patient_id,this.listQuery.start_time,this.listQuery.end_time,this.limit,this.page).then(response=>{
315 248
          if(response.data.state === 1){
316 249
            var patients =  response.data.data.patient
317 250
            this.getModeId(patients)
@@ -416,7 +349,29 @@ export default {
416 349
           patients[i].mode_id = "IUF+HD"
417 350
         }
418 351
       }
419
-    }
352
+    },
353
+     querySearchAsync(keyword, cb) {
354
+        let key = ''
355
+        if (keyword != undefined) {
356
+          key = keyword
357
+        }
358
+        let searchArray = []
359
+        PostSearch(key).then(response => {
360
+          if (response.data.state == 1) {
361
+             searchArray = response.data.data.patient
362
+             console.log("searchArray",searchArray)
363
+            cb(searchArray)
364
+          } else {
365
+            cb([])
366
+          }
367
+        })
368
+      },
369
+   handleSelect(val) {
370
+        console.log("val",val)
371
+        this.listQuery.search = val.name
372
+        this.patient_id = val.id
373
+        this.onSearch()
374
+      },
420 375
   },
421 376
   created(){
422 377
     var nowDate = new Date();

+ 0 - 3
src/xt_pages/qcd/treatmentControlAnalysis/time.vue View File

@@ -10,9 +10,6 @@
10 10
           <el-tab-pane label="患者检验检查统计" name="second"></el-tab-pane>
11 11
         </el-tabs>
12 12
         <div class="cell clearfix">
13
-          <label class="title">
14
-            <span class="name">转归状态</span> :
15
-          </label>
16 13
           <div class="time">
17 14
             <ul class>
18 15
               <li