|
@@ -1,104 +1,264 @@
|
1
|
1
|
<template>
|
2
|
2
|
<div id='invoice-print' style="position: relative;">
|
3
|
|
- <div style="display: flex;width: 575px;margin-bottom: 5px; position: absolute; top: 70px;right: 1px;">
|
4
|
|
- 2023-07-18
|
5
|
|
- </div>
|
6
|
|
- <div style="display: flex; justify-content: space-between;width: 573px;">
|
7
|
|
- <div style="position: absolute;top: 85px;">
|
8
|
|
- <span>姓名:何月兰</span>
|
9
|
|
- <span></span>
|
10
|
|
- <span style="margin-left: 60px;">性别:女</span>
|
11
|
|
- <span></span>
|
|
3
|
+ <div style="border: 1px solid black;padding: 5px;width:600px;">
|
|
4
|
+ <div style="display: flex;width: 575px;margin-bottom: 5px; position: absolute; top: 70px;left: 522px;">
|
|
5
|
+ {{printDate}}
|
12
|
6
|
</div>
|
13
|
|
- <div style="position: absolute;top: 85px;left: 351px;">
|
14
|
|
- <span style="margin-right: 60px;">No: 2307062517</span>
|
|
7
|
+ <div style="display: flex; justify-content: space-between;width: 573px;">
|
|
8
|
+ <div style="position: absolute;top: 85px;">
|
|
9
|
+ <span>{{paramsObj.name}}</span>
|
|
10
|
+ <span></span>
|
|
11
|
+ <span style="margin-left: 60px;" v-if="list.gender == 1">女</span>
|
|
12
|
+ <span style="margin-left: 60px;" v-else-if="list.gender == 2">男</span>
|
|
13
|
+
|
|
14
|
+ <span></span>
|
|
15
|
+ </div>
|
|
16
|
+ <div style="position: absolute;top: 85px;left: 351px;">
|
|
17
|
+ <span style="margin-right: 60px;"></span>
|
|
18
|
+ </div>
|
|
19
|
+ </div>
|
|
20
|
+ <div style="display:flex;justify-content: space-between;">
|
|
21
|
+ <div style="position: absolute;top:120px;left:80px">西药费</div>
|
|
22
|
+ <div style="position: absolute;top:120px;left:171px">{{ list.westernMedicineCostTotal ? list.westernMedicineCostTotal.toFixed(2) : '' }}</div>
|
|
23
|
+ <div style="position: absolute;top:120px;left:262px">检查费</div>
|
|
24
|
+ <div style="position: absolute;top:120px;left:353px">{{ list.checkCostTotal ? list.checkCostTotal.toFixed(2) : '' }}</div>
|
|
25
|
+ <div style="position: absolute;top:120px;left:444px">治疗费</div>
|
|
26
|
+ <div style="position: absolute;top:120px;left:535px">{{ list.treatCostTotal ? list.treatCostTotal.toFixed(2) : '' }}</div>
|
15
|
27
|
</div>
|
16
|
|
- </div>
|
17
|
|
- <div style="display:flex;justify-content: space-between;">
|
18
|
|
- <div style="position: absolute;top:150px;left:80px">西药费</div>
|
19
|
|
- <div style="position: absolute;top:150px;left:171px">555</div>
|
20
|
|
- <div style="position: absolute;top:150px;left:262px">检查费</div>
|
21
|
|
- <div style="position: absolute;top:150px;left:353px">666</div>
|
22
|
|
- <div style="position: absolute;top:150px;left:444px">治疗费</div>
|
23
|
|
- <div style="position: absolute;top:150px;left:535px">777</div>
|
24
|
|
- </div>
|
25
|
|
-
|
26
|
|
- <div>
|
27
|
|
- <span>
|
28
|
|
- <span style="position: absolute;top:230px;left:120px">
|
29
|
|
- <span >
|
30
|
|
- 拾
|
31
|
|
- </span>
|
32
|
|
-
|
33
|
|
- </span>
|
34
|
|
- <span style="position: absolute;top:230px;left:140px">
|
35
|
|
- <span>
|
36
|
|
- 万
|
37
|
|
- </span>
|
38
|
|
-
|
39
|
|
- </span>
|
40
|
|
- <span style="position: absolute;top:230px;left:160px">
|
41
|
|
- <span >
|
42
|
|
- 千
|
43
|
|
- </span>
|
44
|
|
-
|
45
|
|
- </span>
|
46
|
|
- <span style="position: absolute;top:230px;left:180px">
|
47
|
|
- <span >
|
48
|
|
- 百
|
49
|
|
- </span>
|
50
|
|
-
|
51
|
|
- </span>
|
52
|
|
- <span style="position: absolute;top:230px;left:200px">
|
53
|
|
- <span >
|
54
|
|
- 拾
|
55
|
|
- </span>
|
56
|
|
-
|
57
|
|
- </span>
|
58
|
|
- <span style="position: absolute;top:230px;left:220px">
|
59
|
|
- <span >
|
60
|
|
- 元
|
61
|
|
- </span>
|
62
|
|
-
|
63
|
|
- </span>
|
64
|
|
- <span style="position: absolute;top:230px;left:240px">
|
65
|
|
- <span >
|
66
|
|
- 角
|
67
|
|
- </span>
|
68
|
|
- </span>
|
69
|
|
- <span style="position: absolute;top:230px;left:260px">
|
70
|
|
- <span >
|
71
|
|
- 分
|
72
|
|
- </span>
|
73
|
|
- </span>
|
74
|
|
- </span>
|
75
|
|
- <span style="position: absolute;top:230px;left:450px">¥:555.57</span>
|
76
|
|
- </div>
|
77
|
28
|
|
78
|
|
- <div style="border-bottom: 1px solid black;position: absolute;top:250px;left:110;width:573px;font-Size:12px">
|
79
|
|
- <div style="display:flex;margin: 3px 0px;">
|
80
|
|
- <div style="width:140px">医保:门慢统筹:</div>
|
81
|
|
- <div style="width:140px">大病保险:</div>
|
82
|
|
- <div style="width:140px">民政救助:</div>
|
83
|
|
- <div style="width:140px">兜底支付:</div>
|
|
29
|
+ <div style="display:flex;justify-content: space-between;">
|
|
30
|
+ <div style="position: absolute;top:140px;left:80px">床位费</div>
|
|
31
|
+ <div style="position: absolute;top:140px;left:171px">{{ list.bedCostTotal ? list.bedCostTotal.toFixed(2) : '' }}</div>
|
|
32
|
+ <div style="position: absolute;top:140px;left:262px">中成药</div>
|
|
33
|
+ <div style="position: absolute;top:140px;left:353px">{{ list.chineseTraditionalMedicineCostTotal ? list.chineseTraditionalMedicineCostTotal.toFixed(2) : '' }}</div>
|
|
34
|
+ <div style="position: absolute;top:140px;left:444px">化验费</div>
|
|
35
|
+ <div style="position: absolute;top:140px;left:535px">{{ list.laboratoryCostTotal ? list.laboratoryCostTotal.toFixed(2) : '' }}</div>
|
84
|
36
|
</div>
|
85
|
|
- <div style="display:flex;margin-bottom: 3px;">
|
86
|
|
- <div style="width:140px">个人自付:</div>
|
87
|
|
- <div style="width:140px">个账支付:</div>
|
88
|
|
- <div style="width:140px">个账余额:</div>
|
|
37
|
+
|
|
38
|
+ <div style="display:flex;justify-content: space-between;">
|
|
39
|
+ <div style="position: absolute;top:160px;left:80px">手术费</div>
|
|
40
|
+ <div style="position: absolute;top:160px;left:171px">{{ list.operationCostTotal ? list.operationCostTotal.toFixed(2) : '' }}</div>
|
|
41
|
+ <div style="position: absolute;top:160px;left:262px">中成药</div>
|
|
42
|
+ <div style="position: absolute;top:160px;left:353px">{{ list.chineseTraditionalMedicineCostTotal ? list.chineseTraditionalMedicineCostTotal.toFixed(2) : '' }}</div>
|
|
43
|
+ <div style="position: absolute;top:160px;left:444px">其他费</div>
|
|
44
|
+ <div style="position: absolute;top:160px;left:535px">{{ list.otherCostTotal ? list.otherCostTotal.toFixed(2) : '' }}</div>
|
89
|
45
|
</div>
|
90
|
|
- </div>
|
91
|
|
- <div style="position: absolute;top:290px;left:110;width:573px;font-Size:12px">
|
92
|
|
- <div style="display:flex;margin: 3px 0px;">
|
93
|
|
- <div style="width:140px">现金支付:55.57</div>
|
94
|
|
- <div style="width:140px">预存扣减:55.57</div>
|
95
|
|
- <div style="width:140px">预存余额:55.57</div>
|
|
46
|
+
|
|
47
|
+ <div style="display:flex;justify-content: space-between;">
|
|
48
|
+ <div style="position: absolute;top:180px;left:80px">诊察费</div>
|
|
49
|
+ <div style="position: absolute;top:180px;left:171px">{{ list.zhenChaCostTotal ? list.zhenChaCostTotal.toFixed(2) : '' }}</div>
|
|
50
|
+ <div style="position: absolute;top:180px;left:262px">材料费</div>
|
|
51
|
+ <div style="position: absolute;top:180px;left:353px">{{ list.materialCostTotal ? list.materialCostTotal.toFixed(2) : '' }}</div>
|
|
52
|
+ </div>
|
|
53
|
+
|
|
54
|
+ <div>
|
|
55
|
+ <span>
|
|
56
|
+ <span style="position: absolute;top:230px;left:120px">
|
|
57
|
+ <span v-if="zhongwen.indexOf('万') > -1 && zhongwen.indexOf('拾') > -1 && zhongwen.indexOf('拾') == 1">
|
|
58
|
+ {{ zhongwen.substring(0,1) }}
|
|
59
|
+ </span>
|
|
60
|
+ <span v-else>零</span>
|
|
61
|
+
|
|
62
|
+ </span>
|
|
63
|
+ <span style="position: absolute;top:230px;left:140px">
|
|
64
|
+ <span v-if="zhongwen.indexOf('万') > -1">
|
|
65
|
+ {{ zhongwen.substring(zhongwen.indexOf('万') - 1,zhongwen.indexOf('万')) }}
|
|
66
|
+ </span>
|
|
67
|
+ <span v-else>零</span>
|
|
68
|
+
|
|
69
|
+ </span>
|
|
70
|
+ <span style="position: absolute;top:230px;left:160px">
|
|
71
|
+ <span v-if="zhongwen.indexOf('仟') > -1">
|
|
72
|
+ {{ zhongwen.substring(zhongwen.indexOf('仟') - 1,zhongwen.indexOf('仟')) }}
|
|
73
|
+ </span>
|
|
74
|
+ <span v-else>零</span>
|
|
75
|
+
|
|
76
|
+ </span>
|
|
77
|
+ <span style="position: absolute;top:230px;left:180px">
|
|
78
|
+ <span v-if="zhongwen.indexOf('佰') > -1">
|
|
79
|
+ {{ zhongwen.substring(zhongwen.indexOf('佰') - 1,zhongwen.indexOf('佰')) }}
|
|
80
|
+ </span>
|
|
81
|
+ <span v-else>零</span>
|
|
82
|
+
|
|
83
|
+ </span>
|
|
84
|
+ <span style="position: absolute;top:230px;left:200px">
|
|
85
|
+ <span v-if="zhongwen.indexOf('拾') > -1">
|
|
86
|
+ {{zhongwen.substring(zhongwen.indexOf('拾') - 1,zhongwen.indexOf('拾')) == '佰' || !zhongwen.substring(zhongwen.indexOf('拾') - 1,zhongwen.indexOf('拾'))? '壹' : zhongwen.substring(zhongwen.indexOf('拾') - 1,zhongwen.indexOf('拾')) }}
|
|
87
|
+ </span>
|
|
88
|
+ <span v-else>零</span>
|
|
89
|
+
|
|
90
|
+ </span>
|
|
91
|
+ <span style="position: absolute;top:230px;left:220px">
|
|
92
|
+ <span v-if="zhongwen.indexOf('元') > -1 && zhongwen.substring(this.zhongwen.indexOf('元') - 1).substring(0,1)!= '拾'">
|
|
93
|
+ {{ zhongwen.substring(zhongwen.indexOf('元') - 1,zhongwen.indexOf('元')) }}
|
|
94
|
+ </span>
|
|
95
|
+ <span v-else>零</span>
|
|
96
|
+ </span>
|
|
97
|
+ <span style="position: absolute;top:230px;left:240px">
|
|
98
|
+ <span v-if="zhongwen.indexOf('角') > -1">
|
|
99
|
+ {{ zhongwen.substring(zhongwen.indexOf('角') - 1,zhongwen.indexOf('角')) }}
|
|
100
|
+ </span>
|
|
101
|
+ <span v-else>零</span>
|
|
102
|
+ </span>
|
|
103
|
+ <span style="position: absolute;top:230px;left:260px">
|
|
104
|
+ <span v-if="zhongwen.indexOf('分') > -1">
|
|
105
|
+ {{ zhongwen.substring(zhongwen.indexOf('分') - 1,zhongwen.indexOf('分')) }}
|
|
106
|
+ </span>
|
|
107
|
+ <span v-else>零</span>
|
|
108
|
+ </span>
|
|
109
|
+ </span>
|
|
110
|
+ <span style="position: absolute;top:230px;left:450px">¥:{{totalPrice.toFixed(2)}}</span>
|
|
111
|
+ </div>
|
|
112
|
+
|
|
113
|
+ <div style="border-bottom: 1px solid black;position: absolute;top:250px;left:110;width:573px;font-Size:12px">
|
|
114
|
+ <div style="display:flex;margin: 3px 0px;">
|
|
115
|
+ <div style="width:140px">医保:门慢统筹:{{list.order.hifp_pay}}</div>
|
|
116
|
+ <div style="width:140px">大病保险:{{list.order.hifmi_pay}}</div>
|
|
117
|
+ <div style="width:140px">民政救助: </div>
|
|
118
|
+ <div style="width:140px">兜底支付:</div>
|
|
119
|
+ </div>
|
|
120
|
+ <div style="display:flex;margin-bottom: 3px;">
|
|
121
|
+ <div style="width:140px">个人自付:{{list.order.psn_part_amt}}</div>
|
|
122
|
+ <div style="width:140px">个账支付:{{list.order.acct_pay}}</div>
|
|
123
|
+ <div style="width:140px">个账余额:{{list.order.balc}}</div>
|
|
124
|
+ </div>
|
96
|
125
|
</div>
|
97
|
|
- <div style="display:flex;justify-content: space-between; margin: 3px 0px;">
|
98
|
|
- <div style="width:140px">收款单位(盖章)</div>
|
99
|
|
- <div style="width:140px">收款人:莫莉</div>
|
|
126
|
+ <div style="position: absolute;top:290px;left:110;width:573px;font-Size:12px">
|
|
127
|
+ <div style="display:flex;margin: 3px 0px;">
|
|
128
|
+ <div style="width:140px">现金支付:{{list.order.psn_cash_pay}}</div>
|
|
129
|
+ <div style="width:140px">预存扣减:</div>
|
|
130
|
+ <div style="width:140px">预存余额:</div>
|
|
131
|
+ </div>
|
|
132
|
+ <div style="display:flex;justify-content: space-between; margin: 3px 0px;">
|
|
133
|
+ <div style="width:140px">收款单位(盖章)</div>
|
|
134
|
+ <div style="width:140px">收款人:{{list.admin_user_name}}</div>
|
|
135
|
+ </div>
|
100
|
136
|
</div>
|
101
|
137
|
</div>
|
102
|
|
-
|
103
|
138
|
</div>
|
104
|
|
-</template>
|
|
139
|
+</template>
|
|
140
|
+<script>
|
|
141
|
+import { getInvoice } from '@/api/project/project'
|
|
142
|
+import { uParseTime } from '@/utils/tools'
|
|
143
|
+export default {
|
|
144
|
+ props:{
|
|
145
|
+ paramsObj:Object
|
|
146
|
+ },
|
|
147
|
+ data(){
|
|
148
|
+ return{
|
|
149
|
+ gender:'',
|
|
150
|
+ list:{},
|
|
151
|
+ printDate:'',
|
|
152
|
+ zhongwen:'',
|
|
153
|
+ totalPrice:0.0,
|
|
154
|
+ org_id:'',
|
|
155
|
+ org_name:''
|
|
156
|
+ }
|
|
157
|
+ },
|
|
158
|
+ created(){
|
|
159
|
+ console.log('paramsObj',this.paramsObj)
|
|
160
|
+ let params = {
|
|
161
|
+ order_id: this.paramsObj.order_id,
|
|
162
|
+ patient_id: this.paramsObj.patient_id,
|
|
163
|
+ number: this.paramsObj.number,
|
|
164
|
+ }
|
|
165
|
+ this.getInvoice(params)
|
|
166
|
+ // var data = new Date();
|
|
167
|
+ // var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
|
|
168
|
+ // var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
|
|
169
|
+ // this.printDate = data.getFullYear() + "-" + month + "-" + date;
|
|
170
|
+ // this.smalltoBIG(982732.21)
|
|
171
|
+ this.org_id = this.$store.getters.xt_user.org_id
|
|
172
|
+ this.org_name = this.$store.getters.xt_user.org.org_name
|
|
173
|
+ },
|
|
174
|
+ methods:{
|
|
175
|
+ getInvoice(params){
|
|
176
|
+ getInvoice(params).then((res) => {
|
|
177
|
+ console.log('res',res)
|
|
178
|
+ this.list = res.data.data
|
|
179
|
+ this.totalPrice = this.list.westernMedicineCostTotal + this.list.checkCostTotal + this.list.treatCostTotal + this.list.bedCostTotal + this.list.chineseTraditionalMedicineCostTotal +
|
|
180
|
+ this.list.laboratoryCostTotal + this.list.operationCostTotal + this.list.otherCostTotal + this.list.materialCostTotal + this.list.zhenChaCostTotal
|
|
181
|
+ if(this.totalPrice == 0){
|
|
182
|
+
|
|
183
|
+ this.totalPrice = this.list.medfee_sumamt
|
|
184
|
+ }
|
|
185
|
+ console.log( "this.totalPrice")
|
|
186
|
+
|
|
187
|
+ this.smalltoBIG(this.totalPrice.toFixed(2))
|
|
188
|
+ var data = new Date(res.data.data.date * 1000);
|
|
189
|
+ var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
|
|
190
|
+ var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
|
|
191
|
+ this.printDate = data.getFullYear() + "-" + month + "-" + date;
|
|
192
|
+ this.gender = this.list.gender
|
|
193
|
+ })
|
|
194
|
+ },
|
|
195
|
+ smalltoBIG(n) {
|
|
196
|
+ // let fraction = ['角', '分'];
|
|
197
|
+ // let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
|
|
198
|
+ // let unit = [['元.', '万,', '亿,'], ["元",'拾', '佰', '仟']];
|
|
199
|
+ // let head = price < 0 ? '欠' : '';
|
|
200
|
+ // price = Math.abs(price);
|
|
201
|
+ // let upper = '';
|
|
202
|
+ // for (let i = 0; i < fraction.length; i++) {
|
|
203
|
+ // upper += (digit[Math.floor(price * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
|
|
204
|
+ // }
|
|
205
|
+ // upper = upper || '整';
|
|
206
|
+ // price = Math.floor(price);
|
|
207
|
+ // for (let i = 0; i < unit[0].length && price > 0; i++) {
|
|
208
|
+ // let p = '';
|
|
209
|
+ // for (let j = 0; j < unit[1].length && price > 0; j++) {
|
|
210
|
+ // p = digit[price % 10] + unit[1][j] + p;
|
|
211
|
+ // price = Math.floor(price / 10);
|
|
212
|
+ // }
|
|
213
|
+ // upper = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + upper;
|
|
214
|
+ // }
|
|
215
|
+ // this.zhongwen = head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整')
|
|
216
|
+ // console.log('6666',head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整'))
|
|
217
|
+ if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)){
|
|
218
|
+ return "数据非法"; //判断数据是否大于0
|
|
219
|
+ }
|
|
220
|
+
|
|
221
|
+ var unit = "仟佰拾亿仟佰拾万仟佰拾元角分", str = "";
|
|
222
|
+ n += "00";
|
|
223
|
+
|
|
224
|
+ var indexpoint = n.indexOf('.'); // 如果是小数,截取小数点前面的位数
|
|
225
|
+
|
|
226
|
+ if (indexpoint >= 0){
|
|
227
|
+
|
|
228
|
+ n = n.substring(0, indexpoint) + n.substr(indexpoint+1, 2); // 若为小数,截取需要使用的unit单位
|
|
229
|
+ }
|
|
230
|
+
|
|
231
|
+ unit = unit.substr(unit.length - n.length); // 若为整数,截取需要使用的unit单位
|
|
232
|
+ for (var i=0; i < n.length; i++){
|
|
233
|
+ str += "零壹贰叁肆伍陆柒捌玖".charAt(n.charAt(i)) + unit.charAt(i); //遍历转化为大写的数字
|
|
234
|
+ }
|
|
235
|
+
|
|
236
|
+ this.zhongwen = str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
|
|
237
|
+ console.log(this.zhongwen)
|
|
238
|
+ },
|
|
239
|
+ getTime(value, temp) {
|
|
240
|
+ if (value == 0) {
|
|
241
|
+ return ''
|
|
242
|
+ }
|
|
243
|
+ if (value != undefined) {
|
|
244
|
+ return uParseTime(value, temp)
|
|
245
|
+ }
|
|
246
|
+ return ''
|
|
247
|
+ },
|
|
248
|
+ },
|
|
249
|
+ watch:{
|
|
250
|
+ paramsObj:{//深度监听,可监听到对象、数组的变化
|
|
251
|
+ handler(val, oldVal){
|
|
252
|
+ let params = {
|
|
253
|
+ order_id: val.order_id,
|
|
254
|
+ patient_id: val.patient_id,
|
|
255
|
+ number: val.number,
|
|
256
|
+ }
|
|
257
|
+ this.getInvoice(params)
|
|
258
|
+
|
|
259
|
+ },
|
|
260
|
+ deep:true
|
|
261
|
+ }
|
|
262
|
+ }
|
|
263
|
+}
|
|
264
|
+</script>
|