Browse Source

bug修改

XMLWAN 4 years ago
parent
commit
3c6c7d03ba

+ 1 - 1
src/api/common/common.js View File

@@ -448,7 +448,7 @@ export function getPatientContorlAnalysis(params) {
448 448
 }
449 449
 
450 450
 export function GetQualityControl(params) {
451
-  console.log('params', params)
451
+  console.log('params', params)
452 452
   return request({
453 453
     url: '/com/api/getqualitycontrol',
454 454
     method: 'Get',

+ 2 - 2
src/xt_pages/qcd/officesControlAnalysis/project.vue View File

@@ -9,14 +9,14 @@
9 9
         <el-tab-pane label="按项目分组" name="second"></el-tab-pane>
10 10
       </el-tabs>
11 11
       <div class="cell clearfix">
12
-        <el-select v-model="lapseto" placeholder="请选择" style="width:120px;margin-right:10px" @change="changeOptions">
12
+        <!-- <el-select v-model="lapseto" placeholder="请选择" style="width:120px;margin-right:10px" @change="changeOptions">
13 13
           <el-option
14 14
             v-for="item in options"
15 15
             :key="item.value"
16 16
             :label="item.label"
17 17
             :value="item.value"
18 18
           ></el-option>
19
-        </el-select>
19
+        </el-select> -->
20 20
         <el-select v-model="type" placeholder="请选择" @change="chooseType" style="margin-right:10px">
21 21
           <el-option
22 22
             v-for="item in options1"

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

@@ -9,14 +9,14 @@
9 9
         <el-tab-pane label="按项目分组" name="second"></el-tab-pane>
10 10
       </el-tabs>
11 11
       <div class="cell clearfix">
12
-        <el-select v-model="lapseto" placeholder="请选择" style="width:120px;margin-right:10px" @change="changeLapseto">
12
+        <!-- <el-select v-model="lapseto" placeholder="请选择" style="width:120px;margin-right:10px" @change="changeLapseto">
13 13
           <el-option
14 14
             v-for="item in options"
15 15
             :key="item.value"
16 16
             :label="item.label"
17 17
             :value="item.value"
18 18
           ></el-option>
19
-        </el-select>
19
+        </el-select> -->
20 20
         <el-select v-model="type" placeholder="请选择" @change="chooseType" style="margin-right:10px">
21 21
           <el-option
22 22
             v-for="item in options1"

+ 172 - 9
src/xt_pages/qcd/patientComplianceDetails.vue View File

@@ -107,13 +107,16 @@
107 107
                 </div>
108 108
               </div>
109 109
             </div>
110
-            <div class="tableTitle">指标趋势</div>
110
+            <div class="tableTitle">指标趋势
111
+              <span style="font-weight:normal">&nbsp;&nbsp;(当前患者: {{patient_name}})</span>
112
+            </div>
111 113
             <div class="cell clearfix">
112 114
               <p class="point"></p>
113 115
               <p class="pointTitle">{{itemName}}</p>
114 116
             </div>
115 117
             <div>
116
-              <line-chart :options="chart"></line-chart>
118
+              <line-chart :options="chart" v-if="rangetype == 1"></line-chart>
119
+               <line-chart1 :options="char2" v-if="rangetype == 2"></line-chart1>
117 120
             </div>
118 121
           </div>
119 122
         </el-container>
@@ -127,16 +130,20 @@ const moment = require('moment')
127 130
 import echarts from "echarts";
128 131
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
129 132
 import LineChart from "../qcd/components/LineChart";
133
+import LineChart1 from '../qcd/components/LineChart1'
130 134
 import { uParseTime } from "@/utils/tools";
131 135
  import { PostSearch} from '@/api/patient'
132 136
 import { getCurrentOrgPatients,GetQualityControl,getNormData,getPatientComplianceDetail } from "@/api/common/common"
133 137
 export default {
134 138
   components: {
135 139
     LineChart,
136
-    BreadCrumb
140
+    BreadCrumb,
141
+    LineChart1
137 142
   },
138 143
   data() {
139 144
     return {
145
+     patient_name:"",
146
+     rangetype:1,
140 147
      itemName:"",
141 148
      isTrue:0,
142 149
       crumbs: [
@@ -174,6 +181,126 @@ export default {
174 181
       monthType: 0,
175 182
       arr: [],
176 183
       quality: 0,
184
+      char2: {
185
+          title: {
186
+            text: 'ECharts 入门示例'
187
+          },
188
+          tooltip: {},
189
+          legend: {
190
+            data: ['次数'],
191
+            left: 0
192
+          },
193
+          xAxis: {
194
+            data: [],
195
+            axisLine: {
196
+              lineStyle: {
197
+                color: '#FF0000',
198
+                width: 8 //这里是为了突出显示加上的
199
+              }
200
+            },
201
+            axisLabel: {
202
+              interval: 0,
203
+              formatter: function(value) {
204
+                var ret = '' //拼接加\n返回的类目项
205
+                var maxLength = 8 //每项显示文字个数
206
+                var valLength = value.length //X轴类目项的文字个数
207
+                var rowN = Math.ceil(valLength / maxLength) //类目项需要换行的行数
208
+                if (rowN > 1) {
209
+                  //如果类目项的文字大于3,
210
+                  for (var i = 0; i < rowN; i++) {
211
+                    var temp = '' //每次截取的字符串
212
+                    var start = i * maxLength //开始截取的位置
213
+                    var end = start + maxLength //结束截取的位置
214
+                    //这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧
215
+                    temp = value.substring(start, end) + '\n'
216
+                    ret += temp //凭借最终的字符串
217
+                  }
218
+                  return ret
219
+                } else {
220
+                  return value
221
+                }
222
+              }
223
+            }
224
+          },
225
+          yAxis: {
226
+            axisLabel: {
227
+              formatter: '{value} %'
228
+            },
229
+            show: false,
230
+            axisLine: {
231
+              lineStyle: {
232
+                color: '#00FF00',
233
+                width: 8 //这里是为了突出显示加上的
234
+              }
235
+            }
236
+          },
237
+          series: [
238
+            {
239
+              name: '',
240
+              type: 'line',
241
+              data: [],
242
+              symbol: 'circle',//折线点设置为实心点
243
+              symbolSize: 15,   //折线点的大小
244
+              barWidth: 30,
245
+              label: {
246
+                normal: {
247
+                  show: true,
248
+                  position: "top",
249
+                  formatter: (params) => {
250
+                      let str = ''
251
+                      str = this.otherData[params.dataIndex]
252
+                      return str
253
+
254
+                  }
255
+                }
256
+              },
257
+              //配置样式
258
+              itemStyle: {
259
+                //通常情况下:
260
+
261
+                //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
262
+                normal: {
263
+                  color: (params) => {
264
+                    //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
265
+                    var colorList = [
266
+                      ['#409EFF','#409EFF'],
267
+                      ['#f56c6c','#f56c6c']
268
+                      ];
269
+                    if(params.seriesName == this.otherData[params.dataIndex]){
270
+                      var index = 0 
271
+                    }else {
272
+                      var index = 1
273
+                    }
274
+                   
275
+
276
+                    // var index = params.dataIndex;
277
+                    // if (params.dataIndex >= colorList.length) {
278
+                    //   index = params.dataIndex % colorList.length;
279
+                    // }
280
+
281
+                    return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
282
+                      {offset: 0, color: colorList[index][0]},
283
+                      // { offset: 0.5, color: colorList[index][1] },
284
+                      {offset: 1, color: colorList[index][1]}
285
+                    ]);
286
+                  },
287
+                  lineStyle: {
288
+                    width:2,
289
+                    color: "#cccccc"//折线的颜色
290
+                  },
291
+                  barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
292
+                },
293
+
294
+                //鼠标悬停时:
295
+                emphasis: {
296
+                  shadowBlur: 10,
297
+                  shadowOffsetX: 0,
298
+                  shadowColor: 'rgba(0, 0, 0, 0.2)'
299
+                }
300
+              }
301
+            }
302
+          ]
303
+        },
177 304
       chart: {
178 305
         title: {
179 306
           text: "ECharts 入门示例"
@@ -255,6 +382,7 @@ export default {
255 382
       },
256 383
       inspect_date:0,
257 384
       monthActive:0,
385
+      otherData:[]
258 386
     };
259 387
   },
260 388
   methods: {
@@ -383,6 +511,7 @@ export default {
383 511
     },
384 512
     handleChange(val){
385 513
      this.patientid = val.id
514
+     this.patient_name = val.name
386 515
       this.getlistDetail()
387 516
     },
388 517
    getCurrentOrgPatients(){
@@ -392,6 +521,7 @@ export default {
392 521
             for(let i=0;i<patients.length;i++){
393 522
                if(this.patientid == patients[i].id){
394 523
                   this.$refs.singleTable.setCurrentRow(patients[i])
524
+                  this.patient_name = patients[i].name
395 525
                }
396 526
             }
397 527
             this.patientsData = patients
@@ -413,6 +543,8 @@ export default {
413 543
     getlist(){
414 544
         this.modesData.series = []
415 545
         this.modesData.xAxis = []
546
+        this.char2.xAxis.data = []
547
+        this.char2.series[0].data = []
416 548
         const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
417 549
         const endDate = moment(new Date()).format('YYYY-MM-DD')
418 550
         var now = new Date()
@@ -435,7 +567,7 @@ export default {
435 567
        GetQualityControl(params).then(response=>{
436 568
           if(response.data.state == 1){
437 569
             var list = response.data.data.list
438
-            console.log("list",list)
570
+            console.log("list是什么",list)
439 571
             for(let i=0;i<list.length;i++){
440 572
               if(parseInt(list[i].inspect_value)>= parseInt(list[i].range_min) && parseInt(list[i].inspect_value)<= parseInt(list[i].range_max)){
441 573
                     this.isTrue = 1  
@@ -443,9 +575,20 @@ export default {
443 575
                if(parseInt(list[i].inspect_value)< parseInt(list[i].range_min) || parseInt(list[i].inspect_value) > parseInt(list[i].range_max)){
444 576
                     this.isTrue =0
445 577
                }
446
-              this.modesData.xAxis.push(this.getTime(list[i].inspect_date));
447
-               this.modesData.series.push(list[i].inspect_value)
448
-            
578
+               
579
+              if(list[i].range_type == 1){
580
+                    this.rangetype = 1
581
+                    this.modesData.xAxis.push(this.getTime(list[i].inspect_date));
582
+                    this.modesData.series.push(list[i].inspect_value)
583
+                }
584
+
585
+                if(list[i].range_type == 2){
586
+                   this.rangetype = 2
587
+                   this.otherData.push(list[i].inspect_value)
588
+                   this.char2.series[0].data.push("1")
589
+                  this.char2.xAxis.data.push(this.getTime(list[i].inspect_date))
590
+                  this.char2.series[0].name = list[i].range_value
591
+                }
449 592
             }
450 593
             this.chart.series[0].data = this.modesData.series
451 594
             this.chart.xAxis.data = this.modesData.xAxis
@@ -458,6 +601,8 @@ export default {
458 601
     getlistDetail(){
459 602
        this.modesData.series = []
460 603
         this.modesData.xAxis = []
604
+        this.char2.xAxis.data = []
605
+        this.char2.series[0].data = []
461 606
         const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
462 607
         const endDate = moment(new Date()).format('YYYY-MM-DD')
463 608
 
@@ -490,8 +635,21 @@ export default {
490 635
                 if(parseInt(list[i].inspect_value)< parseInt(list[i].range_min) || parseInt(list[i].inspect_value) > parseInt(list[i].range_max)){
491 636
                       this.isTrue =0
492 637
                 }
493
-                this.modesData.xAxis.push(this.getTime(list[i].inspect_date));
494
-                this.modesData.series.push(list[i].inspect_value)
638
+
639
+                if(list[i].range_type == 1){
640
+                    this.rangetype = 1
641
+                    this.modesData.xAxis.push(this.getTime(list[i].inspect_date));
642
+                    this.modesData.series.push(list[i].inspect_value)
643
+                }
644
+
645
+                if(list[i].range_type == 2){
646
+                   this.rangetype = 2
647
+                   this.otherData.push(list[i].inspect_value)
648
+                   this.char2.series[0].data.push("1")
649
+                  this.char2.xAxis.data.push(this.getTime(list[i].inspect_date))
650
+                  this.char2.series[0].name = list[i].range_value
651
+                }
652
+              
495 653
             
496 654
             }
497 655
               this.chart.series[0].data = this.modesData.series
@@ -519,6 +677,11 @@ export default {
519 677
         console.log("val",val)
520 678
         this.listQuery.search = val.name
521 679
         this.patientid = val.id
680
+        for(let i=0;i<this.patientsData.length;i++){
681
+          if(val.id == this.patientsData[i].id){
682
+            this.$refs.singleTable.setCurrentRow(this.patientsData[i])
683
+          }
684
+         }
522 685
         this.getlistDetail()
523 686
       },
524 687
   },

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

@@ -25,14 +25,14 @@
25 25
 
26 26
             </el-form-item>
27 27
           </el-form>
28
-          <el-select v-model="lapstor" placeholder="请选择" style="margin-right:20px;width:100px">
28
+          <!-- <el-select v-model="lapstor" placeholder="请选择" style="margin-right:20px;width:100px">
29 29
             <el-option
30 30
               v-for="item in options"
31 31
               :key="item.value"
32 32
               :label="item.label"
33 33
               :value="item.value"
34 34
             ></el-option>
35
-          </el-select>
35
+          </el-select> -->
36 36
           <label class="title">
37 37
             <span class="name">日期查询</span> :
38 38
           </label>
@@ -257,11 +257,11 @@ export default {
257 257
               },
258 258
 
259 259
               //鼠标悬停时:
260
-              emphasis: {
261
-                shadowBlur: 10,
262
-                shadowOffsetX: 0,
263
-                shadowColor: "rgba(0, 0, 0, 0.2)"
264
-              }
260
+              // emphasis: {
261
+              //   shadowBlur: 10,
262
+              //   shadowOffsetX: 0,
263
+              //   shadowColor: "rgba(0, 0, 0, 0.2)"
264
+              // }
265 265
             }
266 266
           }
267 267
         ]
@@ -649,7 +649,7 @@ export default {
649 649
        getCartogramlist(this.lapstor,this.listQuery.start_time,this.listQuery.end_time,this.limit,this.page).then(response=>{
650 650
            if(response.data.state == 1){
651 651
               var cartogramlist =  response.data.data.cartogramlist
652
-              // console.log("cartogramlist",cartogramlist)
652
+               console.log("cartogramlist",cartogramlist)
653 653
               var totaltwo =  response.data.data.total
654 654
               // console.log("totaltwo",totaltwo)
655 655
               var infectiouscontrol =  response.data.data.infectiouscontrol
@@ -667,14 +667,6 @@ export default {
667 667
                    }
668 668
                 }
669 669
               }
670
-            //  console.log("cart",cart)
671
-
672
-              //  for(let i=0;i<cartogramlist.length;i++){
673
-              //     if(cartogramlist[i].inspect_value != ''){
674
-              //       cart.push(cartogramlist[i])
675
-              //     }
676
-              //  }
677
-              // console.log("cart",cart)
678 670
                let dataInfo = {}
679 671
                 cart.forEach((item, index) => {
680 672
                   let { patient_id } = item

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

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div class="page_timeAll">
3 3
     <div class="cell clearfix">
4
-      <el-select
4
+      <!-- <el-select
5 5
         v-model="listQuery.value"
6 6
         placeholder="请选择"
7 7
         style="width:120px;margin-right:20px"
@@ -13,7 +13,7 @@
13 13
           :label="item.label"
14 14
           :value="item.value"
15 15
         ></el-option>
16
-      </el-select>
16
+      </el-select> -->
17 17
       <label class="title">
18 18
         <span class="name">日期查询</span> :
19 19
       </label>