From 2632b6413a8c803fc492dfed72dc36968d1a105b Mon Sep 17 00:00:00 2001 From: Matteo Chini Date: Tue, 19 Nov 2024 15:05:30 +0100 Subject: [PATCH 1/3] new code for pgaziendale add user --- .../src/components/modal/specific-modals/EmployeeFormModal.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console_aziendale/src/components/modal/specific-modals/EmployeeFormModal.vue b/console_aziendale/src/components/modal/specific-modals/EmployeeFormModal.vue index dd60210..7a0c00a 100644 --- a/console_aziendale/src/components/modal/specific-modals/EmployeeFormModal.vue +++ b/console_aziendale/src/components/modal/specific-modals/EmployeeFormModal.vue @@ -82,7 +82,7 @@ v-model.trim="$v.location.$model" :items="listaSedi" :error-messages="locationErrors" - :item-text="item=>`${item.id}${item.name?(' - '+item.name):''}`" + :item-text="item=>`${item.name?(item.name + ' - '):''} codice ${item.id}`" item-value="id" required @input="$v.location.$touch()" From 175806e8ec8a9df41573806e68b17773af05aa8f Mon Sep 17 00:00:00 2001 From: Matteo Chini Date: Wed, 20 Nov 2024 09:50:55 +0100 Subject: [PATCH 2/3] fixed auto position button for location --- .../specific-modals/LocationFormModal.vue | 165 +++++++++++------- 1 file changed, 103 insertions(+), 62 deletions(-) diff --git a/console_aziendale/src/components/modal/specific-modals/LocationFormModal.vue b/console_aziendale/src/components/modal/specific-modals/LocationFormModal.vue index b49fd8f..f62af11 100644 --- a/console_aziendale/src/components/modal/specific-modals/LocationFormModal.vue +++ b/console_aziendale/src/components/modal/specific-modals/LocationFormModal.vue @@ -244,7 +244,7 @@
-

+

E’ possibile impostare la posizione della sede manualmente oppure automaticamente in base all’indirizzo inserito.

