123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479 |
- <template>
- <div class="main-contain outpatientChargesManagement">
- <div class="position">
- <bread-crumb :crumbs='crumbs'></bread-crumb>
- </div>
- <div class="app-container">
- <div style="display: flex;justify-content: space-between;margin-bottom:10px;">
- <div>
- <!--<el-button size="small" style="margin-left:10px;" class="filter-item" type="primary"-->
- <!--@click="Action">-->
- <!--导出-->
- <!--</el-button>-->
- <el-input size="small" style="width:150px;" v-model="keywords" @input="searchAction"
- @keyup.enter.native='searchAction'
- class="filter-item"/>
- <el-select size="small" v-model="item_type" placeholder="请选择"
- style="width:150px;margin-left:10px;" @change="changeItem">
- <el-option
- label="全部"
- value="0">
- </el-option>
- <el-option
- v-for="item,index in items"
- :key="index"
- :label="item.name"
- :value="item.id">
- </el-option>
- </el-select>
- <el-date-picker
- v-model="chargeDate"
- type="daterange"
- value-format="yyyy-MM-dd"
- range-separator="至"
- start-placeholder="开始日期"
- @change="changeDate"
- end-placeholder="结束日期">
- </el-date-picker>
- <!--<el-radio v-model="radio" label="1">明细</el-radio>-->
- <!--<el-radio v-model="radio" label="2">汇总</el-radio>-->
- </div>
- <div>
- <!-- <el-popover
- placement="bottom"
- width="210"
- trigger="click">
- <el-button size="small" ref="button_two" @click="open(1)">打印清单</el-button>
- <el-button size="small" ref="button_six" @click="open(2)">打印汇总</el-button>
- <el-button slot="reference" style="margin:0 10px;" type="primary" size="small">打印</el-button>
-
- </el-popover> -->
- <el-button size="small" type="primary" @click="export_detail">报表下载</el-button>
- </div>
- </div>
- <el-table :data="tableData" border :row-style="{ color: '#303133' }"
- :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
- show-summary
- max-height="600"
- :span-method="merge"
- :summary-method="getTotal"
- highlight-current-row>
-
- <el-table-column align="center" prop="name" label="患者名字">
- <template slot-scope="scope">{{ scope.row.other_name }}</template>
- </el-table-column>
- <el-table-column align="center" prop="item_name" label="结算日期">
- <template slot-scope="scope">
- {{scope.row.setl_time?scope.row.setl_time:getTimes(scope.row.settle_accounts_date)}}
- </template>
- </el-table-column>
-
- <el-table-column align="center" prop="item_name" label="结算类型">
- <template slot-scope="scope">
- <div v-if="scope.row.is_medicine_insurance == 0">自费</div>
- <div v-if="scope.row.is_medicine_insurance == 1">医保</div>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="item_name" label="处方类型">
- <template slot-scope="scope">
- <div v-if="scope.row.med_type == '14'">门诊特殊病</div>
- <div v-if="scope.row.med_type == '11'">普通门诊</div>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="item_name" label="医疗费总额">
- <template slot-scope="scope">{{scope.row.medfee_sumamt}}</template>
- </el-table-column>
- <el-table-column align="center" prop="item_name" label="基金支付金额">
- <template slot-scope="scope">{{scope.row.fund_pay_sumamt}}</template>
- </el-table-column>
- <el-table-column align="center" prop="item_name" label="个人账户支付金额">
- <template slot-scope="scope">{{scope.row.acct_pay}}</template>
- </el-table-column>
- <el-table-column align="center" prop="item_name" label="个人支付金额">
- <template slot-scope="scope">{{scope.row.psn_cash_pay}}</template>
- </el-table-column>
- <el-table-column align="center" prop="total" label="费用总额">
- <template slot-scope="scope">
- <div>{{scope.row.total.toFixed(2)}}</div>
- </template>
- </el-table-column>
-
- </el-table>
- </div>
-
- </div>
- </template>
-
-
- <script>
- import BreadCrumb from '@/xt_pages/components/bread-crumb'
- import { GetSummarySettle } from '@/api/his/his'
- import { uParseTime } from '@/utils/tools'
- // import NewStatementPrint from './newStatementPrint'
- const moment = require('moment')
- export default {
- components: {
- BreadCrumb
-
- },
- data() {
- return {
- crumbs: [],
- tempArr: [],
- sameRowArr: [],
- tableData: [],
- chargeDate: [moment(new Date()).add('year', 0).format('YYYY-MM-DD'), moment(new Date()).add('year', 0).format('YYYY-MM-DD')],
- item_type: '0',
- items: [
- { id: 1, name: '医保' },
- { id: 2, name: '自费' },
- { id: 3, name: '门诊特殊病' },
- { id: 4, name: '普通门诊' }
-
- ]
-
- }
- },
- methods: {
- getTimes(time) {
- return uParseTime(time, '{y}-{m}-{d}')
- },
- objectSpanMethod({ row, column, rowIndex, columnIndex }) {
- if (columnIndex === 0) {
- if (rowIndex % 2 === 0) {
- return {
- rowspan: 2,
- colspan: 1
- }
- } else {
- return {
- rowspan: 0,
- colspan: 0
- }
- }
- }
- },
- unique(arr) {
- const res = new Map()
- return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1))
- },
- changeDate() {
- // console.log(this.chargeDate)
- this.getSummarySettleList()
- },
- changeItem() {
- this.getSummarySettleList()
-
- },
- searchAction() {
- this.item_type = '0'
- this.getSummarySettleList()
-
- },
- getSummarySettleList() {
- let start_time = this.chargeDate[0]
- let end_time = this.chargeDate[1]
- let params = {
- start_time: start_time,
- end_time: end_time,
- type: this.item_type,
- keyword: this.keywords
- }
- GetSummarySettle(params).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- this.tableData = []
- let data = response.data.data.patients
-
- for (let i = 0; i < data.length; i++) {
- let total = 0
- for (let b = 0; b < data[i].orders.length; b++) {
- let order = data[i].orders[b]
- order['other_name'] = data[i].name
- total = parseFloat((parseFloat(total.toString()) + parseFloat(data[i].orders[b].medfee_sumamt.toString())).toFixed(2).toString())
- }
-
- data[i]['total'] = total
- }
- console.log(data)
-
- for (let i = 0; i < data.length; i++) {
- for (let b = 0; b < data[i].orders.length; b++) {
- let order = data[i].orders[b]
- order['total'] = data[i].total
- this.tableData.push(order)
-
- }
- }
- console.log(this.tableData)
-
- this.handleSpanTempArr()
- }
- })
- }, uniqueProjectAndAdvice(array) {
- // res用来存储结果
- var res = []
- for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
- for (var j = 0, resLen = res.length; j < resLen; j++) {
- if (array[i].item_id === res[j].item_id && array[i].price === res[j].price) {
- break
- }
- }
- // 如果array[i]是唯一的,那么执行完循环,j等于resLen
- if (j === resLen) {
- res.push(array[i])
- }
- }
- return res
- }, sort(arr) {
- for (var i = 0; i < arr.length - 1; i++) {
- for (var j = 0; j < arr.length - i - 1; j++) {
- if (arr[j].patient_id > arr[j + 1].patient_id) {// 相邻元素两两对比
- var hand = arr[j]
- arr[j] = arr[j + 1]
- arr[j + 1] = hand
-
- }
- }
- }
- return arr
- }, handleSpanTempArr() {
- this.tempArr = []
-
- for (let i = 0; i < this.tableData.length; i++) {
- if (i === 0) {
- this.tempArr.push(1)
- this.pos = 0
- } else {
- // 判断当前元素与上一个元素是否相同
- if (this.tableData[i].patient_id === this.tableData[i - 1].patient_id) {
- this.tempArr[this.pos] += 1
- this.tempArr.push(0)
- } else {
- this.tempArr.push(1)
- this.pos = i
- }
- }
- }
-
- let sameRowArr = [], sIdx = 0
- this.tableData.forEach((item, index) => {
- item.index = index
- if (index === 0) {
- sameRowArr.push([index])
- } else {
- if (item.patient_id === this.tableData[index - 1].patient_id) {
- sameRowArr[sIdx].push(index)
- } else {
- sIdx = sIdx + 1
- sameRowArr.push([index])
- }
- }
- })
- this.sameRowArr = sameRowArr
- }, merge({ row, column, rowIndex, columnIndex }) {
- if (columnIndex === 0 || columnIndex === 8) {
- const _row = this.tempArr[rowIndex]
- const _col = _row > 0 ? 1 : 0
- return {
- rowspan: _row,
- colspan: _col
- }
- }
- }, getTotal(param) {
- const { columns, data } = param
- const sums = []
- columns.forEach((column, index) => {
- if (index === 0) {
- sums[index] = '合计'
- return
- }
- const values = data.map(item => Number(item[column.property]))
- if (column.property === 'total') {
- sums[index] = values.reduce((prev, curr) => {
- const value = Number(curr)
- if (!isNaN(value)) {
- return prev + curr
- } else {
- return prev
- }
- }, 0)
- sums[index] = sums[index].toFixed(2)
- } else {
- sums[index] = '--'
- }
- })
-
- return sums
- }, export_detail() {
-
- let list = []
- for (let i = 0; i < this.tableData.length; i++) {
- let order = this.tableData[i]
- let name = ''
- let time = ''
- let balance_accounts = ""
- let med_type = ""
-
- if (order.is_medicine_insurance == 0) {
- balance_accounts = '自费'
- }
-
- if (order.is_medicine_insurance == 1) {
- balance_accounts = '医保'
- }
-
- if (order.med_type == '14') {
- med_type = '门诊特殊病'
- }
-
- if (order.med_type == '11') {
- med_type = '普通门诊'
- }
-
- let number = ''
-
- let department = ''
- let doctor_name = ''
- let order_status = ''
- let charge_name = ''
- let insutypeName = ''
-
-
-
-
-
- if (order.patient != null && order.patient.name.length > 0) {
- name = order.patient.name
-
- }
-
- if (order.p_info != null && order.p_info.department != null && order.p_info.department.name.length > 0) {
- department = order.p_info.department.name
-
- }
-
- if (order.p_info != null && order.p_info.doctor.length > 0) {
- doctor_name = order.p_info.doctor
- }
-
- if (order.creator != null) {
- charge_name = this.getName(order.creator)
- }
- if (order.insutype == '390') {
-
- insutypeName = '城乡居民基本医疗保险'
- } else if (order.insutype == '310') {
- insutypeName = '职工基本医疗保险'
-
- }
-
- if (order.order_status == 1) {
- order_status = '待结算'
- }
-
- if (order.order_status == 2) {
- order_status = '已结算'
- }
-
- if (order.order_status == 3) {
- order_status = '已退费'
- }
-
- if (order.settle_type == 2) {
- time = this.getTimes(order.settle_start_time)
- } else {
- time = this.getTimes(order.settle_accounts_date)
- }
-
- var hifmi_pay = 0.00
-
- if (order.setl_detail.length > 0) {
- var jsonObj = JSON.parse(order.setl_detail)
- for (let i = 0; i < jsonObj.length; i++) {
- if (order.insutype == '310') {
- if (jsonObj[i].fund_pay_type == '310300') {
- hifmi_pay = jsonObj[i].fund_payamt
- }
-
- } else if (order.insutype == '390') {
- if (order.fund_pay_type == '390200') {
- hifmi_pay = jsonObj[i].fund_payamt
- }
- }
- }
- }
- var hifmi_pay = 0.00
-
- if (order.setl_detail.length > 0) {
- var jsonObj = JSON.parse(order.setl_detail)
- for (let i = 0; i < jsonObj.length; i++) {
- if (order.insutype == '310') {
- if (jsonObj[i].fund_pay_type == '310300') {
- hifmi_pay = jsonObj[i].fund_payamt
- }
- }
- if (order.insutype == '390') {
- if (jsonObj[i].fund_pay_type == '390200') {
- hifmi_pay = jsonObj[i].fund_payamt
- }
- }
- }
- }
-
- let obj = {
- '就诊号': order.mdtrt_id,
- '患者姓名': name,
- '开处时间': time,
- '险种类型': insutypeName,
- '应收金额': order.medfee_sumamt,
- '实收金额': order.medfee_sumamt,
- '医保统筹金额': order.hifp_pay,
- '大额基金金额': order.hifob_pay,
- '大病基金金额': hifmi_pay,
- '补充保险基金金额': order.hifes_pay,
- '医疗救助基金金额': order.maf_pay,
- '公务员基金': order.cvlserv_pay,
- '个人支付基金': order.psn_cash_pay,
- '个人账户支付金额': order.acct_pay,
- '科室': department,
- '医生姓名': doctor_name,
- '收费类别': balance_accounts,
- '收费者姓名': charge_name,
- '总金额': order.medfee_sumamt,
- '现金支付': '',
- '账户支付': '',
- '支付宝支付': '',
- '微信支付': '',
- '其他支付': '',
- '收费时间': order.setl_time,
- '收费状态': order_status,
- '退费日期': ''
- }
-
- list.push(obj)
- }
- import('@/vendor/Export2Excel').then(excel => {
- const tHeader = ['就诊号', '患者姓名', '开处时间', '险种类型', '应收金额', '实收金额', '医保统筹金额', '大额基金金额', '大病基金金额', '补充保险基金金额', '医疗救助基金金额', '公务员基金', '个人支付基金', '个人账户支付金额', '科室', '医生姓名', '收费类别', '收费者姓名', '总金额', '现金支付', '账户支付', '支付宝支付', '微信支付', '其他支付', '收费时间', '收费状态', '退费日期']
- const filterVal = ['就诊号', '患者姓名', '开处时间', '险种类型', '应收金额', '实收金额', '医保统筹金额', '大额基金金额', '大病基金金额', '补充保险基金金额', '医疗救助基金金额', '公务员基金', '个人支付基金', '个人账户支付金额', '科室', '医生姓名', '收费类别', '收费者姓名', '总金额', '现金支付', '账户支付', '支付宝支付', '微信支付', '其他支付', '收费时间', '收费状态', '退费日期']
- const data = this.formatJson(filterVal, list)
- excel.export_json_to_excel({
- header: tHeader,
- data,
- filename: '消费明细'
- })
- })
-
- }, formatJson(filterVal, jsonData) {
- return jsonData.map(v => filterVal.map(j => v[j]))
- }
- },
- created() {
- this.getSummarySettleList()
-
- }
- }
- </script>
|