|
|
|
@ -1,33 +1,32 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<Dialog v-model="dialogVisible" :scroll="true" :title="dialogTitle" width="65%">
|
|
|
|
|
|
|
|
<ContentWrap>
|
|
|
|
<ContentWrap>
|
|
|
|
<!-- 订单信息 -->
|
|
|
|
<!-- 订单信息 -->
|
|
|
|
<el-descriptions title="订单信息">
|
|
|
|
<el-descriptions title="订单信息">
|
|
|
|
<el-descriptions-item label="订单号: ">{{ order.no }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="订单号: ">{{ orderInfo.no }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="配送方式: ">物流配送</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="配送方式: ">物流配送</el-descriptions-item>
|
|
|
|
<!-- TODO 芋艿:待实现 -->
|
|
|
|
<!-- TODO 芋艿:待实现 -->
|
|
|
|
<el-descriptions-item label="营销活动: ">物流配送</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="营销活动: ">物流配送</el-descriptions-item>
|
|
|
|
<!-- TODO 芋艿:待实现 -->
|
|
|
|
<!-- TODO 芋艿:待实现 -->
|
|
|
|
<el-descriptions-item label="订单类型: ">
|
|
|
|
<el-descriptions-item label="订单类型: ">
|
|
|
|
<dict-tag :type="DICT_TYPE.TRADE_ORDER_TYPE" :value="order.type" />
|
|
|
|
<dict-tag :type="DICT_TYPE.TRADE_ORDER_TYPE" :value="orderInfo.type" />
|
|
|
|
</el-descriptions-item>
|
|
|
|
</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="收货人: ">{{ order.receiverName }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="收货人: ">{{ orderInfo.receiverName }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="买家留言: ">{{ order.userRemark }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="买家留言: ">{{ orderInfo.userRemark }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="订单来源: ">
|
|
|
|
<el-descriptions-item label="订单来源: ">
|
|
|
|
<dict-tag :type="DICT_TYPE.TERMINAL" :value="order.terminal" />
|
|
|
|
<dict-tag :type="DICT_TYPE.TERMINAL" :value="orderInfo.terminal" />
|
|
|
|
</el-descriptions-item>
|
|
|
|
</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="联系电话: ">{{ order.receiverMobile }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="联系电话: ">{{ orderInfo.receiverMobile }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="商家备注: ">{{ order.remark }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="商家备注: ">{{ orderInfo.remark }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="支付单号: ">{{ order.payOrderId }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="支付单号: ">{{ orderInfo.payOrderId }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="付款方式: ">
|
|
|
|
<el-descriptions-item label="付款方式: ">
|
|
|
|
<dict-tag :type="DICT_TYPE.PAY_CHANNEL_CODE_TYPE" :value="order.payChannelCode" />
|
|
|
|
<dict-tag :type="DICT_TYPE.PAY_CHANNEL_CODE_TYPE" :value="orderInfo.payChannelCode" />
|
|
|
|
</el-descriptions-item>
|
|
|
|
</el-descriptions-item>
|
|
|
|
<!-- <el-descriptions-item label="买家: ">{{ order.user.nickname }}</el-descriptions-item> -->
|
|
|
|
<!-- <el-descriptions-item label="买家: ">{{ orderInfo.user.nickname }}</el-descriptions-item> -->
|
|
|
|
<!-- TODO 芋艿:待实现:跳转会员 -->
|
|
|
|
<!-- TODO 芋艿:待实现:跳转会员 -->
|
|
|
|
<el-descriptions-item label="收货地址: ">
|
|
|
|
<el-descriptions-item label="收货地址: ">
|
|
|
|
{{ order.receiverAreaName }} {{ order.receiverDetailAddress }}
|
|
|
|
{{ orderInfo.receiverAreaName }} {{ orderInfo.receiverDetailAddress }}
|
|
|
|
<el-link
|
|
|
|
<el-link
|
|
|
|
v-clipboard:copy="order.receiverAreaName + ' ' + order.receiverDetailAddress"
|
|
|
|
v-clipboard:copy="orderInfo.receiverAreaName + ' ' + orderInfo.receiverDetailAddress"
|
|
|
|
v-clipboard:success="clipboardSuccess"
|
|
|
|
v-clipboard:success="clipboardSuccess"
|
|
|
|
icon="ep:document-copy"
|
|
|
|
icon="ep:document-copy"
|
|
|
|
type="primary"
|
|
|
|
type="primary"
|
|
|
|
@ -40,9 +39,9 @@
|
|
|
|
<el-descriptions-item label="订单状态: ">
|
|
|
|
<el-descriptions-item label="订单状态: ">
|
|
|
|
<!-- TODO xiaobai:status 一定有值哈,不用判断 -->
|
|
|
|
<!-- TODO xiaobai:status 一定有值哈,不用判断 -->
|
|
|
|
<dict-tag
|
|
|
|
<dict-tag
|
|
|
|
v-if="order.status !== ''"
|
|
|
|
v-if="orderInfo.status !== ''"
|
|
|
|
:type="DICT_TYPE.TRADE_ORDER_STATUS"
|
|
|
|
:type="DICT_TYPE.TRADE_ORDER_STATUS"
|
|
|
|
:value="order.status"
|
|
|
|
:value="orderInfo.status"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</el-descriptions-item>
|
|
|
|
</el-descriptions-item>
|
|
|
|
<el-descriptions-item label-class-name="no-colon">
|
|
|
|
<el-descriptions-item label-class-name="no-colon">
|
|
|
|
@ -52,14 +51,8 @@
|
|
|
|
<!-- TODO 芋艿:待实现 -->
|
|
|
|
<!-- TODO 芋艿:待实现 -->
|
|
|
|
<el-button size="small" type="primary">发货</el-button>
|
|
|
|
<el-button size="small" type="primary">发货</el-button>
|
|
|
|
<!-- TODO 芋艿:待实现 -->
|
|
|
|
<!-- TODO 芋艿:待实现 -->
|
|
|
|
<el-button size="small" type="primary">关闭订单</el-button>
|
|
|
|
|
|
|
|
<!-- TODO 芋艿:待实现 -->
|
|
|
|
|
|
|
|
<el-button size="small" type="primary">修改地址</el-button>
|
|
|
|
<el-button size="small" type="primary">修改地址</el-button>
|
|
|
|
<!-- TODO 芋艿:待实现 -->
|
|
|
|
<!-- TODO 芋艿:待实现 -->
|
|
|
|
<el-button size="small" type="primary">打印电子面单</el-button>
|
|
|
|
|
|
|
|
<!-- TODO 芋艿:待实现 -->
|
|
|
|
|
|
|
|
<el-button size="small" type="primary">打印发货单</el-button>
|
|
|
|
|
|
|
|
<!-- TODO 芋艿:待实现 -->
|
|
|
|
|
|
|
|
<el-button size="small" type="primary">确认收货</el-button>
|
|
|
|
<el-button size="small" type="primary">确认收货</el-button>
|
|
|
|
<!-- TODO 芋艿:待实现 -->
|
|
|
|
<!-- TODO 芋艿:待实现 -->
|
|
|
|
</el-descriptions-item>
|
|
|
|
</el-descriptions-item>
|
|
|
|
@ -78,7 +71,7 @@
|
|
|
|
<el-descriptions-item labelClassName="no-colon">
|
|
|
|
<el-descriptions-item labelClassName="no-colon">
|
|
|
|
<el-row :gutter="20">
|
|
|
|
<el-row :gutter="20">
|
|
|
|
<el-col :span="15">
|
|
|
|
<el-col :span="15">
|
|
|
|
<el-table :data="order.items" border>
|
|
|
|
<el-table :data="orderInfo.items" border>
|
|
|
|
<el-table-column label="商品" prop="spuName" width="auto">
|
|
|
|
<el-table-column label="商品" prop="spuName" width="auto">
|
|
|
|
<template #default="{ row }">
|
|
|
|
<template #default="{ row }">
|
|
|
|
{{ row.spuName }}
|
|
|
|
{{ row.spuName }}
|
|
|
|
@ -110,35 +103,35 @@
|
|
|
|
<!-- 占位 -->
|
|
|
|
<!-- 占位 -->
|
|
|
|
<!-- <el-descriptions-item v-for="item in 5" label-class-name="no-colon" :key="item" /> -->
|
|
|
|
<!-- <el-descriptions-item v-for="item in 5" label-class-name="no-colon" :key="item" /> -->
|
|
|
|
</el-descriptions>
|
|
|
|
</el-descriptions>
|
|
|
|
<el-descriptions column="6">
|
|
|
|
<el-descriptions :column="6">
|
|
|
|
<el-descriptions-item label="商品总额: ">
|
|
|
|
<el-descriptions-item label="商品总额: ">
|
|
|
|
{{ formatToFraction(order.totalPrice) }}元
|
|
|
|
{{ formatToFraction(orderInfo.totalPrice) }}元
|
|
|
|
</el-descriptions-item>
|
|
|
|
</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="运费金额: ">
|
|
|
|
<el-descriptions-item label="运费金额: ">
|
|
|
|
{{ formatToFraction(order.deliveryPrice) }}元
|
|
|
|
{{ formatToFraction(orderInfo.deliveryPrice) }}元
|
|
|
|
</el-descriptions-item>
|
|
|
|
</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="订单调价: ">
|
|
|
|
<el-descriptions-item label="订单调价: ">
|
|
|
|
{{ formatToFraction(order.adjustPrice) }}元
|
|
|
|
{{ formatToFraction(orderInfo.adjustPrice) }}元
|
|
|
|
</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>
|
|
|
|
<!-- 没理解TODO order.totalPrice - order.totalPrice -->
|
|
|
|
<!-- 没理解TODO orderInfo.totalPrice - orderInfo.totalPrice -->
|
|
|
|
{{ formatToFraction(order.totalPrice - order.totalPrice) }}元
|
|
|
|
{{ formatToFraction(orderInfo.totalPrice - orderInfo.totalPrice) }}元
|
|
|
|
</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>
|
|
|
|
{{ formatToFraction(order.discountPrice) }}元
|
|
|
|
{{ formatToFraction(orderInfo.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>
|
|
|
|
{{ formatToFraction(order.pointPrice) }}元
|
|
|
|
{{ formatToFraction(orderInfo.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 5" :key="item" label-class-name="no-colon" />
|
|
|
|
<!-- 占位 -->
|
|
|
|
<!-- 占位 -->
|
|
|
|
<el-descriptions-item label="应付金额: ">
|
|
|
|
<el-descriptions-item label="应付金额: ">
|
|
|
|
{{ formatToFraction(order.payPrice) }}元
|
|
|
|
{{ formatToFraction(orderInfo.payPrice) }}元
|
|
|
|
</el-descriptions-item>
|
|
|
|
</el-descriptions-item>
|
|
|
|
</el-descriptions>
|
|
|
|
</el-descriptions>
|
|
|
|
|
|
|
|
|
|
|
|
@ -219,33 +212,60 @@
|
|
|
|
</el-descriptions>
|
|
|
|
</el-descriptions>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</ContentWrap>
|
|
|
|
</ContentWrap>
|
|
|
|
</Dialog>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
|
|
|
import * as TradeOrderApi from '@/api/mall/trade/order'
|
|
|
|
import { formatToFraction } from '@/utils'
|
|
|
|
import { formatToFraction } from '@/utils'
|
|
|
|
import { DICT_TYPE } from '@/utils/dict'
|
|
|
|
import { DICT_TYPE } from '@/utils/dict'
|
|
|
|
|
|
|
|
|
|
|
|
defineOptions({ name: 'TradeOrderDetailForm' })
|
|
|
|
defineOptions({ name: 'TradeOrderDetailForm' })
|
|
|
|
|
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
|
|
|
const { params } = useRoute() // 查询参数
|
|
|
|
const dialogTitle = ref('订单详情') // 弹窗的标题
|
|
|
|
// const loading = ref(false)
|
|
|
|
|
|
|
|
const orderInfo = ref<TradeOrderApi.OrderVO>({
|
|
|
|
const open = () => {
|
|
|
|
no: '',
|
|
|
|
dialogVisible.value = true
|
|
|
|
createTime: null,
|
|
|
|
}
|
|
|
|
type: null,
|
|
|
|
defineExpose({ open })
|
|
|
|
terminal: null,
|
|
|
|
|
|
|
|
userId: null,
|
|
|
|
const { query } = useRoute()
|
|
|
|
userIp: '',
|
|
|
|
const queryParams = reactive({
|
|
|
|
userRemark: '',
|
|
|
|
id: query.id
|
|
|
|
status: null,
|
|
|
|
})
|
|
|
|
productCount: null,
|
|
|
|
|
|
|
|
finishTime: null,
|
|
|
|
const loading = ref(false)
|
|
|
|
cancelTime: null,
|
|
|
|
const order = ref<any>({
|
|
|
|
cancelType: null,
|
|
|
|
|
|
|
|
remark: '',
|
|
|
|
|
|
|
|
payOrderId: null,
|
|
|
|
|
|
|
|
payed: false,
|
|
|
|
|
|
|
|
payTime: null,
|
|
|
|
|
|
|
|
payChannelCode: '',
|
|
|
|
|
|
|
|
originalPrice: null,
|
|
|
|
|
|
|
|
orderPrice: null,
|
|
|
|
|
|
|
|
discountPrice: null,
|
|
|
|
|
|
|
|
deliveryPrice: null,
|
|
|
|
|
|
|
|
adjustPrice: null,
|
|
|
|
|
|
|
|
payPrice: null,
|
|
|
|
|
|
|
|
deliveryTemplateId: null,
|
|
|
|
|
|
|
|
logisticsId: null,
|
|
|
|
|
|
|
|
logisticsNo: '',
|
|
|
|
|
|
|
|
deliveryStatus: null,
|
|
|
|
|
|
|
|
deliveryTime: null,
|
|
|
|
|
|
|
|
receiveTime: null,
|
|
|
|
|
|
|
|
receiverName: '',
|
|
|
|
|
|
|
|
receiverMobile: '',
|
|
|
|
|
|
|
|
receiverAreaId: null,
|
|
|
|
|
|
|
|
receiverPostCode: null,
|
|
|
|
|
|
|
|
receiverDetailAddress: '',
|
|
|
|
|
|
|
|
afterSaleStatus: null,
|
|
|
|
|
|
|
|
refundPrice: null,
|
|
|
|
|
|
|
|
couponPrice: null,
|
|
|
|
|
|
|
|
pointPrice: null,
|
|
|
|
|
|
|
|
receiverAreaName: '',
|
|
|
|
items: [],
|
|
|
|
items: [],
|
|
|
|
user: {}
|
|
|
|
user: {}
|
|
|
|
}) // 详情数据
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const detailGroups = ref([
|
|
|
|
const detailGroups = ref([
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -311,23 +331,25 @@ const detailInfo = ref({
|
|
|
|
],
|
|
|
|
],
|
|
|
|
goodsInfo: [] // 商品详情tableData
|
|
|
|
goodsInfo: [] // 商品详情tableData
|
|
|
|
})
|
|
|
|
})
|
|
|
|
// 暂考虑一次性加载详情页面所有数据 TODO
|
|
|
|
|
|
|
|
const getlist = async () => {
|
|
|
|
/** 获得详情 */
|
|
|
|
// dialogVisible.value = true
|
|
|
|
const getDetail = async () => {
|
|
|
|
// loading.value = true
|
|
|
|
const id = params.orderId as unknown as number
|
|
|
|
// try {
|
|
|
|
if (id) {
|
|
|
|
// const res = await TradeOrderApi.getOrderDetail(queryParams.id as unknown as number)
|
|
|
|
const res = (await TradeOrderApi.getOrder(id)) as TradeOrderApi.OrderVO
|
|
|
|
// order.value = res
|
|
|
|
// TODO 测试使用
|
|
|
|
// console.log(order)
|
|
|
|
res.user = {
|
|
|
|
// } catch {
|
|
|
|
id: 247,
|
|
|
|
// message.error('获取详情数据失败')
|
|
|
|
nickname: '小妮子'
|
|
|
|
// } finally {
|
|
|
|
}
|
|
|
|
// loading.value = false
|
|
|
|
orderInfo.value = res
|
|
|
|
// }
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(async () => {
|
|
|
|
onMounted(async () => {
|
|
|
|
await getlist()
|
|
|
|
await getDetail()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const clipboardSuccess = () => {
|
|
|
|
const clipboardSuccess = () => {
|
|
|
|
message.success('复制成功')
|
|
|
|
message.success('复制成功')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|