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
e673fcfd19

+ 2 - 3
src/xt_pages/qcd/indicatorControlAnalysis/components/office.vue View File

75
       <el-table :data="tableData" style="width: 100%" :height="tableHeight">
75
       <el-table :data="tableData" style="width: 100%" :height="tableHeight">
76
 
76
 
77
 
77
 
78
-        <el-table-column label="姓名" align="center">
78
+        <el-table-column fixed label="姓名" align="center">
79
           <template slot-scope="scope">
79
           <template slot-scope="scope">
80
             {{scope.row.patient.name}}
80
             {{scope.row.patient.name}}
81
           </template>
81
           </template>
82
         </el-table-column>
82
         </el-table-column>
83
 
83
 
84
-        <el-table-column fixed label="检查日期" align="center">
84
+        <el-table-column  label="检查日期" align="center">
85
           <template slot-scope="scope">
85
           <template slot-scope="scope">
86
             <!--{{getTime(scope.row.inspect_date)}}-->
86
             <!--{{getTime(scope.row.inspect_date)}}-->
87
             {{scope.row.inspect_date | parseTime('{y}-{m}-{d}') }}
87
             {{scope.row.inspect_date | parseTime('{y}-{m}-{d}') }}
474
                 this.tableData.push(resp.data.data[i])
474
                 this.tableData.push(resp.data.data[i])
475
               }
475
               }
476
               this.total = resp.data.total
476
               this.total = resp.data.total
477
-              console.log(this.total)
478
 
477
 
