This commit is contained in:
2021-04-29 18:36:31 +00:00
parent fa4349fc02
commit 89fabfe3fd
6 changed files with 46 additions and 8 deletions

View File

@@ -301,8 +301,6 @@ todo: cypress testing for load testing etc
then make new project folder for this and put the tests there
install standalone cypress and go it without vue stuff
todo: when fetchign a workorder it should order by woitem.sequence so that reports and things automatically get it in sequence
I think in ui it orders automatically at the ui itself in sequence but would need that for reports as well.
todo: changing scheduser estimated qty doesn't trigger dirty until move off, is it using the wrong event for update?
gz-decimal control

View File

@@ -811,8 +811,15 @@ export default {
}
//dev error on form?
if (!formControl) {
throw `gzform::fieldValueChanged formControl is not found ref:${ref}, formReferences:${formReference} `;
if (formControl == null) {
if (vm.$ay.dev) {
//not necessarily an error, can happen during form init
console.trace(
`gzform::fieldValueChanged formControl is not found ref:${ref}, formReferences:${formReference} `
);
} else {
return;
}
}
//this is currently required to ensure that this method runs after all the broken rule checks have settled

View File

@@ -3,7 +3,7 @@
<v-text-field
ref="textField"
:value="currencyValue"
@change="updateValue"
@input="updateValue"
v-currency="{
currency: currencyName,
locale: languageName
@@ -29,7 +29,8 @@ export default {
data() {
return {
currencyName: window.$gz.locale.getCurrencyName(),
languageName: window.$gz.locale.getResolvedLanguage()
languageName: window.$gz.locale.getResolvedLanguage(),
initializing: true
};
},
props: {
@@ -48,11 +49,30 @@ export default {
},
methods: {
updateValue() {
//this is required because the initial setting triggers an input event
//however the two values differ because it comes from the server in much higher precision
//and this control rounds it down
//so the first trigger must be ignored until it "settles"
if (this.initializing) {
this.initializing = false;
return;
}
let val = this.$refs.textField.$refs.input.value;
// //_value contains the actual underlying numeric value without text
// //value contains the entered text
// if (this.$refs.textField.$refs.input._value == this.value) {
// return;
// }
let parsedValue = parseCurrency(val, {
currency: this.currencyName,
locale: this.languageName
});
// //this.value on init is a very long string of digits / decimal places triggering a variance once rounded
// let parsedOldValue = parseCurrency(this.value.toString(), {
// currency: this.currencyName,
// locale: this.languageName
// });
if (parsedValue != this.value) {
this.$emit("input", parsedValue);
}

View File

@@ -3,7 +3,7 @@
<v-text-field
ref="textField"
:value="currencyValue"
@change="updateValue"
@input="updateValue"
v-currency="{
currency: null,
locale: languageName,
@@ -52,6 +52,9 @@ export default {
currency: null,
locale: this.languageName
});
if (parsedValue == this.value) {
return;
}
this.$emit("input", parsedValue);
}

View File

@@ -3,7 +3,7 @@
<v-text-field
ref="textField"
:value="currencyValue"
@change="updateValue"
@input="updateValue"
v-currency="{
currency: null,
locale: languageName,
@@ -54,6 +54,15 @@ export default {
locale: this.languageName
});
if (parsedValue == this.value) {
return;
}
// console.log("PCT CONTROL:", {
// parsedValue: parsedValue,
// value: this.value
// });
this.$emit("input", parsedValue);
}
}

View File

@@ -185,6 +185,7 @@ export default {
return window.$gz.form;
},
fieldValueChanged(ref) {
console.log("woitemscheduserform, field value changed", ref);
if (!this.formState.loading && !this.formState.readonly) {
//flag this record dirty so it gets picked up by save
this.value.items[this.activeWoItemIndex].scheduledUsers[