see999 пре 3 година
родитељ
комит
dfd7632821

+ 5 - 2
src/xt_pages/outpatientCharges/invoicePrint.vue Прегледај датотеку

@@ -13,12 +13,13 @@
13 13
     </template>
14 14
     <div class="app-container" style="padding-top:40px;">
15 15
         <div class='dialysisPage'>
16
-          <div v-if="org_id != 10106 && org_id != 10215 && org_id != 4" >
16
+          <div v-if="org_id != 10106 && org_id != 10215 && org_id != 4 && org_id != 10188" >
17 17
             <printOne v-if="org_id != 10088" :paramsObj="invoiceParams"></printOne>
18 18
             <printThree v-if="org_id == 10088" :paramsObj="invoiceParams"></printThree>
19 19
           </div>
20 20
           <printTwo v-if="org_id == 10106" :paramsObj="invoiceParams"></printTwo>
21 21
           <printFour v-if="org_id == 10215 || org_id == 4" :paramsObj="invoiceParams"></printFour>
22
+          <printFive v-if="org_id == 10188" :paramsObj="invoiceParams"></printFive>
22 23
         </div>
23 24
     </div>
24 25
   </div>
@@ -29,13 +30,15 @@ import printOne from './invoiceTemplate/printOne'
29 30
 import printTwo from './invoiceTemplate/printTwo'
30 31
 import printThree from './invoiceTemplate/printThree'
31 32
 import printFour from './invoiceTemplate/printFour'
