连点限制

This commit is contained in:
zhaoxiao
2021-10-12 10:12:26 +08:00
parent e9f9ca6cab
commit 93e7e8a4f0
25 changed files with 237 additions and 141 deletions
@@ -32,10 +32,6 @@
</a-form-item>
</a-form>
</a-spin>
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
<a-button @click="handleOk" type="primary" v-preventclick :loading="confirmLoading">确定</a-button>
</template>
</j-modal>
</template>
@@ -84,9 +80,12 @@ export default {
methods: {
handleOk() {
// 触发表单验证
if (this.confirmLoading) {
return
}
this.confirmLoading = true
this.form.validateFields((err, values) => {
if (!err) {
this.confirmLoading = true
values.contractId = this.contractId
const formData = Object.assign(this.model, values)
console.log('表单提交数据', formData)
@@ -99,8 +98,12 @@ export default {
this.$message.warning(res.message)
}
}).finally(() => {
this.confirmLoading = false
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
} else {
this.confirmLoading = false
}
})
},