This commit is contained in:
2021-05-05 20:13:48 +00:00
parent d40c16cdd9
commit a9f4299a06

View File

@@ -469,8 +469,11 @@ and it's probably not a big list to fill anyway
return headers; return headers;
}, },
itemList: function() { itemList: function() {
const vm = this;
return this.value.items return this.value.items
.map((x, i) => { .map((x, i) => {
const stat = statusViz(x.workorderItemStatusId, this);
const prior = priorityViz(x.workorderItemPriorityId, this);
return { return {
index: i, index: i,
id: x.id, id: x.id,
@@ -480,14 +483,14 @@ and it's probably not a big list to fill anyway
x.quantityReceived, x.quantityReceived,
this.pvm.languageName this.pvm.languageName
), ),
status: x.workorderItemStatusId, //todo: get real status name etc here use status: stat.name,
requestDate: window.$gz.locale.utcDateToShortDateAndTimeLocalized( requestDate: window.$gz.locale.utcDateToShortDateAndTimeLocalized(
x.requestDate, x.requestDate,
this.pvm.timeZoneName, this.pvm.timeZoneName,
this.pvm.languageName, this.pvm.languageName,
this.pvm.hour12 this.pvm.hour12
), ),
priority: x.workorderItemPriorityId, //todo: get actual priority, color etc here priority: prior.name,
warranty: x.warrantyService, warranty: x.warrantyService,
tags: x.tags 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; return s.active == true || s.id == selectedId;
}); });
}, },
formState: function() { formState: function() {
return this.pvm.formState; 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);
}
</script> </script>