Browse Source

Merge branch '20230223_pc_vue_new_branch' of http://git.shengws.com/csx/Vue_New into 20230223_pc_vue_new_branch

28169 10 months ago
parent
commit
01c47a4db2
1 changed files with 92 additions and 63 deletions
  1. 92 63
      src/xt_pages/outpatientDoctorStation/template/prineight.vue

+ 92 - 63
src/xt_pages/outpatientDoctorStation/template/prineight.vue View File

17
           </div>
17
           </div>
18
           <!-- v-if="prescriptions[index].med_type == '1112'" -->
18
           <!-- v-if="prescriptions[index].med_type == '1112'" -->
19
           <div class="printTitle" v-else>
19
           <div class="printTitle" v-else>
20
-            <div style="font-size: 14px;font-weight: normal;text-align: right;" 
20
+            <div style="font-size: 14px;font-weight: normal;text-align: right;"
21
               v-if="prescriptions[index].med_type == '1112'">(精二)
21
               v-if="prescriptions[index].med_type == '1112'">(精二)
22
             </div>
22
             </div>
23
             <span>{{ orgname }}处方笺</span>
23
             <span>{{ orgname }}处方笺</span>
24
           </div>
24
           </div>
25
           <!-- 非精神处方 -->
25
           <!-- 非精神处方 -->
26
-          <div  style="border-bottom: 1px solid black;border-top: 1px solid black;width: 100%;" 
26
+          <div  style="border-bottom: 1px solid black;border-top: 1px solid black;width: 100%;"
27
             v-if="prescriptions[index].med_type != '1111' && prescriptions[index].med_type != '1112'">
27
             v-if="prescriptions[index].med_type != '1111' && prescriptions[index].med_type != '1112'">
28
-            <div style="display: flex;margin: 10px 0;line-height: 24px;padding: 0 10px;">
28
+            <div style="display: flex;line-height: 24px;padding: 0 10px;">
29
               <div style="flex: 1;">
29
               <div style="flex: 1;">
30
                 NO:
30
                 NO:
31
               </div>
31
               </div>
48
                 </span> -->
48
                 </span> -->
49
               </div>
49
               </div>
50
             </div>
50
             </div>
51
-            <div  style="display: flex;margin: 10px 0;line-height: 24px;padding: 0 10px;">
51
+            <div  style="display: flex;line-height: 24px;padding: 0 10px;">
52
               <p style="width: 200px;">姓名:{{ item.patient.name ? item.patient.name : "" }}</p>
52
               <p style="width: 200px;">姓名:{{ item.patient.name ? item.patient.name : "" }}</p>
53
               <p style="width: 200px;">
53
               <p style="width: 200px;">
54
                 性别:
54
                 性别:
65
                 过敏史:{{ item.patient.allergic_history }}
65
                 过敏史:{{ item.patient.allergic_history }}
66
               </div>
66
               </div>
67
             </div>
67
             </div>
68
-            <div style="flex: 2;margin: 10px 0;">住址/电话:{{ item.patient.home_address }}&nbsp;<span>{{ item.patient.phone }}</span></div>
68
+            <div style="line-height: 24px;padding: 0 10px;">住址/电话:{{ item.patient.home_address }}&nbsp;<span>{{ item.patient.phone }}</span></div>
69
           </div>
69
           </div>
70
           <!-- 精二 -->
70
           <!-- 精二 -->
71
           <div style="border-bottom: 1px solid black;border-top: 1px solid black;width: 100%;"
71
           <div style="border-bottom: 1px solid black;border-top: 1px solid black;width: 100%;"
77
                 ) }}</div>
77
                 ) }}</div>
78
               <div style="flex: 1;">日期:{{ getTime(item.ctime) ? getTime(item.ctime) : "" }}</div>
78
               <div style="flex: 1;">日期:{{ getTime(item.ctime) ? getTime(item.ctime) : "" }}</div>
79
             </div>
79
             </div>
80
-            
80
+
81
             <div  style="display: flex;padding: 0 10px;">
81
             <div  style="display: flex;padding: 0 10px;">
82
               <p style="width: 200px;">姓名:{{ item.patient.name ? item.patient.name : "" }}</p>
82
               <p style="width: 200px;">姓名:{{ item.patient.name ? item.patient.name : "" }}</p>
83
               <p style="width: 200px;">
83
               <p style="width: 200px;">
110
             </div>
110
             </div>
111
           </div>
111
           </div>
112
 
112
 
