-
+
-
-
- {{ premise.handling_unit.length }} x
- {{ premise.handling_unit.width }} x
- {{ premise.handling_unit.height }} {{ premise.handling_unit.dimension_unit }}
+
+
+
+ {{ toDimension(premise.handling_unit) }}
+
+
+
+
{{ toFixed(premise.handling_unit.weight, premise.handling_unit.weight_unit, 0) }}
+
+
+
+ {{ toFixed(premise.handling_unit.content_unit_count, 'pcs.', 0) }}
+
+
+ STACKABLE
+
+ MIXABLE
+
+
-
-
-
{{ premise.handling_unit.weight }} {{ premise.handling_unit.weight_unit }}
-
-
-
- {{ premise.handling_unit.content_unit_count }} pcs.
-
-
- STACKABLE
- MIXABLE
-
-
-
- INCOMPLETE
-
-
-
-
-
-
-
-
-
-
{{ premise.supplier.name }}
-
{{ premise.supplier.address }}
+
+
+
+
+
-
-
-
-
-
{{ destinationsCount }} Destinations
+
+
+
+
+
+ {{ premise.supplier.name }}
+
-
{{ name }}
-
- INCOMPLETE
-
-
-
-
-
-
- INCOMPLETE
+
+
+
+
+
+
{{ toFixed(destination.annual_amount, 'pcs.', 0) }}
+
+ {{ toDestination(destination) }}
+
+
+
+
+
+
+
+
+
{{ toFixed(destination.annual_amount, 'pcs.', 0) }}
+
+ {{ toDestination(destination) }}
+
+
+
-
+
+
+
+
+
+
+
+
+
+
{{ toRoute(destination) }}
+
+ {{ toDestination(destination, 15) }}
+
+
+
+
+
+
+
+
+
+
+
+
{{ toRoute(destination) }}
+
+ {{ toDestination(destination, 15) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
\ No newline at end of file
diff --git a/src/frontend/src/components/layout/calculation/CalculationListItem.vue b/src/frontend/src/components/layout/calculation/CalculationListItem.vue
index a156daf..87a0c0a 100644
--- a/src/frontend/src/components/layout/calculation/CalculationListItem.vue
+++ b/src/frontend/src/components/layout/calculation/CalculationListItem.vue
@@ -181,8 +181,9 @@ export default {
.calculation-list-supplier-data {
display: flex;
flex-direction: column;
+ align-items: flex-start;
+ justify-content: center;
gap: 0.4rem;
- height: 90%
}
.supplier-name {
diff --git a/src/frontend/src/components/layout/edit/MaterialEdit.vue b/src/frontend/src/components/layout/edit/MaterialEdit.vue
index 4d4a366..b2e4e72 100644
--- a/src/frontend/src/components/layout/edit/MaterialEdit.vue
+++ b/src/frontend/src/components/layout/edit/MaterialEdit.vue
@@ -2,7 +2,7 @@
-
+
{{ field.label }}
@@ -15,6 +15,7 @@
@blur="field.onBlur"
class="input-field"
autocomplete="off"
+ :placeholder="fromMassEdit ? '' : ''"
/>
@@ -92,6 +93,10 @@ export default {
responsive: {
type: Boolean,
default: true,
+ },
+ fromMassEdit: {
+ type: Boolean,
+ default: false,
}
},
computed: {
diff --git a/src/frontend/src/components/layout/edit/PackagingEdit.vue b/src/frontend/src/components/layout/edit/PackagingEdit.vue
index b319ecf..6d8135b 100644
--- a/src/frontend/src/components/layout/edit/PackagingEdit.vue
+++ b/src/frontend/src/components/layout/edit/PackagingEdit.vue
@@ -6,6 +6,7 @@
@@ -20,6 +21,7 @@
@@ -32,6 +34,7 @@
@@ -44,6 +47,7 @@
@@ -57,6 +61,7 @@
@@ -125,6 +130,10 @@ export default {
responsive: {
type: Boolean,
default: true,
+ },
+ fromMassEdit: {
+ type: Boolean,
+ default: false,
}
},
computed: {
@@ -204,6 +213,12 @@ export default {
const inputOrder = ['lengthInput', 'widthInput', 'heightInput', 'weightInput', 'unitCountInput'];
const currentIndex = inputOrder.indexOf(currentRef);
+
+ if(currentIndex >= inputOrder.length - 1) {
+ this.$emit('accept');
+ return;
+ }
+
if (currentIndex !== -1 && currentIndex < inputOrder.length - 1) {
const nextRef = inputOrder[currentIndex + 1];
this.$nextTick(() => {
diff --git a/src/frontend/src/components/layout/edit/PriceEdit.vue b/src/frontend/src/components/layout/edit/PriceEdit.vue
index d1246f8..38325bc 100644
--- a/src/frontend/src/components/layout/edit/PriceEdit.vue
+++ b/src/frontend/src/components/layout/edit/PriceEdit.vue
@@ -5,7 +5,8 @@
MEK_A [EUR]
@@ -15,7 +16,8 @@
Oversea share [%]
@@ -25,7 +27,7 @@
Include FCA Fee
-
+
@@ -62,6 +64,10 @@ export default {
responsive: {
type: Boolean,
default: true,
+ },
+ fromMassEdit: {
+ type: Boolean,
+ default: false,
}
},
computed: {
@@ -73,6 +79,29 @@ export default {
}
},
methods: {
+ handleEnter(currentRef, event) {
+ event.preventDefault();
+
+ // Define the navigation order
+ const inputOrder = ['priceInput', 'overseaShareInput', 'fcaInput'];
+
+ const currentIndex = inputOrder.indexOf(currentRef);
+
+ if(currentIndex >= inputOrder.length - 1) {
+ this.$emit('accept');
+ return;
+ }
+
+ if (currentIndex !== -1 && currentIndex < inputOrder.length - 1) {
+ const nextRef = inputOrder[currentIndex + 1];
+ this.$nextTick(() => {
+ if (this.$refs[nextRef]) {
+ this.$refs[nextRef].focus();
+ this.$refs[nextRef].select();
+ }
+ });
+ }
+ },
focusLost(event) {
if (!this.$el.contains(event.relatedTarget)) {
this.$emit('save', 'price');
diff --git a/src/frontend/src/main.js b/src/frontend/src/main.js
index 17a8b34..25fbcdc 100644
--- a/src/frontend/src/main.js
+++ b/src/frontend/src/main.js
@@ -1,5 +1,4 @@
import router from './router.js';
-//import store from './store/index.js';
import {setupErrorBuffer} from './store/notification.js'
import {createApp} from 'vue'
import {createPinia} from 'pinia';
@@ -34,7 +33,8 @@ import {
PhTruckTrailer,
PhUpload,
PhWarning,
- PhX
+ PhX,
+ PhExclamationMark, PhMapPin, PhEmpty, PhShippingContainer
} from "@phosphor-icons/vue";
import {setupSessionRefresh} from "@/store/activeuser.js";
@@ -61,6 +61,8 @@ app.component('PhTruckTrailer', PhTruckTrailer);
app.component('PhTruck', PhTruck);
app.component('PhBoat', PhBoat);
app.component('PhTrain', PhTrain);
+app.component('PhEmpty', PhEmpty);
+app.component('PhShippingContainer', PhShippingContainer);
app.component('PhPencilSimple', PhPencilSimple);
app.component('PhX', PhX);
app.component('PhCloudArrowUp', PhCloudArrowUp);
@@ -74,6 +76,9 @@ app.component('PhFile', PhFile);
app.component("PhDesktop", PhDesktop );
app.component("PhHardDrives", PhHardDrives );
app.component("PhClipboard", PhClipboard );
+app.component("PhExclamationMark", PhExclamationMark );
+app.component("PhMapPin", PhMapPin);
+
app.use(router);
diff --git a/src/frontend/src/pages/CalculationMassEdit.vue b/src/frontend/src/pages/CalculationMassEdit.vue
index ae2474b..d8cefdf 100644
--- a/src/frontend/src/pages/CalculationMassEdit.vue
+++ b/src/frontend/src/pages/CalculationMassEdit.vue
@@ -4,15 +4,15 @@
-
@@ -65,9 +67,11 @@
v-model:tariffRate="componentProps.tariffRate"
v-model:tariffUnlocked="componentProps.tariffUnlocked"
v-model:description="componentProps.description"
+
v-model:price="componentProps.price"
v-model:overSeaShare="componentProps.overSeaShare"
v-model:includeFcaFee="componentProps.includeFcaFee"
+
v-model:length="componentProps.length"
v-model:width="componentProps.width"
v-model:height="componentProps.height"
@@ -77,16 +81,24 @@
v-model:unitCount="componentProps.unitCount"
v-model:mixable="componentProps.mixable"
v-model:stackable="componentProps.stackable"
+
v-model:hideDescription="componentProps.hideDescription"
+
+ :fromMassEdit="true"
:countryId=null
:responsive="false"
+
@close="closeEditModalAction('cancel')"
+ @accept="closeEditModalAction('accept')"
>
-
@@ -137,11 +149,20 @@ export default {
},
computed: {
...mapStores(usePremiseEditStore, useNotificationStore),
+ disableButtons() {
+ return this.premiseEditStore.selectedLoading;
+ },
+ premises() {
+ return this.premiseEditStore.getPremisses;
+ },
hasSelection() {
if (this.premiseEditStore.isLoading || this.premiseEditStore.selectedLoading) {
return false;
}
- return this.premiseEditStore.getSelectedPremissesIds?.length > 0;
+ return this.premiseEditStore.someChecked;
+ },
+ showMultiselectAction() {
+ return this.selectCount > 0;
},
selectCount() {
return this.selectedPremisses?.length ?? 0;
@@ -158,14 +179,8 @@ export default {
showData() {
return this.premiseEditStore.showData;
},
- overallCheck() {
- return this.premiseEditStore.isLoading ? false : this.premiseEditStore.getPremisses?.every(p => p.selected === true) ?? false;
- },
- showMultiselectAction() {
- return this.selectCount > 0;
- },
modalCloseOnly() {
- return this.modalType === 'material' && !this.componentProps.tariffUnlocked;
+ return this.modalType === 'material' && !this.componentProps.tariffUnlocked; //TODO: check all selected.
},
showEditModal() {
return ((this.modalType ?? null) !== null);
@@ -188,10 +203,9 @@ export default {
},
watch: {
showProcessingModal(newState, _) {
- if(newState) {
+ if (newState) {
this.notificationStore.setSpinner(this.shownProcessingMessage);
- }
- else {
+ } else {
this.notificationStore.clearSpinner();
}
}
@@ -201,15 +215,25 @@ export default {
this.ids = new UrlSafeBase64().decodeIds(this.$route.params.ids);
this.premiseEditStore.loadPremissesForced(this.ids);
},
-
data() {
return {
ids: [],
+ overallCheck: false,
+ overallIndeterminate: false,
bulkQuery: null,
modalType: null,
componentsData: {
price: {props: {price: 0, overSeaShare: 0, includeFcaFee: false}},
- material: {props: {partNumber: "", hsCode: null, tariffRate: null, tariffUnlocked: false, description: "", hideDescription: false}},
+ material: {
+ props: {
+ partNumber: "",
+ hsCode: null,
+ tariffRate: null,
+ tariffUnlocked: false,
+ description: "",
+ hideDescription: false
+ }
+ },
packaging: {
props: {
length: 0,
@@ -247,27 +271,48 @@ export default {
});
}
},
- async startCalculation() {
+ async calculate() {
this.showCalculationModal = true;
const error = await this.premiseEditStore.startCalculation();
if (error === null) {
- this.closeMassEdit()
+ this.close()
}
this.showCalculationModal = false;
},
- closeMassEdit() {
+ close() {
this.$router.push({name: "calculation-list"});
},
+ updateCheckBox(data) {
+ this.premiseEditStore.setChecked(data.id, data.checked);
+ this.updateOverallCheckBox();
+ },
updateCheckBoxes(value) {
+ console.log("set all", value)
this.premiseEditStore.setAll(value);
+ this.updateOverallCheckBox();
+ },
+ updateOverallCheckBox() {
+ this.overallCheck = this.premiseEditStore.allChecked;
+
+ if (!this.overallCheck)
+ this.overallIndeterminate = this.premiseEditStore.someChecked;
},
multiselectAction(action) {
this.openModal(action, this.selectedPremisses.map(p => p.id));
},
onClickAction(data) {
- const massEdit = 0 !== this.selectCount
- this.openModal(data.action, massEdit ? this.premiseEditStore.getSelectedPremissesIds : [data.id], data.id, massEdit);
+ if (data.action === 'supplier-select') {
+ this.premiseEditStore.setBy('supplier', data.id);
+ this.updateOverallCheckBox();
+ } else if (data.action === 'material-select') {
+ this.premiseEditStore.setBy('material', data.id);
+ this.updateOverallCheckBox();
+ } else {
+ const massEdit = 0 !== this.selectCount
+ this.openModal(data.action, massEdit ? this.premiseEditStore.getSelectedPremissesIds : [data.id], data.id, massEdit);
+ }
+
},
openModal(type, ids, dataSource = -1, massEdit = true) {
@@ -383,7 +428,7 @@ export default {