应付账单初始化

This commit is contained in:
caojia
2026-11-04 16:04:38 +08:00
committed by liuminghui
parent 04be15deab
commit 51a89b18e1
90 changed files with 15661 additions and 6 deletions
@@ -164,6 +164,8 @@
</template>
<template #col-action="{ row }">
<el-button link type="primary" icon="View" @click="handleView(row)">查看</el-button>
<el-button link type="primary" icon="Money" v-hasPermi="['price:billing:bill']" @click="handlePayBill(row)">生成应付</el-button>
<el-button
<!-- <el-button
link
type="primary"
@@ -276,6 +278,7 @@
<script setup name="BillingBill">
import { listBill, getBill, refundBill, updateCreditArrears, importChargeWeightAsync, downloadChargeWeightTemplate, recalcBillPriceAsync } from '@/api/price/billing'
import { generatePayBill } from '@/api/price/pay'
import { exportAsyncFromTable } from '@/utils/excelExport'
import ExcelExportFieldDialog from '@/components/ExcelExportFieldDialog/index.vue'
import { BILLING_BILL_EXPORT_FIELDS } from '@/utils/exportFieldDefs'
@@ -461,6 +464,7 @@ const columns = [
{ label: '销售员', prop: 'belongSaler', minWidth: 100, showOverflowTooltip: true },
{ label: '结算员', prop: 'settlementMan', minWidth: 100, showOverflowTooltip: true },
{ label: '客服员', prop: 'serviceMan', minWidth: 100, showOverflowTooltip: true },
{ label: '操作', prop: 'action', align: 'center', width: 320, fixed: 'right', slot: 'action', showInToolbar: false, showOverflowTooltip: false }
{ label: '操作', prop: 'action', align: 'center', width: 150, fixed: 'right', slot: 'action', showInToolbar: false, showOverflowTooltip: false }
]
@@ -597,6 +601,23 @@ function handleUpdateArrears(ids, selection) {
}).catch(() => {})
}
function handlePayBill(row) {
if (!row || !row.billId) return
ElMessageBox.confirm(
'按订单的渠道服务商和已配置的应付产品计算应付?',
'生成应付',
{ type: 'warning' }
).then(() => generatePayBill(row.billId)).then(res => {
const data = res.data || {}
if (data.skipped && data.skipped.length) {
ElMessageBox.alert(data.skipped.join('\n'), data.message || '应付已生成', { type: 'warning' })
} else {
ElMessage.success(data.message || '应付已生成')
}
tableRef.value?.refresh?.()
}).catch(() => {})
}
function handleRefund(row) {
if (!row || !row.billId) return
if (row.refundStatus === 'REFUNDED') {