|
|
@@ -325,7 +325,8 @@
|
|
|
// 提交状态
|
|
|
loading: false,
|
|
|
// 是否是修改
|
|
|
- isUpdate: false
|
|
|
+ isUpdate: false,
|
|
|
+ delectId: 1
|
|
|
};
|
|
|
},
|
|
|
created() {},
|
|
|
@@ -336,8 +337,10 @@
|
|
|
code: '',
|
|
|
enable: 1,
|
|
|
name: '',
|
|
|
- sort: ''
|
|
|
+ sort: '',
|
|
|
+ delectId: this.delectId
|
|
|
});
|
|
|
+ this.delectId = this.delectId + 1;
|
|
|
this.filterArr();
|
|
|
},
|
|
|
//
|
|
|
@@ -346,14 +349,30 @@
|
|
|
},
|
|
|
removeArr(row) {
|
|
|
console.log(row);
|
|
|
- let falg = this.form.dictStaticSubmitPOList[row.$index].deleted === 0;
|
|
|
- if (falg) {
|
|
|
- this.form.dictStaticSubmitPOList[row.$index].deleted = 1;
|
|
|
+ if (row.row.id) {
|
|
|
+ this.form.dictStaticSubmitPOList.forEach((item) => {
|
|
|
+ if (item.id === row.row.id) {
|
|
|
+ item.deleted = 1;
|
|
|
+ }
|
|
|
+ });
|
|
|
this.filterArr();
|
|
|
} else {
|
|
|
- this.form.dictStaticSubmitPOList.splice(row.$index, 1);
|
|
|
+ let index = this.form.dictStaticSubmitPOList.findIndex(
|
|
|
+ (item) => item.delectId === row.row.delectId
|
|
|
+ );
|
|
|
+ console.log(index);
|
|
|
+ this.form.dictStaticSubmitPOList.splice(index, 1); // 在数组的指定位置移除对应的元素。 返回移除的
|
|
|
this.filterArr();
|
|
|
}
|
|
|
+
|
|
|
+ // let falg = this.form.dictStaticSubmitPOList[row.$index].deleted === 0;
|
|
|
+ // if (falg) {
|
|
|
+ // this.form.dictStaticSubmitPOList[row.$index].deleted = 1;
|
|
|
+ // this.filterArr();
|
|
|
+ // } else {
|
|
|
+ // this.form.dictStaticSubmitPOList.splice(row.$index, 1);
|
|
|
+ // this.filterArr();
|
|
|
+ // }
|
|
|
},
|
|
|
handleSelectionChange() {},
|
|
|
/* 保存编辑 */
|