diff --git a/ayanova/src/components/work-order-item-parts.vue b/ayanova/src/components/work-order-item-parts.vue index aad66690..bd2eedd1 100644 --- a/ayanova/src/components/work-order-item-parts.vue +++ b/ayanova/src/components/work-order-item-parts.vue @@ -520,14 +520,20 @@ export default { this.activeItemIndex ]; this.$router.push({ - name: "svc-units", + name: "unit-edit", params: { recordid: 0, genFromPart: { customerId: this.value.customerId, partId: thisPart.partId, purchaseDate: this.value.serviceDate, - serial: thisPart.serials + serial: thisPart.serials, + address: this.value.address, + city: this.value.city, + region: this.value.region, + country: this.value.country, + latitude: this.value.latitude, + longitude: this.value.longitude } } }); diff --git a/ayanova/src/views/svc-unit.vue b/ayanova/src/views/svc-unit.vue index 39ea8d67..1e5664bd 100644 --- a/ayanova/src/views/svc-unit.vue +++ b/ayanova/src/views/svc-unit.vue @@ -768,7 +768,13 @@ export default { customerId: this.value.customerId, partId: thisPart.partId, purchaseDate: this.value.serviceDate, - serial: thisPart.serials + serial: thisPart.serials, + address: this.value.address, + city: this.value.city, + region: this.value.region, + country: this.value.country, + latitude: this.value.latitude, + longitude: this.value.longitude } /* @@ -792,7 +798,27 @@ export default { this.obj.customerId = gen.customerId; this.obj.serial = gen.serial; this.obj.purchasedDate = gen.purchaseDate; - this.obj.description = p.partNumber + " " + p.name; + this.obj.description = p.partNumber; + if ( + gen.address || + gen.city || + gen.region || + gen.country || + gen.latitude || + gen.longitude + ) { + this.obj.unitHasOwnAddress = true; + this.obj.address = gen.address ?? null; + this.obj.city = gen.city ?? null; + this.obj.region = gen.region ?? null; + this.obj.country = gen.country ?? null; + this.obj.latitude = gen.latitude ?? null; + this.obj.longitude = gen.longitude ?? null; + } + + if (p.name) { + this.obj.description += ` ${p.name}`; + } } setDirty = true; }