Browse Source

bug修改

XMLWAN 4 years ago
parent
commit
239aa77632

+ 8 - 0
src/api/common/common.js View File

@@ -458,3 +458,11 @@ export function getTreatlist(params) {
458 458
     params: params
459 459
   })
460 460
 }
461
+
462
+export function getPatientComplianceDetail(params) {
463
+  return request({
464
+    url: '/com/api/getpatientcompliancedetal',
465
+    method: 'Get',
466
+    params: params
467
+  })
468
+}

+ 75 - 39
src/xt_pages/qcd/patientComplianceDetails.vue View File

@@ -7,10 +7,6 @@
7 7
       <div class="page_patientComplianceDetails">
8 8
         <div class="cell clearfix" style="margin:0">
9 9
           <el-form :inline="true" :model="listQuery">
10
-<!--            <el-form-item label>-->
11
-<!--              <el-input v-model.trim="listQuery.search" placeholder="姓名/透析号" style="width:150px"></el-input>-->
12
-<!--              <el-button type="primary" @click="onSearch" icon="el-icon-search">搜索</el-button>-->
13
-<!--            </el-form-item>-->
14 10
           </el-form>
15 11
         </div>
16 12
         <el-container>
@@ -86,9 +82,8 @@
86 82
                   @click="clickQuality(index,item.inspection_minor)"
87 83
                 >
88 84
                   <p>{{ item.item_name }}</p>
89
-                  <i class="iconfont icon-gou gou"></i>
90
-<!--                  <i class="iconfont icon-gantanhao gth" v-if="index % 2 == 0"></i>-->
91
-<!--                  <i class="iconfont icon-gou gou" v-else></i>-->
85
+                   <span v-if="isTrue == 1"><i class="iconfont icon-gou gou"></i></span>
86
+                   <span v-if="isTrue == 0"><i class="iconfont icon-gantanhao gth"></i></span>
92 87
                 </div>
93 88
               </div>
94 89
             </div>
@@ -109,7 +104,7 @@ import echarts from "echarts";
109 104
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
110 105
 import LineChart from "../qcd/components/LineChart";
111 106
 import { uParseTime } from "@/utils/tools";
