|
@@ -59,6 +59,7 @@
|
59
|
59
|
height="500" :row-style="{ color: '#303133' }"
|
60
|
60
|
:header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
|
61
|
61
|
highlight-current-row
|
|
62
|
+ ref="singleTable"
|
62
|
63
|
@current-change="handleChange"
|
63
|
64
|
>
|
64
|
65
|
<el-table-column prop="dialysis_no" label="透析号" width="80">
|
|
@@ -91,6 +92,7 @@ export default {
|
91
|
92
|
},
|
92
|
93
|
data() {
|
93
|
94
|
return {
|
|
95
|
+ patient_id:0,
|
94
|
96
|
listQuery: {
|
95
|
97
|
start_time: "",
|
96
|
98
|
end_time: "",
|
|
@@ -242,13 +244,19 @@ export default {
|
242
|
244
|
getCurrentOrgPatients(){
|
243
|
245
|
getCurrentOrgPatients().then(response=>{
|
244
|
246
|
var patients = response.data.data.patients
|
|
247
|
+ for(let i=0;i<patients.length;i++){
|
|
248
|
+ this.$refs.singleTable.setCurrentRow(patients[0])
|
|
249
|
+ this.patient_id = patients[0].id
|
|
250
|
+ }
|
245
|
251
|
this.patientsData = patients
|
|
252
|
+ //获取检验检查项目
|
|
253
|
+ this.getInspectionTotalCount()
|
246
|
254
|
})
|
247
|
255
|
},
|
248
|
256
|
getInspectionTotalCount(){
|
249
|
257
|
this.modesData.series = []
|
250
|
258
|
this.modesData.xAxis = []
|
251
|
|
- getInspectionTotalCount(this.listQuery.start_time,this.listQuery.end_time).then(response=>{
|
|
259
|
+ getInspectionTotalCount(this.listQuery.start_time,this.listQuery.end_time,this.patient_id).then(response=>{
|
252
|
260
|
if(response.data.state === 1){
|
253
|
261
|
var Inspection = response.data.data.Inspection
|
254
|
262
|
|
|
@@ -265,7 +273,7 @@ export default {
|
265
|
273
|
}
|
266
|
274
|
}
|
267
|
275
|
|
268
|
|
- var arrtwo = this.arrayDate(counts,this.normData)
|
|
276
|
+ // var arrtwo = this.arrayDate(counts,this.normData)
|
269
|
277
|
|
270
|
278
|
var hash = {};
|
271
|
279
|
var i = 0;
|
|
@@ -297,7 +305,7 @@ export default {
|
297
|
305
|
res.map(item => {
|
298
|
306
|
this.modesData.series.push(parseInt(item.Count));
|
299
|
307
|
})
|
300
|
|
- console.log("this=====",this.tableData)
|
|
308
|
+ // console.log("this=====",this.tableData)
|
301
|
309
|
for (const key in this.tableData) {
|
302
|
310
|
this.modesData.xAxis.push(this.tableData[key].project_name);
|
303
|
311
|
let time = new Date(this.listQuery.end_time) - new Date(this.listQuery.start_time)
|
|
@@ -319,34 +327,84 @@ export default {
|
319
|
327
|
getInspectionDetailById(val.id,this.listQuery.start_time,this.listQuery.end_time).then(response=>{
|
320
|
328
|
if(response.data.state === 1){
|
321
|
329
|
var patientdetail = response.data.data.patientdetail
|
322
|
|
- console.log("patientdetail",patientdetail)
|
|
330
|
+ // console.log("patientdetail",patientdetail)
|
323
|
331
|
var arr=[]
|
324
|
|
- for(let i=0;i<this.tableData.length;i++){
|
325
|
|
- for(let j=0;j<patientdetail.length;j++){
|
326
|
|
- if(this.tableData[i].inspection_major == patientdetail[j].ProjectId){
|
327
|
|
- arr.push(patientdetail[j])
|
328
|
|
- }
|
|
332
|
+
|
|
333
|
+ for(let i=0;i<this.tableData.length;i++){
|
|
334
|
+ for(let j=0;j<patientdetail.length;j++){
|
|
335
|
+ if(this.tableData[i].inspection_major == patientdetail[j].ProjectId){
|
|
336
|
+ arr.push(patientdetail[j])
|
329
|
337
|
}
|
330
|
338
|
}
|
331
|
|
-
|
332
|
|
- let time = new Date(this.listQuery.end_time) - new Date(this.listQuery.start_time)
|
333
|
|
- let day = parseInt(time / (1000 * 60 * 60 * 24))
|
334
|
|
- console.log("arr",arr)
|
335
|
|
- console.log("tabledata",this.tableData)
|
336
|
|
- for (const key in this.tableData) {
|
337
|
|
- this.modesData.xAxis.push(this.tableData[key].project_name);
|
338
|
|
- if (key in arr) {
|
339
|
|
- this.modesData.series.push(parseInt(arr[key].Count));
|
340
|
|
- this.obj.push(Math.round(day / arr[key].InspectionFrequency))
|
341
|
|
- // batotal += parseInt(res[key].Count);
|
342
|
|
- } else {
|
343
|
|
- this.modesData.series.push(0);
|
344
|
|
- this.obj.push(0)
|
345
|
|
- }
|
|
339
|
+ }
|
|
340
|
+ // console.log('arr',arr)
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+ var hash = {};
|
|
344
|
+ var i = 0;
|
|
345
|
+ var res = [];
|
|
346
|
+ arr.forEach(function(item) {
|
|
347
|
+ var ProjectName = item.ProjectName;
|
|
348
|
+ hash[ProjectName] ? res[hash[ProjectName] - 1].Count.push(item.Count) : hash[ProjectName] = ++i && res.push({
|
|
349
|
+ Count: [item.Count],
|
|
350
|
+ ProjectName: ProjectName,
|
|
351
|
+ ProjectId: item.ProjectId,
|
|
352
|
+ Sort:item.Sort,
|
|
353
|
+ })
|
|
354
|
+ });
|
|
355
|
+
|
|
356
|
+ res.map(item => {
|
|
357
|
+ item.Count = eval(item.Count.join('+'))
|
|
358
|
+ })
|
|
359
|
+
|
|
360
|
+ let arr1 = []
|
|
361
|
+ this.tableData.map(it => {
|
|
362
|
+ arr1.push(it.project_name)
|
|
363
|
+ })
|
|
364
|
+
|
|
365
|
+ arr1.forEach((item,index)=>{
|
|
366
|
+ if(!(res[index] && item ==res[index].ProjectName)){
|
|
367
|
+ res.splice(index,0,{Count:0, ProjectName: item, Sort: index+1})
|
346
|
368
|
}
|
347
|
|
- this.chart.series[0].data = this.modesData.series
|
348
|
|
- this.chart.xAxis.data = this.modesData.xAxis
|
349
|
|
- this.getArrLength(this.chart.xAxis.data)
|
|
369
|
+ })
|
|
370
|
+ res.map(item => {
|
|
371
|
+ this.modesData.series.push(parseInt(item.Count));
|
|
372
|
+ })
|
|
373
|
+ // console.log("this=====",this.tableData)
|
|
374
|
+ for (const key in this.tableData) {
|
|
375
|
+ this.modesData.xAxis.push(this.tableData[key].project_name);
|
|
376
|
+ let time = new Date(this.listQuery.end_time) - new Date(this.listQuery.start_time)
|
|
377
|
+ let day = parseInt(time / (1000 * 60 * 60 * 24))
|
|
378
|
+ this.obj.push(Math.round(day / this.tableData[key].inspection_frequency))
|
|
379
|
+ }
|
|
380
|
+
|
|
381
|
+ this.chart.series[0].data = this.modesData.series
|
|
382
|
+ this.chart.xAxis.data = this.modesData.xAxis
|
|
383
|
+ this.getArrLength(this.chart.xAxis.data)
|
|
384
|
+ // for(let i=0;i<this.tableData.length;i++){
|
|
385
|
+ // for(let j=0;j<patientdetail.length;j++){
|
|
386
|
+ // if(this.tableData[i].inspection_major == patientdetail[j].ProjectId){
|
|
387
|
+ // arr.push(patientdetail[j])
|
|
388
|
+ // }
|
|
389
|
+ // }
|
|
390
|
+ // }
|
|
391
|
+
|
|
392
|
+ // let time = new Date(this.listQuery.end_time) - new Date(this.listQuery.start_time)
|
|
393
|
+ // let day = parseInt(time / (1000 * 60 * 60 * 24))
|
|
394
|
+ // console.log("tabledata",this.tableData)
|
|
395
|
+ // for (const key in this.tableData) {
|
|
396
|
+ // this.modesData.xAxis.push(this.tableData[key].project_name);
|
|
397
|
+ // if (key in arr) {
|
|
398
|
+ // this.modesData.series.push(parseInt(arr[key].Count));
|
|
399
|
+ // this.obj.push(Math.round(day / arr[key].InspectionFrequency))
|
|
400
|
+ // } else {
|
|
401
|
+ // this.modesData.series.push(0);
|
|
402
|
+ // this.obj.push(0)
|
|
403
|
+ // }
|
|
404
|
+ // }
|
|
405
|
+ // this.chart.series[0].data = this.modesData.series
|
|
406
|
+ // this.chart.xAxis.data = this.modesData.xAxis
|
|
407
|
+ // this.getArrLength(this.chart.xAxis.data)
|
350
|
408
|
}
|
351
|
409
|
})
|
352
|
410
|
},
|
|
@@ -358,32 +416,60 @@ export default {
|
358
|
416
|
getSearchPatientInfo(this.patient_id,this.listQuery.start_time,this.listQuery.end_time).then(response=>{
|
359
|
417
|
if(response.data.state === 1){
|
360
|
418
|
var PatientsInfo = response.data.data.PatientsInfo
|
361
|
|
- console.log("patientsInfo",PatientsInfo)
|
|
419
|
+ // console.log("patientsInfo",PatientsInfo)
|
362
|
420
|
var arr = []
|
363
|
|
- for(let i=0;i<this.tableData.length;i++){
|
364
|
|
- for(let j=0;j<PatientsInfo.length;j++){
|
365
|
|
- if(this.tableData[i].inspection_major == PatientsInfo[j].ProjectId){
|
366
|
|
- arr.push(PatientsInfo[j])
|
367
|
|
- }
|
368
|
|
- }
|
369
|
|
- }
|
370
|
|
- let time = new Date(this.listQuery.end_time) - new Date(this.listQuery.start_time)
|
371
|
|
- let day = parseInt(time / (1000 * 60 * 60 * 24))
|
372
|
|
-
|
373
|
|
- for (const key in this.tableData) {
|
374
|
|
- this.modesData.xAxis.push(this.tableData[key].project_name);
|
375
|
|
- if (key in arr) {
|
376
|
|
- this.modesData.series.push(parseInt(arr[key].Count));
|
377
|
|
- this.obj.push(Math.round(day / arr[key].InspectionFrequency))
|
378
|
|
- // batotal += parseInt(res[key].Count);
|
379
|
|
- } else {
|
380
|
|
- this.modesData.series.push(0);
|
381
|
|
- this.obj.push(0)
|
|
421
|
+
|
|
422
|
+ for(let i=0;i<this.tableData.length;i++){
|
|
423
|
+ for(let j=0;j<PatientsInfo.length;j++){
|
|
424
|
+ if(this.tableData[i].inspection_major == PatientsInfo[j].ProjectId){
|
|
425
|
+ arr.push(PatientsInfo[j])
|
382
|
426
|
}
|
383
|
427
|
}
|
384
|
|
- this.chart.series[0].data = this.modesData.series
|
385
|
|
- this.chart.xAxis.data = this.modesData.xAxis
|
386
|
|
- this.getArrLength(this.chart.xAxis.data)
|
|
428
|
+ }
|
|
429
|
+ // console.log('arr',arr)
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+ var hash = {};
|
|
433
|
+ var i = 0;
|
|
434
|
+ var res = [];
|
|
435
|
+ arr.forEach(function(item) {
|
|
436
|
+ var ProjectName = item.ProjectName;
|
|
437
|
+ hash[ProjectName] ? res[hash[ProjectName] - 1].Count.push(item.Count) : hash[ProjectName] = ++i && res.push({
|
|
438
|
+ Count: [item.Count],
|
|
439
|
+ ProjectName: ProjectName,
|
|
440
|
+ ProjectId: item.ProjectId,
|
|
441
|
+ Sort:item.Sort,
|
|
442
|
+ })
|
|
443
|
+ });
|
|
444
|
+
|
|
445
|
+ res.map(item => {
|
|
446
|
+ item.Count = eval(item.Count.join('+'))
|
|
447
|
+ })
|
|
448
|
+
|
|
449
|
+ let arr1 = []
|
|
450
|
+ this.tableData.map(it => {
|
|
451
|
+ arr1.push(it.project_name)
|
|
452
|
+ })
|
|
453
|
+
|
|
454
|
+ arr1.forEach((item,index)=>{
|
|
455
|
+ if(!(res[index] && item ==res[index].ProjectName)){
|
|
456
|
+ res.splice(index,0,{Count:0, ProjectName: item, Sort: index+1})
|
|
457
|
+ }
|
|
458
|
+ })
|
|
459
|
+ res.map(item => {
|
|
460
|
+ this.modesData.series.push(parseInt(item.Count));
|
|
461
|
+ })
|
|
462
|
+ // console.log("this=====",this.tableData)
|
|
463
|
+ for (const key in this.tableData) {
|
|
464
|
+ this.modesData.xAxis.push(this.tableData[key].project_name);
|
|
465
|
+ let time = new Date(this.listQuery.end_time) - new Date(this.listQuery.start_time)
|
|
466
|
+ let day = parseInt(time / (1000 * 60 * 60 * 24))
|
|
467
|
+ this.obj.push(Math.round(day / this.tableData[key].inspection_frequency))
|
|
468
|
+ }
|
|
469
|
+
|
|
470
|
+ this.chart.series[0].data = this.modesData.series
|
|
471
|
+ this.chart.xAxis.data = this.modesData.xAxis
|
|
472
|
+ this.getArrLength(this.chart.xAxis.data)
|
387
|
473
|
}
|
388
|
474
|
})
|
389
|
475
|
},
|
|
@@ -418,7 +504,7 @@ export default {
|
418
|
504
|
PostSearch(key).then(response => {
|
419
|
505
|
if (response.data.state == 1) {
|
420
|
506
|
searchArray = response.data.data.patient
|
421
|
|
- console.log("searchArray",searchArray)
|
|
507
|
+ // console.log("searchArray",searchArray)
|
422
|
508
|
cb(searchArray)
|
423
|
509
|
} else {
|
424
|
510
|
cb([])
|
|
@@ -426,7 +512,7 @@ export default {
|
426
|
512
|
})
|
427
|
513
|
},
|
428
|
514
|
handleSelect(val) {
|
429
|
|
- console.log("val",val)
|
|
515
|
+ // console.log("val",val)
|
430
|
516
|
this.listQuery.search = val.name
|
431
|
517
|
this.patient_id = val.id
|
432
|
518
|
this.onSearch()
|
|
@@ -465,8 +551,7 @@ export default {
|
465
|
551
|
|
466
|
552
|
//获取该机构下的所有患者
|
467
|
553
|
this.getCurrentOrgPatients()
|
468
|
|
- //获取检验检查项目
|
469
|
|
- this.getInspectionTotalCount()
|
|
554
|
+
|
470
|
555
|
}
|
471
|
556
|
};
|
472
|
557
|
</script>
|