瀏覽代碼

11月14日 库存扣减更新

XMLWAN 3 年之前
父節點
當前提交
f93488cf10
共有 1 個文件被更改,包括 175 次插入175 次删除
  1. 175 175
      src/xt_pages/hospitalStation/template/printOne.vue

+ 175 - 175
src/xt_pages/hospitalStation/template/printOne.vue 查看文件

@@ -2,66 +2,66 @@
2 2
   <div id='prescriptionPrint'>
3 3
     <div v-for="(item,index) in advicePrint" :key="index">
4 4
       <div id='prescription-print' class="prescription-print" style="page-break-after: always;">
5
-        <div class="printTitle" v-if="prescriptions[0].med_type == '1111'">{{orgname}}第一类精神药品处方笺</div>
6
-        <div class="printTitle" v-if="prescriptions[0].med_type == '1112'">{{orgname}}第二类精神药品处方笺</div>
7
-        <div class="printTitle" v-else>{{orgname}}处方笺</div>
5
+          <div class="printTitle" v-if="prescriptions[0].med_type == '1111'">{{orgname}}第一类精神药品处方笺</div>
6
+          <div class="printTitle" v-if="prescriptions[0].med_type == '1112'">{{orgname}}第二类精神药品处方笺</div>
7
+          <div class="printTitle" v-else>{{orgname}}处方笺</div>
8 8
 
9 9
 
