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

printTwo.vue 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. <template>
  2. <div id="invoice-print" style="font-size: 12px">
  3. <div v-if="list.order_number">
  4. <div style="display: flex">
  5. <div style="position: absolute; top: 50px; left: 60px">
  6. {{ list.order_number }}
  7. </div>
  8. <!-- <div>{{ list.id_card_no }}</div> -->
  9. </div>
  10. <div style="display: flex; justify-content: space-between">
  11. <!-- <div>{{ list.department_name }}</div> -->
  12. <div style="position: absolute; top: 50px; left: 260px">
  13. {{ id_card_no ? id_card_no : list.order.certno }}
  14. </div>
  15. <div></div>
  16. </div>
  17. <div style="display: flex; justify-content: space-between">
  18. <!-- <div>{{ list.department_name }}</div> -->
  19. <div style="position: absolute; top: 70px; left: 90px">门诊</div>
  20. <div></div>
  21. <div style="position: absolute; top: 70px; left: 240px">
  22. {{ number ? number : list.order.mdtrt_id }}
  23. </div>
  24. <div style="position: absolute; left: 470px; top: 70px">
  25. <span>{{
  26. paramsObj.setl_time
  27. ? paramsObj.setl_time.split(" ")[0].slice(0, 4)
  28. : getTime(list.date, "{y}-{m}-{d}").slice(0, 4)
  29. }}</span>
  30. </div>
  31. <div style="position: absolute; left: 530px; top: 70px">
  32. <span>{{
  33. paramsObj.setl_time
  34. ? parseInt(paramsObj.setl_time.split(" ")[0].slice(5, 7))
  35. : getTime(list.date, "{y}-{m}-{d}").slice(5, 7)
  36. }}</span>
  37. </div>
  38. <div style="position: absolute; left: 560px; top: 70px">
  39. <span>{{
  40. paramsObj.setl_time
  41. ? parseInt(paramsObj.setl_time.split(" ")[0].slice(8, 11))
  42. : getTime(list.date, "{y}-{m}-{d}").slice(8, 11)
  43. }}</span>
  44. </div>
  45. </div>
  46. <div style="display: flex; justify-content: space-between">
  47. <div style="position: absolute; top: 85px; left: 100px">
  48. {{ paramsObj.name }}
  49. </div>
  50. <div style="position: absolute; top: 85px; left: 180px">√</div>
  51. <!-- <div>{{ list.pay_way }}</div> -->
  52. <div style="position: absolute; top: 85px; left: 380px">
  53. {{ in_hosptial_time }}
  54. </div>
  55. <div style="position: absolute; top: 85px; left: 530px">
  56. {{ out_hosptial_time }}
  57. </div>
  58. </div>
  59. <div style="display: flex; justify-content: space-between">
  60. <!-- <div>{{ paramsObj.gend == 1 ? '男' : '女' }}</div> -->
  61. <div v-if="gend == 1" style="position: absolute; top: 110px; left: 100px">√</div>
  62. <div v-if="gend == 2" style="position: absolute; top: 110px; left: 140px">√</div>
  63. <div style="position: absolute; top: 110px; left: 260px">
  64. {{ balance_accounts_type != 2 ? list.order.fund_pay_sumamt : "0.00" }}
  65. </div>
  66. <div style="position: absolute; top: 110px; left: 420px">
  67. {{
  68. balance_accounts_type != 2
  69. ? list.order.psn_cash_pay
  70. : list.order.medfee_sumamt
  71. }}
  72. </div>
  73. <div style="position: absolute; top: 110px; left: 540px">现金</div>
  74. </div>
  75. <div style="display: flex; justify-content: space-between">
  76. <div style="position: absolute; top: 145px; left: 50px">西药</div>
  77. <div style="position: absolute; top: 145px; left: 130px">
  78. {{
  79. list.westernMedicineCostTotal
  80. ? list.westernMedicineCostTotal.toFixed(2)
  81. : ""
  82. }}
  83. </div>
  84. <div style="position: absolute; top: 145px; left: 180px">检查费</div>
  85. <div style="position: absolute; top: 145px; left: 260px">
  86. {{ list.checkCostTotal ? list.checkCostTotal.toFixed(2) : "" }}
  87. </div>
  88. <div style="position: absolute; top: 145px; left: 340px">治疗费</div>
  89. <div style="position: absolute; top: 145px; left: 420px">
  90. {{ list.treatCostTotal ? list.treatCostTotal.toFixed(2) : "" }}
  91. </div>
  92. <div style="position: absolute; top: 145px; left: 480px">床位费</div>
  93. <div style="position: absolute; top: 145px; left: 540px">
  94. {{ list.bedCostTotal ? list.bedCostTotal.toFixed(2) : "" }}
  95. </div>
  96. </div>
  97. <div style="display: flex; justify-content: space-between">
  98. <div style="position: absolute; top: 170px; left: 50px">中成药</div>
  99. <div style="position: absolute; top: 170px; left: 130px">
  100. {{
  101. list.chineseTraditionalMedicineCostTotal
  102. ? list.chineseTraditionalMedicineCostTotal.toFixed(2)
  103. : ""
  104. }}
  105. </div>
  106. <div style="position: absolute; top: 170px; left: 180px">化验费</div>
  107. <div style="position: absolute; top: 170px; left: 260px">
  108. {{
  109. list.laboratoryCostTotal ? list.laboratoryCostTotal.toFixed(2) : ""
  110. }}
  111. </div>
  112. <div style="position: absolute; top: 170px; left: 340px">手术费</div>
  113. <div style="position: absolute; top: 170px; left: 420px">
  114. {{
  115. list.operationCostTotal ? list.operationCostTotal.toFixed(2) : ""
  116. }}
  117. </div>
  118. <div style="position: absolute; top: 170px; left: 480px">其他费</div>
  119. <div style="position: absolute; top: 170px; left: 540px">
  120. {{ list.otherCostTotal ? list.otherCostTotal.toFixed(2) : "" }}
  121. </div>
  122. </div>
  123. <div style="display: flex; justify-content: space-between">
  124. <div style="position: absolute; top: 190px; left: 50px"></div>
  125. <div style="position: absolute; top: 190px; left: 130px"></div>
  126. <div style="position: absolute; top: 190px; left: 180px"></div>
  127. <div style="position: absolute; top: 190px; left: 260px"></div>
  128. <div style="position: absolute; top: 190px; left: 340px">材料费</div>
  129. <div style="position: absolute; top: 190px; left: 420px">
  130. {{ list.materialCostTotal ? list.materialCostTotal.toFixed(2) : "" }}
  131. </div>
  132. <div style="position: absolute; top: 190px; left: 480px">诊察费</div>
  133. <div style="position: absolute; top: 190px; left: 540px">
  134. {{ list.zhenChaCostTotal ? list.zhenChaCostTotal.toFixed(2) : "" }}
  135. </div>
  136. </div>
  137. <div style="display: flex; justify-content: space-between">
  138. <div style="position: absolute; top: 210px; left: 50px"></div>
  139. <div style="position: absolute; top: 210px; left: 130px"></div>
  140. <div style="position: absolute; top: 210px; left: 180px"></div>
  141. <div
  142. style="position: absolute; top: 210px; left: 260px"
  143. v-if="balance_accounts_type != 2"
  144. >
  145. {{ list.psn_cash_money ? list.psn_cash_money.toFixed(2) : "" }}
  146. </div>
  147. <div style="position: absolute; top: 210px; left: 260px" v-else>
  148. {{ list.order.medfee_sumamt ? list.order.medfee_sumamt : "" }}
  149. </div>
  150. <div style="position: absolute; top: 210px; left: 340px"></div>
  151. <div style="position: absolute; top: 210px; left: 420px"></div>
  152. <div style="position: absolute; top: 210px; left: 480px"></div>
  153. <div style="position: absolute; top: 210px; left: 540px"></div>
  154. </div>
  155. <div>
  156. <span>
  157. <span style="position: absolute; top: 235px; left: 190px">
  158. <span
  159. v-if="
  160. zhongwen.indexOf('万') > -1 &&
  161. zhongwen.indexOf('拾') > -1 &&
  162. zhongwen.indexOf('拾') == 1
  163. "
  164. >
  165. {{ zhongwen.substring(0, 1) }}
  166. </span>
  167. <span v-else>零</span>
  168. </span>
  169. <span style="position: absolute; top: 235px; left: 220px">
  170. <span v-if="zhongwen.indexOf('万') > -1">
  171. {{
  172. zhongwen.substring(
  173. zhongwen.indexOf("万") - 1,
  174. zhongwen.indexOf("万")
  175. )
  176. }}
  177. </span>
  178. <span v-else>零</span>
  179. </span>
  180. <span style="position: absolute; top: 235px; left: 250px">
  181. <span v-if="zhongwen.indexOf('仟') > -1">
  182. {{zhongwen.substring(zhongwen.indexOf("仟") - 1,zhongwen.indexOf("仟"))}}
  183. </span>
  184. <span v-else>零</span>
  185. </span>
  186. <span style="position: absolute; top: 235px; left: 290px">
  187. <span v-if="zhongwen.indexOf('佰') > -1">
  188. {{
  189. zhongwen.substring(
  190. zhongwen.indexOf("佰") - 1,
  191. zhongwen.indexOf("佰")
  192. )
  193. }}
  194. </span>
  195. <span v-else>零</span>
  196. </span>
  197. <span style="position: absolute; top: 235px; left: 320px">
  198. <span v-if="zhongwen.indexOf('拾') > -1">
  199. {{
  200. zhongwen.substring(
  201. zhongwen.indexOf("拾") - 1,
  202. zhongwen.indexOf("拾")
  203. ) == "佰" ||
  204. !zhongwen.substring(
  205. zhongwen.indexOf("拾") - 1,
  206. zhongwen.indexOf("拾")
  207. ) ||
  208. zhongwen.substring(
  209. zhongwen.indexOf("拾") - 1,
  210. zhongwen.indexOf("拾")
  211. ) == "零"
  212. ? "壹"
  213. : zhongwen.substring(
  214. zhongwen.indexOf("拾") - 1,
  215. zhongwen.indexOf("拾")
  216. )
  217. }}
  218. </span>
  219. <span v-else>零</span>
  220. </span>
  221. <span style="position: absolute; top: 235px; left: 350px">
  222. <span
  223. v-if="
  224. zhongwen.indexOf('元') > -1 &&
  225. zhongwen
  226. .substring(this.zhongwen.indexOf('元') - 1)
  227. .substring(0, 1) != '拾' &&
  228. zhongwen
  229. .substring(this.zhongwen.indexOf('元') - 1)
  230. .substring(0, 1) != '佰' &&
  231. zhongwen
  232. .substring(this.zhongwen.indexOf('元') - 1)
  233. .substring(0, 1) != '仟'
  234. "
  235. >
  236. {{
  237. zhongwen.substring(
  238. zhongwen.indexOf("元") - 1,
  239. zhongwen.indexOf("元")
  240. )
  241. }}
  242. </span>
  243. <span v-else>零</span>
  244. </span>
  245. <span style="position: absolute; top: 235px; left: 380px">
  246. <span v-if="zhongwen.indexOf('角') > -1">
  247. {{
  248. zhongwen.substring(
  249. zhongwen.indexOf("角") - 1,
  250. zhongwen.indexOf("角")
  251. )
  252. }}
  253. </span>
  254. <span v-else>零</span>
  255. </span>
  256. <span style="position: absolute; top: 235px; left: 415px">
  257. <span v-if="zhongwen.indexOf('分') > -1">
  258. {{
  259. zhongwen.substring(
  260. zhongwen.indexOf("分") - 1,
  261. zhongwen.indexOf("分")
  262. )
  263. }}
  264. </span>
  265. <span v-else>零</span>
  266. </span>
  267. </span>
  268. <span style="position: absolute; top: 235px; left: 500px">{{
  269. totalPrice.toFixed(2)
  270. }}</span>
  271. </div>
  272. <!-- <div style="position: absolute;top:300px;left:460px">现金:{{ list.psn_cash_money }}</div> -->
  273. <div>
  274. <div style="position: absolute; top: 300px; left: 120px">
  275. {{ org_name }}
  276. </div>
  277. <div style="position: absolute; top: 300px; left: 460px">高慧裕</div>
  278. </div>
  279. </div>
  280. </div>
  281. </template>
  282. <script>
  283. import { getInvoice } from "@/api/project/project";
  284. import { uParseTime } from "@/utils/tools";
  285. export default {
  286. props: {
  287. paramsObj: Object,
  288. },
  289. data() {
  290. return {
  291. list: {},
  292. printDate: "",
  293. zhongwen: "",
  294. totalPrice: 0.0,
  295. org_id: "",
  296. org_name: "",
  297. in_hosptial_time: "",
  298. out_hosptial_time: "",
  299. id_card_no: "",
  300. number: "",
  301. balance_accounts_type: "",
  302. gend: "",
  303. loading: true,
  304. };
  305. },
  306. created() {
  307. console.log("paramsObj", this.paramsObj);
  308. let params = {
  309. order_id: this.paramsObj.order_id,
  310. patient_id: this.paramsObj.patient_id,
  311. };
  312. this.$nextTick(() => {
  313. this.getInvoice(params);
  314. })
  315. this.org_id = this.$store.getters.xt_user.org_id;
  316. this.org_name = this.$store.getters.xt_user.org.org_name;
  317. },
  318. methods: {
  319. getInvoice(params) {
  320. getInvoice(params).then((res) => {
  321. this.$nextTick(() => {
  322. this.list = res.data.data;
  323. this.totalPrice =
  324. this.list.westernMedicineCostTotal +
  325. this.list.checkCostTotal +
  326. this.list.treatCostTotal +
  327. this.list.bedCostTotal +
  328. this.list.chineseTraditionalMedicineCostTotal +
  329. this.list.laboratoryCostTotal +
  330. this.list.operationCostTotal +
  331. this.list.otherCostTotal +
  332. this.list.materialCostTotal +
  333. this.list.zhenChaCostTotal;
  334. this.smalltoBIG(this.list.order.medfee_sumamt);
  335. var data = new Date(res.data.data.date * 1000);
  336. var month =
  337. data.getMonth() < 9
  338. ? "0" + (data.getMonth() + 1)
  339. : data.getMonth() + 1;
  340. var date =
  341. data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
  342. this.printDate = data.getFullYear() + "-" + month + "-" + date;
  343. if (this.list.his.id > 0) {
  344. this.in_hosptial_time = this.getTime();
  345. this.out_hosptial_time = this.list.order.setl_time.split(" ")[0];
  346. } else {
  347. this.in_hosptial_time =
  348. this.list.his_hospital_record.in_hosptial_time.split(" ")[0];
  349. this.out_hosptial_time =
  350. this.list.his_hospital_record.out_hosptial_time.split(" ")[0];
  351. }
  352. this.id_card_no = this.list.his_hospital_record.id_card_no;
  353. this.number = this.list.his_hospital_record.number;
  354. this.balance_accounts_type =
  355. this.list.his_hospital_record.balance_accounts_type;
  356. this.gend = this.list.gender;
  357. this.loading = false;
  358. })
  359. });
  360. },
  361. smalltoBIG(n) {
  362. // let fraction = ['角', '分'];
  363. // let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
  364. // let unit = [['元.', '万,', '亿,'], ["元",'拾', '佰', '仟']];
  365. // let head = price < 0 ? '欠' : '';
  366. // price = Math.abs(price);
  367. // let upper = '';
  368. // for (let i = 0; i < fraction.length; i++) {
  369. // upper += (digit[Math.floor(price * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
  370. // }
  371. // upper = upper || '整';
  372. // price = Math.floor(price);
  373. // for (let i = 0; i < unit[0].length && price > 0; i++) {
  374. // let p = '';
  375. // for (let j = 0; j < unit[1].length && price > 0; j++) {
  376. // p = digit[price % 10] + unit[1][j] + p;
  377. // price = Math.floor(price / 10);
  378. // }
  379. // upper = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + upper;
  380. // }
  381. // this.zhongwen = head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整')
  382. // console.log('6666',head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整'))
  383. if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)) {
  384. return "数据非法"; //判断数据是否大于0
  385. }
  386. var unit = "仟佰拾亿仟佰拾万仟佰拾元角分",
  387. str = "";
  388. n += "00";
  389. var indexpoint = n.indexOf("."); // 如果是小数,截取小数点前面的位数
  390. if (indexpoint >= 0) {
  391. n = n.substring(0, indexpoint) + n.substr(indexpoint + 1, 2); // 若为小数,截取需要使用的unit单位
  392. }
  393. unit = unit.substr(unit.length - n.length); // 若为整数,截取需要使用的unit单位
  394. for (var i = 0; i < n.length; i++) {
  395. str += "零壹贰叁肆伍陆柒捌玖".charAt(n.charAt(i)) + unit.charAt(i); //遍历转化为大写的数字
  396. }
  397. this.zhongwen = str
  398. .replace(/零(仟|佰|拾|角)/g, "零")
  399. .replace(/(零)+/g, "零")
  400. .replace(/零(万|亿|元)/g, "$1")
  401. .replace(/(亿)万|壹(拾)/g, "$1$2")
  402. .replace(/^元零?|零分/g, "")
  403. .replace(/元$/g, "元整");
  404. console.log(this.zhongwen, "中文");
  405. console.log(
  406. this.zhongwen.substring(
  407. this.zhongwen.indexOf("拾") - 1,
  408. this.zhongwen.indexOf("拾")
  409. ),
  410. "op"
  411. );
  412. },
  413. getTime(value, temp) {
  414. if (value == 0) {
  415. return "";
  416. }
  417. if (value != undefined) {
  418. return uParseTime(value, temp);
  419. }
  420. return "";
  421. },
  422. },
  423. watch: {
  424. paramsObj: {
  425. //深度监听,可监听到对象、数组的变化
  426. handler(val, oldVal) {
  427. let params = {
  428. order_id: val.order_id,
  429. patient_id: val.patient_id,
  430. };
  431. this.getInvoice(params);
  432. },
  433. deep: true,
  434. },
  435. },
  436. };
  437. </script>