112
-import { getCurrentOrgPatients,GetQualityControl,getNormData } from "@/api/common/common"
107
+import { getCurrentOrgPatients,GetQualityControl,getNormData,getPatientComplianceDetail } from "@/api/common/common"
113 108
 export default {
114 109
   components: {
115 110
     LineChart,
@@ -117,6 +112,7 @@ export default {
117 112
   },
118 113
   data() {
119 114
     return {
115
+     isTrue:0,
120 116
       crumbs: [
121 117
         { path: false, name: "质控管理" },
122 118
         { path: false, name: "患者达标详情" }
@@ -162,7 +158,7 @@ export default {
162 158
           left: 0
163 159
         },
164 160
         xAxis: {
165
-          data: ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
161
+          data: []
166 162
         },
167 163
         yAxis: {
168 164
           axisLabel: {
@@ -174,17 +170,7 @@ export default {
174 170
           {
175 171
             name: "次数",
176 172
             type: "line",
177
-            data: [
178
-              "78.57",
179
-              "50",
180
-              "80",
181
-              "93.33",
182
-              "92.86",
183
-              "100",
184
-              "12",
185
-              "77",
186
-              "37"
187
-            ],
173
+            data: [],
188 174
             barWidth: 30,
189 175
             label: {
190 176
               normal: {
@@ -237,13 +223,16 @@ export default {
237 223
             }
238 224
           }
239 225
         ]
240
-      }
226
+      },
227
+      inspect_date:0,
228
+      monthActive:0,
241 229
     };
242 230
   },
243 231
   methods: {
244 232
     chooseMonth(month) {
245 233
       //一月
246 234
       if(month == 0){
235
+         this.monthActive = 0
247 236
         const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
248 237
         const endDate = moment(new Date()).format('YYYY-MM-DD')
249 238
         var now = new Date()
@@ -256,11 +245,12 @@ export default {
256 245
         //本月的结束时间
257 246
         var monthEndDate = moment().endOf('month').format('YYYY-MM-DD HH:mm:ss');
258 247
         this.endtime =Date.parse(monthEndDate)/1000-1;//s
259
-        this.getlist()
248
+         this.getlistDetail()
260 249
       }
261 250
 
262 251
       //近三月
263 252
       if(month == 1){
253
+         this.monthActive = 1
264 254
         const startDate = moment().subtract('month', 3).format('YYYY-MM-DD')
265 255
     
266 256
         this.startime = Date.parse(startDate)/1000
@@ -269,27 +259,29 @@ export default {
269 259
       
270 260
         this.endtime = Date.parse(endDate)/1000
271 261
     
272
-        this.getlist()
262
+        this.getlistDetail()
273 263
       }
274 264
     
275 265
 
276 266
        //近半年
277 267
       if(month == 2){
268
+        this.monthActive = 2
278 269
         const startDate = moment().subtract('month', 6).format('YYYY-MM-DD')
279 270
         
280 271
         this.startime = Date.parse(startDate)/1000
281 272
         const endDate = moment(new Date()).format('YYYY-MM-DD')
282 273
         this.endtime = Date.parse(endDate)/1000
283
-        this.getlist()
274
+        this.getlistDetail()
284 275
       }
285 276
 
286 277
       //近一年
287 278
       if(month == 3){
279
+        this.monthActive = 3
288 280
         const startDate = moment().subtract('month', 12).format('YYYY-MM-DD')
289 281
         this.startime = Date.parse(startDate)/1000
290 282
         const endDate = moment(new Date()).format('YYYY-MM-DD')
291 283
         this.endtime = Date.parse(endDate)/1000
292
-         this.getlist()
284
+        this.getlistDetail()
293 285
       }
294 286
 
295 287
 
@@ -298,7 +290,7 @@ export default {
298 290
     clickQuality(index,itemid) {
299 291
       this.quality = index;
300 292
       this.item_id = itemid
301
-      this.getlist()
293
+      this.getlistDetail()
302 294
     },
303 295
     handleSizeChange(limit) {
304 296
       //this.limit = limit;
@@ -320,7 +312,7 @@ export default {
320 312
         this.listQuery.start_time = "";
321 313
       } else {
322 314
          this.startime = Date.parse(val)/1000;//s
323
-        this.getlist()
315
+        this.getlistDetail()
324 316
       }
325 317
 
326 318
     },
@@ -332,7 +324,7 @@ export default {
332 324
           this.listQuery.end_time = "";
333 325
         } else {
334 326
           this.endtime = Date.parse(val)/1000;//s
335
-          this.getlist()
327
+          this.getlistDetail()
336 328
         }
337 329
 
338 330
     },
@@ -342,13 +334,12 @@ export default {
342 334
     },
343 335
     handleChange(val){
344 336
      this.patientid = val.id
345
-      this.getlist()
337
+      this.getlistDetail()
346 338
     },
347 339
    getCurrentOrgPatients(){
348 340
       getCurrentOrgPatients().then(response=>{
349 341
           if(response.data.state == 1){
350 342
             var patients = response.data.data.patients
351
-            console.log("patients",patients)
352 343
             this.patientsData = patients
353 344
           }
354 345
       })
@@ -356,10 +347,8 @@ export default {
356 347
     getNormData(){
357 348
       getNormData().then(response=>{
358 349
          var normdata = response.data.data.normdata
359
-          console.log("normdata",normdata)
360 350
           for(let i=0;i<normdata.length;i++){
361 351
             this.item_id = normdata[0].inspection_minor
362
-            console.log("item_id",this.item_id)
363 352
           }
364 353
           this.normData = normdata
365 354
           this.getlist()
@@ -368,37 +357,38 @@ export default {
368 357
     getlist(){
369 358
         this.modesData.series = []
370 359
         this.modesData.xAxis = []
371
-
372 360
         const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
373
-        console.log("开始时间",startDate)
374 361
         const endDate = moment(new Date()).format('YYYY-MM-DD')
375
-        console.log("结束时间",endDate)
376 362
         var now = new Date()
377 363
         var nowMonth = now.getMonth(); //当前月
378 364
         var nowYear = now.getFullYear(); //当前年
379 365
         //本月的开始时间
380 366
         var monthStartDate = new Date(nowYear, nowMonth, 1);
381 367
         this.startime=Date.parse(monthStartDate)/1000;//s
382
-        console.log("本月开始时间",this.startime)
383 368
         //本月的结束时间
384 369
          var monthEndDate = moment().endOf('month').format('YYYY-MM-DD HH:mm:ss');
385 370
          this.endtime =Date.parse(monthEndDate)/1000-1;//s
386
-         console.log("本月结束时间",)
387
-
388 371
 
389 372
           const params = {
390 373
             patientid:this.patientid,
391 374
             startime:this.startime,
392 375
             endtime:this.endtime,
393 376
             itemid:this.item_id,
377
+            inspectdate:this.inspect_date,
394 378
           }
395 379
        GetQualityControl(params).then(response=>{
396 380
           if(response.data.state == 1){
397 381
             var list = response.data.data.list
398
-          
399 382
             for(let i=0;i<list.length;i++){
383
+              if(parseInt(list[i].inspect_value)>= parseInt(list[i].range_min) && parseInt(list[i].inspect_value)<= parseInt(list[i].range_max)){
384
+                    this.isTrue = 1  
385
+               }
386
+               if(parseInt(list[i].inspect_value)< parseInt(list[i].range_min) || parseInt(list[i].inspect_value) > parseInt(list[i].range_max)){
387
+                    this.isTrue =0
388
+               }
400 389
               this.modesData.xAxis.push(this.getTime(list[i].inspect_date));
401 390
                this.modesData.series.push(list[i].inspect_value)
391
+            
402 392
             }
403 393
             this.chart.series[0].data = this.modesData.series
404 394
             this.chart.xAxis.data = this.modesData.xAxis
@@ -406,11 +396,57 @@ export default {
406 396
           }
407 397
 
408 398
        })
399
+    },
400
+
401
+    getlistDetail(){
402
+       this.modesData.series = []
403
+        this.modesData.xAxis = []
404
+        const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
405
+        const endDate = moment(new Date()).format('YYYY-MM-DD')
406
+
407
+       if(this.monthActive == 0){
408
+          var now = new Date()
409
+          var nowMonth = now.getMonth(); //当前月
410
+          var nowYear = now.getFullYear(); //当前年
411
+          //本月的开始时间
412
+          var monthStartDate = new Date(nowYear, nowMonth, 1);
413
+          this.startime=Date.parse(monthStartDate)/1000;//s
414
+          //本月的结束时间
415
+          var monthEndDate = moment().endOf('month').format('YYYY-MM-DD HH:mm:ss');
416
+          this.endtime =Date.parse(monthEndDate)/1000-1;//s
417
+        }
418
+     
419
+          const params = {
420
+            patientid:this.patientid,
421
+            startime:this.startime,
422
+            endtime:this.endtime,
423
+            itemid:this.item_id,
424
+          }
425
+        console.log("params",params)
426
+       getPatientComplianceDetail(params).then(response=>{
427
+            if(response.data.state == 1){
428
+              var list =  response.data.data.list
429
+              for(let i=0;i<list.length;i++){
430
+                if(parseInt(list[i].inspect_value)>= parseInt(list[i].range_min) && parseInt(list[i].inspect_value)<= parseInt(list[i].range_max)){
431
+                      this.isTrue = 1  
432
+                }
433
+                if(parseInt(list[i].inspect_value)< parseInt(list[i].range_min) || parseInt(list[i].inspect_value) > parseInt(list[i].range_max)){
434
+                      this.isTrue =0
435
+                }
436
+                this.modesData.xAxis.push(this.getTime(list[i].inspect_date));
437
+                this.modesData.series.push(list[i].inspect_value)
438
+            
439
+            }
440
+              this.chart.series[0].data = this.modesData.series
441
+              this.chart.xAxis.data = this.modesData.xAxis
442
+            }
443
+       })
409 444
     }
410 445
   },
411 446
 
412 447
    created(){
413 448
      this.patientid =  this.$route.query.patientid
449
+     this.inspect_date = this.$route.query.date
414 450
      //获取指标项
415 451
       this.getNormData()
416 452
      //获取该机构下的所有患者

+ 181 - 231
src/xt_pages/qcd/patientControlAnalysis.vue View File

@@ -8,8 +8,6 @@
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> -->
13 11
                <el-autocomplete
14 12
                 class="checkSearch"
15 13
                 popper-class="my-autocomplete"
@@ -92,15 +90,15 @@
92 90
               :key="index"
93 91
             >
94 92
             <template slot-scope="scope">
95
-                 <span v-if="scope.row.data[index].inspect_value == ''">0</span>
96
-                 <span v-if="scope.row.data[index].inspect_value !=''&& (parseInt(scope.row.data[index].inspect_value) < parseInt(scope.row.data[index].range_min))">{{scope.row.data[index].inspect_value}}↓</span>
97
-                <span v-if="scope.row.data[index].inspect_value !=''&& (parseInt(scope.row.data[index].inspect_value) > parseInt(scope.row.data[index].range_max))">{{scope.row.data[index].inspect_value}}↑</span>
98
-                <span v-if="scope.row.data[index].inspect_value !=''&& (parseInt(scope.row.data[index].inspect_value) >= parseInt(scope.row.data[index].range_min))&& (parseInt(scope.row.data[index].inspect_value) <= parseInt(scope.row.data[index].range_max)) ">{{scope.row.data[index].inspect_value}}</span>
93
+                 <span v-if="scope.row.data[modeItem.item_name].inspect_value == ''">0</span>
94
+                 <span v-if="scope.row.data[modeItem.item_name].inspect_value !=''&& (parseInt(scope.row.data[modeItem.item_name].inspect_value) < parseInt(scope.row.data[modeItem.item_name].range_min))">{{scope.row.data[modeItem.item_name].inspect_value}}↓</span>
95
+                <span v-if="scope.row.data[modeItem.item_name].inspect_value !=''&& (parseInt(scope.row.data[modeItem.item_name].inspect_value) > parseInt(scope.row.data[modeItem.item_name].range_max))">{{scope.row.data[modeItem.item_name].inspect_value}}↑</span>
96
+                <span v-if="scope.row.data[modeItem.item_name].inspect_value !=''&& (parseInt(scope.row.data[modeItem.item_name].inspect_value) >= parseInt(scope.row.data[modeItem.item_name].range_min))&& (parseInt(scope.row.data[modeItem.item_name].inspect_value) <= parseInt(scope.row.data[modeItem.item_name].range_max)) ">{{scope.row.data[modeItem.item_name].inspect_value}}</span>
99 97
             </template>
100 98
         </el-table-column>
101 99
             <el-table-column fixed="right" label="操作" width="100">
102 100
               <template slot-scope="scope">
103
-                <el-button @click="handleClick(scope.row.name)" type="text" size="small">查看</el-button>
101
+                <el-button @click="handleClick(scope.row.patient_id,scope.row.inspect_date)" type="text" size="small">查看</el-button>
104 102
               </template>
105 103
             </el-table-column>
106 104
           </el-table>
@@ -201,7 +199,17 @@ export default {
201 199
               normal: {
202 200
                 show: true,
203 201
                 position: "top",
204
-                formatter: "{c}%"
202
+                formatter: (params) => {
203
+                  if(this.obj.length > 0){
204
+                      let str = ''
205
+                      str = '('+ this.obj[params.dataIndex] +'人'+',' + params.data +'%' +')'
206
+                    return str
207
+                  }else{
208
+                    let str = ''
209
+                    str = params.data+'%'
210
+                    return str
211
+                  }
212
+                }
205 213
               }
206 214
             },
207 215
             //配置样式
@@ -248,6 +256,7 @@ export default {
248 256
       paitents:[],
249 257
       tableName:[],
250 258
       total:0,
259
+       obj:[],
251 260
       ObjectData:{},
252 261
       tablePatients:[],
253 262
       tableSort:[],
@@ -278,7 +287,7 @@ export default {
278 287
         this.$message.error("结束时间不能小于开始时间");
279 288
         this.listQuery.start_time = "";
280 289
       } else {
281
-        
290
+
282 291
       }
283 292
 
284 293
     },
@@ -289,23 +298,23 @@ export default {
289 298
         this.$message.error("结束时间不能小于开始时间");
290 299
         this.listQuery.end_time = "";
291 300
       } else {
292
-       
301
+
293 302
       }
294 303
     },
295 304
     getTimestamp(time) {
296 305
       // 把时间日期转成时间戳
297 306
       return new Date(time).getTime() / 1000;
298 307
     },
299
-    handleClick(name) {
300
-      var id = 0
301
-      var dialysis_no = 0
302
-      for(let i=0;i<this.tablePatients.length;i++){
303
-         if(name == this.tablePatients[i].name){
304
-            id = this.tablePatients[i].patient_id
305
-            dialysis_no = this.tablePatients[i].dialysis_no
306
-         }
307
-      }
308
-      this.$router.push({ path: "/qcd/patientComplianceDetails?patientid="+id});
308
+    handleClick(patientid,inspectdate) {
309
+      // var id = 0
310
+      // var dialysis_no = 0
311
+      // for(let i=0;i<this.tablePatients.length;i++){
312
+      //    if(name == this.tablePatients[i].name){
313
+      //       id = this.tablePatients[i].patient_id
314
+      //       dialysis_no = this.tablePatients[i].dialysis_no
315
+      //    }
316
+      // }
317
+      this.$router.push({ path: "/qcd/patientComplianceDetails?patientid="+patientid+"&date="+inspectdate});
309 318
     },
310 319
     getDialysisNo(name){
311 320
         for(let i=0;i<this.tablePatients.length;i++){
@@ -318,7 +327,7 @@ export default {
318 327
       getNormData().then(response=>{
319 328
          if(response.data.state == 1){
320 329
            var normdata = response.data.data.normdata
321
-          // console.log("normdata",normdata)
330
+        //  console.log("normdata",normdata)
322 331
           this.normData = normdata
323 332
            var a=[];
324 333
            for(let i=0;i<normdata.length;i++){
@@ -327,8 +336,6 @@ export default {
327 336
           // console.log("a",a)
328 337
            this.newArr = a
329 338
            var arr = this.arrayToObj(a)
330
-
331
-          console.log("娃哈哈",arr)
332 339
            this.ObjectData = arr
333 340
 
334 341
 
@@ -346,22 +353,22 @@ export default {
346 353
        getPatientContorlAnalysis(params).then(response=>{
347 354
            if(response.data.state == 1){
348 355
               var control = response.data.data.patientcontorDetail
349
-              console.log('control', control)
356
+              console.log("control",control)
350 357
               let dataInfo = {}
351 358
               control.forEach((item, index) => {
352
-                let { patient_id } = item
353
-                if (!dataInfo[patient_id]) {
354
-                  dataInfo[patient_id] = {
355
-                    patient_id,
359
+                let { inspect_date } = item
360
+                if (!dataInfo[inspect_date]) {
361
+                  dataInfo[inspect_date] = {
362
+                    inspect_date,
356 363
                     name: item.name,
357 364
                     child: [],
358
-                    inspect_date: item.inspect_date
365
+                    patient_id: item.patient_id
359 366
 
360 367
                   }
361 368
                 }
362 369
               })
363 370
               let list = Object.values(dataInfo)
364
-              // console.log('list', list)
371
+              console.log("list",list)
365 372
               list.map(item => {
366 373
                 for (let i = 0; i < control.length; i++) {
367 374
                   if (item.inspect_date == control[i].inspect_date && item.patient_id == control[i].patient_id) {
@@ -377,7 +384,6 @@ export default {
377 384
                 })
378 385
 
379 386
                 // 配置的才显示
380
-
381 387
                 var arrthree = []
382 388
                 for (let i = 0; i < newarrtwo.length; i++) {
383 389
                   for (let j = 0; j < this.normData.length; j++) {
@@ -386,7 +392,7 @@ export default {
386 392
                     }
387 393
                   }
388 394
                 }
389
-
395
+                console.log("arrthree",arrthree)
390 396
                 var arrfour = this.arrayDate(arrthree, newarrtwo)
391 397
                 arrfour.map(item => {
392 398
                   item.item_name = ''
@@ -395,13 +401,14 @@ export default {
395 401
 
396 402
                 var dd = {}
397 403
                 for (const index in arrthree) {
398
-                  if (!(arrthree[index].name in dd)) {
399
-                    dd[arrthree[index].name] = {}
404
+                  if (!(arrthree[index].inspect_date in dd)) {
405
+                    dd[arrthree[index].inspect_date] = {}
400 406
                   }
401
-                  if (!(arrthree[index].item_name in dd[arrthree[index].name]) && arrthree[index].item_name != 0) {
402
-                    dd[arrthree[index].name][arrthree[index].item_name] = arrthree[index]
407
+                  if (!(arrthree[index].item_name in dd[arrthree[index].inspect_date]) && arrthree[index].item_name != 0) {
408
+                    dd[arrthree[index].inspect_date][arrthree[index].item_name] = arrthree[index]
403 409
                   }
404 410
                 }
411
+
405 412
                 this.tableData = []
406 413
 
407 414
                 for (const key in dd) {
@@ -416,28 +423,46 @@ export default {
416 423
                   }
417 424
                   this.tableData.push({ name: key, data: dd[key]})
418 425
                 }
419
-                  console.log("表格",this.tableData)
420
-                  let projectArr = []
421
-                  this.newArr.map(item => {
422
-                    projectArr.push(item.item_name)
426
+              let dataInfotwo = {}
427
+              control.forEach((item, index) => {
428
+                let { inspect_date } = item
429
+                if (!dataInfotwo[inspect_date]) {
430
+                  dataInfotwo[inspect_date] = {
431
+                    inspect_date,
432
+                    name: item.name,
433
+                  }
434
+                }
435
+              })
436
+              let listtwo = Object.values(dataInfotwo)
437
+                listtwo.map(item=>{
438
+                  this.tableData.map(it=>{
439
+                    if(item.inspect_date == parseInt(it.name)){
440
+                      it.name = item.name
441
+                    }
423 442
                   })
443
+                })
444
+                //   let projectArr = []
445
+                //   this.newArr.map(item => {
446
+                //     projectArr.push(item.item_name)
447
+                //   })
448
+
449
+                //   this.tableData.map(item => {
450
+                //     let newarr = Object.values(item.data)
451
+                //     newarr.sort((a, b) => {
452
+                //       return projectArr.indexOf(a.item_name) - projectArr.indexOf(b.item_name)
453
+                //     })
454
+                //     item.data = newarr
455
+                //   })
456
+
457
+                  // for (let i = 0; i < this.patientsArr.length; i++) {
458
+                  //   for (let j = 0; j < this.tableData.length; j++) {
459
+                  //     if (this.patientsArr[i].name == this.tableData[j].name) {
460
+                  //       this.tableData[j].dialysis_no = this.patientsArr[i].dialysis_no
461
+                  //       this.tableData[j].patient_id = this.patientsArr[i].id
462
+                  //     }
463
+                  //   }
464
+                  // }
424 465
 
425
-                  this.tableData.map(item => {
426
-                    let newarr = Object.values(item.data)
427
-                    newarr.sort((a, b) => {
428
-                      return projectArr.indexOf(a.item_name) - projectArr.indexOf(b.item_name)
429
-                    })
430
-                    item.data = newarr
431
-                  })
432
-      
433
-                  for (let i = 0; i < this.patientsArr.length; i++) {
434
-                    for (let j = 0; j < this.tableData.length; j++) {
435
-                      if (this.patientsArr[i].name == this.tableData[j].name) {
436
-                        this.tableData[j].dialysis_no = this.patientsArr[i].dialysis_no
437
-                        this.tableData[j].patient_id = this.patientsArr[i].id
438
-                      }
439
-                    }
440
-                  }
441 466
                 }
442 467
           })
443 468
     },
@@ -474,7 +499,7 @@ export default {
474 499
             }
475 500
           })
476 501
         let list = Object.values(dataInfo)
477
-        
502
+
478 503
 
479 504
          list.map(item => {
480 505
             for (let i = 0; i < newArr.length; i++) {
@@ -483,7 +508,7 @@ export default {
483 508
               }
484 509
             }
485 510
           })
486
-        //  console.log("list",list)  
511
+        //  console.log("list",list)
487 512
          var newarrtwo = []
488 513
           list.map(item => {
489 514
             item.child.map(it => {
@@ -500,110 +525,70 @@ export default {
500 525
               }
501 526
             }
502 527
           }
503
-          // console.log("arrthree",arrthree)
528
+
504 529
           var arrfour = this.arrayDate(arrthree, newarrtwo)
505
-          // console.log("arrfour",arrfour)
506 530
           arrfour.map(item => {
507 531
             item.item_name = ''
508 532
             arrthree.push(item)
509 533
           })
510 534
           // console.log('arrthree', arrthree)
511 535
           var dd = {}
512
-          for (const index in arrthree) {
513
-            if (!(arrthree[index].inspect_date in dd)) {
514
-              dd[arrthree[index].inspect_date] = {}
536
+           for (const index in arrthree) {
537
+             if (!(arrthree[index].inspect_date in dd)) {
538
+               dd[arrthree[index].inspect_date] = {}
539
+             }
540
+             if (!(arrthree[index].item_name in dd[arrthree[index].inspect_date]) && arrthree[index].item_name != 0) {
541
+               dd[arrthree[index].inspect_date][arrthree[index].item_name] = arrthree[index]
542
+
543
+             }
544
+           }
545
+
546
+           let dataInfotwo = {}
547
+          newArr.forEach((item, index) => {
548
+            let { inspect_date } = item
549
+            if (!dataInfotwo[inspect_date]) {
550
+              dataInfotwo[inspect_date] = {
551
+                inspect_date,
552
+                name: item.name,
553
+                inspect_value:item.inspect_value,
554
+                id:item.id,
555
+                inspect_date:item.inspect_date
556
+              }
515 557
             }
516
-            console.log("abc",dd[arrthree[index].inspect_date])
517
-            if (!(arrthree[index].item_name in dd[arrthree[index].inspect_date]) && arrthree[index].item_name != 0) {
518
-              dd[arrthree[index].inspect_date][arrthree[index].item_name] = arrthree[index]
519
-             
558
+          })
559
+        let listtwo = Object.values(dataInfotwo)
560
+        console.log("listtwo",listtwo)
561
+          for (const key in dd) {
562
+            for (const mkey in this.ObjectData) {
563
+              if (!(this.ObjectData[mkey].item_name in dd[key])) {
564
+                dd[key][this.ObjectData[mkey].item_name] = {
565
+                  item_name: this.ObjectData[mkey].item_name,
566
+                  name: mkey,
567
+                  inspect_value: 0
568
+                }
569
+              }
520 570
             }
571
+            this.tableData.push({ name: key, data: dd[key]})
572
+          }
573
+
574
+          listtwo.map(item=>{
575
+            this.tableData.map(it=>{
576
+              if(item.inspect_date == parseInt(it.name)){
577
+                 it.name = item.name
578
+                 it.id = item.id
579
+                 it.inspect_date = item.inspect_date
580
+              }
581
+            })
582
+          })
583
+          for(let i=0;i<this.patientsArr.length;i++){
584
+             for(let j=0;j<this.tableData.length;j++){
585
+               if(this.patientsArr[i].name == this.tableData[j].name){
586
+                   this.tableData[j].dialysis_no = this.patientsArr[i].dialysis_no
587
+                   this.tableData[j].patient_id = this.patientsArr[i].id
588
+               }
589
+             }
521 590
           }
522
-         console.log("dd",dd)
523
-        //   let dataInfotwo = {}
524
-        //   newArr.forEach((item, index) => {
525
-        //     let { inspect_date } = item
526
-        //     if (!dataInfotwo[inspect_date]) {
527
-        //       dataInfotwo[inspect_date] = {
528
-        //         inspect_date,
529
-        //         name: item.name,
530
-        //         item_id:item.item_id,
531
-        //         item_name:item.item_name,
532
-        //         range_max:item.range_max,
533
-        //         range_min:item.range_min,
534
-        //       }
535
-        //     }
536
-        //   })
537
-        // let listtwo = Object.values(dataInfotwo)
538
-        //  console.log("listtwo",listtwo)
539
-        // let arrsix = []
540
-        // for(let i=0;i<listtwo.length;i++){
541
-        //    arrsix.push({
542
-        //         name:listtwo[i].name,
543
-        //        inspectdate:dd[listtwo[i].inspect_date]
544
-        //    })
545
-        // }
546
-      //  var obj = {}
547
-      //  var fruitsObj = {...arrsix}
548
-      //  console.log("陈工",fruitsObj)
549
-      //  console.log("objecdat",this.ObjectData)
550
-       
551
-          // for (const key in dd) {
552
-          //   var total = 0;
553
-          //   for (const mkey in this.modeOptions) {
554
-          //     if (mkey in dd[key]) {
555
-          //       dd[key][mkey].mode = this.modeOptions[mkey].name;
556
-          //       var number = parseInt(dd[key][mkey].number);
557
-          //       if (isNaN(number) || number == 0) {
558
-          //         dd[key][mkey].number = "";
559
-          //         number = 0;
560
-          //       }
561
-          //       total += number;
562
-          //     } else {
563
-          //       dd[key][mkey] = {
564
-          //         mode: this.modeOptions[mkey].name,
565
-          //         mode_id: mkey,
566
-          //         number: 0
567
-          //       };
568
-          //     }
569
-          //   }
570
-          //   this.tableData.push({ date: key, data: dd[key], total: total });
571
-          // }
572
-       
573
-          //  for(const key in dd){
574
-          //    for(const mkey in this.ObjectData){
575
-          //       if(mkey in dd[key]){
576
-          //         dd[key][mkey].item_name =  this.ObjectData[mkey].item_name
577
-          //         var inspect_value = dd[key][mkey].inspect_value
578
-          //         if(inspect_value == 0){
579
-          //           inspect_value = 0
580
-          //         }
581
-          //       }else{
582
-          //         dd[key][mkey] = {
583
-          //            item_name:this.ObjectData[mkey].item_name,
584
-          //            item_id:mkey,
585
-          //            inspect_value:0,
586
-          //         }
587
-          //       }
588
-          //    }
589
-          //    this.tableData.push({ date: key, data: dd[key]})
590
-          //  }
591
-
592
-          //  console.log("表哥",this.tableData)
593
-
594
-
595
-          // for (const key in dd) {
596
-          //   for (const mkey in this.ObjectData) {
597
-          //     if (!(this.ObjectData[mkey].item_name in dd[key])) {
598
-          //       dd[key][this.ObjectData[mkey].item_name] = {
599
-          //         item_name: this.ObjectData[mkey].item_name,
600
-          //         name: mkey,
601
-          //         inspect_value: 0
602
-          //       }
603
-          //     }
604
-          //   }
605
-          //   this.tableData.push({ name: key, data: dd[key]})
606
-          // }
591
+         console.log("表哥123",this.tableData)
607 592
          }
608 593
       })
609 594
     },
@@ -638,37 +623,38 @@ export default {
638 623
        getCartogramlist(this.lapstor,this.listQuery.start_time,this.listQuery.end_time,this.limit,this.page).then(response=>{
639 624
            if(response.data.state == 1){
640 625
               var cartogramlist =  response.data.data.cartogramlist
641
-              // console.log("cartogramlist",cartogramlist)
626
+            //  console.log("cartogramlist",cartogramlist)
642 627
               var totaltwo =  response.data.data.total
628
+              // console.log("totaltwo",totaltwo)
643 629
                var cart = []
644 630
                for(let i=0;i<cartogramlist.length;i++){
645 631
                   if(cartogramlist[i].inspect_value != ''){
646 632
                     cart.push(cartogramlist[i])
647 633
                   }
648 634
                }
649
-              //  console.log("cart",cart)
635
+              // console.log("cart",cart)
650 636
                let dataInfo = {}
651 637
                 cart.forEach((item, index) => {
652
-                  let { patient_id } = item
653
-                  if (!dataInfo[patient_id]) {
654
-                    dataInfo[patient_id] = {
655
-                      patient_id,
638
+                  let { inspect_date } = item
639
+                  if (!dataInfo[inspect_date]) {
640
+                    dataInfo[inspect_date] = {
641
+                      inspect_date,
656 642
                       name:item.name,
657 643
                       child: [],
658
-                      inspect_date:item.inspect_date,
644
+                      patient_id:item.patient_id,
659 645
                       total:0,
646
+                      count:0,
660 647
                     }
661 648
                   }
662 649
                 })
663 650
               let list = Object.values(dataInfo)
664
-              // console.log("list",list)
651
+              console.log("list",list)
665 652
 
666 653
               var arr = []
667 654
               list.map(item=>{
668 655
                  for(let i=0;i<cart.length;i++){
669 656
                     if(item.inspect_date == cart[i].inspect_date && item.patient_id == cart[i].patient_id){
670 657
                         item.child.push(cart[i])
671
-                         item.total++
672 658
                     }
673 659
                  }
674 660
               })
@@ -677,77 +663,41 @@ export default {
677 663
 
678 664
              list.map(item=>{
679 665
                 item.child.map(it=>{
680
-                   arr.push(it)
666
+                   if(parseInt(it.range_min)<=parseInt(it.inspect_value) && parseInt(it.inspect_value)<=parseInt(it.range_max)){
667
+                       item.total ++
668
+                   }
681 669
                 })
682 670
              })
683
-              // console.log("arr",arr)
671
+             var standardTotal = 0
684 672
 
685
-             var arrtwo = []
686
-             for(let i=0;i<arr.length;i++){
687
-               if(parseInt(arr[i].range_min)<= parseInt(arr[i].inspect_value) && parseInt(arr[i].inspect_value)<=parseInt(arr[i].range_max )){
688
-                  arrtwo.push(arr[i])
673
+             list.map(item=>{
674
+               if(item.total == item.child.length){
675
+                  item.count ++
689 676
                }
690
-             }
691
-            //  console.log("arrtwo",arrtwo)
692
-
693
-             let objinfo = {}
694
-                arrtwo.forEach((item, index) => {
695
-                  let { patient_id } = item
696
-                  if (!objinfo[patient_id]) {
697
-                    objinfo[patient_id] = {
698
-                      patient_id,
699
-                      name:item.name,
700
-                      child: [],
701
-                      inspect_date:item.inspect_date,
702
-                      count:0,
703
-                    }
704
-                  }
705
-                })
706
-              let newlist = Object.values(objinfo)
707
-              newlist.map(item=>{
708
-                 for(let i=0;i<arrtwo.length;i++){
709
-                    if(arrtwo[i].patient_id == item.patient_id && arrtwo[i].inspect_date == item.inspect_date){
710
-                       item.child.push(arrtwo[i])
711
-                    }
712
-                 }
713
-              })
714
-              // console.log("newlist",newlist)
715
-              newlist.map(item=>{
716
-                  item.child.map(it=>{
717
-                    if(parseInt(it.range_min)<= parseInt(it.inspect_value) && parseInt(it.inspect_value)<=parseInt(it.range_max )){
718
-                       item.count ++
719
-                    }
720
-                  })
721
-              })
722
-              // console.log("newlist",newlist)
723
-
724
-
725
-              var newtotal = 0
726
-
727
-              list.map(item=>{
728
-                 for(let i=0;i<newlist.length;i++){
729
-                    if(item.patient_id == newlist[i].patient_id && item.total == newlist[i].count){
730
-                       newtotal ++
731
-                    }
732
-                 }
733
-              })
734
-            //  console.log("newtotal",newtotal)
735
-             var totalCount = totaltwo - newtotal
736
-              // console.log("totalCount",totaltwo)
737
-             for(let i=0;i<this.dataName.length;i++){
738
-                this.modesData.xAxis.push(this.dataName[i].name);
739
-             }
740
-
677
+             })
678
+             list.map(item=>{
679
+               standardTotal += item.count
680
+             })
681
+             var totalCount = list.length
682
+            //  console.log("arr",list)
683
+            //  console.log("合格",standardTotal)
684
+            //  console.log("总人数",totalCount)
741 685
              for(let i=0;i<this.dataCount.length;i++){
742
-                this.dataCount[0].count = newtotal
743
-                this.dataCount[1].count =  totalCount
686
+                this.dataCount[0].count = standardTotal
687
+                this.dataCount[1].count =  totalCount - standardTotal
688
+               this.obj.push(this.dataCount[i].count)
744 689
              }
690
+            // console.log("dataCount",this.dataCount)
691
+         for (let i = 0; i < this.dataName.length; i++) {
692
+            this.modesData.xAxis.push(this.dataName[i].name)
745 693
 
746
-             for(let i=0;i<this.dataCount.length;i++){
747
-                this.modesData.series.push(((this.dataCount[i].count/totaltwo)*100).toFixed(1));
748
-             }
749
-              this.chart.series[0].data = this.modesData.series
750
-              this.chart.xAxis.data = this.modesData.xAxis
694
+          }
695
+          for (let i = 0; i < this.dataCount.length; i++) {
696
+              this.modesData.series.push(((this.dataCount[i].count / totalCount) * 100).toFixed(1))
697
+            }
698
+            this.chart.series[0].data = this.modesData.series
699
+            this.chart.xAxis.data = this.modesData.xAxis
700
+            //  console.log("this",this.modesData)
751 701
            }
752 702
        })
753 703
     },
@@ -755,6 +705,9 @@ export default {
755 705
        getCurrentOrgPatients().then(response=>{
756 706
           if(response.data.state == 1){
757 707
             this.patientsArr =  response.data.data.patients
708
+            // console.log("病人",this.patientsArr)
709
+            //获取列表数据
710
+            this.getlist()
758 711
           }
759 712
        })
760 713
      },
@@ -774,11 +727,10 @@ export default {
774 727
         })
775 728
       },
776 729
    handleSelect(val) {
777
-        console.log("val",val)
778 730
         this.listQuery.search = val.name
779 731
         this.patient_id = val.id
780 732
         this.onSearch()
781
-      },
733
+     },
782 734
   },
783 735
   created(){
784 736
     var nowDate = new Date();
@@ -804,15 +756,13 @@ export default {
804 756
 
805 757
 
806 758
 
807
-
759
+    this.getCurrentOrgPatients()
808 760
     //获取系统指标
809 761
     this.getNormData()
810
-    //获取列表数据
811
-    this.getlist()
812 762
     //获取统计图数据
813 763
     this.getCartogramlist()
814 764
 
815
-    this.getCurrentOrgPatients()
765
+
816 766
   }
817 767
 };
818 768
 </script>

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

@@ -331,7 +331,7 @@ export default {
331 331
             var total = 0;
332 332
             for (const mkey in this.modeOptions) {
333 333
               if (mkey in dd[key]) {
334
-                console.log("=====",dd[key])
334
+                console.log("=====",mkey)
335 335
                 console.log(this.modeOptions[mkey].name)
336 336
                 dd[key][mkey].mode = this.modeOptions[mkey].name;
337 337
                 var number = parseInt(dd[key][mkey].number);