|
@@ -0,0 +1,249 @@
|
|
1
|
+<template>
|
|
2
|
+ <div id='invoice-print'>
|
|
3
|
+ <div v-for='(i,index) in pageArr.length' :key="index" >
|
|
4
|
+ <!-- <div :style="{position: 'absolute',top:(20 + (index * 660)) + 'px',left:200+ 'px',}">盐城大丰悦达金骆驼血液透析中心</div> -->
|
|
5
|
+ <!-- <div :style="{position: 'absolute',top:(70 + (index * 660)) + 'px',left:150+ 'px',}">{{ list.order_number }}</div> -->
|
|
6
|
+ <div style="display:flex;justify-content: space-between;">
|
|
7
|
+ <div :style="{position: 'absolute',top:(100 + (index * 660)) + 'px',left:100+ 'px',}">票据代码{{ paramsObj.name }}</div>
|
|
8
|
+ <div :style="{position: 'absolute',top:(100 + (index * 660)) + 'px',left:500+ 'px',}">票据号码</div>
|
|
9
|
+ <div :style="{position: 'absolute',top:(130 + (index * 660)) + 'px',left:100+ 'px',}">交款人统一社会信用代码</div>
|
|
10
|
+ <div :style="{position: 'absolute',top:(130 + (index * 660)) + 'px',left:500+ 'px',}">校验码</div>
|
|
11
|
+ <div :style="{position: 'absolute',top:(160 + (index * 660)) + 'px',left:100+ 'px',}">交款人</div>
|
|
12
|
+ <div :style="{position: 'absolute',top:(160 + (index * 660)) + 'px',left:500+ 'px',}">开票日期</div>
|
|
13
|
+
|
|
14
|
+ </div>
|
|
15
|
+
|
|
16
|
+ <div :style="{position: 'absolute',top:(190 + (index * 660)) + 'px',left:120+ 'px',}">
|
|
17
|
+ <div v-if="list.westernMedicineCostTotal">西药 {{ list.westernMedicineCostTotal }}</div>
|
|
18
|
+ <div v-if="list.treatCostTotal">治疗费 {{ list.treatCostTotal }}</div>
|
|
19
|
+ <div v-if="list.bedCostTotal">床位费 {{ list.bedCostTotal }}</div>
|
|
20
|
+ <div v-if="list.chineseTraditionalMedicineCostTotal">中成药 {{ list.chineseTraditionalMedicineCostTotal }}</div>
|
|
21
|
+ <div v-if="list.laboratoryCostTotal">化验费 {{ list.laboratoryCostTotal }}</div>
|
|
22
|
+ <div v-if="list.operationCostTotal">手术费 {{ list.operationCostTotal }}</div>
|
|
23
|
+ <div v-if="list.otherCostTotal">其他费 {{ list.otherCostTotal }}</div>
|
|
24
|
+ <div v-if="list.materialCostTotal">材料费 {{ list.materialCostTotal }}</div>
|
|
25
|
+ </div>
|
|
26
|
+ <div :style="{position: 'absolute',top:(190 + (index * 660)) + 'px',left:300+ 'px'}">
|
|
27
|
+ <div v-for="item in list.order_info.slice(index * 10,(index * 10) + pageArr[index])">
|
|
28
|
+ <span style="display:inline-block;width:200px;">
|
|
29
|
+ <span v-if="item.advice.id == 0">
|
|
30
|
+ <span v-if="item.project.type == 2"> {{ item.project.project.project_name }}</span>
|
|
31
|
+ <span v-if="item.project.type == 3">{{ item.project.good_info.good_name }}</span>
|
|
32
|
+ </span>
|
|
33
|
+ <span v-else>{{ item.advice.advice_name }}</span>
|
|
34
|
+ </span>
|
|
35
|
+ <span style="display:inline-block;width:50px;">
|
|
36
|
+ <span v-if="item.advice.id == 0">
|
|
37
|
+ <span v-if="item.project.type == 2">{{ item.project.count }}{{ item.project.unit }}</span>
|
|
38
|
+ <span v-if="item.project.type == 3">{{ item.project.count }}{{ item.project.unit }}</span>
|
|
39
|
+ </span>
|
|
40
|
+ <span v-else>{{ item.advice.prescribing_number }}{{ item.advice.prescribing_number_unit }}</span>
|
|
41
|
+ </span>
|
|
42
|
+ <span>
|
|
43
|
+ <span v-if="item.advice.id == 0">
|
|
44
|
+ <span v-if="item.project.type == 2">{{ (item.project.count * item.pric).toFixed(2) }}</span>
|
|
45
|
+ <span v-if="item.project.type == 3">{{ (item.project.count * item.pric).toFixed(2) }}</span>
|
|
46
|
+ </span>
|
|
47
|
+ <span v-else>{{ (item.advice.prescribing_number * item.pric).toFixed(2) }}</span>
|
|
48
|
+ </span>
|
|
49
|
+ </div>
|
|
50
|
+ </div>
|
|
51
|
+ <div :style="{position: 'absolute',top:(390 + (index * 660)) + 'px',left:130+ 'px'}">{{ zhongwen }}</div>
|
|
52
|
+ <div :style="{position: 'absolute',top:(390 + (index * 660)) + 'px',left:480+ 'px'}">{{ list.medfee_sumamt }}</div>
|
|
53
|
+ <div :style="{position: 'absolute',top:(420 + (index * 660)) + 'px',left:110+ 'px',width:100 + '%',fontSize:12+'px'}">
|
|
54
|
+ <div style="display:flex;">
|
|
55
|
+ <div style="width:140px">业务流水号:</div>
|
|
56
|
+ <div style="width:140px">门诊号:</div>
|
|
57
|
+ <div style="width:140px">就诊日期:</div>
|
|
58
|
+
|
|
59
|
+ </div>
|
|
60
|
+ <div style="display:flex;">
|
|
61
|
+ <div style="width:140px">医疗机构类型:</div>
|
|
62
|
+ <div style="width:140px">医保类型:</div>
|
|
63
|
+ <div style="width:140px">医保编号:</div>
|
|
64
|
+ <div style="width:140px">性别:</div>
|
|
65
|
+
|
|
66
|
+ </div>
|
|
67
|
+ <div style="display:flex;">
|
|
68
|
+ <div style="width:140px">医保统筹基金支出:</div>
|
|
69
|
+ <div style="width:140px">其他支出:</div>
|
|
70
|
+ <div style="width:140px">个人账户支付:</div>
|
|
71
|
+ <div style="width:140px">个人现金支出:</div>
|
|
72
|
+ </div>
|
|
73
|
+
|
|
74
|
+ <div style="display:flex;">
|
|
75
|
+ <div style="width:220px">个人自付:</div>
|
|
76
|
+ <div style="width:280px">个人自费:</div>
|
|
77
|
+ </div>
|
|
78
|
+
|
|
79
|
+ </div>
|
|
80
|
+ <div :style="{position: 'absolute',top:(480 + (index * 660)) + 'px',left:110+ 'px',width:100 + '%',fontSize:12+'px'}">
|
|
81
|
+ <div style="display:flex;">
|
|
82
|
+ <div style="width:100px">暂时不知道:</div>
|
|
83
|
+ <div style="width:100px">大病:</div>
|
|
84
|
+ <div style="width:100px">公务员:</div>
|
|
85
|
+ <div style="width:100px">超限价:</div>
|
|
86
|
+ <div style="width:100px">先自付:</div>
|
|
87
|
+ <div style="width:100px">医院负担:</div>
|
|
88
|
+ <div style="width:100px">医疗救助:111.87</div>
|
|
89
|
+ <div style="width:100px">补充保险:</div>
|
|
90
|
+ </div>
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+ </div>
|
|
94
|
+ <div>
|
|
95
|
+ <div :style="{position: 'absolute',top:(520 + (index * 660)) + 'px',left:140+ 'px'}">萍乡汉和医院</div>
|
|
96
|
+
|
|
97
|
+ <!-- 复核人 -->
|
|
98
|
+ <div :style="{position: 'absolute',top:(520 + (index * 660)) + 'px',left:340+ 'px'}">萍乡汉和医院</div>
|
|
99
|
+ <!-- 收款人 -->
|
|
100
|
+ <div :style="{position: 'absolute',top:(520 + (index * 660)) + 'px',left:540+ 'px'}">萍乡汉和医院</div>
|
|
101
|
+ </div>
|
|
102
|
+ </div>
|
|
103
|
+ </div>
|
|
104
|
+</template>
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+<script>
|
|
108
|
+import { getInvoice } from '@/api/project/project'
|
|
109
|
+import { uParseTime } from '@/utils/tools'
|
|
110
|
+export default {
|
|
111
|
+ props:{
|
|
112
|
+ paramsObj:Object
|
|
113
|
+ },
|
|
114
|
+ data(){
|
|
115
|
+ return{
|
|
116
|
+ list:{},
|
|
117
|
+ printDate:'',
|
|
118
|
+ zhongwen:'',
|
|
119
|
+ totalPrice:0.0,
|
|
120
|
+ org_id:'',
|
|
121
|
+ org_name:'',
|
|
122
|
+ page:1,
|
|
123
|
+ pageArr:[],
|
|
124
|
+ }
|
|
125
|
+ },
|
|
126
|
+ created(){
|
|
127
|
+ console.log('paramsObj',this.paramsObj)
|
|
128
|
+ let params = {
|
|
129
|
+ order_id: this.paramsObj.order_id,
|
|
130
|
+ patient_id: this.paramsObj.patient_id,
|
|
131
|
+ }
|
|
132
|
+ this.getInvoice(params)
|
|
133
|
+ // var data = new Date();
|
|
134
|
+ // var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
|
|
135
|
+ // var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
|
|
136
|
+ // this.printDate = data.getFullYear() + "-" + month + "-" + date;
|
|
137
|
+ // this.smalltoBIG(982732.21)
|
|
138
|
+ this.org_id = this.$store.getters.xt_user.org_id
|
|
139
|
+ this.org_name = this.$store.getters.xt_user.org.org_name
|
|
140
|
+ },
|
|
141
|
+ methods:{
|
|
142
|
+ getInvoice(params){
|
|
143
|
+ getInvoice(params).then((res) => {
|
|
144
|
+ // console.log('res',res)
|
|
145
|
+ this.list = res.data.data
|
|
146
|
+ // console.log(this.list,'表单内容打印记得注释')
|
|
147
|
+ this.totalPrice = this.list.westernMedicineCostTotal + this.list.checkCostTotal + this.list.treatCostTotal + this.list.bedCostTotal + this.list.chineseTraditionalMedicineCostTotal +
|
|
148
|
+ this.list.laboratoryCostTotal + this.list.operationCostTotal + this.list.otherCostTotal + this.list.materialCostTotal
|
|
149
|
+ this.smalltoBIG(this.list.medfee_sumamt)
|
|
150
|
+ var data = new Date(res.data.data.date * 1000);
|
|
151
|
+ var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
|
|
152
|
+ var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
|
|
153
|
+ this.printDate = data.getFullYear() + "-" + month + "-" + date;
|
|
154
|
+ this.pageArr = []
|
|
155
|
+ this.getPage()
|
|
156
|
+ this.pageArr.push(10)
|
|
157
|
+ console.log('pageArr',this.pageArr.length)
|
|
158
|
+ })
|
|
159
|
+ },
|
|
160
|
+ smalltoBIG(n) {
|
|
161
|
+ // let fraction = ['角', '分'];
|
|
162
|
+ // let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
|
|
163
|
+ // let unit = [['元.', '万,', '亿,'], ["元",'拾', '佰', '仟']];
|
|
164
|
+ // let head = price < 0 ? '欠' : '';
|
|
165
|
+ // price = Math.abs(price);
|
|
166
|
+ // let upper = '';
|
|
167
|
+ // for (let i = 0; i < fraction.length; i++) {
|
|
168
|
+ // upper += (digit[Math.floor(price * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
|
|
169
|
+ // }
|
|
170
|
+ // upper = upper || '整';
|
|
171
|
+ // price = Math.floor(price);
|
|
172
|
+ // for (let i = 0; i < unit[0].length && price > 0; i++) {
|
|
173
|
+ // let p = '';
|
|
174
|
+ // for (let j = 0; j < unit[1].length && price > 0; j++) {
|
|
175
|
+ // p = digit[price % 10] + unit[1][j] + p;
|
|
176
|
+ // price = Math.floor(price / 10);
|
|
177
|
+ // }
|
|
178
|
+ // upper = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + upper;
|
|
179
|
+ // }
|
|
180
|
+ // this.zhongwen = head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整')
|
|
181
|
+ // console.log('6666',head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整'))
|
|
182
|
+ if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)){
|
|
183
|
+ return "数据非法"; //判断数据是否大于0
|
|
184
|
+ }
|
|
185
|
+
|
|
186
|
+ var unit = "仟佰拾亿仟佰拾万仟佰拾元角分", str = "";
|
|
187
|
+ n += "00";
|
|
188
|
+
|
|
189
|
+ var indexpoint = n.indexOf('.'); // 如果是小数,截取小数点前面的位数
|
|
190
|
+
|
|
191
|
+ if (indexpoint >= 0){
|
|
192
|
+
|
|
193
|
+ n = n.substring(0, indexpoint) + n.substr(indexpoint+1, 2); // 若为小数,截取需要使用的unit单位
|
|
194
|
+ }
|
|
195
|
+
|
|
196
|
+ unit = unit.substr(unit.length - n.length); // 若为整数,截取需要使用的unit单位
|
|
197
|
+ for (var i=0; i < n.length; i++){
|
|
198
|
+ str += "零壹贰叁肆伍陆柒捌玖".charAt(n.charAt(i)) + unit.charAt(i); //遍历转化为大写的数字
|
|
199
|
+ }
|
|
200
|
+ console.log("str",str)
|
|
201
|
+ if(str == '零元零角零分'){
|
|
202
|
+ this.zhongwen = '零'
|
|
203
|
+ }else{
|
|
204
|
+ this.zhongwen = str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
|
|
205
|
+ }
|
|
206
|
+
|
|
207
|
+ console.log(this.zhongwen)
|
|
208
|
+ },
|
|
209
|
+ getTime(value, temp) {
|
|
210
|
+ if (value == 0) {
|
|
211
|
+ return ''
|
|
212
|
+ }
|
|
213
|
+ if (value != undefined) {
|
|
214
|
+ return uParseTime(value, temp)
|
|
215
|
+ }
|
|
216
|
+ return ''
|
|
217
|
+ },
|
|
218
|
+ getPage(){
|
|
219
|
+ if(this.list.order_info.length <= 10){
|
|
220
|
+ this.page = 1
|
|
221
|
+ this.pageArr.push(this.list.order_info.length)
|
|
222
|
+ }else if(this.list.order_info.length > 10){
|
|
223
|
+ this.page = parseInt(this.list.order_info.length / 10)
|
|
224
|
+ let num = this.list.order_info.length % 10
|
|
225
|
+ for (var i=0;i<this.page;i++){
|
|
226
|
+ this.pageArr.push(10)
|
|
227
|
+ }
|
|
228
|
+ if(num != 0){
|
|
229
|
+ this.pageArr.push(num)
|
|
230
|
+ }
|
|
231
|
+ }
|
|
232
|
+ }
|
|
233
|
+
|
|
234
|
+ },
|
|
235
|
+ watch:{
|
|
236
|
+ paramsObj:{//深度监听,可监听到对象、数组的变化
|
|
237
|
+ handler(val, oldVal){
|
|
238
|
+ let params = {
|
|
239
|
+ order_id: val.order_id,
|
|
240
|
+ patient_id: val.patient_id,
|
|
241
|
+ }
|
|
242
|
+ this.getInvoice(params)
|
|
243
|
+
|
|
244
|
+ },
|
|
245
|
+ deep:true
|
|
246
|
+ }
|
|
247
|
+ }
|
|
248
|
+}
|
|
249
|
+</script>
|