From 58b6b1ba578c1f869a82bfd028e86543092419e9 Mon Sep 17 00:00:00 2001 From: owen Date: Wed, 4 Oct 2023 10:51:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A4=E6=98=93=EF=BC=9A=E6=A0=B8=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mall/trade/order/index.ts | 5 ++ src/utils/constants.ts | 25 ++++++++ src/views/mall/trade/order/detail/index.vue | 63 +++++++++++++++------ src/views/mall/trade/order/index.vue | 46 ++++++++++++--- 4 files changed, 115 insertions(+), 24 deletions(-) diff --git a/src/api/mall/trade/order/index.ts b/src/api/mall/trade/order/index.ts index c77e939b..ea78275f 100644 --- a/src/api/mall/trade/order/index.ts +++ b/src/api/mall/trade/order/index.ts @@ -139,3 +139,8 @@ export const updateOrderPrice = async (data: any) => { export const updateOrderAddress = async (data: any) => { return await request.put({ url: `/trade/order/update-address`, data }) } + +// 订单核销 +export const pickUpOrder = async (id: number) => { + return await request.put({ url: `/trade/order/pick-up?id=${id}` }) +} diff --git a/src/utils/constants.ts b/src/utils/constants.ts index a3dc4c2c..41891a4a 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -389,3 +389,28 @@ export const DeliveryTypeEnum = { name: '到店自提' } } +/** + * 交易订单 - 状态 + */ +export const TradeOrderStatusEnum = { + UNPAID: { + status: 0, + name: '待支付' + }, + UNDELIVERED: { + status: 10, + name: '待发货' + }, + DELIVERED: { + status: 20, + name: '已发货' + }, + COMPLETED: { + status: 30, + name: '已完成' + }, + CANCELED: { + status: 40, + name: '已取消' + } +} diff --git a/src/views/mall/trade/order/detail/index.vue b/src/views/mall/trade/order/detail/index.vue index b52876d7..58939dbc 100644 --- a/src/views/mall/trade/order/detail/index.vue +++ b/src/views/mall/trade/order/detail/index.vue @@ -27,24 +27,40 @@ - + 调整价格 备注 - - 发货 - - - 修改地址 - + + @@ -168,7 +184,7 @@
- {{ pickUpStore.name }} + {{ pickUpStore?.name }}
@@ -217,7 +233,7 @@ import OrderUpdateAddressForm from '@/views/mall/trade/order/form/OrderUpdateAdd import OrderUpdatePriceForm from '@/views/mall/trade/order/form/OrderUpdatePriceForm.vue' import * as DeliveryExpressApi from '@/api/mall/trade/delivery/express' import { useTagsViewStore } from '@/store/modules/tagsView' -import { DeliveryTypeEnum } from '@/utils/constants' +import { DeliveryTypeEnum, TradeOrderStatusEnum } from '@/utils/constants' import * as DeliveryPickUpStoreApi from '@/api/mall/trade/delivery/pickUpStore' defineOptions({ name: 'TradeOrderDetail' }) @@ -263,6 +279,19 @@ const updatePrice = () => { updatePriceFormRef.value?.open(formData.value) } +/** 核销 */ +const handlePickUp = async () => { + try { + // 二次确认 + await message.confirm('确认核销订单吗?') + // 提交 + await TradeOrderApi.pickUpOrder(formData.value.id!) + message.success('核销成功') + // 刷新列表 + await getDetail() + } catch {} +} + /** 获得详情 */ const { params } = useRoute() // 查询参数 const getDetail = async () => { diff --git a/src/views/mall/trade/order/index.vue b/src/views/mall/trade/order/index.vue index a7857305..3fecf5aa 100644 --- a/src/views/mall/trade/order/index.vue +++ b/src/views/mall/trade/order/index.vue @@ -74,7 +74,11 @@ /> - + - + + + + @@ -234,7 +255,10 @@