Browse Source

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

csx 4 years ago
parent
commit
31a9bb28f0

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

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
   const params = {
262
   const params = {
263
-    keyword: keyword,
263
+    patientid: patientid,
264
     startime: startime,
264
     startime: startime,
265
     endtime: endtime,
265
     endtime: endtime,
266
     limit: limit,
266
     limit: limit,
267
     page: page
267
     page: page
268
   }
268
   }
269
+  console.log('params', params)
269
   return request({
270
   return request({
270
     url: '/com/api/getprescriptionbyname',
271
     url: '/com/api/getprescriptionbyname',
271
     method: 'Get',
272
     method: 'Get',
299
     startime: startime,
300
     startime: startime,
300
     endtime: endtime
301
     endtime: endtime
301
   }
302
   }
302
-  console.log('startime', params)
303
   return request({
303
   return request({
304
     url: '/com/api/getinspectionDetailById',
304
     url: '/com/api/getinspectionDetailById',
305
     method: 'get',
305
     method: 'get',
307
   })
307
   })
308
 }
308
 }
309
 
309
 
310
-export function getSearchPatientInfo(keyword, startime, endtime) {
310
+export function getSearchPatientInfo(patientid, startime, endtime) {
311
   const params = {
311
   const params = {
312
-    keyword: keyword,
312
+    patientid: patientid,
313
     startime: startime,
313
     startime: startime,
314
     endtime: endtime
314
     endtime: endtime
315
   }
315
   }
449
     params: params
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 - 6
src/router/modules/qcd.js View File

259
         noCache: true
259
         noCache: true
260
       }
260
       }
261
     },
261
     },
262
-
263
     {
262
     {
264
       path: '/qcd/patientanalysis/checkStatistical',
263
       path: '/qcd/patientanalysis/checkStatistical',
265
       hidden: true,
264
       hidden: true,
395
         title: '口服药',
394
         title: '口服药',
396
         noCache: true
395
         noCache: true
397
       }
396
       }
398
-    },  {
399
-      path: "/qcd/inspection/detail",
397
+    }, {
398
+      path: '/qcd/inspection/detail',
400
       hidden: true,
399
       hidden: true,
401
       is_menu: false,
400
       is_menu: false,
402
       component: () =>
401
       component: () =>
403
-        import("@/xt_pages/qcd/indicatorControlAnalysis/patientInspectionDetail"),
404
-      name: "patientInspectionDetail",
402
+        import('@/xt_pages/qcd/indicatorControlAnalysis/patientInspectionDetail'),
403
+      name: 'patientInspectionDetail',
405
       meta: {
404
       meta: {
406
-        title: "化验指标详情",
405
+        title: '化验指标详情',
407
         noCache: true
406
         noCache: true
408
       }
407
       }
409
     }
408
     }

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

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

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

40
             align="right"
40
             align="right"
41
             format="yyyy-MM-dd"
41
             format="yyyy-MM-dd"
42
             value-format="yyyy-MM-dd"
42
             value-format="yyyy-MM-dd"
43
+            :picker-options="pickerOptions"
43
           ></el-date-picker>
44
           ></el-date-picker>
44
           <span class>-</span>
45
           <span class>-</span>
45
           <el-date-picker
46
           <el-date-picker
53
             align="right"
54
             align="right"
54
             format="yyyy-MM-dd"
55
             format="yyyy-MM-dd"
55
             value-format="yyyy-MM-dd"
56
             value-format="yyyy-MM-dd"
57
+            :picker-options="pickerOptions"
56
           ></el-date-picker>
58
           ></el-date-picker>
57
         </div>
59
         </div>
58
       </div>
60
       </div>
59
       <div class="cell clearfix">
61
       <div class="cell clearfix">
60
-        <div class="time newLi" v-if="type == '按季度对比统计'">
62
+        <div class="time newLi" v-if="type == '按季度统计对比'">
61
           <ul class>
63
           <ul class>
62
             <li
64
             <li
63
               :class="item.state == quarterType ? 'active' : ''"
65
               :class="item.state == quarterType ? 'active' : ''"
67
             >{{ item.label }}</li>
