yq1 1 year ago
parent
commit
c1f9382264

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

@@ -10,12 +10,12 @@
10 10
         type="primary"
11 11
       >打印</el-button>
12 12
     </template>
13
-    <div class="app-container" style="padding-top:40px;" v-if="org_id != 10217 && org_id != 10485 && org_id != 10375 && org_id != 10567 && org_id != 10188 "><!--&& org_id != 10188 && org_id != 0-->
13
+    <div class="app-container" style="padding-top:40px;" v-if="org_id != 10217 && org_id != 10485 && org_id != 10375 && org_id != 10567 && org_id != 10188 && org_id != 0"><!--&& org_id != 10188 && org_id != 0-->
14 14
         <div class='dialysisPage'>
15 15
           <div v-if="org_id != 10106 && org_id != 10215 && org_id != 4 && org_id != 10188 && org_id != 10217 && org_id != 10387&& org_id != 10210 && org_id != 10387 && org_id != 10480 " >
16 16
             <printOne v-if="org_id != 10088 && org_id != 10510 && org_id != 0" :paramsObj="invoiceParams"></printOne>
17 17
             <printThree v-if="org_id == 10088 " :paramsObj="invoiceParams"></printThree>
18
-            <printfifteen v-if="org_id == 10510 || org_id==0 " :paramsObj="invoiceParams"></printfifteen>
18
+            <printfifteen v-if="org_id == 10510  " :paramsObj="invoiceParams"></printfifteen>
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>
@@ -57,11 +57,11 @@
57 57
         <printthirteen  :paramsObj="invoiceParams"></printthirteen>
58 58
       </div>
59 59
     </div>
60
-    <!-- <div class="app-container" style="padding-top:40px;" v-if="org_id == 0">
60
+    <div class="app-container" style="" v-if="org_id == 0">
61 61
       <div class='dialysisPage'>
62
-        <printthirteen :paramsObj="invoiceParams"></printthirteen>
62
+        <printSixteen :paramsObj="invoiceParams"></printSixteen>
63 63
       </div>
64
-    </div> -->
64
+    </div>
65 65
   </div>
66 66
 </template>
67 67
 
@@ -81,6 +81,7 @@
81 81
   import printthirteen from './invoiceTemplate/printthirteen'
82 82
   import printfourteen from './invoiceTemplate/printfourteen'
83 83
   import printfifteen from './invoiceTemplate/printfifteen'
84
+  import printSixteen from './invoiceTemplate/printSixteen'
84 85
   export default {
85 86
     name: "invoicePrint",
86 87
     components: {
@@ -98,7 +99,8 @@
98 99
       printtwelve,
99 100
       printthirteen,
100 101
       printfourteen,
101
-      printfifteen
102
+      printfifteen,
103
+      printSixteen
102 104
     },
103 105
     props:{
104 106
       invoiceParams:Object
@@ -108,8 +110,6 @@
108 110
         childResponse: {},
109 111
         //   invoiceParams:{},
110 112
         org_id:''
111
-
112
-
113 113
       };
114 114
     },