@@ -286,7 +286,7 @@
Imposta automaticamente @@ -316,7 +316,14 @@ class="m-2" >Annulla - Conferma + Conferma
@@ -422,7 +429,10 @@ v-model="location" id="locationId" :items="allLocations?.items" - :item-text="item=>`Id: ${item.id}${item.name?(' - Nome: '+item.name):''}`" + :item-text=" + (item) => + `Id: ${item.id}${item.name ? ' - Nome: ' + item.name : ''}` + " item-value="id" outlined > @@ -443,44 +453,44 @@
- - - - - Annulla - - Salva - - - -
+ + + + + Annulla + + Salva + + + +
@@ -501,7 +511,6 @@ Salva - @@ -513,11 +522,11 @@ import { locationService } from "@/services"; import GeoLocationSelectorMapVue from "@/components/leaflet-map/GeoLocationSelectorMap.vue"; import Modal from "@/components/modal/ModalStructure.vue"; import { mapActions, mapState } from "vuex"; -import Confirm from "@/components/Confirm.vue" +import Confirm from "@/components/Confirm.vue"; export default { components: { "geolocation-selector": GeoLocationSelectorMapVue, - "app-confirm":Confirm, + "app-confirm": Confirm, modal: Modal, }, @@ -593,7 +602,7 @@ export default { data() { return { - copyDate:false, + copyDate: false, popup: { title: "", }, @@ -623,6 +632,7 @@ export default { datepicker: null, menu: false, pointIsFar: false, + autoPositionLocation: null, zoom: 13, url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", attribution: @@ -653,28 +663,53 @@ export default { updateLocation: "updateLocation", getAllLocations: "getAllLocations", }), - showInfoEdit(){ - return this.addresIsValid && !this.showErrorLocation &&!this.tmpLocationSelected && !(this.typeCall == 'edit') + showInfoEdit() { + return ( + this.addresIsValid && + !this.showErrorLocation && + !this.tmpLocationSelected && + !(this.typeCall == "edit") + ); + }, + autoPositionButtonDisabled() { + console.log("autoPositionButtonDisabled", this.autoPositionLocation); + console.log("latitude", this.latitude); + console.log("longitude", this.longitude); + if ( + this.autoPositionLocation?.position && + this.autoPositionLocation?.position?.lat && + this.autoPositionLocation?.position?.lng && + this.autoPositionLocation?.position?.lat === this.latitude && + this.autoPositionLocation?.position?.lng === this.longitude + ) + return true; + return !this.addresIsValid; }, loadLocations() { if (this.actualCompany) this.getAllLocations(this.actualCompany.item.id); }, enableCopy() { - this.copyDate=true; + this.copyDate = true; }, - cancelDates(){ - this.copyDate=false; + cancelDates() { + this.copyDate = false; }, async copyDates() { - if (await this.$refs.confirm.open("Copia date", 'In caso di conferma verranno sovrascritte le date. Sei sicuro?', { color: 'primary' })) { + if ( + await this.$refs.confirm.open( + "Copia date", + "In caso di conferma verranno sovrascritte le date. Sei sicuro?", + { color: "primary" } + ) + ) { const loc = this.allLocations.items.find( - (location) => location.id == this.location - ); - if (loc && loc.nonWorkingDays) this.nonWorkingDays = loc.nonWorkingDays; - else this.nonWorkingDays = []; - } + (location) => location.id == this.location + ); + if (loc && loc.nonWorkingDays) this.nonWorkingDays = loc.nonWorkingDays; + else this.nonWorkingDays = []; + } - this.copyDate=false; + this.copyDate = false; }, addressFormIsValid() { return ( @@ -721,6 +756,7 @@ export default { }, autoPosition() { if (this.geoResults.length > 0) { + this.autoPositionLocation = null; this.$refs.geolocationSelector.onSearch({ location: this.geoResults[0] }); } }, @@ -745,13 +781,16 @@ export default { }, cancelManualPosition() { //return to previous position - this.tmpLocationSelected=null; + this.tmpLocationSelected = null; this.$refs.geolocationSelector.resetPosition(this.latitude, this.longitude); this.$refs.geolocationSelector.disableMap(); this.manualEnabling = false; - this.pointIsFar=false; + this.pointIsFar = false; }, locationChanged(input) { + console.log("input", input); + console.log("addresIsValid", this.addresIsValid); + console.log("autoPositionLocation", this.autoPositionLocation); if (this.manualEnabling) { //using tmp this.tmpLocationSelected = input?.address; @@ -764,13 +803,15 @@ export default { this.pointIsFar = false; } } else { + if (!this.autoPositionLocation) + this.autoPositionLocation = input; this.latitude = input?.position?.lat; - this.longitude = input?.position?.lng; + this.longitude = input?.position?.lng; } }, isFarFromInput(input) { if (this.zip != input?.address?.structuredValue?.postcode) return true; - return false; + return false; }, changeParamForm(structuredValue) { if (structuredValue.road) this.address = structuredValue.road; From 0b4d2f82f871a7db8ac6c14f531463eb35aecc43 Mon Sep 17 00:00:00 2001 From: Matteo Chini Date: Thu, 21 Nov 2024 16:46:46 +0100 Subject: [PATCH 3/3] fixed italy vs Italia --- .../specific-modals/CompanyFormModal.vue | 16 +++++++++----- .../specific-modals/LocationFormModal.vue | 21 ++++++++++++------- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/console_aziendale/src/components/modal/specific-modals/CompanyFormModal.vue b/console_aziendale/src/components/modal/specific-modals/CompanyFormModal.vue index 70cd123..9e2d235 100644 --- a/console_aziendale/src/components/modal/specific-modals/CompanyFormModal.vue +++ b/console_aziendale/src/components/modal/specific-modals/CompanyFormModal.vue @@ -142,7 +142,7 @@ >
- + - +