detailPrint.vue 16KB

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