<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="applyForAli(record)">1688申请退款</a>
|
</template>
|
</a-table>
|
</a-card>
|
|
<!-- <RefuseRemardForm
|
ref="refuseModal"
|
:visible="refusevisible"
|
:model="refuseRecord"
|
|
@cancel="refuseCancel"
|
@ok="refuse"
|
/> -->
|
|
<ReturnGoodsSet
|
ref="returnsetModal"
|
:visible="returngoodssetvisible"
|
:model="returnGoodsSet"
|
@cancel="returngoodsCancel"
|
@ok="returngoods"
|
/>
|
|
</page-header-wrapper>
|
</template>
|
|
<script>
|
import { ref } from 'vue'
|
|
import { GetRefundList, JudgeAliTrade, AliApplyFor, GetRefundDetailUrl, GetRefundDetail } from '@/api/refundapi'
|
import RefuseRemardForm from './modules/RefuseRemardForm'
|
import ReturnGoodsSet from './modules/ReturnGoodsSet'
|
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: 'Waiteapplyfor',
|
components: {
|
RefuseRemardForm,
|
ReturnGoodsSet
|
},
|
data () {
|
return {
|
queryParam: {},
|
columns,
|
refuseRecord: {},
|
loading: false,
|
returnGoodsSet: {},
|
refusevisible: false,
|
returngoodssetvisible: 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_AGREE',
|
RelationType: 0
|
}
|
GetRefundList(parameter).then(res => {
|
this.data = res.result.data
|
this.pagination.total = res.result.totalCount
|
}).finally(() => {
|
this.loading = false
|
})
|
},
|
// 1688申请退款
|
applyForAli (record) {
|
this.loading = true
|
// 判断1688订单状态
|
const judgePar = {
|
RefundId: record.refundId
|
}
|
JudgeAliTrade(judgePar).then(res => {
|
if (res.result.isAliTrade && res.result.isAliTradePay)//
|
{ // 已经创建订单且已付款
|
const getParam = {
|
RefundId: record.refundId
|
}
|
GetRefundDetail(getParam).then(res => {
|
this.returnGoodsSet = res.result
|
this.returngoodssetvisible = true
|
})
|
} else {
|
const parameter = {
|
refundId: record.refundId
|
}
|
AliApplyFor(parameter).then(res => {
|
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')
|
})
|
},
|
// 1688退货退款
|
returngoodsCancel () {
|
this.returnGoodsSet = {}
|
this.returngoodssetvisible = false
|
this.loading = false
|
},
|
returngoods () {
|
const form = this.$refs.returnsetModal.form
|
const data = this.$refs.returnsetModal.model
|
form.validateFields((errors, values) => {
|
if (!errors) {
|
const applyPar = {
|
refundId: this.returnGoodsSet.refundId,
|
disputeRequest: values.disputeRequest,
|
applyPayment: values.applyPayment,
|
applyCarriage: values.applyCarriage,
|
applyReasonId: values.applyReasonIds,
|
description: values.description,
|
goodsStatus: values.goodsStatus
|
}
|
AliApplyFor(applyPar).then(res => {
|
if (res.result) {
|
this.$message.success(`操作成功!`)
|
this.pagination.current = 1
|
this.onSearch()
|
}
|
}).finally(() => {
|
this.loading = false
|
})
|
}
|
}
|
)
|
}
|
}
|
}
|
</script>
|