|
@@ -3,35 +3,21 @@
|
|
<!-- 订单信息 -->
|
|
<!-- 订单信息 -->
|
|
<el-descriptions title="订单信息">
|
|
<el-descriptions title="订单信息">
|
|
<el-descriptions-item label="订单号: ">{{ formData.no }}</el-descriptions-item>
|
|
<el-descriptions-item label="订单号: ">{{ formData.no }}</el-descriptions-item>
|
|
- <el-descriptions-item label="配送方式: ">
|
|
|
|
- <dict-tag :type="DICT_TYPE.TRADE_DELIVERY_TYPE" :value="formData.deliveryType!" />
|
|
|
|
- </el-descriptions-item>
|
|
|
|
- <!-- TODO 营销活动待实现 -->
|
|
|
|
- <el-descriptions-item label="营销活动: ">秒杀活动</el-descriptions-item>
|
|
|
|
|
|
+ <el-descriptions-item label="买家: ">{{ formData?.user?.nickname }}</el-descriptions-item>
|
|
<el-descriptions-item label="订单类型: ">
|
|
<el-descriptions-item label="订单类型: ">
|
|
<dict-tag :type="DICT_TYPE.TRADE_ORDER_TYPE" :value="formData.type!" />
|
|
<dict-tag :type="DICT_TYPE.TRADE_ORDER_TYPE" :value="formData.type!" />
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
- <el-descriptions-item label="收货人: ">{{ formData.receiverName }}</el-descriptions-item>
|
|
|
|
- <el-descriptions-item label="买家留言: ">{{ formData.userRemark }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="订单来源: ">
|
|
<el-descriptions-item label="订单来源: ">
|
|
<dict-tag :type="DICT_TYPE.TERMINAL" :value="formData.terminal!" />
|
|
<dict-tag :type="DICT_TYPE.TERMINAL" :value="formData.terminal!" />
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
- <el-descriptions-item label="联系电话: ">{{ formData.receiverMobile }}</el-descriptions-item>
|
|
|
|
|
|
+ <el-descriptions-item label="买家留言: ">{{ formData.userRemark }}</el-descriptions-item>
|
|
<el-descriptions-item label="商家备注: ">{{ formData.remark }}</el-descriptions-item>
|
|
<el-descriptions-item label="商家备注: ">{{ formData.remark }}</el-descriptions-item>
|
|
<el-descriptions-item label="支付单号: ">{{ formData.payOrderId }}</el-descriptions-item>
|
|
<el-descriptions-item label="支付单号: ">{{ formData.payOrderId }}</el-descriptions-item>
|
|
<el-descriptions-item label="付款方式: ">
|
|
<el-descriptions-item label="付款方式: ">
|
|
<dict-tag :type="DICT_TYPE.PAY_CHANNEL_CODE" :value="formData.payChannelCode!" />
|
|
<dict-tag :type="DICT_TYPE.PAY_CHANNEL_CODE" :value="formData.payChannelCode!" />
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
- <!-- <el-descriptions-item label="买家: ">{{ formData.user.nickname }}</el-descriptions-item> -->
|
|
|
|
- <!-- TODO @puhui999:待实现:跳转会员 -->
|
|
|
|
- <el-descriptions-item label="收货地址: ">
|
|
|
|
- {{ formData.receiverAreaName }} {{ formData.receiverDetailAddress }}
|
|
|
|
- <el-link
|
|
|
|
- v-clipboard:copy="formData.receiverAreaName + ' ' + formData.receiverDetailAddress"
|
|
|
|
- v-clipboard:success="clipboardSuccess"
|
|
|
|
- icon="ep:document-copy"
|
|
|
|
- type="primary"
|
|
|
|
- />
|
|
|
|
|
|
+ <el-descriptions-item label="推广用户: " v-if="formData.brokerageUser">
|
|
|
|
+ {{ formData.brokerageUser?.nickname }}
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
</el-descriptions>
|
|
</el-descriptions>
|
|
|
|
|
|
@@ -41,16 +27,40 @@
|
|
<dict-tag :type="DICT_TYPE.TRADE_ORDER_STATUS" :value="formData.status!" />
|
|
<dict-tag :type="DICT_TYPE.TRADE_ORDER_STATUS" :value="formData.status!" />
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label-class-name="no-colon">
|
|
<el-descriptions-item label-class-name="no-colon">
|
|
- <el-button v-if="formData.status! === 0" type="primary" @click="updatePrice">
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="formData.status! === TradeOrderStatusEnum.UNPAID.status"
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="updatePrice"
|
|
|
|
+ >
|
|
调整价格
|
|
调整价格
|
|
</el-button>
|
|
</el-button>
|
|
<el-button type="primary" @click="remark">备注</el-button>
|
|
<el-button type="primary" @click="remark">备注</el-button>
|
|
- <el-button v-if="formData.status! === 10" type="primary" @click="delivery">
|
|
|
|
- 发货
|
|
|
|
- </el-button>
|
|
|
|
- <el-button v-if="formData.status! === 10" type="primary" @click="updateAddress">
|
|
|
|
- 修改地址
|
|
|
|
- </el-button>
|
|
|
|
|
|
+ <!-- 待发货 -->
|
|
|
|
+ <template v-if="formData.status! === TradeOrderStatusEnum.UNDELIVERED.status">
|
|
|
|
+ <!-- 快递发货 -->
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="formData.deliveryType === DeliveryTypeEnum.EXPRESS.type"
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="delivery"
|
|
|
|
+ >
|
|
|
|
+ 发货
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="formData.deliveryType === DeliveryTypeEnum.EXPRESS.type"
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="updateAddress"
|
|
|
|
+ >
|
|
|
|
+ 修改地址
|
|
|
|
+ </el-button>
|
|
|
|
+ <!-- 到店自提 -->
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="formData.deliveryType === DeliveryTypeEnum.PICK_UP.type"
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="handlePickUp"
|
|
|
|
+ >
|
|
|
|
+ 核销
|
|
|
|
+ </el-button>
|
|
|
|
+ </template>
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
<el-descriptions-item>
|
|
<el-descriptions-item>
|
|
<template #label><span style="color: red">提醒: </span></template>
|
|
<template #label><span style="color: red">提醒: </span></template>
|
|
@@ -75,11 +85,11 @@
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="商品原价" prop="price" width="150">
|
|
<el-table-column label="商品原价" prop="price" width="150">
|
|
- <template #default="{ row }">{{ floatToFixed2(row.price) }}元</template>
|
|
|
|
|
|
+ <template #default="{ row }">{{ fenToYuan(row.price) }}元</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="数量" prop="count" width="100" />
|
|
<el-table-column label="数量" prop="count" width="100" />
|
|
<el-table-column label="合计" prop="payPrice" width="150">
|
|
<el-table-column label="合计" prop="payPrice" width="150">
|
|
- <template #default="{ row }">{{ floatToFixed2(row.payPrice) }}元</template>
|
|
|
|
|
|
+ <template #default="{ row }">{{ fenToYuan(row.payPrice) }}元</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="售后状态" prop="afterSaleStatus" width="120">
|
|
<el-table-column label="售后状态" prop="afterSaleStatus" width="120">
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
@@ -95,64 +105,91 @@
|
|
</el-row>
|
|
</el-row>
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
</el-descriptions>
|
|
</el-descriptions>
|
|
- <el-descriptions :column="6">
|
|
|
|
|
|
+ <el-descriptions :column="4">
|
|
|
|
+ <!-- 第一层 -->
|
|
<el-descriptions-item label="商品总额: ">
|
|
<el-descriptions-item label="商品总额: ">
|
|
- {{ floatToFixed2(formData.totalPrice!) }}元
|
|
|
|
|
|
+ {{ fenToYuan(formData.totalPrice!) }} 元
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="运费金额: ">
|
|
<el-descriptions-item label="运费金额: ">
|
|
- {{ floatToFixed2(formData.deliveryPrice!) }}元
|
|
|
|
|
|
+ {{ fenToYuan(formData.deliveryPrice!) }} 元
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="订单调价: ">
|
|
<el-descriptions-item label="订单调价: ">
|
|
- {{ floatToFixed2(formData.adjustPrice!) }}元
|
|
|
|
|
|
+ {{ fenToYuan(formData.adjustPrice!) }} 元
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
+ <el-descriptions-item v-for="item in 1" :key="item" label-class-name="no-colon" />
|
|
|
|
+ <!-- 第二层 -->
|
|
|
|
+ <el-descriptions-item>
|
|
|
|
+ <template #label><span style="color: red">优惠劵优惠: </span></template>
|
|
|
|
+ {{ fenToYuan(formData.couponPrice!) }} 元
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
-
|
|
|
|
<el-descriptions-item>
|
|
<el-descriptions-item>
|
|
- <template #label><span style="color: red">商品优惠: </span></template>
|
|
|
|
- {{ floatToFixed2(formData.couponPrice!) }}元
|
|
|
|
|
|
+ <template #label><span style="color: red">VIP 优惠: </span></template>
|
|
|
|
+ {{ fenToYuan(formData.vipPrice!) }} 元
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
<el-descriptions-item>
|
|
<el-descriptions-item>
|
|
- <template #label><span style="color: red">订单优惠: </span></template>
|
|
|
|
- {{ floatToFixed2(formData.discountPrice!) }}元
|
|
|
|
|
|
+ <template #label><span style="color: red">活动优惠: </span></template>
|
|
|
|
+ {{ fenToYuan(formData.discountPrice!) }} 元
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
<el-descriptions-item>
|
|
<el-descriptions-item>
|
|
<template #label><span style="color: red">积分抵扣: </span></template>
|
|
<template #label><span style="color: red">积分抵扣: </span></template>
|
|
- {{ floatToFixed2(formData.pointPrice!) }}元
|
|
|
|
|
|
+ {{ fenToYuan(formData.pointPrice!) }} 元
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
-
|
|
|
|
- <el-descriptions-item v-for="item in 5" :key="item" label-class-name="no-colon" />
|
|
|
|
- <!-- 占位 -->
|
|
|
|
|
|
+ <!-- 第三层 -->
|
|
|
|
+ <el-descriptions-item v-for="item in 3" :key="item" label-class-name="no-colon" />
|
|
<el-descriptions-item label="应付金额: ">
|
|
<el-descriptions-item label="应付金额: ">
|
|
- {{ floatToFixed2(formData.payPrice!) }}元
|
|
|
|
|
|
+ {{ fenToYuan(formData.payPrice!) }} 元
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
</el-descriptions>
|
|
</el-descriptions>
|
|
|
|
|
|
- <!-- TODO 芋艿:需要改改 -->
|
|
|
|
- <el-descriptions :column="4" title="物流信息">
|
|
|
|
- <el-descriptions-item label="物流公司: ">
|
|
|
|
- {{ deliveryExpressList.find((item) => item.id === formData.logisticsId)?.name }}
|
|
|
|
- </el-descriptions-item>
|
|
|
|
- <el-descriptions-item label="运单号: ">{{ formData.logisticsNo }}</el-descriptions-item>
|
|
|
|
- <el-descriptions-item label="发货时间: ">
|
|
|
|
- {{ formatDate(formData.deliveryTime!) }}
|
|
|
|
- </el-descriptions-item>
|
|
|
|
- <el-descriptions-item label="物流状态: ">
|
|
|
|
- <!-- TODO 物流状态怎么获取? -->
|
|
|
|
- <dict-tag :type="DICT_TYPE.TRADE_ORDER_STATUS" :value="formData.deliveryStatus!" />
|
|
|
|
- </el-descriptions-item>
|
|
|
|
- <!-- 占位 4 -->
|
|
|
|
- <el-descriptions-item v-for="item in 4" :key="item" label-class-name="no-colon" />
|
|
|
|
- <el-descriptions-item label="物流详情: ">
|
|
|
|
- <el-timeline>
|
|
|
|
- <el-timeline-item
|
|
|
|
- v-for="(express, index) in expressTrackList"
|
|
|
|
- :key="index"
|
|
|
|
- :timestamp="formatDate(express.time)"
|
|
|
|
- >
|
|
|
|
- {{ express.content }}
|
|
|
|
- </el-timeline-item>
|
|
|
|
- </el-timeline>
|
|
|
|
|
|
+ <!-- 物流信息 -->
|
|
|
|
+ <el-descriptions :column="4" title="收货信息">
|
|
|
|
+ <el-descriptions-item label="配送方式: ">
|
|
|
|
+ <dict-tag :type="DICT_TYPE.TRADE_DELIVERY_TYPE" :value="formData.deliveryType!" />
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="收货人: ">{{ formData.receiverName }}</el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="联系电话: ">{{ formData.receiverMobile }}</el-descriptions-item>
|
|
|
|
+ <!-- 快递配送 -->
|
|
|
|
+ <div v-if="formData.deliveryType === DeliveryTypeEnum.EXPRESS.type">
|
|
|
|
+ <el-descriptions-item label="收货地址: " v-if="formData.receiverDetailAddress">
|
|
|
|
+ {{ formData.receiverAreaName }} {{ formData.receiverDetailAddress }}
|
|
|
|
+ <el-link
|
|
|
|
+ v-clipboard:copy="formData.receiverAreaName + ' ' + formData.receiverDetailAddress"
|
|
|
|
+ v-clipboard:success="clipboardSuccess"
|
|
|
|
+ icon="ep:document-copy"
|
|
|
|
+ type="primary"
|
|
|
|
+ />
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="物流公司: " v-if="formData.logisticsId">
|
|
|
|
+ {{ deliveryExpressList.find((item) => item.id === formData.logisticsId)?.name }}
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="运单号: " v-if="formData.logisticsId">
|
|
|
|
+ {{ formData.logisticsNo }}
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="发货时间: " v-if="formatDate.deliveryTime">
|
|
|
|
+ {{ formatDate(formData.deliveryTime) }}
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
+ <el-descriptions-item v-for="item in 2" :key="item" label-class-name="no-colon" />
|
|
|
|
+ <el-descriptions-item label="物流详情: " v-if="expressTrackList.length > 0">
|
|
|
|
+ <el-timeline>
|
|
|
|
+ <el-timeline-item
|
|
|
|
+ v-for="(express, index) in expressTrackList"
|
|
|
|
+ :key="index"
|
|
|
|
+ :timestamp="formatDate(express.time)"
|
|
|
|
+ >
|
|
|
|
+ {{ express.content }}
|
|
|
|
+ </el-timeline-item>
|
|
|
|
+ </el-timeline>
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
+ </div>
|
|
|
|
+ <!-- 自提门店 -->
|
|
|
|
+ <div v-if="formData.deliveryType === DeliveryTypeEnum.PICK_UP.type">
|
|
|
|
+ <el-descriptions-item label="自提门店: " v-if="formData.pickUpStoreId">
|
|
|
|
+ {{ pickUpStore?.name }}
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
+ </div>
|
|
</el-descriptions>
|
|
</el-descriptions>
|
|
|
|
+
|
|
|
|
+ <!-- 订单日志 -->
|
|
<el-descriptions title="订单操作日志">
|
|
<el-descriptions title="订单操作日志">
|
|
<el-descriptions-item labelClassName="no-colon">
|
|
<el-descriptions-item labelClassName="no-colon">
|
|
<el-timeline>
|
|
<el-timeline>
|
|
@@ -187,7 +224,7 @@
|
|
</template>
|
|
</template>
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
import * as TradeOrderApi from '@/api/mall/trade/order'
|
|
import * as TradeOrderApi from '@/api/mall/trade/order'
|
|
-import { floatToFixed2 } from '@/utils'
|
|
|
|
|
|
+import { fenToYuan } from '@/utils'
|
|
import { formatDate } from '@/utils/formatTime'
|
|
import { formatDate } from '@/utils/formatTime'
|
|
import { DICT_TYPE, getDictLabel, getDictObj } from '@/utils/dict'
|
|
import { DICT_TYPE, getDictLabel, getDictObj } from '@/utils/dict'
|
|
import OrderUpdateRemarkForm from '@/views/mall/trade/order/form/OrderUpdateRemarkForm.vue'
|
|
import OrderUpdateRemarkForm from '@/views/mall/trade/order/form/OrderUpdateRemarkForm.vue'
|
|
@@ -196,6 +233,8 @@ import OrderUpdateAddressForm from '@/views/mall/trade/order/form/OrderUpdateAdd
|
|
import OrderUpdatePriceForm from '@/views/mall/trade/order/form/OrderUpdatePriceForm.vue'
|
|
import OrderUpdatePriceForm from '@/views/mall/trade/order/form/OrderUpdatePriceForm.vue'
|
|
import * as DeliveryExpressApi from '@/api/mall/trade/delivery/express'
|
|
import * as DeliveryExpressApi from '@/api/mall/trade/delivery/express'
|
|
import { useTagsViewStore } from '@/store/modules/tagsView'
|
|
import { useTagsViewStore } from '@/store/modules/tagsView'
|
|
|
|
+import { DeliveryTypeEnum, TradeOrderStatusEnum } from '@/utils/constants'
|
|
|
|
+import * as DeliveryPickUpStoreApi from '@/api/mall/trade/delivery/pickUpStore'
|
|
|
|
|
|
defineOptions({ name: 'TradeOrderDetail' })
|
|
defineOptions({ name: 'TradeOrderDetail' })
|
|
|
|
|
|
@@ -240,14 +279,27 @@ const updatePrice = () => {
|
|
updatePriceFormRef.value?.open(formData.value)
|
|
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 { params } = useRoute() // 查询参数
|
|
const getDetail = async () => {
|
|
const getDetail = async () => {
|
|
- const id = params.orderId as unknown as number
|
|
|
|
|
|
+ const id = params.id as unknown as number
|
|
if (id) {
|
|
if (id) {
|
|
const res = (await TradeOrderApi.getOrder(id)) as TradeOrderApi.OrderVO
|
|
const res = (await TradeOrderApi.getOrder(id)) as TradeOrderApi.OrderVO
|
|
// 没有表单信息则关闭页面返回
|
|
// 没有表单信息则关闭页面返回
|
|
- if (res === null) {
|
|
|
|
|
|
+ if (!res) {
|
|
message.error('交易订单不存在')
|
|
message.error('交易订单不存在')
|
|
close()
|
|
close()
|
|
}
|
|
}
|
|
@@ -271,10 +323,20 @@ const clipboardSuccess = () => {
|
|
/** 初始化 **/
|
|
/** 初始化 **/
|
|
const deliveryExpressList = ref([]) // 物流公司
|
|
const deliveryExpressList = ref([]) // 物流公司
|
|
const expressTrackList = ref([]) // 物流详情
|
|
const expressTrackList = ref([]) // 物流详情
|
|
|
|
+const pickUpStore = ref({}) // 自提门店
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
await getDetail()
|
|
await getDetail()
|
|
- deliveryExpressList.value = await DeliveryExpressApi.getSimpleDeliveryExpressList()
|
|
|
|
- expressTrackList.value = await TradeOrderApi.getExpressTrackList(formData.value.id!)
|
|
|
|
|
|
+ // 如果配送方式为快递,则查询物流公司
|
|
|
|
+ if (formData.value.deliveryType === DeliveryTypeEnum.EXPRESS.type) {
|
|
|
|
+ deliveryExpressList.value = await DeliveryExpressApi.getSimpleDeliveryExpressList()
|
|
|
|
+ if (form.value.logisticsId) {
|
|
|
|
+ expressTrackList.value = await TradeOrderApi.getExpressTrackList(formData.value.id!)
|
|
|
|
+ }
|
|
|
|
+ } else if (formData.value.deliveryType === DeliveryTypeEnum.PICK_UP.type) {
|
|
|
|
+ pickUpStore.value = await DeliveryPickUpStoreApi.getDeliveryPickUpStore(
|
|
|
|
+ formData.value.pickUpStoreId
|
|
|
|
+ )
|
|
|
|
+ }
|
|
})
|
|
})
|
|
</script>
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
@@ -312,7 +374,7 @@ onMounted(async () => {
|
|
|
|
|
|
// 时间线样式调整
|
|
// 时间线样式调整
|
|
:deep(.el-timeline) {
|
|
:deep(.el-timeline) {
|
|
- margin: 10px 0px 0px 160px;
|
|
|
|
|
|
+ margin: 10px 0 0 160px;
|
|
|
|
|
|
.el-timeline-item__wrapper {
|
|
.el-timeline-item__wrapper {
|
|
position: relative;
|
|
position: relative;
|