detailPrint.vue 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. <template>
  2. <div>
  3. <div class="print_btn">
  4. <el-button type="primary" @click="printtpage">打印</el-button>
  5. </div>
  6. <div id="list-print" class="list-print">
  7. <div class="listTitle">
  8. {{ $store.getters.xt_user.org.org_name }}费用清单
  9. </div>
  10. <div class="listInfo">
  11. <div>患者姓名:{{ patient.name }}</div>
  12. <div>性别:{{ patient.gender == 1 ? "男" : "女" }}</div>
  13. <div>结算类别:{{ getType(his_patient.balance_accounts_type) }}</div>
  14. <div style="min-width:300px;">发票号码:</div>
  15. </div>
  16. <div class="listInfo">
  17. <div>住院/门诊号:</div>
  18. <div>科室:{{ getDepartment(his_patient.departments) }}</div>
  19. <div style="min-width:350px;">就诊流水号:{{ his_patient.number }}</div>
  20. </div>
  21. <div class="listInfo">
  22. <div>总费用:{{ getAllPice() }}</div>
  23. <div>个人支付:{{ getActPay() }}</div>
  24. <div>基金支付记账:{{ getFundPaySumamt() }}</div>
  25. <div style="min-width:300px;">补充医疗支付记账:{{ getHifesPay() }}</div>
  26. </div>
  27. <div class="listInfo">
  28. <div>救助支付金额:{{ getMafPay() }}</div>
  29. </div>
  30. <table class="listTable" border="1">
  31. <tr style="height:45px">
  32. <td style="width: 5%; text-align: center">序号</td>
  33. <td style="width: 13%; text-align: center">处方日期</td>
  34. <td style="width: 20%; text-align: center">费用编码</td>
  35. <td style="width: 17%; text-align: center">项目名称</td>
  36. <td style="width: 10%; text-align: center">规格</td>
  37. <td style="width: 13%; text-align: center">数量</td>
  38. <td style="width: 13%; text-align: center">单位</td>
  39. <td style="width: 11%; text-align: center">单价(元)</td>
  40. <td style="width: 10%; text-align: center">金额</td>
  41. </tr>
  42. <tr v-for="(item, index) in tableData" :key="index">
  43. <td style="width: 19%; text-align: center">{{ index + 1 }}</td>
  44. <td style="width: 10%; text-align: center">
  45. <span v-if="item.record_date > 0">{{
  46. getTimes(item.record_date)
  47. }}</span>
  48. </td>
  49. <td style="width: 31%; text-align: center">{{ item.number }}</td>
  50. <td style="width: 14%; text-align: center">
  51. <span v-if="item.advice_id > 0">{{ item.advice.advice_name }}</span>
  52. <span v-if="item.project_id > 0">
  53. <span v-if="item.project.type == 2">{{
  54. item.project.project.project_name
  55. }}</span>
  56. <span v-if="item.project.type == 3"
  57. >{item.project.good_info.good_name}}</span
  58. >
  59. </span>
  60. </td>
  61. <td style="width: 10%; text-align: center">
  62. <span v-if="item.advice_id > 0"
  63. >{{ item.advice.drug.dose }}{{ item.advice.drug.dose_unit }}*{{
  64. item.advice.drug.min_number
  65. }}{{ item.advice.drug.min_unit }}/{{
  66. item.advice.drug.max_unit
  67. }}</span
  68. >
  69. <span v-if="item.project_id > 0">
  70. <span v-if="item.project.type == 2">{{
  71. item.project.project.project_name
  72. }}</span>
  73. <span v-if="item.project.type == 3">{{
  74. item.project.good_info.specification_name
  75. }}</span>
  76. </span>
  77. </td>
  78. <td style="width: 6%; text-align: center">
  79. {{ item.cnt }}
  80. </td>
  81. <td style="width: 6%; text-align: center">
  82. <span v-if="item.advice_id > 0">{{item.advice.prescribing_number_unit}}</span>
  83. <span v-if="item.project_id > 0">
  84. <span v-if="item.project.type == 2">{{item.project.project.unit}}</span>
  85. <span v-if="item.project.type == 3">{{item.project.good_info.packing_unit}}</span>
  86. </span>
  87. </td>
  88. <td style="width: 10%; text-align: center">
  89. {{ item.pric }}
  90. </td>
  91. <td style="width: 10%; text-align: center">
  92. {{ item.total_price }}
  93. </td>
  94. </tr>
  95. </table>
  96. </div>
  97. </div>
  98. </template>
  99. <script>
  100. import print from "print-js";
  101. import { uParseTime } from "@/utils/tools";
  102. import { getHisSummaryDetailList } from "@/api/his/his_tools";
  103. export default {
  104. data() {
  105. return {
  106. patient: {},
  107. tableData: [],
  108. list: [],
  109. his_patient: {},
  110. hisDepatment: [],
  111. settlement: [
  112. { value: 1, label: "医保" },
  113. { value: 2, label: "自费" },
  114. { value: 3, label: "公费" },
  115. { value: 4, label: "农保" },
  116. { value: 5, label: "会员" },
  117. { value: 6, label: "职工" },
  118. { value: 7, label: "合同" },
  119. { value: 8, label: "医保自费" },
  120. ],
  121. };
  122. },
  123. methods: {
  124. printtpage() {
  125. const style =
  126. '@media print {.list-print{width:960px;margin:0 auto} .listTitle {font-size: 24px;text-align: center;font-weight: bold;margin-bottom: 10px;}.listInfo {display: flex;font-size: 16px;justify-content: space-between;margin: 10px 0;}.listTable {width: 100%;text-align: center;border-collapse: collapse;line-height: 25px;font-size: 14px;border-color: #000;text-align: left;} .listTable tr td {padding: 0 5px;}.tableBottom {font-size: 16px;display: flex;margin-top: 20px;}.tableBottomOne {margin-right: 40px;}';
  127. printJS({
  128. printable: "list-print",
  129. type: "html",
  130. style: style,
  131. scanStyles: false,
  132. });
  133. },
  134. getNowTime: function () {
  135. let dateTime;
  136. let yy = new Date().getFullYear();
  137. let mm = new Date().getMonth() + 1;
  138. let dd = new Date().getDate();
  139. let hh = new Date().getHours();
  140. let mf =
  141. new Date().getMinutes() < 10
  142. ? "0" + new Date().getMinutes()
  143. : new Date().getMinutes();
  144. let ss =
  145. new Date().getSeconds() < 10
  146. ? "0" + new Date().getSeconds()
  147. : new Date().getSeconds();
  148. dateTime = yy + "-" + mm + "-" + dd + " " + hh + ":" + mf + ":" + ss;
  149. return dateTime;
  150. },
  151. getTimes(time) {
  152. return uParseTime(time, "{y}-{m}-{d}");
  153. },
  154. getHisSummaryDetailList() {
  155. let start_time = this.$route.query.start_time;
  156. let end_time = this.$route.query.end_time;
  157. let params = {
  158. patient_id: this.$route.query.patient_id,
  159. start_time: start_time,
  160. end_time: end_time,
  161. type: this.$route.query.type,
  162. keyword: this.$route.query.keyword,
  163. };
  164. getHisSummaryDetailList(params).then((response) => {
  165. if (response.data.state == 1) {
  166. var list = response.data.data.list;
  167. this.list = list;
  168. this.patient = response.data.data.patient;
  169. this.his_patient = response.data.data.his_patient;
  170. this.hisDepatment = response.data.data.hisDepatment;
  171. this.tableData = [];
  172. for (let i = 0; i < list.length; i++) {
  173. for (let j = 0; j < list[i].orders.length; j++) {
  174. for (let z = 0; z < list[i].orders[j].order_info.length; z++) {
  175. list[i].orders[j].order_info[z].record_date =
  176. list[i].orders[j].settle_accounts_date;
  177. list[i].orders[j].order_info[z].number =
  178. list[i].orders[j].number;
  179. this.tableData.push(list[i].orders[j].order_info[z]);
  180. }
  181. }
  182. }
  183. var obj = { index: "合计", total_price: 0, record_date: "0" };
  184. for (let i = 0; i < this.tableData.length; i++) {
  185. this.tableData[i].index = i + 1;
  186. this.tableData[i].total_price = 0;
  187. this.tableData[i].total_price = (
  188. this.tableData[i].cnt * this.tableData[i].pric
  189. ).toFixed(2);
  190. obj.total_price += this.tableData[i].cnt * this.tableData[i].pric;
  191. }
  192. obj.total_price = obj.total_price.toFixed(2);
  193. this.tableData.push(obj);
  194. if (this.$route.query.keyword != "") {
  195. for (let i = 0; i < this.tableData.length; i++) {
  196. if (this.tableData[i].index != "合计") {
  197. if (this.tableData[i].advice_id > 0) {
  198. if (
  199. this.tableData[i].advice.advice_name.indexOf(
  200. this.$route.query.keyword
  201. ) > -1
  202. ) {
  203. new_arr.push(this.tableData[i]);
  204. }
  205. }
  206. if (this.tableData[i].project_id > 0) {
  207. if (this.tableData[i].project.type == 2) {
  208. if (
  209. this.tableData[i].project.project.project_name.indexOf(
  210. this.$route.query.keyword
  211. ) > -1
  212. ) {
  213. new_arr.push(this.tableData[i]);
  214. }
  215. }
  216. if (this.tableData[i].project.type == 3) {
  217. if (
  218. this.tableData[i].project.good_info.good_name.indexOf(
  219. this.$route.query.keyword
  220. ) > -1
  221. ) {
  222. new_arr.push(this.tableData[i]);
  223. }
  224. }
  225. }
  226. }
  227. }
  228. if (this.$route.query.keyword != "") {
  229. this.tableData.push(obj);
  230. }
  231. this.tableData = new_arr;
  232. }
  233. console.log("tabledata32233223323232", this.tableData);
  234. }
  235. });
  236. },
  237. getAllPice() {
  238. var total_price = 0;
  239. for (let i = 0; i < this.tableData.length; i++) {
  240. if (this.tableData[i].index == "合计") {
  241. total_price = this.tableData[i].total_price;
  242. }
  243. }
  244. return total_price;
  245. },
  246. getActPay() {
  247. console.log("hh23h323223323", this.list);
  248. var act_pay = 0;
  249. for (let i = 0; i < this.list.length; i++) {
  250. for (let j = 0; j < this.list[i].orders.length; j++) {
  251. act_pay += this.list[i].orders[j].acct_pay;
  252. }
  253. }
  254. return act_pay;
  255. },
  256. getFundPaySumamt() {
  257. var fund_pay_sumamt = 0;
  258. for (let i = 0; i < this.list.length; i++) {
  259. for (let j = 0; j < this.list[i].orders.length; j++) {
  260. fund_pay_sumamt += this.list[i].orders[j].fund_pay_sumamt;
  261. }
  262. }
  263. return fund_pay_sumamt;
  264. },
  265. getHifesPay() {
  266. var hifes_pay = 0;
  267. for (let i = 0; i < this.list.length; i++) {
  268. for (let j = 0; j < this.list[i].orders.length; j++) {
  269. hifes_pay += this.list[i].orders[j].hifes_pay;
  270. }
  271. }
  272. return hifes_pay;
  273. },
  274. getMafPay() {
  275. var maf_pay = 0;
  276. for (let i = 0; i < this.list.length; i++) {
  277. for (let j = 0; j < this.list[i].orders.length; j++) {
  278. maf_pay += this.list[i].orders[j].maf_pay;
  279. }
  280. }
  281. return maf_pay;
  282. },
  283. getDepartment(id) {
  284. var name = "";
  285. for (let i = 0; i < this.hisDepatment.length; i++) {
  286. if (id == this.hisDepatment[i].id) {
  287. name = this.hisDepatment[i].name;
  288. }
  289. }
  290. return name;
  291. },
  292. getType(id) {
  293. var name = "";
  294. for (let i = 0; i < this.settlement.length; i++) {
  295. if (id == this.settlement[i].value) {
  296. name = this.settlement[i].label;
  297. }
  298. }
  299. return name;
  300. },
  301. },
  302. created() {
  303. this.getHisSummaryDetailList();
  304. },
  305. };
  306. </script>
  307. <style lang="scss" scoped>
  308. .list-print {
  309. -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27),
  310. 0 0 60px rgba(0, 0, 0, 0.06) inset;
  311. -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27),
  312. 0 0 40px rgba(0, 0, 0, 0.06) inset;
  313. box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
  314. margin-bottom: 20px;
  315. padding: 20px 10px;
  316. }
  317. .listTitle {
  318. font-size: 24px;
  319. text-align: center;
  320. font-weight: bold;
  321. margin-bottom: 10px;
  322. }
  323. .listInfo {
  324. display: flex;
  325. font-size: 16px;
  326. justify-content: space-between;
  327. margin: 10px 0;
  328. }
  329. .listTable {
  330. width: 100%;
  331. text-align: center;
  332. border-collapse: collapse;
  333. line-height: 25px;
  334. font-size: 14px;
  335. border-color: #000;
  336. text-align: left;
  337. }
  338. .listTable tr td {
  339. padding: 0 5px;
  340. }
  341. .tableBottom {
  342. font-size: 16px;
  343. display: flex;
  344. margin-top: 20px;
  345. }
  346. .tableBottomOne {
  347. margin-right: 40px;
  348. }
  349. .print_btn {
  350. display: flex;
  351. justify-content: flex-end;
  352. }
  353. </style>