10
-        <div class="infoTitle">
11
-          <p>姓名:{{item.patient.name?item.patient.name:""}}</p>
12
-          <p>性别:
13
-            <span v-if="item.patient.gender == 1">男</span>
14
-            <span v-if="item.patient.gender == 2">女</span>
15
-          </p>
16
-          <p>年龄:{{getAge(item.patient)?getAge(item.patient):""}}岁</p>
17
-        </div>
18
-        <div class="infoMain">
19
-          <div style="margin-bottom: 10px;">门诊号:{{hisPatient.number?hisPatient.number:""}}</div>
20
-          <div style="margin-bottom: 10px;">科室:{{item.info?getDepart(item.info.departments):''}}</div>
21
-          <div style="margin-bottom: 10px;">医保卡号:{{item.hisPatient.number?item.hisPatient.number:""}}</div>
22
-          <div style="margin-bottom: 10px;">电话:{{item.patient.phone}}</div>
23
-          <div>地址:{{item.patient.home_address}}</div>
24
-          <div style="display:flex;width:50%;">临床诊断:{{getDiagnosis(item.info.diagnosis)}}</div>
25
-        </div>
26
-        <div class="prescriptionBox">
27
-          <div class="Rp">Rp:</div>
28
-          <div class="drugsBox" v-for="(it,index) in item.advices" :key="index">
29
-            <!-- <div class="drugsOne"><span style="font-weight:bold;">{{ index+1 + '.' }}</span>{{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> -->
30
-            <div class="drugsOne"><span style="font-weight:bold;">{{ index+1 + '.' }}</span>{{it.advice_name?it.advice_name:""}}&nbsp;&nbsp;<span v-if="it.drug.min_unit != it.drug.dose_unit">{{it.drug.dose}}{{it.drug.dose_unit}}&nbsp;* &nbsp;</span>{{it.drug.min_number}}{{it.drug.min_unit}}/{{it.drug.max_unit}}&nbsp;×&nbsp; {{it.prescribing_number}}{{it.prescribing_number_unit}}</div>
31
-            <div style="margin-left:100px;"><span>用法:{{it.single_dose}}{{it.single_dose_unit}}</span>&nbsp;&nbsp;<span>{{it.execution_frequency}}&nbsp;{{it.delivery_way}}&nbsp;</span>&nbsp;&nbsp;<span>{{it.advice_desc}}</span></div>
10
+          <div class="infoTitle">
11
+              <p>姓名:{{item.patient.name?item.patient.name:""}}</p>
12
+              <p>性别:
13
+                <span v-if="item.patient.gender == 1">男</span>
14
+                <span v-if="item.patient.gender == 2">女</span>
15
+              </p>
16
+              <p>年龄:{{getAge(item.patient)?getAge(item.patient):""}}岁</p>
32 17
           </div>
33
-          <div class="drugsBox" v-for="(it,i) in item.additionalcharge" :key="i">
34
-            <div class="drugsOne">{{it.item_name?it.item_name:""}}:&nbsp;{{it.price}}元/{{it.count}}次</div>
18
+          <div class="infoMain">
19
+              <div style="margin-bottom: 10px;">门诊号:{{hisPatient.number?hisPatient.number:""}}</div>
20
+              <div style="margin-bottom: 10px;">科室:{{item.info?getDepart(item.info.departments):''}}</div>
21
+              <div style="margin-bottom: 10px;">医保卡号:{{item.hisPatient.number?item.hisPatient.number:""}}</div>
22
+              <div style="margin-bottom: 10px;">电话:{{item.patient.phone}}</div>
23
+              <div>地址:{{item.patient.home_address}}</div>
24
+              <div style="display:flex;width:50%;">临床诊断:{{getDiagnosis(item.info.diagnosis)}}</div>
35 25
           </div>
26
+          <div class="prescriptionBox">
27
+              <div class="Rp">Rp:</div>
28
+              <div class="drugsBox" v-for="(it,index) in item.advices" :key="index">
29
+                  <!-- <div class="drugsOne"><span style="font-weight:bold;">{{ index+1 + '.' }}</span>{{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> -->
30
+                  <div class="drugsOne"><span style="font-weight:bold;">{{ index+1 + '.' }}</span>{{it.advice_name?it.advice_name:""}}&nbsp;&nbsp;<span v-if="it.drug.min_unit != it.drug.dose_unit">{{it.drug.dose}}{{it.drug.dose_unit}}&nbsp;* &nbsp;</span>{{it.drug.min_number}}{{it.drug.min_unit}}/{{it.drug.max_unit}}&nbsp;×&nbsp; {{it.prescribing_number}}{{it.prescribing_number_unit}}</div>
31
+                  <div style="margin-left:100px;"><span>用法:{{it.single_dose}}{{it.single_dose_unit}}</span>&nbsp;&nbsp;<span>{{it.execution_frequency}}&nbsp;{{it.delivery_way}}&nbsp;</span>&nbsp;&nbsp;<span>{{it.advice_desc}}</span></div>
32
+              </div>
33
+              <div class="drugsBox" v-for="(it,i) in item.additionalcharge" :key="i">
34
+                <div class="drugsOne">{{it.item_name?it.item_name:""}}:&nbsp;{{it.price}}元/{{it.count}}次</div>
35
+               </div>
36
+
37
+              <div class="drugsBox" v-for="(it,index) in item.project" :key="index">
38
+                  <div class="drugsOne"><span style="font-weight:bold;">{{ index+1 + '.' }}</span>{{it.type == 2?getProjectName(it.project_id)?getProjectName(it.project_id):"":it.good_info.good_name}}&nbsp;&nbsp;{{it.single_dose}}{{it.single_dose_unit}}&nbsp;×&nbsp; {{it.count}}{{unit}}</div>
39
+                  <div style="margin-left:100px;"><span>用法:{{it.single_dose}}{{it.single_dose_unit}}</span>&nbsp;&nbsp;<span>{{it.delivery_way}}</span>&nbsp;&nbsp;<span>{{it.advice_desc}}</span></div>
40
+              </div>
41
+              <div class="drugsBox" v-for="(it,i) in item.additionalcharge" :key="i">
42
+                <div class="drugsOne">{{it.project_id?it.project_id:""}}:&nbsp;{{it.price}}元/{{it.count}}次</div>
43
+               </div>
44
+               <div style="text-align:center;" >(以下空白)</div>
36 45
 
37
-          <div class="drugsBox" v-for="(it,index) in item.project" :key="index">
38
-            <div class="drugsOne"><span style="font-weight:bold;">{{ index+1 + '.' }}</span>{{it.type == 2?getProjectName(it.project_id)?getProjectName(it.project_id):"":it.good_info.good_name}}&nbsp;&nbsp;{{it.single_dose}}{{it.single_dose_unit}}&nbsp;×&nbsp; {{it.count}}{{unit}}</div>
39
-            <div style="margin-left:100px;"><span>用法:{{it.single_dose}}{{it.single_dose_unit}}</span>&nbsp;&nbsp;<span>{{it.delivery_way}}</span>&nbsp;&nbsp;<span>{{it.advice_desc}}</span></div>
40 46
           </div>
41
-          <div class="drugsBox" v-for="(it,i) in item.additionalcharge" :key="i">
42
-            <div class="drugsOne">{{it.project_id?it.project_id:""}}:&nbsp;{{it.price}}元/{{it.count}}次</div>
47
+          <div class="doctorBox">
48
+              <p>医师:{{item.doctor?item.doctor:""}}</p>
49
+              <p>日期:{{getTime(item.pre_time)?getTime(item.pre_time):""}}</p>
43 50
           </div>
44
-          <div style="text-align:center;" >(以下空白)</div>
45
-
46
-        </div>
47
-        <div class="doctorBox">
48
-          <p>医师:{{item.doctor?item.doctor:""}}</p>
49
-          <p>日期:{{getTime(item.ctime)?getTime(item.ctime):""}}</p>
50
-        </div>
51
-        <div class="actionBar">
52
-          <!-- <p>审核:{{getDoctor(item.advices[0].checker)?getDoctor(item.advices[0].checker):""}}</p>
53
-          <p>配对:</p>
54
-          <p>核对:{{getDoctor(item.advices[0].checker)?getDoctor(item.advices[0].checker):""}}</p>
55
-          <p>发药:{{getDoctor(item.advices[0].execution_staff)?getDoctor(item.advices[0].execution_staff):""}}</p>
56
-          <p>药费:{{getTotalOne(item.id)?getTotalOne(item.id):0}}元</p> -->
51
+          <div class="actionBar">
52
+                 <!-- <p>审核:{{getDoctor(item.advices[0].checker)?getDoctor(item.advices[0].checker):""}}</p>
53
+                 <p>配对:</p>
54
+                 <p>核对:{{getDoctor(item.advices[0].checker)?getDoctor(item.advices[0].checker):""}}</p>
55
+                 <p>发药:{{getDoctor(item.advices[0].execution_staff)?getDoctor(item.advices[0].execution_staff):""}}</p>
56
+                 <p>药费:{{getTotalOne(item.id)?getTotalOne(item.id):0}}元</p> -->
57 57
 
58
-          <p>审核:</p>
59
-          <p>配对:</p>
60
-          <p>核对:</p>
61
-          <p>发药:</p>
62
-          <p>药费:{{getTotalOne(item.id).toFixed(2)?getTotalOne(item.id).toFixed(2):0}}元</p>
63
-        </div>
64
-        <div style="page-break-after:always"></div>
58
+                 <p>审核:</p>
59
+                 <p>配对:</p>
60
+                 <p>核对:</p>
61
+                 <p>发药:</p>
62
+                 <p>药费:{{getTotalOne(item.id).toFixed(2)?getTotalOne(item.id).toFixed(2):0}}元</p>
63
+          </div>
64
+          <div style="page-break-after:always"></div>
65 65
       </div>
66 66
     </div>
67 67
 
@@ -70,10 +70,10 @@
70 70
 
71 71
 </template>
72 72
 <script>
73
-  import { jsGetAge, uParseTime } from '@/utils/tools'
74
-  import {getAllDoctorList,getPrescriptionPrint,getHisPatientDetail} from "@/api/project/project"
75
-  import {getInitData} from "@/api/his/his"
76
-  export default {
73
+import { jsGetAge, uParseTime } from '@/utils/tools'
74
+import {getAllDoctorList,getPrescriptionPrint,getHisPatientDetail} from "@/api/project/project"
75
+import {getInitData} from "@/api/his/his"
76
+export default {
77 77
     props:{
78 78
       patient_id:Number,
79 79
       record_date:String,
@@ -95,52 +95,52 @@
95 95
         diagnoses:[],
96 96
       }
97 97
     },
98
-    methods:{
99
-      getAge(patient){
100
-        var thisLen = patient.id_card_no.length
101
-        var birth = ''
102
-        if (thisLen == 15) {
103
-          birth = '19' + patient.id_card_no.substr(6, 6)
104
-        } else {
105
-          birth = patient.id_card_no.substr(6, 8)
106
-        }
107
-        var births =
108
-          birth.substr(0, 4) +
109
-          '-' +
110
-          birth.substr(4, 2) +
111
-          '-' +
112
-          birth.substr(6, 2)
113
-        return jsGetAge(births, '-')
98
+   methods:{
99
+     getAge(patient){
100
+       var thisLen = patient.id_card_no.length
101
+       var birth = ''
102
+       if (thisLen == 15) {
103
+         birth = '19' + patient.id_card_no.substr(6, 6)
104
+       } else {
105
+         birth = patient.id_card_no.substr(6, 8)
106
+       }
107
+       var births =
108
+         birth.substr(0, 4) +
109
+         '-' +
110
+         birth.substr(4, 2) +
111
+         '-' +
112
+         birth.substr(6, 2)
113
+       return jsGetAge(births, '-')
114 114
 
115
-      },
115
+     },
116 116
 
117
-      getAllDoctorList(){
118
-        getAllDoctorList().then(response=>{
119
-          if(response.data.state == 1){
120
-            var doctor =  response.data.data.doctor
117
+     getAllDoctorList(){
118
+      getAllDoctorList().then(response=>{
119
+        if(response.data.state == 1){
120
+               var doctor =  response.data.data.doctor
121 121
 
122
-            this.doctorList = doctor
123
-          }
124
-        })
125
-      },
122
+               this.doctorList = doctor
123
+             }
124
+         })
125
+     },
126 126
 
127 127
       getDoctor(id){
128 128
         var name = ""
129 129
         for(let i=0;i<this.doctorList.length;i++){
130 130
           if(id == this.doctorList[i].admin_user_id){
131
-            name = this.doctorList[i].user_name
131
+              name = this.doctorList[i].user_name
132 132
           }
133 133
         }
134 134
         return name
135 135
       },
136 136
       getTime(value, temp) {
137 137
         if (value != undefined) {
138
-          return uParseTime(value, temp)
138
+            return uParseTime(value, temp)
139 139
         }
140 140
         return ''
141
-      },
142
-      getPrescriptionPrint(){
143
-        var params = {
141
+     },
142
+       getPrescriptionPrint(){
143
+         var params = {
144 144
           // patient_id:this.patient_id,
145 145
           // record_date:this.record_date,
146 146
           // prescription_id:this.prescription_id,
@@ -150,8 +150,8 @@
150 150
           ids:this.ids
151 151
         }
152 152
         console.log("params",params)
153
-        getPrescriptionPrint(params).then(response=>{
154
-          if(response.data.state == 1){
153
+       getPrescriptionPrint(params).then(response=>{
154
+         if(response.data.state == 1){
155 155
             var advicePrint =  response.data.data.advicePrint
156 156
             console.log("adviceprint9999",advicePrint)
157 157
             this.advicePrint = advicePrint
@@ -164,39 +164,39 @@
164 164
             console.log("所有项目列表",projectlist)
165 165
             this.projectList = projectlist
166 166
           }
167
-        })
168
-      },
169
-      getHisPatientDetail(){
170
-        const params = {
171
-          patient_id:this.patient_id
172
-        }
173
-        getHisPatientDetail(params).then(response=>{
167
+       })
168
+     },
169
+     getHisPatientDetail(){
170
+          const params = {
171
+              patient_id:this.patient_id
172
+          }
173
+       getHisPatientDetail(params).then(response=>{
174 174
           if(response.data.state == 1){
175
-            var hisPatient =  response.data.data.hisPatient
176
-            console.log("挂号病人",hisPatient)
177
-            this.hisPatient = hisPatient
175
+             var hisPatient =  response.data.data.hisPatient
176
+             console.log("挂号病人",hisPatient)
177
+             this.hisPatient = hisPatient
178 178
           }
179
-        })
180
-      },
181
-      getInitData(){
182
-        getInitData().then(response=>{
179
+       })
180
+     },
181
+     getInitData(){
182
+       getInitData().then(response=>{
183 183
           if(response.data.state == 1){
184 184
             this.department = response.data.data.department
185 185
             this.diagnoses = response.data.data.diagnose
186 186
             console.log("争端",this.diagnoses)
187 187
           }
188
-        })
189
-      },
190
-      getDepart(id){
191
-        var name = ""
192
-        for(let i=0;i<this.department.length;i++){
193
-          if(id == this.department[i].id){
194
-            name = this.department[i].name
195
-          }
196
-        }
197
-        return name
198
-      },
199
-      getTotalOne(id) {
188
+       })
189
+     },
190
+     getDepart(id){
191
+         var name = ""
192
+       for(let i=0;i<this.department.length;i++){
193
+           if(id == this.department[i].id){
194
+               name = this.department[i].name
195
+           }
196
+       }
197
+       return name
198
+     },
199
+    getTotalOne(id) {
200 200
 
201 201
         var total = 0
202 202
         var addtotal = 0
@@ -213,12 +213,12 @@
213 213
                 addtotal = addtotal + this.prescriptions[i].additionalcharge[a].price * this.prescriptions[i].additionalcharge[a].count
214 214
               }
215 215
             }
216
-            addtotal =  Math.floor(addtotal * 100) / 100
217
-          }
218
-
216
+              addtotal =  Math.floor(addtotal * 100) / 100
219 217
         }
220 218
 
221
-        for (let i = 0; i < this.prescriptions.length; i++) {
219
+       }
220
+
221
+      for (let i = 0; i < this.prescriptions.length; i++) {
222 222
           if(id == this.prescriptions[i].id){
223 223
             if (this.prescriptions[i].advices != null) {
224 224
               for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
@@ -231,36 +231,36 @@
231 231
                 addtotal = addtotal + this.prescriptions[i].additionalcharge[a].price * this.prescriptions[i].additionalcharge[a].count
232 232
               }
233 233
             }
234
-            addtotal =  Math.floor(addtotal * 100) / 100
235
-          }
234
+              addtotal =  Math.floor(addtotal * 100) / 100
236 235
         }
236
+       }
237 237
 
238 238
         return total + addtotal
239 239
       },
240 240
 
241
-      getProjectName(id){
241
+     getProjectName(id){
242 242
         var project_name = ""
243 243
         for(let i=0;i<this.projectList.length;i++){
244
-          if(id == this.projectList[i].id){
245
-            project_name = this.projectList[i].project_name
246
-          }
244
+           if(id == this.projectList[i].id){
245
+               project_name = this.projectList[i].project_name
246
+           }
247 247
         }
248 248
         return project_name
249
-      },
249
+     },
250 250
 
251
-      getDiagnosis(id) {
252
-        let arr = id.split(',')
253
-        var name = ''
254
-        for (let i = 0; i < this.diagnoses.length; i++) {
255
-          if (arr.indexOf(String(this.diagnoses[i].id)) > -1) {
256
-            name += this.diagnoses[i].class_name + ' '
257
-          }
258
-        }
259
-        return name
260
-      },
251
+     getDiagnosis(id) {
252
+       let arr = id.split(',')
253
+       var name = ''
254
+       for (let i = 0; i < this.diagnoses.length; i++) {
255
+         if (arr.indexOf(String(this.diagnoses[i].id)) > -1) {
256
+           name += this.diagnoses[i].class_name + ' '
257
+         }
258
+       }
259
+       return name
260
+     },
261 261
 
262
-    },
263
-    created(){
262
+   },
263
+   created(){
264 264
       this.getAllDoctorList()
265 265
       this.getInitData()
266 266
       this.getPrescriptionPrint()
@@ -268,85 +268,85 @@
268 268
       var xtuser = this.$store.getters.xt_user;
269 269
       this.orgname = xtuser.org.org_name;
270 270
 
271
-    },
272
-    watch:{
273
-      ids:function(val){
274
-        this.ids = val
275
-        this.getPrescriptionPrint()
276
-      }
271
+   },
272
+   watch:{
273
+     ids:function(val){
274
+      this.ids = val
275
+      this.getPrescriptionPrint()
277 276
     }
278
-  }
277
+   }
278
+}
279 279
 </script>
