Commit ddfcc34e by wuwx

修复网络慢,多次点击创建优惠券按钮生成多个优惠券

1 parent 6077a389
......@@ -190,6 +190,7 @@ export default {
title: '创建',
editChildRef: 'editChildRef',
loading: false,
clickStatus: false,
routeInfo: {
// 1-新增;2-编辑;3-查看
addOrEdit: 1,
......@@ -807,6 +808,8 @@ export default {
method = 'createCouponApi' //后台创建优惠券
}
console.log(params)
if (this.clickStatus) return
this.clickStatus = true
this.$apis.couponManage[method](params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
......
......@@ -168,6 +168,7 @@ export default {
format: 'yyyy-MM-dd HH:mm:ss', // 日期显示格式
showSubmit: true,
userDisable: false,
clickStatus: false,
size: 'small',
title: '创建',
titleObj: {
......@@ -566,6 +567,8 @@ export default {
} else {
method = 'createCouponApi' //后台创建优惠券
}
if (this.clickStatus) return
this.clickStatus = true
this.$apis.couponManage[method](params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
......
......@@ -127,6 +127,7 @@ export default {
editChildRef: 'editChildRef',
loading: false,
editStatus: false,
clickStatus: false,
// pickerOptions: {
// disabledDate(v) {//禁用当前之前的日期
// return v.getTime() < new Date().getTime() - 86400000;
......@@ -457,6 +458,8 @@ export default {
} else {
method = 'createCouponApi' //后台创建优惠券
}
if (this.clickStatus) return
this.clickStatus = true
this.$apis.couponManage[method](params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
......
......@@ -209,6 +209,7 @@ export default {
}, 1000)
}
return {
clickStatus: false,
isEdit: false,
showSubmit: true,
disabledDescription: false,
......@@ -402,6 +403,8 @@ export default {
},
submitForm(formName) {
if (this.clickStatus) return
this.clickStatus = true
this.$refs[formName].validate((valid, errorObj) => {
var merchantval = true
var merchantErrorObj = []
......
......@@ -115,7 +115,7 @@ export default {
}
</script>
<style lang="scss" scope>
<style lang="scss" scoped>
.img-bg {
position: relative;
width: 290px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!