增加导出功能

This commit is contained in:
wuweihua
2026-10-21 18:06:21 +08:00
parent c04191c316
commit 92000956fc
15 changed files with 1181 additions and 21 deletions
+27 -2
View File
@@ -117,6 +117,15 @@
@click="openRecalcDialog"
>重计费</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="Download"
v-hasPermi="['price:billing:export']"
@click="handleExport"
>导出</el-button>
</el-col>
</template>
<template #col-action="{ row }">
<el-button link type="primary" icon="View" @click="handleView(row)">查看</el-button>
@@ -225,6 +234,7 @@
<script setup name="BillingBill">
import { listBill, getBill, refundBill, listOrderNoOptions, listTrackingNoOptions, listTransferNoOptions, updateCreditArrears, importChargeWeightAsync, downloadChargeWeightTemplate, recalcBillPriceAsync } from '@/api/price/billing'
import { exportAsyncFromTable } from '@/utils/excelExport'
import { ElMessage, ElMessageBox } from 'element-plus'
import { useProducts } from '@/components/ProductSelect/useProducts'
import BillDetail from './components/BillDetail.vue'
@@ -390,8 +400,8 @@ const searchColumns = [
}
]
function queryList(params) {
const { bizDateRange, ...rest } = params
function buildBillQuery(params) {
const { bizDateRange, ...rest } = params || {}
const query = { ...rest }
if (Array.isArray(bizDateRange) && (bizDateRange[0] || bizDateRange[1])) {
query.params = {
@@ -400,9 +410,24 @@ function queryList(params) {
endBizDate: bizDateRange[1] || null
}
}
return query
}
function queryList(params) {
const query = buildBillQuery(params)
return listBill(query)
}
function handleExport() {
return exportAsyncFromTable({
baseUrl: '/price/billing/bill/export',
tableRef: tableRef.value,
normalize: buildBillQuery,
filePrefix: 'billing_bill',
requireFilter: true
})
}
function handleUpdateArrears(ids, selection) {
const billIds = (ids && ids.length)
? ids