Browse Source

pc页面防止重复提交

feature/yujt_analysis_pc
zhangyuan 5 years ago
parent
commit
3076360f3c
  1. 9
      src/views/modules/activity/group-add-or-update.vue

9
src/views/modules/activity/group-add-or-update.vue

@ -48,7 +48,7 @@
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
<el-button :disabled="disabled" type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
@ -89,6 +89,7 @@ export default {
categoryOptions: [],
options: [],
loading: false,
disabled:false,
uploadUrl: ''
}
},
@ -238,11 +239,13 @@ export default {
},
//
dataFormSubmitHandle: debounce(function () {
this.disabled = true
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/property/group/interest', this.dataForm).then(({ data: res }) => {
this.disabled = false
if (res.code !== 0) {
return this.$message.error(res.msg)
}
@ -255,7 +258,9 @@ export default {
this.$emit('refreshDataList')
}
})
}).catch(() => {})
}).catch(() => {
this.loading = false
})
})
}, 1000, { 'leading': true, 'trailing': false })
}

Loading…
Cancel
Save