diff --git a/sgzb-ui/src/views/base/unit/index.vue b/sgzb-ui/src/views/base/unit/index.vue index 2b75ee05..954db2c9 100644 --- a/sgzb-ui/src/views/base/unit/index.vue +++ b/sgzb-ui/src/views/base/unit/index.vue @@ -24,6 +24,7 @@ plain icon="el-icon-plus" size="mini" + :loading="isLoading" @click="handleAdd" >新建 @@ -105,6 +106,7 @@ export default { dicts: ['sys_normal_disable'], data() { return { + isLoading: false, // 遮罩层 loading: true, // 选中数组 @@ -211,17 +213,24 @@ export default { submitForm: function() { this.$refs["form"].validate(valid => { if (valid) { + this.isLoading = true; if (this.form.id != undefined) { updateUnitType(this.form).then(response => { this.$modal.msgSuccess("修改成功"); this.open = false; + this.isLoading = false; this.getList(); + }).catch(() => { + this.isLoading = false; }); } else { addUnitType(this.form).then(response => { this.$modal.msgSuccess("新增成功"); this.open = false; + this.isLoading = false; this.getList(); + }).catch(() => { + this.isLoading = false; }); } }