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

settle.vue 29KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717
  1. <template>
  2. <div>
  3. <div style="display: flex;justify-content: space-between;margin-bottom:10px;">
  4. <div>
  5. <!--<el-button size="small" style="margin-left:10px;" class="filter-item" type="primary"-->
  6. <!--@click="Action">-->
  7. <!--导出-->
  8. <!--</el-button>-->
  9. <el-input size="small" style="width:150px;" v-model="keywords" @input="searchAction"
  10. @keyup.enter.native='searchAction'
  11. placeholder="请输入患者姓名"
  12. class="filter-item"/>
  13. <el-select size="small" v-model="item_type" placeholder="请选择"
  14. style="width:150px;margin-left:10px;" @change="changeItem">
  15. <el-option
  16. label="全部"
  17. value="0">
  18. </el-option>
  19. <el-option
  20. v-for="item,index in items"
  21. :key="index"
  22. :label="item.name"
  23. :value="item.id">
  24. </el-option>
  25. </el-select>
  26. <el-date-picker
  27. v-model="chargeDate"
  28. type="daterange"
  29. value-format="yyyy-MM-dd"
  30. range-separator="至"
  31. start-placeholder="开始日期"
  32. @change="changeDate"
  33. end-placeholder="结束日期">
  34. </el-date-picker>
  35. <!--<el-radio v-model="radio" label="1">明细</el-radio>-->
  36. <!--<el-radio v-model="radio" label="2">汇总</el-radio>-->
  37. </div>
  38. <div>
  39. <!-- <el-popover
  40. placement="bottom"
  41. width="210"
  42. trigger="click">
  43. <el-button size="small" ref="button_two" @click="open(1)">打印清单</el-button>
  44. <el-button size="small" ref="button_six" @click="open(2)">打印汇总</el-button>
  45. <el-button slot="reference" style="margin:0 10px;" type="primary" size="small">打印</el-button>
  46. </el-popover> -->
  47. <el-button size="small" type="primary" @click="export_detail">报表下载</el-button>
  48. </div>
  49. </div>
  50. <el-table :data="tableData" border :row-style="{ color: '#303133' }"
  51. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  52. show-summary
  53. v-loading="settle_loading"
  54. max-height="600"
  55. :span-method="merge"
  56. :summary-method="getTotal"
  57. highlight-current-row>
  58. <el-table-column align="center" prop="name" label="患者名字">
  59. <template slot-scope="scope">{{ scope.row.other_name }}</template>
  60. </el-table-column>
  61. <el-table-column align="center" prop="item_name" label="身份证">
  62. <template slot-scope="scope">
  63. {{scope.row.id_card_no}}
  64. </template>
  65. </el-table-column>
  66. <el-table-column align="center" prop="item_name" label="就诊号">
  67. <template slot-scope="scope">
  68. {{scope.row.mdtrt_id}}
  69. </template>
  70. </el-table-column>
  71. <el-table-column align="center" prop="item_name" label="治疗日期">
  72. <template slot-scope="scope">
  73. {{getTimes(scope.row.settle_accounts_date)}}
  74. </template>
  75. </el-table-column>
  76. <el-table-column align="center" prop="item_name" label="结算日期">
  77. <template slot-scope="scope">
  78. {{scope.row.setl_time?scope.row.setl_time.split(" ")[0]:getTimes(scope.row.settle_accounts_date)}}
  79. </template>
  80. </el-table-column>
  81. <el-table-column align="center" prop="item_name" label="结算类型">
  82. <template slot-scope="scope">
  83. <div v-if="scope.row.is_medicine_insurance == 0">自费</div>
  84. <div v-if="scope.row.is_medicine_insurance == 1">医保</div>
  85. </template>
  86. </el-table-column>
  87. <el-table-column align="center" prop="item_name" label="处方类型">
  88. <template slot-scope="scope">
  89. <div v-if="scope.row.med_type == '14'">门诊特殊病</div>
  90. <div v-if="scope.row.med_type == '11'">普通门诊</div>
  91. <div v-if="scope.row.med_type == '1112'">普通门诊</div>
  92. </template>
  93. </el-table-column>
  94. <el-table-column align="center" prop="medfee_sumamt" label="医疗费总额">
  95. <template slot-scope="scope">{{scope.row.medfee_sumamt.toFixed(2)}}</template>
  96. </el-table-column>
  97. <el-table-column align="center" prop="fund_pay_sumamt" label="基金支付金额">
  98. <template slot-scope="scope">{{scope.row.fund_pay_sumamt.toFixed(2)}}</template>
  99. </el-table-column>
  100. <el-table-column align="center" prop="acct_pay" label="个人账户支付金额">
  101. <template slot-scope="scope">{{scope.row.acct_pay.toFixed(2)}}</template>
  102. </el-table-column>
  103. <el-table-column align="center" prop="psn_cash_pay" label="个人支付金额">
  104. <template slot-scope="scope">{{scope.row.psn_cash_pay.toFixed(2)}}</template>
  105. </el-table-column>
  106. <el-table-column align="center" prop="hifp_pay" label="基金统筹金额">
  107. <template slot-scope="scope">{{scope.row.hifp_pay.toFixed(2)}}</template>
  108. </el-table-column>
  109. <el-table-column align="center" prop="hifob_pay" label="大额基金支付">
  110. <template slot-scope="scope">{{scope.row.hifob_pay.toFixed(2)}}</template>
  111. </el-table-column>
  112. <el-table-column align="center" prop="maf_pay" label="医疗救助基金">
  113. <template slot-scope="scope">{{scope.row.maf_pay.toFixed(2)}}</template>
  114. </el-table-column>
  115. <el-table-column align="center" prop="hifes_pay" label="企业补充医疗保险基金支出">
  116. <template slot-scope="scope">{{scope.row.hifes_pay.toFixed(2)}}</template>
  117. </el-table-column>
  118. <el-table-column align="center" prop="hifmi_pay" label="居民大病保险资金支出">
  119. <template slot-scope="scope">{{scope.row.hifmi_pay.toFixed(2)}}</template>
  120. </el-table-column>
  121. <el-table-column align="center" prop="oth_pay" label="其他支付">
  122. <template slot-scope="scope">{{scope.row.oth_pay.toFixed(2)}}</template>
  123. </el-table-column>
  124. <el-table-column align="center" prop="cvlserv_pay" label="公务员医疗补助资金支出">
  125. <template slot-scope="scope">{{scope.row.cvlserv_pay.toFixed(2)}}</template>
  126. </el-table-column>
  127. <el-table-column align="center" prop="wechat_pay" label="发票号码">
  128. <template slot-scope="scope" style="width: 100px">
  129. <el-input v-model="scope.row.fa_piao_number" oninput="value=value.replace(/[^0-9.]/g,'')"></el-input>
  130. <el-button size="small" @click="change(scope.row.id,scope.row.fa_piao_number,'fa_piao_number')">修改</el-button>
  131. </template>
  132. </el-table-column>
  133. <el-table-column align="center" prop="wechat_pay" label="发票编号">
  134. <template slot-scope="scope" style="width: 100px">
  135. <el-input v-model="scope.row.fa_piao_code" oninput="value=value.replace(/[^0-9.]/g,'')"></el-input>
  136. <el-button size="small" @click="change(scope.row.id,scope.row.fa_piao_code,'fa_piao_code')">修改</el-button>
  137. </template>
  138. </el-table-column>
  139. <el-table-column align="center" prop="wechat_pay" label="微信支付">
  140. <template slot-scope="scope" style="width: 100px">
  141. <el-input v-model="scope.row.wechat_pay" oninput="value=value.replace(/[^0-9.]/g,'')"></el-input>
  142. <el-button size="small" @click="change(scope.row.id,scope.row.wechat_pay,'wechat_pay')">修改</el-button>
  143. </template>
  144. </el-table-column>
  145. <el-table-column align="center" prop="ali_pay" label="支付宝支付">
  146. <!-- <template slot-scope="scope">{{scope.row.ali_pay}}</template>-->
  147. <template slot-scope="scope" style="width: 100px">
  148. <el-input v-model="scope.row.ali_pay" oninput="value=value.replace(/[^0-9.]/g,'')"></el-input>
  149. <el-button size="small" @click="change(scope.row.id,scope.row.ali_pay,'ali_pay')">修改</el-button>
  150. </template>
  151. </el-table-column>
  152. <el-table-column align="center" prop="band_card_pay" label="银行卡支付">
  153. <!-- <template slot-scope="scope">{{scope.row.band_card_pay}}</template>-->
  154. <template slot-scope="scope" style="width: 100px">
  155. <el-input v-model="scope.row.band_card_pay" oninput="value=value.replace(/[^0-9.]/g,'')"></el-input>
  156. <el-button size="small" @click="change(scope.row.id,scope.row.band_card_pay,'band_card_pay')">修改</el-button>
  157. </template>
  158. </el-table-column>
  159. <el-table-column align="center" prop="jifen_pay" label="积分支付">
  160. <!-- <template slot-scope="scope">{{scope.row.jifen_pay}}</template>-->
  161. <template slot-scope="scope" style="width: 100px">
  162. <el-input v-model="scope.row.jifen_pay" oninput="value=value.replace(/[^0-9.]/g,'')"></el-input>
  163. <el-button size="small" @click="change(scope.row.id,scope.row.jifen_pay,'jifen_pay')">修改</el-button>
  164. </template>
  165. </el-table-column>
  166. <el-table-column align="center" prop="cash_pay" label="现金支付">
  167. <!-- <template slot-scope="scope">{{scope.row.cash_pay}}</template>-->
  168. <template slot-scope="scope" style="width: 100px">
  169. <el-input v-model="scope.row.cash_pay" oninput="value=value.replace(/[^0-9.]/g,'')"></el-input>
  170. <el-button size="small" @click="change(scope.row.id,scope.row.cash_pay,'cash_pay')">修改</el-button>
  171. </template>
  172. </el-table-column>
  173. <el-table-column align="center" prop="item_name" label="其他说明">
  174. <!-- <template slot-scope="scope">{{scope.row.oth_desc}}</template>-->
  175. <template slot-scope="scope" style="width: 100px">
  176. <el-input v-model="scope.row.oth_desc"></el-input>
  177. <el-button size="small" @click="change(scope.row.id,scope.row.oth_desc,'oth_desc')">修改</el-button>
  178. </template>
  179. </el-table-column>
  180. <el-table-column align="center" prop="total" label="费用总额">
  181. <template slot-scope="scope">
  182. <div>{{scope.row.total.toFixed(2)}}</div>
  183. </template>
  184. </el-table-column>
  185. </el-table>
  186. <el-table ref="report-table" :data="tableData" v-show="false" border :row-style="{ color: '#303133' }"
  187. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  188. show-summary
  189. v-loading="settle_loading"
  190. max-height="600"
  191. :span-method="merge"
  192. :summary-method="getTotal"
  193. highlight-current-row>
  194. <el-table-column align="center" prop="name" label="患者名字">
  195. <template slot-scope="scope">{{ scope.row.other_name }}</template>
  196. </el-table-column>
  197. <el-table-column align="center" prop="item_name" label="身份证">
  198. <template slot-scope="scope">
  199. {{scope.row.id_card_no}}
  200. </template>
  201. </el-table-column>
  202. <el-table-column align="center" prop="item_name" label="就诊号">
  203. <template slot-scope="scope">
  204. {{scope.row.mdtrt_id}}
  205. </template>
  206. </el-table-column>
  207. <el-table-column align="center" prop="item_name" label="治疗日期">
  208. <template slot-scope="scope">
  209. {{getTimes(scope.row.settle_accounts_date)}}
  210. </template>
  211. </el-table-column>
  212. <el-table-column align="center" prop="item_name" label="结算日期">
  213. <template slot-scope="scope">
  214. {{scope.row.setl_time?scope.row.setl_time.split(" ")[0]:getTimes(scope.row.settle_accounts_date)}}
  215. </template>
  216. </el-table-column>
  217. <el-table-column align="center" prop="item_name" label="结算类型">
  218. <template slot-scope="scope">
  219. <div v-if="scope.row.is_medicine_insurance == 0">自费</div>
  220. <div v-if="scope.row.is_medicine_insurance == 1">医保</div>
  221. </template>
  222. </el-table-column>
  223. <el-table-column align="center" prop="item_name" label="处方类型">
  224. <template slot-scope="scope">
  225. <div v-if="scope.row.med_type == '14'">门诊特殊病</div>
  226. <div v-if="scope.row.med_type == '11'">普通门诊</div>
  227. <div v-if="scope.row.med_type == '1112'">普通门诊</div>
  228. </template>
  229. </el-table-column>
  230. <el-table-column align="center" prop="medfee_sumamt" label="医疗费总额">
  231. <template slot-scope="scope">{{scope.row.medfee_sumamt.toFixed(2)}}</template>
  232. </el-table-column>
  233. <el-table-column align="center" prop="fund_pay_sumamt" label="基金支付金额">
  234. <template slot-scope="scope">{{scope.row.fund_pay_sumamt.toFixed(2)}}</template>
  235. </el-table-column>
  236. <el-table-column align="center" prop="acct_pay" label="个人账户支付金额">
  237. <template slot-scope="scope">{{scope.row.acct_pay.toFixed(2)}}</template>
  238. </el-table-column>
  239. <el-table-column align="center" prop="psn_cash_pay" label="个人支付金额">
  240. <template slot-scope="scope">{{scope.row.psn_cash_pay.toFixed(2)}}</template>
  241. </el-table-column>
  242. <el-table-column align="center" prop="hifp_pay" label="基金统筹金额">
  243. <template slot-scope="scope">{{scope.row.hifp_pay.toFixed(2)}}</template>
  244. </el-table-column>
  245. <el-table-column align="center" prop="hifob_pay" label="大额基金支付">
  246. <template slot-scope="scope">{{scope.row.hifob_pay.toFixed(2)}}</template>
  247. </el-table-column>
  248. <el-table-column align="center" prop="maf_pay" label="医疗救助基金">
  249. <template slot-scope="scope">{{scope.row.maf_pay.toFixed(2)}}</template>
  250. </el-table-column>
  251. <el-table-column align="center" prop="hifes_pay" label="企业补充医疗保险基金支出">
  252. <template slot-scope="scope">{{scope.row.hifes_pay.toFixed(2)}}</template>
  253. </el-table-column>
  254. <el-table-column align="center" prop="hifmi_pay" label="居民大病保险资金支出">
  255. <template slot-scope="scope">{{scope.row.hifmi_pay.toFixed(2)}}</template>
  256. </el-table-column>
  257. <el-table-column align="center" prop="oth_pay" label="其他支付">
  258. <template slot-scope="scope">{{scope.row.oth_pay.toFixed(2)}}</template>
  259. </el-table-column>
  260. <el-table-column align="center" prop="cvlserv_pay" label="公务员医疗补助资金支出">
  261. <template slot-scope="scope">{{scope.row.cvlserv_pay.toFixed(2)}}</template>
  262. </el-table-column>
  263. <el-table-column align="center" prop="wechat_pay" label="发票号码">
  264. <template slot-scope="scope">{{scope.row.fa_piao_number}}</template>
  265. </el-table-column>
  266. <el-table-column align="center" prop="wechat_pay" label="发票编号">
  267. <template slot-scope="scope">{{scope.row.fa_piao_code}}</template>
  268. </el-table-column>
  269. <el-table-column align="center" prop="wechat_pay" label="微信支付">
  270. <template slot-scope="scope">{{scope.row.wechat_pay}}</template>
  271. <!-- <template slot-scope="scope" style="width: 100px">-->
  272. <!-- <el-input v-model="scope.row.wechat_pay" oninput="value=value.replace(/[^0-9.]/g,'')"></el-input>-->
  273. <!-- </template>-->
  274. </el-table-column>
  275. <el-table-column align="center" prop="ali_pay" label="支付宝支付">
  276. <template slot-scope="scope">{{scope.row.ali_pay}}</template>
  277. <!-- <template slot-scope="scope" style="width: 100px">-->
  278. <!-- <el-input v-model="scope.row.ali_pay" oninput="value=value.replace(/[^0-9.]/g,'')"></el-input>-->
  279. <!-- </template>-->
  280. </el-table-column>
  281. <el-table-column align="center" prop="band_card_pay" label="银行卡支付">
  282. <template slot-scope="scope">{{scope.row.band_card_pay}}</template>
  283. <!-- <template slot-scope="scope" style="width: 100px">-->
  284. <!-- <el-input v-model="scope.row.band_card_pay" oninput="value=value.replace(/[^0-9.]/g,'')"></el-input>-->
  285. <!-- </template>-->
  286. </el-table-column>
  287. <el-table-column align="center" prop="jifen_pay" label="积分支付">
  288. <template slot-scope="scope">{{scope.row.jifen_pay}}</template>
  289. <!-- <template slot-scope="scope" style="width: 100px">-->
  290. <!-- <el-input v-model="scope.row.jifen_pay" oninput="value=value.replace(/[^0-9.]/g,'')"></el-input>-->
  291. <!-- </template>-->
  292. </el-table-column>
  293. <el-table-column align="center" prop="cash_pay" label="现金支付">
  294. <template slot-scope="scope">{{scope.row.cash_pay}}</template>
  295. <!-- <template slot-scope="scope" style="width: 100px">-->
  296. <!-- <el-input v-model="scope.row.cash_pay" oninput="value=value.replace(/[^0-9.]/g,'')"></el-input>-->
  297. <!-- </template>-->
  298. </el-table-column>
  299. <el-table-column align="center" prop="item_name" label="其他说明">
  300. <template slot-scope="scope">{{scope.row.oth_desc}}</template>
  301. <!-- <template slot-scope="scope" style="width: 100px">-->
  302. <!-- <el-input v-model="scope.row.oth_desc"></el-input>-->
  303. <!-- </template>-->
  304. </el-table-column>
  305. <el-table-column align="center" prop="total" label="费用总额">
  306. <template slot-scope="scope">
  307. <div>{{scope.row.total.toFixed(2)}}</div>
  308. </template>
  309. </el-table-column>
  310. </el-table>
  311. </div>
  312. </template>
  313. <script>
  314. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  315. import { GetSummarySettle,changeOrderDesc } from '@/api/his/his'
  316. import { uParseTime } from '@/utils/tools'
  317. // import NewStatementPrint from './newStatementPrint'
  318. const moment = require('moment')
  319. export default {
  320. components: {
  321. BreadCrumb
  322. },
  323. data() {
  324. return {
  325. settle_loading:false,
  326. crumbs: [],
  327. tempArr: [],
  328. sameRowArr: [],
  329. tableData: [],
  330. chargeDate: [moment(new Date()).add('year', 0).format('YYYY-MM-DD'), moment(new Date()).add('year', 0).format('YYYY-MM-DD')],
  331. item_type: '0',
  332. items: [
  333. { id: 1, name: '医保' },
  334. { id: 2, name: '自费' },
  335. { id: 3, name: '门诊特殊病' },
  336. { id: 4, name: '普通门诊' },
  337. { id: 5, name: '城乡居民基本医疗保险' },
  338. { id: 6, name: '职工基本医疗保险' }
  339. ]
  340. }
  341. },
  342. methods: {
  343. change(id,desc,type){
  344. let params = {
  345. id: id,
  346. desc: desc,
  347. change_type: type
  348. }
  349. changeOrderDesc(params).then(response => {
  350. if (response.data.state == 0) {
  351. this.$message.error(response.data.msg)
  352. } else {
  353. this.$message.success(response.data.data.msg)
  354. }
  355. })
  356. },
  357. getTimes(time) {
  358. return uParseTime(time, '{y}-{m}-{d}')
  359. },
  360. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  361. if (columnIndex === 0) {
  362. if (rowIndex % 2 === 0) {
  363. return {
  364. rowspan: 2,
  365. colspan: 1
  366. }
  367. } else {
  368. return {
  369. rowspan: 0,
  370. colspan: 0
  371. }
  372. }
  373. }
  374. },
  375. unique(arr) {
  376. const res = new Map()
  377. return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1))
  378. },
  379. changeDate() {
  380. // console.log(this.chargeDate)
  381. this.getSummarySettleList()
  382. },
  383. changeItem() {
  384. this.getSummarySettleList()
  385. },
  386. searchAction() {
  387. this.item_type = '0'
  388. this.getSummarySettleList()
  389. },
  390. getSummarySettleList() {
  391. let start_time = this.chargeDate[0]
  392. let end_time = this.chargeDate[1]
  393. let params = {
  394. start_time: start_time,
  395. end_time: end_time,
  396. type: this.item_type,
  397. keyword: this.keywords
  398. }
  399. this.settle_loading = true
  400. GetSummarySettle(params).then(response => {
  401. if (response.data.state == 0) {
  402. this.settle_loading = false
  403. this.$message.error(response.data.msg)
  404. return false
  405. } else {
  406. this.settle_loading = false
  407. this.tableData = []
  408. let data = response.data.data.patients
  409. for (let i = 0; i < data.length; i++) {
  410. let total = 0
  411. for (let b = 0; b < data[i].orders.length; b++) {
  412. let order = data[i].orders[b]
  413. order['other_name'] = data[i].name
  414. order['id'] = order.id
  415. order['id_card_no'] = data[i].id_card_no
  416. order['mdtrt_id'] =order.mdtrt_id
  417. total = parseFloat((parseFloat(total.toString()) + parseFloat(data[i].orders[b].medfee_sumamt.toString())).toFixed(2).toString())
  418. }
  419. data[i]['total'] = total
  420. }
  421. console.log(data)
  422. for (let i = 0; i < data.length; i++) {
  423. for (let b = 0; b < data[i].orders.length; b++) {
  424. let order = data[i].orders[b]
  425. if(b == 0){
  426. order['total'] = data[i].total
  427. }else{
  428. order['total'] = 0
  429. }
  430. this.tableData.push(order)
  431. }
  432. }
  433. console.log(this.tableData)
  434. this.handleSpanTempArr()
  435. }
  436. })
  437. }, uniqueProjectAndAdvice(array) {
  438. // res用来存储结果
  439. var res = []
  440. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  441. for (var j = 0, resLen = res.length; j < resLen; j++) {
  442. if (array[i].item_id === res[j].item_id && array[i].price === res[j].price) {
  443. break
  444. }
  445. }
  446. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  447. if (j === resLen) {
  448. res.push(array[i])
  449. }
  450. }
  451. return res
  452. }, sort(arr) {
  453. for (var i = 0; i < arr.length - 1; i++) {
  454. for (var j = 0; j < arr.length - i - 1; j++) {
  455. if (arr[j].patient_id > arr[j + 1].patient_id) {// 相邻元素两两对比
  456. var hand = arr[j]
  457. arr[j] = arr[j + 1]
  458. arr[j + 1] = hand
  459. }
  460. }
  461. }
  462. return arr
  463. }, handleSpanTempArr() {
  464. this.tempArr = []
  465. for (let i = 0; i < this.tableData.length; i++) {
  466. if (i === 0) {
  467. this.tempArr.push(1)
  468. this.pos = 0
  469. } else {
  470. // 判断当前元素与上一个元素是否相同
  471. if (this.tableData[i].patient_id === this.tableData[i - 1].patient_id) {
  472. this.tempArr[this.pos] += 1
  473. this.tempArr.push(0)
  474. } else {
  475. this.tempArr.push(1)
  476. this.pos = i
  477. }
  478. }
  479. }
  480. let sameRowArr = [], sIdx = 0
  481. this.tableData.forEach((item, index) => {
  482. item.index = index
  483. if (index === 0) {
  484. sameRowArr.push([index])
  485. } else {
  486. if (item.patient_id === this.tableData[index - 1].patient_id) {
  487. sameRowArr[sIdx].push(index)
  488. } else {
  489. sIdx = sIdx + 1
  490. sameRowArr.push([index])
  491. }
  492. }
  493. })
  494. this.sameRowArr = sameRowArr
  495. }, merge({ row, column, rowIndex, columnIndex }) {
  496. if (columnIndex === 0 || columnIndex === 1) {
  497. const _row = this.tempArr[rowIndex]
  498. const _col = _row > 0 ? 1 : 0
  499. return {
  500. rowspan: _row,
  501. colspan: _col
  502. }
  503. }
  504. },
  505. getTotal(param) {
  506. const { columns, data } = param
  507. const sums = []
  508. columns.forEach((column, index) => {
  509. if (index === 0) {
  510. sums[index] = '合计'
  511. return
  512. }
  513. console.log(data)
  514. const values = data.map(item => Number(item[column.property]))
  515. if (column.property === 'total' || column.property === 'medfee_sumamt' || column.property === 'fund_pay_sumamt' || column.property === 'acct_pay' || column.property === 'maf_pay' || column.property === 'psn_cash_pay' || column.property === 'hifp_pay' || column.property === 'hifob_pay' || column.property === 'hifes_pay' || column.property === 'hifmi_pay' || column.property === 'oth_pay' || column.property === 'cvlserv_pay' || column.property === 'wechat_pay' || column.property === 'ali_pay' || column.property === 'band_card_pay' || column.property === 'jifen_pay' || column.property === 'cash_pay') {
  516. sums[index] = values.reduce((prev, curr) => {
  517. const value = Number(curr)
  518. if (!isNaN(value)) {
  519. return prev + curr
  520. } else {
  521. return prev
  522. }
  523. }, 0)
  524. sums[index] = sums[index].toFixed(2)
  525. } else {
  526. sums[index] = ''
  527. }
  528. })
  529. return sums
  530. },
  531. export_detail() {
  532. console.log("~~~~~~~")
  533. let list = []
  534. // for (let i = 0; i < this.tableData.length; i++) {
  535. // let order = this.tableData[i]
  536. // let name = order.other_name
  537. // let id_card_no = order.id_card_no
  538. //
  539. // let time = ''
  540. // let balance_accounts = ""
  541. // let med_type = ""
  542. // let medfee_sumamt = ""
  543. // let fund_pay_sumamt = ""
  544. // let acct_pay = ""
  545. // let psn_cash_pay = ""
  546. // let hifes_pay = ""
  547. // let hifmi_pay = ""
  548. // let hifp_pay = ""
  549. // let hifob_pay = ""
  550. // let maf_pay = ""
  551. // let time2 = ""
  552. // time2 = this.getTimes(order.settle_accounts_date)
  553. //
  554. // let total = ""
  555. //
  556. // if(order.setl_time.length == 0){
  557. //
  558. // time = this.getTimes(order.settle_accounts_date)
  559. //
  560. // }else {
  561. //
  562. // time = order.setl_time.split(" ")[0]
  563. //
  564. // }
  565. //
  566. // if (order.is_medicine_insurance == 0) {
  567. // balance_accounts = '自费'
  568. // }
  569. //
  570. // if (order.is_medicine_insurance == 1) {
  571. // balance_accounts = '医保'
  572. // }
  573. //
  574. // if (order.med_type == '14') {
  575. // med_type = '门诊特殊病'
  576. // }
  577. //
  578. // if (order.med_type == '11') {
  579. // med_type = '普通门诊'
  580. // }
  581. //
  582. // medfee_sumamt = order.medfee_sumamt
  583. // fund_pay_sumamt = order.fund_pay_sumamt
  584. //
  585. // acct_pay = order.acct_pay
  586. //
  587. // psn_cash_pay = order.psn_cash_pay
  588. // hifes_pay = order.hifes_pay
  589. // hifmi_pay = order.hifmi_pay
  590. // hifp_pay = order.hifp_pay
  591. // hifob_pay = order.hifob_pay
  592. // maf_pay = order.maf_pay
  593. // total = order.total
  594. //
  595. //
  596. // let obj = {
  597. // '患者姓名': name,
  598. // '身份证': id_card_no,
  599. // '治疗日期': time2,
  600. // '结算日期': time,
  601. // '结算类型': balance_accounts,
  602. // '处方类型': med_type,
  603. // '医疗费总额': medfee_sumamt,
  604. // '基金支付金额': fund_pay_sumamt,
  605. // '基金统筹金额': hifp_pay,
  606. // '大额基金支付':hifob_pay,
  607. // '医疗救助基金':maf_pay,
  608. // '个人账户支付金额': acct_pay,
  609. // '个人支付基金': psn_cash_pay,
  610. // '企业补充医疗保险基金支出': hifes_pay,
  611. // '居民大病保险资金支出': hifmi_pay,
  612. // '费用总额':total,
  613. //
  614. // }
  615. // list.push(obj)
  616. // }
  617. import('@/vendor/Export2Excel').then(excel => {
  618. const tHeader = [ '患者姓名','身份证', '治疗日期','结算日期', '结算类型', '处方类型', '医疗费总额', '基金支付金额', '个人账户支付金额', '个人支付基金','企业补充医疗保险基金支出','居民大病保险资金支出', '费用总额']
  619. const filterVal = [ '患者姓名','身份证', '治疗日期','结算日期', '结算类型', '处方类型', '医疗费总额', '基金支付金额', '个人账户支付金额', '个人支付基金','企业补充医疗保险基金支出','居民大病保险资金支出', '费用总额']
  620. const data = this.formatJson(filterVal, list)
  621. excel.export_json_to_excel1({
  622. header: tHeader,
  623. data,
  624. filename: '结算明细',
  625. ref:this.$refs['report-table'].$el
  626. })
  627. })
  628. }, formatJson(filterVal, jsonData) {
  629. return jsonData.map(v => filterVal.map(j => v[j]))
  630. }
  631. },
  632. created() {
  633. this.getSummarySettleList()
  634. }
  635. }
  636. </script>