You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
284 lines
10 KiB
284 lines
10 KiB
<template>
|
|
<div class="app-container">
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
<el-form-item label="客户名称" prop="custName">
|
|
<el-input
|
|
v-model="queryParams.custName"
|
|
placeholder="请输入客户名称"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item label="收支" prop="ie">
|
|
<el-select v-model="queryParams.ie" placeholder="请选择收支" clearable>
|
|
<el-option
|
|
v-for="dict in dict.type.ie_type"
|
|
:key="dict.value"
|
|
:label="dict.label"
|
|
:value="dict.value"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="费用名称" prop="chargeName">
|
|
<el-input
|
|
v-model="queryParams.chargeName"
|
|
placeholder="请输入费用名称"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item label="结算方式" prop="payMethod">
|
|
<el-select v-model="queryParams.payMethod" placeholder="请输入结算方式" clearable>
|
|
<el-option
|
|
v-for="dict in dict.type.pay_method"
|
|
:key="dict.value"
|
|
:label="dict.label"
|
|
:value="dict.value"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
type="primary"
|
|
plain
|
|
icon="el-icon-plus"
|
|
size="mini"
|
|
:disabled="multiple"
|
|
@click="autoWriteoff"
|
|
v-hasPermi="['cash:writeoff:add']"
|
|
>自动核销</el-button>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
type="danger"
|
|
plain
|
|
icon="el-icon-delete"
|
|
size="mini"
|
|
:disabled="multiple"
|
|
@click="removeWriteoff"
|
|
v-hasPermi="['cash:writeoff:add']"
|
|
>退回核销</el-button>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
type="warning"
|
|
plain
|
|
icon="el-icon-download"
|
|
size="mini"
|
|
@click="handleExport"
|
|
v-hasPermi="['bill:charge:export']"
|
|
>导出
|
|
</el-button>
|
|
</el-col>
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
</el-row>
|
|
|
|
<el-table v-loading="loading" :data="chargeList"
|
|
@sort-change="handleSortChange" @selection-change="handleSelectionChange" @row-click="handleRowClick">
|
|
<el-table-column type="selection" width="55" align="center" fixed="left"/>
|
|
<el-table-column label="客户名称" align="center" prop="custName" sortable='custom' width="120" fixed="left"/>
|
|
<el-table-column label="业务类型" align="center" prop="bizType" sortable='custom' width="100" >
|
|
<template slot-scope="scope">
|
|
<dict-tag :options="dict.type.biz_type" :value="scope.row.bizType"/>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="收支" align="center" prop="ie" sortable='custom'>
|
|
<template slot-scope="scope">
|
|
<dict-tag :options="dict.type.ie_type" :value="scope.row.ie"/>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="费用名称" align="center" prop="chargeName" sortable='custom' width="100"/>
|
|
<el-table-column label="结算方式" align="center" prop="payMethod" sortable='custom' width="100">
|
|
<template slot-scope="scope">
|
|
<dict-tag :options="dict.type.pay_method" :value="scope.row.payMethod"/>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="费率" align="center" prop="chargePrice" sortable='custom'/>
|
|
<el-table-column label="币种" align="center" prop="currency" sortable='custom'>
|
|
<template slot-scope="scope">
|
|
<dict-tag :options="dict.type.sys_curr_type" :value="scope.row.currency"/>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="单位" align="center" prop="unit" sortable='custom'>
|
|
<template slot-scope="scope">
|
|
<dict-tag :options="dict.type.bm_measuring_unit" :value="scope.row.unit"/>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="数量" align="center" prop="chargeNum" sortable='custom'/>
|
|
<el-table-column label="金额" align="center" prop="chargeAmount" sortable='custom'/>
|
|
<el-table-column label="结算时间" align="center" prop="chargeTime" width="120" sortable='custom'>
|
|
<template slot-scope="scope">
|
|
<span>{{ parseTime(scope.row.chargeTime, '{y}-{m}-{d}') }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="可核销金额" align="center" prop="hxAmount" sortable='custom' width="120" />
|
|
<el-table-column label="已核销金额" align="center" prop="hxedAmount" sortable='custom' width="120"/>
|
|
<el-table-column label="可开票金额" align="center" prop="kpAmount" sortable='custom' width="120"/>
|
|
<el-table-column label="已开票金额" align="center" prop="kpedAmount" sortable='custom' width="120"/>
|
|
<el-table-column label="摘要" align="center" prop="chargeAbstract" sortable='custom'/>
|
|
<el-table-column label="状态" align="center" prop="status" sortable='custom'>
|
|
<template slot-scope="scope">
|
|
<dict-tag :options="dict.type.charge_status" :value="scope.row.status"/>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="核销状态" align="center" prop="hxStatus" sortable='custom' width="100">
|
|
<template slot-scope="scope">
|
|
<dict-tag :options="dict.type.hx_status" :value="scope.row.hxStatus"/>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="备注" align="center" prop="remark" sortable='custom' show-overflow-tooltip/>
|
|
<el-table-column label="操作" align="center" fixed="right" width="80">
|
|
<template slot-scope="scope">
|
|
<el-button type="text" size="mini" @click="handleView(scope.row.id)">查看</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
|
|
<!-- 费用详情弹窗 -->
|
|
<fmbillcharge-add-and-update ref="fmbillchargeAddAndUpdate" @refreshDataList="getList" />
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import * as api from '@/api/fmbillcharge.js'
|
|
import RightToolbar from '@/components/RightToolbar'
|
|
import * as apiWriteoff from '@/api/fmcashwriteoff.js'
|
|
import fmbillchargeAddAndUpdate from '@/views/fm/bill/charge/fmbillcharge-add-and-update.vue'
|
|
|
|
export default {
|
|
components: { RightToolbar, fmbillchargeAddAndUpdate },
|
|
dicts: ['ie_type', 'biz_type', 'pay_method','charge_status','hx_status','sys_curr_type'],
|
|
data() {
|
|
return {
|
|
// 遮罩层
|
|
loading: true,
|
|
// 选中数组
|
|
ids: [],
|
|
// 非单个禁用
|
|
single: true,
|
|
// 非多个禁用
|
|
multiple: true,
|
|
// 显示搜索条件
|
|
showSearch: true,
|
|
// 客户ID
|
|
custId: undefined,
|
|
// 排序参数
|
|
sortField: '',
|
|
sortOrder: '',
|
|
// 导出参数
|
|
exportParams: {},
|
|
// 接收的费用ID
|
|
receivedChargeId: null,
|
|
// 查询参数
|
|
queryParams: {
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
chargeName: undefined,
|
|
custName: undefined,
|
|
ie: undefined,
|
|
payMethod: undefined,
|
|
bizType: undefined
|
|
},
|
|
// 费用列表
|
|
chargeList: [],
|
|
// 总条数
|
|
total: 0
|
|
}
|
|
},
|
|
methods: {
|
|
// 自动核销
|
|
autoWriteoff() {
|
|
this.$confirm('是否确认自动核销?', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
}).then(() => {
|
|
return apiWriteoff.addWriteoffVo({ chargeIds: this.ids })
|
|
}).then(response => {
|
|
this.$message.success('自动核销成功')
|
|
this.getList()
|
|
this.$emit('chargeTriggerRefresh')
|
|
}).catch(() => {
|
|
this.$message.info('已取消操作')
|
|
})
|
|
},
|
|
// 退回核销
|
|
removeWriteoff() {
|
|
this.$confirm('是否确认退回核销?', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
}).then(() => {
|
|
return apiWriteoff.removeWriteoff({ chargeIds: this.ids })
|
|
}).then(response => {
|
|
this.$message.success('退回核销成功')
|
|
this.getList()
|
|
this.$emit('chargeTriggerRefresh')
|
|
}).catch(() => {
|
|
this.$message.info('已取消操作')
|
|
})
|
|
},
|
|
// 查询按钮点击事件
|
|
handleQuery() {
|
|
this.queryParams.pageNum = 1
|
|
this.getList()
|
|
},
|
|
// 重置按钮点击事件
|
|
resetQuery() {
|
|
this.resetForm('queryForm')
|
|
this.handleQuery()
|
|
},
|
|
// 选择数据
|
|
handleSelectionChange(selection) {
|
|
this.ids = selection.map(item => item.id)
|
|
this.single = selection.length !== 1
|
|
this.multiple = !selection.length
|
|
},
|
|
// 查看详情
|
|
handleView(id) {
|
|
this.$refs.fmbillchargeAddAndUpdate.init(id, true)
|
|
},
|
|
// 行点击事件
|
|
handleRowClick(row) {
|
|
this.selectObj = row
|
|
this.$emit('passChargeId', row.id)
|
|
},
|
|
// 排序
|
|
handleSortChange(ev) {
|
|
this.sortField = ev.prop
|
|
this.sortOrder = ev.order === 'ascending' ? 'asc' : 'desc'
|
|
this.getList()
|
|
},
|
|
// 导出
|
|
handleExport() {
|
|
this.download('bill/charge/export', {
|
|
...this.queryParams
|
|
}, `charge_${new Date().getTime()}.xlsx`)
|
|
},
|
|
// 获取费用列表
|
|
getList() {
|
|
this.loading = true
|
|
api.fmbillchargeListApi({
|
|
...this.queryParams,
|
|
sortField: this.sortField,
|
|
sortOrder: this.sortOrder
|
|
}).then(response => {
|
|
this.chargeList = response.list || [];
|
|
this.total = response.total
|
|
this.loading = false
|
|
})
|
|
}
|
|
},
|
|
created() {
|
|
this.getList()
|
|
}
|
|
}
|
|
</script>
|