Added proper zIP hendlování PSČ.

This commit is contained in:
Greenscreener 2021-01-23 11:00:21 +01:00
parent a64aa74b3c
commit 0127acb915

View File

@ -294,11 +294,13 @@ export default {
watch: { watch: {
selected:{ selected:{
handler(newVal) { handler(newVal) {
const addressFields = newVal.fulladdress.split(", ");
this.zaloba.soud.nazev = newVal.name || "" this.zaloba.soud.nazev = newVal.name || ""
this.zaloba.soud.sidlo.uliceacislopopisne = newVal.address.split(", ")[0]|| "" this.zaloba.soud.sidlo.uliceacislopopisne = addressFields[0]|| ""
this.zaloba.soud.sidlo.mesto = newVal.address.split(", ")[1] || "" this.zaloba.soud.sidlo.mesto = addressFields[addressFields.length-2].split(" ").slice(2).join(" ") || ""
this.zaloba.soud.sidlo.psc = "" this.zaloba.soud.sidlo.psc = addressFields[addressFields.length-2].split(" ").slice(0,2).join(" ") || ""
this.zaloba.soud.sidlo.stat = "Česká republika" this.zaloba.soud.sidlo.stat = addressFields[addressFields.length-1] || ""
}, },
deep: true deep: true
} }
@ -369,4 +371,4 @@ export default {
}, },
} }
</script> </script>