|
|
|
@ -152,7 +152,7 @@ |
|
|
|
</el-card> |
|
|
|
</div> |
|
|
|
<!-- 按钮区域 --> |
|
|
|
<div style="margin-left: 10px; margin-top: 10%"> |
|
|
|
<div style="margin-left: 10px; margin-top: 7%"> |
|
|
|
<el-button type="primary" @click="add">新增</el-button> |
|
|
|
<div style="margin-top: 10px"> |
|
|
|
<el-button type="primary" @click="editpopup">编辑</el-button> |
|
|
|
@ -356,28 +356,25 @@ export default { |
|
|
|
}, |
|
|
|
//确定新增或者编辑 |
|
|
|
addoredit() { |
|
|
|
if(this.form.displayName==undefined){ |
|
|
|
this.$message.warning('请输入名称') |
|
|
|
}else{ |
|
|
|
|
|
|
|
|
|
|
|
if (this.title == 1) { |
|
|
|
addunit({ displayName: this.form.displayName }).then((res) => { |
|
|
|
this.$message.success("新增成功"); |
|
|
|
this.getlist(); |
|
|
|
this.dialogVisible = false; |
|
|
|
}); |
|
|
|
} else if (this.title == 2) { |
|
|
|
editunit(this.form.id, { displayName: this.form.displayName }).then( |
|
|
|
(res) => { |
|
|
|
this.$message.success("修改成功"); |
|
|
|
if (this.form.displayName == undefined) { |
|
|
|
this.$message.warning("请输入名称"); |
|
|
|
} else { |
|
|
|
if (this.title == 1) { |
|
|
|
addunit({ displayName: this.form.displayName }).then((res) => { |
|
|
|
this.$message.success("新增成功"); |
|
|
|
this.getlist(); |
|
|
|
this.dialogVisible = false; |
|
|
|
} |
|
|
|
); |
|
|
|
} |
|
|
|
}); |
|
|
|
} else if (this.title == 2) { |
|
|
|
editunit(this.form.id, { displayName: this.form.displayName }).then( |
|
|
|
(res) => { |
|
|
|
this.$message.success("修改成功"); |
|
|
|
this.getlist(); |
|
|
|
this.dialogVisible = false; |
|
|
|
} |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
//新增弹框 |
|
|
|
add() { |
|
|
|
|