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

detailStatistics.vue 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. <template>
  2. <div>
  3. <div
  4. style="display: flex; justify-content: space-between; margin-bottom: 10px"
  5. >
  6. <div>
  7. <el-select
  8. size="small"
  9. v-model="item_type"
  10. placeholder="请选择"
  11. style="width: 150px; margin-left: 10px"
  12. @change="changeItem"
  13. >
  14. <el-option label="全部" value="0"> </el-option>
  15. <el-option
  16. v-for="(item, index) in items"
  17. :key="index"
  18. :label="item.name"
  19. :value="item.id"
  20. >
  21. </el-option>
  22. </el-select>
  23. <el-input
  24. size="small"
  25. style="width: 150px"
  26. v-model="keywords"
  27. class="filter-item"
  28. placeholder="请输入项目名称"
  29. />
  30. <el-button
  31. size="small"
  32. style="margin: 0 10px"
  33. class="filter-item"
  34. type="primary"
  35. @click="searchAction"
  36. >搜索
  37. </el-button>
  38. <el-date-picker
  39. v-model="chargeDate"
  40. type="daterange"
  41. value-format="yyyy-MM-dd"
  42. range-separator="至"
  43. start-placeholder="开始日期"
  44. @change="changeDate"
  45. end-placeholder="结束日期"
  46. >
  47. </el-date-picker>
  48. <el-button type="primary" size="small" @click="toPrint">打印</el-button>
  49. </div>
  50. <div></div>
  51. </div>
  52. <el-table
  53. :data="tableData"
  54. border
  55. :row-style="{ color: '#303133' }"
  56. ref="table"
  57. :header-cell-style="{
  58. backgroundColor: 'rgb(245, 247, 250)',
  59. color: '#606266',
  60. }"
  61. max-height="600"
  62. show-summary
  63. v-loading="detail_loading"
  64. highlight-current-row
  65. >
  66. <el-table-column type="index" label="序号" width="60px" align="center">
  67. <template slot-scope="scope">
  68. {{ scope.row.index }}
  69. </template>
  70. </el-table-column>
  71. <el-table-column align="center" label="处方日期">
  72. <template slot-scope="scope">{{
  73. getTime(scope.row.record_date)
  74. }}</template>
  75. </el-table-column>
  76. <el-table-column align="center" label="费用编码">
  77. <template slot-scope="scope">
  78. {{ scope.row.number }}
  79. </template>
  80. </el-table-column>
  81. <el-table-column align="center" label="项目名称">
  82. <template slot-scope="scope">
  83. <span v-if="scope.row.advice_id > 0">{{
  84. scope.row.advice.advice_name
  85. }}</span>
  86. <span v-if="scope.row.project_id > 0">
  87. <span v-if="scope.row.project.type == 2">{{
  88. scope.row.project.project.project_name
  89. }}</span>
  90. <span v-if="scope.row.project.type == 3">{{
  91. scope.row.project.good_info.good_name
  92. }}</span>
  93. </span>
  94. </template>
  95. </el-table-column>
  96. <el-table-column align="center" label="规格">
  97. <template slot-scope="scope">
  98. <span v-if="scope.row.advice_id > 0"
  99. >{{ scope.row.advice.drug.dose
  100. }}{{ scope.row.advice.drug.dose_unit }}*{{
  101. scope.row.advice.drug.min_number
  102. }}{{ scope.row.advice.drug.min_unit }}/{{
  103. scope.row.advice.drug.max_unit
  104. }}</span
  105. >
  106. <span v-if="scope.row.project_id > 0">
  107. <span v-if="scope.row.project.type == 2">{{
  108. scope.row.project.project.project_name
  109. }}</span>
  110. <span v-if="scope.row.project.type == 3">{{
  111. scope.row.project.good_info.specification_name
  112. }}</span>
  113. </span>
  114. </template>
  115. </el-table-column>
  116. <el-table-column align="center" label="数量">
  117. <template slot-scope="scope">
  118. {{ scope.row.cnt }}
  119. </template>
  120. </el-table-column>
  121. <el-table-column align="center" label="单位">
  122. <template slot-scope="scope">
  123. <span v-if="scope.row.advice_id > 0">{{
  124. scope.row.advice.prescribing_number_unit
  125. }}</span>
  126. <span v-if="scope.row.project_id > 0">
  127. <span v-if="scope.row.project.type == 2">{{
  128. scope.row.project.project.unit
  129. }}</span>
  130. <span v-if="scope.row.project.type == 3">{{
  131. scope.row.project.good_info.packing_unit
  132. }}</span>
  133. </span>
  134. </template>
  135. </el-table-column>
  136. <el-table-column align="center" label="单价">
  137. <template slot-scope="scope">
  138. {{ scope.row.pric }}
  139. </template>
  140. </el-table-column>
  141. <el-table-column align="center" label="金额" prop="total_price">
  142. <template slot-scope="scope">
  143. <div>
  144. {{ scope.row.total_price }}
  145. </div>
  146. </template>
  147. </el-table-column>
  148. <el-table-column align="center" prop="name" label="备注">
  149. <template slot-scope="scope">
  150. <div>
  151. <span v-if="scope.row.advice_id > 0">{{
  152. scope.row.advice.remark
  153. }}</span>
  154. <span v-if="scope.row.project_id > 0">
  155. <span v-if="scope.row.project.type == 2">{{
  156. scope.row.project.remark
  157. }}</span>
  158. <span v-if="scope.row.project.type == 3">{{
  159. scope.row.project.remark
  160. }}</span>
  161. </span>
  162. </div>
  163. </template>
  164. </el-table-column>
  165. </el-table>
  166. <div style="display: flex; justify-content: space-around; margin-top: 25px">
  167. <div>总费用:{{ getAllPice() }}</div>
  168. <div>
  169. 个人支付:
  170. {{getActPay()}}
  171. <!-- <span v-if="his_patient.balance_accounts_type == 2">{{ getAllPice() }}</span>
  172. <span v-if="his_patient.balance_accounts_type != 2">{{ getActPay() }}</span> -->
  173. </div>
  174. <div>基金支付记账:{{ getFundPaySumamt() }}</div>
  175. <div>补充医疗支付记账:{{ getHifesPay() }}</div>
  176. <div>救助支付金额:{{ getMafPay() }}</div>
  177. </div>
  178. </div>
  179. <!-- </div> -->
  180. </template>
  181. <script>
  182. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  183. import { getHisSummaryDetailList } from "@/api/his/his_tools";
  184. const moment = require("moment");
  185. import { uParseTime } from "@/utils/tools";
  186. export default {
  187. components: {
  188. BreadCrumb,
  189. },
  190. props: {
  191. patient_id: {
  192. type: Number,
  193. default: 0,
  194. },
  195. },
  196. data() {
  197. return {
  198. detail_loading: false,
  199. tempArr: [],
  200. pos: 0,
  201. search_input: "",
  202. sameRowArr: [],
  203. keywords: "",
  204. tableData: [],
  205. chargeDate: [
  206. moment(new Date()).add("year", 0).format("YYYY-MM-DD"),
  207. moment(new Date()).add("year", 0).format("YYYY-MM-DD"),
  208. ],
  209. item_type: "0",
  210. items: [
  211. { id: 1, name: "药品" },
  212. { id: 2, name: "项目" },
  213. { id: 3, name: "耗材" },
  214. ],
  215. list: [],
  216. his_patient: {},
  217. id: 0,
  218. start_time: "",
  219. end_time: "",
  220. org_id:0,
  221. };
  222. },
  223. methods: {
  224. getTime(val) {
  225. if (val <= 0) {
  226. return "";
  227. }
  228. if (val == "") {
  229. return "";
  230. } else {
  231. return uParseTime(val, "{y}-{m}-{d}");
  232. }
  233. },
  234. searchAction() {
  235. let table_id = this.$store.getters.pagedata.list.table_id;
  236. if (table_id == undefined) {
  237. this.$store.commit("SET_PAGEDATA", {
  238. table_id: 0,
  239. type_id: this.id,
  240. keywords: this.keywords,
  241. start_time: this.chargeDate[0],
  242. end_time: this.chargeDate[1],
  243. patient_id: this.patient_id,
  244. });
  245. } else {
  246. this.$store.commit("SET_PAGEDATA", {
  247. table_id: table_id,
  248. type_id: this.id,
  249. keywords: this.keywords,
  250. start_time: this.chargeDate[0],
  251. end_time: this.chargeDate[1],
  252. patient_id: this.patient_id,
  253. });
  254. }
  255. this.getHisSummaryDetailList();
  256. },
  257. changeDate() {
  258. this.start_time = this.chargeDate[0];
  259. this.end_time = this.chargeDate[1];
  260. this.getHisSummaryDetailList();
  261. },
  262. changeItem(id) {
  263. this.id = id;
  264. let table_id = this.$store.getters.pagedata.list.table_id;
  265. if (table_id == undefined) {
  266. this.$store.commit("SET_PAGEDATA", {
  267. table_id: 0,
  268. type_id: this.id,
  269. keywords: this.keywords,
  270. start_time: this.chargeDate[0],
  271. end_time: this.chargeDate[1],
  272. patient_id: this.patient_id,
  273. });
  274. } else {
  275. this.$store.commit("SET_PAGEDATA", {
  276. table_id: table_id,
  277. type_id: this.id,
  278. keywords: this.keywords,
  279. start_time: this.chargeDate[0],
  280. end_time: this.chargeDate[1],
  281. patient_id: this.patient_id,
  282. });
  283. }
  284. this.getHisSummaryDetailList();
  285. },
  286. getHisSummaryDetailList() {
  287. let start_time = this.chargeDate[0];
  288. let end_time = this.chargeDate[1];
  289. let params = {
  290. patient_id: this.patient_id,
  291. start_time: start_time,
  292. end_time: end_time,
  293. type: this.item_type,
  294. keyword: this.keywords,
  295. };
  296. getHisSummaryDetailList(params).then((response) => {
  297. if (response.data.state == 1) {
  298. var list = response.data.data.list;
  299. this.his_patient = response.data.data.his_patient;
  300. this.list = list;
  301. console.log( this.list)
  302. this.tableData = [];
  303. for (let i = 0; i < list.length; i++) {
  304. for (let j = 0; j < list[i].orders.length; j++) {
  305. for (let z = 0; z < list[i].orders[j].order_info.length; z++) {
  306. list[i].orders[j].order_info[z].record_date =
  307. list[i].orders[j].settle_accounts_date;
  308. list[i].orders[j].order_info[z].number =
  309. list[i].orders[j].number;
  310. this.tableData.push(list[i].orders[j].order_info[z]);
  311. }
  312. }
  313. }
  314. var obj = { index: "合计", total_price: 0, record_date: "0" };
  315. for (let i = 0; i < this.tableData.length; i++) {
  316. this.tableData[i].index = i + 1;
  317. this.tableData[i].total_price = 0;
  318. this.tableData[i].total_price = (
  319. this.tableData[i].cnt * this.tableData[i].pric
  320. ).toFixed(2);
  321. obj.total_price += this.tableData[i].cnt * this.tableData[i].pric;
  322. }
  323. obj.total_price = obj.total_price.toFixed(2);
  324. var new_arr = [];
  325. let list_1 = this.$store.getters.pagedata.list;
  326. if (list_1.keywords == undefined) {
  327. this.keywords = "";
  328. } else {
  329. this.keywords = list_1.keywords;
  330. }
  331. this.id = list_1.type_id;
  332. this.item_type = this.id;
  333. if(this.item_type == undefined){
  334. this.item_type = "0"
  335. }else{
  336. this.item_type = this.id;
  337. }
  338. if (this.keywords != "") {
  339. for (let i = 0; i < this.tableData.length; i++) {
  340. if (this.tableData[i].index != "合计") {
  341. if (this.tableData[i].advice_id > 0) {
  342. if (
  343. this.tableData[i].advice.advice_name.indexOf(
  344. this.keywords
  345. ) > -1
  346. ) {
  347. new_arr.push(this.tableData[i]);
  348. }
  349. }
  350. if (this.tableData[i].project_id > 0) {
  351. if (this.tableData[i].project.type == 2) {
  352. if (
  353. this.tableData[i].project.project.project_name.indexOf(
  354. this.keywords
  355. ) > -1
  356. ) {
  357. new_arr.push(this.tableData[i]);
  358. }
  359. }
  360. if (this.tableData[i].project.type == 3) {
  361. if (
  362. this.tableData[i].project.good_info.good_name.indexOf(
  363. this.keywords
  364. ) > -1
  365. ) {
  366. new_arr.push(this.tableData[i]);
  367. }
  368. }
  369. }
  370. }
  371. }
  372. var objs = { index: "合计", total_price: 0, record_date: "0" };
  373. objs.total_price = this.getPrice(new_arr);
  374. this.tableData = new_arr;
  375. }
  376. if (this.id == 1) {
  377. var obj = { index: "合计", total_price: 0, record_date: "0" };
  378. var new_arr = [];
  379. for (let i = 0; i < this.tableData.length; i++) {
  380. if (this.tableData[i].index != "合计") {
  381. if (this.tableData[i].advice_id > 0) {
  382. new_arr.push(this.tableData[i]);
  383. }
  384. }
  385. }
  386. this.tableData = [];
  387. obj.total_price = this.getPrice(new_arr);
  388. this.tableData = new_arr;
  389. }
  390. if (this.id == 2) {
  391. var obj = { index: "合计", total_price: 0, record_date: "0" };
  392. var new_arr = [];
  393. for (let i = 0; i < this.tableData.length; i++) {
  394. if (this.tableData[i].index != "合计") {
  395. if (this.tableData[i].project_id > 0) {
  396. if (this.tableData[i].project.type == 2) {
  397. new_arr.push(this.tableData[i]);
  398. }
  399. }
  400. }
  401. }
  402. this.tableData = [];
  403. obj.total_price = this.getPrice(new_arr);
  404. this.tableData = new_arr;
  405. }
  406. if (this.id == 3) {
  407. var new_arr = [];
  408. var obj = { index: "合计", total_price: 0, record_date: "0" };
  409. for (let i = 0; i < this.tableData.length; i++) {
  410. if (this.tableData[i].index != "合计") {
  411. if (this.tableData[i].project_id > 0) {
  412. if (this.tableData[i].project.type == 3) {
  413. new_arr.push(this.tableData[i]);
  414. }
  415. }
  416. }
  417. }
  418. this.tableData = [];
  419. obj.total_price = this.getPrice(new_arr);
  420. this.tableData = new_arr;
  421. }
  422. }
  423. });
  424. },
  425. getAllPice() {
  426. var total_price = 0;
  427. for (let i = 0; i < this.tableData.length; i++) {
  428. total_price += this.tableData[i].pric * this.tableData[i].cnt;
  429. }
  430. return total_price.toFixed(2);
  431. },
  432. getActPay() {
  433. var act_pay = 0;
  434. for (let i = 0; i < this.list.length; i++) {
  435. for (let j = 0; j < this.list[i].orders.length; j++) {
  436. if(this.list[i].orders[j].is_medicine_insurance == 1){
  437. act_pay = act_pay + this.list[i].orders[j].psn_cash_pay
  438. }else{
  439. console.log(this.list[i].orders[j].medfee_sumamt)
  440. act_pay= act_pay + this.list[i].orders[j].medfee_sumamt
  441. }
  442. }
  443. }
  444. return act_pay.toFixed(2);
  445. },
  446. getFundPaySumamt() {
  447. var fund_pay_sumamt = 0;
  448. for (let i = 0; i < this.list.length; i++) {
  449. for (let j = 0; j < this.list[i].orders.length; j++) {
  450. fund_pay_sumamt += this.list[i].orders[j].fund_pay_sumamt;
  451. }
  452. }
  453. return fund_pay_sumamt;
  454. },
  455. getHifesPay() {
  456. var hifes_pay = 0;
  457. for (let i = 0; i < this.list.length; i++) {
  458. for (let j = 0; j < this.list[i].orders.length; j++) {
  459. hifes_pay += this.list[i].orders[j].hifes_pay;
  460. }
  461. }
  462. return hifes_pay;
  463. },
  464. getMafPay() {
  465. var maf_pay = 0;
  466. for (let i = 0; i < this.list.length; i++) {
  467. for (let j = 0; j < this.list[i].orders.length; j++) {
  468. maf_pay += this.list[i].orders[j].maf_pay;
  469. }
  470. }
  471. return maf_pay;
  472. },
  473. toPrint() {
  474. this.$router.push({
  475. path:
  476. "/hisTool/detailPrint?patient_id=" +
  477. this.patient_id +
  478. "&start_time=" +
  479. this.start_time +
  480. "&end_time=" +
  481. this.end_time +
  482. "&type=" +
  483. this.item_type +
  484. "&keyword=" +
  485. this.keywords +
  486. "&id=" +
  487. this.id +
  488. "&balance_accounts_type=" +
  489. this.his_patient.balance_accounts_type,
  490. });
  491. // ======打印时将查询参数保存至store中======
  492. // table_id: 左栏表格下标
  493. // type_id: 下拉框id
  494. // keywords: 输入框
  495. // start_time: this.chargeDate[0],
  496. // end_time: this.chargeDate[1],
  497. // patient_id:this.patient_id
  498. let table_id = this.$store.getters.pagedata.list.table_id;
  499. if (table_id == undefined) {
  500. this.$store.commit("SET_PAGEDATA", {
  501. table_id: 0,
  502. type_id: this.id,
  503. keywords: this.keywords,
  504. start_time: this.chargeDate[0],
  505. end_time: this.chargeDate[1],
  506. patient_id: this.patient_id,
  507. });
  508. } else {
  509. this.$store.commit("SET_PAGEDATA", {
  510. table_id: table_id,
  511. type_id: this.id,
  512. keywords: this.keywords,
  513. start_time: this.chargeDate[0],
  514. end_time: this.chargeDate[1],
  515. patient_id: this.patient_id,
  516. });
  517. }
  518. },
  519. getPrice(val) {
  520. var total_price = 0;
  521. for (let i = 0; i < val.length; i++) {
  522. total_price += val[i].cnt * val[i].pric;
  523. }
  524. return total_price.toFixed(2);
  525. },
  526. },
  527. created() {
  528. let list_1 = this.$store.getters.pagedata.list;
  529. if (!list_1.start_time ||list_1.start_time == "") {
  530. this.chargeDate[0] = this.chargeDate[0] = moment(new Date()).add("year", 0).format("YYYY-MM-DD");;
  531. } else {
  532. this.chargeDate[0] = list_1.start_time;
  533. }
  534. if (!list_1.end_time ||list_1.end_time == "") {
  535. this.chargeDate[1] = this.chargeDate[0] = moment(new Date()).add("year", 0).format("YYYY-MM-DD");;
  536. } else {
  537. this.chargeDate[1] = list_1.end_time;
  538. }
  539. this.start_time = this.chargeDate[0];
  540. this.end_time = this.chargeDate[1];
  541. this.getHisSummaryDetailList();
  542. },
  543. watch: {
  544. patient_id: function () {
  545. this.patient_id = this.patient_id;
  546. this.getHisSummaryDetailList();
  547. },
  548. },
  549. };
  550. </script>