diff --git a/public/js/pages/WarehouseOrderRequest/WarehouseOrderRequest.js b/public/js/pages/WarehouseOrderRequest/WarehouseOrderRequest.js index ce50dd91b..41b5aeed4 100644 --- a/public/js/pages/WarehouseOrderRequest/WarehouseOrderRequest.js +++ b/public/js/pages/WarehouseOrderRequest/WarehouseOrderRequest.js @@ -1,21 +1,25 @@ +window['TT_CONFIG']['CRUD_CONFIG']['editCondition'] = (row) => { + return row.cancelled === 0 && (!row.linkedOrderIds || row.linkedOrderIds.length === 0); +} + window.TT_CONFIG["CRUD_CONFIG"]["additionalActions"] = [ ...window.TT_CONFIG["CRUD_CONFIG"]["additionalActions"], { key: "cancelRequest", title: "Bestellwunsch stornieren", - class: "fas fa-times text-danger", + class: "fas fa-ban text-danger", // Instead of fa-times, use a ban icon condition: (row) => window.TT_CONFIG['WAREHOUSE_ADMIN'] === '1' && row.cancelled === 0, }, { key: "uncancelRequest", title: "Bestellwunsch wiederherstellen", - class: "fas fa-check text-success", + class: "fas fa-undo text-warning", // Use an undo icon for restore, with a warning color condition: (row) => window.TT_CONFIG['WAREHOUSE_ADMIN'] === '1' && row.cancelled === 1, }, { key: "createOrder", title: "Bestellung erstellen", - class: "fas fa-plus text-success", + class: "fas fa-shopping-cart text-primary", // Use shopping-cart to indicate order creation condition: (row) => window.TT_CONFIG['WAREHOUSE_ADMIN'] === '1' && row.cancelled === 0 && (!row.linkedOrderIds || row.linkedOrderIds.length === 0) && JSON.parse(row.positions).filter(position => position.articleId_text).length === 0, @@ -23,26 +27,26 @@ window.TT_CONFIG["CRUD_CONFIG"]["additionalActions"] = [ { key: "doneOrder", title: "Bestellwunsch erledigt", - class: "fas fa-check text-success", + class: "fas fa-check-circle text-success", // Use check-circle for marking as done condition: (row) => window.TT_CONFIG['WAREHOUSE_ADMIN'] === '1' && row.done === 0, }, { key: "undoneOrder", title: "Bestellwunsch wieder offen", - class: "fas fa-times text-danger", + class: "fas fa-redo-alt text-info", // Use redo-alt to indicate reopening the order condition: (row) => window.TT_CONFIG['WAREHOUSE_ADMIN'] === '1' && row.done === 1, }, -] +]; Vue.component('add-log-modal', { props: { orderRequestId: {type: Number, required: true}, - type: {type: String, default: 'accept'} + type: {type: String, default: 'accept'} }, data() { return { - orderRequest: null, - note: '', + orderRequest: null, + note: '', }; }, async mounted() { @@ -58,7 +62,7 @@ Vue.component('add-log-modal', { async submit() { const response = await axios.post(`${window.TT_CONFIG["BASE_PATH"]}/WarehouseOrderRequest/createNewLogAction`, { orderRequestId: this.orderRequestId, - note: this.note, + note: this.note, }); if (response.data.success) { @@ -82,8 +86,8 @@ Vue.component('add-log-modal', { }) Vue.component('order-request-log', { - props: {orderRequestId: {type: Number, required: true}}, - data: () => ({ + props: {orderRequestId: {type: Number, required: true}}, + data: () => ({ logs: [] }), async mounted() { @@ -98,7 +102,8 @@ Vue.component('order-request-log', { if (typeof response2.data.linkedOrderIds === 'string') { try { response2.data.linkedOrderIds = JSON.parse(response2.data.linkedOrderIds); - } catch {} + } catch { + } } if (response2.data.linkedOrderIds && response2.data.linkedOrderIds.length > 0) { @@ -124,16 +129,16 @@ Vue.component('order-request-log', { }, //language=Vue template: ` -
- -
- ` +
+ +
+ ` }) @@ -166,7 +171,7 @@ Vue.component('linked-order-status', { }); Vue.component('warehouse-order-request-detail', { - props: { + props: { positions: { type: Array, required: true @@ -217,15 +222,17 @@ Vue.component('warehouse-order-request', { - + `, data: () => ({ window, historyModal: false, historyModalId: null, - addLogModal: false, - addLogModalId: null, + addLogModal: false, + addLogModalId: null, showHiddenRequests: false, showCanceledRequests: false, orderRequestModalId: null diff --git a/public/plugins/vue/tt-components/tt-table-crud.js b/public/plugins/vue/tt-components/tt-table-crud.js index 2c1894797..feac23f5a 100644 --- a/public/plugins/vue/tt-components/tt-table-crud.js +++ b/public/plugins/vue/tt-components/tt-table-crud.js @@ -30,7 +30,8 @@ Vue.component('tt-table-crud', {
-