往来单位管理-修复新增按钮多次提交
This commit is contained in:
parent
b9dd07af15
commit
f29da14bac
|
|
@ -201,7 +201,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" @click="submitForm" :loading="isLoading">确 定</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
@ -220,6 +220,7 @@ export default {
|
||||||
components: { Treeselect },
|
components: { Treeselect },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
isLoading: false,
|
||||||
//单位类型
|
//单位类型
|
||||||
typeList: [],
|
typeList: [],
|
||||||
chonsenData: {},
|
chonsenData: {},
|
||||||
|
|
@ -377,17 +378,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.unitId != undefined) {
|
if (this.form.unitId != undefined) {
|
||||||
updateUnit(this.form).then(response => {
|
updateUnit(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 {
|
||||||
addUnit(this.form).then(response => {
|
addUnit(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;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue