Browse Source

新增售后申请退货物业务流程-不含有部分支付

master
liutong 1 year ago
parent
commit
8171d60648
  1. 13
      components/dialogOrderAfterSale.vue
  2. 2
      pages/order/index.vue
  3. 24
      pages/order/processRefunds.vue
  4. 139
      pages/order/refund.vue
  5. 21
      pages/shopping_cart/submit_order.vue

13
components/dialogOrderAfterSale.vue

@ -25,7 +25,8 @@
<span>没收到货,或与卖家写上同意无需要退货只退款</span>
</div>
</li>
<li>
<!--只有order.order_status[已发货,已收货]时展示"已发货已收货"-->
<li v-if="[3,4].includes(orderData.order_status)">
<input type="radio" name="refundType" v-model="formData.refund_type" value="2">
<div class="left">
<strong>退货退款</strong>
@ -224,7 +225,15 @@ export default {
.then((res) => {
if (res.code == 0) {
this.orderData = res.data
this.orderGoodsList = res.data.order_goods//
let _refund_goods_data = [];//退
res.data.order_goods.forEach((v)=>{
if(v.refund_status == 0){
_refund_goods_data.push(v)
}
})
this.orderGoodsList = _refund_goods_data//
console.log('1111',this.orderGoodsList)
}else{
this.$message.error(res.message);

2
pages/order/index.vue

@ -183,7 +183,7 @@
<template slot-scope="scope">
<!-- 在这里添加自定义内容和判断逻辑 -->
<span v-if="scope.row.order_status_name == `待审核` && scope.row.order_status == 1">待发货</span>
<span v-else>11{{scope.row.order_status_name}}</span>
<span v-else>{{scope.row.order_status_name}}</span>
</template>
</el-table-column>
<!--待审核是展示-->

24
pages/order/processRefunds.vue

@ -46,7 +46,8 @@
<p class="t1">退款成功</p>
<p class="t4">
退款总金额
<span>¥{{refundData.real_goods_money}}</span>
<!-- <span>¥{{refundData.real_goods_money}}</span>-->
<span>¥{{orderGoodsData.refund_status == 3 ? orderGoodsData.refund_real_money : orderGoodsData.refund_apply_money}}</span>
</p>
</div>
<!-- 商品信息 -->
@ -74,13 +75,22 @@
<div>申请时间</div>
<div>{{ $dayjs(refundData.refund_action_time*1000).format('YYYY-MM-DD HH:mm:ss') }}</div>
</div>
<div class="refoundOrder_item" v-if="refundData.refund_fee">
<!--退款状态=3维权结束 && refund_real_money实际退款金额 >0 时展示-->
<div class="refoundOrder_item" v-if="refundData.refund_status == 3 && refundData.refund_real_money>0">
<div>退款金额</div>
<div>¥{{refundData.refund_fee}}</div>
<div>¥{{refundData.refund_real_money}}</div>
</div>
<!--退款申请金额>0时展示-->
<div class="refoundOrder_item" v-else-if="refundData.refund_apply_money > 0">
<div>退款金额</div>
<div>¥{{refundData.refund_apply_money}}</div>
</div>
<div class="refoundOrder_item">
<div>退款原因</div>
<div>{{refundData.refund_reason}}</div>
<div>{{orderGoodsData.refund_remark}}</div>
</div>
<!-- <div class="refoundOrder_item_img" >
<div>上传图片</div>
@ -120,7 +130,7 @@
<script>
import Setting from "~/setting";
export default {
props: ["stepActive", "iSfailed", "iSrefund", "orderData"],
props: ["stepActive", "iSfailed", "iSrefund", "orderData",'orderGoodsData'],
data() {
return {
imgUrl: Setting.uplodBaseURL,
@ -136,6 +146,7 @@ export default {
return item.order_goods_id;
});
this.getRefundData();
//console.log('qq5',this.orderGoodsData)
console.log(this.stepActive, this.iSfailed, this.iSrefund);
},
methods: {
@ -143,7 +154,8 @@ export default {
// 退
// if (this.orderData.order_goods.length > 1) {
let obj = {
order_goods_id: this.order_goods_ids.toString()
//order_goods_id: this.order_goods_ids.toString()
order_goods_id: this.orderGoodsData.order_goods_id.toString()
};
this.$axios
.post(`/orderrefund/detail`, obj)

139
pages/order/refund.vue

@ -15,6 +15,7 @@
:key="stepIndex"
></el-step>
</el-steps>
<ApplyRefund v-if="stepActive == 0" :orderData.sync="orderData" ref="applyRefund" />
<ProcessRefunds
v-if="!stepActive == 0"
@ -23,6 +24,7 @@
:iSfailed.sync="iSfailed"
:iSrefund.sync="iSrefund"
:orderData.sync="orderData"
:orderGoodsData.sync="order_goods_data"
/>
<el-button class="refundBtn" type="primary" @click="next(0)" v-show="stepActive == 0">提交</el-button>
@ -31,13 +33,19 @@
class="refundBtn"
type="primary"
@click="next(2)"
v-show="stepActive == 2 && iSfailed == false"
v-show="stepActive == 2 && iSfailed == false && ![5,6].includes(order_goods_data.refund_status)"
>撤销申请</el-button>
<!-- <el-button-->
<!-- class="refundBtn"-->
<!-- type="primary"-->
<!-- @click="showWaybill()"-->
<!-- v-if="isWaybill"-->
<!-- v-show="stepActive == 2 && iSfailed == true"-->
<!-- >填写快递运单号</el-button>-->
<el-button
class="refundBtn"
type="primary"
@click="showWaybill()"
v-if="isWaybill"
v-show="stepActive == 2 && iSfailed == true"
>填写快递运单号</el-button>
</div>
@ -50,19 +58,16 @@
>
<template v-slot:contentSlot>
<el-form ref="waybillForm" :model="waybillForm" label-width="80px">
<el-form-item label="快递公司">
<el-select
v-model="waybillForm.region"
placeholder="请选择"
style="width: 100%"
size="small"
>
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
</el-select>
<el-form-item label="物流公司">
<el-input v-model="waybillForm.refund_delivery_name" size="small"></el-input>
</el-form-item>
<el-form-item label="快递单号">
<el-input v-model="waybillForm.name" size="small"></el-input>
<el-form-item label="物流单号">
<el-input v-model="waybillForm.refund_delivery_no" size="small"></el-input>
</el-form-item>
<el-form-item label="物流说明">
<el-input v-model="waybillForm.refund_delivery_remark" size="small"></el-input>
</el-form-item>
</el-form>
</template>
@ -117,9 +122,15 @@ export default {
//
isWaybill: false,
waybillDialog: false,
order_goods_ids:[],
order_goods_data:'',//
refundData: {},//退
//退
waybillForm: {
region: "",
name: ""
refund_delivery_name: "",//
refund_delivery_no: "",//
refund_delivery_remark: "",//
},
orderData: {},
@ -137,18 +148,20 @@ export default {
this.iSrefund = undefined;
this.iSfailed = undefined;
this.stepActive = 0;
this.order_goods_data = this.$route.query.row;//
if (this.$route.query.row.refund_status == 0) {
this.orderData = this.$route.query.row;
} else {
let status = this.$route.query.row.refund_status;
this.getRefundOrder(this.$route.query.row.order_id, status);
console.log(
this.stepActive,
this.iSfailed,
this.iSrefund,
status,
111111
);
// console.log(
// this.stepActive,
// this.iSfailed,
// this.iSrefund,
// status,
// 111111
// );
}
},
mounted() {
@ -166,6 +179,12 @@ export default {
console.log(status, `status`);
console.log(this.orderData, `this.orderData`);
this.order_goods_ids = this.orderData.order_goods.map(item => {
return item.order_goods_id;
});
this.getRefundData()
// refund_status 1退 2 3 4 5 6 -1退 -2退
switch (status) {
case -1:
@ -186,9 +205,18 @@ export default {
this.stepActive = 3;
this.iSrefund = true;
break;
// case 4:
// this.stepActive = 2;
// break;
case 4://4
this.stepActive = 2;
this.iSfailed = true;
break;
case 5://5
this.stepActive = 2;
this.iSfailed = false;
break;
case 6://6
this.stepActive = 2;
this.iSfailed = false;
break;
// default:
// this.stepActive = 0;
@ -251,22 +279,67 @@ export default {
showWaybill() {
this.waybillDialog = true;
},
//
//退
getRefundData() {
// 退
// if (this.orderData.order_goods.length > 1) {
let obj = {
order_goods_id: this.order_goods_ids.toString()
};
this.$axios
.post(`/orderrefund/detail`, obj)
.then(res => {
this.refundData = res.data;
//console.log('qq3',res.data);
})
.catch(err => {
this.$message.error(err);
});
},
//
clickConfirm() {
let obj = {
order_goods_id: "",
refund_delivery_name: "",
refund_delivery_no: ""
// refund_delivery_remark
order_goods_id: this.$route.query.row.order_goods_id,
refund_delivery_name: this.waybillForm.refund_delivery_name,
refund_delivery_no: this.waybillForm.refund_delivery_no,
refund_delivery_remark:this.waybillForm.refund_delivery_remark,
};
//
if (!obj.refund_delivery_name){
this.$message.error("请填写物流公司名称");
return;
}
if (!obj.refund_delivery_no){
this.$message.error("请填写物流单号");
return;
}
//
this.$axios
.post(`/orderrefund/delivery`, obj)
.then(res => {
console.log('qq2',res)
if(res.code == 0){
this.$message.success(res.message);
}else{
this.$message.error(res.message);
}
})
.catch(err => {
this.$message.error(err);
});
this.waybillDialog = false;
// if (this.stepActive++ > 2) this.stepActive = 0;
},
//退
cancelRefund() {
console.log();
let obj = {
order_goods_id: this.$refs.processRefunds.order_goods_ids.toString()
order_goods_id: this.$route.query.row.order_goods_id.toString()
};
this.$axios
.post(`/orderrefund/cancel`, obj)

21
pages/shopping_cart/submit_order.vue

@ -548,9 +548,24 @@ export default {
is_invoice: this.paymentForm.is_invoice ? 1 : 0, //
store_id: JSON.parse(localStorage.getItem("drugstoreObj")).id,
};
this.$axios.post(`/ordercreate/create`, obj).then((res) => {
this.orderNum = res.data;
});
// this.$axios.post(`/ordercreate/create`, obj).then((res) => {
// this.orderNum = res.data;
// });
this.$axios
.post(`/ordercreate/create`, obj)
.then(res => {
if(res.code != 0){
this.$message.error(res.message);
}
this.orderNum = res.data;
})
.catch(err => {
this.$message.error(err);
});
this.paymentDialog = true;
},
//

Loading…
Cancel
Save