This commit is contained in:
2021-06-02 14:23:35 +00:00
parent d9ca665c2a
commit 559cfbac03

View File

@@ -445,6 +445,34 @@ export default {
},
handleStopDateChange: function(isNew, dStart, dStop) {
// (ONLY IF GLOBAL DEFAULT QTY) enter stop date when start date is null then it will back calc and set start and qty based on global default
const globalMinutes =
window.$gz.store.state.globalSettings.workLaborScheduleDefaultMinutes;
if (isNew && dStart == null) {
if (globalMinutes != 0) {
//set start date based on stop date and global minutes
this.value.items[this.activeWoItemIndex].scheduledUsers[
this.activeItemIndex
].startDate = window.$gz.locale.addMinutesToUTC8601String(
dStop,
0 - globalMinutes
);
this.value.items[this.activeWoItemIndex].scheduledUsers[
this.activeItemIndex
].estimatedQuantity = globalMinutes;
}
} else {
//Existing record or both dates filled, just update quantity
if (dStart != null) {
this.value.items[this.activeWoItemIndex].scheduledUsers[
this.activeItemIndex
].estimatedQuantity = window.$gz.locale.diffHoursFromUTC8601String(
dStart,
dStop
);
}
}
},
handleEstimatedQuantityChange: function(isNew, dStart, dStop) {
let val = this.value.items[this.activeWoItemIndex].scheduledUsers[