新增
编辑
@@ -307,32 +307,37 @@ export default {
},
// 确定新增或者编辑
async addoredit() {
- if(this.form.displayName==undefined){
- this.$message.warning('请输入名称')
- }else {
- if (this.title == 1) {
- let res = await addinvoice({ displayName: this.form.displayName });
- if (res.code == 1) {
- this.$message.success("新增成功");
- this.getlist();
- this.dialogVisible = false;
+ if (this.form.displayName == undefined) {
+ this.$message.warning("请输入名称");
+ } else {
+ if (this.title == 1) {
+ let res = await addinvoice({ displayName: this.form.displayName });
+ if (res.code == 1) {
+ this.$message.success("新增成功");
+ this.getlist();
+ this.dialogVisible = false;
+ }
+ } else if (this.title == 2) {
+ console.log(this.form.displayName);
+ if (this.form.displayName == "") {
+ this.$message.warning("请输入名称");
+ } else {
+ modifyinvoiceedit(this.form.id, {
+ displayName: this.form.displayName,
+ }).then((res) => {
+ this.$message.success("修改成功");
+ this.getlist();
+ this.dialogVisible = false;
+ });
+ }
}
- } else if (this.title == 2) {
- modifyinvoiceedit(this.form.id, {
- displayName: this.form.displayName,
- }).then((res) => {
- this.$message.success("修改成功");
- this.getlist();
- this.dialogVisible = false;
- });
}
- }
},
//新增弹框
addll() {
this.dialogVisible = true;
this.title = 1;
- this.form={}
+ this.form = {};
},
// 点击每一列根据id获取并调用接口
rowick(row) {