WarehouseOffer fixed bugs

This commit is contained in:
Luca Haid
2025-07-21 12:27:26 +02:00
parent 48f5d2fae4
commit a867bcc6b8
17 changed files with 526 additions and 303 deletions
@@ -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;
}
})