|
@@ -325,46 +325,70 @@
|
325
|
325
|
}
|
326
|
326
|
})
|
327
|
327
|
},
|
328
|
|
- setMonthPrescription(month_prescriptions){
|
|
328
|
+ setMonthPrescription(month_prescriptions) {
|
|
329
|
+ console.log("11111111")
|
|
330
|
+ console.log(month_prescriptions)
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+ this.month_prescriptions = []
|
|
334
|
+
|
329
|
335
|
let drug_month_prescriptions = {
|
330
|
|
- advices:[],
|
|
336
|
+ advices: []
|
331
|
337
|
}
|
332
|
|
- let drug_ids=[]
|
333
|
|
- let project_month_prescriptions ={
|
334
|
|
- project:[],
|
|
338
|
+ let drug_ids = []
|
|
339
|
+ let project_month_prescriptions = {
|
|
340
|
+ project: []
|
335
|
341
|
|
336
|
342
|
}
|
337
|
|
- let project_ids=[]
|
|
343
|
+ let project_ids = []
|
338
|
344
|
|
339
|
|
- let addition_month_prescriptions ={
|
340
|
|
- addtions:[],
|
|
345
|
+ let addition_month_prescriptions = {
|
|
346
|
+ addition: []
|
341
|
347
|
|
342
|
348
|
}
|
343
|
|
- let additions_ids=[]
|
|
349
|
+ let additions_ids = []
|
344
|
350
|
|
|
351
|
+ for (let i = 0; i < month_prescriptions.length; i++) {
|
|
352
|
+ if (month_prescriptions[i].type == 1) { //药品
|
|
353
|
+ for (let a = 0; a < month_prescriptions[i].advices.length; a++) {
|
|
354
|
+ let obj = {
|
|
355
|
+ id: month_prescriptions[i].advices[a].drug_id,
|
|
356
|
+ price:month_prescriptions[i].advices[a].price,
|
345
|
357
|
|
346
|
|
- for (let i = 0; i < month_prescriptions.length; i++){
|
347
|
|
- if(month_prescriptions[i].type == 1){ //药品
|
348
|
|
- for (let a = 0; a < month_prescriptions[i].advices.length; a++){
|
349
|
|
- drug_ids.push(month_prescriptions[i].advices[a].drug_id)
|
|
358
|
+ }
|
|
359
|
+ drug_ids.push(obj)
|
350
|
360
|
drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
|
351
|
361
|
}
|
352
|
362
|
|
353
|
|
- }else if(month_prescriptions[i].type == 2){ //项目
|
354
|
|
- for (let a = 0; a < month_prescriptions[i].project.length; a++){
|
355
|
|
- project_ids.push(month_prescriptions[i].project[a].project_id)
|
|
363
|
+ } else if (month_prescriptions[i].type == 2) { //项目
|
|
364
|
+ for (let a = 0; a < month_prescriptions[i].project.length; a++) {
|
|
365
|
+ let obj = {
|
|
366
|
+ id: month_prescriptions[i].project[a].project_id,
|
|
367
|
+ price:month_prescriptions[i].project[a].price,
|
|
368
|
+
|
|
369
|
+ }
|
|
370
|
+ project_ids.push(obj)
|
356
|
371
|
project_month_prescriptions.project.push(month_prescriptions[i].project[a])
|
357
|
372
|
}
|
358
|
373
|
}
|
359
|
374
|
//附加收费
|
360
|
375
|
for (let a = 0; a < month_prescriptions[i].addition.length; a++) {
|
361
|
|
- additions_ids.push(month_prescriptions[i].addition[a].item_id)
|
362
|
|
- addition_month_prescriptions.addtions.push(month_prescriptions[i].addition[a])
|
363
|
|
- }
|
|
376
|
+ let obj = {
|
|
377
|
+ id: month_prescriptions[i].addition[a].item_id,
|
|
378
|
+ price:month_prescriptions[i].addition[a].price,
|
364
|
379
|
|
365
|
|
- }
|
|
380
|
+ }
|
|
381
|
+ additions_ids.push(obj)
|
|
382
|
+ addition_month_prescriptions.addition.push(month_prescriptions[i].addition[a])
|
366
|
383
|
|
|
384
|
+ }
|
367
|
385
|
|
|
386
|
+ }
|
|
387
|
+ console.log("00000000000000")
|
|
388
|
+ console.log(drug_ids)
|
|
389
|
+ console.log(project_ids)
|
|
390
|
+ console.log(additions_ids)
|
|
391
|
+ console.log("00000000000000")
|
368
|
392
|
|
369
|
393
|
|
370
|
394
|
const obj = {}
|
|
@@ -372,119 +396,278 @@
|
372
|
396
|
const obj2 = {}
|
373
|
397
|
|
374
|
398
|
drug_ids = drug_ids.reduce((cur, next) => {
|
375
|
|
- obj[next] ? '' : obj[next] = true && cur.push(next)
|
|
399
|
+ obj[next.price] ? '' : obj[next.price] = true && cur.push(next)
|
376
|
400
|
return cur
|
377
|
401
|
}, []) // 设置cur默认类型为数组,并且初始值为空的数组
|
378
|
402
|
project_ids = project_ids.reduce((cur, next) => {
|
379
|
|
- obj1[next] ? '' : obj1[next] = true && cur.push(next)
|
|
403
|
+ obj[next.price] ? '' : obj[next.price] = true && cur.push(next)
|
380
|
404
|
return cur
|
381
|
405
|
}, []) // 设置cur默认类型为数组,并且初始值为空的数组
|
382
|
406
|
additions_ids = additions_ids.reduce((cur, next) => {
|
383
|
|
- obj2[next] ? '' : obj2[next] = true && cur.push(next)
|
|
407
|
+ obj[next.price] ? '' : obj[next.price] = true && cur.push(next)
|
384
|
408
|
return cur
|
385
|
409
|
}, []) // 设置cur默认类型为数组,并且初始值为空的数组
|
386
|
410
|
|
387
|
411
|
|
388
|
412
|
|
|
413
|
+ let drugs = []
|
|
414
|
+ let projects = []
|
|
415
|
+ let additions = []
|
389
|
416
|
|
390
|
|
-
|
391
|
|
- let drugs =[]
|
392
|
|
- let projects =[]
|
393
|
|
- let additions =[]
|
394
|
|
-
|
395
|
|
-
|
396
|
|
- for (let i = 0; i < drug_ids.length; i++){
|
|
417
|
+ for (let i = 0; i < drug_ids.length; i++) {
|
397
|
418
|
let obj = {}
|
398
|
|
- let price = 0
|
399
|
419
|
let count = 0
|
400
|
|
- for (let a = 0; a < drug_month_prescriptions.advices.length; a++){
|
401
|
|
- if(drug_ids[i] == drug_month_prescriptions.advices[a].drug_id){
|
|
420
|
+ for (let a = 0; a < drug_month_prescriptions.advices.length; a++) {
|
|
421
|
+ if (drug_ids[i].price == drug_month_prescriptions.advices[a].price) {
|
402
|
422
|
obj['drug_name'] = drug_month_prescriptions.advices[a].advice_name
|
403
|
423
|
obj['single_dose'] = drug_month_prescriptions.advices[a].single_dose
|
404
|
424
|
obj['delivery_way'] = drug_month_prescriptions.advices[a].delivery_way
|
405
|
425
|
obj['execution_frequency'] = drug_month_prescriptions.advices[a].execution_frequency
|
406
|
426
|
obj['day'] = drug_month_prescriptions.advices[a].day
|
407
|
427
|
// obj['prescribing_number'] = obj['prescribing_number'] + drug_month_prescriptions.advices[a].prescribing_number
|
408
|
|
- obj['prescribing_number_unit'] = drug_month_prescriptions.advices[a].prescribing_number_unit
|
409
|
|
- obj['medical_insurance_number'] = drug_month_prescriptions.advices[a].drug.medical_insurance_number
|
410
|
|
- obj['id'] = drug_month_prescriptions.advices[a].drug_id
|
|
428
|
+ obj['prescribing_number_unit'] = drug_month_prescriptions.advices[a].prescribing_number_unit
|
|
429
|
+ obj['medical_insurance_number'] = drug_month_prescriptions.advices[a].drug.medical_insurance_number
|
|
430
|
+ obj['id'] = drug_month_prescriptions.advices[a].drug_id
|
411
|
431
|
// obj['retail_price'] = obj['retail_price'] + drug_month_prescriptions.advices[a].drug.retail_price
|
412
|
|
-
|
413
|
|
-
|
414
|
|
- count = count + drug_month_prescriptions.advices[a].prescribing_number
|
415
|
|
- price = price + drug_month_prescriptions.advices[a].price
|
|
432
|
+ obj['retail_price'] = parseFloat(drug_month_prescriptions.advices[a].price)
|
|
433
|
+ count = count + drug_month_prescriptions.advices[a].prescribing_number
|
416
|
434
|
|
417
|
435
|
}
|
418
|
436
|
}
|
419
|
|
- obj['retail_price'] = price
|
420
|
437
|
obj['prescribing_number'] = count
|
421
|
438
|
drugs.push(obj)
|
422
|
439
|
}
|
423
|
440
|
|
424
|
|
-
|
425
|
|
-
|
426
|
|
-
|
427
|
|
- for (let i = 0; i < project_ids.length; i++){
|
|
441
|
+ for (let i = 0; i < project_ids.length; i++) {
|
428
|
442
|
let obj = {}
|
429
|
|
- let price = 0
|
430
|
443
|
let count = 0
|
431
|
|
- for (let a = 0; a < project_month_prescriptions.project.length; a++){
|
432
|
|
- if(project_ids[i] == project_month_prescriptions.project[a].project_id){
|
|
444
|
+ for (let a = 0; a < project_month_prescriptions.project.length; a++) {
|
|
445
|
+ if (project_ids[i].price == project_month_prescriptions.project[a].price) {
|
433
|
446
|
obj['project_name'] = project_month_prescriptions.project[a].project.project_name
|
434
|
447
|
obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification
|
435
|
448
|
obj['single_dose'] = project_month_prescriptions.project[a].single_dose
|
436
|
449
|
obj['delivery_way'] = project_month_prescriptions.project[a].delivery_way
|
437
|
450
|
obj['execution_frequency'] = project_month_prescriptions.project[a].execution_frequency
|
438
|
451
|
obj['number_days'] = project_month_prescriptions.project[a].day
|
439
|
|
- obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code
|
440
|
|
- obj['unit'] = project_month_prescriptions.project[a].unit
|
441
|
|
- obj['project_id'] = project_month_prescriptions.project[a].project_id
|
442
|
|
- count = count + project_month_prescriptions.project[a].count
|
443
|
|
- price = price + project_month_prescriptions.project[a].price
|
|
452
|
+ obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code
|
|
453
|
+ obj['unit'] = project_month_prescriptions.project[a].unit
|
|
454
|
+ obj['project_id'] = project_month_prescriptions.project[a].project_id
|
|
455
|
+ count = count + project_month_prescriptions.project[a].count
|
|
456
|
+ // price = price + project_month_prescriptions.project[a].price
|
|
457
|
+ obj['price'] = parseFloat(project_month_prescriptions.project[a].price)
|
|
458
|
+
|
444
|
459
|
}
|
445
|
460
|
}
|
446
|
|
- obj['price'] = price
|
447
|
461
|
obj['total'] = count
|
448
|
462
|
projects.push(obj)
|
449
|
463
|
}
|
450
|
464
|
|
451
|
|
-
|
452
|
|
- for (let i = 0; i < additions_ids.length; i++){
|
|
465
|
+ for (let i = 0; i < additions_ids.length; i++) {
|
453
|
466
|
let obj = {}
|
454
|
|
- let price = 0
|
455
|
467
|
let count = 0
|
456
|
|
- for (let a = 0; a < addition_month_prescriptions.addition.length; a++){
|
457
|
|
- if(project_ids[i] == addition_month_prescriptions.addition[a].item_id){
|
458
|
|
- obj['item_name'] = addition_month_prescriptions.addition[a].item_name
|
459
|
|
- obj['id'] = addition_month_prescriptions.addition[a].id
|
460
|
|
- obj['item_id'] = addition_month_prescriptions.addition[a].item_id
|
461
|
|
- count = count + addition_month_prescriptions.addition[a].count
|
462
|
|
- price = price + addition_month_prescriptions.addition[a].price
|
|
468
|
+ console.log(addition_month_prescriptions.addition)
|
|
469
|
+ if (addition_month_prescriptions.addition) {
|
|
470
|
+ for (let a = 0; a < addition_month_prescriptions.addition.length; a++) {
|
|
471
|
+ if (project_ids[i].price == addition_month_prescriptions.addition[a].price) {
|
|
472
|
+ obj['item_name'] = addition_month_prescriptions.addition[a].item_name
|
|
473
|
+ obj['id'] = addition_month_prescriptions.addition[a].id
|
|
474
|
+ obj['item_id'] = addition_month_prescriptions.addition[a].item_id
|
|
475
|
+ count = count + addition_month_prescriptions.addition[a].count
|
|
476
|
+ obj['price'] = parseFloat(addition_month_prescriptions.addition[a].price)
|
|
477
|
+ }
|
463
|
478
|
}
|
|
479
|
+ obj['count'] = count
|
|
480
|
+ additions.push(obj)
|
464
|
481
|
}
|
465
|
|
- obj['price'] = price
|
466
|
|
- obj['count'] = count
|
467
|
|
- additions.push(obj)
|
468
|
482
|
}
|
469
|
483
|
|
|
484
|
+ console.log(drugs)
|
|
485
|
+ console.log(projects)
|
|
486
|
+ console.log(additions)
|
470
|
487
|
|
471
|
488
|
let p1 = {
|
472
|
489
|
name: '处方' + 1,
|
473
|
490
|
advices: drugs,
|
474
|
491
|
project: [],
|
475
|
|
- type:1,
|
476
|
|
- addition: additions,
|
|
492
|
+ type: 1,
|
|
493
|
+ addition: additions
|
477
|
494
|
}
|
478
|
495
|
let p2 = {
|
479
|
496
|
name: '处方' + 2,
|
480
|
|
- type:2,
|
|
497
|
+ type: 2,
|
481
|
498
|
project: projects,
|
482
|
499
|
advices: [],
|
|
500
|
+ addition: []
|
|
501
|
+
|
483
|
502
|
}
|
|
503
|
+
|
484
|
504
|
this.month_prescriptions.push(p1)
|
485
|
505
|
this.month_prescriptions.push(p2)
|
486
|
506
|
|
|
507
|
+ this.curMonthPrescriptions = this.month_prescriptions[0]
|
|
508
|
+
|
487
|
509
|
},
|
|
510
|
+
|
|
511
|
+ // setMonthPrescription(month_prescriptions){
|
|
512
|
+ // let drug_month_prescriptions = {
|
|
513
|
+ // advices:[],
|
|
514
|
+ // }
|
|
515
|
+ // let drug_ids=[]
|
|
516
|
+ // let project_month_prescriptions ={
|
|
517
|
+ // project:[],
|
|
518
|
+ //
|
|
519
|
+ // }
|
|
520
|
+ // let project_ids=[]
|
|
521
|
+ //
|
|
522
|
+ // let addition_month_prescriptions ={
|
|
523
|
+ // addtions:[],
|
|
524
|
+ //
|
|
525
|
+ // }
|
|
526
|
+ // let additions_ids=[]
|
|
527
|
+ //
|
|
528
|
+ //
|
|
529
|
+ // for (let i = 0; i < month_prescriptions.length; i++){
|
|
530
|
+ // if(month_prescriptions[i].type == 1){ //药品
|
|
531
|
+ // for (let a = 0; a < month_prescriptions[i].advices.length; a++){
|
|
532
|
+ // drug_ids.push(month_prescriptions[i].advices[a].drug_id)
|
|
533
|
+ // drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
|
|
534
|
+ // }
|
|
535
|
+ //
|
|
536
|
+ // }else if(month_prescriptions[i].type == 2){ //项目
|
|
537
|
+ // for (let a = 0; a < month_prescriptions[i].project.length; a++){
|
|
538
|
+ // project_ids.push(month_prescriptions[i].project[a].project_id)
|
|
539
|
+ // project_month_prescriptions.project.push(month_prescriptions[i].project[a])
|
|
540
|
+ // }
|
|
541
|
+ // }
|
|
542
|
+ // //附加收费
|
|
543
|
+ // for (let a = 0; a < month_prescriptions[i].addition.length; a++) {
|
|
544
|
+ // additions_ids.push(month_prescriptions[i].addition[a].item_id)
|
|
545
|
+ // addition_month_prescriptions.addtions.push(month_prescriptions[i].addition[a])
|
|
546
|
+ // }
|
|
547
|
+ //
|
|
548
|
+ // }
|
|
549
|
+ //
|
|
550
|
+ //
|
|
551
|
+ //
|
|
552
|
+ //
|
|
553
|
+ // const obj = {}
|
|
554
|
+ // const obj1 = {}
|
|
555
|
+ // const obj2 = {}
|
|
556
|
+ //
|
|
557
|
+ // drug_ids = drug_ids.reduce((cur, next) => {
|
|
558
|
+ // obj[next] ? '' : obj[next] = true && cur.push(next)
|
|
559
|
+ // return cur
|
|
560
|
+ // }, []) // 设置cur默认类型为数组,并且初始值为空的数组
|
|
561
|
+ // project_ids = project_ids.reduce((cur, next) => {
|
|
562
|
+ // obj1[next] ? '' : obj1[next] = true && cur.push(next)
|
|
563
|
+ // return cur
|
|
564
|
+ // }, []) // 设置cur默认类型为数组,并且初始值为空的数组
|
|
565
|
+ // additions_ids = additions_ids.reduce((cur, next) => {
|
|
566
|
+ // obj2[next] ? '' : obj2[next] = true && cur.push(next)
|
|
567
|
+ // return cur
|
|
568
|
+ // }, []) // 设置cur默认类型为数组,并且初始值为空的数组
|
|
569
|
+ //
|
|
570
|
+ //
|
|
571
|
+ //
|
|
572
|
+ //
|
|
573
|
+ //
|
|
574
|
+ // let drugs =[]
|
|
575
|
+ // let projects =[]
|
|
576
|
+ // let additions =[]
|
|
577
|
+ //
|
|
578
|
+ //
|
|
579
|
+ // for (let i = 0; i < drug_ids.length; i++){
|
|
580
|
+ // let obj = {}
|
|
581
|
+ // let price = 0
|
|
582
|
+ // let count = 0
|
|
583
|
+ // for (let a = 0; a < drug_month_prescriptions.advices.length; a++){
|
|
584
|
+ // if(drug_ids[i] == drug_month_prescriptions.advices[a].drug_id){
|
|
585
|
+ // obj['drug_name'] = drug_month_prescriptions.advices[a].advice_name
|
|
586
|
+ // obj['single_dose'] = drug_month_prescriptions.advices[a].single_dose
|
|
587
|
+ // obj['delivery_way'] = drug_month_prescriptions.advices[a].delivery_way
|
|
588
|
+ // obj['execution_frequency'] = drug_month_prescriptions.advices[a].execution_frequency
|
|
589
|
+ // obj['day'] = drug_month_prescriptions.advices[a].day
|
|
590
|
+ // // obj['prescribing_number'] = obj['prescribing_number'] + drug_month_prescriptions.advices[a].prescribing_number
|
|
591
|
+ // obj['prescribing_number_unit'] = drug_month_prescriptions.advices[a].prescribing_number_unit
|
|
592
|
+ // obj['medical_insurance_number'] = drug_month_prescriptions.advices[a].drug.medical_insurance_number
|
|
593
|
+ // obj['id'] = drug_month_prescriptions.advices[a].drug_id
|
|
594
|
+ // // obj['retail_price'] = obj['retail_price'] + drug_month_prescriptions.advices[a].drug.retail_price
|
|
595
|
+ //
|
|
596
|
+ //
|
|
597
|
+ // count = count + drug_month_prescriptions.advices[a].prescribing_number
|
|
598
|
+ // price = price + drug_month_prescriptions.advices[a].price
|
|
599
|
+ //
|
|
600
|
+ // }
|
|
601
|
+ // }
|
|
602
|
+ // obj['retail_price'] = price
|
|
603
|
+ // obj['prescribing_number'] = count
|
|
604
|
+ // drugs.push(obj)
|
|
605
|
+ // }
|
|
606
|
+ //
|
|
607
|
+ //
|
|
608
|
+ //
|
|
609
|
+ //
|
|
610
|
+ // for (let i = 0; i < project_ids.length; i++){
|
|
611
|
+ // let obj = {}
|
|
612
|
+ // let price = 0
|
|
613
|
+ // let count = 0
|
|
614
|
+ // for (let a = 0; a < project_month_prescriptions.project.length; a++){
|
|
615
|
+ // if(project_ids[i] == project_month_prescriptions.project[a].project_id){
|
|
616
|
+ // obj['project_name'] = project_month_prescriptions.project[a].project.project_name
|
|
617
|
+ // obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification
|
|
618
|
+ // obj['single_dose'] = project_month_prescriptions.project[a].single_dose
|
|
619
|
+ // obj['delivery_way'] = project_month_prescriptions.project[a].delivery_way
|
|
620
|
+ // obj['execution_frequency'] = project_month_prescriptions.project[a].execution_frequency
|
|
621
|
+ // obj['number_days'] = project_month_prescriptions.project[a].day
|
|
622
|
+ // obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code
|
|
623
|
+ // obj['unit'] = project_month_prescriptions.project[a].unit
|
|
624
|
+ // obj['project_id'] = project_month_prescriptions.project[a].project_id
|
|
625
|
+ // count = count + project_month_prescriptions.project[a].count
|
|
626
|
+ // price = price + project_month_prescriptions.project[a].price
|
|
627
|
+ // }
|
|
628
|
+ // }
|
|
629
|
+ // obj['price'] = price
|
|
630
|
+ // obj['total'] = count
|
|
631
|
+ // projects.push(obj)
|
|
632
|
+ // }
|
|
633
|
+ //
|
|
634
|
+ //
|
|
635
|
+ // for (let i = 0; i < additions_ids.length; i++){
|
|
636
|
+ // let obj = {}
|
|
637
|
+ // let price = 0
|
|
638
|
+ // let count = 0
|
|
639
|
+ // for (let a = 0; a < addition_month_prescriptions.addition.length; a++){
|
|
640
|
+ // if(project_ids[i] == addition_month_prescriptions.addition[a].item_id){
|
|
641
|
+ // obj['item_name'] = addition_month_prescriptions.addition[a].item_name
|
|
642
|
+ // obj['id'] = addition_month_prescriptions.addition[a].id
|
|
643
|
+ // obj['item_id'] = addition_month_prescriptions.addition[a].item_id
|
|
644
|
+ // count = count + addition_month_prescriptions.addition[a].count
|
|
645
|
+ // price = price + addition_month_prescriptions.addition[a].price
|
|
646
|
+ // }
|
|
647
|
+ // }
|
|
648
|
+ // obj['price'] = price
|
|
649
|
+ // obj['count'] = count
|
|
650
|
+ // additions.push(obj)
|
|
651
|
+ // }
|
|
652
|
+ //
|
|
653
|
+ //
|
|
654
|
+ // let p1 = {
|
|
655
|
+ // name: '处方' + 1,
|
|
656
|
+ // advices: drugs,
|
|
657
|
+ // project: [],
|
|
658
|
+ // type:1,
|
|
659
|
+ // addition: additions,
|
|
660
|
+ // }
|
|
661
|
+ // let p2 = {
|
|
662
|
+ // name: '处方' + 2,
|
|
663
|
+ // type:2,
|
|
664
|
+ // project: projects,
|
|
665
|
+ // advices: [],
|
|
666
|
+ // }
|
|
667
|
+ // this.month_prescriptions.push(p1)
|
|
668
|
+ // this.month_prescriptions.push(p2)
|
|
669
|
+ //
|
|
670
|
+ // },
|
488
|
671
|
getList() {
|
489
|
672
|
let params = {
|
490
|
673
|
'record_date': this.record_date,
|