Add article livesearch lookup

This commit is contained in:
2026-06-07 14:53:44 +02:00
parent 68bb6ce061
commit b6180867ef
9 changed files with 73 additions and 4 deletions
+24
View File
@@ -345,6 +345,30 @@ class AgrarmonitorConnector {
};
});
}
async getArtikel(artikelGruppe, suchstring = '') {
const response = await this.http.get('/module/artikel/livesearch.php', {
params: {
suchstring,
artikel_aktiv: 0,
warengruppe: artikelGruppe,
lagerplatz: 0,
bestand: 0,
itemsperpage: 100000,
seite: 1,
},
});
await this.saveSession();
const document = this.parseHtmlDocument(response.data);
const rows = Array.from(document.querySelectorAll('table#artikel_table tbody tr'));
return rows.map(row => {
const cells = Array.from(row.querySelectorAll('td'));
return {
id: this.parseNumber(row.getAttribute('data-id') ?? row.id),
nummer: cells[0]?.textContent?.trim() ?? '',
bezeichnung: cells[1]?.textContent?.trim() ?? '',
};
});
}
createHttpClient() {
const client = (0, axios_cookiejar_support_1.wrapper)(axios_1.default.create({
baseURL: this.baseUrl,