69
             >{{ item.label }}</li>
68
           </ul>
70
           </ul>
69
         </div>
71
         </div>
70
-        <div class="time newLi" v-if="type == '按月份对比统计'">
72
+        <div class="time newLi" v-if="type == '按月份统计对比'">
71
           <ul class>
73
           <ul class>
72
             <li
74
             <li
73
               :class="item.state == monthType ? 'active' : ''"
75
               :class="item.state == monthType ? 'active' : ''"
110
   },
112
   },
111
   data() {
113
   data() {
112
     return {
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
       modetype:0,
121
       modetype:0,
114
       startime:"",
122
       startime:"",
115
       endtime:"",
123
       endtime:"",
148
       value: "请选项",
156
       value: "请选项",
149
       options1: [
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
           value: "自定义",
167
           value: "自定义",
193
           left: 0
201
           left: 0
194
         },
202
         },
195
         xAxis: {
203
         xAxis: {
196
-          data: ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
204
+          data: []
197
         },
205
         },
198
         yAxis: {
206
         yAxis: {
199
           axisLabel: {
207
           axisLabel: {
205
           {
213
           {
206
             name: "次数",
214
             name: "次数",
207
             type: "bar",
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
             barWidth: 30,
217
             barWidth: 30,
220
             label: {
218
             label: {
221
               normal: {
219
               normal: {
322
     },
320
     },
323
     chooseType(val) {
321
     chooseType(val) {
324
       this.type = val;
322
       this.type = val;
325
-      if(val == "按月份对比统计"){
323
+      if(val == "按月份统计对比"){
326
          this.modetype = 0
324
          this.modetype = 0
327
         
325
         
328
       }
326
       }
329
-       if(val == "按季度对比统计"){
327
+       if(val == "按季度统计对比"){
330
          this.modetype = 1
328
          this.modetype = 1
331
          
329
          
332
       }
330
       }

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

8
         <div class="cell clearfix">
8
         <div class="cell clearfix">
9
           <el-form :inline="true" :model="listQuery">
9
           <el-form :inline="true" :model="listQuery">
10
             <el-form-item label>
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
             </el-form-item>
28
             </el-form-item>
14
           </el-form>
29
           </el-form>
15
           <el-select v-model="lapstor" placeholder="请选择" style="margin-right:20px;width:100px">
30
           <el-select v-model="lapstor" placeholder="请选择" style="margin-right:20px;width:100px">
109
 </template>
124
 </template>
110
 
125
 
111
 <script>
126
 <script>
127
+import { PostSearch} from '@/api/patient'
112
 import echarts from "echarts";
128
 import echarts from "echarts";
113
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
129
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
114
 import LineChart from "../qcd/components/LineChart";
130
 import LineChart from "../qcd/components/LineChart";
242
       dataCount:[
258
       dataCount:[
243
          {id:0,count:0},
259
          {id:0,count:0},
244
          {id:1,count:0}
260
          {id:1,count:0}
245
-      ]
261
+      ],
262
+      patient_id:0,
246
     };
263
     };
247
   },
264
   },
248
   methods: {
265
   methods: {
321
     onSearch(){
338
     onSearch(){
322
          const params = {
339
          const params = {
323
             lapstor:this.lapstor,
340
             lapstor:this.lapstor,
324
-            keyword:this.listQuery.search,
341
+            patientid:this.patient_id,
325
             startime:this.listQuery.start_time,
342
             startime:this.listQuery.start_time,
326
             endtime:this.listQuery.end_time,
343
             endtime:this.listQuery.end_time,
327
 
344
 
328
          }
345
          }
329
-         console.log("params",params)
330
        getPatientContorlAnalysis(params).then(response=>{
346
        getPatientContorlAnalysis(params).then(response=>{
331
            if(response.data.state == 1){
347
            if(response.data.state == 1){
332
               var control = response.data.data.patientcontorDetail
348
               var control = response.data.data.patientcontorDetail
541
               item.data = newarr
557
               item.data = newarr
542
              // console.log(1111111111,item.data)
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
                     cart.push(cartogramlist[i])
600
                     cart.push(cartogramlist[i])
585
                   }
601
                   }
586
                }
602
                }
587
-               console.log("cart",cart)
603
+              //  console.log("cart",cart)
588
                let dataInfo = {}
604
                let dataInfo = {}
589
                 cart.forEach((item, index) => {
605
                 cart.forEach((item, index) => {
590
                   let { patient_id } = item
606
                   let { patient_id } = item
599
                   }
615
                   }
600
                 })
616
                 })
601
               let list = Object.values(dataInfo)
617
               let list = Object.values(dataInfo)
602
-              console.log("list",list)
618
+              // console.log("list",list)
603
 
619
 
604
               var arr = []
620
               var arr = []
605
               list.map(item=>{
621
               list.map(item=>{
618
                    arr.push(it)
634
                    arr.push(it)
619
                 })
635
                 })
620
              })
636
              })
621
-              console.log("arr",arr)
637
+              // console.log("arr",arr)
622
 
638
 
623
              var arrtwo = []
639
              var arrtwo = []
624
              for(let i=0;i<arr.length;i++){
640
              for(let i=0;i<arr.length;i++){
626
                   arrtwo.push(arr[i])
642
                   arrtwo.push(arr[i])
627
                }
643
                }
628
              }
644
              }
629
-             console.log("arrtwo",arrtwo)
645
+            //  console.log("arrtwo",arrtwo)
630
 
646
 
631
              let objinfo = {}
647
              let objinfo = {}
632
                 arrtwo.forEach((item, index) => {
648
                 arrtwo.forEach((item, index) => {
649
                     }
665
                     }
650
                  }
666
                  }
651
               })
667
               })
652
-              console.log("newlist",newlist)
668
+              // console.log("newlist",newlist)
653
               newlist.map(item=>{
669
               newlist.map(item=>{
654
                   item.child.map(it=>{
670
                   item.child.map(it=>{
655
                     if(parseInt(it.range_min)<= parseInt(it.inspect_value) && parseInt(it.inspect_value)<=parseInt(it.range_max )){
671
                     if(parseInt(it.range_min)<= parseInt(it.inspect_value) && parseInt(it.inspect_value)<=parseInt(it.range_max )){
657
                     }
673
                     }
658
                   })
674
                   })
659
               })
675
               })
660
-              console.log("newlist",newlist)
676
+              // console.log("newlist",newlist)
661
 
677
 
662
 
678
 
663
               var newtotal = 0
679
               var newtotal = 0
669
                     }
685
                     }
