@@ -91,4 +91,8 @@ export default {
\ No newline at end of file
diff --git a/src/frontend/src/components/layout/config/Properties.vue b/src/frontend/src/components/layout/config/Properties.vue
index b5581de..ad17373 100644
--- a/src/frontend/src/components/layout/config/Properties.vue
+++ b/src/frontend/src/components/layout/config/Properties.vue
@@ -166,6 +166,9 @@ export default {
width: fit-content;
}
+.properties-container {
+ padding: 2.4rem;
+}
.property-item-enter-from {
opacity: 0;
diff --git a/src/frontend/src/components/layout/config/Rates.vue b/src/frontend/src/components/layout/config/Rates.vue
index 5620377..98208ea 100644
--- a/src/frontend/src/components/layout/config/Rates.vue
+++ b/src/frontend/src/components/layout/config/Rates.vue
@@ -236,6 +236,7 @@ export default {
.container-rate-container {
display: flex;
flex-direction: column;
+ padding: 1.6rem;
}
.container-rate-header {
diff --git a/src/frontend/src/components/layout/config/Users.vue b/src/frontend/src/components/layout/config/Users.vue
index 93eb6ff..e2b79fa 100644
--- a/src/frontend/src/components/layout/config/Users.vue
+++ b/src/frontend/src/components/layout/config/Users.vue
@@ -1,8 +1,8 @@
-
+
@@ -119,9 +119,9 @@ export default {
badgeResolver: (value) => {
const formattedValues = []
- value.slice(0,5).forEach(v => formattedValues.push({text: v, variant: "secondary"}));
+ value.slice(0, 5).forEach(v => formattedValues.push({text: v, variant: "secondary"}));
- if(value.length > 5)
+ if (value.length > 5)
formattedValues.push({text: "...", variant: "secondary"});
return formattedValues;
@@ -141,6 +141,11 @@ export default {
\ No newline at end of file
diff --git a/src/frontend/src/components/layout/edit/destination/mass/DestinationMassRouteCell.vue b/src/frontend/src/components/layout/edit/destination/mass/DestinationMassRouteCell.vue
new file mode 100644
index 0000000..34cd1d8
--- /dev/null
+++ b/src/frontend/src/components/layout/edit/destination/mass/DestinationMassRouteCell.vue
@@ -0,0 +1,229 @@
+
+
+
+
+
+
+ icon
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/frontend/src/components/layout/edit/destination/mass/DestinationMassRouteRow.vue b/src/frontend/src/components/layout/edit/destination/mass/DestinationMassRouteRow.vue
new file mode 100644
index 0000000..3fcd40a
--- /dev/null
+++ b/src/frontend/src/components/layout/edit/destination/mass/DestinationMassRouteRow.vue
@@ -0,0 +1,75 @@
+
+
+
+
+ {{ row.supplier.name }}
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/frontend/src/pages/CalculationMassEdit.vue b/src/frontend/src/pages/CalculationMassEdit.vue
index fd739e8..e3fa81d 100644
--- a/src/frontend/src/pages/CalculationMassEdit.vue
+++ b/src/frontend/src/pages/CalculationMassEdit.vue
@@ -263,7 +263,7 @@ export default {
return this.modalType ? COMPONENT_TYPES[this.modalType] : null;
},
showProcessingModal() {
- return this.premiseEditStore.showProcessingModal || this.destinationEditStore.showProcessingModal ;
+ return this.premiseEditStore.showProcessingModal || this.destinationEditStore.showProcessingModal;
},
shownProcessingMessage() {
return this.processingMessage;
@@ -425,7 +425,7 @@ export default {
}
if ((type === 'amount' || type === 'routes')) {
- if(dataSource !== -1)
+ if (dataSource !== -1)
ids = [dataSource];
}
@@ -439,13 +439,18 @@ export default {
},
async closeEditModalAction(action) {
- if (this.modalType === "destinations") {
+ if (this.modalType === 'amount' || this.modalType === 'routes' || this.modalType === "destinations") {
if (action === 'accept') {
- const destMatrix = this.$refs.modalComponent?.destMatrix;
- if (destMatrix) {
- await this.destinationEditStore.massSetDestinations(destMatrix);
+ if (this.modalType === "destinations") {
+ const setMatrix = this.$refs.modalComponent?.destMatrix;
+
+ if (setMatrix) {
+ await this.destinationEditStore.massSetDestinations(setMatrix);
+ }
+ } else {
+ await this.destinationEditStore.massUpdateDestinations();
}
}
@@ -503,9 +508,10 @@ export default {
stackable: true
};
- if (type === 'amount' || type === 'routes' || type === 'destinations')
+ if (type === 'amount' || type === 'routes' || type === 'destinations') {
+ this.modalTitle = "Edit destinations";
this.modalProps = {};
-
+ }
} else {
const premise = this.premiseEditStore.getById(id);
@@ -545,10 +551,8 @@ export default {
this.modalTitle = "Edit destinations";
this.modalProps = {type: type};
}
-
}
- }
- ,
+ },
/* Animation hooks */
diff --git a/src/frontend/src/store/destinationEdit.js b/src/frontend/src/store/destinationEdit.js
index 896657a..122f471 100644
--- a/src/frontend/src/store/destinationEdit.js
+++ b/src/frontend/src/store/destinationEdit.js
@@ -6,6 +6,10 @@ export const useDestinationEditStore = defineStore('destinationEdit', {
state: () => ({
destinations: null,
loading: false,
+ initialized: false,
+ handlingCostMatrix: null,
+ quantityMatrix: null,
+ routeMatrix: null
}),
getters: {
checkDestinationAssignment(state) {
@@ -45,9 +49,27 @@ export const useDestinationEditStore = defineStore('destinationEdit', {
},
showProcessingModal(state) {
return state.loading;
+ },
+ getHandlingCostMatrix(state) {
+ return state.handlingCostMatrix;
+ },
+ getQuantityMatrix(state) {
+ return state.quantityMatrix;
+ },
+ getRouteMatrix(state) {
+ return state.routeMatrix;
}
},
actions: {
+ setHandlingCostMatrix(handlingCostMatrix) {
+ this.handlingCostMatrix = handlingCostMatrix;
+ },
+ setQuantityMatrix(quantityMatrix) {
+ this.quantityMatrix = quantityMatrix;
+ },
+ setRouteMatrix(routeMatrix) {
+ this.routeMatrix = routeMatrix;
+ },
setupDestinations(premisses) {
this.loading = true;
@@ -55,6 +77,7 @@ export const useDestinationEditStore = defineStore('destinationEdit', {
premisses.forEach(p => temp.set(p.id, p.destinations));
this.destinations = temp;
+ this.initialized = true;
this.loading = false;
},
async massSetDestinations(updateMatrix) {
@@ -85,11 +108,51 @@ export const useDestinationEditStore = defineStore('destinationEdit', {
this.loading = false;
},
- async massUpdateDestinations(updateMatrix) {
+ async massUpdateDestinations() {
this.loading = true;
+ this.updateQuantity();
+ this.updateHandlingCosts();
+
+
this.loading = false;
},
+ updateHandlingCosts() {
+ this.handlingCostMatrix.forEach(row => {
+ const destinations = this.destinations.get(row.id);
+
+ if ((destinations ?? null) !== null) {
+
+ const destination = destinations.find(dest => dest.id === row.destinationId);
+
+ if((destination ?? null) !== null) {
+ destination.disposal_costs = row.disposal_costs;
+ destination.repackaging_costs = row.repackaging_costs;
+ destination.handling_costs = row.handling_costs;
+ }
+ }
+ });
+
+ },
+ updateQuantity() {
+ this.quantityMatrix.forEach(row => {
+ const destinations = this.destinations.get(row.id);
+
+
+ if ((destinations ?? null) !== null) {
+ row.destinations
+ .filter(newDest => newDest.id !== null)
+ .forEach(newDest => {
+
+ const found = destinations.find(dest => dest.id === newDest.id);
+ if (found)
+ found.annual_amount = newDest.annual_amount;
+
+ });
+ }
+
+ });
+ }
}
});
\ No newline at end of file