详情修改
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m48s

This commit is contained in:
sexygoat
2026-03-06 17:51:27 +08:00
parent 1ebc0b8929
commit 8fbc321a5e
9 changed files with 211 additions and 85 deletions

View File

@@ -655,7 +655,20 @@
{
prop: 'order_no',
label: t('orderManagement.table.orderNo'),
minWidth: 220
minWidth: 220,
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: 'order_type',
@@ -1008,6 +1021,15 @@
})
}
// 处理名称点击
const handleNameClick = (row: Order) => {
if (hasAuth('orders:view_detail')) {
showOrderDetail(row)
} else {
ElMessage.warning('您没有查看详情的权限')
}
}
// 取消订单
const handleCancelOrder = (row: Order) => {
// 已支付的订单不能取消
@@ -1045,10 +1067,6 @@
const items: MenuItemType[] = []
if (hasAuth('orders:view_detail')) {
items.push({ key: 'detail', label: '详情' })
}
// 只有待支付和已支付的订单可以删除
if (
(currentRow.value.payment_status === 1 || currentRow.value.payment_status === 2) &&
@@ -1073,9 +1091,6 @@
if (!currentRow.value) return
switch (item.key) {
case 'detail':
showOrderDetail(currentRow.value)
break
case 'cancel':
handleCancelOrder(currentRow.value)
break