670
                  }
686
                  }
671
               })
687
               })
672
-             console.log("newtotal",newtotal)
688
+            //  console.log("newtotal",newtotal)
673
              var totalCount = totaltwo - newtotal
689
              var totalCount = totaltwo - newtotal
674
-              console.log("totalCount",totaltwo)
690
+              // console.log("totalCount",totaltwo)
675
              for(let i=0;i<this.dataName.length;i++){
691
              for(let i=0;i<this.dataName.length;i++){
676
                 this.modesData.xAxis.push(this.dataName[i].name);
692
                 this.modesData.xAxis.push(this.dataName[i].name);
677
              }
693
              }
695
             this.patientsArr =  response.data.data.patients
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
   created(){
737
   created(){
702
     var nowDate = new Date();
738
     var nowDate = new Date();

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

192
 
192
 
193
     //编辑
193
     //编辑
194
     handleEdit(id) {
194
     handleEdit(id) {
195
-      console.log("id",id)
196
       this.editDialog = true;
195
       this.editDialog = true;
197
       getConfigurationDetail(id).then(response=>{
196
       getConfigurationDetail(id).then(response=>{
198
          if(response.data.state == 1){
197
          if(response.data.state == 1){
235
     },
234
     },
236
     changeInspectionTwo(id){
235
     changeInspectionTwo(id){
237
       this.InspectionMinorTwo = []
236
       this.InspectionMinorTwo = []
237
+      this.editform.inspectionMinor = ""
238
        getInspectionMinor(id).then(response=>{
238
        getInspectionMinor(id).then(response=>{
239
         if(response.data.state == 1){
239
         if(response.data.state == 1){
240
          var inspection =  response.data.data.inspection
240
          var inspection =  response.data.data.inspection
294
               configurationlist[i].sort = ""
294
               configurationlist[i].sort = ""
295
             }
295
             }
296
           }
296
           }
297
-          //console.log("列表",configurationlist)
297
+          console.log("列表",configurationlist)
298
           this.configuraData = configurationlist
298
           this.configuraData = configurationlist
299
           var total = response.data.data.total
299
           var total = response.data.data.total
300
          // console.log("total",total)
300
          // console.log("total",total)
321
         var sort = parseInt(sorts)
321
         var sort = parseInt(sorts)
322
         this.editform.sort = sort
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
           <el-tab-pane label="患者检验检查统计" name="second"></el-tab-pane>
10
           <el-tab-pane label="患者检验检查统计" name="second"></el-tab-pane>
11
         </el-tabs>
11
         </el-tabs>
12
         <div class="cell clearfix">
12
         <div class="cell clearfix">
13
-          <label class="title">
14
-            <span class="name">转归状态</span> :
15
-          </label>
16
           <div class="time">
13
           <div class="time">
17
             <ul class>
14
             <ul class>
18
               <li
15
               <li

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

3
     <div class="cell clearfix">
3
     <div class="cell clearfix">
4
       <el-form :inline="true" :model="listQuery">
4
       <el-form :inline="true" :model="listQuery">
5
         <el-form-item label>
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
         </el-form-item>
22
         </el-form-item>
9
       </el-form>
23
       </el-form>
10
       <label class="title">
24
       <label class="title">
90
 
104
 
91
 
105
 
92
 <script>
106
 <script>
107
+  import { PostSearch} from '@/api/patient'
93
   import {getCurrentOrgPatients,getAllMajorInspection,getPatientList,getPatientDetailCheck,SearchDetailCheck } from "@/api/common/common"
108
   import {getCurrentOrgPatients,getAllMajorInspection,getPatientList,getPatientDetailCheck,SearchDetailCheck } from "@/api/common/common"
94
 export default {
109
 export default {
95
   data() {
110
   data() {
106
       total:0,
121
       total:0,
107
       tableName:[],
122
       tableName:[],
108
       ObjectData:{},
123
       ObjectData:{},
124
+      patient_id:0,
125
+      patient_name:"",
109
     };
126
     };
110
   },
127
   },
111
   methods: {
128
   methods: {
122
       }
139
       }
123
     },
140
     },
124
     onSearch(){
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
           if(response.data.state === 1){
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
             for(let i=0;i<checkDetail.length;i++){
147
             for(let i=0;i<checkDetail.length;i++){
130
               for(let j=0;j<this.tableName.length;j++){
148
               for(let j=0;j<this.tableName.length;j++){
131
                  if(checkDetail[i].ProjectId == this.tableName[j].inspection_major){
149
                  if(checkDetail[i].ProjectId == this.tableName[j].inspection_major){
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
     },
314
     },
296
    arrayToObj(arr){
315
    arrayToObj(arr){
297
       return Object.assign({},arr);
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
   created(){
340
   created(){
301
      var nowDate = new Date();
341
      var nowDate = new Date();

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

3
     <div class="cell clearfix">
3
     <div class="cell clearfix">
4
       <el-form :inline="true" :model="listQuery">
4
       <el-form :inline="true" :model="listQuery">
5
         <el-form-item label>
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
         </el-form-item>
22
         </el-form-item>
9
       </el-form>
23
       </el-form>
10
       <label class="title">
24
       <label class="title">
67
 
81
 
68
 
82
 
69
 <script>
83
 <script>
84
+import { PostSearch} from '@/api/patient'
70
 import echarts from "echarts";
85
 import echarts from "echarts";
71
 import LineChart from "../../components/LineChart";
86
 import LineChart from "../../components/LineChart";
72
 import { getCurrentOrgPatients,getInspectionTotalCount,getInspectionDetailById,getSearchPatientInfo } from "@/api/common/common";
87
 import { getCurrentOrgPatients,getInspectionTotalCount,getInspectionDetailById,getSearchPatientInfo } from "@/api/common/common";
178
         xAxis: [],
193
         xAxis: [],
179
         series: []
194
         series: []
180
       },
195
       },
181
-      obj:[]
196
+      obj:[],
197
+      patient_id:0,
182
     };
198
     };
183
   },
199
   },
184
   methods: {
200
   methods: {
290
        getInspectionDetailById(val.id,this.listQuery.start_time,this.listQuery.end_time).then(response=>{
306
        getInspectionDetailById(val.id,this.listQuery.start_time,this.listQuery.end_time).then(response=>{
291
           if(response.data.state === 1){
307
           if(response.data.state === 1){
292
             var patientdetail = response.data.data.patientdetail
308
             var patientdetail = response.data.data.patientdetail
293
-
309
+            console.log("patientdetail",patientdetail)
294
             var arr=[]
310
             var arr=[]
295
             for(let i=0;i<this.tableData.length;i++){
311
             for(let i=0;i<this.tableData.length;i++){
296
               for(let j=0;j<patientdetail.length;j++){
312
               for(let j=0;j<patientdetail.length;j++){
322
 
338
 
323
     //搜索功能
339
     //搜索功能
324
     onSearch(){
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
          if(response.data.state  === 1){
344
          if(response.data.state  === 1){
327
            var PatientsInfo = response.data.data.PatientsInfo
345
            var PatientsInfo = response.data.data.PatientsInfo
328
-          
346
+           console.log("patientsInfo",PatientsInfo)
329
            var arr = []
347
            var arr = []
330
            for(let i=0;i<this.tableData.length;i++){
348
            for(let i=0;i<this.tableData.length;i++){
331
              for(let j=0;j<PatientsInfo.length;j++){
349
              for(let j=0;j<PatientsInfo.length;j++){
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
         }
393
         }
361
         return result;
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
   created(){
419
   created(){
365
     var nowDate = new Date();
420
     var nowDate = new Date();

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

101
 <script>
101
 <script>
102
 import echarts from "echarts";
102
 import echarts from "echarts";
103
 import LineChart from "../../components/LineChart";
103
 import LineChart from "../../components/LineChart";
104
-import {geStatistics} from "@/api/common/common"
104
+import {geStatistics,getTreatlist} from "@/api/common/common"
105
 export default {
105
 export default {
106
   components: {
106
   components: {
107
     LineChart
107
     LineChart
247
       this.geStatistics();
247
       this.geStatistics();
248
     },
248
     },
249
     handleCurrentChange(page) {
249
     handleCurrentChange(page) {
250
+      this.tableData = []
250
       this.listQuery.page = page;
251
       this.listQuery.page = page;
251
       this.geStatistics();
252
       this.geStatistics();
252
     },
253
     },
253
    selectChange(val){
254
    selectChange(val){
255
+     this.tableData=[]
254
      this.listQuery.value =val
256
      this.listQuery.value =val
255
      this.geStatistics()
257
      this.geStatistics()
258
+     this.getlist()
256
    },
259
    },
257
-    geStatistics(){
260
+   getlist(){
258
       this.modesData.series = []
261
       this.modesData.series = []
259
       this.modesData.xAxis = []
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
       geStatistics(this.listQuery).then(response=>{
290
       geStatistics(this.listQuery).then(response=>{
261
         if(response.data.state === 1){
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
           var dd = {};
320
           var dd = {};
265
           for (const index in dtd) {
321
           for (const index in dtd) {
266
             if (!(dtd[index].date in dd)) {
322
             if (!(dtd[index].date in dd)) {
270
               dd[dtd[index].date][dtd[index].mode_id] = dtd[index];
326
               dd[dtd[index].date][dtd[index].mode_id] = dtd[index];
271
             }
327
             }
272
           }
328
           }
273
-          console.log("ddd",dd)
274
           for (const key in dd) {
329
           for (const key in dd) {
275
             var total = 0;
330
             var total = 0;
276
             for (const mkey in this.modeOptions) {
331
             for (const mkey in this.modeOptions) {
292
             }
347
             }
293
             this.tableData.push({ date: key, data: dd[key], total: total });
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
   created(){
355
   created(){
331
     this.modeOptions = this.$store.getters.treatment_mode;
356
     this.modeOptions = this.$store.getters.treatment_mode;
332
-    console.log("-----",this.modeOptions)
333
     var nowDate = new Date();
357
     var nowDate = new Date();
334
     var nowYear = nowDate.getFullYear();
358
     var nowYear = nowDate.getFullYear();
335
     var nowMonth = nowDate.getMonth() + 1;
359
     var nowMonth = nowDate.getMonth() + 1;
350
       (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
374
       (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
351
       "-" +
375
       "-" +
352
       (nowDay < 10 ? "0" + nowDay : nowDay);
376
       (nowDay < 10 ? "0" + nowDay : nowDay);
377
+      //获取柱状图数据
378
+      this.getlist()
353
       //获取统计列表数据
379
       //获取统计列表数据
354
       this.geStatistics()
380
       this.geStatistics()
355
-      console.log("activeModes",this.activeModes)
356
   },
381
   },
357
   computed: {
382
   computed: {
358
     activeModes: function() {
383
     activeModes: function() {

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

3
     <div class="cell clearfix">
3
     <div class="cell clearfix">
4
       <el-form :inline="true" :model="listQuery">
4
       <el-form :inline="true" :model="listQuery">
5
         <el-form-item label>
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
         </el-form-item>
22
         </el-form-item>
9
       </el-form>
23
       </el-form>
10
       <label class="title">
24
       <label class="title">
98
 
112
 
99
 
113
 
100
 <script>
114
 <script>
115
+ import { PostSearch} from '@/api/patient'
101
  import { getCurrentOrgPatients,getDialysisList,getDialysisDetailById,getPrescriptionByName } from "@/api/common/common";
116
  import { getCurrentOrgPatients,getDialysisList,getDialysisDetailById,getPrescriptionByName } from "@/api/common/common";
102
  import { uParseTime } from "@/utils/tools";
117
  import { uParseTime } from "@/utils/tools";
103
 export default {
118
 export default {
124
           return time.getTime() > Date.now() || time.getTime() < threeMonths;;
139
           return time.getTime() > Date.now() || time.getTime() < threeMonths;;
125
         }
140
         }
126
       }, 
141
       }, 
142
+      patient_id:0,
127
     };
143
     };
128
   },
144
   },
129
   methods: {
145
   methods: {
173
     getDialysisList(){
189
     getDialysisList(){
174
       getDialysisList(this.listQuery.start_time,this.listQuery.end_time,this.listQuery.page,this.listQuery.limit).then(response=>{
190
       getDialysisList(this.listQuery.start_time,this.listQuery.end_time,this.listQuery.page,this.listQuery.limit).then(response=>{
175
          if(response.data.state === 1){
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
           var list = response.data.data.list
192
           var list = response.data.data.list
252
-          //console.log("list",list)
193
+          console.log("list",list)
253
           var totallist  =  response.data.data.totallist
194
           var totallist  =  response.data.data.totallist
254
-         // console.log("totallist",totallist)
195
+           console.log("totallist",totallist)
255
           this.total = totallist  
196
           this.total = totallist  
256
           var prescriptionList = response.data.data.prescriptionList
197
           var prescriptionList = response.data.data.prescriptionList
257
           this.getModeId(prescriptionList)
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
           let dataInfo = {}
200
           let dataInfo = {}
268
           list.forEach((item, index) => {
201
           list.forEach((item, index) => {
269
             let { patient_id } = item
202
             let { patient_id } = item
311
          this.getDialysisList()
244
          this.getDialysisList()
312
          return false
245
          return false
313
       }else{
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
          if(response.data.state === 1){
248
          if(response.data.state === 1){
316
            var patients =  response.data.data.patient
249
            var patients =  response.data.data.patient
317
            this.getModeId(patients)
250
            this.getModeId(patients)
416
           patients[i].mode_id = "IUF+HD"
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
   created(){
376
   created(){
422
     var nowDate = new Date();
377
     var nowDate = new Date();

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

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