From 1100bc3151ee31acb4f84fcbd1ca938c0ac2558a Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 6 Jul 2021 23:58:02 +0000 Subject: [PATCH] --- ayanova/src/components/work-order-items.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ayanova/src/components/work-order-items.vue b/ayanova/src/components/work-order-items.vue index ab6124da..673f4f54 100644 --- a/ayanova/src/components/work-order-items.vue +++ b/ayanova/src/components/work-order-items.vue @@ -879,10 +879,20 @@ export default { User is left with a existing wo opened, a new woitem added and the wo is dirty and ready to save */ + console.log("COPY ITEM TO WO CALLED"); if (!this.copyItemWoNumber) { return; } + + console.log("dirty?", this.value.formState); + + if (this.value.formState.dirty) { + if ((await window.$gz.dialog.confirmLeaveUnsaved()) !== true) { + return; + } + } + //get id from number then push open let res = await window.$gz.api.get( "workorder/id-from-number/" + this.copyItemWoNumber