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