fix: order
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m33s

This commit is contained in:
sexygoat
2026-04-30 10:39:51 +08:00
parent 1a4eb00440
commit 044c07fae6
10 changed files with 437 additions and 158 deletions

View File

@@ -60,14 +60,20 @@
</template>
<script setup lang="ts">
import { ref, onMounted, computed } from 'vue'
import { ref, onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { ElCard, ElButton, ElIcon, ElMessage, ElTable, ElTableColumn, ElTag } from 'element-plus'
import { ElCard, ElButton, ElIcon, ElMessage, ElTable, ElTableColumn } from 'element-plus'
import { ArrowLeft, Loading } from '@element-plus/icons-vue'
import DetailPage from '@/components/common/DetailPage.vue'
import type { DetailSection } from '@/components/common/DetailPage.vue'
import { OrderService } from '@/api/modules'
import type { Order } from '@/types/api'
import type {
Order,
OrderCommissionResult,
OrderCommissionStatus,
OrderOperatorType,
OrderPaymentMethod
} from '@/types/api'
import { formatDateTime } from '@/utils/business/format'
defineOptions({ name: 'OrderDetail' })
@@ -94,25 +100,61 @@
}
// 获取支付方式文本
const getPaymentMethodText = (method: string): string => {
const methodMap: Record<string, string> = {
const getPaymentMethodText = (method: OrderPaymentMethod): string => {
const methodMap: Record<OrderPaymentMethod, string> = {
wallet: '钱包支付',
wechat: '微信支付',
alipay: '支付宝支付'
alipay: '支付宝支付',
offline: '线下支付'
}
return methodMap[method] || method
}
// 获取佣金状态文本
const getCommissionStatusText = (status: number): string => {
const statusMap: Record<number, string> = {
0: '不适用',
1: '待结算',
2: '已结算'
// 获取操作者类型文本
const getOperatorTypeText = (type?: OrderOperatorType): string => {
if (!type) return '-'
const typeMap: Record<OrderOperatorType, string> = {
platform: '平台',
agent: '代理',
enterprise: '企业',
personal_customer: '个人客户'
}
return typeMap[type] || type
}
// 获取佣金流程状态文本
const getCommissionStatusText = (
status?: OrderCommissionStatus,
statusName?: string
): string => {
if (statusName) return statusName
if (status === undefined) return '-'
const statusMap: Record<OrderCommissionStatus, string> = {
1: '待计算',
2: '已完成',
3: '待人工处理'
}
return statusMap[status] || '-'
}
// 获取佣金业务结果文本
const getCommissionResultText = (
result?: OrderCommissionResult,
resultName?: string
): string => {
if (resultName) return resultName
if (result === undefined) return '-'
const resultMap: Record<OrderCommissionResult, string> = {
0: '未知',
1: '有佣金',
2: '无佣金',
3: '链路异常'
}
return resultMap[result] || '-'
}
// 获取订单角色文本
const getPurchaseRoleText = (role: string): string => {
const roleMap: Record<string, string> = {
@@ -173,6 +215,11 @@
prop: 'purchase_remark',
formatter: (value) => value || '-'
},
{
label: '支付时间',
prop: 'paid_at',
formatter: (value) => (value ? formatDateTime(value) : '-')
},
{
label: '是否上级代购',
formatter: (_, data) => (data.is_purchased_by_parent ? '是' : '否')
@@ -182,16 +229,6 @@
prop: 'asset_identifier',
formatter: (value) => value || '-'
},
{
label: '操作者类型',
prop: 'operator_type',
formatter: (value) => value || '-'
},
{
label: '操作者名称',
prop: 'operator_name',
formatter: (value) => value || '-'
},
{
label: '是否超时',
formatter: (_, data) => {
@@ -204,14 +241,6 @@
prop: 'expires_at',
formatter: (value) => (value ? formatDateTime(value) : '-')
},
{
label: '佣金状态',
formatter: (_, data) => getCommissionStatusText(data.commission_status)
},
{
label: '佣金配置版本',
prop: 'commission_config_version'
},
{
label: '创建时间',
prop: 'created_at',
@@ -223,6 +252,50 @@
formatter: (value) => formatDateTime(value)
}
]
},
{
title: '操作者信息',
fields: [
{
label: '操作者类型',
prop: 'operator_type',
formatter: (value) => getOperatorTypeText(value)
},
{
label: '操作者名称',
prop: 'operator_name',
formatter: (value) => value || '-'
}
]
},
{
title: '业务归属信息',
fields: [
{
label: '销售店铺名称',
prop: 'seller_shop_name',
formatter: (value) => value || '-'
}
]
},
{
title: '佣金信息',
fields: [
{
label: '流程状态',
formatter: (_, data) =>
getCommissionStatusText(data.commission_status, data.commission_status_name)
},
{
label: '业务结果',
formatter: (_, data) =>
getCommissionResultText(data.commission_result, data.commission_result_name)
},
{
label: '佣金配置版本',
prop: 'commission_config_version'
}
]
}
]