This commit is contained in:
2021-06-01 23:24:47 +00:00
parent 6cf679adaf
commit 73d6c7c219

View File

@@ -390,39 +390,43 @@ export default {
this.activeItemIndex
].isDirty = true;
window.$gz.form.fieldValueChanged(this.pvm, ref);
const isNew =
this.value.items[this.activeWoItemIndex].scheduledUsers[
this.activeItemIndex
].id == 0;
//Auto calculate dates / quantities / global defaults
if (ref.includes("startDate")) {
this.handleStartDateChange();
this.handleStartDateChange(isNew);
}
if (ref.includes("stopDate")) {
this.handleStopDateChange();
this.handleStopDateChange(isNew);
}
if (ref.includes("estimatedQuantity")) {
this.handleEstimatedQuantityChange();
this.handleEstimatedQuantityChange(isNew);
}
}
},
handleStartDateChange: function() {
let val = this.value.items[this.activeWoItemIndex].scheduledUsers[
handleStartDateChange: function(isNew) {
const dt = this.value.items[this.activeWoItemIndex].scheduledUsers[
this.activeItemIndex
].startDate;
console.log("Start date value is now", val);
let d = window.$gz.locale.addMinutesToUTC8601String(
val,
window.$gz.store.state.globalSettings.workLaborScheduleDefaultMinutes
);
console.log("start plus global default labor minutes is:", d);
console.log("IsNew:", isNew);
const globalMinutes =
window.$gz.store.state.globalSettings.workLaborScheduleDefaultMinutes;
if (globalMinutes == 0) {
return;
}
let d = window.$gz.locale.addMinutesToUTC8601String(dt);
},
handleStopDateChange: function() {
handleStopDateChange: function(isNew) {
let val = this.value.items[this.activeWoItemIndex].scheduledUsers[
this.activeItemIndex
].stopDate;
console.log("Stop date value is now", val);
},
handleEstimatedQuantityChange: function() {
handleEstimatedQuantityChange: function(isNew) {
let val = this.value.items[this.activeWoItemIndex].scheduledUsers[
this.activeItemIndex
].estimatedQuantity;