This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user