479
             } else {
478
             } else {
480
               this.$toast({
479
               this.$toast({

+ 15 - 1
src/xt_pages/qcd/indicatorControlAnalysis/components/personal.vue View File

141
     },
141
     },
142
     data() {
142
     data() {
143
       return {
143
       return {
144
+        percent:[],
145
+
144
         pickerOptions: {
146
         pickerOptions: {
145
           disabledDate(time) {
147
           disabledDate(time) {
146
             let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear() - 1)).getTime() - 24 * 3600 * 1000
148
             let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear() - 1)).getTime() - 24 * 3600 * 1000
197
                 normal: {
199
                 normal: {
198
                   show: true,
200
                   show: true,
199
                   position: 'top',
201
                   position: 'top',
200
-                  formatter: '{c}'
202
+                  formatter: (params) => {
203
+                    if(this.percent.length > 0){
204
+                      let str = ''
205
+                      str = params.data + '('+ this.percent[params.dataIndex] +'%)'
206
+                      return str
207
+                    }else{
208
+                      let str = ''
209
+                      str = params.data
210
+                      return str
211
+                    }
212
+                  }
201
                 }
213
                 }
202
               },
214
               },
203
               //配置样式
215
               //配置样式
568
               for (let i = 0; i < resp.data.data.length; i++) {
580
               for (let i = 0; i < resp.data.data.length; i++) {
569
                 this.options.xAxis.data.push(resp.data.data[i].name)
581
                 this.options.xAxis.data.push(resp.data.data[i].name)
570
                 this.options.series[0].data.push(resp.data.data[i].total)
582
                 this.options.series[0].data.push(resp.data.data[i].total)
583
+                this.percent.push(resp.data.data[i].ratio)
584
+
571
               }
585
               }
572
 
586
 
573
             } else {
587
             } else {

+ 1 - 1
src/xt_pages/qcd/indicatorControlAnalysis/weightDetails.vue View File

356
           if (resp.state == 1) {
356
           if (resp.state == 1) {
357
             for (let i = 0; i < resp.data.data.length; i++) {
357
             for (let i = 0; i < resp.data.data.length; i++) {
358
               this.chart.xAxis.data.push(resp.data.data[i].date)
358
               this.chart.xAxis.data.push(resp.data.data[i].date)
359
-              this.chart.series[0].data.push(resp.data.data[i].value)
359
+              this.chart.series[0].data.push(parseFloat(resp.data.data[i].value).toFixed(1))
360
             }
360
             }
361
           } else {
361
           } else {
362
           }
362
           }

+ 23 - 1
src/xt_pages/qcd/workAnalysis/doctor.vue View File

132
   },
132
   },
133
   data() {
133
   data() {
134
     return {
134
     return {
135
+      percent:[],
136
+
135
       pickerOptions: {
137
       pickerOptions: {
136
         disabledDate(time) {
138
         disabledDate(time) {
137
           let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
139
           let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
200
               normal: {
202
               normal: {
201
                 show: true,
203
                 show: true,
202
                 position: "top",
204
                 position: "top",
203
-                formatter: "{c}人次"
205
+                formatter: (params) => {
206
+                  if(this.percent.length > 0){
207
+                    let str = ''
208
+                    str = params.data + '('+ this.percent[params.dataIndex] +'%)'
209
+                    return str
210
+                  }else{
211
+                    let str = ''
212
+                    str = params.data
213
+                    return str
214
+                  }
215
+                }
204
               }
216
               }
205
             },
217
             },
206
             //配置样式
218
             //配置样式
300
 
312
 
301
         })
313
         })
302
     },
314
     },
315
+    getTimestamp(time) {
316
+      // 把时间日期转成时间戳
317
+      return new Date(time).getTime() / 1000;
318
+    },
303
     changeTime(val) {
319
     changeTime(val) {
304
       var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time);
320
       var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time);
305
       if (time > 0) {
321
       if (time > 0) {
327
               if(this.query.statistics_type == 1){
343
               if(this.query.statistics_type == 1){
328
 
344
 
329
                 this.bar.series[0].data.push(resp.data.data[i].p_count)
345
                 this.bar.series[0].data.push(resp.data.data[i].p_count)
346
+                this.percent.push(resp.data.data[i].p_ratio)
347
+
330
 
348
 
331
               }else if(this.query.statistics_type == 2){
349
               }else if(this.query.statistics_type == 2){
332
                 this.bar.series[0].data.push(resp.data.data[i].course_count)
350
                 this.bar.series[0].data.push(resp.data.data[i].course_count)
351
+                this.percent.push(resp.data.data[i].course_ratio)
352
+
333
 
353
 
334
               }else if(this.query.statistics_type == 3){
354
               }else if(this.query.statistics_type == 3){
335
                 this.bar.series[0].data.push(resp.data.data[i].rescue_count)
355
                 this.bar.series[0].data.push(resp.data.data[i].rescue_count)
356
+                this.percent.push(resp.data.data[i].rescue_ratio)
357
+
336
 
358
 
337
               }
359
               }
338
             }
360
             }

+ 20 - 1
src/xt_pages/qcd/workAnalysis/nurse.vue View File

175
     },
175
     },
176
     data() {
176
     data() {
177
       return {
177
       return {
178
+        percent:[],
178
         pickerOptions: {
179
         pickerOptions: {
179
           disabledDate(time) {
180
           disabledDate(time) {
180
             let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
181
             let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
244
                 normal: {
245
                 normal: {
245
                   show: true,
246
                   show: true,
246
                   position: "top",
247
                   position: "top",
247
-                  formatter: "{c}人次"
248
+                  formatter: (params) => {
249
+                    if(this.percent.length > 0){
250
+                      let str = ''
251
+                      str = params.data + '('+ this.percent[params.dataIndex] +'%)'
252
+                      return str
253
+                    }else{
254
+                      let str = ''
255
+                      str = params.data
256
+                      return str
257
+                    }
258
+                  }
248
                 }
259
                 }
249
               },
260
               },
250
               //配置样式
261
               //配置样式
344
 
355
 
345
           })
356
           })
346
       },
357
       },
358
+      getTimestamp(time) {
359
+        // 把时间日期转成时间戳
360
+        return new Date(time).getTime() / 1000;
361
+      },
347
       changeTime(val) {
362
       changeTime(val) {
348
         var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time);
363
         var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time);
349
         if (time > 0) {
364
         if (time > 0) {
371
                 if(this.query.statistics_type == 1){
386
                 if(this.query.statistics_type == 1){
372
 
387
 
373
                   this.bar.series[0].data.push(resp.data.data[i].puncture_count)
388
                   this.bar.series[0].data.push(resp.data.data[i].puncture_count)
389
+                  this.percent.push(resp.data.data[i].puncture_ratio)
374
 
390
 
375
                 }else if(this.query.statistics_type == 2){
391
                 }else if(this.query.statistics_type == 2){
376
 
392
 
377
                   this.bar.series[0].data.push(resp.data.data[i].change_medicine_count)
393
                   this.bar.series[0].data.push(resp.data.data[i].change_medicine_count)
394
+                  this.percent.push(resp.data.data[i].change_medicine_ratio)
378
 
395
 
379
 
396
 
380
                 }else if(this.query.statistics_type == 3){
397
                 }else if(this.query.statistics_type == 3){
381
                   this.bar.series[0].data.push(resp.data.data[i].cure_count)
398
                   this.bar.series[0].data.push(resp.data.data[i].cure_count)
399
+                  this.percent.push(resp.data.data[i].cure_ratio)
382
 
400
 
383
                 }else if(this.query.statistics_type == 4){
401
                 }else if(this.query.statistics_type == 4){
384
                   this.bar.series[0].data.push(resp.data.data[i].mission_count)
402
                   this.bar.series[0].data.push(resp.data.data[i].mission_count)
403
+                  this.percent.push(resp.data.data[i].mission_ratio)
385
 
404
 
386
                 }
405
                 }
387
               }
406
               }