Browse Source

批量打印

XMLWAN 4 years ago
parent
commit
bf5104b756

+ 1 - 0
src/xt_pages/outpatientDoctorStation/components/additionalCharges.vue View File

@@ -59,6 +59,7 @@
59 59
       },
60 60
       show() {
61 61
         this.chargeTable = []
62
+       
62 63
         this.visible = true
63 64
         if (this.addtions_charge == null || this.addtions_charge.length == 0) {
64 65
           for (let i = 0; i < this.additions.length; i++) {

+ 4 - 2
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue View File

@@ -376,7 +376,8 @@
376 376
 
377 377
         }
378 378
 
379
-      }, getTotalOne() {
379
+      }, 
380
+      getTotalOne() {
380 381
         var total = 0
381 382
         console.log(this.prescriptions)
382 383
         for (let i = 0; i < this.prescriptions.length; i++) {
@@ -398,7 +399,8 @@
398 399
         }
399 400
         return total
400 401
 
401
-      }, getCurTotal() {
402
+      }, 
403
+      getCurTotal() {
402 404
         var total = 0
403 405
         console.log(this.editableTabsValue)
404 406
 

+ 1 - 1
src/xt_pages/outpatientDoctorStation/doctorDesk.vue View File

@@ -371,7 +371,7 @@
371 371
       },
372 372
       open(index) {
373 373
         console.log("index0999999",this.prescriptions)
374
-         if(this.prescriptions[0].advices.length == 0){
374
+         if(this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length == 0){
375 375
            this.$message.error("请先开处方")
376 376
            return
377 377
           }

+ 38 - 21
src/xt_pages/outpatientDoctorStation/template/printOne.vue View File

@@ -24,17 +24,20 @@
24 24
                 <div class="drugsOne">{{it.advice_name?it.advice_name:""}}&nbsp;&nbsp;{{it.single_dose}}{{it.single_dose_unit}}&nbsp;×&nbsp; {{it.prescribing_number}}{{it.prescribing_number_unit}}</div>
25 25
                 <div style="margin-left:100px;"><span>用法:{{it.single_dose}}{{it.single_dose_unit}}</span>&nbsp;&nbsp;<span>{{it.execution_frequency}}</span>&nbsp;&nbsp;<span>{{it.advice_desc}}</span></div>
26 26
             </div>
27
+            <div class="drugsBox" v-for="(it,i) in item.additionalcharge" :key="i">
28
+                <div class="drugsOne">{{it.item_name?it.item_name:""}}:&nbsp;{{it.price}}元/{{it.count}}次</div>
29
+            </div>
27 30
         </div>
28 31
         <div class="doctorBox">
29
-            <p>医师:{{getDoctor(item.doctor)?getDoctor(item.doctor):""}}</p>
32
+            <p>医师:{{item.doctor?item.doctor:""}}</p>
30 33
             <p>日期:{{getTime(item.ctime)?getTime(item.ctime):""}}</p>
31 34
         </div>
32 35
         <div class="actionBar">
33 36
             <p>审核:{{getDoctor(item.advices[0].checker)?getDoctor(item.advices[0].checker):""}}</p>
34
-            <p>配对:{{getDoctor(item.doctor)?getDoctor(item.doctor):""}}</p>
37
+            <p>配对:{{getDoctor(item.advices[0].advice_doctor)?getDoctor(item.advices[0].advice_doctor):""}}</p>
35 38
             <p>核对:{{getDoctor(item.advices[0].checker)?getDoctor(item.advices[0].checker):""}}</p>
36 39
             <p>发药:{{getDoctor(item.advices[0].execution_staff)?getDoctor(item.advices[0].execution_staff):""}}</p>
37
-            <p>药费:</p>
40
+            <p>药费:{{getTotalOne(item.id)?getTotalOne(item.id):0}}元</p>
38 41
         </div>
39 42
     </div>
40 43
 
@@ -62,7 +65,8 @@ export default {
62 65
         tableData:[],
63 66
         prescriptionInfo:[],
64 67
         hisPatient:{},
65
-        department:[]
68
+        department:[],
69
+        prescriptions:[]
66 70
       }
67 71
     },
68 72
    methods:{
@@ -71,7 +75,7 @@ export default {
71 75
       getAllDoctorList().then(response=>{
72 76
         if(response.data.state == 1){
73 77
                var doctor =  response.data.data.doctor
74
-               
78
+               console.log("医生列表数据",doctor)
75 79
                this.doctorList = doctor
76 80
              }
77 81
          })   
@@ -108,21 +112,8 @@ export default {
108 112
             var advicePrint =  response.data.data.advicePrint
109 113
             console.log("adviceprint9999",advicePrint)
110 114
             this.advicePrint = advicePrint
111
-            // var patient =  response.data.data.patient
112
-            // console.log("patient",patient)
113
-            // this.patient = patient
114
-            // var doctorPorject = response.data.data.doctorPorject
115
-          
116
-            // var arr = doctorPorject.project
117
-            //   console.log("我的中谷歌",arr)
118
-            // for(let i=0;i<arr.length;i++){
119
-            //   console.log("arr",arr[i].project_name)
120
-            // }
121
-            // this.tableData = arr
122
-            // console.log("3333",this.tableData)
123
-            // var prescriptioninfo = response.data.data.prescriptionInfo
124
-            // console.log("prescriptioninfo",prescriptioninfo)
125
-            // this.prescriptionInfo = prescriptioninfo
115
+            this.prescriptions = advicePrint
116
+           
126 117
           }
127 118
        })
128 119
      },
@@ -154,7 +145,33 @@ export default {
154 145
            }
155 146
        }
