This commit is contained in:
2021-06-01 23:58:19 +00:00
parent 73d6c7c219
commit 2ddf8b9ddf
4 changed files with 80 additions and 7 deletions

View File

@@ -408,17 +408,33 @@ export default {
}
},
handleStartDateChange: function(isNew) {
const dt = this.value.items[this.activeWoItemIndex].scheduledUsers[
const dStart = this.value.items[this.activeWoItemIndex].scheduledUsers[
this.activeItemIndex
].startDate;
console.log("IsNew:", isNew);
const globalMinutes =
window.$gz.store.state.globalSettings.workLaborScheduleDefaultMinutes;
if (globalMinutes == 0) {
return;
if (isNew) {
// (ONLY IF GLOBAL DEFAULT QTY) enter start date when stop date is null then it will add global default to start and set stop and qty
// (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
// If no global default then it acts like existing and updates qty or stop date when qty changes (if there are dates to go on)
const globalMinutes =
window.$gz.store.state.globalSettings.workLaborScheduleDefaultMinutes;
if (globalMinutes == 0) {
return;
}
let d = window.$gz.locale.addMinutesToUTC8601String(dStart);
} else {
const dStop = this.value.items[this.activeWoItemIndex].scheduledUsers[
this.activeItemIndex
].stopDate;
// Existing
// update quantity when dates change or update stop date when quantity changes to match
// no consideration for global default, once it's made that shit doesn't apply
console.log(
"existing record - DIFF HOURS IS:",
window.$gz.locale.diffHoursFromUTC8601String(dStart, dStop)
);
}
let d = window.$gz.locale.addMinutesToUTC8601String(dt);
},
handleStopDateChange: function(isNew) {
let val = this.value.items[this.activeWoItemIndex].scheduledUsers[