diff --git a/src/frontend/src/components/layout/edit/DestinationListView.vue b/src/frontend/src/components/layout/edit/DestinationListView.vue
index 42d237b..d0bf7ee 100644
--- a/src/frontend/src/components/layout/edit/DestinationListView.vue
+++ b/src/frontend/src/components/layout/edit/DestinationListView.vue
@@ -1,5 +1,5 @@
-
+
-
-
-
-
+
+
@@ -53,11 +52,12 @@ import Checkbox from "@/components/UI/Checkbox.vue";
import CalculationListItem from "@/components/layout/calculation/CalculationListItem.vue";
import DestinationItem from "@/components/layout/edit/destination/DestinationItem.vue";
import {mapStores} from "pinia";
-import {usePremiseEditStore} from "@/store/premiseEdit.js";
import {useNodeStore} from "@/store/node.js";
import Modal from "@/components/UI/Modal.vue";
import DestinationEdit from "@/components/layout/edit/destination/DestinationEdit.vue";
-import {UrlSafeBase64} from "@/common.js";
+import {usePremiseSingleEditStore} from "@/store/premiseSingleEdit.js";
+import logger from "@/logger.js";
+import {useDestinationSingleEditStore} from "@/store/destinationSingleEdit.js";
export default {
name: "DestinationListView",
@@ -72,12 +72,9 @@ export default {
}
},
computed: {
- massEditClasses() {
- return this.premiseEditStore.isSingleSelect ? '' : 'container--mass-edit';
- },
- ...mapStores(usePremiseEditStore, useNodeStore),
+ ...mapStores(usePremiseSingleEditStore, useDestinationSingleEditStore, useNodeStore),
destinations() {
- return this.premiseEditStore.getDestinationsView;
+ return this.premiseSingleEditStore.getDestinations;
},
showDestinationsList() {
return this.destinations !== null && this.destinations.length > 0;
@@ -92,22 +89,35 @@ export default {
return node.country.iso_code;
},
async addDestination(node) {
- console.log(node)
- const [id] = await this.premiseEditStore.addDestination(node);
+ logger.log(node)
+ const [id] = await this.premiseSingleEditStore.addDestination(node);
this.editDestination(id);
},
- deleteDestination(id) {
- this.premiseEditStore.deleteDestination(id);
+ async deleteDestination(id) {
+ this.premiseSingleEditStore.deleteDestination(id);
},
editDestination(id) {
- // TODO refactor.
- if (id && this.premiseEditStore.getDestinationById(id) !== null) {
- this.premiseEditStore.selectDestination(id);
+
+ logger.log(id);
+
+ if (id) {
+ const destination = this.premiseSingleEditStore.getDestinationById(id);
+ logger.log(destination);
+ this.destinationSingleEditStore.setDestination(destination);
this.editDestinationModalState = true;
}
},
- deselectDestination(save) {
- this.premiseEditStore.deselectDestinations(save);
+ async editDestinationFinish(save) {
+
+ if (save) {
+
+ const dest = this.premiseSingleEditStore.getDestinationById(this.destinationSingleEditStore.destination.id);
+
+ logger.log("id", this.destinationSingleEditStore.destination.id, "dest", dest);
+ this.destinationSingleEditStore.copyBack(dest);
+ await this.premiseSingleEditStore.updateDestination(this.destinationSingleEditStore.destination.id)
+ }
+
this.editDestinationModalState = false;
}
}
@@ -132,10 +142,6 @@ export default {
}
-.container--mass-edit {
- width: min(80vw, 120rem);
-}
-
.search-bar-container {
margin: 3rem 3rem 0 3rem;
diff --git a/src/frontend/src/components/layout/edit/SupplierView.vue b/src/frontend/src/components/layout/edit/SupplierView.vue
index 90975a1..720bbb4 100644
--- a/src/frontend/src/components/layout/edit/SupplierView.vue
+++ b/src/frontend/src/components/layout/edit/SupplierView.vue
@@ -18,13 +18,6 @@
-
-
-
\ No newline at end of file
diff --git a/src/frontend/src/components/layout/report/Report.vue b/src/frontend/src/components/layout/report/Report.vue
index 6527379..a36c328 100644
--- a/src/frontend/src/components/layout/report/Report.vue
+++ b/src/frontend/src/components/layout/report/Report.vue
@@ -156,7 +156,7 @@
-
+
diff --git a/src/frontend/src/pages/CalculationMassEdit.vue b/src/frontend/src/pages/CalculationMassEdit.vue
index 0f8447b..011ae42 100644
--- a/src/frontend/src/pages/CalculationMassEdit.vue
+++ b/src/frontend/src/pages/CalculationMassEdit.vue
@@ -121,7 +121,6 @@ import PriceEdit from "@/components/layout/edit/PriceEdit.vue";
import MaterialEdit from "@/components/layout/edit/MaterialEdit.vue";
import PackagingEdit from "@/components/layout/edit/PackagingEdit.vue";
import DestinationListView from "@/components/layout/edit/DestinationListView.vue";
-import SelectNode from "@/components/layout/node/SelectNode.vue";
import Toast from "@/components/UI/Toast.vue";
import logger from "@/logger.js";
import {useCustomsStore} from "@/store/customs.js";
@@ -131,7 +130,6 @@ const COMPONENT_TYPES = {
price: PriceEdit,
material: MaterialEdit,
packaging: PackagingEdit,
- supplier: SelectNode,
destinations: DestinationListView,
}
@@ -414,11 +412,6 @@ export default {
mixable: premise.is_mixable ?? true,
stackable: premise.is_stackable ?? true
}
- } else if (type === "supplier") {
- this.componentsData.supplier.props = {
- preSelectedNode: premise.supplier,
- openSelectDirect: true
- }
}
}
}
diff --git a/src/frontend/src/pages/CalculationSingleEdit.vue b/src/frontend/src/pages/CalculationSingleEdit.vue
index d382f25..a796248 100644
--- a/src/frontend/src/pages/CalculationSingleEdit.vue
+++ b/src/frontend/src/pages/CalculationSingleEdit.vue
@@ -3,12 +3,12 @@