|
|
@@ -388,10 +388,10 @@
|
|
|
:columns="columns"
|
|
|
:datasource="tableList"
|
|
|
:selection.sync="selection"
|
|
|
+ :page-size="20"
|
|
|
v-if="isAll"
|
|
|
- row-key="id"
|
|
|
+ row-key="code"
|
|
|
height="20vh"
|
|
|
- :needPage="true"
|
|
|
>
|
|
|
<template v-slot:toolbar>
|
|
|
<el-button type="primary" size="small" @click="add">添加</el-button>
|
|
|
@@ -620,6 +620,8 @@
|
|
|
this.handleNodeClick(data);
|
|
|
});
|
|
|
});
|
|
|
+
|
|
|
+ console.log(this.selection, this.tableList);
|
|
|
},
|
|
|
async confirm() {
|
|
|
this.$emit(
|
|
|
@@ -634,6 +636,10 @@
|
|
|
this.$message.error('请至少选择一条数据!');
|
|
|
return;
|
|
|
}
|
|
|
+ console.log(this.tableList);
|
|
|
+
|
|
|
+ console.log(this.selectionList);
|
|
|
+
|
|
|
this.selectionList = this.selectionList.filter((item) => {
|
|
|
if (item.warehouseList?.length > 0) {
|
|
|
item['warehouseId'] = item.warehouseList[0].warehouse_id;
|
|
|
@@ -646,12 +652,17 @@
|
|
|
this.tableList.push(...this.selectionList);
|
|
|
},
|
|
|
del() {
|
|
|
- let ids = this.selection.map((item) => item.id);
|
|
|
+ // let ids = this.selection.map((item) => item.id);
|
|
|
+ // this.tableList = this.tableList.filter(
|
|
|
+ // (item) => !ids.includes(item.id)
|
|
|
+ // );
|
|
|
+ let codes = this.selection.map((item) => item.code);
|
|
|
this.tableList = this.tableList.filter(
|
|
|
- (item) => !ids.includes(item.id)
|
|
|
+ (item) => !codes.includes(item.code)
|
|
|
);
|
|
|
},
|
|
|
cancel() {
|
|
|
+ this.selection = [];
|
|
|
this.selectionList = [];
|
|
|
this.$refs.multipleTable.clearSelection();
|
|
|
this.visible1 = false;
|