Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

printfifteen.vue 8.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <div id='invoice-print'>
  3. <div style="display:flex;">
  4. <!-- <div style="position: absolute;top:30px;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:250px;">{{ list.department_name }}</div>
  9. <div></div>
  10. <div>
  11. <span style="position: absolute;top:80px;left:80px;">{{ paramsObj.setl_time.split(' ')[0].slice(0,10) }}</span>
  12. </div>
  13. </div>
  14. <div style="display:flex;justify-content: space-between;">
  15. <div style="position: absolute;top:100px;left:80px;"> {{ paramsObj.name }}</div>
  16. </div>
  17. <!-- <div style="display:flex;justify-content: space-between;"> -->
  18. <div style="position: absolute;top:120px;left:80px">西药 {{ list.westernMedicineCostTotal }}</div>
  19. <!-- <div style="position: absolute;top:140px;left:80px"></div> -->
  20. <div style="position: absolute;top:120px;left:220px">检查费 {{ list.checkCostTotal }}</div>
  21. <!-- <div style="position: absolute;top:180px;left:80px"></div> -->
  22. <div style="position: absolute;top:140px;left:80px">治疗费 {{ list.treatCostTotal }}</div>
  23. <!-- <div style="position: absolute;top:140px;left:80px"></div> -->
  24. <div style="position: absolute;top:140px;left:220px">化验费 {{ list.laboratoryCostTotal }}</div>
  25. <!-- <div style="position: absolute;top:140px;left:80px"></div> -->
  26. <!-- </div> -->
  27. <div style="position: absolute;top:160px;left:80px">中成药 {{ list.chineseTraditionalMedicineCostTotal }}</div>
  28. <!-- <div style="position: absolute;top:170px;left:80px"></div> -->
  29. <div style="position: absolute;top:160px;left:220px">材料费 {{ list.materialCostTotal }}</div>
  30. <div style="position: absolute;top:200px;left:80px">医疗费总金额: {{list.order.medfee_sumamt?list.order.medfee_sumamt:""}}</div>
  31. <div style="position: absolute;top:200px;left:250px">个人现金支付:{{list.order.psn_cash_pay?list.order.psn_cash_pay:""}}</div>
  32. <!-- <div style="position: absolute;top:220px;left:80px">全自费金额: {{list.order.fulamt_ownpay_amt?list.order.fulamt_ownpay_amt:""}}</div> -->
  33. <div style="position: absolute;top:220px;left:80px">基金支付总额: {{list.order.fund_pay_sumamt?list.order.fund_pay_sumamt:""}}</div>
  34. <!-- <div style="position: absolute;top:240px;left:80px">个人账户支付: {{list.order.acct_pay?list.order.acct_pay:""}}</div> -->
  35. <!-- <div style="position: absolute;top:300px;left:80px">医疗费总金额 {{ list.order.medfee_sumamt }}</div>
  36. <div style="position: absolute;top:300px;left:300px">个人自费 {{ list.psn_cash_money }}</div> -->
  37. <div>
  38. <!-- <div style="position: absolute;top:320px;left:120px">{{ org_name }}</div> -->
  39. <div style="position: absolute;top:340px;left:120px">{{ paramsObj.chargeName }}</div>
  40. </div>
  41. </div>
  42. </template>
  43. <script>
  44. import { getInvoice } from '@/api/project/project'
  45. import { uParseTime } from '@/utils/tools'
  46. export default {
  47. props:{
  48. paramsObj:Object
  49. },
  50. data(){
  51. return{
  52. list:{},
  53. printDate:'',
  54. zhongwen:'',
  55. totalPrice:0.0,
  56. org_id:'',
  57. org_name:''
  58. }
  59. },
  60. created(){
  61. console.log('paramsObj',this.paramsObj)
  62. let params = {
  63. order_id: this.paramsObj.order_id,
  64. patient_id: this.paramsObj.patient_id,
  65. }
  66. this.getInvoice(params)
  67. // var data = new Date();
  68. // var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
  69. // var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
  70. // this.printDate = data.getFullYear() + "-" + month + "-" + date;
  71. // this.smalltoBIG(982732.21)
  72. this.org_id = this.$store.getters.xt_user.org_id
  73. this.org_name = this.$store.getters.xt_user.org.org_name
  74. },
  75. methods:{
  76. getInvoice(params){
  77. getInvoice(params).then((res) => {
  78. console.log('res',res)
  79. this.list = res.data.data
  80. this.totalPrice = this.list.westernMedicineCostTotal + this.list.checkCostTotal + this.list.treatCostTotal + this.list.bedCostTotal + this.list.chineseTraditionalMedicineCostTotal +
  81. this.list.laboratoryCostTotal + this.list.operationCostTotal + this.list.otherCostTotal + this.list.materialCostTotal
  82. this.smalltoBIG(this.list.psn_cash_money)
  83. var data = new Date(res.data.data.date * 1000);
  84. var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
  85. var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
  86. this.printDate = data.getFullYear() + "-" + month + "-" + date;
  87. })
  88. },
  89. smalltoBIG(n) {
  90. // let fraction = ['角', '分'];
  91. // let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
  92. // let unit = [['元.', '万,', '亿,'], ["元",'拾', '佰', '仟']];
  93. // let head = price < 0 ? '欠' : '';
  94. // price = Math.abs(price);
  95. // let upper = '';
  96. // for (let i = 0; i < fraction.length; i++) {
  97. // upper += (digit[Math.floor(price * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
  98. // }
  99. // upper = upper || '整';
  100. // price = Math.floor(price);
  101. // for (let i = 0; i < unit[0].length && price > 0; i++) {
  102. // let p = '';
  103. // for (let j = 0; j < unit[1].length && price > 0; j++) {
  104. // p = digit[price % 10] + unit[1][j] + p;
  105. // price = Math.floor(price / 10);
  106. // }
  107. // upper = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + upper;
  108. // }
  109. // this.zhongwen = head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整')
  110. // console.log('6666',head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整'))
  111. if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)){
  112. return "数据非法"; //判断数据是否大于0
  113. }
  114. var unit = "仟佰拾亿仟佰拾万仟佰拾元角分", str = "";
  115. n += "00";
  116. var indexpoint = n.indexOf('.'); // 如果是小数,截取小数点前面的位数
  117. if (indexpoint >= 0){
  118. n = n.substring(0, indexpoint) + n.substr(indexpoint+1, 2); // 若为小数,截取需要使用的unit单位
  119. }
  120. unit = unit.substr(unit.length - n.length); // 若为整数,截取需要使用的unit单位
  121. for (var i=0; i < n.length; i++){
  122. str += "零壹贰叁肆伍陆柒捌玖".charAt(n.charAt(i)) + unit.charAt(i); //遍历转化为大写的数字
  123. }
  124. console.log("str",str)
  125. if(str == '零元零角零分'){
  126. this.zhongwen = '零'
  127. }else{
  128. this.zhongwen = str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
  129. }
  130. console.log(this.zhongwen)
  131. },
  132. getTime(value, temp) {
  133. if (value == 0) {
  134. return ''
  135. }
  136. if (value != undefined) {
  137. return uParseTime(value, temp)
  138. }
  139. return ''
  140. },
  141. },
  142. watch:{
  143. paramsObj:{//深度监听,可监听到对象、数组的变化
  144. handler(val, oldVal){
  145. let params = {
  146. order_id: val.order_id,
  147. patient_id: val.patient_id,
  148. }
  149. this.getInvoice(params)
  150. },
  151. deep:true
  152. }
  153. }
  154. }
  155. </script>