This commit is contained in:
2020-11-20 19:43:53 +00:00
parent d62b071595
commit c65af91492

View File

@@ -424,12 +424,18 @@
</v-btn> </v-btn>
</template> </template>
<v-list> <v-list>
<v-list-item> <v-list-item @click="AddressCopyToPostal">
<v-list-item-icon>
<v-icon>$ayiClone</v-icon>
</v-list-item-icon>
<v-list-item-title>{{ <v-list-item-title>{{
$ay.t("AddressCopyToPostal") $ay.t("AddressCopyToPostal")
}}</v-list-item-title> }}</v-list-item-title>
</v-list-item> </v-list-item>
<v-list-item> <v-list-item @click="GeoCapture">
<v-list-item-icon>
<v-icon>$ayiMapMarker</v-icon>
</v-list-item-icon>
<v-list-item-title>{{ <v-list-item-title>{{
$ay.t("GeoCapture") $ay.t("GeoCapture")
}}</v-list-item-title> }}</v-list-item-title>
@@ -1192,6 +1198,33 @@ export default {
}); });
window.$gz.errorHandler.handleFormError(error, vm); window.$gz.errorHandler.handleFormError(error, vm);
} }
},
AddressCopyToPostal() {
let vm = this;
vm.obj.postAddress = vm.obj.address;
vm.obj.postCity = vm.obj.city;
vm.obj.postRegion = vm.obj.region;
vm.obj.postCountry = vm.obj.country;
},
AddressCopyToPhysical() {
let vm = this;
vm.obj.address = vm.obj.postAddress;
vm.obj.city = vm.obj.postCity;
vm.obj.region = vm.obj.postRegion;
vm.obj.country = vm.obj.postCountry;
},
async GeoCapture() {
let vm = this;
try {
window.$gz.form.deleteAllErrorBoxErrors(vm);
let loc = await window.$gz.util.getGeoLocation();
vm.obj.latitude = loc.latitude;
vm.fieldValueChanged("latitude");
vm.obj.longitude = loc.longitude;
vm.fieldValueChanged("longitude");
} catch (ex) {
window.$gz.errorHandler.handleFormError(ex, vm);
}
} }
//end methods //end methods
@@ -1253,19 +1286,7 @@ async function clickHandler(menuItem) {
}); });
} }
break; break;
case "geocapture":
try {
window.$gz.form.deleteAllErrorBoxErrors(m.vm);
let loc = await window.$gz.util.getGeoLocation();
m.vm.obj.latitude = loc.latitude;
m.vm.fieldValueChanged("latitude");
m.vm.obj.longitude = loc.longitude;
m.vm.fieldValueChanged("longitude");
} catch (ex) {
window.$gz.errorHandler.handleFormError(ex, m.vm);
}
break;
case "geoview": case "geoview":
window.$gz.util.viewGeoLocation({ window.$gz.util.viewGeoLocation({
latitude: m.vm.obj.latitude, latitude: m.vm.obj.latitude,
@@ -1277,18 +1298,6 @@ async function clickHandler(menuItem) {
postCode: m.vm.obj.postCode postCode: m.vm.obj.postCode
}); });
break; break;
case "addresscopytopostal":
m.vm.obj.postAddress = m.vm.obj.address;
m.vm.obj.postCity = m.vm.obj.city;
m.vm.obj.postRegion = m.vm.obj.region;
m.vm.obj.postCountry = m.vm.obj.country;
break;
case "addresscopytophysical":
m.vm.obj.address = m.vm.obj.postAddress;
m.vm.obj.city = m.vm.obj.postCity;
m.vm.obj.region = m.vm.obj.postRegion;
m.vm.obj.country = m.vm.obj.postCountry;
break;
default: default:
window.$gz.eventBus.$emit( window.$gz.eventBus.$emit(
"notify-warning", "notify-warning",
@@ -1372,29 +1381,29 @@ function generateMenu(vm) {
vm: vm vm: vm
}); });
menuOptions.menuItems.push({ // menuOptions.menuItems.push({
title: "AddressCopyToPostal", // title: "AddressCopyToPostal",
icon: null, // icon: null,
key: FORM_KEY + ":addresscopytopostal", // key: FORM_KEY + ":addresscopytopostal",
vm: vm // vm: vm
}); // });
menuOptions.menuItems.push({ // menuOptions.menuItems.push({
title: "AddressCopyToPhysical", // title: "AddressCopyToPhysical",
icon: null, // icon: null,
key: FORM_KEY + ":addresscopytophysical", // key: FORM_KEY + ":addresscopytophysical",
vm: vm // vm: vm
}); // });
if (navigator.geolocation) { // if (navigator.geolocation) {
// geolocation is available // // geolocation is available
menuOptions.menuItems.push({ // menuOptions.menuItems.push({
title: "GeoCapture", // title: "GeoCapture",
icon: "$ayiMapMarker", // icon: "$ayiMapMarker",
key: FORM_KEY + ":geocapture", // key: FORM_KEY + ":geocapture",
vm: vm // vm: vm
}); // });
} // }
} }
menuOptions.menuItems.push({ menuOptions.menuItems.push({