fixed getting wrong order results

This commit is contained in:
Luca Haid
2025-05-13 09:18:34 +02:00
parent d65e67571d
commit a6d577023f
4 changed files with 221 additions and 39 deletions
@@ -2,6 +2,8 @@ async function handleApiResponse(responsePromise) {
const res = await responsePromise;
if (res.data.success === false) return window.notify('error', `Fehler: ${res.data.errors.join(', ')}`);
window.notify('success', res.data.message || 'Erfolgreich');
window.dispatchEvent(new Event('refreshTable'));
}
Vue.component('warehouse-article-prices', {
@@ -148,6 +150,16 @@ Vue.component('warehouse-article-distributor', {
Vue.component('warehouse-article', {
template: `
<tt-card>
<tt-select
multiple
sm
row
label="Kategorie"
:options="[{'text':'Alle'},{'value':1,'text':'Dienstleistungen'},{'value':2,'text':'Elektromaterial etc.'},{'value':3,'text':'EStmk Shop'},{'value':4,'text':'GPON OLTs und Bridges'},{'value':5,'text':'Kabel-TV und Zubehör'},{'value':6,'text':'Kupferverkabelung und Schränke'},{'value':7,'text':'LWL Aussen- und Universalkabel'},{'value':8,'text':'LWL Boxen, Muffen und Gehäuse'},{'value':9,'text':'LWL Leitungsbau'},{'value':10,'text':'LWL Pigtails und Kupplungen'},{'value':11,'text':'LWL Splitter, Filter und Dämpfer'},{'value':12,'text':'Netzteile, USV, Akkus'},{'value':13,'text':'Patchkabel Kupfer'},{'value':14,'text':'Patchkabel LWL Multimode'},{'value':15,'text':'Patchkabel LWL Singlemode'},{'value':16,'text':'Richtfunk und WLAN'},{'value':17,'text':'Router und Zubehör'},{'value':18,'text':'SFP und Konverter'},{'value':19,'text':'Switches und Zubehör'},{'value':20,'text':'Telefonie und Zubehör'}]"
v-model="articleTest"
@input="window.console.log('Selected categories:', articleTest)"
/>
<tt-table-crud ref="table" @openHistory="historyModalId = $event.id; historyModal = true">
<template v-slot:cheapestsellprice="{ row }">
<template v-for="price in JSON.parse(row.cheapestSellPrice || '[]')">
@@ -175,7 +187,7 @@ Vue.component('warehouse-article', {
<warehouse-history-modal :show.sync="historyModal" :id="historyModalId"/>
</tt-card>
`,
data: () => ({window, historyModal: false, historyModalId: null}),
data: () => ({window, historyModal: false, historyModalId: null, articleTest: null}),
mounted() {
const table = this.$refs.table?.$refs?.table;
if (!table) return;
@@ -188,5 +200,9 @@ Vue.component('warehouse-article', {
if (Object.keys(table.filters).length === 0) table.filters = {};
table.refreshTable();
}
window.addEventListener('refreshTable', () => {
table.refreshTable();
});
}
});