|
3 | 3 | <!-- 订单信息 -->
|
4 | 4 | <el-descriptions title="订单信息">
|
5 | 5 | <el-descriptions-item label="订单号: ">{{ formData.no }}</el-descriptions-item>
|
6 |
| - <el-descriptions-item label="配送方式: "> |
7 |
| - <dict-tag :type="DICT_TYPE.TRADE_DELIVERY_TYPE" :value="formData.deliveryType!" /> |
8 |
| - </el-descriptions-item> |
9 |
| - <!-- TODO 营销活动待实现 --> |
10 |
| - <el-descriptions-item label="营销活动: ">秒杀活动</el-descriptions-item> |
| 6 | + <el-descriptions-item label="买家: ">{{ formData?.user?.nickname }}</el-descriptions-item> |
11 | 7 | <el-descriptions-item label="订单类型: ">
|
12 | 8 | <dict-tag :type="DICT_TYPE.TRADE_ORDER_TYPE" :value="formData.type!" />
|
13 | 9 | </el-descriptions-item>
|
14 |
| - <el-descriptions-item label="收货人: ">{{ formData.receiverName }}</el-descriptions-item> |
15 |
| - <el-descriptions-item label="买家留言: ">{{ formData.userRemark }}</el-descriptions-item> |
16 | 10 | <el-descriptions-item label="订单来源: ">
|
17 | 11 | <dict-tag :type="DICT_TYPE.TERMINAL" :value="formData.terminal!" />
|
18 | 12 | </el-descriptions-item>
|
19 |
| - <el-descriptions-item label="联系电话: ">{{ formData.receiverMobile }}</el-descriptions-item> |
| 13 | + <el-descriptions-item label="买家留言: ">{{ formData.userRemark }}</el-descriptions-item> |
20 | 14 | <el-descriptions-item label="商家备注: ">{{ formData.remark }}</el-descriptions-item>
|
21 | 15 | <el-descriptions-item label="支付单号: ">{{ formData.payOrderId }}</el-descriptions-item>
|
22 | 16 | <el-descriptions-item label="付款方式: ">
|
23 | 17 | <dict-tag :type="DICT_TYPE.PAY_CHANNEL_CODE" :value="formData.payChannelCode!" />
|
24 | 18 | </el-descriptions-item>
|
25 |
| - <!-- <el-descriptions-item label="买家: ">{{ formData.user.nickname }}</el-descriptions-item> --> |
26 |
| - <!-- TODO @puhui999:待实现:跳转会员 --> |
27 |
| - <el-descriptions-item label="收货地址: "> |
28 |
| - {{ formData.receiverAreaName }} {{ formData.receiverDetailAddress }} |
29 |
| - <el-link |
30 |
| - v-clipboard:copy="formData.receiverAreaName + ' ' + formData.receiverDetailAddress" |
31 |
| - v-clipboard:success="clipboardSuccess" |
32 |
| - icon="ep:document-copy" |
33 |
| - type="primary" |
34 |
| - /> |
| 19 | + <el-descriptions-item label="推广用户: " v-if="formData.brokerageUser"> |
| 20 | + {{ formData.brokerageUser?.nickname }} |
35 | 21 | </el-descriptions-item>
|
36 | 22 | </el-descriptions>
|
37 | 23 |
|
|
45 | 31 | 调整价格
|
46 | 32 | </el-button>
|
47 | 33 | <el-button type="primary" @click="remark">备注</el-button>
|
48 |
| - <el-button v-if="formData.status! === 10" type="primary" @click="delivery"> |
| 34 | + <el-button |
| 35 | + v-if="formData.status! === 10 && formData.deliveryType === DeliveryTypeEnum.EXPRESS.type" |
| 36 | + type="primary" |
| 37 | + @click="delivery" |
| 38 | + > |
49 | 39 | 发货
|
50 | 40 | </el-button>
|
51 |
| - <el-button v-if="formData.status! === 10" type="primary" @click="updateAddress"> |
| 41 | + <el-button |
| 42 | + v-if="formData.status! === 10 && formData.deliveryType === DeliveryTypeEnum.EXPRESS.type" |
| 43 | + type="primary" |
| 44 | + @click="updateAddress" |
| 45 | + > |
52 | 46 | 修改地址
|
53 | 47 | </el-button>
|
54 | 48 | </el-descriptions-item>
|
|
95 | 89 | </el-row>
|
96 | 90 | </el-descriptions-item>
|
97 | 91 | </el-descriptions>
|
98 |
| - <el-descriptions :column="6"> |
| 92 | + <el-descriptions :column="4"> |
| 93 | + <!-- 第一层 --> |
99 | 94 | <el-descriptions-item label="商品总额: ">
|
100 |
| - {{ fenToYuan(formData.totalPrice!) }}元 |
| 95 | + {{ fenToYuan(formData.totalPrice!) }} 元 |
101 | 96 | </el-descriptions-item>
|
102 | 97 | <el-descriptions-item label="运费金额: ">
|
103 |
| - {{ fenToYuan(formData.deliveryPrice!) }}元 |
| 98 | + {{ fenToYuan(formData.deliveryPrice!) }} 元 |
104 | 99 | </el-descriptions-item>
|
105 | 100 | <el-descriptions-item label="订单调价: ">
|
106 |
| - {{ fenToYuan(formData.adjustPrice!) }}元 |
| 101 | + {{ fenToYuan(formData.adjustPrice!) }} 元 |
107 | 102 | </el-descriptions-item>
|
108 |
| - |
| 103 | + <el-descriptions-item v-for="item in 1" :key="item" label-class-name="no-colon" /> |
| 104 | + <!-- 第二层 --> |
109 | 105 | <el-descriptions-item>
|
110 |
| - <template #label><span style="color: red">商品优惠: </span></template> |
111 |
| - {{ fenToYuan(formData.couponPrice!) }}元 |
| 106 | + <template #label><span style="color: red">优惠劵优惠: </span></template> |
| 107 | + {{ fenToYuan(formData.couponPrice!) }} 元 |
112 | 108 | </el-descriptions-item>
|
113 | 109 | <el-descriptions-item>
|
114 |
| - <template #label><span style="color: red">订单优惠: </span></template> |
115 |
| - {{ fenToYuan(formData.discountPrice!) }}元 |
| 110 | + <template #label><span style="color: red">VIP 优惠: </span></template> |
| 111 | + {{ fenToYuan(formData.vipPrice!) }} 元 |
| 112 | + </el-descriptions-item> |
| 113 | + <el-descriptions-item> |
| 114 | + <template #label><span style="color: red">活动优惠: </span></template> |
| 115 | + {{ fenToYuan(formData.discountPrice!) }} 元 |
116 | 116 | </el-descriptions-item>
|
117 | 117 | <el-descriptions-item>
|
118 | 118 | <template #label><span style="color: red">积分抵扣: </span></template>
|
119 |
| - {{ fenToYuan(formData.pointPrice!) }}元 |
| 119 | + {{ fenToYuan(formData.pointPrice!) }} 元 |
120 | 120 | </el-descriptions-item>
|
121 |
| - |
122 |
| - <el-descriptions-item v-for="item in 5" :key="item" label-class-name="no-colon" /> |
123 |
| - <!-- 占位 --> |
| 121 | + <!-- 第三层 --> |
| 122 | + <el-descriptions-item v-for="item in 3" :key="item" label-class-name="no-colon" /> |
124 | 123 | <el-descriptions-item label="应付金额: ">
|
125 |
| - {{ fenToYuan(formData.payPrice!) }}元 |
| 124 | + {{ fenToYuan(formData.payPrice!) }} 元 |
126 | 125 | </el-descriptions-item>
|
127 | 126 | </el-descriptions>
|
128 | 127 |
|
129 |
| - <!-- TODO 芋艿:需要改改 --> |
130 |
| - <el-descriptions :column="4" title="物流信息"> |
131 |
| - <el-descriptions-item label="物流公司: "> |
132 |
| - {{ deliveryExpressList.find((item) => item.id === formData.logisticsId)?.name }} |
133 |
| - </el-descriptions-item> |
134 |
| - <el-descriptions-item label="运单号: ">{{ formData.logisticsNo }}</el-descriptions-item> |
135 |
| - <el-descriptions-item label="发货时间: "> |
136 |
| - {{ formatDate(formData.deliveryTime!) }} |
137 |
| - </el-descriptions-item> |
138 |
| - <el-descriptions-item label="物流状态: "> |
139 |
| - <!-- TODO 物流状态怎么获取? --> |
140 |
| - <dict-tag :type="DICT_TYPE.TRADE_ORDER_STATUS" :value="formData.deliveryStatus!" /> |
141 |
| - </el-descriptions-item> |
142 |
| - <!-- 占位 4 --> |
143 |
| - <el-descriptions-item v-for="item in 4" :key="item" label-class-name="no-colon" /> |
144 |
| - <el-descriptions-item label="物流详情: "> |
145 |
| - <el-timeline> |
146 |
| - <el-timeline-item |
147 |
| - v-for="(express, index) in expressTrackList" |
148 |
| - :key="index" |
149 |
| - :timestamp="formatDate(express.time)" |
150 |
| - > |
151 |
| - {{ express.content }} |
152 |
| - </el-timeline-item> |
153 |
| - </el-timeline> |
| 128 | + <!-- 物流信息 --> |
| 129 | + <el-descriptions :column="4" title="收货信息"> |
| 130 | + <el-descriptions-item label="配送方式: "> |
| 131 | + <dict-tag :type="DICT_TYPE.TRADE_DELIVERY_TYPE" :value="formData.deliveryType!" /> |
154 | 132 | </el-descriptions-item>
|
| 133 | + <el-descriptions-item label="收货人: ">{{ formData.receiverName }}</el-descriptions-item> |
| 134 | + <el-descriptions-item label="联系电话: ">{{ formData.receiverMobile }}</el-descriptions-item> |
| 135 | + <!-- 快递配送 --> |
| 136 | + <div v-if="formData.deliveryType === DeliveryTypeEnum.EXPRESS.type"> |
| 137 | + <el-descriptions-item label="收货地址: " v-if="formData.receiverDetailAddress"> |
| 138 | + {{ formData.receiverAreaName }} {{ formData.receiverDetailAddress }} |
| 139 | + <el-link |
| 140 | + v-clipboard:copy="formData.receiverAreaName + ' ' + formData.receiverDetailAddress" |
| 141 | + v-clipboard:success="clipboardSuccess" |
| 142 | + icon="ep:document-copy" |
| 143 | + type="primary" |
| 144 | + /> |
| 145 | + </el-descriptions-item> |
| 146 | + <el-descriptions-item label="物流公司: " v-if="formData.logisticsId"> |
| 147 | + {{ deliveryExpressList.find((item) => item.id === formData.logisticsId)?.name }} |
| 148 | + </el-descriptions-item> |
| 149 | + <el-descriptions-item label="运单号: " v-if="formData.logisticsId"> |
| 150 | + {{ formData.logisticsNo }} |
| 151 | + </el-descriptions-item> |
| 152 | + <el-descriptions-item label="发货时间: " v-if="formatDate.deliveryTime"> |
| 153 | + {{ formatDate(formData.deliveryTime) }} |
| 154 | + </el-descriptions-item> |
| 155 | + <el-descriptions-item v-for="item in 2" :key="item" label-class-name="no-colon" /> |
| 156 | + <el-descriptions-item label="物流详情: " v-if="expressTrackList.length > 0"> |
| 157 | + <el-timeline> |
| 158 | + <el-timeline-item |
| 159 | + v-for="(express, index) in expressTrackList" |
| 160 | + :key="index" |
| 161 | + :timestamp="formatDate(express.time)" |
| 162 | + > |
| 163 | + {{ express.content }} |
| 164 | + </el-timeline-item> |
| 165 | + </el-timeline> |
| 166 | + </el-descriptions-item> |
| 167 | + </div> |
| 168 | + <!-- 自提门店 --> |
| 169 | + <div v-if="formData.deliveryType === DeliveryTypeEnum.PICK_UP.type"> |
| 170 | + <el-descriptions-item label="自提门店: " v-if="formData.pickUpStoreId"> |
| 171 | + {{ pickUpStore.name }} |
| 172 | + </el-descriptions-item> |
| 173 | + </div> |
155 | 174 | </el-descriptions>
|
| 175 | + |
| 176 | + <!-- 订单日志 --> |
156 | 177 | <el-descriptions title="订单操作日志">
|
157 | 178 | <el-descriptions-item labelClassName="no-colon">
|
158 | 179 | <el-timeline>
|
@@ -196,6 +217,8 @@ import OrderUpdateAddressForm from '@/views/mall/trade/order/form/OrderUpdateAdd
|
196 | 217 | import OrderUpdatePriceForm from '@/views/mall/trade/order/form/OrderUpdatePriceForm.vue'
|
197 | 218 | import * as DeliveryExpressApi from '@/api/mall/trade/delivery/express'
|
198 | 219 | import { useTagsViewStore } from '@/store/modules/tagsView'
|
| 220 | +import { DeliveryTypeEnum } from '@/utils/constants' |
| 221 | +import * as DeliveryPickUpStoreApi from '@/api/mall/trade/delivery/pickUpStore' |
199 | 222 |
|
200 | 223 | defineOptions({ name: 'TradeOrderDetail' })
|
201 | 224 |
|
@@ -271,10 +294,20 @@ const clipboardSuccess = () => {
|
271 | 294 | /** 初始化 **/
|
272 | 295 | const deliveryExpressList = ref([]) // 物流公司
|
273 | 296 | const expressTrackList = ref([]) // 物流详情
|
| 297 | +const pickUpStore = ref({}) // 自提门店 |
274 | 298 | onMounted(async () => {
|
275 | 299 | await getDetail()
|
276 |
| - deliveryExpressList.value = await DeliveryExpressApi.getSimpleDeliveryExpressList() |
277 |
| - expressTrackList.value = await TradeOrderApi.getExpressTrackList(formData.value.id!) |
| 300 | + // 如果配送方式为快递,则查询物流公司 |
| 301 | + if (formData.value.deliveryType === DeliveryTypeEnum.EXPRESS.type) { |
| 302 | + deliveryExpressList.value = await DeliveryExpressApi.getSimpleDeliveryExpressList() |
| 303 | + if (form.value.logisticsId) { |
| 304 | + expressTrackList.value = await TradeOrderApi.getExpressTrackList(formData.value.id!) |
| 305 | + } |
| 306 | + } else if (formData.value.deliveryType === DeliveryTypeEnum.PICK_UP.type) { |
| 307 | + pickUpStore.value = await DeliveryPickUpStoreApi.getDeliveryPickUpStore( |
| 308 | + formData.value.pickUpStoreId |
| 309 | + ) |
| 310 | + } |
278 | 311 | })
|
279 | 312 | </script>
|
280 | 313 | <style lang="scss" scoped>
|
@@ -312,7 +345,7 @@ onMounted(async () => {
|
312 | 345 |
|
313 | 346 | // 时间线样式调整
|
314 | 347 | :deep(.el-timeline) {
|
315 |
| - margin: 10px 0px 0px 160px; |
| 348 | + margin: 10px 0 0 160px; |
316 | 349 |
|
317 | 350 | .el-timeline-item__wrapper {
|
318 | 351 | position: relative;
|
|
0 commit comments