|
@@ -24,7 +24,7 @@
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="4" style="margin-top: 3px;">
|
|
|
|
|
|
|
+ <el-col :span="4" style="margin-top: 3px">
|
|
|
<el-button type="primary" @click="addTableData">添加</el-button>
|
|
<el-button type="primary" @click="addTableData">添加</el-button>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
@@ -149,24 +149,38 @@
|
|
|
this.tableDate.splice(index, 1);
|
|
this.tableDate.splice(index, 1);
|
|
|
},
|
|
},
|
|
|
async getWarehouseList(categoryType) {
|
|
async getWarehouseList(categoryType) {
|
|
|
- const res = await warehouseDefinition.list({
|
|
|
|
|
|
|
+ let params = {
|
|
|
inventoryType: categoryType
|
|
inventoryType: categoryType
|
|
|
- });
|
|
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ if (this.$store.state.user.info.factoryId) {
|
|
|
|
|
+ params['factoryId'] = this.$store.state.user.info.factoryId;
|
|
|
|
|
+ }
|
|
|
|
|
+ const res = await warehouseDefinition.list(params);
|
|
|
this.warehouseList = res.map((item) => {
|
|
this.warehouseList = res.map((item) => {
|
|
|
return { ...item, name: item.name };
|
|
return { ...item, name: item.name };
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
async getBatchWarehouseList(batch) {
|
|
async getBatchWarehouseList(batch) {
|
|
|
- const res = await warehouseDefinition.list({});
|
|
|
|
|
- if (!batch.length) {
|
|
|
|
|
- this.warehouseList = res.map((item) => {
|
|
|
|
|
- return { ...item, name: item.name };
|
|
|
|
|
- });
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ let params = {};
|
|
|
|
|
+
|
|
|
|
|
+ if (this.$store.state.user.info.factoryId) {
|
|
|
|
|
+ params['factoryId'] = this.$store.state.user.info.factoryId;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (batch?.length == 1) {
|
|
|
|
|
+ params['inventoryType'] = batch[0];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const res = await warehouseDefinition.list(params);
|
|
|
|
|
+ // if (!batch.length) {
|
|
|
|
|
+ // this.warehouseList = res.map((item) => {
|
|
|
|
|
+ // return { ...item, name: item.name };
|
|
|
|
|
+ // });
|
|
|
|
|
+ // return;
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
- let filter = res.filter((item) => batch.includes(item.inventoryType));
|
|
|
|
|
- this.warehouseList = filter.map((item) => {
|
|
|
|
|
|
|
+ // let filter = res.filter((item) => batch.includes(item.inventoryType));
|
|
|
|
|
+ this.warehouseList = res.map((item) => {
|
|
|
return { ...item, name: item.name };
|
|
return { ...item, name: item.name };
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|