See999 3 years ago
parent
commit
92cdaf94bb

+ 1 - 1
src/xt_pages/outpatientCharges/invoicePrint.vue View File

63
     printThisPage() {
63
     printThisPage() {
64
 
64
 
65
       const style =
65
       const style =
66
-        '@media print {.printTitle{font-size: 22px;text-align: center;font-weight: bold;}.infoMain{display: flex;flex-wrap: wrap;padding:0 10px;margin-top:10px;}.infoMain .infoP{width: 33%;}.chargeBox{border: 1px solid #000;}.chargeUl{display:flex;justify-content: space-between;text-align: center;}.chargeUl p{line-height: 1px;}.chargeP{line-height: 1px;padding-bottom:16px;}.moneyBox{display: flex;justify-content: space-between;padding: 0 10px;background: #eeeeee;-webkit-print-color-adjust:exact;-moz-print-color-adjust:exact;-ms-print-color-adjust:exact;print-color-adjust:exact;height: 40px;align-items: center;border:1px solid #000; border-top:none}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;}.actionBar div{width:150px;}}';
66
+        '@media print {#invoice-print{font-size:12px;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}.infoMain{display: flex;flex-wrap: wrap;padding:0 10px;margin-top:10px;}.infoMain .infoP{width: 33%;}.chargeBox{border: 1px solid #000;}.chargeUl{display:flex;justify-content: space-between;text-align: center;}.chargeUl p{line-height: 1px;}.chargeP{line-height: 1px;padding-bottom:16px;}.moneyBox{display: flex;justify-content: space-between;padding: 0 10px;background: #eeeeee;-webkit-print-color-adjust:exact;-moz-print-color-adjust:exact;-ms-print-color-adjust:exact;print-color-adjust:exact;height: 40px;align-items: center;border:1px solid #000; border-top:none}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;}.actionBar div{width:150px;}}';
67
         printJS({
67
         printJS({
68
             printable: "invoice-print",
68
             printable: "invoice-print",
69
             type: "html",
69
             type: "html",

+ 111 - 74
src/xt_pages/outpatientCharges/invoiceTemplate/printOne.vue View File

1
 <template>
1
 <template>
2
     <div id='invoice-print'>
2
     <div id='invoice-print'>
3
         <div style="display:flex;">
3
         <div style="display:flex;">
4
-            <div>业务流水号:{{ list.order_number }}</div>
5
-            <div>社会保障号:{{ list.id_card_no }}</div>
4
+            <div style="position: absolute;top:50px;left:70px;">{{ list.order_number }}</div>
5
+            <!-- <div>{{ list.id_card_no }}</div> -->
6
         </div>
6
         </div>
7
         <div style="display:flex;justify-content: space-between;">
7
         <div style="display:flex;justify-content: space-between;">
8
-            <div>科室:{{ list.department_name }}</div>
9
-            <div>门诊号:{{ list.number }}</div>
10
-            <div>医院类型:</div>
11
-            <div>
12
-                <span>{{ printDate.slice(0,4) }}</span>
13
-                <span>{{ printDate.slice(5,7) }}</span>
14
-                <span>{{ printDate.slice(8,11) }}</span>
8
+            <!-- <div>{{ list.department_name }}</div> -->
9
+            <div  style="position: absolute;top:50px;left:300px">{{ list.number }}</div>
10
+            <div></div>
11
+            <div  style="position: absolute;left:560px;top:50px;">
12
+                <span>{{ printDate.slice(0,4) }}</span>
13
+                <span>{{ printDate.slice(5,7) }}</span>
14
+                <span>{{ printDate.slice(8,11) }}</span>
15
             </div>
15
             </div>
16
         </div>
16
         </div>
17
         <div style="display:flex;justify-content: space-between;">
17
         <div style="display:flex;justify-content: space-between;">
18
-            <div>姓名: {{ paramsObj.name }}</div>
19
-            <div>{{ list.pay_way }}</div>
20
-            <div>住院日期: {{ paramsObj.setl_time.split(' ')[0] }}</div>
21
-            <div>出院日期: {{ paramsObj.setl_time.split(' ')[0] }}</div>
18
+            <div style="position: absolute;top:70px;left:120px;"> {{ paramsObj.name }}</div>
19
+            <!-- <div>{{ list.pay_way }}</div> -->
20
+            <div style="position: absolute;top:70px;left:460px;">{{ paramsObj.setl_time.split(' ')[0] }}</div>
21
+            <div style="position: absolute;top:70px;left:560px;">{{ paramsObj.setl_time.split(' ')[0] }}</div>
22
         </div>
22
         </div>
23
         <div style="display:flex;justify-content: space-between;">
23
         <div style="display:flex;justify-content: space-between;">
24
-            <div>性别: {{ paramsObj.gend == 1 ? '男' : '女' }}</div>
25
-            <div>医保/公医记账:{{ totalPrice - list.psn_cash_money }}</div>
26
-            <div>个人缴费: {{ list.psn_cash_money }}</div>
27
-            <div>结算方式: {{ list.pay_way }}</div>
24
+            <!-- <div>{{ paramsObj.gend == 1 ? '男' : '女' }}</div> -->
25
+            <div style="position: absolute;top:90px;left:260px;">{{ totalPrice - list.psn_cash_money }}</div>
26
+            <div style="position: absolute;top:90px;left:440px;">{{ list.psn_cash_money }}</div>
27
+            <div style="position: absolute;top:90px;left:580px;">{{ list.pay_way }}</div>
28
         </div>
28
         </div>
29
         <div style="display:flex;justify-content: space-between;">
29
         <div style="display:flex;justify-content: space-between;">
30
-            <div style="width:12.5%">西药</div>
31
-            <div style="width:12.5%">{{ list.westernMedicineCostTotal }}</div>
32
-            <div style="width:12.5%">检查费</div>
33
-            <div style="width:12.5%">{{ list.checkCostTotal }}</div>
34
-            <div style="width:12.5%">治疗费</div>
35
-            <div style="width:12.5%">{{ list.treatCostTotal }}</div>
36
-            <div style="width:12.5%">床位费</div>
37
-            <div style="width:12.5%">{{ list.bedCostTotal }}</div>
30
+            <div style="position: absolute;top:140px;left:40px">西药</div>
31
+            <div style="position: absolute;top:140px;left:110px">{{ list.westernMedicineCostTotal }}</div>
32
+            <div style="position: absolute;top:140px;left:180px">检查费</div>
33
+            <div style="position: absolute;top:140px;left:260px">{{ list.checkCostTotal }}</div>
34
+            <div style="position: absolute;top:140px;left:340px">治疗费</div>
35
+            <div style="position: absolute;top:140px;left:420px">{{ list.treatCostTotal }}</div>
36
+            <div style="position: absolute;top:140px;left:500px">床位费</div>
37
+            <div style="position: absolute;top:140px;left:580px">{{ list.bedCostTotal }}</div>
38
         </div>
38
         </div>
39
         <div style="display:flex;justify-content: space-between;">
39
         <div style="display:flex;justify-content: space-between;">
40
-            <div style="width:12.5%">中成药</div>
41
-            <div style="width:12.5%">{{ list.chineseTraditionalMedicineCostTotal }}</div>
42
-            <div style="width:12.5%">化验费</div>
43
-            <div style="width:12.5%">{{ list.laboratoryCostTotal }}</div>
44
-            <div style="width:12.5%">手术费</div>
45
-            <div style="width:12.5%">{{ list.operationCostTotal }}</div>
46
-            <div style="width:12.5%">其他费</div>
47
-            <div style="width:12.5%">{{ list.otherCostTotal }}</div>
40
+            <div style="position: absolute;top:170px;left:40px">中成药</div>
41
+            <div style="position: absolute;top:170px;left:110px">{{ list.chineseTraditionalMedicineCostTotal }}</div>
42
+            <div style="position: absolute;top:170px;left:180px">化验费</div>
43
+            <div style="position: absolute;top:170px;left:260px">{{ list.laboratoryCostTotal }}</div>
44
+            <div style="position: absolute;top:170px;left:340px">手术费</div>
45
+            <div style="position: absolute;top:170px;left:420px">{{ list.operationCostTotal }}</div>
46
+            <div style="position: absolute;top:170px;left:500px">其他费</div>
47
+            <div style="position: absolute;top:170px;left:580px">{{ list.otherCostTotal }}</div>
48
         </div>
48
         </div>
49
         <div style="display:flex;justify-content: space-between;">
49
         <div style="display:flex;justify-content: space-between;">
50
-            <div style="width:12.5%"></div>
51
-            <div style="width:12.5%"></div>
52
-            <div style="width:12.5%"></div>
53
-            <div style="width:12.5%"></div>
54
-            <div style="width:12.5%">材料费</div>
55
-            <div style="width:12.5%">{{ list.materialCostTotal }}</div>
56
-            <div style="width:12.5%"></div>
57
-            <div style="width:12.5%"></div>
50
+            <div style="position: absolute;top:190px;left:40px"></div>
51
+            <div style="position: absolute;top:190px;left:110px"></div>
52
+            <div style="position: absolute;top:190px;left:180px"></div>
53
+            <div style="position: absolute;top:190px;left:260px"></div>
54
+            <div style="position: absolute;top:190px;left:340px">材料费</div>
55
+            <div style="position: absolute;top:190px;left:420px">{{ list.materialCostTotal }}</div>
56
+            <div style="position: absolute;top:190px;left:500px"></div>
57
+            <div style="position: absolute;top:190px;left:580px"></div>
58
         </div>
58
         </div>
59
         <div>
59
         <div>
60
             <span>
60
             <span>
61
+            <span  style="position: absolute;top:240px;left:180px">
62
+                <span v-if="zhongwen.indexOf('万') > -1 && zhongwen.indexOf('拾') > -1 && zhongwen.indexOf('拾') == 1">
63
+                    {{ zhongwen.substring(0,1) }}
64
+                </span>
65
+                <span v-else>零</span>
66
+            </span>
67
+            <span  style="position: absolute;top:240px;left:220px">
61
                 <span v-if="zhongwen.indexOf('万') > -1">
68
                 <span v-if="zhongwen.indexOf('万') > -1">
62
-                    {{ zhongwen.substring(zhongwen.indexOf('万'),-1) }}
69
+                    {{ zhongwen.substring(zhongwen.indexOf('万') - 1,zhongwen.indexOf('万')) }}
63
                 </span>
70
                 </span>
64
                 <span v-else>零</span>
71
                 <span v-else>零</span>
65
             </span>
72
             </span>
66
-            <span>
73
+            <span  style="position: absolute;top:240px;left:260px">
67
                 <span v-if="zhongwen.indexOf('仟') > -1">
74
                 <span v-if="zhongwen.indexOf('仟') > -1">
68
-                    {{ zhongwen.substring(zhongwen.indexOf('仟'),-1) }}
75
+                    {{ zhongwen.substring(zhongwen.indexOf('仟') - 1,zhongwen.indexOf('仟')) }}
69
                 </span>
76
                 </span>
70
                 <span v-else>零</span>
77
                 <span v-else>零</span>
71
             </span>
78
             </span>
72
-            <span>
79
+            <span  style="position: absolute;top:240px;left:300px">
73
                 <span v-if="zhongwen.indexOf('佰') > -1">
80
                 <span v-if="zhongwen.indexOf('佰') > -1">
74
                     {{ zhongwen.substring(zhongwen.indexOf('佰') - 1,zhongwen.indexOf('佰')) }}
81
                     {{ zhongwen.substring(zhongwen.indexOf('佰') - 1,zhongwen.indexOf('佰')) }}
75
                 </span>
82
                 </span>
76
                 <span v-else>零</span>
83
                 <span v-else>零</span>
77
             </span>
84
             </span>
78
-            <span>
85
+            <span style="position: absolute;top:240px;left:340px">
79
                 <span v-if="zhongwen.indexOf('拾') > -1">
86
                 <span v-if="zhongwen.indexOf('拾') > -1">
80
                     {{ zhongwen.substring(zhongwen.indexOf('拾') - 1,zhongwen.indexOf('拾')) }}
87
                     {{ zhongwen.substring(zhongwen.indexOf('拾') - 1,zhongwen.indexOf('拾')) }}
81
                 </span>
88
                 </span>
82
                 <span v-else>零</span>
89
                 <span v-else>零</span>
83
             </span>
90
             </span>
84
-            <span>
85
-                <span v-if="zhongwen.indexOf('元') > -1">
91
+            <span  style="position: absolute;top:240px;left:380px">
92
+                <span v-if="zhongwen.indexOf('元') > -1 && zhongwen.substring(zhongwen.indexOf('元') - 1,zhongwen.indexOf('元')) != '拾'">
86
                     {{ zhongwen.substring(zhongwen.indexOf('元') - 1,zhongwen.indexOf('元')) }}
93
                     {{ zhongwen.substring(zhongwen.indexOf('元') - 1,zhongwen.indexOf('元')) }}
87
                 </span>
94
                 </span>
88
                 <span v-else>零</span>
95
                 <span v-else>零</span>
89
             </span>
96
             </span>
90
-            <span>
97
+            <span  style="position: absolute;top:240px;left:420px">
91
                 <span v-if="zhongwen.indexOf('角') > -1">
98
                 <span v-if="zhongwen.indexOf('角') > -1">
92
                     {{ zhongwen.substring(zhongwen.indexOf('角') - 1,zhongwen.indexOf('角')) }}
99
                     {{ zhongwen.substring(zhongwen.indexOf('角') - 1,zhongwen.indexOf('角')) }}
93
                 </span>
100
                 </span>
94
                 <span v-else>零</span>
101
                 <span v-else>零</span>
95
             </span>
102
             </span>
96
-            <span>
103
+            <span  style="position: absolute;top:240px;left:460px">
97
                 <span v-if="zhongwen.indexOf('分') > -1">
104
                 <span v-if="zhongwen.indexOf('分') > -1">
98
                     {{ zhongwen.substring(zhongwen.indexOf('分') - 1,zhongwen.indexOf('分')) }}
105
                     {{ zhongwen.substring(zhongwen.indexOf('分') - 1,zhongwen.indexOf('分')) }}
99
                 </span>
106
                 </span>
100
                 <span v-else>零</span>
107
                 <span v-else>零</span>
101
             </span>
108
             </span>
102
-            <span>{{ totalPrice }}</span>
109
+            </span>
110
+            <span style="position: absolute;top:240px;left:540px">{{ totalPrice }}</span>
111
+        </div>
112
+        <div>
113
+            <div style="position: absolute;top:320px;left:70px">{{ org_name }}</div>
114
+            <div v-if="org_id == 9990" style="position: absolute;top:320px;left:300px">钱玉玲</div>
115
+            <div v-if="org_id == 9990" style="position: absolute;top:320px;left:420px">陈国杰</div>
103
         </div>
116
         </div>
104
     </div>
117
     </div>
105
 </template>
118
 </template>
116
             list:{},
129
             list:{},
117
             printDate:'',
130
             printDate:'',
118
             zhongwen:'',
131
             zhongwen:'',
119
-            totalPrice:0.0
132
+            totalPrice:0.0,
133
+            org_id:'',
134
+            org_name:''
120
         }
135
         }
121
     },
136
     },
122
     created(){
137
     created(){
130
         var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
145
         var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
131
         var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
146
         var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
132
         this.printDate = data.getFullYear() + "-" + month + "-" + date;
147
         this.printDate = data.getFullYear() + "-" + month + "-" + date;
133
-        
148
+        // this.smalltoBIG(982732.21)
149
+        this.org_id = this.$store.getters.xt_user.org_id
150
+        this.org_name = this.$store.getters.xt_user.org.org_name
134
     },
151
     },
135
     methods:{
152
     methods:{
136
         getInvoice(params){
153
         getInvoice(params){
142
                 this.smalltoBIG(this.totalPrice)
159
                 this.smalltoBIG(this.totalPrice)
143
             })
160
             })
144
         },
161
         },
