提交 37efc899 authored 作者: huaxinzhu's avatar huaxinzhu

售后 接口

上级 04922129
...@@ -91,3 +91,29 @@ export function getASOrderDetail(query) { ...@@ -91,3 +91,29 @@ export function getASOrderDetail(query) {
}) })
} }
// 售后 同意类操作
export function agreeRefundData(data) {
return request({
url: '/system/retreat/refundAgree',
method: 'post',
data: data
})
}
// 售后 拒绝类 操作
export function refuseRefundData(data) {
return request({
url: '/system/retreat/refundReject',
method: 'post',
data: data
})
}
// 退货退款 地址
export function getASAdressData(query) {
return request({
url: '/local/AfterSalesAddress/list',
method: 'get',
params: query
})
}
...@@ -268,7 +268,7 @@ ...@@ -268,7 +268,7 @@
/** 获取 seller_id*/ /** 获取 seller_id*/
this.sellerId = this.$store.state.user.sellerid; this.sellerId = this.$store.state.user.sellerid;
// 获取 订单 状态对应数量 // 获取 订单 状态对应数量
this.getOrderTab() //this.getOrderTab()
// 订单列表 搜索 // 订单列表 搜索
this.getListOrder() this.getListOrder()
// //
...@@ -360,19 +360,19 @@ ...@@ -360,19 +360,19 @@
}, },
/** 获取 订单 状态对应数量 */ /** 获取 订单 状态对应数量 */
getOrderTab() { getOrderTab() {
getOrderTabData().then(res => { // getOrderTabData().then(res => {
//console.log("获取订单状态和对应订单数量",res); // //console.log("获取订单状态和对应订单数量",res);
if (res.code === 1 && res.data.length > 0) { // if (res.code === 1 && res.data.length > 0) {
// 1 表示 代发货;2 表示 已发货 // // 1 表示 代发货;2 表示 已发货
for (let i = 0; i < res.data.length; i++) { // for (let i = 0; i < res.data.length; i++) {
if (res.data[i].Status === 1) { // if (res.data[i].Status === 1) {
this.total1 = res.data[i].Count > 999 ? '999+' : res.data[i].Count; // this.total1 = res.data[i].Count > 999 ? '999+' : res.data[i].Count;
} else if (res.data[i].Status === 2) { // } else if (res.data[i].Status === 2) {
this.total2 = res.data[i].Count > 999 ? '999+' : res.data[i].Count; // this.total2 = res.data[i].Count > 999 ? '999+' : res.data[i].Count;
} // }
} // }
} // }
}); // });
}, },
// 获取订单列表 // 获取订单列表
getListOrder() { getListOrder() {
...@@ -402,6 +402,12 @@ ...@@ -402,6 +402,12 @@
this.total = res.data.count || 0 this.total = res.data.count || 0
this.tableDataList = res.data.data this.tableDataList = res.data.data
if(this.goodsStatus == 1) {
this.taotal1 = res.data.count;
}else if(this.goodsStatus == 2) {
this.taotal2 = res.data.count;
}
} }
}) })
}, },
......
...@@ -129,20 +129,77 @@ ...@@ -129,20 +129,77 @@
</div> </div>
<!-- 售后 操作按钮 --> <!-- 售后 操作按钮 -->
<div class="as-handle-btn" v-if="asOrderType == 1"> <div class="as-handle-btn" v-if="onlyOrRefundBtnType == 1">
<el-button class="as-btn" type="primary">同意退款</el-button> <el-button class="as-btn" type="primary" @click="agreeHandle(1)">同意退款</el-button>
<el-button class="as-btn" type="primary">拒绝退款</el-button> <el-button class="as-btn" type="primary" @click="refuseHandle(2)">拒绝退款</el-button>
</div>
<div class="as-handle-btn" v-if="onlyOrRefundBtnType == 2">
<el-button class="as-btn" type="primary" @click="agreeHandle(3)">同意退货退款</el-button>
<el-button class="as-btn" type="primary" @click="refuseHandle(4)">拒绝退货退款</el-button>
</div>
<div class="as-handle-btn" v-if="onlyOrRefundBtnType == 3">
<el-button class="as-btn" type="primary" @click="refuseHandle(4)">拒收包裹</el-button>
<el-button class="as-btn" type="primary" @click="agreeHandle(1)">确定退款</el-button>
</div> </div>
</el-card> </el-card>
<!-- 仅退款 同意退款 对话框 --> <!-- [仅退款 同意/拒绝] [退货退款 确定退款/拒收包裹] 对话框 -->
<el-dialog
:title="dialogASTypeTitle"
:visible.sync="isASTypeDialog"
width="50%"
center>
<div v-if="onlyIsAgree == 1" class="only-refund-agree">
<p>同意退款,该订单将关闭,请您仔细核实商品发货状态以及退款金额,若因此导致的损失将由您自己承担!</p>
<p>确定同意同款吗?</p>
<p>确定同意退款后,将关闭该订单</p>
</div>
<div v-if="onlyIsAgree == 2" class="only-refund-refuse">
<p>拒绝原因:</p>
<p style="width:80%">
<el-input type="textarea" v-model="onlyRefuseReason" :rows="4"></el-input>
</p>
</div>
<div v-if="onlyIsAgree == 3" class="refund-agree">
<div class="refund-agree-1">
<p>同意退货退款,买家回填退货商品的物流单号,收到货后,请您仔细核实商品,核实无误后,点击【确定退款】按钮进行退款!若因此导致的损失将由您自己承担!</p>
<p>确定同意退货退款吗?</p>
<p>确定同意退货退款后,等待买家退回商品</p>
</div>
<div class="refund-agree-2">
<p>选择发送退换货地址:</p>
<p style="width:80%">
<el-select v-model="order_refund_address" placeholder="退货地址" style="width: 80%;">
<el-option v-for="(item,index) in asAddressOptions" :key="item.id" :label="item.info"
:value="item.id"></el-option>
</el-select>
</p>
</div>
</div>
<div v-if="onlyIsAgree == 4" class="onlyIsAgree-4">
<div class="onlyIsAgree-4-1">
<p>拒绝原因:</p>
<p style="width:80%">
<el-input type="textarea" v-model="refuseReason" :rows="4"></el-input>
</p>
</div>
<p>请详细说明您拒绝的原因,拒绝后售后不会结束,买家可再次申请</p>
</div>
<!-- 仅退款 拒绝退款 对话框 --> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitAfterSale(onlyIsAgree)" size="small">确 定</el-button>
<el-button @click="cancelAfterSale(onlyIsAgree)" size="small">取 消</el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { getASOrderDetail } from '@/api/module/retreat' import { getASOrderDetail, agreeRefundData, refuseRefundData,getASAdressData } from '@/api/module/retreat'
import { dateFormat } from '@/utils' //getASOrderDetail import { dateFormat } from '@/utils' //getASOrderDetail
export default { export default {
name: "Edit", name: "Edit",
...@@ -185,14 +242,28 @@ ...@@ -185,14 +242,28 @@
asApplyList: [ asApplyList: [
{ data1:1256332213,data2: 1,data3: 3,data4: 4,data5:5, data6: 6,data7: 7 } { data1:1256332213,data2: 1,data3: 3,data4: 4,data5:5, data6: 6,data7: 7 }
], ],
// 0-全部隐藏-默认状态; 1-显示 仅退款 按钮;2-显示 退货退款中(同意/拒绝 退货退款)按钮; 3-显示 退货退款中 (拒收包裹 / 确定退款) 按钮
onlyOrRefundBtnType: 0,
// 1-仅退款 同意退款; 2-仅退款 拒绝退款; 3-退货退款 同意退款退款; 4-; 5-
onlyIsAgree: 0,
dialogASTypeTitle: '',
isASTypeDialog: false,
onlyRefuseReason: '',
refuseReason: '',
sellerId: 0,
asAddressOptions: [],
order_refund_address:''
} // return end } // return end
}, },
watch: {}, watch: {},
created() { created() {
this.sellerId = this.$store.state.user.sellerid;
/** 获取 当前售后 订单的id */ /** 获取 当前售后 订单的id */
this.asGoodId = this.$route.query.refund_sn; this.asGoodId = this.$route.query.refund_sn;
/** 查询 售后订单详情 */ /** 查询 售后订单详情 */
this.getDetail(); this.getDetail();
/** 获取 退货退款的发送 地址 */
this.getASAdress();
}, },
mounted() {}, mounted() {},
methods: { methods: {
...@@ -305,13 +376,15 @@ ...@@ -305,13 +376,15 @@
// 售后订单详情 // 售后订单详情
if( res.data.order_refund ) { if( res.data.order_refund ) {
this.asOrderDetail = res.data.order_refund; this.asOrderDetail = res.data.order_refund;
//----- 测试数据 --- //------------ 测试数据
this.asOrderDetail.refund_type = 1; // this.asOrderDetail.refund_type = 2;
// this.asOrderDetail.status = 2;
// this.asOrderDetail.close_reason = 2;
//-------- //--------------
// 先确定 售后类型 // 先确定 售后类型
this.asOrderType = this.asOrderDetail.refund_type this.asOrderType = this.asOrderDetail.refund_type
// 根据售后订单信息,判断 订单状态,显示对应按钮操作
this.asHandleBtnType(this.asOrderDetail)
// 金额处理 // 金额处理
this.asOrderDetail.apply_price = this.asOrderDetail.apply_price / 100 this.asOrderDetail.apply_price = this.asOrderDetail.apply_price / 100
this.asOrderDetail.price = this.asOrderDetail.price / 100 this.asOrderDetail.price = this.asOrderDetail.price / 100
...@@ -342,6 +415,177 @@ ...@@ -342,6 +415,177 @@
} }
}); });
}, },
/** 仅退款
* 操作按钮 类型
* onlyOrRefundBtnType:// 1-显示 仅退款 按钮; 2-显示 退货退款中(同意/拒绝 退货退款)按钮; 3-显示 退货退款中 (拒收包裹 / 确定退款) 按钮
* disabledOnlyBtn: true-售后结束-不能点击;false-可以点击
* 每次 订单详情更新,被调用
* */
asHandleBtnType(row) {
// row.refund_type 1-仅退款 ; 2-退货退款
// row.status 退款状态-1关闭1待审核2待退货3待收货4待打款5已完成
// row.close_reason 售后关闭原因: 1卖家拒绝退款、退货退款 2卖家拒收拒绝退款 3买家超时未退货自动关闭 6买家取消
if( row ) {
if(row.refund_type == 1) {
this.onlyOrRefundBtnType = 1
}else if(row.refund_type == 2) {
this.onlyOrRefundBtnType = (row.status == 1) ? 2 : 3
}else {
this.onlyOrRefundBtnType = 0;
}
}
},
/** 同意 */
agreeHandle(type) {
if(type == 1) {
this.onlyIsAgree = type // 仅退款 同意退款
this.dialogASTypeTitle = "提示";
this.isASTypeDialog = true;
}
if(type ==3) {
this.onlyIsAgree = type // 退货退款 同意退货退款
this.dialogASTypeTitle = "提示";
this.isASTypeDialog = true;
}
},
/** 拒绝 */
refuseHandle(type) {
if( type== 2 ) {
this.onlyIsAgree = type // 仅退款的 拒绝退款
this.dialogASTypeTitle = "拒绝原因";
this.onlyRefuseReason = '';
this.isASTypeDialog = true;
}
if( type == 4 ) {
this.onlyIsAgree = type // 4 拒绝退货退款
this.dialogASTypeTitle = "拒绝原因";
this.refuseReason = '';
this.isASTypeDialog = true;
}
},
/** 提交 退款 处理信息
*
* */
submitAfterSale(type) {
console.log("确定的类型",type);
let params = {
order_refund_sn: 0
};
// type为1,则为,仅退款的 同意退款 操作
if(this.onlyIsAgree == 1) {
params.order_refund_sn = this.asGoodId
// 1、为了更好提示,2、预防后期接口解耦
agreeRefundData(params).then(res=> {
let msg = ''
if(res.code == 1) {
this.$message({type:'success',message:'操作成功'});
}else {
msg = res.message ? res.message : '操作失败'
this.$message({type:'error',message:msg});
}
this.isASTypeDialog = false;
// 更新订单
this.getDetail();
});
}
// type为2,则为,仅退款的 拒绝退款 操作
if(this.onlyIsAgree == 2) {
if(this.onlyRefuseReason == '') {
this.$message({type:'warning',message: '请输入拒绝退款的原因'});
return
}
params['reason'] = this.onlyRefuseReason;
refuseRefundData(params).then(res=> {
let msg = ''
if(res.code == 1) {
this.$message({type:'success',message:'操作成功'});
}else {
msg = res.message ? res.message : '操作失败'
this.$message({type:'error',message:msg});
}
this.isASTypeDialog = false;
// 更新订单
this.getDetail();
});
} // type 2 end
// type 为3,则为,退货退款的 同意退货退款,发送地址
if(this.onlyIsAgree == 3) {
// console.log('地址信息:',this.order_refund_address);
if( this.order_refund_address == '' ) {
this.$message({type:'warning',message: '请选择地址信息'});
return
}
params['order_refund_address'] = this.order_refund_address;
agreeRefundData(params).then(res=> {
let msg = ''
if(res.code == 1) {
this.$message({type:'success',message:'操作成功'});
}else {
msg = res.message ? res.message : '操作失败'
this.$message({type:'error',message:msg});
}
this.isASTypeDialog = false;
// 更新订单
this.getDetail();
});
} // type 3 end
// type 为4,则为 退货退款的 拒绝
if(this.onlyIsAgree == 4) {
if(this.refuseReason == '') {
this.$message({type:'warning',message: '请输入拒绝的原因'});
return
}
params['reason'] = this.refuseReason;
refuseRefundData(params).then(res=> {
let msg = ''
if(res.code == 1) {
this.$message({type:'success',message:'操作成功'});
}else {
msg = res.message ? res.message : '操作失败'
this.$message({type:'error',message:msg});
}
this.isASTypeDialog = false;
// 更新订单
this.getDetail();
});
} // type 4 end
//
},
/** */
/** 取消 售后对话框 */
cancelAfterSale(type) {
//console.log("拒绝类型",type);
this.isASTypeDialog = false;
},
/** 售后 退货退款 地址 */
getASAdress() {
let params = {
page:1,
limit:100,
seller_id: this.sellerId
}
getASAdressData(params).then(res=> {
if(res.code == 1) {
this.asAddressOptions = res.data.list;
}else {
let msg = res.message ? res.message : '获取售后地址失败'
this.$message({type:'error',message: msg});
}
});
},
/** 订单发货状态 goodsDeliveryStatus Formatter*/ /** 订单发货状态 goodsDeliveryStatus Formatter*/
GDSFormatter(status) { GDSFormatter(status) {
let statusText = '' let statusText = ''
...@@ -469,6 +713,45 @@ ...@@ -469,6 +713,45 @@
justify-content: center; justify-content: center;
} }
.only-refund-agree {
margin: 0 50px;
}
.only-refund-agree > p{
text-align: center;
line-height: 30px;
}
.only-refund-refuse {
display: flex;
align-items: center;
justify-content: center;
flex-direction: row;
}
.refund-agree .refund-agree-1 > p {
text-align: center;
line-height: 30px;
}
.refund-agree > .refund-agree-2{
display: flex;
align-items: center;
justify-content: center;
flex-direction: row;
}
.onlyIsAgree-4 > .onlyIsAgree-4-1 {
display: flex;
align-items: center;
justify-content: center;
flex-direction: row;
}
.onlyIsAgree-4 > p {
text-align: center;
line-height: 30px;
}
.as-btn { .as-btn {
margin: 40px 20px 20px; margin: 40px 20px 20px;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论