|
| 1 | +<template> |
| 2 | + <ContentWrap> |
| 3 | + <!-- 订单信息 --> |
| 4 | + <el-descriptions title="退款订单信息"> |
| 5 | + <el-descriptions-item label="订单号: ">{{ formData.orderNo }}</el-descriptions-item> |
| 6 | + <el-descriptions-item label="配送方式: "> |
| 7 | + <dict-tag :type="DICT_TYPE.TRADE_DELIVERY_TYPE" :value="formData.order.deliveryType" /> |
| 8 | + </el-descriptions-item> |
| 9 | + <el-descriptions-item label="订单类型: "> |
| 10 | + <dict-tag :type="DICT_TYPE.TRADE_ORDER_TYPE" :value="formData.order.type" /> |
| 11 | + </el-descriptions-item> |
| 12 | + <el-descriptions-item label="收货人: "> |
| 13 | + {{ formData.order.receiverName }} |
| 14 | + </el-descriptions-item> |
| 15 | + <el-descriptions-item label="买家留言: "> |
| 16 | + {{ formData.order.userRemark }} |
| 17 | + </el-descriptions-item> |
| 18 | + <el-descriptions-item label="订单来源: "> |
| 19 | + <dict-tag :type="DICT_TYPE.TERMINAL" :value="formData.order.terminal" /> |
| 20 | + </el-descriptions-item> |
| 21 | + <el-descriptions-item label="联系电话: "> |
| 22 | + {{ formData.order.receiverMobile }} |
| 23 | + </el-descriptions-item> |
| 24 | + <el-descriptions-item label="商家备注: ">{{ formData.order.remark }}</el-descriptions-item> |
| 25 | + <el-descriptions-item label="支付单号: "> |
| 26 | + {{ formData.order.payOrderId }} |
| 27 | + </el-descriptions-item> |
| 28 | + <el-descriptions-item label="付款方式: "> |
| 29 | + <dict-tag :type="DICT_TYPE.PAY_CHANNEL_CODE" :value="formData.order.payChannelCode" /> |
| 30 | + </el-descriptions-item> |
| 31 | + <!-- TODO 芋艿:待实现:跳转会员 --> |
| 32 | + <!-- <el-descriptions-item label="买家: ">{{ formData.user.nickname }}</el-descriptions-item> --> |
| 33 | + </el-descriptions> |
| 34 | + |
| 35 | + <!-- 售后信息 --> |
| 36 | + <el-descriptions title="售后信息"> |
| 37 | + <el-descriptions-item label="退款编号: ">{{ formData.no }}</el-descriptions-item> |
| 38 | + <el-descriptions-item label="申请时间: "> |
| 39 | + {{ formatDate(formData.auditTime) }} |
| 40 | + </el-descriptions-item> |
| 41 | + <!-- TODO 营销活动待实现 --> |
| 42 | + <el-descriptions-item label="售后类型: "> |
| 43 | + <dict-tag :type="DICT_TYPE.TRADE_AFTER_SALE_TYPE" :value="formData.type" /> |
| 44 | + </el-descriptions-item> |
| 45 | + <el-descriptions-item label="售后方式: "> |
| 46 | + <dict-tag :type="DICT_TYPE.TRADE_AFTER_SALE_WAY" :value="formData.way" /> |
| 47 | + </el-descriptions-item> |
| 48 | + <el-descriptions-item label="退款金额: ">{{ formData.refundPrice }}</el-descriptions-item> |
| 49 | + <el-descriptions-item label="退款原因: ">{{ formData.applyReason }}</el-descriptions-item> |
| 50 | + <el-descriptions-item label="补充描述: "> |
| 51 | + {{ formData.applyDescription }} |
| 52 | + </el-descriptions-item> |
| 53 | + <el-descriptions-item label="凭证图片: "> {{ formData.applyPicUrls }}</el-descriptions-item> |
| 54 | + </el-descriptions> |
| 55 | + |
| 56 | + <!-- 退款状态 --> |
| 57 | + <el-descriptions :column="1" title="退款状态"> |
| 58 | + <el-descriptions-item label="退款状态: "> |
| 59 | + <dict-tag :type="DICT_TYPE.TRADE_AFTER_SALE_STATUS" :value="formData.status" /> |
| 60 | + </el-descriptions-item> |
| 61 | + <el-descriptions-item label-class-name="no-colon"> |
| 62 | + <el-button type="primary" @click="openForm('agree')">同意售后</el-button> |
| 63 | + <el-button type="primary" @click="openForm('disagree')">拒绝售后</el-button> |
| 64 | + <el-button type="primary" @click="openForm('receive')">确认收货</el-button> |
| 65 | + <el-button type="primary" @click="openForm('refuse')">拒绝收货</el-button> |
| 66 | + <el-button type="primary" @click="openForm('refund')">确认退款</el-button> |
| 67 | + </el-descriptions-item> |
| 68 | + <el-descriptions-item> |
| 69 | + <template #label><span style="color: red">提醒: </span></template> |
| 70 | + 如果未发货,请点击同意退款给买家。<br /> |
| 71 | + 如果实际已发货,请主动与买家联系。<br /> |
| 72 | + 如果订单整体退款后,优惠券和余额会退还给买家. |
| 73 | + </el-descriptions-item> |
| 74 | + </el-descriptions> |
| 75 | + |
| 76 | + <!-- 商品信息 --> |
| 77 | + <el-descriptions title="商品信息"> |
| 78 | + <el-descriptions-item labelClassName="no-colon"> |
| 79 | + <el-row :gutter="20"> |
| 80 | + <el-col :span="15"> |
| 81 | + <el-table :data="formData.items" border> |
| 82 | + <el-table-column label="商品" prop="spuName" width="auto"> |
| 83 | + <template #default="{ row }"> |
| 84 | + {{ row.spuName }} |
| 85 | + <el-tag v-for="property in row.properties" :key="property.propertyId"> |
| 86 | + {{ property.propertyName }}: {{ property.valueName }} |
| 87 | + </el-tag> |
| 88 | + </template> |
| 89 | + </el-table-column> |
| 90 | + <el-table-column label="商品原价" prop="price" width="150"> |
| 91 | + <template #default="{ row }">{{ floatToFixed2(row.price) }}元</template> |
| 92 | + </el-table-column> |
| 93 | + <el-table-column label="数量" prop="count" width="100" /> |
| 94 | + <el-table-column label="合计" prop="payPrice" width="150"> |
| 95 | + <template #default="{ row }">{{ floatToFixed2(row.payPrice) }}元</template> |
| 96 | + </el-table-column> |
| 97 | + <el-table-column label="售后状态" prop="afterSaleStatus" width="120"> |
| 98 | + <template #default="{ row }"> |
| 99 | + <dict-tag |
| 100 | + :type="DICT_TYPE.TRADE_ORDER_ITEM_AFTER_SALE_STATUS" |
| 101 | + :value="row.afterSaleStatus" |
| 102 | + /> |
| 103 | + </template> |
| 104 | + </el-table-column> |
| 105 | + </el-table> |
| 106 | + </el-col> |
| 107 | + <el-col :span="10" /> |
| 108 | + </el-row> |
| 109 | + </el-descriptions-item> |
| 110 | + </el-descriptions> |
| 111 | + <!-- 售后信息 --> |
| 112 | + <el-descriptions title="售后日志" /> |
| 113 | + </ContentWrap> |
| 114 | + |
| 115 | + <!-- 各种操作的弹窗 --> |
| 116 | + <UpdateAuditReasonForm ref="updateAuditReasonFormRef" @success="getDetail" /> |
| 117 | +</template> |
| 118 | +<script lang="ts" setup> |
| 119 | +import * as AfterSaleApi from '@/api/mall/trade/afterSale/index' |
| 120 | +import { floatToFixed2 } from '@/utils' |
| 121 | +import { DICT_TYPE } from '@/utils/dict' |
| 122 | +import { formatDate } from '@/utils/formatTime' |
| 123 | +import UpdateAuditReasonForm from '@/views/mall/trade/afterSale/components/UpdateAuditReasonForm.vue' |
| 124 | +
|
| 125 | +defineOptions({ name: 'TradeOrderDetailForm' }) |
| 126 | +
|
| 127 | +const message = useMessage() // 消息弹窗 |
| 128 | +const { params } = useRoute() // 查询参数 |
| 129 | +const formData = ref({ |
| 130 | + order: {} |
| 131 | +}) |
| 132 | +const updateAuditReasonFormRef = ref() // 拒绝售后表单 Ref |
| 133 | +/** 获得详情 */ |
| 134 | +const getDetail = async () => { |
| 135 | + const id = params.orderId as unknown as number |
| 136 | + if (id) { |
| 137 | + formData.value = await AfterSaleApi.getAfterSale(id) |
| 138 | + } |
| 139 | +} |
| 140 | +const openForm = (type: string) => { |
| 141 | + switch (type) { |
| 142 | + case 'agree': |
| 143 | + message.confirm('是否同意售后?').then(() => { |
| 144 | + AfterSaleApi.agree(formData.value.id) |
| 145 | + }) |
| 146 | + break |
| 147 | + case 'disagree': |
| 148 | + updateAuditReasonFormRef.value?.open(formData.value) |
| 149 | + break |
| 150 | + case 'receive': |
| 151 | + message.confirm('是否确认收货?').then(() => { |
| 152 | + AfterSaleApi.receive(formData.value.id) |
| 153 | + }) |
| 154 | + break |
| 155 | + case 'refuse': |
| 156 | + message.confirm('是否拒绝收货?').then(() => { |
| 157 | + AfterSaleApi.refuse(formData.value.id) |
| 158 | + }) |
| 159 | + break |
| 160 | + case 'refund': |
| 161 | + message.confirm('是否确认退款?').then(() => { |
| 162 | + AfterSaleApi.refund(formData.value.id) |
| 163 | + }) |
| 164 | + break |
| 165 | + } |
| 166 | +} |
| 167 | +onMounted(async () => { |
| 168 | + await getDetail() |
| 169 | +}) |
| 170 | +</script> |
| 171 | +<style lang="scss" scoped> |
| 172 | +:deep(.el-descriptions) { |
| 173 | + &:not(:nth-child(1)) { |
| 174 | + margin-top: 20px; |
| 175 | + } |
| 176 | +
|
| 177 | + .el-descriptions__title { |
| 178 | + display: flex; |
| 179 | + align-items: center; |
| 180 | +
|
| 181 | + &::before { |
| 182 | + display: inline-block; |
| 183 | + width: 3px; |
| 184 | + height: 20px; |
| 185 | + margin-right: 10px; |
| 186 | + background-color: #409eff; |
| 187 | + content: ''; |
| 188 | + } |
| 189 | + } |
| 190 | +
|
| 191 | + .el-descriptions-item__container { |
| 192 | + margin: 0 10px; |
| 193 | +
|
| 194 | + .no-colon { |
| 195 | + margin: 0; |
| 196 | +
|
| 197 | + &::after { |
| 198 | + content: ''; |
| 199 | + } |
| 200 | + } |
| 201 | + } |
| 202 | +} |
| 203 | +</style> |
0 commit comments