156 147
        return name
157
-     }
148
+     },
149
+
150
+     getTotalOne(id) {
151
+        
152
+        var total = 0
153
+        var addtotal = 0
154
+        for (let i = 0; i < this.prescriptions.length; i++) {
155
+          if(id == this.prescriptions[i].id){
156
+            if (this.prescriptions[i].advices != null) {
157
+              for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
158
+                total = total + this.prescriptions[i].advices[a].price * this.prescriptions[i].advices[a].prescribing_number
159
+              }
160
+            }
161
+          
162
+            if (this.prescriptions[i].additionalcharge != null) {
163
+              for (let a = 0; a < this.prescriptions[i].additionalcharge.length; a++) {
164
+                addtotal = addtotal + this.prescriptions[i].additionalcharge[a].price * this.prescriptions[i].additionalcharge[a].count
165
+              }
166
+            }
167
+              addtotal =  Math.floor(addtotal * 100) / 100
168
+        }
169
+        return total + addtotal
170
+       }
171
+      }, 
172
+
173
+
174
+      
158 175
    },
159 176
    created(){
160 177
       this.getAllDoctorList()

+ 31 - 5
src/xt_pages/outpatientDoctorStation/treatTemplate/printOne.vue View File

@@ -57,12 +57,12 @@
57 57
             </table>
58 58
         </div>
59 59
         <div class="infoTitle">
60
-            <p>开单医生:{{getDoctor(item.doctor)?getDoctor(item.doctor):""}}</p>
60
+            <p>开单医生:{{item.doctor?item.doctor:""}}</p>
61 61
             <p>签章:</p>
62 62
         </div>
63 63
         <div class="actionBar">
64
-            <p>执行医生:{{getDoctor(item.doctor)?getDoctor(item.doctor):""}}</p>
65
-            <p>费用:</p>
64
+            <p>执行医生:{{item.doctor?item.doctor:""}}</p>
65
+            <p>费用:{{getTotalOne(item.id)?getTotalOne(item.id):''}}元</p>
66 66
         </div>
67 67
         <table style="width:100%;text-align:center;line-height:25px;border-collapse: collapse;" border="1">
68 68
             <tr>
@@ -109,7 +109,8 @@ export default {
109 109
         patient:{},
110 110
         tableData:[],
111 111
         prescriptionInfo:[],
112
-        projectList:[]
112
+        projectList:[],
113
+        prescriptions:[]
113 114
       }
114 115
     },
115 116
    methods:{
@@ -167,9 +168,11 @@ export default {
167 168
             var advicePrint =  response.data.data.advicePrint
168 169
             console.log("adviceprint",advicePrint)
169 170
             this.advicePrint = advicePrint
171
+            this.prescriptions = advicePrint
170 172
             var projectlist =  response.data.data.projectlist
171 173
             console.log("所有项目列表",projectlist)
172 174
             this.projectList = projectlist
175
+            
173 176
           }
174 177
        })
175 178
      },
@@ -190,7 +193,30 @@ export default {
190 193
            }
191 194
         }
192 195
         return unit
193
-     }
196
+     },
197
+
198
+       getTotalOne(id) {
199
+        
200
+        var total = 0
201
+        var addtotal = 0
202
+        for (let i = 0; i < this.prescriptions.length; i++) {
203
+          if(id == this.prescriptions[i].id){
204
+            if (this.prescriptions[i].project != null) {
205
+              for (let a = 0; a < this.prescriptions[i].project.length; a++) {
206
+                total = total + this.prescriptions[i].project[a].price * this.prescriptions[i].project[a].count
207
+              }
208
+            }
209
+          
210
+            if (this.prescriptions[i].additionalcharge != null) {
211
+              for (let a = 0; a < this.prescriptions[i].additionalcharge.length; a++) {
212
+                addtotal = addtotal + this.prescriptions[i].additionalcharge[a].price * this.prescriptions[i].additionalcharge[a].count
213
+              }
214
+            }
215
+              addtotal =  Math.floor(addtotal * 100) / 100
216
+        }
217
+        return total + addtotal
218
+       }
219
+      }, 
194 220
    },
195 221
    created(){
196 222
       this.getAllDoctorList()