113
-          <div class="prescriptionBox" style="height: 300px;">
113
+          <div class="prescriptionBox" style="min-height: 300px;">
114
             <div class="Rp">Rp:</div>
114
             <div class="Rp">Rp:</div>
115
             <div
115
             <div
116
               class="drugsBox"
116
               class="drugsBox"
119
             >
119
             >
120
               <template v-if="index==yi+1&&item.advices.length>5">
120
               <template v-if="index==yi+1&&item.advices.length>5">
121
                 <!-- 非精神处方 -->
121
                 <!-- 非精神处方 -->
122
-                <div style="margin: 20px 0px; border-bottom: 1px solid black;border-top: 1px solid black;" 
122
+                <div style="margin: 20px 0px; border-bottom: 1px solid black;border-top: 1px solid black;"
123
                   v-if="prescriptions[index].med_type != '1111' && prescriptions[index].med_type != '1112'">
123
                   v-if="prescriptions[index].med_type != '1111' && prescriptions[index].med_type != '1112'">
124
                   <div style="display: flex;margin: 10px 0;line-height: 24px;padding: 0 10px;">
124
                   <div style="display: flex;margin: 10px 0;line-height: 24px;padding: 0 10px;">
125
                     <div style="flex: 1;">
125
                     <div style="flex: 1;">
162
                   <div style="display: flex;">
162
                   <div style="display: flex;">
163
                     <div style="flex: 1;">处方编号:</div>
163
                     <div style="flex: 1;">处方编号:</div>
164
                     <div style="flex: 1;">日期:{{ getTime(item.ctime) ? getTime(item.ctime) : "" }}</div>
164
                     <div style="flex: 1;">日期:{{ getTime(item.ctime) ? getTime(item.ctime) : "" }}</div>
165
-                  </div>               
165
+                  </div>
166
                   <div  style="display: flex;margin: 10px 0;line-height: 24px;padding: 0 10px;">
166
                   <div  style="display: flex;margin: 10px 0;line-height: 24px;padding: 0 10px;">
167
                     <p style="width: 200px;">姓名:{{ item.patient.name ? item.patient.name : "" }}</p>
167
                     <p style="width: 200px;">姓名:{{ item.patient.name ? item.patient.name : "" }}</p>
168
                     <p style="width: 200px;">
168
                     <p style="width: 200px;">
188
                 </div>
188
                 </div>
189
               </template>
189
               </template>
190
               <div style="position: relative;">
190
               <div style="position: relative;">
191
-                <div v-if="it.arr !== undefined">
191
+                <div v-if="it.arr != ''">
192
                   <div class="drugsOne" :style="{'border-right':it.arr.length>0 ? '1px solid black': 'none','width':'80%'}">
192
                   <div class="drugsOne" :style="{'border-right':it.arr.length>0 ? '1px solid black': 'none','width':'80%'}">
193
                     <span style="font-weight: bold" >
193
                     <span style="font-weight: bold" >
194
                       {{ index + 1 + "."}}
194
                       {{ index + 1 + "."}}
200
                     </span>&nbsp;
200
                     </span>&nbsp;
201
                     <div>
201
                     <div>
202
                       <template>
202
                       <template>
203
+                        <!-- <div v-if="it.arr.length<2">
204
+                          <div>
205
+                            <span style="margin-left: 38px;">{{it.arr[0].advice_name ? it.arr[0].advice_name : ""}}</span>&nbsp;&nbsp;
206
+                            <span >
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 }}/
208
+                              {{it.arr[0].drug.max_unit}}
209
+                            </span>&nbsp;
210
+                          </div>
211
+                          <div style="display: inline-block;position: absolute;left:85%;top:20px;margin-left: 5px;" >
212
+                            &nbsp;共{{ it.arr[0].single_dose }}{{ it.arr[0].single_dose_unit }}
213
+                          </div>
214
+                        </div> -->
203
                         <div>
215
                         <div>
