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

printtwelve.vue 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. <template>
  2. <div id='invoice-print' style="position: relative;">
  3. <!-- <div style="position: absolute;top:90px;left:81px;">
  4. 阜阳经沃血液透析中心
  5. </div>
  6. <div style="display: flex;">
  7. <div style="position: absolute;top:120px;left:81px;">
  8. 小米
  9. </div>
  10. <div style="position: absolute;top:120px;left:200px;">
  11. 号码
  12. </div>
  13. </div>
  14. <div style="display: flex;">
  15. <div style="position: absolute;top:150px;left:81px;">
  16. 医保证号:
  17. </div>
  18. <div style="position: absolute;top:150px;left:190px;">
  19. 人员类别:
  20. </div>
  21. <div style="position: absolute;top:150px;left:252px;">
  22. 2023-09-28
  23. </div>
  24. </div>
  25. <div style="display: flex;">
  26. <div style="position: absolute;top:170px;left:106px;">目录内</div>
  27. <div style="position: absolute;top:170px;left:146px;">目录外</div>
  28. <div style="position: absolute;top:170px;left:232px;">目录内</div>
  29. <div style="position: absolute;top:170px;left:272px;">目录外</div>
  30. </div>
  31. <div style="display: flex;">
  32. <div style="position: absolute;top:190px;left:106px;">目录内</div>
  33. <div style="position: absolute;top:190px;left:146px;">目录外</div>
  34. <div style="position: absolute;top:190px;left:232px;">目录内</div>
  35. <div style="position: absolute;top:190px;left:272px;">目录外</div>
  36. </div>
  37. <div style="display: flex;">
  38. <div style="position: absolute;top:210px;left:106px;">目录内</div>
  39. <div style="position: absolute;top:210px;left:146px;">目录外</div>
  40. <div style="position: absolute;top:210px;left:232px;">目录内</div>
  41. <div style="position: absolute;top:210px;left:272px;">目录外</div>
  42. </div>
  43. <div style="display: flex;">
  44. <div style="position: absolute;top:230px;left:106px;">目录内</div>
  45. <div style="position: absolute;top:230px;left:146px;">目录外</div>
  46. <div style="position: absolute;top:230px;left:232px;">目录内</div>
  47. <div style="position: absolute;top:230px;left:272px;">目录外</div>
  48. </div>
  49. <div style="display: flex;">
  50. <div style="position: absolute;top:250px;left:106px;">目录内</div>
  51. <div style="position: absolute;top:250px;left:146px;">目录外</div>
  52. <div style="position: absolute;top:250px;left:232px;">目录内</div>
  53. <div style="position: absolute;top:250px;left:272px;">目录外</div>
  54. </div>
  55. <div style="display: flex;">
  56. <div style="position: absolute;top:270px;left:106px;">目录内</div>
  57. <div style="position: absolute;top:270px;left:146px;">目录外</div>
  58. <div style="position: absolute;top:270px;left:232px;">目录内</div>
  59. <div style="position: absolute;top:270px;left:272px;">目录外</div>
  60. </div> -->
  61. <!--金额 -->
  62. <!-- <div style="display: flex;">
  63. <div style="position: absolute;top:290px;left:146px;">280</div>
  64. <div style="position: absolute;top:290px;left:242px;">个人支付:9.92</div>
  65. </div>
  66. <div style="position: absolute;top:310px;left:146px;">贰佰捌拾整</div>
  67. <div style="position: absolute;top:330px;left:190px;">目录内金额</div>
  68. <div style="position: absolute;top:350px;left:252px;">个人医保</div>
  69. <div style="display: flex;">
  70. <div style="position: absolute;top:370px;left:106px;">收款人员</div>
  71. <div style="position: absolute;top:370px;left:252px;">流水号</div>
  72. </div> -->
  73. <!-- 附件 -->
  74. <div v-for="(item,index) in Arr" :key="index">
  75. <div :style="{position: 'absolute',top:(90 + (index * 370)) + 'px',left:'81px'}">
  76. 阜阳经沃血液透析中心
  77. </div>
  78. <div style="display: flex;">
  79. <div :style="{position: 'absolute',top:(120 + (index * 370)) + 'px',left:'81px'}">
  80. {{paramsObj.name}}
  81. </div>
  82. <div :style="{position: 'absolute',top:(120 + (index * 370)) + 'px',left:'200px'}">
  83. </div>
  84. </div>
  85. <div style="display: flex;">
  86. <div :style="{position: 'absolute',top:(150 + (index * 370)) + 'px',left:'81px'}">
  87. </div>
  88. <div :style="{position: 'absolute',top:(150 + (index * 370)) + 'px',left:'190px'}">
  89. </div>
  90. <div :style="{position: 'absolute',top:(150 + (index * 370)) + 'px',left:'252px'}">
  91. {{printDate}}
  92. </div>
  93. </div>
  94. <div style="display: flex;">
  95. <div :style="{position: 'absolute',top:(170+(index * 370))+'px',left:'106px'}">{{list.westernMedicineCostTotal?list.westernMedicineCostTotal:""}}</div>
  96. <div :style="{position: 'absolute',top:(170+(index * 370))+'px',left:'146px'}"></div>
  97. <div :style="{position: 'absolute',top:(170+(index * 370))+'px',left:'232px'}">{{ list.operationCostTotal?list.operationCostTotal:""}}</div>
  98. <div :style="{position: 'absolute',top:(170+(index * 370))+'px',left:'272px'}"></div>
  99. </div>
  100. <div style="display: flex;">
  101. <div :style="{position: 'absolute',top:(190+(index * 370))+'px',left:'106px'}">{{list.chineseTraditionalMedicineCostTotal?list.chineseTraditionalMedicineCostTotal:""}}</div>
  102. <div :style="{position: 'absolute',top:(190+(index * 370))+'px',left:'146px'}"></div>
  103. <div :style="{position: 'absolute',top:(190+(index * 370))+'px',left:'232px'}">{{list.laboratoryCostTotal?list.laboratoryCostTotal:""}}</div>
  104. <div :style="{position: 'absolute',top:(190+(index * 370))+'px',left:'272px'}"></div>
  105. </div>
  106. <div style="display: flex;">
  107. <div :style="{position: 'absolute',top:(210+(index * 370))+'px',left:'106px'}"></div>
  108. <div :style="{position: 'absolute',top:(210+(index * 370))+'px',left:'146px'}"></div>
  109. <div :style="{position: 'absolute',top:(210+(index * 370))+'px',left:'232px'}"></div>
  110. <div :style="{position: 'absolute',top:(210+(index * 370))+'px',left:'272px'}"></div>
  111. </div>
  112. <div style="display: flex;">
  113. <div :style="{position: 'absolute',top:(230+(index * 370))+'px',left:'106px'}"></div>
  114. <div :style="{position: 'absolute',top:(230+(index * 370))+'px',left:'146px'}"></div>
  115. <div :style="{position: 'absolute',top:(230+(index * 370))+'px',left:'232px'}"></div>
  116. <div :style="{position: 'absolute',top:(230+(index * 370))+'px',left:'272px'}"></div>
  117. </div>
  118. <div style="display: flex;">
  119. <div :style="{position: 'absolute',top:(250+(index * 370))+'px',left:'106px'}">{{list.checkCostTotal?list.checkCostTotal:""}}</div>
  120. <div :style="{position: 'absolute',top:(250+(index * 370))+'px',left:'146px'}"></div>
  121. <div :style="{position: 'absolute',top:(250+(index * 370))+'px',left:'232px'}"></div>
  122. <div :style="{position: 'absolute',top:(250+(index * 370))+'px',left:'272px'}"></div>
  123. </div>
  124. <div style="display: flex;">
  125. <div :style="{position: 'absolute',top:(270+(index * 370))+'px',left:'106px'}">{{list.treatCostTotal?list.treatCostTotal:""}}</div>
  126. <div :style="{position: 'absolute',top:(270+(index * 370))+'px',left:'146px'}"></div>
  127. <div :style="{position: 'absolute',top:(270+(index * 370))+'px',left:'232px'}">{{list.materialCostTotal?list.materialCostTotal:""}}</div>
  128. <div :style="{position: 'absolute',top:(270+(index * 370))+'px',left:'272px'}"></div>
  129. </div>
  130. <!--金额 -->
  131. <div style="display: flex;">
  132. <div :style="{position: 'absolute',top:(290+(index * 370))+'px',left:'146px',}">{{list.order.medfee_sumamt}}</div>
  133. <div :style="{position: 'absolute',top:(290+(index * 370))+'px',left:'242px'}">个人支付:{{list.order.psn_cash_pay}}</div>
  134. </div>
  135. <div :style="{position: 'absolute',top:(310+(index * 370))+'px',left:'146px'}">{{zhongwen}}</div>
  136. <div :style="{position: 'absolute',top:(330+(index * 370))+'px',left:'190px'}">{{'统筹支付:' + list.order.hifp_pay}}</div>
  137. <div :style="{position: 'absolute',top:(350+(index * 370))+'px',left:'252px'}">{{list.order.acct_pay}}</div>
  138. <div style="display: flex;">
  139. <div :style="{position: 'absolute',top:(370+(index * 370))+'px',left:'106px'}">{{list.admin_user_name}}</div>
  140. <div :style="{position: 'absolute',top:(370+(index * 370))+'px',left:'252px'}">{{list.order_number}}</div>
  141. </div>
  142. <div v-for="(ite,index2) in item" :key="index2" style="">
  143. <div :style="{position: 'absolute',top:(120 + (index * 370)) + 'px',left:(380 + (index2 * 110)) + 'px'}">{{list.order_number}}</div>
  144. <div :style="{position: 'absolute',top:(150 + (index * 370)) + 'px',left:(380 + (index2 * 110)) + 'px'}">{{ite.name}}</div>
  145. <div :style="{position: 'absolute',top:(170 + (index * 370)) + 'px',left:(380 + (index2 * 110)) + 'px'}">{{ite.item}}</div>
  146. <div :style="{position: 'absolute',top:(290 + (index * 370)) + 'px',left:(380 + (index2 * 110)) + 'px'}">{{ite.doctor_name}}</div>
  147. <div :style="{position: 'absolute',top:(310 + (index * 370)) + 'px',left:(380 + (index2 * 110)) + 'px'}">{{ite.total}}</div>
  148. <div :style="{position: 'absolute',top:(330 + (index * 370)) + 'px',left:(380 + (index2 * 110)) + 'px'}">{{ite.operator}}</div>
  149. <div :style="{position: 'absolute',top:(350 + (index * 370)) + 'px',left:(380 + (index2 * 110)) + 'px'}">{{ite.printDate}}</div>
  150. <!-- 附件 -->
  151. <!-- <div :style="{position: 'absolute',top:(120 + (index * 350)) + 'px',left:'490px'}">号码</div>
  152. <div :style="{position: 'absolute',top:(150 + (index * 350)) + 'px',left:'490px'}">{{ite}}</div>
  153. <div :style="{position: 'absolute',top:(170 + (index * 350)) + 'px',left:'490px'}">项目</div>
  154. <div :style="{position: 'absolute',top:(310 + (index * 350)) + 'px',left:'490px'}">金额</div>
  155. <div :style="{position: 'absolute',top:(330 + (index * 350)) + 'px',left:'490px'}">收款人</div>
  156. <div :style="{position: 'absolute',top:(350 + (index * 350)) + 'px',left:'490px'}">日期</div> -->
  157. <!-- 附件 -->
  158. <!-- <div :style="{position: 'absolute',top:(120 + (index * 350)) + 'px',left:'588px'}">号码</div>
  159. <div :style="{position: 'absolute',top:(150 + (index * 350)) + 'px',left:'588px'}">{{ite}}</div>
  160. <div :style="{position: 'absolute',top:(170 + (index * 350)) + 'px',left:'588px'}">项目</div>
  161. <div :style="{position: 'absolute',top:(310 + (index * 350)) + 'px',left:'588px'}">金额</div>
  162. <div :style="{position: 'absolute',top:(330 + (index * 350)) + 'px',left:'588px'}">收款人</div>
  163. <div :style="{position: 'absolute',top:(350 + (index * 350)) + 'px',left:'588px'}">日期</div> -->
  164. </div>
  165. </div>
  166. </div>
  167. </template>
  168. <script>
  169. import { getInvoice } from '@/api/project/project'
  170. export default {
  171. props:{
  172. paramsObj:Object
  173. },
  174. data(){
  175. return{
  176. list:{},
  177. printDate:'',
  178. zhongwen:'',
  179. totalPrice:0.0,
  180. org_id:'',
  181. org_name:'',
  182. pageArr:[],
  183. Arr:[],
  184. }
  185. },
  186. created(){
  187. console.log('paramsObj',this.paramsObj)
  188. let params = {
  189. order_id: this.paramsObj.order_id,
  190. patient_id: this.paramsObj.patient_id,
  191. number: this.paramsObj.number,
  192. }
  193. this.getInvoice(params)
  194. // var data = new Date();
  195. // var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
  196. // var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
  197. // this.printDate = data.getFullYear() + "-" + month + "-" + date;
  198. // this.smalltoBIG(982732.21)
  199. this.org_id = this.$store.getters.xt_user.org_id
  200. this.org_name = this.$store.getters.xt_user.org.org_name
  201. },
  202. methods:{
  203. group(array, subGroupLength) {
  204. let index = 0;
  205. let newArray = [];
  206. while(index < array.length) {
  207. newArray.push(array.slice(index, index += subGroupLength));
  208. }
  209. return newArray;
  210. }, getInvoice(params){
  211. getInvoice(params).then((res) => {
  212. console.log('res',res)
  213. this.list = res.data.data
  214. this.totalPrice = this.list.westernMedicineCostTotal + this.list.checkCostTotal + this.list.treatCostTotal + this.list.bedCostTotal + this.list.chineseTraditionalMedicineCostTotal +
  215. this.list.laboratoryCostTotal + this.list.operationCostTotal + this.list.otherCostTotal + this.list.materialCostTotal
  216. this.smalltoBIG(this.totalPrice)
  217. var data = new Date(res.data.data.date * 1000);
  218. var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
  219. var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
  220. this.printDate = data.getFullYear() + "-" + month + "-" + date;
  221. // this.getPage()
  222. this.pageArr = []
  223. if(this.list.westernMedicineCostTotal > 0){
  224. let obj = {
  225. name: this.paramsObj.name,
  226. total: this.list.westernMedicineCostTotal,
  227. item: "药品费",
  228. doctor_name:"医生 " + this.list.doctor_info.user_name,
  229. operator:this.list.admin_user_name,
  230. printDate:this.printDate,
  231. }
  232. this.pageArr.push(obj)
  233. }
  234. if(this.list.operationCostTotal > 0){
  235. let obj = {
  236. name: this.paramsObj.name,
  237. total: this.list.operationCostTotal,
  238. item: "手术费",
  239. doctor_name:"医生 " + this.list.doctor_info.user_name,
  240. operator:this.list.admin_user_name,
  241. printDate:this.printDate,
  242. }
  243. this.pageArr.push(obj)
  244. }
  245. if(this.list.chineseTraditionalMedicineCostTotal > 0){
  246. let obj = {
  247. name: this.paramsObj.name,
  248. total: this.list.chineseTraditionalMedicineCostTotal,
  249. item: "中成药费",
  250. doctor_name:"医生 " + this.list.doctor_info.user_name,
  251. operator:this.list.admin_user_name,
  252. printDate:this.printDate,
  253. }
  254. this.pageArr.push(obj)
  255. }
  256. if(this.list.laboratoryCostTotal > 0){
  257. let obj = {
  258. name:this.paramsObj.name,
  259. total: this.list.laboratoryCostTotal,
  260. item: "化验费",
  261. doctor_name:"医生 " + this.list.doctor_info.user_name,
  262. operator:this.list.admin_user_name,
  263. printDate:this.printDate,
  264. }
  265. this.pageArr.push(obj)
  266. }
  267. if(this.list.checkCostTotal > 0){
  268. let obj = {
  269. name: this.paramsObj.name,
  270. total: this.list.checkCostTotal,
  271. item: "检查费",
  272. doctor_name:"医生 " + this.list.doctor_info.user_name,
  273. operator:this.list.admin_user_name,
  274. printDate:this.printDate,
  275. }
  276. this.pageArr.push(obj)
  277. }
  278. if(this.list.treatCostTotal > 0){
  279. let obj = {
  280. name:this.paramsObj.name,
  281. total: this.list.treatCostTotal,
  282. item: "治疗费",
  283. doctor_name:"医生 " + this.list.doctor_info.user_name,
  284. operator:this.list.admin_user_name,
  285. printDate:this.printDate,
  286. }
  287. this.pageArr.push(obj)
  288. }
  289. if(this.list.materialCostTotal > 0){
  290. let obj = {
  291. name:this.paramsObj.name,
  292. total: this.list.materialCostTotal,
  293. item: "材料费",
  294. doctor_name:"医生 " + this.list.doctor_info.user_name,
  295. operator:this.list.admin_user_name,
  296. printDate:this.printDate,
  297. }
  298. this.pageArr.push(obj)
  299. }
  300. this.Arr = this.group(this.pageArr,Math.ceil(this.pageArr.length/4))
  301. console.log(this.Arr)
  302. })
  303. },
  304. smalltoBIG(n) {
  305. // let fraction = ['角', '分'];
  306. // let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
  307. // let unit = [['元.', '万,', '亿,'], ["元",'拾', '佰', '仟']];
  308. // let head = price < 0 ? '欠' : '';
  309. // price = Math.abs(price);
  310. // let upper = '';
  311. // for (let i = 0; i < fraction.length; i++) {
  312. // upper += (digit[Math.floor(price * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
  313. // }
  314. // upper = upper || '整';
  315. // price = Math.floor(price);
  316. // for (let i = 0; i < unit[0].length && price > 0; i++) {
  317. // let p = '';
  318. // for (let j = 0; j < unit[1].length && price > 0; j++) {
  319. // p = digit[price % 10] + unit[1][j] + p;
  320. // price = Math.floor(price / 10);
  321. // }
  322. // upper = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + upper;
  323. // }
  324. // this.zhongwen = head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整')
  325. // console.log('6666',head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整'))
  326. if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)){
  327. return "数据非法"; //判断数据是否大于0
  328. }
  329. var unit = "仟佰拾亿仟佰拾万仟佰拾元角分", str = "";
  330. n += "00";
  331. var indexpoint = n.indexOf('.'); // 如果是小数,截取小数点前面的位数
  332. if (indexpoint >= 0){
  333. n = n.substring(0, indexpoint) + n.substr(indexpoint+1, 2); // 若为小数,截取需要使用的unit单位
  334. }
  335. unit = unit.substr(unit.length - n.length); // 若为整数,截取需要使用的unit单位
  336. for (var i=0; i < n.length; i++){
  337. str += "零壹贰叁肆伍陆柒捌玖".charAt(n.charAt(i)) + unit.charAt(i); //遍历转化为大写的数字
  338. }
  339. this.zhongwen = str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
  340. console.log(this.zhongwen)
  341. },
  342. },
  343. watch:{
  344. paramsObj:{//深度监听,可监听到对象、数组的变化
  345. handler(val, oldVal){
  346. let params = {
  347. order_id: val.order_id,
  348. patient_id: val.patient_id,
  349. number: val.number,
  350. }
  351. this.getInvoice(params)
  352. },
  353. deep:true
  354. }
  355. }
  356. }
  357. </script>