280 280
 
281 281
 
282 282
 <style lang="scss" scoped>
283
-  .prescription-print{
284
-    -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 60px rgba(0, 0, 0, 0.06) inset;
283
+.prescription-print{
284
+  -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 60px rgba(0, 0, 0, 0.06) inset;
285 285
     -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
286 286
     box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
287 287
     margin-bottom: 20px;
288 288
     padding:20px 10px;
289
-  }
290
-  .printTitle{
289
+}
290
+.printTitle{
291 291
     font-size: 22px;
292 292
     text-align: center;
293 293
     font-weight: bold;
294
-  }
295
-  .infoTitle{
294
+}
295
+.infoTitle{
296 296
     display: flex;
297 297
     border-bottom: 2px solid #000;
298 298
     margin-top:10px;
299 299
     line-height: 24px;
300 300
     padding:0 10px;
301
-  }
302
-  .infoTitle p{
301
+}
302
+.infoTitle p{
303 303
     width: 200px;
304
-  }
305
-  .infoMain{
304
+}
305
+.infoMain{
306 306
     display: flex;
307 307
     flex-wrap: wrap;
308 308
     border-bottom: 2px solid #000;
309 309
     padding:0 10px;
310
-  }
311
-  .infoMain div{
310
+}
311
+.infoMain div{
312 312
     width: 50%;
313 313
     line-height: 24px;
314
-  }
315
-  .prescriptionBox{
314
+}
315
+.prescriptionBox{
316 316
     padding:0 10px;
317 317
     min-height:450px;
318
-  }
319
-  .Rp{
318
+}
319
+.Rp{
320 320
     font-size: 22px;
321 321
     font-weight: bold;
322
-  }
323
-  .drugsBox{
322
+}
323
+.drugsBox{
324 324
     padding-left: 40px;
325 325
     margin-bottom: 10px;
326
-  }
327
-  .drugsBox div{
326
+}
327
+.drugsBox div{
328 328
     line-height: 20px;
329
-  }
330
-  .drugsOne{
329
+}
330
+.drugsOne{
331 331
     line-height: 24px;
332
-  }
333
-  .drugsOne span{
332
+}
333
+.drugsOne span{
334 334
     margin-right: 20px;
335
-  }
336
-  .doctorBox{
335
+}
336
+.doctorBox{
337 337
     display: flex;
338 338
     justify-content: space-between;
339 339
     padding:0 10px;
340 340
     line-height: 24px;
341 341
     border-bottom: 2px solid #000;
342
-  }
343
-  .actionBar{
342
+}
343
+.actionBar{
344 344
     display: flex;
345 345
     justify-content: space-between;
346 346
     line-height: 24px;
347 347
     padding:0 10px;
348
-  }
349
-  .actionBar p{
348
+}
349
+.actionBar p{
350 350
     width:150px;
351
-  }
351
+}
352 352
 </style>