Browse Source

8月9,舒和处方笺

yq1 8 months ago
parent
commit
c6473806e2
1 changed files with 31 additions and 54 deletions
  1. 31 54
      src/xt_pages/outpatientDoctorStation/template/prineight.vue

+ 31 - 54
src/xt_pages/outpatientDoctorStation/template/prineight.vue View File

@@ -188,7 +188,7 @@
188 188
                 </div>
189 189
               </template>
190 190
               <div style="position: relative;">
191
-                <div v-if="it.arr !== undefined">
191
+                <div v-if="it.arr != ''">
192 192
                   <div class="drugsOne" :style="{'border-right':it.arr.length>0 ? '1px solid black': 'none','width':'80%'}">
193 193
                     <span style="font-weight: bold" >
194 194
                       {{ index + 1 + "."}}
@@ -200,10 +200,9 @@
200 200
                     </span>&nbsp;
201 201
                     <div>
202 202
                       <template>
203
-                        <div v-if="it.arr.length<2">
203
+                        <!-- <div v-if="it.arr.length<2">
204 204
                           <div>
205 205
                             <span style="margin-left: 38px;">{{it.arr[0].advice_name ? it.arr[0].advice_name : ""}}</span>&nbsp;&nbsp;
206
-                            <!-- v-if="ite[0].drug.min_unit != ite[0].drug.dose_unit" -->
207 206
                             <span >
208 207
                               {{ it.arr[0].drug.dose }}{{ it.arr[0].drug.dose_unit }}&nbsp;* {{ it.arr[0].drug.min_number }}{{ it.arr[0].drug.min_unit }}/
209 208
                               {{it.arr[0].drug.max_unit}}
@@ -212,8 +211,8 @@
212 211
                           <div style="display: inline-block;position: absolute;left:85%;top:20px;margin-left: 5px;" >
213 212
                             &nbsp;共{{ it.arr[0].single_dose }}{{ it.arr[0].single_dose_unit }}
214 213
                           </div>
215
-                        </div>
216
-                        <div v-else>
214
+                        </div> -->
215
+                        <div>
217 216
                           <div v-for="(ites,ins) in it.arr" :key="ins">
218 217
                             <div>
219 218
                               <span style="margin-left: 38px;">{{ites[0].advice_name ? ites[0].advice_name : ""}}</span>&nbsp;&nbsp;
@@ -272,7 +271,7 @@
272 271
                       </div>
273 272
                   </template>
274 273
                 </div>
275
-                <div v-if="it.arr === undefined">
274
+                <div v-if="it.arr =='' ">
276 275
                   <div class="drugsOne" >
277 276
                     <span style="font-weight: bold" >
278 277
                       {{ index + 1 + "."}}
