fix:订单列表详情实付金额代理/企业不可见
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 6m22s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 6m22s
This commit is contained in:
@@ -489,26 +489,37 @@
|
||||
})
|
||||
|
||||
// 列配置
|
||||
const columnOptions = [
|
||||
{ label: '订单编号', prop: 'order_no' },
|
||||
{ label: '买家手机号', prop: 'buyer_phone' },
|
||||
{ label: '买家昵称', prop: 'buyer_nickname' },
|
||||
{ label: '订单类型', prop: 'order_type' },
|
||||
{ label: '买家类型', prop: 'buyer_type' },
|
||||
{ label: '资产标识符', prop: 'asset_identifier' },
|
||||
{ label: '订单渠道', prop: 'purchase_role' },
|
||||
{ label: '购买备注', prop: 'purchase_remark' },
|
||||
{ label: '下单时间', prop: 'created_at' },
|
||||
{ label: '操作者', prop: 'operator_name' },
|
||||
{ label: '销售店铺', prop: 'seller_shop_name' },
|
||||
{ label: '支付状态', prop: 'payment_status' },
|
||||
{ label: '佣金流程状态', prop: 'commission_status_name' },
|
||||
{ label: '佣金业务结果', prop: 'commission_result_name' },
|
||||
{ label: '订单金额', prop: 'total_amount' },
|
||||
{ label: '实付金额', prop: 'actual_paid_amount' },
|
||||
{ label: '支付方式', prop: 'payment_method' },
|
||||
{ label: '支付时间', prop: 'paid_at' }
|
||||
]
|
||||
const columnOptions = computed(() => {
|
||||
const options = [
|
||||
{ label: '订单编号', prop: 'order_no' },
|
||||
{ label: '买家手机号', prop: 'buyer_phone' },
|
||||
{ label: '买家昵称', prop: 'buyer_nickname' },
|
||||
{ label: '订单类型', prop: 'order_type' },
|
||||
{ label: '买家类型', prop: 'buyer_type' },
|
||||
{ label: '资产标识符', prop: 'asset_identifier' },
|
||||
{ label: '订单渠道', prop: 'purchase_role' },
|
||||
{ label: '购买备注', prop: 'purchase_remark' },
|
||||
{ label: '下单时间', prop: 'created_at' },
|
||||
{ label: '操作者', prop: 'operator_name' },
|
||||
{ label: '销售店铺', prop: 'seller_shop_name' },
|
||||
{ label: '支付状态', prop: 'payment_status' },
|
||||
{ label: '佣金流程状态', prop: 'commission_status_name' },
|
||||
{ label: '佣金业务结果', prop: 'commission_result_name' },
|
||||
{ label: '订单金额', prop: 'total_amount' }
|
||||
]
|
||||
|
||||
// 只有非代理账号和非企业账号才能看到实付金额选项
|
||||
if (canViewActualPaidAmount.value) {
|
||||
options.push({ label: '实付金额', prop: 'actual_paid_amount' })
|
||||
}
|
||||
|
||||
options.push(
|
||||
{ label: '支付方式', prop: 'payment_method' },
|
||||
{ label: '支付时间', prop: 'paid_at' }
|
||||
)
|
||||
|
||||
return options
|
||||
})
|
||||
|
||||
const createFormRef = ref<FormInstance>()
|
||||
const uploadRef = ref<UploadInstance>()
|
||||
@@ -858,169 +869,187 @@
|
||||
}
|
||||
}
|
||||
|
||||
// 检查当前用户是否可以查看实付金额(代理账号和企业账号不能看到)
|
||||
const canViewActualPaidAmount = computed(() => {
|
||||
const userType = userStore.info.user_type
|
||||
// 只有代理账号(3)和企业账号(4)不能看到实付金额
|
||||
return userType !== 3 && userType !== 4
|
||||
})
|
||||
|
||||
// 动态列配置
|
||||
const { columnChecks, columns } = useCheckedColumns(() => [
|
||||
{
|
||||
prop: 'order_no',
|
||||
label: '订单编号',
|
||||
minWidth: 220,
|
||||
showOverflowTooltip: true,
|
||||
formatter: (row: Order) => {
|
||||
return h(
|
||||
'span',
|
||||
{
|
||||
style: 'color: var(--el-color-primary); cursor: pointer; text-decoration: underline;',
|
||||
onClick: (e: MouseEvent) => {
|
||||
e.stopPropagation()
|
||||
handleNameClick(row)
|
||||
}
|
||||
},
|
||||
row.order_no
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'buyer_phone',
|
||||
label: '买家手机号',
|
||||
width: 130,
|
||||
formatter: (row: Order) => row.buyer_phone || '-'
|
||||
},
|
||||
{
|
||||
prop: 'buyer_nickname',
|
||||
label: '买家昵称',
|
||||
width: 130,
|
||||
formatter: (row: Order) => row.buyer_nickname || '-'
|
||||
},
|
||||
{
|
||||
prop: 'order_type',
|
||||
label: '订单类型',
|
||||
width: 120,
|
||||
formatter: (row: Order) => {
|
||||
return h(ElTag, { type: row.order_type === 'single_card' ? 'primary' : 'success' }, () =>
|
||||
getOrderTypeText(row.order_type)
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'buyer_type',
|
||||
label: '买家类型',
|
||||
width: 120,
|
||||
formatter: (row: Order) => {
|
||||
return h(ElTag, { type: row.buyer_type === 'personal' ? 'info' : 'warning' }, () =>
|
||||
getBuyerTypeText(row.buyer_type)
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'payment_status',
|
||||
label: '支付状态',
|
||||
width: 120,
|
||||
formatter: (row: Order) => {
|
||||
return h(
|
||||
ElTag,
|
||||
{ type: getPaymentStatusType(row.payment_status) },
|
||||
() => row.payment_status_text
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'asset_identifier',
|
||||
label: '资产标识符',
|
||||
width: 180,
|
||||
showOverflowTooltip: true,
|
||||
formatter: (row: Order) => row.asset_identifier || '-'
|
||||
},
|
||||
{
|
||||
prop: 'purchase_role',
|
||||
label: '订单渠道',
|
||||
width: 140,
|
||||
formatter: (row: Order) => {
|
||||
if (!row.purchase_role) return '-'
|
||||
const roleTypeMap: Record<string, 'success' | 'info' | 'warning' | 'danger'> = {
|
||||
self_purchase: 'success',
|
||||
purchased_by_parent: 'warning',
|
||||
purchased_by_platform: 'danger',
|
||||
purchase_for_subordinate: 'info'
|
||||
const { columnChecks, columns } = useCheckedColumns(() => {
|
||||
const baseColumns = [
|
||||
{
|
||||
prop: 'order_no',
|
||||
label: '订单编号',
|
||||
minWidth: 220,
|
||||
showOverflowTooltip: true,
|
||||
formatter: (row: Order) => {
|
||||
return h(
|
||||
'span',
|
||||
{
|
||||
style: 'color: var(--el-color-primary); cursor: pointer; text-decoration: underline;',
|
||||
onClick: (e: MouseEvent) => {
|
||||
e.stopPropagation()
|
||||
handleNameClick(row)
|
||||
}
|
||||
},
|
||||
row.order_no
|
||||
)
|
||||
}
|
||||
return h(
|
||||
ElTag,
|
||||
{ type: roleTypeMap[row.purchase_role || ''] || 'info', size: 'small' },
|
||||
() => getPurchaseRoleText(row.purchase_role || '')
|
||||
)
|
||||
},
|
||||
{
|
||||
prop: 'buyer_phone',
|
||||
label: '买家手机号',
|
||||
width: 130,
|
||||
formatter: (row: Order) => row.buyer_phone || '-'
|
||||
},
|
||||
{
|
||||
prop: 'buyer_nickname',
|
||||
label: '买家昵称',
|
||||
width: 130,
|
||||
formatter: (row: Order) => row.buyer_nickname || '-'
|
||||
},
|
||||
{
|
||||
prop: 'order_type',
|
||||
label: '订单类型',
|
||||
width: 120,
|
||||
formatter: (row: Order) => {
|
||||
return h(ElTag, { type: row.order_type === 'single_card' ? 'primary' : 'success' }, () =>
|
||||
getOrderTypeText(row.order_type)
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'buyer_type',
|
||||
label: '买家类型',
|
||||
width: 120,
|
||||
formatter: (row: Order) => {
|
||||
return h(ElTag, { type: row.buyer_type === 'personal' ? 'info' : 'warning' }, () =>
|
||||
getBuyerTypeText(row.buyer_type)
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'payment_status',
|
||||
label: '支付状态',
|
||||
width: 120,
|
||||
formatter: (row: Order) => {
|
||||
return h(
|
||||
ElTag,
|
||||
{ type: getPaymentStatusType(row.payment_status) },
|
||||
() => row.payment_status_text
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'asset_identifier',
|
||||
label: '资产标识符',
|
||||
width: 180,
|
||||
showOverflowTooltip: true,
|
||||
formatter: (row: Order) => row.asset_identifier || '-'
|
||||
},
|
||||
{
|
||||
prop: 'purchase_role',
|
||||
label: '订单渠道',
|
||||
width: 140,
|
||||
formatter: (row: Order) => {
|
||||
if (!row.purchase_role) return '-'
|
||||
const roleTypeMap: Record<string, 'success' | 'info' | 'warning' | 'danger'> = {
|
||||
self_purchase: 'success',
|
||||
purchased_by_parent: 'warning',
|
||||
purchased_by_platform: 'danger',
|
||||
purchase_for_subordinate: 'info'
|
||||
}
|
||||
return h(
|
||||
ElTag,
|
||||
{ type: roleTypeMap[row.purchase_role || ''] || 'info', size: 'small' },
|
||||
() => getPurchaseRoleText(row.purchase_role || '')
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'purchase_remark',
|
||||
label: '购买备注',
|
||||
minWidth: 180,
|
||||
showOverflowTooltip: true,
|
||||
formatter: (row: Order) => row.purchase_remark || '-'
|
||||
},
|
||||
{
|
||||
prop: 'created_at',
|
||||
label: '下单时间',
|
||||
width: 180,
|
||||
formatter: (row: Order) => formatDateTime(row.created_at)
|
||||
},
|
||||
{
|
||||
prop: 'operator_name',
|
||||
label: '操作者',
|
||||
width: 140,
|
||||
formatter: (row: Order) => row.operator_name || '-'
|
||||
},
|
||||
{
|
||||
prop: 'seller_shop_name',
|
||||
label: '销售店铺',
|
||||
width: 160,
|
||||
showOverflowTooltip: true,
|
||||
formatter: (row: Order) => row.seller_shop_name || '-'
|
||||
},
|
||||
{
|
||||
prop: 'commission_status_name',
|
||||
label: '佣金流程状态',
|
||||
width: 140,
|
||||
formatter: (row: Order) =>
|
||||
h(ElTag, { type: getCommissionStatusType(row.commission_status), size: 'small' }, () =>
|
||||
getCommissionStatusText(row.commission_status, row.commission_status_name)
|
||||
)
|
||||
},
|
||||
{
|
||||
prop: 'commission_result_name',
|
||||
label: '佣金业务结果',
|
||||
width: 140,
|
||||
formatter: (row: Order) =>
|
||||
h(ElTag, { type: getCommissionResultType(row.commission_result), size: 'small' }, () =>
|
||||
getCommissionResultText(row.commission_result, row.commission_result_name)
|
||||
)
|
||||
},
|
||||
{
|
||||
prop: 'total_amount',
|
||||
label: '订单金额',
|
||||
width: 120,
|
||||
formatter: (row: Order) => formatCurrency(row.total_amount)
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'purchase_remark',
|
||||
label: '购买备注',
|
||||
minWidth: 180,
|
||||
showOverflowTooltip: true,
|
||||
formatter: (row: Order) => row.purchase_remark || '-'
|
||||
},
|
||||
{
|
||||
prop: 'created_at',
|
||||
label: '下单时间',
|
||||
width: 180,
|
||||
formatter: (row: Order) => formatDateTime(row.created_at)
|
||||
},
|
||||
{
|
||||
prop: 'operator_name',
|
||||
label: '操作者',
|
||||
width: 140,
|
||||
formatter: (row: Order) => row.operator_name || '-'
|
||||
},
|
||||
{
|
||||
prop: 'seller_shop_name',
|
||||
label: '销售店铺',
|
||||
width: 160,
|
||||
showOverflowTooltip: true,
|
||||
formatter: (row: Order) => row.seller_shop_name || '-'
|
||||
},
|
||||
{
|
||||
prop: 'commission_status_name',
|
||||
label: '佣金流程状态',
|
||||
width: 140,
|
||||
formatter: (row: Order) =>
|
||||
h(ElTag, { type: getCommissionStatusType(row.commission_status), size: 'small' }, () =>
|
||||
getCommissionStatusText(row.commission_status, row.commission_status_name)
|
||||
)
|
||||
},
|
||||
{
|
||||
prop: 'commission_result_name',
|
||||
label: '佣金业务结果',
|
||||
width: 140,
|
||||
formatter: (row: Order) =>
|
||||
h(ElTag, { type: getCommissionResultType(row.commission_result), size: 'small' }, () =>
|
||||
getCommissionResultText(row.commission_result, row.commission_result_name)
|
||||
)
|
||||
},
|
||||
{
|
||||
prop: 'total_amount',
|
||||
label: '订单金额',
|
||||
width: 120,
|
||||
formatter: (row: Order) => formatCurrency(row.total_amount)
|
||||
},
|
||||
{
|
||||
prop: 'actual_paid_amount',
|
||||
label: '实付金额',
|
||||
width: 120,
|
||||
formatter: (row: Order) => {
|
||||
if (row.actual_paid_amount === undefined || row.actual_paid_amount === null) return '-'
|
||||
return formatCurrency(row.actual_paid_amount)
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'payment_method',
|
||||
label: '支付方式',
|
||||
width: 120,
|
||||
formatter: (row: Order) => getPaymentMethodText(row.payment_method)
|
||||
},
|
||||
{
|
||||
prop: 'paid_at',
|
||||
label: '支付时间',
|
||||
width: 180,
|
||||
formatter: (row: Order) => (row.paid_at ? formatDateTime(row.paid_at) : '-')
|
||||
]
|
||||
|
||||
// 只有非代理账号和非企业账号才能看到实付金额列
|
||||
if (canViewActualPaidAmount.value) {
|
||||
baseColumns.push({
|
||||
prop: 'actual_paid_amount',
|
||||
label: '实付金额',
|
||||
width: 120,
|
||||
formatter: (row: Order) => {
|
||||
if (row.actual_paid_amount === undefined || row.actual_paid_amount === null) return '-'
|
||||
return formatCurrency(row.actual_paid_amount)
|
||||
}
|
||||
})
|
||||
}
|
||||
])
|
||||
|
||||
baseColumns.push(
|
||||
{
|
||||
prop: 'payment_method',
|
||||
label: '支付方式',
|
||||
width: 120,
|
||||
formatter: (row: Order) => getPaymentMethodText(row.payment_method)
|
||||
},
|
||||
{
|
||||
prop: 'paid_at',
|
||||
label: '支付时间',
|
||||
width: 180,
|
||||
formatter: (row: Order) => (row.paid_at ? formatDateTime(row.paid_at) : '-')
|
||||
}
|
||||
)
|
||||
|
||||
return baseColumns
|
||||
})
|
||||
|
||||
// 当订单类型切换时,清空已选择的套餐
|
||||
watch(
|
||||
|
||||
Reference in New Issue
Block a user