|
|
@@ -62,17 +62,17 @@
|
|
|
@click="refund(item.orderSn, items)"
|
|
|
v-if="
|
|
|
items.periodStatus !== 0 &&
|
|
|
- items.periodStatus !== 1 &&
|
|
|
- items.periodStatus !== 2 &&
|
|
|
- items.refundStatus === 0 &&
|
|
|
- (item.orderFrom === 2 || item.orderFrom === 3) &&
|
|
|
- (item.orderStatus === 1 ||
|
|
|
- item.orderStatus === 2 ||
|
|
|
- item.orderStatus === 3) &&
|
|
|
- (items.goodsType == '1' ||
|
|
|
- items.goodsType == '2' ||
|
|
|
- items.goodsType == '6') &&
|
|
|
- items.goodsPrice > 0
|
|
|
+ items.periodStatus !== 1 &&
|
|
|
+ items.periodStatus !== 2 &&
|
|
|
+ items.refundStatus === 0 &&
|
|
|
+ (item.orderFrom === 2 || item.orderFrom === 3) &&
|
|
|
+ (item.orderStatus === 1 ||
|
|
|
+ item.orderStatus === 2 ||
|
|
|
+ item.orderStatus === 3) &&
|
|
|
+ (items.goodsType == '1' ||
|
|
|
+ items.goodsType == '2' ||
|
|
|
+ items.goodsType == '6') &&
|
|
|
+ items.goodsPrice > 0
|
|
|
"
|
|
|
>
|
|
|
申请退款
|
|
|
@@ -98,8 +98,8 @@
|
|
|
v-if="
|
|
|
(item.orderStatus === 0 &&
|
|
|
(item.orderFrom === 2 || item.orderFrom === 3)) ||
|
|
|
- ((item.orderStatus === -1 || item.orderStatus === -2) &&
|
|
|
- (item.orderFrom === 2 || item.orderFrom === 3))
|
|
|
+ ((item.orderStatus === -1 || item.orderStatus === -2) &&
|
|
|
+ (item.orderFrom === 2 || item.orderFrom === 3))
|
|
|
"
|
|
|
>
|
|
|
<div class="btns">
|
|
|
@@ -108,7 +108,7 @@
|
|
|
class="btn"
|
|
|
v-if="
|
|
|
item.orderStatus === 0 &&
|
|
|
- (item.orderFrom === 2 || item.orderFrom === 3)
|
|
|
+ (item.orderFrom === 2 || item.orderFrom === 3)
|
|
|
"
|
|
|
@click="pay(item)"
|
|
|
>
|
|
|
@@ -118,7 +118,7 @@
|
|
|
class="btn btn--nobg"
|
|
|
v-if="
|
|
|
item.orderStatus === 0 &&
|
|
|
- (item.orderFrom === 2 || item.orderFrom === 3)
|
|
|
+ (item.orderFrom === 2 || item.orderFrom === 3)
|
|
|
"
|
|
|
@click="cancelOrder(item)"
|
|
|
>
|
|
|
@@ -128,7 +128,7 @@
|
|
|
class="btn btn--nobg"
|
|
|
v-if="
|
|
|
(item.orderStatus === -1 || item.orderStatus === -2) &&
|
|
|
- (item.orderFrom === 2 || item.orderFrom === 3)
|
|
|
+ (item.orderFrom === 2 || item.orderFrom === 3)
|
|
|
"
|
|
|
@click="delOrder(item)"
|
|
|
>
|
|
|
@@ -158,13 +158,18 @@
|
|
|
</div>
|
|
|
<div class="refund-wrap">
|
|
|
<div class="btns">
|
|
|
- <template v-if="!item.wxpayRefundId"> 退款失败 </template>
|
|
|
- <template v-else>
|
|
|
+ <template v-if="item.periodStatus == 3">
|
|
|
<div class="price-text">已退款</div>
|
|
|
<div class="price-number">
|
|
|
¥{{ item.refundFee | formatPrice }}
|
|
|
</div>
|
|
|
</template>
|
|
|
+ <template v-else-if="item.periodStatus >= 0">
|
|
|
+ 待审核
|
|
|
+ </template>
|
|
|
+ <template v-else-if="item.periodStatus < 0">
|
|
|
+ 审核不通过
|
|
|
+ </template>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -211,7 +216,7 @@
|
|
|
>
|
|
|
<el-form-item label="" prop="refundOptionsIndex">
|
|
|
<el-select
|
|
|
- style="width:360px"
|
|
|
+ style="width: 360px"
|
|
|
v-model="ruleForm.refundOptionsIndex"
|
|
|
placeholder="请选择退款原因"
|
|
|
>
|
|
|
@@ -230,7 +235,7 @@
|
|
|
><el-input
|
|
|
type="textarea"
|
|
|
:rows="3"
|
|
|
- style="width:360px"
|
|
|
+ style="width: 360px"
|
|
|
v-model.trim="ruleForm.refundReason"
|
|
|
placeholder="请输入退款原因"
|
|
|
></el-input></el-form-item
|
|
|
@@ -257,20 +262,20 @@ export default {
|
|
|
{ label: "报错专业/课程", value: 2 },
|
|
|
{ label: "班级未开班", value: 3 },
|
|
|
{ label: "培训/继教周期未到", value: 4 },
|
|
|
- { label: "其他", value: 5 }
|
|
|
+ { label: "其他", value: 5 },
|
|
|
],
|
|
|
- activeItem:{},
|
|
|
+ activeItem: {},
|
|
|
ruleForm: {
|
|
|
refundOptionsIndex: "",
|
|
|
- refundReason: ""
|
|
|
+ refundReason: "",
|
|
|
},
|
|
|
rules: {
|
|
|
refundOptionsIndex: [
|
|
|
- { required: true, message: "选择退款原因", trigger: "change" }
|
|
|
+ { required: true, message: "选择退款原因", trigger: "change" },
|
|
|
],
|
|
|
refundReason: [
|
|
|
- { required: true, message: "输入退款原因", trigger: "blur" }
|
|
|
- ]
|
|
|
+ { required: true, message: "输入退款原因", trigger: "blur" },
|
|
|
+ ],
|
|
|
},
|
|
|
visible: false,
|
|
|
orderList: [],
|
|
|
@@ -278,7 +283,7 @@ export default {
|
|
|
formData: {
|
|
|
status: "0,1",
|
|
|
pageNum: 1,
|
|
|
- pageSize: 10
|
|
|
+ pageSize: 10,
|
|
|
},
|
|
|
total: 0,
|
|
|
loading: null,
|
|
|
@@ -286,29 +291,29 @@ export default {
|
|
|
{
|
|
|
label: "待支付",
|
|
|
count: 0,
|
|
|
- name: "1"
|
|
|
+ name: "1",
|
|
|
},
|
|
|
{
|
|
|
label: "已支付",
|
|
|
count: 0,
|
|
|
- name: "2"
|
|
|
+ name: "2",
|
|
|
},
|
|
|
{
|
|
|
label: "已取消",
|
|
|
count: 0,
|
|
|
- name: "3"
|
|
|
+ name: "3",
|
|
|
},
|
|
|
{
|
|
|
label: "已退款",
|
|
|
count: 0,
|
|
|
- name: "4"
|
|
|
- }
|
|
|
- ]
|
|
|
+ name: "4",
|
|
|
+ },
|
|
|
+ ],
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- periodStatusName: function() {
|
|
|
- return function(val) {
|
|
|
+ periodStatusName: function () {
|
|
|
+ return function (val) {
|
|
|
// ("审批状态 0 待审核 1初审通过 2复审通过待退款 -1初审不通过 -2复审不通过 3已退款")
|
|
|
var status = "";
|
|
|
switch (val) {
|
|
|
@@ -335,7 +340,7 @@ export default {
|
|
|
}
|
|
|
return status;
|
|
|
};
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
if (this.$route.query.state) {
|
|
|
@@ -347,7 +352,7 @@ export default {
|
|
|
methods: {
|
|
|
go(path) {
|
|
|
this.$router.push({
|
|
|
- path: path
|
|
|
+ path: path,
|
|
|
});
|
|
|
},
|
|
|
getOrderNum() {
|
|
|
@@ -356,9 +361,9 @@ export default {
|
|
|
status: "0,1",
|
|
|
pageNum: 1,
|
|
|
pageSize: 1,
|
|
|
- orderStatus: "0"
|
|
|
+ orderStatus: "0",
|
|
|
})
|
|
|
- .then(res => {
|
|
|
+ .then((res) => {
|
|
|
this.list[0].count = res.total;
|
|
|
});
|
|
|
|
|
|
@@ -367,9 +372,9 @@ export default {
|
|
|
status: "0,1",
|
|
|
pageNum: 1,
|
|
|
pageSize: 1,
|
|
|
- orderStatus: "1,2,3,4"
|
|
|
+ orderStatus: "1,2,3,4",
|
|
|
})
|
|
|
- .then(res => {
|
|
|
+ .then((res) => {
|
|
|
this.list[1].count = res.total;
|
|
|
});
|
|
|
|
|
|
@@ -378,19 +383,19 @@ export default {
|
|
|
status: "0,1",
|
|
|
pageNum: 1,
|
|
|
pageSize: 1,
|
|
|
- orderStatus: "-1,-2"
|
|
|
+ orderStatus: "-1,-2",
|
|
|
})
|
|
|
- .then(res => {
|
|
|
+ .then((res) => {
|
|
|
this.list[2].count = res.total;
|
|
|
});
|
|
|
|
|
|
this.$request
|
|
|
.orderRefundList({
|
|
|
- periodStatus:3,
|
|
|
+ periodStatus: 3,
|
|
|
pageNum: 1,
|
|
|
- pageSize: 1
|
|
|
+ pageSize: 1,
|
|
|
})
|
|
|
- .then(res => {
|
|
|
+ .then((res) => {
|
|
|
this.list[3].count = res.total;
|
|
|
})
|
|
|
.catch(this.hideLoading);
|
|
|
@@ -435,12 +440,12 @@ export default {
|
|
|
name: "支付",
|
|
|
params: {
|
|
|
total: item.payPrice,
|
|
|
- orderSn: item.orderSn
|
|
|
- }
|
|
|
+ orderSn: item.orderSn,
|
|
|
+ },
|
|
|
});
|
|
|
},
|
|
|
submitRefund(formName) {
|
|
|
- this.$refs[formName].validate(valid => {
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.showLoading();
|
|
|
this.$request
|
|
|
@@ -451,23 +456,24 @@ export default {
|
|
|
applyReason:
|
|
|
this.ruleForm.refundOptionsIndex == 5
|
|
|
? this.ruleForm.refundReason
|
|
|
- : this.refundOptions[this.ruleForm.refundOptionsIndex - 1].label
|
|
|
+ : this.refundOptions[this.ruleForm.refundOptionsIndex - 1]
|
|
|
+ .label,
|
|
|
})
|
|
|
- .then(res => {
|
|
|
- this.visible = false
|
|
|
+ .then((res) => {
|
|
|
+ this.visible = false;
|
|
|
this.hideLoading();
|
|
|
this.$message({
|
|
|
type: "success",
|
|
|
- message: "申请退款成功"
|
|
|
+ message: "申请退款成功",
|
|
|
});
|
|
|
this.getOrderNum();
|
|
|
this.getOrderList();
|
|
|
})
|
|
|
- .catch(err => {
|
|
|
+ .catch((err) => {
|
|
|
this.hideLoading();
|
|
|
this.$message({
|
|
|
type: "warning",
|
|
|
- message: err.msg
|
|
|
+ message: err.msg,
|
|
|
});
|
|
|
});
|
|
|
} else {
|
|
|
@@ -480,7 +486,7 @@ export default {
|
|
|
this.activeItem = item;
|
|
|
this.ruleForm = {
|
|
|
refundOptionsIndex: "",
|
|
|
- refundReason: ""
|
|
|
+ refundReason: "",
|
|
|
};
|
|
|
this.visible = true;
|
|
|
this.$nextTick(() => {
|
|
|
@@ -491,7 +497,7 @@ export default {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
inputPattern: /^.{1,10000}$/,
|
|
|
- inputErrorMessage: "请输入退款原因"
|
|
|
+ inputErrorMessage: "请输入退款原因",
|
|
|
})
|
|
|
.then(({ value }) => {
|
|
|
this.showLoading();
|
|
|
@@ -500,22 +506,22 @@ export default {
|
|
|
orderSn: orderSn,
|
|
|
goodsId: item.goodsId,
|
|
|
orderGoodsId: item.orderGoodsId,
|
|
|
- applyReason: value
|
|
|
+ applyReason: value,
|
|
|
})
|
|
|
- .then(res => {
|
|
|
+ .then((res) => {
|
|
|
this.hideLoading();
|
|
|
this.$message({
|
|
|
type: "success",
|
|
|
- message: "申请退款成功"
|
|
|
+ message: "申请退款成功",
|
|
|
});
|
|
|
this.getOrderNum();
|
|
|
this.getOrderList();
|
|
|
})
|
|
|
- .catch(err => {
|
|
|
+ .catch((err) => {
|
|
|
this.hideLoading();
|
|
|
this.$message({
|
|
|
type: "warning",
|
|
|
- message: err.msg
|
|
|
+ message: err.msg,
|
|
|
});
|
|
|
});
|
|
|
})
|
|
|
@@ -529,30 +535,30 @@ export default {
|
|
|
closeOnClickModal: false,
|
|
|
closeOnPressEscape: false,
|
|
|
distinguishCancelAndClose: false,
|
|
|
- showClose: false
|
|
|
+ showClose: false,
|
|
|
})
|
|
|
- .then(_ => {
|
|
|
+ .then((_) => {
|
|
|
this.showLoading();
|
|
|
this.$request
|
|
|
.eddOrder({ orderId: item.orderId, status: -1 })
|
|
|
- .then(res => {
|
|
|
+ .then((res) => {
|
|
|
this.$message({
|
|
|
type: "success",
|
|
|
- message: "订单删除成功"
|
|
|
+ message: "订单删除成功",
|
|
|
});
|
|
|
this.hideLoading();
|
|
|
this.getOrderNum();
|
|
|
this.getOrderList();
|
|
|
})
|
|
|
- .catch(err => {
|
|
|
+ .catch((err) => {
|
|
|
this.hideLoading();
|
|
|
this.$message({
|
|
|
type: "warning",
|
|
|
- message: err.msg
|
|
|
+ message: err.msg,
|
|
|
});
|
|
|
});
|
|
|
})
|
|
|
- .catch(err => {
|
|
|
+ .catch((err) => {
|
|
|
this.hideLoading();
|
|
|
});
|
|
|
},
|
|
|
@@ -560,18 +566,18 @@ export default {
|
|
|
orderRefundList() {
|
|
|
this.showLoading();
|
|
|
this.formData.orderStatus = "";
|
|
|
- let data = JSON.parse(JSON.stringify(this.formData))
|
|
|
- data.periodStatus = 3
|
|
|
+ let data = JSON.parse(JSON.stringify(this.formData));
|
|
|
+ data.periodStatus = 3;
|
|
|
this.$request
|
|
|
.orderRefundList(data)
|
|
|
- .then(res => {
|
|
|
+ .then((res) => {
|
|
|
this.hideLoading();
|
|
|
this.orderList = res.rows;
|
|
|
this.total = res.total;
|
|
|
})
|
|
|
.catch(this.hideLoading);
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 取消订单
|
|
|
*/
|
|
|
@@ -582,30 +588,30 @@ export default {
|
|
|
closeOnClickModal: false,
|
|
|
closeOnPressEscape: false,
|
|
|
distinguishCancelAndClose: false,
|
|
|
- showClose: false
|
|
|
+ showClose: false,
|
|
|
})
|
|
|
- .then(_ => {
|
|
|
+ .then((_) => {
|
|
|
this.showLoading();
|
|
|
this.$request
|
|
|
.eddOrder({ orderId: item.orderId, orderStatus: -1 })
|
|
|
- .then(res => {
|
|
|
+ .then((res) => {
|
|
|
this.hideLoading();
|
|
|
this.getOrderNum();
|
|
|
this.$message({
|
|
|
type: "success",
|
|
|
- message: "订单取消成功"
|
|
|
+ message: "订单取消成功",
|
|
|
});
|
|
|
this.getOrderList();
|
|
|
})
|
|
|
- .catch(err => {
|
|
|
+ .catch((err) => {
|
|
|
this.hideLoading();
|
|
|
this.$message({
|
|
|
type: "warning",
|
|
|
- message: err.msg
|
|
|
+ message: err.msg,
|
|
|
});
|
|
|
});
|
|
|
})
|
|
|
- .catch(_ => {});
|
|
|
+ .catch((_) => {});
|
|
|
},
|
|
|
|
|
|
showLoading(obj) {
|
|
|
@@ -614,7 +620,7 @@ export default {
|
|
|
text: (obj && obj.text) || "loading",
|
|
|
spinner: "el-icon-loading",
|
|
|
background: "rgba(0, 0, 0, 0)",
|
|
|
- target: document.querySelector(".my-order__body")
|
|
|
+ target: document.querySelector(".my-order__body"),
|
|
|
});
|
|
|
},
|
|
|
|
|
|
@@ -636,14 +642,14 @@ export default {
|
|
|
}
|
|
|
this.$request
|
|
|
.getorderlists(this.formData)
|
|
|
- .then(res => {
|
|
|
+ .then((res) => {
|
|
|
this.orderList = res.rows;
|
|
|
this.total = res.total;
|
|
|
this.hideLoading();
|
|
|
})
|
|
|
.catch(this.hideLoading);
|
|
|
- }
|
|
|
- }
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|