From a9f4299a06a87de2c754e77f5e503bc1262ec4c0 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 5 May 2021 20:13:48 +0000 Subject: [PATCH] --- ayanova/src/components/work-order-items.vue | 37 +++++++++++++++++---- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/ayanova/src/components/work-order-items.vue b/ayanova/src/components/work-order-items.vue index 75016879..4f6c7aea 100644 --- a/ayanova/src/components/work-order-items.vue +++ b/ayanova/src/components/work-order-items.vue @@ -469,8 +469,11 @@ and it's probably not a big list to fill anyway return headers; }, itemList: function() { + const vm = this; return this.value.items .map((x, i) => { + const stat = statusViz(x.workorderItemStatusId, this); + const prior = priorityViz(x.workorderItemPriorityId, this); return { index: i, id: x.id, @@ -480,14 +483,14 @@ and it's probably not a big list to fill anyway x.quantityReceived, this.pvm.languageName ), - status: x.workorderItemStatusId, //todo: get real status name etc here use + status: stat.name, requestDate: window.$gz.locale.utcDateToShortDateAndTimeLocalized( x.requestDate, this.pvm.timeZoneName, this.pvm.languageName, this.pvm.hour12 ), - priority: x.workorderItemPriorityId, //todo: get actual priority, color etc here + priority: prior.name, warranty: x.warrantyService, tags: x.tags }; @@ -508,6 +511,7 @@ and it's probably not a big list to fill anyway return s.active == true || s.id == selectedId; }); }, + formState: function() { return this.pvm.formState; }, @@ -533,9 +537,30 @@ and it's probably not a big list to fill anyway ); } } - - //TODO: Function status name from woitemstatusid - //and priority same - //this.pvm.pickLists.woItemStatus.find(x=>x.id==x.workorderItemStatusId) }; +//TODO: Function status name from woitemstatusid +//and priority same +//this.pvm.pickLists.woItemStatus.find(x=>x.id==x.workorderItemStatusId) + +////////////////////// +// +// +function statusViz(id, vm) { + if (id == null) { + return { name: null, color: null }; + } + + return vm.pvm.selectLists.woItemStatus.find(s => s.id == id); +} + +////////////////////// +// +// +function priorityViz(id, vm) { + if (id == null) { + return { name: null, color: null }; + } + + return vm.pvm.selectLists.woItemPriorities.find(s => s.id == id); +}