@@ -481,7 +480,7 @@ export default{
481 480
     return {
482 481
       doc_name:"",
483 482
       doctorList: [],
484
-      advicePrint: {},
483
+      advicePrint: [],
485 484
       yi:4,
486 485
       radio:'',
487 486
       arr:[],
@@ -598,58 +597,30 @@ export default{
598 597
       };
599 598
       getPrescriptionPrint(params).then((response) => {
600 599
         if (response.data.state == 1) {
601
-          var advicePrint = response.data.data.advicePrint;
600
+          const advicePrint = response.data.data.advicePrint;
602 601
           console.log("adviceprint9999", advicePrint);
603 602
           console.log("response.data.data", response.data.data);
604 603
           this.advicePrint = advicePrint;
605 604
           this.prescriptions = advicePrint;
606 605
           this.adminUser = response.data.data.roles
607 606
           this.doctorList_1 = response.data.data.eles;
608
-          
607
+
609 608
           for(let i=0;i< advicePrint.length;i++){
610
-            const arr = []
611 609
             const advicess = advicePrint[i].advices
612 610
             for(let j=0;j<advicess.length;j++){
613
-              // console.log('dddddd',j);
611
+              this.advicePrint[i].advices[j]['arr'] = []
614 612
               for(let x=j+1; x<advicess.length;x++){
615
-                // console.log('dddddd22222',x);
616 613
                 if(advicess[j].groupno == advicess[x].groupno){
617
-                  arr.push(advicess.splice(x,1))
614
+                  this.advicePrint[i].advices[j]['arr'].push(advicess.splice(x,1))
615
+                  // advicess.splice(x,1)
618 616
                   x--
619 617
                 }
620 618
               }
621
-              
622
-            }
623
-            // totalarr.push(arr)
624
-            console.log('123123123',arr);
625
-            const child = []
626
-            for(let x in arr){
627
-              if(arr.length>1){
628
-                for(let j in this.advicePrint[i].advices){
629
-                  if(arr[x][0].groupno==this.advicePrint[i].advices[j].groupno){
630
-                     child.push(arr[x])
631
-                  }
632
-                  console.log('pppppp',child);
633
-                  this.advicePrint[i]['advices'][j]['arr'] = child
634
-                  // this.advicePrint[i]['advices'][j].push(arr[x])
635
-                }
636
-              }else{
637
-                console.log('ggggggg',arr[x])
638
-                for(let j in this.advicePrint[i].advices){
639
-                  if(arr[x][0].groupno==this.advicePrint[i].advices[j].groupno){
640
-                    this.advicePrint[i]['advices'][j]['arr'] = arr[x]
641
-                    // this.advicePrint[i]['advices'][j]['arr'].push(arr[x])
642
-                  }
643
-                }
644
-              }
645
-           
646 619
             }
620
+            console.log('123123123',advicess);
647 621
           }
648
-         
649
-          console.log('4444444',this.advicePrint);
650
-        //  console.log('55555555',this.arr);
622
+          console.log('dddddd22222',this.advicePrint)
651 623
 
652
-          // console.log(this.doctorList_1, "医生列表");
653 624
           if (this.doctorList_1.length > 0) {
654 625
             var operatorsLen = this.doctorList_1.length;
655 626
             for (var index = 0; index < operatorsLen; index++) {
@@ -737,26 +708,32 @@ export default{
737 708
       for (let i = 0; i < this.prescriptions.length; i++) {
738 709
         if (id == this.prescriptions[i].id) {
739 710
           if (this.prescriptions[i].advices != null) {
740
-
711
+            console.log('123456789',this.prescriptions[i].advices);
712
+            
741 713
             for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
742 714
               total =
743 715
                 total +
744 716
                 (this.prescriptions[i].advices[a].price *
745 717
                   this.prescriptions[i].advices[a].prescribing_number) ;
746 718
 
747
-                if(this.prescriptions[i].advices[a].arr !=undefined){
748
-                  if(this.prescriptions[i].advices[a].arr.length<2){
719
+                if(this.prescriptions[i].advices[a].arr !=''){
720
+                  for(let b in this.prescriptions[i].advices[a].arr){
749 721
                     zimuyao = zimuyao +
750
-                    this.prescriptions[i].advices[a].arr[0].price *
751
-                    this.prescriptions[i].advices[a].arr[0].prescribing_number
752
-                  }else{
753
-                    const child = this.prescriptions[i].advices[a].arr
754
-                    for(let i in child){
755
-                      zimuyao = zimuyao +
756
-                      child[i][0].price *
757
-                      child[i][0].prescribing_number
758
-                    }
722
+                    this.prescriptions[i].advices[a].arr[b][0].price *
723
+                    this.prescriptions[i].advices[a].arr[b][0].prescribing_number
759 724
                   }
725
+                //   if(this.prescriptions[i].advices[a].arr.length<2){
726
+                //     zimuyao = zimuyao +
727
+                //     this.prescriptions[i].advices[a].arr[0].price *
728
+                //     this.prescriptions[i].advices[a].arr[0].prescribing_number
729
+                //   }else{
730
+                //     const child = this.prescriptions[i].advices[a].arr
731
+                //     for(let i in child){
732
+                //       zimuyao = zimuyao +
733
+                //       child[i][0].price *
734
+                //       child[i][0].prescribing_number
735
+                //     }
736
+                //   }
760 737
                 }
761 738
             }
762 739
           }