feature/0423
wanghousheng 10 months ago
parent b51f52bec4
commit 0fbdcd0772
  1. 3
      src/common/enum/order/refund/RefundType.js
  2. 4
      src/views/order/Index.vue
  3. 122
      src/views/order/refund/Detail.vue
  4. 41
      src/views/order/refund/modules/AuditForm.vue

@ -6,5 +6,6 @@ import Enum from '../../enum'
*/
export default new Enum([
{ key: 'RETURN', name: '退货退款', value: 10 },
{ key: 'EXCHANGE', name: '换货', value: 20 }
{ key: 'EXCHANGE', name: '换货', value: 20 },
{ key: 'RETURNPRICE', name: '退款', value: 30 },
])

@ -393,9 +393,9 @@ export default {
try {
const textToCopy = text
await navigator.clipboard.writeText(textToCopy)
console.log('文本已复制到剪贴板')
this.$message.success('复制成功', 1.5)
} catch (err) {
console.error('复制到剪贴板失败', err)
this.$message.error('复制失败', 1.5)
}
},
//

@ -20,23 +20,22 @@
<!-- 操作栏 -->
<div class="actions mt-10">
<div v-if="$auth('/order/refund/index.audit')">
<a-button
v-if="record.audit_status == AuditStatusEnum.WAIT.value"
type="primary"
@click="handleAudit"
>商家审核</a-button>
<a-button v-if="record.audit_status == AuditStatusEnum.WAIT.value" type="primary" @click="handleAudit"
>商家审核</a-button
>
</div>
<div v-if="$auth('/order/refund/index.receipt')">
<a-button
v-if="(
record.type == RefundTypeEnum.RETURN.value
&& record.audit_status == AuditStatusEnum.REVIEWED.value
&& record.is_user_send
&& !record.is_receipt
)"
v-if="
record.type == RefundTypeEnum.RETURN.value &&
record.audit_status == AuditStatusEnum.REVIEWED.value &&
record.is_user_send &&
!record.is_receipt
"
type="primary"
@click="handleReceipt"
>确认收货</a-button>
>确认收货</a-button
>
</div>
</div>
<a-divider class="o-divider" />
@ -48,7 +47,8 @@
title="查看订单详情"
:to="{ path: '/order/detail', query: { orderId: record.order_id } }"
target="_blank"
>{{ record.orderData.order_no }}</router-link>
>{{ record.orderData.order_no }}</router-link
>
</a-descriptions-item>
<a-descriptions-item label="买家信息">
<a-tooltip>
@ -66,9 +66,7 @@
<a-tag>{{ RefundTypeEnum[record.type].name }}</a-tag>
</a-descriptions-item>
<a-descriptions-item label="售后单状态">
<a-tag
:color="renderRefundStatusColor(record.status)"
>{{ RefundStatusEnum[record.status].name }}</a-tag>
<a-tag :color="renderRefundStatusColor(record.status)">{{ RefundStatusEnum[record.status].name }}</a-tag>
</a-descriptions-item>
<a-descriptions-item label="申请时间">{{ record.create_time }}</a-descriptions-item>
</a-descriptions>
@ -76,22 +74,17 @@
<!-- 售后单信息 -->
<a-descriptions title="处理进度">
<a-descriptions-item label="审核状态 (商家)">
<a-tag
:color="renderAuditStatusColor(record.audit_status)"
>{{ AuditStatusEnum[record.audit_status].name }}</a-tag>
<a-tag :color="renderAuditStatusColor(record.audit_status)">{{
AuditStatusEnum[record.audit_status].name
}}</a-tag>
</a-descriptions-item>
<a-descriptions-item v-if="record.type == RefundTypeEnum.RETURN.value" label="发货状态 (买家)">
<a-tag
:color="record.is_user_send ? 'green' : ''"
>{{ record.is_user_send ? '已发货' : '待发货' }}</a-tag>
<a-tag :color="record.is_user_send ? 'green' : ''">{{ record.is_user_send ? '已发货' : '待发货' }}</a-tag>
</a-descriptions-item>
<a-descriptions-item v-if="record.type == RefundTypeEnum.RETURN.value" label="收货状态 (商家)">
<a-tag :color="record.is_receipt ? 'green' : ''">{{ record.is_receipt ? '已收货' : '待收货' }}</a-tag>
</a-descriptions-item>
<a-descriptions-item
v-if="record.audit_status == AuditStatusEnum.REJECTED.value"
label="拒绝原因"
>
<a-descriptions-item v-if="record.audit_status == AuditStatusEnum.REJECTED.value" label="拒绝原因">
<span>{{ record.refuse_desc }}</span>
</a-descriptions-item>
</a-descriptions>
@ -135,7 +128,7 @@
image: item.goods_image,
imageAlt: '商品图片',
title: item.goods_name,
goodsProps: item.goods_props
goodsProps: item.goods_props,
}"
/>
</template>
@ -153,7 +146,7 @@
<!-- 商家退货地址 -->
<a-card
v-if="record.audit_status == AuditStatusEnum.REVIEWED.value"
v-if="record.audit_status == AuditStatusEnum.REVIEWED.value && record.type != RefundTypeEnum.RETURNPRICE.value"
class="mt-20"
:bordered="false"
>
@ -161,11 +154,7 @@
<a-descriptions-item label="收货人姓名">{{ record.address.name }}</a-descriptions-item>
<a-descriptions-item label="联系电话">{{ record.address.phone }}</a-descriptions-item>
<a-descriptions-item label="所在地区">
<span
class="region mr-5"
v-for="(region, idx) in record.address.region"
:key="idx"
>{{ region }}</span>
<span class="region mr-5" v-for="(region, idx) in record.address.region" :key="idx">{{ region }}</span>
</a-descriptions-item>
<a-descriptions-item label="详细地址">{{ record.address.detail }}</a-descriptions-item>
</a-descriptions>
@ -173,11 +162,11 @@
<!-- 用户发货信息 -->
<a-card
v-if="(
record.type == RefundTypeEnum.RETURN.value
&& record.audit_status == AuditStatusEnum.REVIEWED.value
&& record.is_user_send
)"
v-if="
record.type == RefundTypeEnum.RETURN.value &&
record.audit_status == AuditStatusEnum.REVIEWED.value &&
record.is_user_send
"
class="mt-20"
:bordered="false"
>
@ -185,14 +174,11 @@
<a-descriptions-item label="物流公司">{{ record.express.express_name }}</a-descriptions-item>
<a-descriptions-item label="物流单号">{{ record.express_no }}</a-descriptions-item>
<a-descriptions-item label="发货状态">
<a-tag
:color="record.is_user_send ? 'green' : ''"
>{{ record.is_user_send ? '已发货' : '待发货' }}</a-tag>
<a-tag :color="record.is_user_send ? 'green' : ''">{{ record.is_user_send ? '已发货' : '待发货' }}</a-tag>
</a-descriptions-item>
<a-descriptions-item label="发货时间">{{ record.send_time }}</a-descriptions-item>
</a-descriptions>
</a-card>
</div>
<AuditForm ref="AuditForm" @handleSubmit="handleRefresh" />
<ReceiptForm ref="ReceiptForm" @handleSubmit="handleRefresh" />
@ -210,33 +196,33 @@ import { AuditForm, ReceiptForm } from './modules'
const goodsColumns = [
{
title: '商品信息',
scopedSlots: { customRender: 'goodsInfo' }
scopedSlots: { customRender: 'goodsInfo' },
},
{
title: '商品编码',
dataIndex: 'goods_no',
scopedSlots: { customRender: 'goods_no' }
scopedSlots: { customRender: 'goods_no' },
},
{
title: '重量(Kg)',
dataIndex: 'goods_weight',
scopedSlots: { customRender: 'goods_weight' }
scopedSlots: { customRender: 'goods_weight' },
},
{
title: '单价',
dataIndex: 'goods_price',
scopedSlots: { customRender: 'goods_price' }
scopedSlots: { customRender: 'goods_price' },
},
{
title: '购买数量',
dataIndex: 'total_num',
scopedSlots: { customRender: 'total_num' }
scopedSlots: { customRender: 'total_num' },
},
{
title: '实际付款价',
dataIndex: 'total_pay_price',
scopedSlots: { customRender: 'total_pay_price' }
}
scopedSlots: { customRender: 'total_pay_price' },
},
]
export default {
@ -245,9 +231,9 @@ export default {
GoodsItem,
UserItem,
AuditForm,
ReceiptForm
ReceiptForm,
},
data () {
data() {
return {
//
isLoading: true,
@ -258,81 +244,79 @@ export default {
//
goodsColumns,
//
goodsList: []
goodsList: [],
}
},
beforeCreate () {
beforeCreate() {
//
assignment(this, {
AuditStatusEnum,
RefundStatusEnum,
RefundTypeEnum
RefundTypeEnum,
})
},
created () {
created() {
// ID
this.orderRefundId = this.$route.query.orderRefundId
//
this.handleRefresh()
},
methods: {
//
handleRefresh () {
handleRefresh() {
//
this.getDetail()
},
//
getDetail () {
getDetail() {
const { orderRefundId } = this
this.isLoading = true
Api.detail({ orderRefundId })
.then(result => {
.then((result) => {
//
this.record = result.data.detail
//
this.goodsList = [this.record.orderGoods]
})
.finally(() => this.isLoading = false)
.finally(() => (this.isLoading = false))
},
//
renderAuditStatusColor (status) {
renderAuditStatusColor(status) {
const { AuditStatusEnum } = this
const ColorEnum = {
[AuditStatusEnum.WAIT.value]: '',
[AuditStatusEnum.REVIEWED.value]: 'green',
[AuditStatusEnum.REJECTED.value]: 'red'
[AuditStatusEnum.REJECTED.value]: 'red',
}
return ColorEnum[status]
},
//
renderRefundStatusColor (status) {
renderRefundStatusColor(status) {
const { RefundStatusEnum } = this
const ColorEnum = {
[RefundStatusEnum.NORMAL.value]: '',
[RefundStatusEnum.REJECTED.value]: 'red',
[RefundStatusEnum.COMPLETED.value]: 'green',
[RefundStatusEnum.CANCELLED.value]: 'red'
[RefundStatusEnum.CANCELLED.value]: 'red',
}
return ColorEnum[status]
},
//
handleAudit () {
handleAudit() {
const { record } = this
this.$refs.AuditForm.show(record)
},
//
handleReceipt () {
handleReceipt() {
const { record } = this
this.$refs.ReceiptForm.show(record)
}
}
},
},
}
</script>
<style lang="less" scoped>

@ -14,14 +14,49 @@
<a-form-item label="售后类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-tag>{{ RefundTypeEnum[record.type].name }}</a-tag>
</a-form-item>
<a-form-item label="审核状态" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="false">
<a-radio-group v-decorator="['audit_status', { initialValue: 20, rules: [{ required: true }] }]">
<a-form-item label="审核状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group v-decorator="['audit_status', { initialValue: 10, rules: [{ required: true }] }]">
<a-radio :value="10">同意</a-radio>
<a-radio :value="20">拒绝</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item
v-if="form.getFieldValue('audit_status') == AuditStatusEnum.REVIEWED.value"
label="订单付款的总金额"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
v-if="record.type == RefundTypeEnum.RETURNPRICE.value"
>
<span>{{ record.orderData.pay_price }}</span>
</a-form-item>
<a-form-item
label="退款的金额"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
v-if="
record.type == RefundTypeEnum.RETURNPRICE.value &&
form.getFieldValue('audit_status') == AuditStatusEnum.REVIEWED.value
"
>
<a-input-number
:min="0"
:precision="2"
v-decorator="['refund_money', { rules: [{ required: true, message: '请输入退款金额' }] }]"
/>
<span class="ml-10"></span>
<div class="form-item-help">
<p class="extra">
请输入退款金额最多{{
Math.min(record.orderGoods.total_pay_price, record.orderData.pay_price)
}}最多不能大于订单实际付款的总金额
</p>
</div>
</a-form-item>
<a-form-item
v-if="
form.getFieldValue('audit_status') == AuditStatusEnum.REVIEWED.value &&
record.type == RefundTypeEnum.RETURN.value
"
label="退货地址"
:labelCol="labelCol"
:wrapperCol="wrapperCol"

Loading…
Cancel
Save