204
-                          <span style="margin-left: 38px;">{{it.arr[0].advice_name ? it.arr[0].advice_name : ""}}</span>&nbsp;&nbsp;
205
-                          <!-- v-if="ite[0].drug.min_unit != ite[0].drug.dose_unit" -->
206
-                          <span >
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 }}/
208
-                            {{it.arr[0].drug.max_unit}}
209
-                          </span>&nbsp;
210
-                        </div>
211
-                        <div style="display: inline-block;position: absolute;left:85%;top:20px;margin-left: 5px;" >
212
-                          &nbsp;共{{ it.arr[0].single_dose }}{{ it.arr[0].single_dose_unit }}
216
+                          <div v-for="(ites,ins) in it.arr" :key="ins">
217
+                            <div>
218
+                              <span style="margin-left: 38px;">{{ites[0].advice_name ? ites[0].advice_name : ""}}</span>&nbsp;&nbsp;
219
+                              <!-- v-if="ite[0].drug.min_unit != ite[0].drug.dose_unit" -->
220
+                              <span >
221
+                                {{ ites[0].drug.dose }}{{ ites[0].drug.dose_unit }}&nbsp;* {{ ites[0].drug.min_number }}{{ ites[0].drug.min_unit }}/
222
+                                {{ites[0].drug.max_unit}}
223
+                              </span>&nbsp;
224
+                            </div>
225
+                            <div :style="{display: 'inline-block',position: 'absolute',left:'85%',top:((ins+1)*20)+'px','margin-left': '5px'}" >
226
+                              &nbsp;共{{ ites[0].single_dose }}{{ ites[0].single_dose_unit }}
227
+                            </div>
228
+                          </div>
213
                         </div>
229
                         </div>
214
                       </template>
230
                       </template>
215
                     </div>
231
                     </div>
229
                     </div>
245
                     </div>
230
                   </div>
246
                   </div>
231
 
247
 
232
-                  <div style="display: inline-block;position: absolute;left:80%;bottom:30px;margin-left: 5px;" >
248
+                  <div style="display: inline-block;position: absolute;left:80%;bottom:30px;margin-left: 5px;" v-if="it.arr.length<2">
249
+                    ×&nbsp;{{ it.prescribing_number}}
250
+                  </div>
251
+                  <div style="display: inline-block;position: absolute;left:80%;top:0px;margin-left: 5px;" v-if="it.arr.length>1">
233
                     ×&nbsp;{{ it.prescribing_number}}
252
                     ×&nbsp;{{ it.prescribing_number}}
234
                   </div>
253
                   </div>
235
-                  <!-- <div> -->
254
+
255
+
256
+                  <div v-if="it.arr.length<2">
236
                     <div style="display: inline-block;position: absolute;left:80%;bottom:15px;margin-left: 5px;" >
257
                     <div style="display: inline-block;position: absolute;left:80%;bottom:15px;margin-left: 5px;" >
237
                       ×&nbsp;{{ it.arr[0].prescribing_number}}
258
                       ×&nbsp;{{ it.arr[0].prescribing_number}}
238
                     </div>
259
                     </div>
239
-                  <!-- </div> -->
260
+                  </div>
261
+                  <div v-else>
262
+                    <div v-for="(ites,ins) in it.arr" :key="ins">
263
+                      <div :style="{display: 'inline-block',position: 'absolute',left:'80%',top:((ins+1)*15)+'px','margin-left': '5px'}" >
264
+                        ×&nbsp;{{ ites[0].prescribing_number}}
265
+                      </div>
266
+                    </div>
267
+                  </div>
240
                   <template>
268
                   <template>
241
                       <div style="display: inline-block;position: absolute;left:85%;top:0px;margin-left: 5px;" >
269
                       <div style="display: inline-block;position: absolute;left:85%;top:0px;margin-left: 5px;" >
242
                         &nbsp;共{{ it.single_dose }}{{ it.single_dose_unit }}
270
                         &nbsp;共{{ it.single_dose }}{{ it.single_dose_unit }}
243
                       </div>
271
                       </div>
244
                   </template>
272
                   </template>
245
                 </div>
273
                 </div>
246
-                <div v-if="it.arr === undefined">
274
+                <div v-if="it.arr =='' ">
247
                   <div class="drugsOne" >
275
                   <div class="drugsOne" >
248
                     <span style="font-weight: bold" >
276
                     <span style="font-weight: bold" >
249
                       {{ index + 1 + "."}}
277
                       {{ index + 1 + "."}}
295
                 </div>
323
                 </div>
296
               </div>
324
               </div>
297
               <template v-if="index==yi&&item.advices.length>5">
325
               <template v-if="index==yi&&item.advices.length>5">
298
-                <div style="margin: 20px 0px;" 
326
+                <div style="margin: 20px 0px;"
299
                   v-if="prescriptions[index].med_type != '1111' && prescriptions[index].med_type != '1112'">
327
                   v-if="prescriptions[index].med_type != '1111' && prescriptions[index].med_type != '1112'">
300
                   <div style="display: flex;border-top: 1px solid #000;margin: 10px 0;">
328
                   <div style="display: flex;border-top: 1px solid #000;margin: 10px 0;">
