123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- <template>
- <div id='invoice-print'>
- <div style="display:flex;">
- {{ list.order_number }}
- {{ list.id_card_no }}
- </div>
- <div style="display:flex;justify-content: space-between;">
- <div style="position: absolute;top:100px;left:250px;">{{ list.department_name }}</div>
- <div></div>
- <div>
- <span style="position: absolute;top:80px;left:80px;">{{ paramsObj.setl_time.split(' ')[0].slice(0,10) }}</span>
- </div>
- </div>
- <div style="display:flex;justify-content: space-between;">
- <div style="position: absolute;top:100px;left:80px;"> {{ paramsObj.name }}</div>
-
- </div>
-
-
- <div style="position: absolute;top:120px;left:80px">西药 {{ list.westernMedicineCostTotal }}</div>
-
- <div style="position: absolute;top:120px;left:220px">检查费 {{ list.checkCostTotal }}</div>
-
- <div style="position: absolute;top:140px;left:80px">治疗费 {{ list.treatCostTotal }}</div>
-
- <div style="position: absolute;top:140px;left:220px">化验费 {{ list.laboratoryCostTotal }}</div>
-
-
- <div style="position: absolute;top:160px;left:80px">中成药 {{ list.chineseTraditionalMedicineCostTotal }}</div>
-
- <div style="position: absolute;top:160px;left:220px">材料费 {{ list.materialCostTotal }}</div>
-
- <div style="position: absolute;top:200px;left:80px">医疗费总金额: {{list.order.medfee_sumamt?list.order.medfee_sumamt:""}}</div>
- <div style="position: absolute;top:200px;left:250px">个人现金支付:{{list.order.psn_cash_pay?list.order.psn_cash_pay:""}}</div>
- {{list.order.fulamt_ownpay_amt?list.order.fulamt_ownpay_amt:""}}
- <div style="position: absolute;top:220px;left:80px">基金支付总额: {{list.order.fund_pay_sumamt?list.order.fund_pay_sumamt:""}}</div>
- {{list.order.acct_pay?list.order.acct_pay:""}}
- {{ list.order.medfee_sumamt }}
- {{ list.psn_cash_money }}
- <div>
- {{ org_name }}
- <div style="position: absolute;top:340px;left:120px">{{ paramsObj.chargeName }}</div>
- </div>
- </div>
- </template>
-
-
- <script>
- import { getInvoice } from '@/api/project/project'
- import { uParseTime } from '@/utils/tools'
- export default {
- props:{
- paramsObj:Object
- },
- data(){
- return{
- list:{},
- printDate:'',
- zhongwen:'',
- totalPrice:0.0,
- org_id:'',
- org_name:''
- }
- },
- created(){
- console.log('paramsObj',this.paramsObj)
- let params = {
- order_id: this.paramsObj.order_id,
- patient_id: this.paramsObj.patient_id,
- }
- this.getInvoice(params)
-
-
-
-
-
- this.org_id = this.$store.getters.xt_user.org_id
- this.org_name = this.$store.getters.xt_user.org.org_name
- },
- methods:{
- getInvoice(params){
- getInvoice(params).then((res) => {
- console.log('res',res)
- this.list = res.data.data
- this.totalPrice = this.list.westernMedicineCostTotal + this.list.checkCostTotal + this.list.treatCostTotal + this.list.bedCostTotal + this.list.chineseTraditionalMedicineCostTotal +
- this.list.laboratoryCostTotal + this.list.operationCostTotal + this.list.otherCostTotal + this.list.materialCostTotal
- this.smalltoBIG(this.list.psn_cash_money)
- var data = new Date(res.data.data.date * 1000);
- var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
- var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
- this.printDate = data.getFullYear() + "-" + month + "-" + date;
- })
- },
- smalltoBIG(n) {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)){
- return "数据非法";
- }
-
- var unit = "仟佰拾亿仟佰拾万仟佰拾元角分", str = "";
- n += "00";
-
- var indexpoint = n.indexOf('.');
-
- if (indexpoint >= 0){
-
- n = n.substring(0, indexpoint) + n.substr(indexpoint+1, 2);
- }
-
- unit = unit.substr(unit.length - n.length);
- for (var i=0; i < n.length; i++){
- str += "零壹贰叁肆伍陆柒捌玖".charAt(n.charAt(i)) + unit.charAt(i);
- }
- console.log("str",str)
- if(str == '零元零角零分'){
- this.zhongwen = '零'
- }else{
- this.zhongwen = str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
- }
-
- console.log(this.zhongwen)
- },
- getTime(value, temp) {
- if (value == 0) {
- return ''
- }
- if (value != undefined) {
- return uParseTime(value, temp)
- }
- return ''
- },
-
- },
- watch:{
- paramsObj:{
- handler(val, oldVal){
- let params = {
- order_id: val.order_id,
- patient_id: val.patient_id,
- }
- this.getInvoice(params)
-
- },
- deep:true
- }
- }
- }
- </script>
|