优化计费逻辑
This commit is contained in:
@@ -193,6 +193,8 @@ function fmtList(arr, max = 5) {
|
||||
|
||||
function buildQueryTags(q) {
|
||||
const tags = []
|
||||
const identifiers = fmtList(q.orderIdentifiers)
|
||||
if (identifiers) tags.push("单号" + ':' + identifiers)
|
||||
const order = fmtList(q.orderNos)
|
||||
if (order) tags.push("订单号" + ':' + order)
|
||||
const tracking = fmtList(q.trackingNos)
|
||||
@@ -256,6 +258,7 @@ function buildPayload() {
|
||||
orderNos: q.orderNos || [],
|
||||
trackingNos: q.trackingNos || [],
|
||||
transferNos: q.transferNos || [],
|
||||
orderIdentifiers: q.orderIdentifiers || [],
|
||||
customerCodes: q.customerCodes || [],
|
||||
productCodes: q.productCodes || [],
|
||||
creditArrearsStatus: q.creditArrearsStatus || undefined,
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
<div class="sec-title">费用明细</div>
|
||||
<el-tabs v-model="feeTab" class="fee-tabs">
|
||||
<el-tab-pane label="应收" name="income">
|
||||
<div class="fee-toolbar">
|
||||
<div v-if="!readonly" class="fee-toolbar">
|
||||
<el-button type="primary" plain size="small" icon="Plus" v-hasPermi="['price:billing:feeAdd']" @click="openAddFee">增加费用</el-button>
|
||||
<el-button type="primary" plain size="small" icon="Edit" v-hasPermi="['price:billing:chargeWeightEdit']" :disabled="detail.refundStatus === 'REFUNDED'" @click="openEditCw">修改计费重</el-button>
|
||||
</div>
|
||||
@@ -124,7 +124,7 @@
|
||||
<el-table-column label="说明" min-width="160" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ row.remark || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="120" align="center" fixed="right">
|
||||
<el-table-column v-if="!readonly" label="操作" width="120" align="center" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<template v-if="canEditManualFee(row)">
|
||||
<el-button link type="primary" v-hasPermi="['price:billing:feeEdit']" @click="openEditFee(row)">编辑</el-button>
|
||||
@@ -198,7 +198,8 @@ const props = defineProps({
|
||||
modelValue: { type: Boolean, default: false },
|
||||
title: { type: String, default: '计费详情' },
|
||||
loading: { type: Boolean, default: false },
|
||||
detail: { type: Object, default: null }
|
||||
detail: { type: Object, default: null },
|
||||
readonly: { type: Boolean, default: false }
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:modelValue', 'updated'])
|
||||
@@ -335,17 +336,41 @@ function formatDateTime(val) {
|
||||
return d.getFullYear() + '-' + pad(d.getMonth() + 1) + '-' + pad(d.getDate()) + ' ' + pad(d.getHours()) + ':' + pad(d.getMinutes()) + ':' + pad(d.getSeconds())
|
||||
}
|
||||
|
||||
const billingFailStatusOptions = [
|
||||
{ label: '计费成功', value: 0 },
|
||||
{ label: '未匹配产品', value: 1 },
|
||||
{ label: '未匹配国家', value: 2 },
|
||||
{ label: '未匹配重量段', value: 3 },
|
||||
{ label: '未绑定套餐', value: 4 },
|
||||
{ label: '无生效套餐版本', value: 5 },
|
||||
{ label: '已生成应收账单', value: 6 },
|
||||
{ label: '产品档案缺失', value: 7 },
|
||||
{ label: '未命中价格', value: 8 },
|
||||
{ label: '分区无价格', value: 9 },
|
||||
{ label: '邮编必填', value: 10 },
|
||||
{ label: '邮编未匹配分区', value: 11 },
|
||||
{ label: '上游订单不存在', value: 12 },
|
||||
{ label: '上游订单号为空', value: 13 },
|
||||
{ label: '上游客户为空', value: 14 },
|
||||
{ label: '上游产品为空', value: 15 },
|
||||
{ label: '上游重量无效', value: 16 },
|
||||
{ label: '计费时间为空', value: 17 },
|
||||
{ label: '退费订单无法解析', value: 18 },
|
||||
{ label: '客户代码为空', value: 19 },
|
||||
{ label: '客户已停用', value: 20 },
|
||||
{ label: '运费为空', value: 21 },
|
||||
{ label: '未知失败', value: 22 }
|
||||
]
|
||||
|
||||
function billingFailLabel(status) {
|
||||
const code = status == null ? 0 : Number(status)
|
||||
if (code === 1) return '未匹配产品'
|
||||
if (code === 2) return '未匹配国家'
|
||||
if (code === 3) return '未匹配重量段'
|
||||
return '计费成功'
|
||||
const hit = billingFailStatusOptions.find(item => item.value === code)
|
||||
return hit ? hit.label : '未知失败'
|
||||
}
|
||||
|
||||
function billingFailTagType(status) {
|
||||
const code = status == null ? 0 : Number(status)
|
||||
if (code === 1 || code === 2 || code === 3) return 'danger'
|
||||
if (code > 0) return 'danger'
|
||||
return 'success'
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user