Commit 6d8a5dcd by YG8999

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

parent d3a317f1
...@@ -489,6 +489,13 @@ ...@@ -489,6 +489,13 @@
:closable="false" :closable="false"
show-icon> show-icon>
</el-alert> </el-alert>
<el-alert
title="2: 请您仔细填写并核对退款数据,一旦退款成功,数据不可修改!"
type="error"
:closable="false"
show-icon>
</el-alert>
<el-divider></el-divider> <el-divider></el-divider>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
...@@ -529,7 +536,7 @@ ...@@ -529,7 +536,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="退款金额" prop="amount"> <el-form-item label="退款金额" prop="amount">
<el-input v-model="refundForm.amount" type="number"/> <el-input v-model="refundForm.amount" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -588,6 +595,13 @@ export default { ...@@ -588,6 +595,13 @@ export default {
name: "Order", 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'], 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() { data() {
const equalToPayAmount = (rule, value, callback) => {
if (this.refundForm.payAmount < value) {
callback(new Error("退款金额不能大于实际支付金额"));
} else {
callback();
}
};
return { return {
repealOpen:false, repealOpen:false,
repealForm:{ repealForm:{
...@@ -682,7 +696,15 @@ export default { ...@@ -682,7 +696,15 @@ export default {
// 表单校验 // 表单校验
refundRules: { refundRules: {
amount: [ 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 { ...@@ -823,8 +845,8 @@ export default {
couponAmount: null, couponAmount: null,
payAmount: null, payAmount: null,
amount: null, amount: null,
refundCoupon: '0', refundCoupon: null,
isClean: '0', isClean: null,
refundReason: null, refundReason: null,
orderStatus: null orderStatus: null
} }
...@@ -919,8 +941,8 @@ export default { ...@@ -919,8 +941,8 @@ export default {
} }
this.refundForm.payAmount = row.payPrice; this.refundForm.payAmount = row.payPrice;
this.refundForm.amount = row.payPrice ? row.payPrice : 0; this.refundForm.amount = row.payPrice ? row.payPrice : 0;
this.refundForm.refundCoupon = '0'; // this.refundForm.refundCoupon = '0';
this.refundForm.isClean = '0'; // this.refundForm.isClean = '0';
}, },
// 字典翻译 // 字典翻译
orderStatusFormat(value) { orderStatusFormat(value) {
...@@ -928,13 +950,21 @@ export default { ...@@ -928,13 +950,21 @@ export default {
}, },
/** 退款提交按钮操作 */ /** 退款提交按钮操作 */
submitRefundForm() { submitRefundForm() {
let that = this;
this.$refs["refundForm"].validate(valid => { this.$refs["refundForm"].validate(valid => {
if (valid) { if (valid) {
refund(this.refundForm).then(response => { this.$modal.confirm('请您仔细核对退款数据,一旦退款成功,数据不可修改!').then(function() {
this.$modal.msgSuccess("退款成功"); return refund(that.refundForm);
this.refundOpen = false; }).then(() => {
this.getList(); 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