Commit 293c3025 authored by zhangdong's avatar zhangdong

按钮时间

parent ddd3b645
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</div> </div>
<div class="centerButton "> <div class="centerButton ">
<el-button @click="noedit">取消</el-button> <el-button @click="noedit">取消</el-button>
<el-button @click="edit">提交</el-button> <el-button @click="edit" :disabled="isDisabled">提交</el-button>
</div> </div>
</div> </div>
</template> </template>
...@@ -51,6 +51,8 @@ export default { ...@@ -51,6 +51,8 @@ export default {
}, },
data() { data() {
return { return {
isDisabled:false,
time:"",
activeIdx: 0, activeIdx: 0,
allForm: {}, allForm: {},
detail: { detail: {
...@@ -70,6 +72,10 @@ export default { ...@@ -70,6 +72,10 @@ export default {
await this.$refs.message.next(); await this.$refs.message.next();
await this.$refs.timeSet.next(); await this.$refs.timeSet.next();
await this.$refs.fileUpload.next(); await this.$refs.fileUpload.next();
this.isDisabled=true
this.time=setTimeout(() => {
this.isDisabled=false
}, 5000);
console.log('通过'); console.log('通过');
console.log(this.detail) console.log(this.detail)
const { msg, code } = await editProject(this.detail); const { msg, code } = await editProject(this.detail);
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</div> </div>
<div class="button"> <div class="button">
<el-button @click="upper">上一步</el-button> <el-button @click="upper">上一步</el-button>
<el-button type="primary" @click="next">发布</el-button> <el-button type="primary" @click="next" :disabled="isDisabled">发布</el-button>
</div> </div>
</div> </div>
</div> </div>
...@@ -58,6 +58,8 @@ export default { ...@@ -58,6 +58,8 @@ export default {
} }
}; };
return { return {
time:"",
isDisabled:false,
ruleForm: { ruleForm: {
bidBookPO: [], bidBookPO: [],
bidBookAccessoryPOList: [] bidBookAccessoryPOList: []
...@@ -83,8 +85,11 @@ export default { ...@@ -83,8 +85,11 @@ export default {
}, },
async next() { async next() {
const valid = await this.$refs['ruleForm'].validate(); const valid = await this.$refs['ruleForm'].validate();
console.log(valid);
if (valid) { if (valid) {
this.isDisabled=true
this.time=setTimeout(() => {
this.isDisabled=false
}, 5000);
Object.assign(this.allForm, this.ruleForm); Object.assign(this.allForm, this.ruleForm);
let allForm = this.allForm; let allForm = this.allForm;
allForm.companyId = localStorage.getItem('companyId'); allForm.companyId = localStorage.getItem('companyId');
...@@ -106,6 +111,7 @@ export default { ...@@ -106,6 +111,7 @@ export default {
upper() { upper() {
this.$parent.upper(); this.$parent.upper();
clearTimeout(this.time)
} }
// changeType(val) { // changeType(val) {
......
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