功能:新增下一阶段运营能力和生产部署
This commit is contained in:
@@ -76,6 +76,22 @@
|
||||
<template v-else-if="column.key === 'actions'">
|
||||
<a-space>
|
||||
<a-button type="link" size="small" @click="currentOrder = record">查看</a-button>
|
||||
<a-button
|
||||
v-if="canManagePayments && record.paymentStatus !== 'PAID'"
|
||||
type="link"
|
||||
size="small"
|
||||
@click="openManualPay(record)"
|
||||
>
|
||||
手动确认支付
|
||||
</a-button>
|
||||
<a-button
|
||||
v-if="canViewAfterSales"
|
||||
type="link"
|
||||
size="small"
|
||||
@click="openAfterSales(record)"
|
||||
>
|
||||
售后
|
||||
</a-button>
|
||||
<a-button
|
||||
v-if="record.status === 1 && canProcessOrders"
|
||||
type="primary"
|
||||
@@ -129,6 +145,20 @@
|
||||
</div>
|
||||
<div class="admin-mobile-card__actions">
|
||||
<a-button size="small" @click="currentOrder = item">查看详情</a-button>
|
||||
<a-button
|
||||
v-if="canManagePayments && item.paymentStatus !== 'PAID'"
|
||||
size="small"
|
||||
@click="openManualPay(item)"
|
||||
>
|
||||
确认支付
|
||||
</a-button>
|
||||
<a-button
|
||||
v-if="canViewAfterSales"
|
||||
size="small"
|
||||
@click="openAfterSales(item)"
|
||||
>
|
||||
售后
|
||||
</a-button>
|
||||
<a-button
|
||||
v-if="item.status === 1 && canProcessOrders"
|
||||
size="small"
|
||||
@@ -209,6 +239,29 @@
|
||||
</div>
|
||||
</template>
|
||||
</AdminResponsiveModal>
|
||||
|
||||
<AdminResponsiveModal
|
||||
v-model:open="manualPayOpen"
|
||||
title="手动确认支付"
|
||||
:desktop-width="560"
|
||||
:confirm-loading="manualPayLoading"
|
||||
@ok="submitManualPay"
|
||||
@cancel="closeManualPay"
|
||||
>
|
||||
<a-form layout="vertical">
|
||||
<a-alert
|
||||
v-if="manualPayOrder"
|
||||
class="order-action-alert"
|
||||
type="warning"
|
||||
show-icon
|
||||
:message="manualPayOrder.orderNo"
|
||||
:description="`将把订单标记为已支付,实付金额 ¥${moneyText(manualPayOrder.actualAmount || manualPayOrder.totalAmount)}`"
|
||||
/>
|
||||
<a-form-item label="确认备注">
|
||||
<a-textarea v-model:value="manualPayRemark" :rows="3" :maxlength="200" placeholder="例如:线下现金已核验" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</AdminResponsiveModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -219,6 +272,7 @@
|
||||
*/
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { message } from 'ant-design-vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
/**
|
||||
* Purpose: Shop supports OrdersView.vue by holding or executing the shop page or API role.
|
||||
* Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
@@ -233,6 +287,7 @@ import AdminMobileCardList from '@/components/admin/AdminMobileCardList.vue'
|
||||
import AdminResponsiveModal from '@/components/admin/AdminResponsiveModal.vue'
|
||||
|
||||
const { isMobile } = useAdminViewport()
|
||||
const router = useRouter()
|
||||
/**
|
||||
* Purpose: orders supports OrdersView.vue by holding or executing the orders page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
@@ -250,6 +305,10 @@ const shopLoading = ref(false)
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const currentOrder = ref<any | null>(null)
|
||||
const manualPayOpen = ref(false)
|
||||
const manualPayLoading = ref(false)
|
||||
const manualPayOrder = ref<any | null>(null)
|
||||
const manualPayRemark = ref('')
|
||||
/**
|
||||
* Purpose: currentUserType supports OrdersView.vue by holding or executing the current user type page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
@@ -324,6 +383,8 @@ const detailVisible = computed({
|
||||
})
|
||||
/** canProcessOrders is a reactive state variable used by the template and event handlers. */
|
||||
const canProcessOrders = computed(() => hasPermission('order:process'))
|
||||
const canManagePayments = computed(() => hasPermission('payment:manage'))
|
||||
const canViewAfterSales = computed(() => hasPermission('after_sale:view'))
|
||||
/** isArtist is a reactive state variable used by the template and event handlers. */
|
||||
const isArtist = computed(() => currentUserType.value === 3)
|
||||
/**
|
||||
@@ -445,6 +506,8 @@ const statusColor = (status: number) => {
|
||||
return 'default'
|
||||
}
|
||||
|
||||
const moneyText = (value?: number) => Number(value || 0).toFixed(2)
|
||||
|
||||
/**
|
||||
* Purpose: normalizeUserType supports OrdersView.vue by holding or executing the normalize user type page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
@@ -530,6 +593,43 @@ const process = async (orderId: IdType, status: number) => {
|
||||
}
|
||||
}
|
||||
|
||||
const openManualPay = (order: any) => {
|
||||
manualPayOrder.value = order
|
||||
manualPayRemark.value = ''
|
||||
manualPayOpen.value = true
|
||||
}
|
||||
|
||||
const closeManualPay = () => {
|
||||
manualPayOpen.value = false
|
||||
manualPayOrder.value = null
|
||||
manualPayRemark.value = ''
|
||||
}
|
||||
|
||||
const submitManualPay = async () => {
|
||||
if (!manualPayOrder.value) return
|
||||
manualPayLoading.value = true
|
||||
try {
|
||||
await runWithGlobalLoading(async () => {
|
||||
await adminOrderApi.manualConfirmPayment(manualPayOrder.value.id, manualPayRemark.value.trim() || undefined)
|
||||
await loadOrders()
|
||||
})
|
||||
message.success('支付已确认')
|
||||
closeManualPay()
|
||||
} catch (error: any) {
|
||||
console.error('手动确认支付失败:', error)
|
||||
message.error(error?.message || '手动确认支付失败')
|
||||
} finally {
|
||||
manualPayLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const openAfterSales = (order: any) => {
|
||||
router.push({
|
||||
path: '/admin/after-sales',
|
||||
query: { orderId: String(order.id) }
|
||||
})
|
||||
}
|
||||
|
||||
/** noop is a local helper used by this page script. */
|
||||
const noop = () => {}
|
||||
|
||||
@@ -557,4 +657,8 @@ onMounted(async () => {
|
||||
gap: 10px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.order-action-alert {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user