settle.vue 30KB

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