diff --git a/ayanova/src/components/work-order-item-tasks.vue b/ayanova/src/components/work-order-item-tasks.vue index ccaa6fbb..7eac2b6d 100644 --- a/ayanova/src/components/work-order-item-tasks.vue +++ b/ayanova/src/components/work-order-item-tasks.vue @@ -161,6 +161,7 @@ ${activeItemIndex} ].status`) " + @change="statusChange" > @@ -314,10 +315,23 @@ export default { this.activeItemIndex ].completedByUserViz = newName; }, - statusChange(newName) { + statusChange(newStatusId) { this.value.items[this.activeWoItemIndex].tasks[ this.activeItemIndex - ].statusViz = newName; + ].statusViz = this.pvm.selectLists.woItemTaskCompletionTypes.find( + s => s.id == newStatusId + ).name; + + //completed date auto set by status change if not a todo + if (newStatusId != 1) { + this.value.items[this.activeWoItemIndex].tasks[ + this.activeItemIndex + ].completedDate = window.$gz.locale.nowUTC8601String(); + } else { + this.value.items[this.activeWoItemIndex].tasks[ + this.activeItemIndex + ].completedDate = null; + } }, newItem() { let newIndex = this.value.items[this.activeWoItemIndex].tasks.length;