Add employee livesearch lookup

This commit is contained in:
2026-06-07 15:04:50 +02:00
parent b6180867ef
commit 27d28a8767
9 changed files with 77 additions and 4 deletions
+23
View File
@@ -369,6 +369,29 @@ class AgrarmonitorConnector {
};
});
}
async getMitarbeiter(suchstring = '', mitarbeitergruppe = 0) {
const response = await this.http.get('/module/mitarbeiter/livesearch.php', {
params: {
suchstring,
mitarbeiter_aktiv: 1,
mitarbeitergruppe,
itemsperpage: 100000,
seite: 1,
},
});
await this.saveSession();
const document = this.parseHtmlDocument(response.data);
const rows = Array.from(document.querySelectorAll('table#mitarbeiter_table tbody tr, table.mitarbeiter_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() ?? '',
nachname: cells[1]?.textContent?.trim() ?? '',
vorname: cells[2]?.textContent?.trim() ?? '',
};
});
}
createHttpClient() {
const client = (0, axios_cookiejar_support_1.wrapper)(axios_1.default.create({
baseURL: this.baseUrl,