Commit 6d8a5dcd by YG8999

修改退款操作:优化信息提示及弹框提示

parent d3a317f1
......@@ -489,6 +489,13 @@
:closable="false"
show-icon>
</el-alert>
<el-alert
title="2: 请您仔细填写并核对退款数据,一旦退款成功,数据不可修改!"
type="error"
:closable="false"
show-icon>
</el-alert>
<el-divider></el-divider>
<el-row :gutter="20">
<el-col :span="12">
......@@ -529,7 +536,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="退款金额" prop="amount">
<el-input v-model="refundForm.amount" type="number"/>
<el-input v-model="refundForm.amount" />
</el-form-item>
</el-col>
</el-row>
......@@ -588,6 +595,13 @@ export default {
name: "Order",
dicts: ['sys_normal_disable','store_order_type', 'store_coupon_type', 'store_is_use_coupon', 'store_order_status','store_pay_ways','order_pay_status','order_status_admin'],
data() {
const equalToPayAmount = (rule, value, callback) => {
if (this.refundForm.payAmount < value) {
callback(new Error("退款金额不能大于实际支付金额"));
} else {
callback();
}
};
return {
repealOpen:false,
repealForm:{
......@@ -682,7 +696,15 @@ export default {
// 表单校验
refundRules: {
amount: [
{required: true, message: "退款金额不能为空", trigger: "blur"}
{required: true, message: "退款金额不能为空", trigger: "blur"},
{required: true, validator: equalToPayAmount, trigger: "blur" },
{pattern: /^[0-9]+(\.[0-9]{0,2})?$/, message: "退款金额必须填写大于等于0的整数或两位以内的小数"},
],
refundCoupon: [
{required: true, message: "请选择是否退优惠券", trigger: "change"}
],
isClean: [
{required: true, message: "请选择是否生成保洁任务", trigger: "change"}
]
},
};
......@@ -823,8 +845,8 @@ export default {
couponAmount: null,
payAmount: null,
amount: null,
refundCoupon: '0',
isClean: '0',
refundCoupon: null,
isClean: null,
refundReason: null,
orderStatus: null
}
......@@ -919,8 +941,8 @@ export default {
}
this.refundForm.payAmount = row.payPrice;
this.refundForm.amount = row.payPrice ? row.payPrice : 0;
this.refundForm.refundCoupon = '0';
this.refundForm.isClean = '0';
// this.refundForm.refundCoupon = '0';
// this.refundForm.isClean = '0';
},
// 字典翻译
orderStatusFormat(value) {
......@@ -928,13 +950,21 @@ export default {
},
/** 退款提交按钮操作 */
submitRefundForm() {
let that = this;
this.$refs["refundForm"].validate(valid => {
if (valid) {
refund(this.refundForm).then(response => {
this.$modal.msgSuccess("退款成功");
this.refundOpen = false;
this.getList();
});
this.$modal.confirm('请您仔细核对退款数据,一旦退款成功,数据不可修改!').then(function() {
return refund(that.refundForm);
}).then(() => {
that.refundOpen = false;
that.getList();
that.$modal.msgSuccess("退款成功");
}).catch(() => {});
// refund(this.refundForm).then(response => {
// this.$modal.msgSuccess("退款成功");
// this.refundOpen = false;
// this.getList();
// });
}
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment