陈少旭 7 months ago
parent
commit
48e8420c14
1 changed files with 116 additions and 117 deletions
  1. 116 117
      src/xt_pages/outpatientTool/components/pdetail.vue

+ 116 - 117
src/xt_pages/outpatientTool/components/pdetail.vue View File

@@ -114,7 +114,7 @@
114 114
       </el-table-column>
115 115
 
116 116
       <el-table-column align="center" prop="price" label="单价">
117
-        <template slot-scope="scope">{{scope.row.price.toFixed(2)}}</template>
117
+        <template slot-scope="scope">{{scope.row.price}}</template>
118 118
       </el-table-column>
119 119
 
120 120
       <el-table-column align="center" prop="sum" label="金额">
@@ -552,7 +552,6 @@ export default {
552 552
                 newObj['item_id'] = orders[c].item_id
553 553
                 if (orders[c].p_type == 2) {
554 554
                   newObj['type'] = 2
555
-
556 555
                   newObj['item_spec'] = ""
557 556
                   newObj['item_name'] = orders[c].item_name
558 557
                 } else if (orders[c].p_type == 3) {
@@ -567,126 +566,126 @@ export default {
567 566
             tempPatientsTwo.push(obj)
568 567
           }
569 568
 
570
-          for (let d = 0; d < tempPatientsTwo.length; d++) {
571
-            tempPatientsTwo[d]['new_order_info'] = []
572
-            let project = []
573
-            let advice = []
574
-            for (let b = 0; b < tempPatientsTwo[d].order_info.length; b++) {
575
-              if (tempPatientsTwo[d].order_info[b].type == 1) {
576
-                advice.push(tempPatientsTwo[d].order_info[b])
577
-              } else {
578
-                project.push(tempPatientsTwo[d].order_info[b])
579
-              }
580
-            }
581
-            project = this.uniqueProjectAndAdvice(project)
582
-            advice = this.uniqueProjectAndAdvice(advice)
583
-
584
-            for (let i = 0; i < project.length; i++) {
585
-              let obj = {}
586
-              let count = 0
587
-              for (let a = 0; a < tempPatientsTwo[d].order_info.length; a++) {
588
-                if (project[i].item_id == tempPatientsTwo[d].order_info[a].item_id && project[i].price == tempPatientsTwo[d].order_info[a].price) {
589
-                  count = count + tempPatientsTwo[d].order_info[a].count
590
-                }
591
-              }
592
-
593
-              obj['price'] = project[i].price
594
-              obj['type'] = project[i].type
595
-              obj['item_name'] = project[i].item_name
596
-              obj['item_spec'] = project[i].item_spec
597
-
598
-              obj['order_status'] = project[i].order_status
599
-              obj['setl_time'] = project[i].setl_time
600
-
601
-              obj['med_type'] = project[i].med_type
602
-              obj['record_date'] = project[i].record_date
603
-              obj['item_cost_type'] = project[i].item_cost_type
604
-              obj['unit'] = project[i].unit
605
-
606
-
607
-              // obj['item_total'] = project[i].item_total
608
-
609
-              obj['item_id'] = project[i].item_id
610
-              obj['name'] = tempPatientsTwo[d].name
611
-              obj['patient_id'] = tempPatientsTwo[d].patient_id
612
-              obj['count'] = count
613
-              tempPatientsTwo[d].new_order_info.push(obj)
614
-            }
615
-
616
-            for (let i = 0; i < advice.length; i++) {
617
-              let obj = {}
618
-              let count = 0
619
-              for (let a = 0; a < tempPatientsTwo[d].order_info.length; a++) {
620
-                if (advice[i].item_id == tempPatientsTwo[d].order_info[a].item_id && advice[i].price == tempPatientsTwo[d].order_info[a].price) {
621
-                  count = count + tempPatientsTwo[d].order_info[a].count
622
-                }
623
-              }
624
-
625
-              obj['price'] = advice[i].price
626
-              obj['type'] = advice[i].type
627
-              obj['item_name'] = advice[i].item_name
628
-              obj['item_spec'] = advice[i].item_spec
629
-              obj['item_id'] = advice[i].item_id
630
-              obj['unit'] = advice[i].unit
631
-
632
-              obj['name'] = tempPatientsTwo[d].name
633
-              obj['order_status'] = advice[i].order_status
634
-              obj['setl_time'] = advice[i].setl_time
635
-
636
-              obj['med_type'] = advice[i].med_type
637
-              obj['record_date'] = advice[i].record_date
638
-              obj['item_cost_type'] = advice[i].item_cost_type
639
-              // obj['item_total'] = advice[i].item_total
640
-              obj['patient_id'] = tempPatientsTwo[d].patient_id
641
-              obj['count'] = count
642
-              tempPatientsTwo[d].new_order_info.push(obj)
643
-            }
644
-
645
-          }
646 569
           for (let i = 0; i < tempPatientsTwo.length; i++) {
647
-            let total = 0
648
-            for (let b = 0; b < tempPatientsTwo[i].new_order_info.length; b++) {
649
-              let new_name = tempPatientsTwo[i].new_order_info[b].item_name
650
-              if (new_name != undefined) {
651
-                if (new_name.length != 0) {
652
-                  console.log(parseFloat(tempPatientsTwo[i].new_order_info[b].count) * parseFloat(tempPatientsTwo[i].new_order_info[b].price))
653
-                  total = parseFloat(total) + parseFloat((parseFloat(tempPatientsTwo[i].new_order_info[b].count) * parseFloat(tempPatientsTwo[i].new_order_info[b].price)).toFixed(2))
654
-                }
655
-
656
-              }
657
-
570
+            for (let b = 0; b < tempPatientsTwo[i].order_info.length; b++) {
571
+            let obj = {
572
+              name: tempPatientsTwo[i].name,
573
+              patient_id: tempPatientsTwo[i].patient_id,
574
+              price: tempPatientsTwo[i].order_info[b].price,
575
+              type: tempPatientsTwo[i].order_info[b].type,
576
+              item_name: tempPatientsTwo[i].order_info[b].item_name,
577
+              item_id: tempPatientsTwo[i].order_info[b].item_id,
578
+              count: tempPatientsTwo[i].order_info[b].count,
579
+              item_spec: tempPatientsTwo[i].order_info[b].item_spec,
580
+              order_status: tempPatientsTwo[i].order_info[b].order_status,
581
+              setl_time: tempPatientsTwo[i].order_info[b].setl_time,
582
+              med_type: tempPatientsTwo[i].order_info[b].med_type,
583
+              record_date: tempPatientsTwo[i].order_info[b].record_date,
584
+              item_cost_type: tempPatientsTwo[i].order_info[b].item_cost_type,
585
+              unit: tempPatientsTwo[i].order_info[b].unit,
586
+              sum: parseFloat(tempPatientsTwo[i].order_info[b].price * tempPatientsTwo[i].order_info[b].count).toFixed(2),
658 587
             }
659
-            tempPatientsTwo[i]['total'] = total
588
+            this.tableData.push(obj)
660 589
           }
661
-          for (let i = 0; i < tempPatientsTwo.length; i++) {
662
-            // console.log(111,tempPatientsTwo[i].total)
663
-            if (tempPatientsTwo[i].new_order_info.length > 0) {
590
+        }
664 591
 
665
-              for (let b = 0; b < tempPatientsTwo[i].new_order_info.length; b++) {
592
+          // for (let d = 0; d < tempPatientsTwo.length; d++) {
593
+          //   tempPatientsTwo[d]['new_order_info'] = []
594
+          //   let project = []
595
+          //   let advice = []
596
+          //   for (let b = 0; b < tempPatientsTwo[d].order_info.length; b++) {
597
+          //     if (tempPatientsTwo[d].order_info[b].type == 1) {
598
+          //       advice.push(tempPatientsTwo[d].order_info[b])
599
+          //     } else {
600
+          //       project.push(tempPatientsTwo[d].order_info[b])
601
+          //     }
602
+          //   }
603
+          //   project = this.uniqueProjectAndAdvice(project)
604
+          //   advice = this.uniqueProjectAndAdvice(advice)
605
+          //
606
+          //   for (let i = 0; i < project.length; i++) {
607
+          //     let obj = {}
608
+          //     let count = 0
609
+          //     for (let a = 0; a < tempPatientsTwo[d].order_info.length; a++) {
610
+          //       if (project[i].item_id == tempPatientsTwo[d].order_info[a].item_id && project[i].price == tempPatientsTwo[d].order_info[a].price) {
611
+          //         count = count + tempPatientsTwo[d].order_info[a].count
612
+          //       }
613
+          //     }
614
+          //
615
+          //     obj['price'] = project[i].price
616
+          //     obj['type'] = project[i].type
617
+          //     obj['item_name'] = project[i].item_name
618
+          //     obj['item_spec'] = project[i].item_spec
619
+          //
620
+          //     obj['order_status'] = project[i].order_status
621
+          //     obj['setl_time'] = project[i].setl_time
622
+          //
623
+          //     obj['med_type'] = project[i].med_type
624
+          //     obj['record_date'] = project[i].record_date
625
+          //     obj['item_cost_type'] = project[i].item_cost_type
626
+          //     obj['unit'] = project[i].unit
627
+          //
628
+          //
629
+          //     // obj['item_total'] = project[i].item_total
630
+          //
631
+          //     obj['item_id'] = project[i].item_id
632
+          //     obj['name'] = tempPatientsTwo[d].name
633
+          //     obj['patient_id'] = tempPatientsTwo[d].patient_id
634
+          //     obj['count'] = count
635
+          //     tempPatientsTwo[d].new_order_info.push(obj)
636
+          //   }
637
+          //
638
+          //   for (let i = 0; i < advice.length; i++) {
639
+          //     let obj = {}
640
+          //     let count = 0
641
+          //     for (let a = 0; a < tempPatientsTwo[d].order_info.length; a++) {
642
+          //       if (advice[i].item_id == tempPatientsTwo[d].order_info[a].item_id && advice[i].price == tempPatientsTwo[d].order_info[a].price) {
643
+          //         count = count + tempPatientsTwo[d].order_info[a].count
644
+          //       }
645
+          //     }
646
+          //
647
+          //     obj['price'] = advice[i].price
648
+          //     obj['type'] = advice[i].type
649
+          //     obj['item_name'] = advice[i].item_name
650
+          //     obj['item_spec'] = advice[i].item_spec
651
+          //     obj['item_id'] = advice[i].item_id
652
+          //     obj['unit'] = advice[i].unit
653
+          //
654
+          //     obj['name'] = tempPatientsTwo[d].name
655
+          //     obj['order_status'] = advice[i].order_status
656
+          //     obj['setl_time'] = advice[i].setl_time
657
+          //
658
+          //     obj['med_type'] = advice[i].med_type
659
+          //     obj['record_date'] = advice[i].record_date
660
+          //     obj['item_cost_type'] = advice[i].item_cost_type
661
+          //     // obj['item_total'] = advice[i].item_total
662
+          //     obj['patient_id'] = tempPatientsTwo[d].patient_id
663
+          //     obj['count'] = count
664
+          //     tempPatientsTwo[d].new_order_info.push(obj)
665
+          //   }
666
+          //
667
+          // }
668
+          // for (let i = 0; i < tempPatientsTwo.length; i++) {
669
+          //   let total = 0
670
+          //   for (let b = 0; b < tempPatientsTwo[i].new_order_info.length; b++) {
671
+          //     let new_name = tempPatientsTwo[i].new_order_info[b].item_name
672
+          //     if (new_name != undefined) {
673
+          //       if (new_name.length != 0) {
674
+          //         console.log(parseFloat(tempPatientsTwo[i].new_order_info[b].count) * parseFloat(tempPatientsTwo[i].new_order_info[b].price))
675
+          //         total = parseFloat(total) + parseFloat((parseFloat(tempPatientsTwo[i].new_order_info[b].count) * parseFloat(tempPatientsTwo[i].new_order_info[b].price)).toFixed(2))
676
+          //       }
677
+          //
678
+          //     }
679
+          //
680
+          //   }
681
+          //   tempPatientsTwo[i]['total'] = total
682
+          // }
683
+          // for (let i = 0; i < tempPatientsTwo.length; i++) {
684
+          //   // console.log(111,tempPatientsTwo[i].total)
685
+          //   if (tempPatientsTwo[i].new_order_info.length > 0) {
686
+          //
666 687
 
667
-                let obj = {
668
-                  name: tempPatientsTwo[i].name,
669
-                  patient_id: tempPatientsTwo[i].patient_id,
670
-                  price: tempPatientsTwo[i].new_order_info[b].price,
671
-                  type: tempPatientsTwo[i].new_order_info[b].type,
672
-                  item_name: tempPatientsTwo[i].new_order_info[b].item_name,
673
-                  item_id: tempPatientsTwo[i].new_order_info[b].item_id,
674
-                  count: tempPatientsTwo[i].new_order_info[b].count,
675
-                  item_spec: tempPatientsTwo[i].new_order_info[b].item_spec,
676
-                  order_status: tempPatientsTwo[i].new_order_info[b].order_status,
677
-                  setl_time: tempPatientsTwo[i].new_order_info[b].setl_time,
678
-
679
-                  med_type: tempPatientsTwo[i].new_order_info[b].med_type,
680
-                  record_date: tempPatientsTwo[i].new_order_info[b].record_date,
681
-                  item_cost_type: tempPatientsTwo[i].new_order_info[b].item_cost_type,
682
-                  unit: tempPatientsTwo[i].new_order_info[b].unit,
683
-                }
684
-                obj['sum'] = parseFloat(tempPatientsTwo[i].new_order_info[b].price * tempPatientsTwo[i].new_order_info[b].count).toFixed(2)
685
-                obj['total'] = tempPatientsTwo[i].total
686
-                this.tableData.push(obj)
687
-              }
688
-            }
689
-          }
688
+          // }
690 689
           console.log(this.tableData)
691 690
           this.handleSpanTempArr()
692 691
           console.log(this.tableData)