Erweiterte Werte übernehmen

This commit is contained in:
2026-07-17 12:44:13 +02:00
parent 5b20729877
commit 5989046b53
4 changed files with 39 additions and 13 deletions
+15 -9
View File
@@ -20,20 +20,26 @@
<label for="customerSearch">Kundennummer oder Firmenname</label>
<input type="text" id="customerSearch" autocomplete="off" role="combobox"
aria-expanded="false" aria-controls="suggestions"
placeholder="z. B. K-10042 oder Mueller">
placeholder="z. B. K-10042 oder Müller">
<div class="suggestions" id="suggestions" role="listbox"></div>
<label class="checkbox-row">
<input type="checkbox" id="advancedToggle">
Erweitert
</label>
<div class="field-group" id="advancedFields" role="group" aria-label="Erweiterte Suchfelder" hidden>
<button type="button" class="field-toggle" data-field="kugru" aria-pressed="false">Kundengruppe</button>
<button type="button" class="field-toggle" data-field="kg_id" aria-pressed="false">Kundengruppen-ID</button>
<button type="button" class="field-toggle" data-field="sydat" aria-pressed="false">Erstellt am</button>
<button type="button" class="field-toggle" data-field="datlv" aria-pressed="false">Letzte Änderung</button>
<button type="button" class="field-toggle" data-field="fibuk" aria-pressed="false">Fibu-Konto</button>
<button type="button" class="field-toggle" data-field="ku_id" aria-pressed="false">Kunden-ID (intern)</button>
<div id="advancedFields" hidden>
<div class="field-group" role="group" aria-label="Erweiterte Suchfelder">
<button type="button" class="field-toggle" data-field="kugru" aria-pressed="false">Kundengruppe</button>
<button type="button" class="field-toggle" data-field="kg_id" aria-pressed="false">Kundengruppen-ID</button>
<button type="button" class="field-toggle" data-field="sydat" aria-pressed="false">Erstellt am</button>
<button type="button" class="field-toggle" data-field="datlv" aria-pressed="false">Letzte Änderung</button>
<button type="button" class="field-toggle" data-field="fibuk" aria-pressed="false">Fibu-Konto</button>
<button type="button" class="field-toggle" data-field="ku_id" aria-pressed="false">Kunden-ID (intern)</button>
</div>
<label class="checkbox-row">
<input type="checkbox" id="applyExtraValues">
Erweiterte Werte übernehmen
</label>
</div>
</div>
@@ -48,7 +54,7 @@
<div class="step-label"><span class="num">2</span> Anliegen</div>
<label for="subject">Betreff</label>
<input type="text" id="subject" maxlength="200" placeholder="Kurze Zusammenfassung der Störung">
<input type="text" id="subject" maxlength="200" placeholder="Kurze Zusammenfassung">
<label for="description">Beschreibung</label>
<textarea id="description" placeholder="Was ist passiert? Fehlermeldungen, betroffene Systeme, Ansprechpartner ..."></textarea>
+8 -1
View File
@@ -7,6 +7,7 @@
const advancedToggle = document.getElementById("advancedToggle");
const advancedFields = document.getElementById("advancedFields");
const fieldToggleButtons = Array.from(document.querySelectorAll(".field-toggle"));
const applyExtraValuesToggle = document.getElementById("applyExtraValues");
const customerChip = document.getElementById("customerChip");
const chipNumber = document.getElementById("chipNumber");
const chipName = document.getElementById("chipName");
@@ -86,6 +87,9 @@
appendHighlighted(numberSpan, customer.number, currentQuery);
const nameSpan = document.createElement("span");
appendHighlighted(nameSpan, customer.name, currentQuery);
if (customer.extraMatches && customer.extraMatches.length > 0) {
nameSpan.appendChild(document.createTextNode(` (${customer.extraMatches.join(", ")})`));
}
item.appendChild(numberSpan);
item.appendChild(nameSpan);
item.addEventListener("click", () => selectCustomer(customer));
@@ -117,7 +121,10 @@
function selectCustomer(customer) {
selectedCustomer = customer;
chipNumber.textContent = customer.number;
chipName.textContent = customer.name;
const useExtraValues = applyExtraValuesToggle.checked && customer.extraMatches && customer.extraMatches.length > 0;
chipName.textContent = useExtraValues
? `${customer.name} (${customer.extraMatches.join(", ")})`
: customer.name;
customerChip.classList.add("visible");
searchWrap.style.display = "none";
closeSuggestions();