301
                     <div style="flex: 1;">医师:{{ getAdminUser(item.creator)}}</div>
329
                     <div style="flex: 1;">医师:{{ getAdminUser(item.creator)}}</div>
323
                     <div style="flex: 1;">调配药师:</div>
351
                     <div style="flex: 1;">调配药师:</div>
324
                     <div style="flex: 1;">核/发药师:</div>
352
                     <div style="flex: 1;">核/发药师:</div>
325
                   </div>
353
                   </div>
326
-                  <div style="display: flex;margin: 10px 0;"> 
354
+                  <div style="display: flex;margin: 10px 0;">
327
                     <div style="flex: 1;">取药人:</div>
355
                     <div style="flex: 1;">取药人:</div>
328
                     <div style="flex: 1;">执行人:</div>
356
                     <div style="flex: 1;">执行人:</div>
329
                     <div style="flex: 1;">弃去量:</div>
357
                     <div style="flex: 1;">弃去量:</div>
330
                     <div style="flex: 1;">证明人:</div>
358
                     <div style="flex: 1;">证明人:</div>
331
                   </div>
359
                   </div>
332
-                  <div style="display: flex;"> 
360
+                  <div style="display: flex;">
333
                     <div style="flex: 1;">收回空安瓿或废贴批号:</div>
361
                     <div style="flex: 1;">收回空安瓿或废贴批号:</div>
334
                     <div style="flex: 1;">发出药品批号:</div>
362
                     <div style="flex: 1;">发出药品批号:</div>
335
                   </div>
363
                   </div>
418
               <div style="flex: 1;">调配药师:</div>
446
               <div style="flex: 1;">调配药师:</div>
419
               <div style="flex: 1;">核/发药师:</div>
447
               <div style="flex: 1;">核/发药师:</div>
420
             </div>
448
             </div>
421
-            <div style="display: flex;margin: 10px 0;"> 
449
+            <div style="display: flex;margin: 10px 0;">
422
               <div style="flex: 1;">取药人:</div>
450
               <div style="flex: 1;">取药人:</div>
423
               <div style="flex: 1;">执行人:</div>
451
               <div style="flex: 1;">执行人:</div>
424
               <div style="flex: 1;">弃去量:</div>
452
               <div style="flex: 1;">弃去量:</div>
425
               <div style="flex: 1;">证明人:</div>
453
               <div style="flex: 1;">证明人:</div>
426
             </div>
454
             </div>
427
-            <div style="display: flex;"> 
455
+            <div style="display: flex;">
428
               <div style="flex: 1;">收回空安瓿或废贴批号:</div>
456
               <div style="flex: 1;">收回空安瓿或废贴批号:</div>
429
               <div style="flex: 1;">发出药品批号:</div>
457
               <div style="flex: 1;">发出药品批号:</div>
430
             </div>
458
             </div>
452
     return {
480
     return {
453
       doc_name:"",
481
       doc_name:"",
454
       doctorList: [],
482
       doctorList: [],
455
-      advicePrint: {},
483
+      advicePrint: [],
456
       yi:4,
484
       yi:4,
457
       radio:'',
485
       radio:'',
458
       arr:[],
486
       arr:[],
569
       };
597
       };
