Implement batch fee management features in BillingController, including preview, submission, and task retrieval. Update related services and mappers to support batch processing. Add necessary error messages in properties file and enhance front-end API for batch operations.

This commit is contained in:
wuweihua
2026-10-09 10:28:29 +08:00
parent 95df65b4f6
commit 5b4cbaffd6
15 changed files with 1014 additions and 23 deletions
+44 -8
View File
@@ -70,24 +70,30 @@
<template #col-payTotal="{ row }">
<span class="payable">{{ formatMoney(row.payTotal) }}</span>
</template>
<!-- <template #toolbar="{ selection, ids }">
<template #toolbar>
<el-col :span="1.5">
<el-button
type="warning"
type="primary"
plain
icon="Refresh"
:disabled="!selection.length"
v-hasPermi="['price:billing:arrearsUpdate']"
@click="handleUpdateArrears(ids, selection)"
>更新欠费状态</el-button>
icon="Plus"
v-hasPermi="['price:billing:feeAdd']"
@click="openBatchFee"
>批量增加费用</el-button>
</el-col>
</template> -->
</template>
<template #col-action="{ row }">
<el-button link type="primary" icon="View" @click="handleView(row)">查看</el-button>
</template>
</basic-table>
<bill-detail v-model="open" :title="title" :loading="loading" :detail="detail" @updated="onDetailUpdated" />
<batch-add-income-fee-dialog
v-model="batchFeeOpen"
:list-query="batchFeeListQuery"
:selected-ids="batchFeeSelectedIds"
@success="onBatchFeeSuccess"
/>
</div>
</template>
@@ -96,6 +102,7 @@ import { listBill, getBill, listOrderNoOptions, listTrackingNoOptions, listTrans
import { ElMessage, ElMessageBox } from 'element-plus'
import { useProducts } from '@/components/ProductSelect/useProducts'
import BillDetail from './components/BillDetail.vue'
import BatchAddIncomeFeeDialog from './components/BatchAddIncomeFeeDialog.vue'
// 订单号下拉远程搜索:返回匹配的订单号列表(最多 20 条)
function searchOrderNoOptions(keyword) {
@@ -126,6 +133,9 @@ const open = ref(false)
const title = ref('计费详情')
const loading = ref(false)
const detail = ref(null)
const batchFeeOpen = ref(false)
const batchFeeListQuery = ref({})
const batchFeeSelectedIds = ref([])
const columns = [
{ label: '订单号', prop: 'orderNo', minWidth: 140, showOverflowTooltip: true },
@@ -213,6 +223,32 @@ function onDetailUpdated(data) {
tableRef.value?.refresh?.()
}
function hasBatchFeeQuery(q) {
const hasArr = (arr) => Array.isArray(arr) && arr.some(v => v != null && String(v).trim() !== '')
return hasArr(q.orderNos)
|| hasArr(q.trackingNos)
|| hasArr(q.transferNos)
|| hasArr(q.customerCodes)
|| hasArr(q.productCodes)
|| !!(q.creditArrearsStatus && String(q.creditArrearsStatus).trim())
}
function openBatchFee() {
const q = tableRef.value?.getQueryParams?.() || {}
const { pageNum, pageSize, ...rest } = q
if (!hasBatchFeeQuery(rest)) {
ElMessage.warning('请先设置列表查询条件')
return
}
batchFeeListQuery.value = { ...rest }
batchFeeSelectedIds.value = tableRef.value?.getSelectionIds?.() || []
batchFeeOpen.value = true
}
function onBatchFeeSuccess() {
tableRef.value?.refresh?.()
}
function formatMoney(val) {
if (val === null || val === undefined || val === '') return '-'
const num = Number(val)