33
+import printFive from './invoiceTemplate/printFive'
32 34
 export default {
33 35
    name: "invoicePrint",
34 36
   components: {
35 37
     printOne,
36 38
     printTwo,
37 39
     printThree,
38
-    printFour
40
+    printFour,
41
+    printFive
39 42
   },
40 43
   props:{
41 44
     invoiceParams:Object

+ 203 - 0
src/xt_pages/outpatientCharges/invoiceTemplate/printFive.vue Прегледај датотеку

@@ -0,0 +1,203 @@
1
+<template>
2
+    <div id='invoice-print'>
3
+        <div style="display:flex;">
4
+            <div style="position: absolute;top:80px;left:70px;">{{ list.order_number }}</div>
5
+            <!-- <div>{{ list.id_card_no }}</div> -->
6
+        </div>
7
+        <div style="display:flex;justify-content: space-between;">
8
+            <div style="position: absolute;top:100px;left:80px;"> {{ paramsObj.name }}</div>
9
+        </div>
10
+        <div style="position: absolute;top:120px;left:80px">
11
+            <div v-if="list.westernMedicineCostTotal">西药 {{ list.westernMedicineCostTotal }}</div>
12
+            <div v-if="list.treatCostTotal">治疗费 {{ list.treatCostTotal }}</div>
13
+            <div v-if="list.bedCostTotal">床位费 {{ list.bedCostTotal }}</div>
14
+            <div v-if="list.chineseTraditionalMedicineCostTotal">中成药 {{ list.chineseTraditionalMedicineCostTotal }}</div>
15
+            <div v-if="list.laboratoryCostTotal">化验费 {{ list.laboratoryCostTotal }}</div>
16
+            <div v-if="list.operationCostTotal">手术费 {{ list.operationCostTotal }}</div>
17
+            <div v-if="list.otherCostTotal">其他费 {{ list.otherCostTotal }}</div>
18
+            <div v-if="list.materialCostTotal">材料费 {{ list.materialCostTotal }}</div>
19
+        </div>
20
+        <div style="position: absolute;top:120px;left:300px">
21
+            <div v-for="(item,index) in list.order_info" :key="index">
22
+                <span style="display:inline-block;width:240px;">
23
+                    <span v-if="item.advice.id == 0">
24
+                        <span v-if="item.project.type == 2">{{ item.project.project.project_name }}</span>
25
+                        <span v-if="item.project.type == 3">{{ item.project.good_info.good_name }}</span>
26
+                    </span>
27
+                    <span v-else>{{ item.advice.advice_name }}</span>
28
+                </span>
29
+                <span style="display:inline-block;width:50px;">
30
+                    <span v-if="item.advice.id == 0">
31
+                        <span v-if="item.project.type == 2">{{ item.project.count }}{{ item.project.unit }}</span>
32
+                        <span v-if="item.project.type == 3">{{ item.project.count }}{{ item.project.unit }}</span>
33
+                    </span>
34
+                    <span v-else>{{ item.advice.prescribing_number }}{{ item.advice.prescribing_number_unit }}</span>
35
+                </span>
36
+                <span>
37
+                    <span v-if="item.advice.id == 0">
38
+                        <span v-if="item.project.type == 2">{{ (item.project.count * item.pric).toFixed(2) }}</span>
39
+                        <span v-if="item.project.type == 3">{{ (item.project.count * item.pric).toFixed(2) }}</span>
40
+                    </span>
41
+                    <span v-else>{{ (item.advice.prescribing_number * item.pric).toFixed(2) }}</span>
42
+                </span>
43
+            </div>
44
+        </div>
45
+        <div style="position: absolute;top:300px;left:80px">{{ zhongwen }}</div>
46
+        <div style="position: absolute;top:300px;left:300px">{{ list.psn_cash_money ? list.psn_cash_money : list.medfee_sumamt }}</div>
47
+        <div style="position: absolute;top:320px;left:80px;width:100%">
48
+            <div style="display:flex;">
49
+                <div style="width:160px">医疗总费用:{{ list.psn_cash_money ? list.psn_cash_money : list.medfee_sumamt }}</div>
50
+                <div style="width:160px">现金支出:{{ list.psn_cash_money ? list.psn_cash_money : list.medfee_sumamt }}</div>
51
+                <div style="width:160px">上次账户:0</div>
52
+                <div style="width:160px">本次账户:0</div>
53
+            </div>
54
+            <div style="display:flex;">
55
+                <div style="width:160px">账户余额:{{ list.order.balc }}</div>
56
+                <div style="width:160px">统筹支出:{{ list.order.hifp_pay }}</div>
57
+                <div style="width:160px">大病支出:0</div>
58
+                <div style="width:160px">民政支出:0</div>
59
+            </div>
60
+            <div style="display:flex;">
61
+                <div style="width:160px">大病补充保险支出:0</div>
62
+                <div style="width:320px">企业补充医疗保险基金支出:{{ list.order.hifes_pay }}</div>
63
+                <div style="width:160px">其他支出:{{ list.order.oth_pay }}</div>
64
+            </div>
65
+        </div>
66
+        <div>
67
+            <div style="position: absolute;top:380px;left:120px">{{ org_name }}</div>
68
+            <div style="position: absolute;top:380px;left:300px">{{ paramsObj.chargeName }}</div>
69
+             <div  style="position: absolute;left:470px;top:380px;">
70
+                <span>{{  paramsObj.setl_time ? paramsObj.setl_time.split(' ')[0].slice(0,4) : getTime(list.date, '{y}-{m}-{d}').slice(0,4) }}</span>
71
+            </div>
72
+            <div  style="position: absolute;left:530px;top:380px;">
73
+                <span>{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(5,7)) : getTime(list.date, '{y}-{m}-{d}').slice(5,7) }}</span>
74
+            </div>
75
+            <div  style="position: absolute;left:560px;top:380px;">
76
+                <span>{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(8,11)) : getTime(list.date, '{y}-{m}-{d}').slice(8,11) }}</span>
77
+            </div>
78
+        </div>
79
+    </div>
80
+</template>
81
+
82
+
83
+<script>
84
+import { getInvoice } from '@/api/project/project'
85
+import { uParseTime } from '@/utils/tools'
86
+export default {
87
+    props:{
88
+        paramsObj:Object
89
+    },
90
+    data(){
91
+        return{
92
+            list:{},
93
+            printDate:'',
94
+            zhongwen:'',
95
+            totalPrice:0.0,
96
+            org_id:'',
97
+            org_name:''
98
+        }
99
+    },
100
+    created(){
101
+        console.log('paramsObj',this.paramsObj)
102
+        let params = {
103
+            order_id: this.paramsObj.order_id,
104
+            patient_id: this.paramsObj.patient_id,
105
+        }
106
+        this.getInvoice(params)
107
+        // var data = new Date();
108
+        // var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
109
+        // var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
110
+        // this.printDate = data.getFullYear() + "-" + month + "-" + date;
111
+        // this.smalltoBIG(982732.21)
112
+        this.org_id = this.$store.getters.xt_user.org_id
113
+        this.org_name = this.$store.getters.xt_user.org.org_name
114
+    },
115
+    methods:{
116
+        getInvoice(params){
117
+            getInvoice(params).then((res) => {
118
+                console.log('res',res)
119
+                this.list = res.data.data
120
+                this.totalPrice = this.list.westernMedicineCostTotal + this.list.checkCostTotal + this.list.treatCostTotal + this.list.bedCostTotal + this.list.chineseTraditionalMedicineCostTotal +
121
+                                    this.list.laboratoryCostTotal + this.list.operationCostTotal + this.list.otherCostTotal + this.list.materialCostTotal
122
+                this.smalltoBIG(this.list.psn_cash_money ? this.list.psn_cash_money : this.list.medfee_sumamt)
123
+                var data = new Date(res.data.data.date * 1000);
124
+                var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
125
+                var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
126
+                this.printDate = data.getFullYear() + "-" + month + "-" + date;
127
+            })
128
+        },
129
+        smalltoBIG(n) {
130
+            // let fraction = ['角', '分'];
131
+            // let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
132
+            // let unit = [['元.', '万,', '亿,'], ["元",'拾', '佰', '仟']];
133
+            // let head = price < 0 ? '欠' : '';
134
+            // price = Math.abs(price);
135
+            // let upper = '';
136
+            // for (let i = 0; i < fraction.length; i++) {
137
+            // upper += (digit[Math.floor(price * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
138
+            // }
139
+            // upper = upper || '整';
140
+            // price = Math.floor(price);
141
+            // for (let i = 0; i < unit[0].length && price > 0; i++) {
142
+            // let p = '';
143
+            // for (let j = 0; j < unit[1].length && price > 0; j++) {
144
+            //     p = digit[price % 10] + unit[1][j] + p;
145
+            //     price = Math.floor(price / 10);
146
+            // }
147
+            // upper = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + upper;
148
+            // }
149
+            // this.zhongwen = head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整')
150
+            // console.log('6666',head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整'))
151
+            if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)){
152
+                return "数据非法";  //判断数据是否大于0
153
+            }
154
+
155
+            var unit = "仟佰拾亿仟佰拾万仟佰拾元角分", str = "";
156
+            n += "00";  
157
+
158
+            var indexpoint = n.indexOf('.');  // 如果是小数,截取小数点前面的位数
159
+
160
+            if (indexpoint >= 0){
161
+
162
+                n = n.substring(0, indexpoint) + n.substr(indexpoint+1, 2);   // 若为小数,截取需要使用的unit单位
163
+            }
164
+
165
+            unit = unit.substr(unit.length - n.length);  // 若为整数,截取需要使用的unit单位
166
+            for (var i=0; i < n.length; i++){
167
+                str += "零壹贰叁肆伍陆柒捌玖".charAt(n.charAt(i)) + unit.charAt(i);  //遍历转化为大写的数字
168
+            }
169
+            console.log("str",str)
170
+            if(str == '零元零角零分'){
171
+                this.zhongwen = '零'
172
+            }else{
173
+                this.zhongwen =  str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
174
+            }
175
+
176
+            console.log(this.zhongwen)
177
+        },
178
+        getTime(value, temp) {
179
+            if (value == 0) {
180
+                return ''
181
+            }
182
+            if (value != undefined) {
183
+                return uParseTime(value, temp)
184
+            }
185
+            return ''
186
+        },
187
+
188
+    },
189
+    watch:{
190
+        paramsObj:{//深度监听,可监听到对象、数组的变化
191
+            handler(val, oldVal){
192
+                let params = {
193
+                    order_id: val.order_id,
194
+                    patient_id: val.patient_id,
195
+                }
196
+                this.getInvoice(params)
197
+
198
+            },
199
+            deep:true
200
+        }
201
+    }
202
+}
203
+</script>