145
-        smalltoBIG(price) {
146
-            let fraction = ['角', '分'];
147
-            let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
148
-            let unit = [['元.', '万,', '亿,'], ['元', '拾', '佰', '仟']];
149
-            let head = price < 0 ? '欠' : '';
150
-            price = Math.abs(price);
151
-            let upper = '';
152
-            for (let i = 0; i < fraction.length; i++) {
153
-            upper += (digit[Math.floor(price * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
162
+        smalltoBIG(n) {
163
+            // let fraction = ['角', '分'];
164
+            // let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
165
+            // let unit = [['元.', '万,', '亿,'], ["元",'拾', '佰', '仟']];
166
+            // let head = price < 0 ? '欠' : '';
167
+            // price = Math.abs(price);
168
+            // let upper = '';
169
+            // for (let i = 0; i < fraction.length; i++) {
170
+            // upper += (digit[Math.floor(price * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
171
+            // }
172
+            // upper = upper || '整';
173
+            // price = Math.floor(price);
174
+            // for (let i = 0; i < unit[0].length && price > 0; i++) {
175
+            // let p = '';
176
+            // for (let j = 0; j < unit[1].length && price > 0; j++) {
177
+            //     p = digit[price % 10] + unit[1][j] + p;
178
+            //     price = Math.floor(price / 10);
179
+            // }
180
+            // upper = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + upper;
181
+            // }
182
+            // this.zhongwen = head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整')
183
+            // console.log('6666',head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整'))
184
+            if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)){
185
+                return "数据非法";  //判断数据是否大于0
154
             }
186
             }
155
-            upper = upper || '整';
156
-            price = Math.floor(price);
157
-            for (let i = 0; i < unit[0].length && price > 0; i++) {
158
-            let p = '';
159
-            for (let j = 0; j < unit[1].length && price > 0; j++) {
160
-                p = digit[price % 10] + unit[1][j] + p;
161
-                price = Math.floor(price / 10);
187
+
188
+            var unit = "仟佰拾亿仟佰拾万仟佰拾元角分", str = "";
189
+            n += "00";  
190
+
191
+            var indexpoint = n.indexOf('.');  // 如果是小数,截取小数点前面的位数
192
+
193
+            if (indexpoint >= 0){
194
+
195
+                n = n.substring(0, indexpoint) + n.substr(indexpoint+1, 2);   // 若为小数,截取需要使用的unit单位
162
             }
196
             }
163
-            upper = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + upper;
197
+
198
+            unit = unit.substr(unit.length - n.length);  // 若为整数,截取需要使用的unit单位
199
+            for (var i=0; i < n.length; i++){
200
+                str += "零壹贰叁肆伍陆柒捌玖".charAt(n.charAt(i)) + unit.charAt(i);  //遍历转化为大写的数字
164
             }
201
             }
165
-            this.zhongwen = head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整')
166
-            console.log('6666',head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整'))
167
-    
202
+
203
+            this.zhongwen =  str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
204
+            console.log(this.zhongwen)
168
         },
205
         },
169
 
206
 
170
     },
207
     },
182
         }
219
         }
183
     }
220
     }
184
 }
221
 }
185
-</script>
222
+</script>

+ 1 - 1
src/xt_pages/outpatientCharges/summary.vue View File

552
       invoicePrint(obj){
552
       invoicePrint(obj){
553
         console.log(obj)
553
         console.log(obj)
554
         let paramsObj = {
554
         let paramsObj = {
555
-          order_id: obj.order_info.order_id,
555
+          order_id: obj.id,
556
           patient_id: obj.patient_id,
556
           patient_id: obj.patient_id,
557
           name:obj.patient.name,
557
           name:obj.patient.name,
558
           age:obj.age,
558
           age:obj.age,