improved warehouse module

This commit is contained in:
Luca Haid
2025-08-04 15:28:12 +02:00
parent 3979f907b0
commit 1ac95214b2
15 changed files with 117 additions and 26 deletions
@@ -107,9 +107,17 @@ Vue.component('tt-table-crud', {
const response = await axios.post(this.crudModalData.id ? window['TT_CONFIG']['UPDATE_URL'] : window['TT_CONFIG']['CREATE_URL'],
this.crudModalData);
if (response.data.success) {
this.$refs.table.refreshTable();
this.resetCrudModalData();
this.window.notify('success', response.data.message || 'Erfolgreich gespeichert');
if (this.crudConfig.reopenOnCreate && !this.crudModalData.id) {
this.resetCrudModalData();
const getByIdUrl = window['TT_CONFIG']['GET_BY_ID_URL'] || `${window['TT_CONFIG']['BASE_PATH']}/${this.crudConfig.key}/getById`;
const getByIdResponse = await axios.get(getByIdUrl, {params: {id: response.data.id}});
this.crudModalData = getByIdResponse.data;
this.crudModal = true;
} else {
this.resetCrudModalData();
this.$refs.table.refreshTable();
}
} else {
this.window.notify('error',
response.data.errors ? Object.values(response.data.errors).join('<br>') : response.data.message || 'Ein Fehler ist aufgetreten');