115 115
     methods: {

+ 226 - 0
src/xt_pages/outpatientCharges/invoiceTemplate/printSixteen.vue View File

@@ -0,0 +1,226 @@
1
+<template>
2
+  <div id='invoice-print'>
3
+      <div style="border-bottom: 1px solid black;text-align: center;font-size: 18px;margin-bottom: 10px;">
4
+        广水市第一人民医院
5
+      </div>
6
+      <div style="border-bottom: 1px solid black;text-align: center;font-size: 18px;">缴费单</div>
7
+      <div style="display: flex;border-top: 1px solid black;margin-top: 2px;">
8
+        <div style="padding:7px 5px;flex: 1;">电子发票号:</div>
9
+        <div style="padding:7px 5px;flex: 1;">门诊号:</div>
10
+      </div>
11
+      <div style="display: flex;">
12
+        <div style="flex: 1;">姓名:{{paramsObj.name}}</div>
13
+        <div style="flex: 1;">性别:{{ paramsObj.gend==1 ? '男':'女' }}</div>
14
+        <div style="flex: 1;">年龄:{{paramsObj.age}}</div>
15
+      </div>
16
+      <div style="display: flex;">
17
+        <div style="padding:7px 5px;flex: 1;">就诊卡号:</div>
18
+        <div style="padding:7px 5px;flex: 1;">开单科室:{{ list.department_name }}</div>
19
+      </div>
20
+      <div>
21
+        联系电话:
22
+      </div>
23
+      <div style="margin-top: 5px;height: 120px;">
24
+        <div style="display: flex;">
25
+          <div style="flex: 2;">项目</div>
26
+          <div style="flex: 1;">金额</div>
27
+          <div style="flex: 2;">项目</div>
28
+          <div style="flex: 1;">金额</div>
29
+        </div>
30
+        <div style="display: flex;">
31
+          <div style="flex: 2;"><span v-if="list.westernMedicineCostTotal>0">西药</span></div>
32
+          <div style="flex: 1;"><span v-if="list.westernMedicineCostTotal>0">
33
+            {{ list.westernMedicineCostTotal }}</span>
34
+          </div>
35
+          <div style="flex: 2;"><span v-if="list.checkCostTotal>0">检查费</span></div>
36
+          <div style="flex: 1;"><span v-if="list.checkCostTotal>0">{{ list.checkCostTotal }}</span></div>
37
+        </div>
38
+        <div style="display: flex;">
39
+          <div style="flex: 2;"><span v-if="list.treatCostTotal>0">治疗费</span></div>
40
+          <div style="flex: 1;"><span v-if="list.treatCostTotal>0">{{ list.treatCostTotal }}</span></div>
41
+          <div style="flex: 2;"><span v-if="list.bedCostTotal>0">床位费</span></div>
42
+          <div style="flex: 1;"><span v-if="list.bedCostTotal>0">{{ list.bedCostTotal }}</span></div>
43
+        </div>
44
+        <div style="display: flex;">
45
+          <div style="flex: 2;"><span v-if="list.chineseTraditionalMedicineCostTotal>0">中成药</span></div>
46
+          <div style="flex: 1;"><span v-if="list.chineseTraditionalMedicineCostTotal>0">
47
+            {{ list.chineseTraditionalMedicineCostTotal }}</span>
48
+          </div>
49
+          <div style="flex: 2;"><span v-if="list.laboratoryCostTotal>0">化验费</span></div>
50
+          <div style="flex: 1;"><span v-if="list.laboratoryCostTotal>0">{{ list.laboratoryCostTotal }}</span></div>
51
+        </div>
52
+        <div style="display: flex;">
53
+          <div style="flex: 2;"><span v-if="list.operationCostTotal>0">手术费</span></div>
54
+          <div style="flex: 1;"><span v-if="list.operationCostTotal>0">{{ list.operationCostTotal }}</span></div>
55
+          <div style="flex: 2;"><span v-if="list.otherCostTotal>0">其他费</span></div>
56
+          <div style="flex: 1;"><span v-if="list.otherCostTotal>0">{{ list.otherCostTotal }}</span></div>
57
+        </div> 
58
+        <div style="display: flex;">
59
+          <div style="flex: 2;"><span v-if="list.materialCostTotal>0">材料费</span></div>
60
+          <div style="flex: 1;"><span v-if="list.materialCostTotal>0">{{ list.materialCostTotal }}</span></div>
61
+          <div style="flex: 2;"><span></span></div>
62
+          <div style="flex: 1;"><span></span></div>
63
+        </div>
64
+      </div>
65
+      <div style="display: flex;">
66
+        <div style="padding:5px;flex: 1;">合计:</div>
67
+        <div style="padding:5px;flex: 2;">大写:</div>
68
+      </div>
69
+      <div >
70
+        缴费明细:现金: 统筹支付:
71
+      </div>
72
+      <div style="margin: 7px 0;">
73
+        操作员:{{paramsObj.chargeName}}
74
+      </div>
75
+      <div style="">
76
+        缴费日期:{{ paramsObj.setl_time}}
77
+      </div>
78
+      <div style="margin: 7px 0;">
79
+        湖北省财政电子票据公共服务平台网址查验真伪:http://221.232.224.111:8086/bi1lcheck
80
+      </div>
81
+      <div>
82
+        温馨提示:请妥善保管好您的缴费凭证
83
+      </div>
84
+
85
+      <div style="border: 1px solid black;margin: 15px 0;"> </div>
86
+
87
+      <div style="text-align: center;font-size: 18px;">对账单</div>
88
+      <div style="display: flex;margin-top: 3px;">
89
+        <div style="padding:7px 5px;flex: 1;">电子发票号:</div>
90
+        <div style="padding:7px 5px;flex: 1;">门诊号:</div>
91
+      </div>
92
+      <div style="display: flex;">
93
+        <div style="flex: 1;">姓名:{{paramsObj.name}}</div>
94
+        <div style="flex: 1;">操作员:{{ paramsObj.chargeName }}</div>
95
+      </div>
96
+      <div style="margin: 10px 0 15px 0;">
97
+        缴费明细:现金: 统筹支付:
98
+      </div>
99
+      <div style="">
100
+        缴费日期:{{ paramsObj.setl_time}}
101
+      </div>
102
+  </div>
103
+</template>
104
+
105
+
106
+<script>
107
+import { getInvoice } from '@/api/project/project'
108
+import { uParseTime } from '@/utils/tools'
109
+export default {
110
+  props:{
111
+      paramsObj:Object
112
+  },
113
+  data(){
114
+      return{
115
+          list:{},
116
+          printDate:'',
117
+          zhongwen:'',
118
+          totalPrice:0.0,
119
+          org_id:'',
120
+          org_name:''
121
+      }
122
+  },
123
+  created(){
124
+      console.log('paramsObj',this.paramsObj)
125
+      let params = {
126
+          order_id: this.paramsObj.order_id,
127
+          patient_id: this.paramsObj.patient_id,
128
+      }
129
+      this.getInvoice(params)
130
+      // var data = new Date();
131
+      // var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
132
+      // var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
133
+      // this.printDate = data.getFullYear() + "-" + month + "-" + date;
134
+      // this.smalltoBIG(982732.21)
135
+      this.org_id = this.$store.getters.xt_user.org_id
136
+      this.org_name = this.$store.getters.xt_user.org.org_name
137
+  },
138
+  methods:{
139
+      getInvoice(params){
140
+          getInvoice(params).then((res) => {
141
+              console.log('res',res)
142
+              this.list = res.data.data
143
+              this.totalPrice = this.list.westernMedicineCostTotal + this.list.checkCostTotal + this.list.treatCostTotal + this.list.bedCostTotal + this.list.chineseTraditionalMedicineCostTotal +
144
+                                  this.list.laboratoryCostTotal + this.list.operationCostTotal + this.list.otherCostTotal + this.list.materialCostTotal
145
+              this.smalltoBIG(this.list.psn_cash_money)
146
+              var data = new Date(res.data.data.date * 1000);
147
+              var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
148
+              var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
149
+              this.printDate = data.getFullYear() + "-" + month + "-" + date;
150
+          })
151
+      },
152
+      smalltoBIG(n) {
153
+          // let fraction = ['角', '分'];
154
+          // let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
155
+          // let unit = [['元.', '万,', '亿,'], ["元",'拾', '佰', '仟']];
156
+          // let head = price < 0 ? '欠' : '';
157
+          // price = Math.abs(price);
158
+          // let upper = '';
159
+          // for (let i = 0; i < fraction.length; i++) {
160
+          // upper += (digit[Math.floor(price * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
161
+          // }
162
+          // upper = upper || '整';
163
+          // price = Math.floor(price);
164
+          // for (let i = 0; i < unit[0].length && price > 0; i++) {
165
+          // let p = '';
166
+          // for (let j = 0; j < unit[1].length && price > 0; j++) {
167
+          //     p = digit[price % 10] + unit[1][j] + p;
168
+          //     price = Math.floor(price / 10);
169
+          // }
170
+          // upper = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + upper;
171
+          // }
172
+          // this.zhongwen = head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整')
173
+          // console.log('6666',head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整'))
174
+          if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)){
175
+              return "数据非法";  //判断数据是否大于0
176
+          }
177
+
178
+          var unit = "仟佰拾亿仟佰拾万仟佰拾元角分", str = "";
179
+          n += "00";
180
+
181
+          var indexpoint = n.indexOf('.');  // 如果是小数,截取小数点前面的位数
182
+
183
+          if (indexpoint >= 0){
184
+
185
+              n = n.substring(0, indexpoint) + n.substr(indexpoint+1, 2);   // 若为小数,截取需要使用的unit单位
186
+          }
187
+
188
+          unit = unit.substr(unit.length - n.length);  // 若为整数,截取需要使用的unit单位
189
+          for (var i=0; i < n.length; i++){
190
+              str += "零壹贰叁肆伍陆柒捌玖".charAt(n.charAt(i)) + unit.charAt(i);  //遍历转化为大写的数字
191
+          }
192
+          console.log("str",str)
193
+          if(str == '零元零角零分'){
194
+              this.zhongwen = '零'
195
+          }else{
196
+              this.zhongwen =  str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
197
+          }
198
+
199
+          console.log(this.zhongwen)
200
+      },
201
+      getTime(value, temp) {
202
+          if (value == 0) {
203
+              return ''
204
+          }
205
+          if (value != undefined) {
206
+              return uParseTime(value, temp)
207
+          }
208
+          return ''
209
+      },
210
+
211
+  },
212
+  watch:{
213
+      paramsObj:{//深度监听,可监听到对象、数组的变化
214
+          handler(val, oldVal){
215
+              let params = {
216
+                  order_id: val.order_id,
217
+                  patient_id: val.patient_id,
218
+              }
219
+              this.getInvoice(params)
220
+
221
+          },
222
+          deep:true
223
+      }
224
+  }
225
+}
226
+</script>