2023-08-28 17:18:42 +08:00
|
|
|
|
<template>
|
|
|
|
|
<ContentWrap>
|
|
|
|
|
<!-- 订单信息 -->
|
2023-08-30 21:18:46 +08:00
|
|
|
|
<el-descriptions title="订单信息">
|
2023-08-29 09:48:33 +08:00
|
|
|
|
<el-descriptions-item label="订单号: ">{{ formData.orderNo }}</el-descriptions-item>
|
2023-08-28 17:18:42 +08:00
|
|
|
|
<el-descriptions-item label="配送方式: ">
|
2023-08-29 09:48:33 +08:00
|
|
|
|
<dict-tag :type="DICT_TYPE.TRADE_DELIVERY_TYPE" :value="formData.order.deliveryType" />
|
2023-08-28 17:18:42 +08:00
|
|
|
|
</el-descriptions-item>
|
2023-08-31 15:39:13 +08:00
|
|
|
|
<!-- TODO 营销活动待实现 -->
|
2023-08-28 17:18:42 +08:00
|
|
|
|
<el-descriptions-item label="订单类型: ">
|
2023-08-29 09:48:33 +08:00
|
|
|
|
<dict-tag :type="DICT_TYPE.TRADE_ORDER_TYPE" :value="formData.order.type" />
|
2023-08-28 17:18:42 +08:00
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
<el-descriptions-item label="收货人: ">
|
2023-08-29 09:48:33 +08:00
|
|
|
|
{{ formData.order.receiverName }}
|
2023-08-28 17:18:42 +08:00
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
<el-descriptions-item label="买家留言: ">
|
2023-08-29 09:48:33 +08:00
|
|
|
|
{{ formData.order.userRemark }}
|
2023-08-28 17:18:42 +08:00
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
<el-descriptions-item label="订单来源: ">
|
2023-08-29 09:48:33 +08:00
|
|
|
|
<dict-tag :type="DICT_TYPE.TERMINAL" :value="formData.order.terminal" />
|
2023-08-28 17:18:42 +08:00
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
<el-descriptions-item label="联系电话: ">
|
2023-08-29 09:48:33 +08:00
|
|
|
|
{{ formData.order.receiverMobile }}
|
2023-08-28 17:18:42 +08:00
|
|
|
|
</el-descriptions-item>
|
2023-08-29 09:48:33 +08:00
|
|
|
|
<el-descriptions-item label="商家备注: ">{{ formData.order.remark }}</el-descriptions-item>
|
2023-08-28 17:18:42 +08:00
|
|
|
|
<el-descriptions-item label="支付单号: ">
|
2023-08-29 09:48:33 +08:00
|
|
|
|
{{ formData.order.payOrderId }}
|
2023-08-28 17:18:42 +08:00
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
<el-descriptions-item label="付款方式: ">
|
2023-08-29 09:48:33 +08:00
|
|
|
|
<dict-tag :type="DICT_TYPE.PAY_CHANNEL_CODE" :value="formData.order.payChannelCode" />
|
2023-08-28 17:18:42 +08:00
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
<!-- TODO 芋艿:待实现:跳转会员 -->
|
2023-08-29 09:48:33 +08:00
|
|
|
|
<!-- <el-descriptions-item label="买家: ">{{ formData.user.nickname }}</el-descriptions-item> -->
|
2023-08-28 17:18:42 +08:00
|
|
|
|
</el-descriptions>
|
|
|
|
|
|
|
|
|
|
<!-- 售后信息 -->
|
|
|
|
|
<el-descriptions title="售后信息">
|
2023-08-29 09:48:33 +08:00
|
|
|
|
<el-descriptions-item label="退款编号: ">{{ formData.no }}</el-descriptions-item>
|
2023-08-28 17:18:42 +08:00
|
|
|
|
<el-descriptions-item label="申请时间: ">
|
2023-08-29 09:48:33 +08:00
|
|
|
|
{{ formatDate(formData.auditTime) }}
|
2023-08-28 17:18:42 +08:00
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
<el-descriptions-item label="售后类型: ">
|
2023-08-29 09:48:33 +08:00
|
|
|
|
<dict-tag :type="DICT_TYPE.TRADE_AFTER_SALE_TYPE" :value="formData.type" />
|
2023-08-28 17:18:42 +08:00
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
<el-descriptions-item label="售后方式: ">
|
2023-08-29 09:48:33 +08:00
|
|
|
|
<dict-tag :type="DICT_TYPE.TRADE_AFTER_SALE_WAY" :value="formData.way" />
|
2023-08-28 17:18:42 +08:00
|
|
|
|
</el-descriptions-item>
|
2023-08-31 15:39:13 +08:00
|
|
|
|
<el-descriptions-item label="退款金额: ">
|
|
|
|
|
{{ floatToFixed2(formData.refundPrice) }}
|
|
|
|
|
</el-descriptions-item>
|
2023-08-29 09:48:33 +08:00
|
|
|
|
<el-descriptions-item label="退款原因: ">{{ formData.applyReason }}</el-descriptions-item>
|
2023-08-28 17:18:42 +08:00
|
|
|
|
<el-descriptions-item label="补充描述: ">
|
2023-08-29 09:48:33 +08:00
|
|
|
|
{{ formData.applyDescription }}
|
2023-08-28 17:18:42 +08:00
|
|
|
|
</el-descriptions-item>
|
2023-08-31 15:39:13 +08:00
|
|
|
|
<el-descriptions-item label="凭证图片: ">
|
|
|
|
|
<el-image
|
|
|
|
|
v-for="(item, index) in formData.applyPicUrls"
|
|
|
|
|
:key="index"
|
|
|
|
|
:src="item.url"
|
|
|
|
|
class="w-60px h-60px mr-10px"
|
|
|
|
|
@click="imagePreview(formData.applyPicUrls)"
|
|
|
|
|
/>
|
|
|
|
|
</el-descriptions-item>
|
2023-08-28 17:18:42 +08:00
|
|
|
|
</el-descriptions>
|
|
|
|
|
|
|
|
|
|
<!-- 退款状态 -->
|
|
|
|
|
<el-descriptions :column="1" title="退款状态">
|
|
|
|
|
<el-descriptions-item label="退款状态: ">
|
2023-08-29 09:48:33 +08:00
|
|
|
|
<dict-tag :type="DICT_TYPE.TRADE_AFTER_SALE_STATUS" :value="formData.status" />
|
2023-08-28 17:18:42 +08:00
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
<el-descriptions-item label-class-name="no-colon">
|
2023-08-31 15:39:13 +08:00
|
|
|
|
<el-button v-if="formData.status === 10" type="primary" @click="agree">同意售后</el-button>
|
|
|
|
|
<el-button v-if="formData.status === 10" type="primary" @click="disagree">
|
|
|
|
|
拒绝售后
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button v-if="formData.status === 30" type="primary" @click="receive">
|
|
|
|
|
确认收货
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button v-if="formData.status === 30" type="primary" @click="refuse">拒绝收货</el-button>
|
|
|
|
|
<el-button v-if="formData.status === 40" type="primary" @click="refund">确认退款</el-button>
|
2023-08-28 17:18:42 +08:00
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
<el-descriptions-item>
|
|
|
|
|
<template #label><span style="color: red">提醒: </span></template>
|
|
|
|
|
如果未发货,请点击同意退款给买家。<br />
|
|
|
|
|
如果实际已发货,请主动与买家联系。<br />
|
|
|
|
|
如果订单整体退款后,优惠券和余额会退还给买家.
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
</el-descriptions>
|
|
|
|
|
|
|
|
|
|
<!-- 商品信息 -->
|
|
|
|
|
<el-descriptions title="商品信息">
|
|
|
|
|
<el-descriptions-item labelClassName="no-colon">
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
<el-col :span="15">
|
2023-08-29 09:48:33 +08:00
|
|
|
|
<el-table :data="formData.items" border>
|
2023-08-28 17:18:42 +08:00
|
|
|
|
<el-table-column label="商品" prop="spuName" width="auto">
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
{{ row.spuName }}
|
|
|
|
|
<el-tag v-for="property in row.properties" :key="property.propertyId">
|
|
|
|
|
{{ property.propertyName }}: {{ property.valueName }}
|
|
|
|
|
</el-tag>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="商品原价" prop="price" width="150">
|
|
|
|
|
<template #default="{ row }">{{ floatToFixed2(row.price) }}元</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="数量" prop="count" width="100" />
|
|
|
|
|
<el-table-column label="合计" prop="payPrice" width="150">
|
|
|
|
|
<template #default="{ row }">{{ floatToFixed2(row.payPrice) }}元</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="售后状态" prop="afterSaleStatus" width="120">
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
<dict-tag
|
|
|
|
|
:type="DICT_TYPE.TRADE_ORDER_ITEM_AFTER_SALE_STATUS"
|
|
|
|
|
:value="row.afterSaleStatus"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="10" />
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
</el-descriptions>
|
2023-09-01 10:32:05 +08:00
|
|
|
|
<el-descriptions title="售后日志">
|
|
|
|
|
<el-descriptions-item labelClassName="no-colon">
|
|
|
|
|
<el-timeline>
|
|
|
|
|
<el-timeline-item
|
|
|
|
|
v-for="saleLog in formData.afterSaleLog"
|
|
|
|
|
:key="saleLog.id"
|
|
|
|
|
:timestamp="formatDate(saleLog.createTime)"
|
|
|
|
|
placement="top"
|
|
|
|
|
>
|
|
|
|
|
<el-card>
|
|
|
|
|
<span>用户类型:</span>
|
|
|
|
|
<dict-tag :type="DICT_TYPE.USER_TYPE" :value="saleLog.userType" class="mr-10px" />
|
|
|
|
|
<span>售后状态(之前):</span>
|
|
|
|
|
<dict-tag
|
|
|
|
|
:type="DICT_TYPE.TRADE_AFTER_SALE_STATUS"
|
|
|
|
|
:value="saleLog.beforeStatus"
|
|
|
|
|
class="mr-10px"
|
|
|
|
|
/>
|
|
|
|
|
<span>售后状态(之后):</span>
|
|
|
|
|
<dict-tag
|
|
|
|
|
:type="DICT_TYPE.TRADE_AFTER_SALE_STATUS"
|
|
|
|
|
:value="saleLog.afterStatus"
|
|
|
|
|
class="mr-10px"
|
|
|
|
|
/>
|
|
|
|
|
<span>操作明细:{{ saleLog.content }}</span>
|
|
|
|
|
</el-card>
|
|
|
|
|
</el-timeline-item>
|
|
|
|
|
</el-timeline>
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
</el-descriptions>
|
2023-08-28 17:18:42 +08:00
|
|
|
|
</ContentWrap>
|
2023-08-29 09:48:33 +08:00
|
|
|
|
|
|
|
|
|
<!-- 各种操作的弹窗 -->
|
|
|
|
|
<UpdateAuditReasonForm ref="updateAuditReasonFormRef" @success="getDetail" />
|
2023-08-28 17:18:42 +08:00
|
|
|
|
</template>
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import * as AfterSaleApi from '@/api/mall/trade/afterSale/index'
|
|
|
|
|
import { floatToFixed2 } from '@/utils'
|
|
|
|
|
import { DICT_TYPE } from '@/utils/dict'
|
|
|
|
|
import { formatDate } from '@/utils/formatTime'
|
2023-08-31 15:39:13 +08:00
|
|
|
|
import UpdateAuditReasonForm from '@/views/mall/trade/afterSale/form/AfterSaleDisagreeForm.vue'
|
|
|
|
|
import { createImageViewer } from '@/components/ImageViewer'
|
|
|
|
|
import { isArray } from '@/utils/is'
|
2023-08-28 17:18:42 +08:00
|
|
|
|
|
2023-09-01 20:03:08 +08:00
|
|
|
|
defineOptions({ name: 'TradeAfterSaleDetail' })
|
2023-08-28 17:18:42 +08:00
|
|
|
|
|
2023-09-01 10:32:05 +08:00
|
|
|
|
const { t } = useI18n() // 国际化
|
2023-08-29 09:48:33 +08:00
|
|
|
|
const message = useMessage() // 消息弹窗
|
2023-08-28 17:18:42 +08:00
|
|
|
|
const { params } = useRoute() // 查询参数
|
2023-08-29 09:48:33 +08:00
|
|
|
|
const formData = ref({
|
2023-09-01 10:32:05 +08:00
|
|
|
|
order: {},
|
|
|
|
|
afterSaleLog: []
|
2023-08-28 17:18:42 +08:00
|
|
|
|
})
|
2023-08-29 09:48:33 +08:00
|
|
|
|
const updateAuditReasonFormRef = ref() // 拒绝售后表单 Ref
|
2023-08-30 21:18:46 +08:00
|
|
|
|
|
2023-08-28 17:18:42 +08:00
|
|
|
|
/** 获得详情 */
|
|
|
|
|
const getDetail = async () => {
|
|
|
|
|
const id = params.orderId as unknown as number
|
|
|
|
|
if (id) {
|
2023-08-29 09:48:33 +08:00
|
|
|
|
formData.value = await AfterSaleApi.getAfterSale(id)
|
2023-08-28 17:18:42 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-09-01 00:49:42 +08:00
|
|
|
|
|
|
|
|
|
/** 同意售后 */
|
2023-08-31 15:39:13 +08:00
|
|
|
|
const agree = () => {
|
|
|
|
|
message.confirm('是否同意售后?').then(() => {
|
|
|
|
|
AfterSaleApi.agree(formData.value.id)
|
2023-09-01 10:32:05 +08:00
|
|
|
|
message.success(t('common.success'))
|
|
|
|
|
getDetail()
|
2023-08-31 15:39:13 +08:00
|
|
|
|
})
|
|
|
|
|
}
|
2023-09-01 00:49:42 +08:00
|
|
|
|
|
|
|
|
|
/** 拒绝售后 */
|
2023-08-31 15:39:13 +08:00
|
|
|
|
const disagree = () => {
|
|
|
|
|
updateAuditReasonFormRef.value?.open(formData.value)
|
|
|
|
|
}
|
2023-09-01 00:49:42 +08:00
|
|
|
|
|
|
|
|
|
/** 确认收货 */
|
2023-08-31 15:39:13 +08:00
|
|
|
|
const receive = () => {
|
|
|
|
|
message.confirm('是否确认收货?').then(() => {
|
|
|
|
|
AfterSaleApi.receive(formData.value.id)
|
2023-09-01 10:32:05 +08:00
|
|
|
|
message.success(t('common.success'))
|
|
|
|
|
getDetail()
|
2023-08-31 15:39:13 +08:00
|
|
|
|
})
|
|
|
|
|
}
|
2023-09-01 00:49:42 +08:00
|
|
|
|
|
|
|
|
|
/** 拒绝收货 */
|
2023-08-31 15:39:13 +08:00
|
|
|
|
const refuse = () => {
|
|
|
|
|
message.confirm('是否拒绝收货?').then(() => {
|
|
|
|
|
AfterSaleApi.refuse(formData.value.id)
|
2023-09-01 10:32:05 +08:00
|
|
|
|
message.success(t('common.success'))
|
|
|
|
|
getDetail()
|
2023-08-31 15:39:13 +08:00
|
|
|
|
})
|
|
|
|
|
}
|
2023-09-01 00:49:42 +08:00
|
|
|
|
|
|
|
|
|
/** 确认退款 */
|
2023-08-31 15:39:13 +08:00
|
|
|
|
const refund = () => {
|
|
|
|
|
message.confirm('是否确认退款?').then(() => {
|
|
|
|
|
AfterSaleApi.refund(formData.value.id)
|
2023-09-01 10:32:05 +08:00
|
|
|
|
message.success(t('common.success'))
|
|
|
|
|
getDetail()
|
2023-08-31 15:39:13 +08:00
|
|
|
|
})
|
|
|
|
|
}
|
2023-09-01 00:49:42 +08:00
|
|
|
|
|
2023-08-31 15:39:13 +08:00
|
|
|
|
/** 图片预览 */
|
|
|
|
|
const imagePreview = (args) => {
|
|
|
|
|
const urlList = []
|
|
|
|
|
if (isArray(args)) {
|
|
|
|
|
args.forEach((item) => {
|
|
|
|
|
urlList.push(item.url)
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
urlList.push(args)
|
2023-08-28 17:18:42 +08:00
|
|
|
|
}
|
2023-08-31 15:39:13 +08:00
|
|
|
|
createImageViewer({
|
|
|
|
|
urlList
|
|
|
|
|
})
|
2023-08-28 17:18:42 +08:00
|
|
|
|
}
|
2023-09-01 00:49:42 +08:00
|
|
|
|
|
2023-08-28 17:18:42 +08:00
|
|
|
|
onMounted(async () => {
|
|
|
|
|
await getDetail()
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
:deep(.el-descriptions) {
|
|
|
|
|
&:not(:nth-child(1)) {
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.el-descriptions__title {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
&::before {
|
|
|
|
|
display: inline-block;
|
|
|
|
|
width: 3px;
|
|
|
|
|
height: 20px;
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
background-color: #409eff;
|
|
|
|
|
content: '';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.el-descriptions-item__container {
|
|
|
|
|
margin: 0 10px;
|
|
|
|
|
|
|
|
|
|
.no-colon {
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
|
|
|
|
&::after {
|
|
|
|
|
content: '';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|