570
       getPrescriptionPrint(params).then((response) => {
598
       getPrescriptionPrint(params).then((response) => {
571
         if (response.data.state == 1) {
599
         if (response.data.state == 1) {
572
-          var advicePrint = response.data.data.advicePrint;
600
+          const advicePrint = response.data.data.advicePrint;
573
           console.log("adviceprint9999", advicePrint);
601
           console.log("adviceprint9999", advicePrint);
574
           console.log("response.data.data", response.data.data);
602
           console.log("response.data.data", response.data.data);
575
           this.advicePrint = advicePrint;
603
           this.advicePrint = advicePrint;
576
           this.prescriptions = advicePrint;
604
           this.prescriptions = advicePrint;
577
           this.adminUser = response.data.data.roles
605
           this.adminUser = response.data.data.roles
578
           this.doctorList_1 = response.data.data.eles;
606
           this.doctorList_1 = response.data.data.eles;
579
-         for(let i=0;i<this.advicePrint.length;i++){
580
-          const arr = new Array()
581
-          var advicess = new Array()
582
-          var advicess=advicePrint[i].advices
583
-
584
-         for(let j=0;j<advicess.length;j++){
585
-            for(let x=j+1;x<advicess.length;x++){
586
-              if(advicess[j].groupno == advicess[x].groupno){
587
-                arr.push(advicess.splice(x,1))
588
-              }
589
-            }
590
-          }
591
 
607
 
592
-          for(let x in arr){
593
-            for(let j in this.advicePrint[i].advices){
594
-              if(arr[x][0].groupno==this.advicePrint[i].advices[j].groupno){
595
-                this.advicePrint[i]['advices'][j]['arr'] = arr[x]
608
+          for(let i=0;i< advicePrint.length;i++){
609
+            const advicess = advicePrint[i].advices
610
+            for(let j=0;j<advicess.length;j++){
611
+              this.advicePrint[i].advices[j]['arr'] = []
612
+              for(let x=j+1; x<advicess.length;x++){
613
+                if(advicess[j].groupno == advicess[x].groupno){
614
+                  this.advicePrint[i].advices[j]['arr'].push(advicess.splice(x,1))
615
+                  // advicess.splice(x,1)
616
+                  x--
617
+                }
596
               }
618
               }
597
             }
619
             }
620
+            console.log('123123123',advicess);
598
           }
621
           }
599
-        }
600
-
601
-          // console.log('4444444',this.advicePrint);
602
-        //  console.log('55555555',this.arr);
622
+          console.log('dddddd22222',this.advicePrint)
603
 
623
 
604
-          // console.log(this.doctorList_1, "医生列表");
605
           if (this.doctorList_1.length > 0) {
624
           if (this.doctorList_1.length > 0) {
606
             var operatorsLen = this.doctorList_1.length;
625
             var operatorsLen = this.doctorList_1.length;
607
             for (var index = 0; index < operatorsLen; index++) {
626
             for (var index = 0; index < operatorsLen; index++) {
654
       return name;
673
       return name;
655
     },
674
     },
656
     getTotalOne(id) {
675
     getTotalOne(id) {
657
-      // console.log('999999999',this.prescriptions);
676
+      console.log('999999999',this.prescriptions);
658
       var total = 0;
677
       var total = 0;
659
       var addtotal = 0;
678
       var addtotal = 0;
660
       var zimuyao = 0;
679
       var zimuyao = 0;
680
+
661
       for (let i = 0; i < this.prescriptions.length; i++) {
681
       for (let i = 0; i < this.prescriptions.length; i++) {
662
         if (id == this.prescriptions[i].id) {
682
         if (id == this.prescriptions[i].id) {
663
           if (this.prescriptions[i].project != null) {
683
           if (this.prescriptions[i].project != null) {
688
       for (let i = 0; i < this.prescriptions.length; i++) {
708
       for (let i = 0; i < this.prescriptions.length; i++) {
689
         if (id == this.prescriptions[i].id) {
709
         if (id == this.prescriptions[i].id) {
690
           if (this.prescriptions[i].advices != null) {
710
           if (this.prescriptions[i].advices != null) {
711
+            console.log('123456789',this.prescriptions[i].advices);
712
+            
691
             for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
713
             for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
692
               total =
714
               total =
693
                 total +
715
                 total +
694
                 (this.prescriptions[i].advices[a].price *
716
                 (this.prescriptions[i].advices[a].price *
695
                   this.prescriptions[i].advices[a].prescribing_number) ;
717
                   this.prescriptions[i].advices[a].prescribing_number) ;
696
 
718
 
697
-                if(this.prescriptions[i].advices[a].arr !=undefined){
698
-                  zimuyao = zimuyao +
699
-                  this.prescriptions[i].advices[a].arr[0].price *
700
-                  this.prescriptions[i].advices[a].arr[0].prescribing_number
719
+                if(this.prescriptions[i].advices[a].arr !=''){
720
+                  for(let b in this.prescriptions[i].advices[a].arr){
721
+                    zimuyao = zimuyao +
722
+                    this.prescriptions[i].advices[a].arr[b][0].price *
723
+                    this.prescriptions[i].advices[a].arr[b][0].prescribing_number
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
+                //   }
701
                 }
737
                 }
702
             }
738
             }
703
           }
739
           }
704
-          // if(this.prescriptions[i].arr[0] != null){
705
-          //   for(let b=0;b<this.prescriptions[i].arr[0].length;b++){
706
-          //     zimuyao = zimuyao +
707
-          //     this.prescriptions[i].arr[b][0].price *
708
-          //     this.prescriptions[i].arr[b][0].prescribing_number
709
-          //   }
710
-          // }
711
           if (this.prescriptions[i].additionalcharge != null) {
740
           if (this.prescriptions[i].additionalcharge != null) {
712
             for (
741
             for (
713
               let a = 0;
742
               let a = 0;