|
|
|
@ -469,6 +469,14 @@ import { |
|
|
|
saveWarehouse, |
|
|
|
delWarehouse, |
|
|
|
getWareHouseTypeList, |
|
|
|
getStorageZoneConfigList, |
|
|
|
getWarehouseStorageConfigList, |
|
|
|
saveWarehouseStorageConfig, |
|
|
|
deleteWarehouseStorageConfig, |
|
|
|
getUserList, |
|
|
|
getAccessWarehouseList, |
|
|
|
saveAccessWarehouse, |
|
|
|
deleteAccessWarehouse, |
|
|
|
} from '@/api/warehouse/warehouse.js' |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
@ -1315,22 +1323,14 @@ import { |
|
|
|
async loadStorageConfigLists() { |
|
|
|
try { |
|
|
|
// 加载可选策略(从StorageZoneConfig表) |
|
|
|
const {data: availableData} = await this.$http({ |
|
|
|
url: this.$http.adornUrl('warehouse/getStorageZoneConfigList'), |
|
|
|
method: 'post', |
|
|
|
data: this.$http.adornData({ |
|
|
|
site: this.currentWarehouse.site |
|
|
|
}) |
|
|
|
const {data: availableData} = await getStorageZoneConfigList({ |
|
|
|
site: this.currentWarehouse.site |
|
|
|
}); |
|
|
|
|
|
|
|
// 加载已配置策略(从WareHouseStorageZoneConfig表) |
|
|
|
const {data: selectedData} = await this.$http({ |
|
|
|
url: this.$http.adornUrl('warehouse/getWarehouseStorageConfigList'), |
|
|
|
method: 'post', |
|
|
|
data: this.$http.adornData({ |
|
|
|
site: this.currentWarehouse.site, |
|
|
|
warehouseId: this.currentWarehouse.wareHouseId |
|
|
|
}) |
|
|
|
const {data: selectedData} = await getWarehouseStorageConfigList({ |
|
|
|
site: this.currentWarehouse.site, |
|
|
|
warehouseId: this.currentWarehouse.wareHouseId |
|
|
|
}); |
|
|
|
|
|
|
|
if (selectedData && selectedData.code === 0) { |
|
|
|
@ -1414,11 +1414,7 @@ import { |
|
|
|
remark: item.configName + (item.description ? ' - ' + item.description : '') |
|
|
|
})); |
|
|
|
|
|
|
|
const {data} = await this.$http({ |
|
|
|
url: this.$http.adornUrl('warehouse/saveWarehouseStorageConfig'), |
|
|
|
method: 'post', |
|
|
|
data: this.$http.adornData(configList, false) |
|
|
|
}); |
|
|
|
const {data} = await saveWarehouseStorageConfig(configList); |
|
|
|
|
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success('添加成功'); |
|
|
|
@ -1454,14 +1450,10 @@ import { |
|
|
|
try { |
|
|
|
const configCodes = this.selectedConfigSelections.map(item => item.configCode); |
|
|
|
|
|
|
|
const {data} = await this.$http({ |
|
|
|
url: this.$http.adornUrl('warehouse/deleteWarehouseStorageConfig'), |
|
|
|
method: 'post', |
|
|
|
data: this.$http.adornData({ |
|
|
|
site: this.currentWarehouse.site, |
|
|
|
warehouseId: this.currentWarehouse.wareHouseId, |
|
|
|
configCodes: configCodes |
|
|
|
}, false) |
|
|
|
const {data} = await deleteWarehouseStorageConfig({ |
|
|
|
site: this.currentWarehouse.site, |
|
|
|
warehouseId: this.currentWarehouse.wareHouseId, |
|
|
|
configCodes: configCodes |
|
|
|
}); |
|
|
|
|
|
|
|
if (data && data.code === 0) { |
|
|
|
@ -1502,23 +1494,15 @@ import { |
|
|
|
async loadAccessAuthLists() { |
|
|
|
try { |
|
|
|
// 加载可选用户(从sys_user表) |
|
|
|
const {data: availableData} = await this.$http({ |
|
|
|
url: this.$http.adornUrl('sys/user/list'), |
|
|
|
method: 'get', |
|
|
|
params: this.$http.adornParams({ |
|
|
|
page: 1, |
|
|
|
limit: 10000 |
|
|
|
}) |
|
|
|
const {data: availableData} = await getUserList({ |
|
|
|
page: 1, |
|
|
|
limit: 10000 |
|
|
|
}); |
|
|
|
|
|
|
|
// 加载已授权用户(从AccessWarehouse表) |
|
|
|
const {data: selectedData} = await this.$http({ |
|
|
|
url: this.$http.adornUrl('warehouse/getAccessWarehouseList'), |
|
|
|
method: 'post', |
|
|
|
data: this.$http.adornData({ |
|
|
|
site: this.currentWarehouse.site, |
|
|
|
warehouseId: this.currentWarehouse.wareHouseId |
|
|
|
}) |
|
|
|
const {data: selectedData} = await getAccessWarehouseList({ |
|
|
|
site: this.currentWarehouse.site, |
|
|
|
warehouseId: this.currentWarehouse.wareHouseId |
|
|
|
}); |
|
|
|
|
|
|
|
if (selectedData && selectedData.code === 0) { |
|
|
|
@ -1601,12 +1585,7 @@ import { |
|
|
|
userName: item.userDisplay |
|
|
|
})); |
|
|
|
|
|
|
|
console.log(userList) |
|
|
|
const {data} = await this.$http({ |
|
|
|
url: this.$http.adornUrl('warehouse/saveAccessWarehouse'), |
|
|
|
method: 'post', |
|
|
|
data: this.$http.adornData(userList, false) |
|
|
|
}); |
|
|
|
const {data} = await saveAccessWarehouse(userList); |
|
|
|
|
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success('授权成功'); |
|
|
|
@ -1642,14 +1621,10 @@ import { |
|
|
|
try { |
|
|
|
const userIds = this.selectedUserSelections.map(item => item.userid); |
|
|
|
|
|
|
|
const {data} = await this.$http({ |
|
|
|
url: this.$http.adornUrl('warehouse/deleteAccessWarehouse'), |
|
|
|
method: 'post', |
|
|
|
data: this.$http.adornData({ |
|
|
|
site: this.currentWarehouse.site, |
|
|
|
warehouseId: this.currentWarehouse.wareHouseId, |
|
|
|
userIds: userIds |
|
|
|
}, false) |
|
|
|
const {data} = await deleteAccessWarehouse({ |
|
|
|
site: this.currentWarehouse.site, |
|
|
|
warehouseId: this.currentWarehouse.wareHouseId, |
|
|
|
userIds: userIds |
|
|
|
}); |
|
|
|
|
|
|
|
if (data && data.code === 0) { |
|
|
|
|