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