|
@@ -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>
|