修改计费重

This commit is contained in:
wuweihua
2026-10-13 17:12:32 +08:00
parent 5c48717da2
commit d6a6ec4d53
17 changed files with 294 additions and 14 deletions
+1
View File
@@ -66,3 +66,4 @@ export function listOrderSourceOrdersByProduct(data) {
timeout: 120000
})
}
+9
View File
@@ -61,6 +61,15 @@ export function getBill(billId) {
})
}
/** Refund receivable bill (billType=REFUND) */
export function refundBill(billId) {
return request({
url: '/price/billing/bill/' + encodeURIComponent(billId) + '/refund',
method: 'post',
timeout: 120000
})
}
/** Order no options for remote search (bill list multi search) */
export function listOrderNoOptions(keyword) {
return request({
@@ -280,6 +280,7 @@ function toSyncRow(row) {
}
}
function handleSyncOne(row) {
proxy.$modal.confirm('确认同步计费该订单?', '二次确认').then(() => {
syncingKey.value = rowKey(row)
+59 -2
View File
@@ -64,6 +64,9 @@
<template #col-creditArrearsStatus="{ row }">
<el-tag size="small" :type="creditArrearsTagType(row.creditArrearsStatus)">{{ creditArrearsLabel(row.creditArrearsStatus) }}</el-tag>
</template>
<template #col-refundStatus="{ row }">
<el-tag size="small" :type="refundTagType(row.refundStatus)">{{ refundLabel(row.refundStatus) }}</el-tag>
</template>
<template #col-incomeTotal="{ row }">
<span class="payable">{{ formatMoney(row.incomeTotal) }}</span>
</template>
@@ -83,6 +86,15 @@
</template>
<template #col-action="{ row }">
<el-button link type="primary" icon="View" @click="handleView(row)">查看</el-button>
<el-button
link
type="danger"
icon="RefreshLeft"
:loading="refundingKey === row.billId"
:disabled="row.refundStatus === 'REFUNDED'"
v-hasPermi="['price:billing:refund']"
@click="handleRefund(row)"
>退费</el-button>
</template>
</basic-table>
@@ -98,7 +110,7 @@
</template>
<script setup name="BillingBill">
import { listBill, getBill, listOrderNoOptions, listTrackingNoOptions, listTransferNoOptions, updateCreditArrears } from '@/api/price/billing'
import { listBill, getBill, refundBill, listOrderNoOptions, listTrackingNoOptions, listTransferNoOptions, updateCreditArrears } from '@/api/price/billing'
import { ElMessage, ElMessageBox } from 'element-plus'
import { useProducts } from '@/components/ProductSelect/useProducts'
import BillDetail from './components/BillDetail.vue'
@@ -136,6 +148,7 @@ const detail = ref(null)
const batchFeeOpen = ref(false)
const batchFeeListQuery = ref({})
const batchFeeSelectedIds = ref([])
const refundingKey = ref(null)
const columns = [
{ label: '订单号', prop: 'orderNo', minWidth: 140, showOverflowTooltip: true },
@@ -152,18 +165,23 @@ const columns = [
{ label: '计价来源', prop: 'matchSource', align: 'center', width: 130, slot: 'matchSource' },
{ label: '客户状态', prop: 'customerActiveStatus', align: 'center', width: 100, slot: 'customerActiveStatus' },
{ label: '额度欠费', prop: 'creditArrearsStatus', align: 'center', width: 100, slot: 'creditArrearsStatus' },
{ label: '退费状态', prop: 'refundStatus', align: 'center', width: 100, slot: 'refundStatus' },
{ label: '计费时间', prop: 'bizDate', align: 'center', width: 170, parseTime: true },
{ label: '下单时间', prop: 'orderTime', align: 'center', width: 170, parseTime: true },
{ 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: 90, fixed: 'right', slot: 'action', showInToolbar: false }
{ label: '操作', prop: 'action', align: 'center', width: 160, fixed: 'right', slot: 'action', showInToolbar: false }
]
const arrearsStatusOptions = [
{ label: '正常', value: 'NORMAL' },
{ label: '欠费', value: 'ARREARS' }
]
const refundStatusOptions = [
{ label: '未退费', value: 'NONE' },
{ label: '已退费', value: 'REFUNDED' }
]
const searchColumns = [
{ label: '订单号', prop: 'orderNos', placeholder: '订单号' },
@@ -179,6 +197,14 @@ const searchColumns = [
placeholder: '请选择',
props: { clearable: true }
},
{
label: '退费状态',
prop: 'refundStatus',
component: 'select',
options: refundStatusOptions,
placeholder: '请选择',
props: { clearable: true }
},
{
label: '计费时间',
prop: 'bizDateRange',
@@ -227,6 +253,27 @@ function handleUpdateArrears(ids, selection) {
}).catch(() => {})
}
function handleRefund(row) {
if (!row || !row.billId) return
if (row.refundStatus === 'REFUNDED') {
ElMessage.warning('该订单已退费')
return
}
ElMessageBox.confirm(
'确认对订单 ' + (row.orderNo || '') + ' 发起退费?',
'退费确认',
{ type: 'warning' }
).then(() => {
refundingKey.value = row.billId
return refundBill(row.billId)
}).then(() => {
ElMessage.success('退费成功')
tableRef.value?.refresh?.()
}).catch(() => {}).finally(() => {
refundingKey.value = null
})
}
function handleView(row) {
title.value = '计费详情'
open.value = true
@@ -330,6 +377,16 @@ function creditArrearsTagType(status) {
if (status === 'ARREARS') return 'danger'
return 'info'
}
function refundLabel(status) {
const map = { NONE: '未退费', REFUNDED: '已退费' }
return map[status] || status || '未退费'
}
function refundTagType(status) {
if (status === 'REFUNDED') return 'danger'
return 'success'
}
</script>
<style scoped>
@@ -23,6 +23,7 @@
<el-descriptions-item label="客户">{{ displayCustomer(detail) }}</el-descriptions-item>
<el-descriptions-item label="客户状态">{{ customerActiveLabel(detail.customerActiveStatus) }}</el-descriptions-item>
<el-descriptions-item label="额度欠费">{{ creditArrearsLabel(detail.creditArrearsStatus) }}</el-descriptions-item>
<el-descriptions-item label="退费状态">{{ refundLabel(detail.refundStatus) }}</el-descriptions-item>
<el-descriptions-item label="仓库">{{ detail.warehouseCode || '-' }}</el-descriptions-item>
<el-descriptions-item label="发件人">{{ detail.shipperName || '-' }}</el-descriptions-item>
<el-descriptions-item label="收件人">{{ detail.consigneeName || '-' }}</el-descriptions-item>
@@ -357,6 +358,11 @@ function sourceTagType(source) {
if (source === 'PRODUCT_DEFAULT') return 'info'
return ''
}
function refundLabel(status) {
const map = { NONE: '未退费', REFUNDED: '已退费' }
return map[status] || status || '未退费'
}
</script>
<style scoped>