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