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

printthirteen.vue 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <template>
  2. <div id='invoice-print'>
  3. <div v-for='(i,index) in pageArr.length' :key="index" style="width: 90%;margin: 0 auto;font-size: 17px;">
  4. <div style="text-align: center;width: 100%;font-size: 20px; font-weight: bolder;">盐城响水燕舞血液透析中心收据</div>
  5. <div style="display: flex; margin: 15px 0 5px 0;">
  6. <div style="flex: 1.1;">业务流水号:{{ list.order_number }}</div>
  7. <div style="flex: 0.9;">医疗机构类型:</div>
  8. <div style="flex: 1;">医院国家编码:H32092103007</div>
  9. </div>
  10. <div style="display: flex;">
  11. <!-- <div style="flex:1;">医生:{{ doctor_info.user_name }}</div>
  12. <div style="flex: 1;">医生编码:{{ doctor_info.doctor_number }}</div> -->
  13. <div style="flex: 1;">No.{{list.order.fa_piao_number}}</div>
  14. </div>
  15. <div style="display: flex;border: 1px solid black;padding: 5px 0;">
  16. <div style="flex: 1;">姓名:{{ paramsObj.name }}</div>
  17. <div style="flex: 1;">性别:
  18. <span v-if="list.gender == 1">男</span>
  19. <span v-if="list.gender == 2">女</span>
  20. </div>
  21. <div style="flex: 1;">医保类型:</div>
  22. <div style="flex: 1;">社会保障号码:</div>
  23. </div>
  24. <div style="display: flex;border: 1px solid black;text-align: center;border-top:none;">
  25. <div style="flex: 1;display: flex;">
  26. <div style="flex: 1;border-right: 1px solid black;padding: 5px 0;">项目</div>
  27. <div style="flex: 1; padding: 5px 0;">金额</div>
  28. </div>
  29. <div style="flex: 2;display: flex;border-left: 1px solid black;">
  30. <div style="flex: 1; padding: 5px 0;">项目/规格</div>
  31. <div style="flex: 1;border-left: 1px solid black; padding: 5px 0;">数量</div>
  32. <div style="flex: 1;border-left: 1px solid black; padding: 5px 0;">金额</div>
  33. </div>
  34. <div style="flex: 2;display: flex;border-left: 1px solid black;">
  35. <div style="flex: 1; padding: 5px 0;">项目/规格</div>
  36. <div style="flex: 1;border-left: 1px solid black; padding: 5px 0;">数量</div>
  37. <div style="flex: 1;border-left: 1px solid black; padding: 5px 0;">金额</div>
  38. </div>
  39. </div>
  40. <div style="display: flex;border: 1px solid black;border-top:none;min-height: 200px;">
  41. <div style="flex: 1;" >
  42. <div v-if="list.westernMedicineCostTotal">西药 &nbsp;&nbsp;{{ list.westernMedicineCostTotal }}</div>
  43. <div v-if="list.treatCostTotal">治疗费 &nbsp;&nbsp;{{ list.treatCostTotal }}</div>
  44. <div v-if="list.bedCostTotal">床位费 &nbsp;&nbsp;{{ list.bedCostTotal }}</div>
  45. <div v-if="list.chineseTraditionalMedicineCostTotal">中成药 &nbsp;&nbsp;{{ list.chineseTraditionalMedicineCostTotal }}</div>
  46. <div v-if="list.laboratoryCostTotal">化验费 &nbsp;&nbsp;{{ list.laboratoryCostTotal }}</div>
  47. <div v-if="list.operationCostTotal">手术费 &nbsp;&nbsp;{{ list.operationCostTotal }}</div>
  48. <div v-if="list.otherCostTotal">其他费 &nbsp;&nbsp;{{ list.otherCostTotal }}</div>
  49. <div v-if="list.materialCostTotal">材料费 &nbsp;&nbsp;{{ list.materialCostTotal }}</div>
  50. </div>
  51. <div style="flex: 2;border-left: 1px solid black;">
  52. <div v-for="item in list.order_info.slice(index * 10,(index * 10) + pageArr[index])" style="">
  53. <span style="display:inline-block;width:56%;">
  54. <span v-if="item.advice.id == 0">
  55. <span v-if="item.project.type == 2">{{ item.project.project.project_name }}</span>
  56. <span v-if="item.project.type == 3">{{ item.project.good_info.good_name }}</span>
  57. </span>
  58. <span v-else>{{ item.advice.advice_name }}</span>
  59. </span>
  60. <span style="display:inline-block;width:50px;">
  61. <span v-if="item.advice.id == 0">
  62. <span v-if="item.project.type == 2">{{ item.project.count }}{{ item.project.unit }}</span>
  63. <span v-if="item.project.type == 3">{{ item.project.count }}{{ item.project.unit }}</span>
  64. </span>
  65. <span v-else>{{ item.advice.prescribing_number }}{{ item.advice.prescribing_number_unit }}</span>
  66. </span>
  67. <span>
  68. <span v-if="item.advice.id == 0">
  69. <span v-if="item.project.type == 2">{{ (item.project.count * item.pric).toFixed(2) }}</span>
  70. <span v-if="item.project.type == 3">{{ (item.project.count * item.pric).toFixed(2) }}</span>
  71. </span>
  72. <span v-else>{{ (item.advice.prescribing_number * item.pric).toFixed(2) }}</span>
  73. </span>
  74. </div>
  75. </div>
  76. <div style="flex: 2;border-left: 1px solid black;">
  77. </div>
  78. </div>
  79. <div style="display: flex;border:1px solid black;border-top: none;">
  80. <div style="flex: 2; padding: 5px 0;">
  81. <span style="font-weight: bolder;">合计(大写):</span>
  82. <span>{{ zhongwen }}</span>
  83. </div>
  84. <div style="flex: 1;border-left: 1px solid black; padding: 5px 0;">¥:{{ list.medfee_sumamt }}</div>
  85. </div>
  86. <div style="border:1px solid black;border-top: none;min-height: 80px;">
  87. <div style="padding: 5px 0; position: relative;">
  88. <div v-if="index == pageArr.length - 1">
  89. <div style="display:flex;">
  90. <div style="flex: 1;">医疗总费用:{{ list.order.medfee_sumamt }}</div>
  91. <div style="flex: 1;">基金支付总额:{{ list.order.fund_pay_sumamt }}</div>
  92. <div style="flex: 1;">统筹支出:{{ list.order.hifp_pay }}</div>
  93. <div style="flex: 1;">大病支出:{{list.order.hifmi_pay}}</div>
  94. </div>
  95. <div style="display:flex;">
  96. <div style="flex: 1;">个人账户支付:{{ list.order.acct_pay }}</div>
  97. <div style="flex: 1;">现金支出:{{ list.order.psn_cash_pay }}</div>
  98. <div style="flex: 1;">本次账户:0</div>
  99. <div style="flex: 1;">上次账户:0</div>
  100. </div>
  101. <div style="display:flex;">
  102. <div style="flex: 1;">账户余额:{{ list.order.balc }}</div>
  103. <div style="flex: 1;">其他支出:{{ list.order.oth_pay }}</div>
  104. <div style="flex: 1;">大病补充保险支出:0</div>
  105. <div style="flex: 1;">民政支出:0</div>
  106. </div>
  107. <div style="display:flex;">
  108. <div style="flex: 1;">医疗救助基金支出:{{ list.order.maf_pay }}</div>
  109. <div style="flex: 1;">企业补充医疗保险基金支出:{{ list.order.hifes_pay }}</div>
  110. </div>
  111. </div>
  112. <!-- <span style="position: absolute;left: 80%;top: 70%;">(手写无效)</span> -->
  113. </div>
  114. </div>
  115. <div style="display: flex;">
  116. <div style="flex:1;">医生:{{ doctor_info.user_name }}</div>
  117. <div style="flex: 1;">医生编码:{{ doctor_info.doctor_number }}</div>
  118. <!-- <div style="flex: 1;">No.{{list.order.fa_piao_number}}</div> -->
  119. </div>
  120. <div style="display: flex;">
  121. <div style="flex: 1.5;">收款单位(章):{{ org_name }}</div>
  122. <div style="flex: 0.7;">收费员:{{ paramsObj.chargeName }}</div>
  123. <div style="flex: 1;">
  124. <span>{{ paramsObj.setl_time ? paramsObj.setl_time.split(' ')[0].slice(0,4) : getTime(list.date, '{y}-{m}-{d}').slice(0,4) }}</span>
  125. <span>{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(5,7)) : getTime(list.date, '{y}-{m}-{d}').slice(5,7) }}</span>
  126. <span>{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(8,11)) : getTime(list.date, '{y}-{m}-{d}').slice(8,11) }}</span>
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. </template>
  132. <script>
  133. import { getInvoice } from '@/api/project/project'
  134. import { uParseTime } from '@/utils/tools'
  135. export default {
  136. props:{
  137. paramsObj:Object
  138. },
  139. data(){
  140. return{
  141. list:{},
  142. printDate:'',
  143. zhongwen:'',
  144. totalPrice:0.0,
  145. org_id:'',
  146. org_name:'',
  147. page:1,
  148. pageArr:[],
  149. doctor_info:{},
  150. }
  151. },
  152. created(){
  153. console.log('paramsObj',this.paramsObj)
  154. let params = {
  155. order_id: this.paramsObj.order_id,
  156. patient_id: this.paramsObj.patient_id,
  157. }
  158. this.getInvoice(params)
  159. // var data = new Date();
  160. // var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
  161. // var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
  162. // this.printDate = data.getFullYear() + "-" + month + "-" + date;
  163. // this.smalltoBIG(982732.21)
  164. this.org_id = this.$store.getters.xt_user.org_id
  165. this.org_name = this.$store.getters.xt_user.org.org_name
  166. },
  167. methods:{
  168. getInvoice(params){
  169. getInvoice(params).then((res) => {
  170. console.log('res',res)
  171. this.list = res.data.data
  172. this.totalPrice = this.list.westernMedicineCostTotal + this.list.checkCostTotal + this.list.treatCostTotal + this.list.bedCostTotal + this.list.chineseTraditionalMedicineCostTotal +
  173. this.list.laboratoryCostTotal + this.list.operationCostTotal + this.list.otherCostTotal + this.list.materialCostTotal
  174. this.smalltoBIG(this.list.medfee_sumamt)
  175. var data = new Date(res.data.data.date * 1000);
  176. var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
  177. var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
  178. this.printDate = data.getFullYear() + "-" + month + "-" + date;
  179. this.pageArr = []
  180. this.getPage()
  181. this.doctor_info = res.data.data.doctor_info
  182. console.log('pageArr',this.pageArr)
  183. })
  184. },
  185. smalltoBIG(n) {
  186. // let fraction = ['角', '分'];
  187. // let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
  188. // let unit = [['元.', '万,', '亿,'], ["元",'拾', '佰', '仟']];
  189. // let head = price < 0 ? '欠' : '';
  190. // price = Math.abs(price);
  191. // let upper = '';
  192. // for (let i = 0; i < fraction.length; i++) {
  193. // upper += (digit[Math.floor(price * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
  194. // }
  195. // upper = upper || '整';
  196. // price = Math.floor(price);
  197. // for (let i = 0; i < unit[0].length && price > 0; i++) {
  198. // let p = '';
  199. // for (let j = 0; j < unit[1].length && price > 0; j++) {
  200. // p = digit[price % 10] + unit[1][j] + p;
  201. // price = Math.floor(price / 10);
  202. // }
  203. // upper = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + upper;
  204. // }
  205. // this.zhongwen = head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整')
  206. // console.log('6666',head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整'))
  207. if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)){
  208. return "数据非法"; //判断数据是否大于0
  209. }
  210. var unit = "仟佰拾亿仟佰拾万仟佰拾元角分", str = "";
  211. n += "00";
  212. var indexpoint = n.indexOf('.'); // 如果是小数,截取小数点前面的位数
  213. if (indexpoint >= 0){
  214. n = n.substring(0, indexpoint) + n.substr(indexpoint+1, 2); // 若为小数,截取需要使用的unit单位
  215. }
  216. unit = unit.substr(unit.length - n.length); // 若为整数,截取需要使用的unit单位
  217. for (var i=0; i < n.length; i++){
  218. str += "零壹贰叁肆伍陆柒捌玖".charAt(n.charAt(i)) + unit.charAt(i); //遍历转化为大写的数字
  219. }
  220. console.log("str",str)
  221. if(str == '零元零角零分'){
  222. this.zhongwen = '零'
  223. }else{
  224. this.zhongwen = str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
  225. }
  226. console.log(this.zhongwen)
  227. },
  228. getTime(value, temp) {
  229. if (value == 0) {
  230. return ''
  231. }
  232. if (value != undefined) {
  233. return uParseTime(value, temp)
  234. }
  235. return ''
  236. },
  237. getPage(){
  238. if(this.list.order_info.length <= 10){
  239. this.page = 1
  240. this.pageArr.push(this.list.order_info.length)
  241. }else if(this.list.order_info.length > 10){
  242. this.page = parseInt(this.list.order_info.length / 10)
  243. let num = this.list.order_info.length % 10
  244. for (var i=0;i<this.page;i++){
  245. this.pageArr.push(10)
  246. }
  247. if(num != 0){
  248. this.pageArr.push(num)
  249. }
  250. }
  251. }
  252. },
  253. watch:{
  254. paramsObj:{//深度监听,可监听到对象、数组的变化
  255. handler(val, oldVal){
  256. let params = {
  257. order_id: val.order_id,
  258. patient_id: val.patient_id,
  259. }
  260. this.getInvoice(params)
  261. },
  262. deep:true
  263. }
  264. }
  265. }
  266. </script>