标段工程管理-修复新增按钮多次提交

This commit is contained in:
binbin_pan 2024-04-10 17:30:49 +08:00
parent dbae114b07
commit 5d53605f80
1 changed files with 9 additions and 1 deletions

View File

@ -198,7 +198,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" :loading="isLoading" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
@ -217,6 +217,7 @@ export default {
components: { Treeselect }, components: { Treeselect },
data() { data() {
return { return {
isLoading: false,
// //
loading: true, loading: true,
// //
@ -382,17 +383,24 @@ export default {
submitForm: function () { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
this.isLoading = true;
if (this.form.lotId != undefined) { if (this.form.lotId != undefined) {
updateProjectLot(this.form).then(response => { updateProjectLot(this.form).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.isLoading = false;
this.getList(); this.getList();
}).catch(() => {
this.isLoading = false;
}); });
} else { } else {
addProjectLot(this.form).then(response => { addProjectLot(this.form).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.isLoading = false;
this.getList(); this.getList();
}).catch(() => {
this.isLoading = false;
}); });
} }
} }