From 17cae92902eed4eb12f6da2dafc7cdf2d82ff1b9 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 9 Jul 2021 00:17:59 +0000 Subject: [PATCH] --- .../src/components/work-order-item-parts.vue | 10 +++++-- ayanova/src/views/svc-unit.vue | 30 +++++++++++++++++-- 2 files changed, 36 insertions(+), 4 deletions(-) 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; }