This commit is contained in:
@@ -273,6 +273,7 @@
|
||||
<script setup lang="ts">
|
||||
import { h } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { OrderService, CardService, DeviceService, PackageManageService } from '@/api/modules'
|
||||
import { ElMessage, ElMessageBox, ElTag } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
@@ -296,10 +297,12 @@
|
||||
import ArtMenuRight from '@/components/core/others/ArtMenuRight.vue'
|
||||
import type { MenuItemType } from '@/components/core/others/ArtMenuRight.vue'
|
||||
import { formatDateTime } from '@/utils/business/format'
|
||||
import { RoutesAlias } from '@/router/routesAlias'
|
||||
|
||||
defineOptions({ name: 'OrderList' })
|
||||
|
||||
const { t } = useI18n()
|
||||
const router = useRouter()
|
||||
const { hasAuth } = useAuth()
|
||||
|
||||
const loading = ref(false)
|
||||
@@ -855,16 +858,10 @@
|
||||
}
|
||||
|
||||
// 查看订单详情
|
||||
const showOrderDetail = async (row: Order) => {
|
||||
try {
|
||||
const res = await OrderService.getOrderById(row.id)
|
||||
if (res.code === 0) {
|
||||
currentOrder.value = res.data
|
||||
detailDialogVisible.value = true
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
const showOrderDetail = (row: Order) => {
|
||||
router.push({
|
||||
path: `${RoutesAlias.OrderList}/detail/${row.id}`
|
||||
})
|
||||
}
|
||||
|
||||
// 取消订单
|
||||
@@ -904,10 +901,15 @@
|
||||
|
||||
const items: MenuItemType[] = []
|
||||
|
||||
items.push({ key: 'detail', label: '详情' })
|
||||
if (hasAuth('orders:view_detail')) {
|
||||
items.push({ key: 'detail', label: '详情' })
|
||||
}
|
||||
|
||||
// 只有待支付和已支付的订单可以取消
|
||||
if (currentRow.value.payment_status === 1 || currentRow.value.payment_status === 2) {
|
||||
// 只有待支付和已支付的订单可以删除
|
||||
if (
|
||||
(currentRow.value.payment_status === 1 || currentRow.value.payment_status === 2) &&
|
||||
hasAuth('orders:delete')
|
||||
) {
|
||||
items.push({ key: 'cancel', label: '删除' })
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user