From 28915406a5145d053af175c621250c1f15a1aeb6 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 7 Jul 2021 15:44:19 +0000 Subject: [PATCH] --- ayanova/src/views/svc-workorder.vue | 131 ++-------------------------- 1 file changed, 5 insertions(+), 126 deletions(-) diff --git a/ayanova/src/views/svc-workorder.vue b/ayanova/src/views/svc-workorder.vue index 624b443f..e70560d4 100644 --- a/ayanova/src/views/svc-workorder.vue +++ b/ayanova/src/views/svc-workorder.vue @@ -92,75 +92,6 @@ export default { vm.obj.items.push(wi); setDirty = true; } - // if (cp) { - // cp.id = 0; - // cp.concurrency = 0; - // cp.uid = Date.now(); - // cp.workOrderId = this.obj.id; - // cp.isDirty = true; - // cp.sequence = this.obj.items.length + 1; - // cp.expenses.forEach(x => { - // x.id = 0; - // x.workOrderItemId = 0; - // x.concurrency = undefined; - // x.isDirty = true; - // }); - // cp.labors.forEach(x => { - // x.id = 0; - // x.workOrderItemId = 0; - // x.concurrency = undefined; - // x.isDirty = true; - // }); - // cp.loans.forEach(x => { - // x.id = 0; - // x.workOrderItemId = 0; - // x.concurrency = undefined; - // x.isDirty = true; - // x.cost = 0; - // x.listPrice = 0; - // }); - // cp.parts.forEach(x => { - // x.id = 0; - // x.workOrderItemId = 0; - // x.concurrency = undefined; - // x.isDirty = true; - // x.cost = 0; - // x.listPrice = 0; - // }); - - // cp.scheduledUsers.forEach(x => { - // x.id = 0; - // x.workOrderItemId = 0; - // x.concurrency = undefined; - // x.isDirty = true; - // }); - // cp.tasks.forEach(x => { - // x.id = 0; - // x.workOrderItemId = 0; - // x.concurrency = undefined; - // x.isDirty = true; - // }); - // cp.travels.forEach(x => { - // x.id = 0; - // x.workOrderItemId = 0; - // x.concurrency = undefined; - // x.isDirty = true; - // }); - // cp.units.forEach(x => { - // x.id = 0; - // x.workOrderItemId = 0; - // x.concurrency = undefined; - // x.isDirty = true; - // }); - // cp.outsideServices.forEach(x => { - // x.id = 0; - // x.workOrderItemId = 0; - // x.concurrency = undefined; - // x.isDirty = true; - // }); - // vm.obj.items.push(cp); - // setDirty = true; - // } } } else { //new path @@ -172,63 +103,8 @@ export default { this.obj.serial = 0; this.obj.isDirty = true; vm.obj.items.forEach(z => { - z.id = 0; - z.concurrency = undefined; z.workOrderId = 0; - z.isDirty = true; - if (z.partRequests) { - z.partRequests.splice(0); - } - z.expenses.forEach(x => { - x.id = 0; - x.concurrency = undefined; - x.isDirty = true; - }); - z.labors.forEach(x => { - x.id = 0; - x.concurrency = undefined; - x.isDirty = true; - }); - z.loans.forEach(x => { - x.id = 0; - x.concurrency = undefined; - x.isDirty = true; - x.cost = 0; - x.listPrice = 0; - }); - z.parts.forEach(x => { - x.id = 0; - x.concurrency = undefined; - x.isDirty = true; - x.cost = 0; - x.listPrice = 0; - }); - - z.scheduledUsers.forEach(x => { - x.id = 0; - x.concurrency = undefined; - x.isDirty = true; - }); - z.tasks.forEach(x => { - x.id = 0; - x.concurrency = undefined; - x.isDirty = true; - }); - z.travels.forEach(x => { - x.id = 0; - x.concurrency = undefined; - x.isDirty = true; - }); - z.units.forEach(x => { - x.id = 0; - x.concurrency = undefined; - x.isDirty = true; - }); - z.outsideServices.forEach(x => { - x.id = 0; - x.concurrency = undefined; - x.isDirty = true; - }); + washWorkOrderItem(z); }); setDirty = true; } else { @@ -2000,12 +1876,15 @@ function generateMenu(vm) { // savable as a new record // (used by duplicate and copy wo item functions) // -function washWorkOrderItem(wi, vm) { +function washWorkOrderItem(wi) { if (wi) { wi.id = 0; wi.concurrency = 0; wi.uid = Date.now(); wi.isDirty = true; + if (wi.partRequests) { + wi.partRequests.splice(0); + } wi.expenses.forEach(x => { x.id = 0; x.workOrderItemId = 0;