WarehouseOffer fixed bugs
This commit is contained in:
@@ -37,6 +37,21 @@ Vue.component('WarehouseArticlePacket', {
|
||||
articles: [],
|
||||
}
|
||||
}, beforeMount() {
|
||||
// Dynamically filter articles based on the user's shop context
|
||||
// This assumes TT_CONFIG is available and contains userAddressId
|
||||
const userAddressId = window['TT_CONFIG']['userAddressId'];
|
||||
let articleFilter = {};
|
||||
if (userAddressId === 209) {
|
||||
articleFilter = { isEShop: 1 };
|
||||
} else if (userAddressId === 210) {
|
||||
articleFilter = { isSbidiShop: 1 };
|
||||
}
|
||||
|
||||
// The current implementation directly uses `window['TT_CONFIG']['CRUD_CONFIG'].columns.find(...)`
|
||||
// which might not reflect the filtered articles.
|
||||
// To properly filter, the `input-article` component or its underlying API call needs to be aware of the shop context.
|
||||
// For now, this will just get all articles that were passed from the backend during initial config.
|
||||
// A more robust solution would involve modifying the `WarehouseArticle/autocomplete` API to accept shop filters.
|
||||
this.articles = window['TT_CONFIG']['CRUD_CONFIG'].columns.find(column => column.key === 'subItems').modal.items;
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user