summary.vue 33KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906
  1. <template>
  2. <div class="main-contain outpatientChargesManagement">
  3. <div class="position">
  4. <bread-crumb :crumbs='crumbs'></bread-crumb>
  5. </div>
  6. <div class="app-container">
  7. <div style="display: flex;justify-content: space-between;margin-bottom:10px;">
  8. <div>
  9. <el-input size="small" style="width:150px;" v-model="keywords"
  10. class="filter-item"/>
  11. <el-button size="small" style="margin-left:10px;" class="filter-item" type="primary"
  12. @click="searchAction">
  13. 搜索
  14. </el-button>
  15. <el-select size="small" v-model="sort_type" placeholder="请选择"
  16. style="width:150px;margin-left:10px;" @change="changeSortType">
  17. <el-option
  18. v-for="(item,index) in sort_types"
  19. :key="index"
  20. :label="item.label"
  21. :value="item.value">
  22. </el-option>
  23. </el-select>
  24. <el-select size="small" v-model="p_type" placeholder="请选择"
  25. style="width:150px;margin-left:10px;" @change="changePType">
  26. <el-option
  27. v-for="(item,index) in p_types"
  28. :key="index"
  29. :label="item.label"
  30. :value="item.value">
  31. </el-option>
  32. </el-select>
  33. <el-date-picker size="small" v-model="start_time" prefix-icon="el-icon-date"
  34. @change="handleStartTimeChange" :editable="false" :clearable="false"
  35. style="width: 196px;margin-right:10px;" type="date" placeholder="选择开始日期"
  36. format="yyyy-MM-dd"
  37. value-format="yyyy-MM-dd"
  38. align="right"></el-date-picker>
  39. <el-date-picker size="small" v-model="end_time" prefix-icon="el-icon-date"
  40. @change="handleEndTimeChange" :editable="false" :clearable="false"
  41. style="width: 196px;margin-right:10px;" type="date" placeholder="选择结束日期"
  42. format="yyyy-MM-dd"
  43. value-format="yyyy-MM-dd"
  44. align="right"></el-date-picker>
  45. <!--<el-radio v-model="radio" label="1">明细</el-radio>-->
  46. <!--<el-radio v-model="radio" label="2">汇总</el-radio>-->
  47. </div>
  48. <div>
  49. <!-- <el-popover
  50. placement="bottom"
  51. width="210"
  52. trigger="click">
  53. <el-button size="small" ref="button_two" @click="open(1)">打印清单</el-button>
  54. <el-button size="small" ref="button_six" @click="open(2)">打印汇总</el-button>
  55. <el-button slot="reference" style="margin:0 10px;" type="primary" size="small">打印</el-button>
  56. </el-popover> -->
  57. <el-button size="small" type="primary" @click="export_detail">报表下载</el-button>
  58. </div>
  59. </div>
  60. <el-table :data="tableData" border style="width: 100%;" :row-style="{ color: '#303133' }"
  61. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  62. highlight-current-row>
  63. <el-table-column
  64. prop="date"
  65. label="序号"
  66. width="60"
  67. align="center"
  68. type="index"
  69. >
  70. </el-table-column>
  71. <el-table-column align="center" prop="name" label="就诊号">
  72. <template slot-scope="scope">{{ scope.row.mdtrt_id }}</template>
  73. </el-table-column>
  74. <el-table-column align="center" prop="name" label="患者名字">
  75. <template slot-scope="scope">{{ scope.row.patient.name }}</template>
  76. </el-table-column>
  77. <!--<el-table-column align="center" prop="name" label="患者类型">-->
  78. <!--<template slot-scope="scope"></template>-->
  79. <!--</el-table-column>-->
  80. <el-table-column align="center" prop="name" label="应收金额">
  81. <template slot-scope="scope">{{scope.row.medfee_sumamt.toFixed(2)}}</template>
  82. </el-table-column>
  83. <el-table-column align="center" prop="name" label="实收金额">
  84. <template slot-scope="scope">{{scope.row.reality_price.toFixed(2)}}</template>
  85. </el-table-column>
  86. <el-table-column align="center" prop="name" label="科室">
  87. <template slot-scope="scope">{{scope.row.department_name}}</template>
  88. </el-table-column>
  89. <el-table-column align="center" prop="name" label="收费日期">
  90. <template slot-scope="scope">
  91. <div>{{scope.row.setl_time}}</div>
  92. </template>
  93. </el-table-column>
  94. <el-table-column align="center" prop="name" label="收费员">
  95. <template slot-scope="scope">{{ getName(scope.row.creator) }}</template>
  96. </el-table-column>
  97. <el-table-column align="center" prop="name" label="状态">
  98. <template slot-scope="scope">
  99. <div v-if="scope.row.order_status == 1">待结算</div>
  100. <div v-if="scope.row.order_status == 2">已结算</div>
  101. <div v-if="scope.row.order_status == 3">已退费</div>
  102. </template>
  103. </el-table-column>
  104. <el-table-column align="center" prop="name" label="操作">
  105. <template slot-scope="scope">
  106. <el-button size="mini" type="primary" @click="toDetail(scope.row)">详情</el-button>
  107. <el-button size="mini" type="primary" @click="toPrint(scope.row)">
  108. 结算单
  109. </el-button>
  110. <!-- <el-button size="mini" type="primary" @click="toRefund(scope.row)">-->
  111. <!-- 退费-->
  112. <!-- </el-button>-->
  113. <el-button size="mini" type="primary" @click="uploadInfo(scope.row)"
  114. v-if="scope.row.order_status == 2 && scope.row.result.id == 0 && p_type == 1">
  115. 上传结算清单
  116. </el-button>
  117. <el-button size="mini" type="primary" @click="uploadOtherInfo(scope.row)"
  118. v-if="scope.row.order_status == 2 && scope.row.result.id == 0 && p_type == 2">
  119. 上传结算清单
  120. </el-button>
  121. <el-button size="mini" type="primary" @click="invoicePrint(scope.row)">打印发票</el-button>
  122. <!-- <el-button size="mini" type="primary" @click="shouJuPrint(scope.row)">打印收据</el-button>-->
  123. <!-- <el-button size="mini" type="primary" @click="refundOne(scope.row)">-->
  124. <!-- 撤销出院-->
  125. <!-- </el-button>-->
  126. <!--<el-button size="mini" type="primary" @click="refundTwo(scope.row)" v-if="scope.row.his_hospital_patient.balance_accounts_type == 2">-->
  127. <!--撤销明细-->
  128. <!--</el-button>-->
  129. <!-- <el-button size="mini" type="primary" @click="refundTwo(scope.row)" v-if="scope.row.his_hospital_patient.balance_accounts_type != 2">-->
  130. <!-- 撤销明细-->
  131. <!-- </el-button>-->
  132. <!-- <el-button size="mini" type="primary" @click="refundThee(scope.row)">-->
  133. <!-- 撤销入院-->
  134. <!-- </el-button>-->
  135. </template>
  136. </el-table-column>
  137. </el-table>
  138. <el-pagination
  139. @size-change="handleSizeChange"
  140. @current-change="handleCurrentChange"
  141. :page-sizes="[10, 50, 100]"
  142. :page-size="10"
  143. background
  144. style="margin-top:20px;float: right"
  145. layout="total, sizes, prev, pager, next, jumper"
  146. :total="total"
  147. >
  148. </el-pagination>
  149. </div>
  150. <el-dialog
  151. class="centerDialog"
  152. width="1200px"
  153. title="打印"
  154. :visible.sync="statementVisible">
  155. <statementPrint ref="print" :paramsObj='orderObj'></statementPrint>
  156. <!-- <new-statement-print ref="print" :paramsObj='orderObj'></new-statement-print>-->
  157. <!-- <state-->
  158. </el-dialog>
  159. <el-dialog
  160. class="centerDialog"
  161. width="900px"
  162. title="打印"
  163. :visible.sync="listVisible">
  164. <listPrint></listPrint>
  165. </el-dialog>
  166. <el-dialog
  167. class="centerDialog"
  168. width="900px"
  169. title="打印"
  170. :visible.sync="allListVisible">
  171. <allListPrint :paramsObj='paramsObj'></allListPrint>
  172. </el-dialog>
  173. <el-dialog
  174. class="centerDialog"
  175. width="1200px"
  176. title="打印"
  177. :visible.sync="statementVisible9504">
  178. <!--<statementPrint ref="print" :paramsObj='orderObj'></statementPrint>-->
  179. <!--<new-statement-print ref="print" :paramsObj='orderObj9504'></new-statement-print>-->
  180. <new-statement-print-two ref="print" :paramsObj='orderObj9504'></new-statement-print-two>
  181. </el-dialog>
  182. <el-dialog
  183. class="centerDialog"
  184. width="1200px"
  185. title="打印"
  186. :visible.sync="invoiceVisible">
  187. <invoicePrint ref="print" :invoiceParams='invoiceParams'></invoicePrint>
  188. </el-dialog>
  189. <el-dialog
  190. class="centerDialog"
  191. width="1200px"
  192. title="打印"
  193. :visible.sync="shouJuVisible">
  194. <!-- <invoicePrint ref="print" :invoiceParams='invoiceParams'></invoicePrint>-->
  195. <!-- <shou-ju-print></shou-ju-print>-->
  196. <shou-ju-print ref="shouJuPrint" :invoiceParams='invoiceParams'></shou-ju-print>
  197. </el-dialog>
  198. <!-- <el-dialog
  199. class="centerDialog"
  200. width="1200px"
  201. title="打印"
  202. :visible.sync="settlementVisible">
  203. <settlement-print ref="print" :paramsObj='orderObj'></settlement-print>
  204. </el-dialog> -->
  205. </div>
  206. </template>
  207. <script>
  208. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  209. import { getDoctorList, getExportConsumeDetailList, getHisOrderList, HopitalunRefund, Refund,Outhopitaluncheck,Inthopitaluncheck } from '@/api/his/his'
  210. import { uParseTime } from '@/utils/tools'
  211. import NewStatementPrint from './newStatementPrint'
  212. import listPrint from './listPrint'
  213. import allListPrint from './allListPrint'
  214. import NewStatementPrintTwo from './newStatementPrintTwo'
  215. import { fetchAllAdminUsers } from '@/api/doctor'
  216. import axios from 'axios'
  217. import invoicePrint from './invoicePrint'
  218. import statementPrint from './statementPrint'
  219. import ShouJuPrint from './shouJuPrint'
  220. // import settlementPrint from './settlementPrint'
  221. export default {
  222. components: {
  223. ShouJuPrint,
  224. NewStatementPrintTwo,
  225. NewStatementPrint,
  226. BreadCrumb,
  227. listPrint,
  228. allListPrint,
  229. statementPrint,
  230. invoicePrint
  231. // settlementPrint
  232. },
  233. data() {
  234. return {
  235. orderObj: {},
  236. statementVisible: false,
  237. statementVisible9504: false,
  238. orderObj9504: {},
  239. crumbs: [
  240. { path: false, name: '门诊收费' },
  241. { path: false, name: '项目消费明细汇总' }
  242. ],
  243. tableData: [],
  244. limit: 10,
  245. page: 1,
  246. keywords: '',
  247. start_time: '',
  248. end_time: '',
  249. total: '',
  250. doctors: [],
  251. admin_user_id: '',
  252. listVisible: false,
  253. allListVisible: false,
  254. adminUserOptions: [],
  255. invoiceVisible: false,
  256. paramsObj: {},
  257. invoiceParams: {},
  258. settlementVisible: false,
  259. sort_type:1,
  260. p_type:1,
  261. sort_types: [
  262. { value: 1, label: '处方时间' },
  263. { value: 2, label: '结算时间' }
  264. ],
  265. p_types:[
  266. { value: 0, label: '全部' },
  267. { value: 1, label: '住院' },
  268. { value: 2, label: '门诊' }
  269. ],
  270. shouJuVisible:false,
  271. }
  272. },
  273. methods: {
  274. uploadOtherInfo(row) {
  275. var that = this
  276. axios.get('http://127.0.0.1:9532/api/settlelist/get', {
  277. params: {
  278. order_id: row.id,
  279. admin_user_id: this.$store.getters.xt_user.user.id
  280. }
  281. }).then(function(response) {
  282. if (response.data.state == 0) {
  283. that.$message.error(response.data.msg)
  284. return false
  285. } else {
  286. if (response.data.data.failed_code == -10) {
  287. // that.$message.error(response.data.data.msg)
  288. that.$confirm(response.data.data.msg, '医保错误信息', {
  289. confirmButtonText: '确 定',
  290. type: 'warning'
  291. }).then(() => {
  292. }).catch(() => {
  293. })
  294. } else {
  295. that.$message.success('上传成功')
  296. row.result.id = response.data.data.result.id
  297. }
  298. }
  299. }).catch(function(error) {
  300. })
  301. },
  302. changePType(){
  303. this.page = 1
  304. this.keywords = ''
  305. this.getHisOrderList()
  306. },
  307. changeSortType(){
  308. this.page = 1
  309. this.keywords = ''
  310. this.getHisOrderList()
  311. },
  312. refundOne(row) {
  313. if(row.his_hospital_patient.balance_accounts_type == 2){
  314. var that = this
  315. this.$confirm('是否撤销出院', '撤销出院', {
  316. confirmButtonText: '确 定',
  317. cancelButtonText: '取 消',
  318. type: 'warning'
  319. }).then(() => {
  320. let params = {
  321. 'id': row.his_hospital_patient.id,
  322. 'admin_user_id': this.$store.getters.xt_user.user.id
  323. }
  324. Outhopitaluncheck(params).then(response => {
  325. if (response.data.state == 0) {
  326. this.$message.error(response.data.msg)
  327. return false
  328. } else {
  329. this.$message.success('撤销出院成功')
  330. this.changeRadioAndPatient(1)
  331. }
  332. })
  333. }).catch(() => {
  334. })
  335. }else{
  336. var that = this
  337. this.$confirm('是否撤销出院', '撤销出院', {
  338. confirmButtonText: '确 定',
  339. cancelButtonText: '取 消',
  340. type: 'warning'
  341. }).then(() => {
  342. let params = {
  343. 'id': row.his_hospital_patient.id,
  344. 'admin_user_id': this.$store.getters.xt_user.user.id
  345. }
  346. axios.get('http://127.0.0.1:9532/zh/api/outhopitaluncheck/get', {
  347. params: params
  348. })
  349. .then(function(response) {
  350. if (response.data.state == 0) {
  351. that.$message.error(response.data.msg)
  352. return false
  353. } else {
  354. if (response.data.data.failed_code == -10) {
  355. // that.$message.error(response.data.data.msg)
  356. that.$confirm(response.data.data.msg, '医保错误信息', {
  357. confirmButtonText: '确 定',
  358. type: 'warning'
  359. }).then(() => {
  360. }).catch(() => {
  361. })
  362. } else {
  363. that.$message({ message: '撤销出院成功', type: 'success', duration: 5000 })
  364. }
  365. }
  366. })
  367. .catch(function(error) {
  368. })
  369. }).catch(() => {
  370. })
  371. }
  372. }, refundThee(row) {
  373. if(row.his_hospital_patient.balance_accounts_type == 2){
  374. this.$confirm('是否撤销入院', '撤销入院', {
  375. confirmButtonText: '确 定',
  376. cancelButtonText: '取 消',
  377. type: 'warning'
  378. }).then(() => {
  379. let params = {
  380. 'id': row.his_hospital_patient.id,
  381. 'admin_user_id': this.$store.getters.xt_user.user.id
  382. }
  383. Inthopitaluncheck(params).then(response => {
  384. if (response.data.state == 0) {
  385. this.$message.error(response.data.msg)
  386. return false
  387. } else {
  388. this.$message.success('撤销入院成功')
  389. }
  390. })
  391. }).catch(() => {
  392. })
  393. }else {
  394. var that = this
  395. this.$confirm('是否撤销入院', '撤销入院', {
  396. confirmButtonText: '确 定',
  397. cancelButtonText: '取 消',
  398. type: 'warning'
  399. }).then(() => {
  400. let params = {
  401. 'id': row.his_hospital_patient.id,
  402. 'admin_user_id': this.$store.getters.xt_user.user.id
  403. }
  404. axios.get('http://127.0.0.1:9532/zh/api/inthopitaluncheck/get', {
  405. params: params
  406. })
  407. .then(function(response) {
  408. if (response.data.state == 0) {
  409. that.$message.error(response.data.msg)
  410. return false
  411. } else {
  412. if (response.data.data.failed_code == -10) {
  413. // that.$message.error(response.data.data.msg)
  414. that.$confirm(response.data.data.msg, '医保错误信息', {
  415. confirmButtonText: '确 定',
  416. type: 'warning'
  417. }).then(() => {
  418. }).catch(() => {
  419. })
  420. } else {
  421. that.changeRadioAndPatient(1)
  422. that.$message({ message: '撤销入院成功', type: 'success', duration: 5000 })
  423. }
  424. }
  425. })
  426. .catch(function(error) {
  427. })
  428. }).catch(() => {
  429. })
  430. }
  431. }, refundTwo(row) {
  432. var that = this
  433. this.$confirm('是否撤销明细', '撤销明细', {
  434. confirmButtonText: '确 定',
  435. cancelButtonText: '取 消',
  436. type: 'warning'
  437. }).then(() => {
  438. let params = {
  439. 'order_id': row.id,
  440. 'admin_user_id': this.$store.getters.xt_user.user.id
  441. }
  442. axios.get('http://127.0.0.1:9532/zh/api/refunddetail', {
  443. params: params
  444. })
  445. .then(function(response) {
  446. if (response.data.state == 0) {
  447. that.$message.error(response.data.msg)
  448. that.loadingtwo = false
  449. return false
  450. } else {
  451. if (response.data.data.failed_csuode == -10) {
  452. // that.$message.error(response.data.data.msg)
  453. that.$confirm(response.data.data.msg, '医保错误信息', {
  454. confirmButtonText: '确 定',
  455. type: 'warning'
  456. }).then(() => {
  457. }).catch(() => {
  458. })
  459. } else {
  460. that.$message.success('撤销明细成功')
  461. that.changeRadioAndPatient(1)
  462. }
  463. }
  464. })
  465. .catch(function(error) {
  466. })
  467. }).catch(() => {
  468. })
  469. },
  470. uploadInfo(row) {
  471. var that = this
  472. axios.get('http://127.0.0.1:9532/api/settlelisthosptial/get', {
  473. params: {
  474. order_id: row.id,
  475. admin_user_id: this.$store.getters.xt_user.user.id
  476. }
  477. }).then(function(response) {
  478. if (response.data.state == 0) {
  479. that.$message.error(response.data.msg)
  480. return false
  481. } else {
  482. if (response.data.data.failed_code == -10) {
  483. // that.$message.error(response.data.data.msg)
  484. that.$confirm(response.data.data.msg, '医保错误信息', {
  485. confirmButtonText: '确 定',
  486. type: 'warning'
  487. }).then(() => {
  488. }).catch(() => {
  489. })
  490. } else {
  491. that.$message.success('上传成功')
  492. row.result.id = response.data.data.result.id
  493. }
  494. }
  495. }).catch(function(error) {
  496. })
  497. },
  498. fetchAllAdminUsers() {
  499. fetchAllAdminUsers().then(response => {
  500. if (response.data.state == 1) {
  501. this.adminUserOptions = response.data.data.users
  502. }
  503. })
  504. },
  505. getName(admin_user_id) {
  506. for (let i = 0; i < this.adminUserOptions.length; i++) {
  507. if (this.adminUserOptions[i].id == admin_user_id) {
  508. return this.adminUserOptions[i].name
  509. }
  510. }
  511. }, toRefund(row) {
  512. console.log("~~~~~~~")
  513. if (row.his_hospital_patient.balance_accounts_type != 2) {
  514. var that = this
  515. this.$confirm('是否退费', '退费', {
  516. confirmButtonText: '确 定',
  517. cancelButtonText: '取 消',
  518. type: 'warning'
  519. }).then(() => {
  520. let params = {
  521. 'order_id': row.id,
  522. 'admin_user_id': this.$store.getters.xt_user.user.id
  523. }
  524. axios.get('http://127.0.0.1:9532/zh/api/refund', {
  525. params: params
  526. })
  527. .then(function(response) {
  528. if (response.data.state == 0) {
  529. that.$message.error(response.data.msg)
  530. return false
  531. } else {
  532. if (response.data.data.failed_code == -10) {
  533. that.$confirm(response.data.data.msg, '医保错误信息', {
  534. confirmButtonText: '确 定',
  535. type: 'warning'
  536. }).then(() => {
  537. }).catch(() => {
  538. })
  539. } else {
  540. that.$message({ message: '退费成功', type: 'success', duration: 5000 })
  541. that.getHisOrderList()
  542. }
  543. }
  544. })
  545. .catch(function(error) {
  546. })
  547. }).catch(() => {
  548. })
  549. } else {
  550. this.$confirm('是否退费', '退费', {
  551. confirmButtonText: '确 定',
  552. cancelButtonText: '取 消',
  553. type: 'warning'
  554. }).then(() => {
  555. let params = {
  556. 'order_id': row.id,
  557. }
  558. HopitalunRefund(params).then(response => {
  559. if (response.data.state == 0) {
  560. this.$message.error(response.data.msg)
  561. return false
  562. } else {
  563. this.$message({ message: '退费成功', type: 'success' })
  564. this.getHisOrderList()
  565. }
  566. })
  567. }).catch(() => {
  568. })
  569. }
  570. },
  571. toPrint(row) {
  572. console.log(row)
  573. if (this.$store.getters.xt_user.org_id == 9504 || this.$store.getters.xt_user.org_id == 10028 || (row.order_status == 2 && this.$store.getters.xt_user.org_id == 10138) || (row.order_status == 2 && this.$store.getters.xt_user.org_id == 10278)) {
  574. this.statementVisible9504 = true
  575. let obj = {
  576. order_id: row.id,
  577. patient_id: row.patient_id,
  578. record_time: this.getTimes(row.settle_accounts_date),
  579. admin_user_id: this.$store.getters.xt_user.user.id
  580. }
  581. this.orderObj9504 = obj
  582. } else {
  583. this.statementVisible = true
  584. let obj = {
  585. order_id: row.id,
  586. balance_accounts_type: row.his_hospital_patient.balance_accounts_type,
  587. start_time: row.settle_start_time,
  588. end_time: row.settle_end_time
  589. }
  590. console.log(obj)
  591. this.orderObj = obj
  592. console.log(this.orderObj)
  593. }
  594. },
  595. settlementPrint() {
  596. this.settlementVisible = true
  597. },
  598. export_detail() {
  599. let params = {
  600. start_time: this.start_time,
  601. end_time: this.end_time,
  602. p_type: this.p_type
  603. }
  604. getExportConsumeDetailList(params).then(response => {
  605. if (response.data.state == 0) {
  606. this.$message.error(response.data.msg)
  607. return false
  608. } else {
  609. let list = []
  610. for (let i = 0; i < response.data.data.order.length; i++) {
  611. let order = response.data.data.order[i]
  612. let number = ''
  613. let name = ''
  614. let department = ''
  615. let doctor_name = ''
  616. let balance_accounts = ''
  617. let charge_name = ''
  618. let order_status = ''
  619. if (order.his_hospital_patient != null && order.his_hospital_patient.number.length > 0) {
  620. number = order.his_hospital_patient.number
  621. }
  622. if (order.his_patient != null) {
  623. if (order.his_patient.balance_accounts_type == 1) {
  624. balance_accounts = '自费'
  625. }
  626. if (order.his_patient.balance_accounts_type == 2) {
  627. balance_accounts = '医保'
  628. }
  629. }
  630. if (order.patient != null && order.patient.name.length > 0) {
  631. name = order.patient.name
  632. }
  633. if (order.p_info != null && order.p_info.department != null && order.p_info.department.name.length > 0) {
  634. department = order.p_info.department.name
  635. }
  636. if (order.p_info != null && order.p_info.doctor.length > 0) {
  637. doctor_name = order.p_info.doctor
  638. }
  639. if (order.creator != null) {
  640. charge_name = this.getName(order.creator)
  641. }
  642. if (order.order_status == 1) {
  643. order_status = '待结算'
  644. }
  645. if (order.order_status == 2) {
  646. order_status = '已结算'
  647. }
  648. if (order.order_status == 3) {
  649. order_status = '已退费'
  650. }
  651. let obj = {
  652. '单号': order.number,
  653. '人员编号':order.his_hospital_patient.psn_no,
  654. '身份证号':order.patient.id_card_no,
  655. '患者姓名': name,
  656. '险种':order.insutype,
  657. '医疗类别':order.med_type,
  658. '就诊id': number,
  659. '登记日期': order.his_hospital_patient.in_hosptial_time,
  660. '出院日期': order.his_hospital_patient.out_hosptial_time,
  661. '结算id': order.setl_id,
  662. '结算日期': order.setl_time,
  663. '医疗费总额': order.medfee_sumamt,
  664. '全自费金额':order.fulamt_ownpay_amt ,
  665. '超限价自费金额': order.overlmt_self_pay,
  666. '先行自付金额': order.preselfpay_amt,
  667. '符合政策范围金额': order.inscp_scp_amt,
  668. '实际支付起付线': order.act_pay_dedc,
  669. '基本医疗保险统筹基金支出': order.hifp_pay,
  670. '基本医疗保险统筹基金支付比例': order.pool_prop_selfpay,
  671. '公务员医疗补助基金支出': order.cvlserv_pay,
  672. '企业补充医疗保险基金支出': order.hifes_pay,
  673. '居民大病保险基金支出': order.hifmi_pay,
  674. '职工大额医疗费用补助基金支出': order.hifob_pay,
  675. '医疗救助基金支出': order.maf_pay,
  676. '其他支出': order.oth_pay,
  677. '基金支付总额': order.fund_pay_sumamt,
  678. '个人负担总金额': order.psn_part_amt,
  679. '个人账户支付金额': order.acct_pay,
  680. '个人现金支出': order.psn_cash_pay,
  681. '医院总负担金额': order.hosp_part_amt,
  682. '余额': order.balc,
  683. '个账共济支付金额': order.acct_mulaid_pay,
  684. }
  685. list.push(obj)
  686. }
  687. import('@/vendor/Export2Excel').then(excel => {
  688. const tHeader = ['单号', '人员编号', '身份证号', '患者姓名', '险种', '医疗类别', '就诊id', '登记日期', '出院日期', '结算id', '结算日期', '医疗费总额', '全自费金额', '超限价自费金额', '先行自付金额', '符合政策范围金额', '实际支付起付线', '基本医疗保险统筹基金支出', '基本医疗保险统筹基金支付比例', '公务员医疗补助基金支出', '企业补充医疗保险基金支出', '居民大病保险基金支出', '职工大额医疗费用补助基金支出', '医疗救助基金支出', '其他支出','基金支付总额','个人负担总金额','个人账户支付金额','个人现金支出','医院总负担金额','余额','个账共济支付金额']
  689. const filterVal = ['单号', '人员编号', '身份证号', '患者姓名', '险种', '医疗类别', '就诊id', '登记日期', '出院日期', '结算id', '结算日期', '医疗费总额', '全自费金额', '超限价自费金额', '先行自付金额', '符合政策范围金额', '实际支付起付线', '基本医疗保险统筹基金支出', '基本医疗保险统筹基金支付比例', '公务员医疗补助基金支出', '企业补充医疗保险基金支出', '居民大病保险基金支出', '职工大额医疗费用补助基金支出', '医疗救助基金支出', '其他支出','基金支付总额','个人负担总金额', '个人账户支付金额','个人现金支出','医院总负担金额','余额','个账共济支付金额']
  690. const data = this.formatJson(filterVal, list)
  691. excel.export_json_to_excel({
  692. header: tHeader,
  693. data,
  694. filename: '消费明细'
  695. })
  696. })
  697. }
  698. })
  699. }, formatJson(filterVal, jsonData) {
  700. return jsonData.map(v => filterVal.map(j => v[j]))
  701. },
  702. changeDoctor() {
  703. this.page = 1
  704. this.keywords = ''
  705. this.getHisOrderList()
  706. },
  707. handleSizeChange(limit) {
  708. this.limit = limit
  709. this.getHisOrderList()
  710. }, handleCurrentChange(page) {
  711. this.page = page
  712. this.getHisOrderList()
  713. },
  714. handleStartTimeChange() {
  715. this.page = 1
  716. this.keywords = ''
  717. this.getHisOrderList()
  718. }, handleEndTimeChange() {
  719. this.page = 1
  720. this.keywords = ''
  721. this.getHisOrderList()
  722. },
  723. searchAction() {
  724. this.page = 1
  725. this.getHisOrderList()
  726. },
  727. getTimes(time) {
  728. return uParseTime(time, '{y}-{m}-{d}')
  729. },
  730. toDetail(row) {
  731. this.$router.push('/outpatientCharges/summaryDetail?patient_id=' + row.patient.id + '&number=' + row.number + '&id=' + row.id)
  732. }, getTime(value, temp) {
  733. if (value != undefined) {
  734. return uParseTime(value, temp)
  735. }
  736. return ''
  737. }, getHisOrderList() {
  738. let params = {
  739. page: this.page,
  740. limit: this.limit,
  741. keywords: this.keywords,
  742. start_time: this.start_time,
  743. end_time: this.end_time,
  744. type: this.admin_user_id,
  745. p_type: this.p_type,
  746. sort_type: this.sort_type
  747. }
  748. getHisOrderList(params).then(response => {
  749. if (response.data.state == 0) {
  750. this.$message.error(response.data.msg)
  751. return false
  752. } else {
  753. this.tableData = response.data.data.order
  754. this.total = response.data.data.total
  755. }
  756. })
  757. }, getDoctorList() {
  758. getDoctorList().then(response => {
  759. if (response.data.state == 0) {
  760. this.$message.error(response.data.msg)
  761. return false
  762. } else {
  763. this.doctors = response.data.data.doctors
  764. }
  765. })
  766. },
  767. open(index) {
  768. if (index == 1) {
  769. this.listVisible = true
  770. } else if (index == 2) {
  771. this.allListVisible = true
  772. }
  773. },
  774. invoicePrint(obj) {
  775. let paramsObj = {
  776. order_id: obj.id,
  777. patient_id: obj.patient_id,
  778. name: obj.patient.name,
  779. age: obj.age,
  780. gend: obj.gend,
  781. setl_time: obj.setl_time
  782. }
  783. this.invoiceParams = paramsObj
  784. console.log(this.invoiceParams,'999')
  785. this.invoiceVisible = true
  786. },shouJuPrint(obj){
  787. let paramsObj = {
  788. order_id: obj.id,
  789. patient_id: obj.patient_id,
  790. name: obj.patient.name,
  791. age: obj.age,
  792. gend: obj.gend,
  793. setl_time: obj.setl_time
  794. }
  795. this.invoiceParams = paramsObj
  796. this.shouJuVisible = true
  797. }
  798. }, created() {
  799. this.fetchAllAdminUsers()
  800. this.getDoctorList()
  801. this.getHisOrderList()
  802. }
  803. }
  804. </script>