<template>
|
<page-header-wrapper
|
:breadcrumb="false"
|
>
|
<a-card :bordered="false">
|
<div class="table-page-search-wrapper" style="background-color: #fff;">
|
<a-form layout="inline">
|
<a-row :gutter="48">
|
<a-col :md="8" :sm="24">
|
<a-form-item label="退款单号">
|
<a-input v-model="queryParam.tid" placeholder="请输入有赞退款号查询"/>
|
</a-form-item>
|
</a-col>
|
<a-col :md="8" :sm="24">
|
<a-form-item>
|
<a-button type="primary" @click="onSearch">查询</a-button>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
</a-form>
|
</div>
|
|
<a-table
|
rowKey="id"
|
ref="table"
|
size="default"
|
:pagination="pagination"
|
:columns="columns"
|
:data-source="data"
|
:scroll="{ x: 2200 }"
|
:loading="loading"
|
>
|
<template slot="tradedetail" slot-scope="text, record">
|
<a @click="getRefundDetail(record)">{{ record.refundId }}</a>
|
</template>
|
<template slot="alitradestatus" slot-scope="text, record">
|
{{ getAliStatus(record) }}
|
</template>
|
<template slot="refundstatus" slot-scope="text, record">
|
{{ getRefundStatus(record) }}
|
</template>
|
<template slot="action" slot-scope="text, record">
|
<a @click="backReturn(record)">回传退货单</a>
|
<!---| <a @click="refuseRefund(record)">拒绝退款</a>-->
|
</template>
|
</a-table>
|
</a-card>
|
|
</page-header-wrapper>
|
</template>
|
|
<script>
|
import { ref } from 'vue'
|
|
import { GetRefundList, GetRefundDetailUrl, ReturnGoods } from '@/api/refundapi'
|
import GoodAddressForm from './modules/GoodAddressForm'
|
const columns = [
|
{
|
title: '有赞退款单',
|
dataIndex: 'refundId',
|
fixed: 'left',
|
scopedSlots: { customRender: 'tradedetail' }
|
},
|
{
|
title: '退款类型',
|
width: '100px',
|
dataIndex: 'refundType',
|
ellipsis: true,
|
customRender: (text) => text == 'REFUND_ONLY' ? '仅退款' : '退货退款'
|
},
|
{
|
title: '1688订单',
|
dataIndex: 'aliTid',
|
customRender: (text) => text == null ? '未创建1688订单' : text
|
},
|
{
|
title: '有赞子订单',
|
dataIndex: 'yzOid'
|
},
|
{
|
title: '有赞主订单',
|
dataIndex: 'yzTid'
|
},
|
{
|
title: '退款金额',
|
dataIndex: 'refundedFee'
|
},
|
{
|
title: '有赞退款状态',
|
dataIndex: 'yzRefundStaus',
|
ellipsis: true,
|
scopedSlots: { customRender: 'refundstatus' }
|
},
|
{
|
title: '退款原因',
|
dataIndex: 'refundReasonDesc'
|
},
|
{
|
title: '1688订单状态',
|
dataIndex: 'aliTradeStatus',
|
ellipsis: true,
|
scopedSlots: { customRender: 'alitradestatus' }
|
},
|
|
{
|
title: '备注',
|
dataIndex: 'memo'
|
},
|
{
|
title: '操作',
|
dataIndex: 'action',
|
fixed: 'right',
|
scopedSlots: { customRender: 'action' }
|
}
|
]
|
export default {
|
name: 'Backreturn',
|
components: {
|
GoodAddressForm
|
},
|
data () {
|
return {
|
queryParam: {},
|
columns,
|
loading: false,
|
data: [],
|
pagination: {
|
current: 1,
|
pageSize: 10,
|
total: 0,
|
pageSizeOptions: ['10', '20'],
|
onChange: this.onPageChange,
|
onShowSizeChange: this.onPageChange
|
}
|
}
|
},
|
setup () {
|
|
},
|
created () {
|
this.onSearch()
|
},
|
methods: {
|
onPageChange (current, size) {
|
this.pagination.current = current
|
this.pagination.pageSize = size
|
this.onSearch()
|
},
|
onSearch () {
|
this.loading = true
|
var parameter = {
|
PageNo: this.pagination.current,
|
PageSize: this.pagination.pageSize,
|
YzRefundStatus: 'REFUND_WAIT_SELLER_CONFIRM_GOODS',
|
RelationType: 3
|
}
|
GetRefundList(parameter).then(res => {
|
this.data = res.result.data
|
this.pagination.total = res.result.totalCount
|
}).finally(() => {
|
this.loading = false
|
})
|
},
|
// 回传退货单
|
backReturn (record) {
|
this.loading = true
|
const parameter = {
|
RefundId: record.refundId
|
}
|
ReturnGoods(parameter).then(res => {
|
if (res.result) {
|
this.$message.success(`操作成功!`)
|
this.pagination.current = 1
|
this.onSearch()
|
}
|
}).finally(() => {
|
this.loading = false
|
})
|
},
|
// 获取1688订单状态
|
getAliStatus (record) {
|
switch (record.aliTradeStatus) {
|
case 'waitbuyerpay':
|
return '等待买家付款'
|
case 'waitsellersend':
|
return '等待卖家发货'
|
case 'waitbuyerreceive':
|
return '等待买家收货'
|
case 'confirm_goods':
|
return '已收货'
|
case 'success':
|
return '交易成功'
|
case 'cancel':
|
return '交易取消'
|
case 'terminated':
|
return '交易终止'
|
default:
|
return '未知状态'
|
}
|
},
|
// 获取退款状态
|
getRefundStatus (record) {
|
switch (record.yzRefundStaus) {
|
case 'REFUND_WAIT_SELLER_AGREE':
|
return '买家已经申请退款,等待卖家同意'
|
case 'REFUND_SELLER_REFUSE_BUYER':
|
return '卖家拒绝退款'
|
case 'REFUND_WAIT_BUYER_RETURN_GOODS':
|
return '卖家已经同意退货,等待买家退货'
|
case 'REFUND_WAIT_SELLER_CONFIRM_GOODS':
|
return '买家已经退货,等待卖家确认收货'
|
case 'REFUND_SELLER_REFUSE_RETURN_GOODS':
|
return '卖家未收到货,拒绝退款'
|
case 'REFUND_CLOSED':
|
return '退款关闭'
|
case 'REFUND_SUCCESS':
|
return '退款成功'
|
}
|
},
|
// 跳转退款详情
|
getRefundDetail (record) {
|
const parameter = {
|
RefundId: record.refundId,
|
TradeId: record.yzTid
|
}
|
GetRefundDetailUrl(parameter).then(res => {
|
window.open(res.result, '_blank')
|
})
|
}
|
}
|
}
|
</script>
|