This commit is contained in:
2021-05-07 18:33:04 +00:00
parent ea9ba291ae
commit 5203dd1c23
3 changed files with 14 additions and 21 deletions

View File

@@ -312,7 +312,9 @@ todo: Test hiding woitem custom wiki attach
test updating and displaying with also header ones test updating and displaying with also header ones
todo: test the shit out of failures to save and ensure errors occur and as much as can be saved is saved todo: test the shit out of failures to save and ensure errors occur and as much as can be saved is saved
OVERALL OVERALL
- then full in front end and flow out to back end as required, remove any backend that was a defunct evolutionary path so no cruft left around - then full in front end and flow out to back end as required, remove any backend that was a defunct evolutionary path so no cruft left around

View File

@@ -31,6 +31,7 @@ function isInt(value) {
return false; return false;
} }
x = parseFloat(value); x = parseFloat(value);
// console.log("isInt:", x);
return (x | 0) === x; return (x | 0) === x;
} }
@@ -47,7 +48,7 @@ function isNumber(n) {
// //
function getControl(vm, ref) { function getControl(vm, ref) {
let ctrl = vm.$refs[ref]; let ctrl = vm.$refs[ref];
console.log("getcontrol refs are", vm.$refs);
//I don't think this is required anymore //I don't think this is required anymore
// if (ctrl === undefined) { // if (ctrl === undefined) {
// //it's either a sub field in custom fields component or it's a coding error // //it's either a sub field in custom fields component or it's a coding error
@@ -146,16 +147,9 @@ export default {
if (vm.formState.loading) { if (vm.formState.loading) {
return true; return true;
} }
console.log("form-Required ref is:", ref); //Items[0].Notes
// if (ref.includes(".")) {
// let xxx = ref.split(".");
// console.log("split ref=", xxx);
// ref = `${xxx[xxx.length - 2]}.${xxx[xxx.length - 1]}`;
// }
// console.log("actual ref is ", ref);
let ctrl = getControl(vm, ref); let ctrl = getControl(vm, ref);
if (typeof ctrl == "undefined") { if (typeof ctrl == "undefined") {
console.log("not found");
return true; return true;
} }
@@ -164,8 +158,6 @@ export default {
return true; return true;
} }
console.log("HERE");
// "ErrorRequiredFieldEmpty": "{0} is a required field. Please enter a value for {0}", // "ErrorRequiredFieldEmpty": "{0} is a required field. Please enter a value for {0}",
let err = vm.$ay.t("ErrorRequiredFieldEmpty"); let err = vm.$ay.t("ErrorRequiredFieldEmpty");
let fieldName = getControlLabel(ctrl); let fieldName = getControlLabel(ctrl);
@@ -317,13 +309,14 @@ export default {
return true; return true;
} }
//DEBUG
//logControl("integerValid", ctrl, ref);
let value = getControlValue(ctrl); let value = getControlValue(ctrl);
if (isEmpty(value)) {
return true; //this block doesn't work and shouldn't be here afaict
} //if you type a letter for example it presents as empty, I guess because it's set to a numeric input type
//in any case, empty isn't a valid integer so it should show as a broken rule when a letter or empty is entered
// if (isEmpty(value)) {
// return true;
// }
if (isInt(value)) { if (isInt(value)) {
return true; return true;

View File

@@ -88,8 +88,6 @@
v-if="form().showMe(this, 'Items.WorkOrderItemSummary')" v-if="form().showMe(this, 'Items.WorkOrderItemSummary')"
cols="12" cols="12"
> >
servererrors:
{{ form().serverErrors(this, `items[${activeItemIndex}].notes`) }}
<v-textarea <v-textarea
v-model="value.items[activeItemIndex].notes" v-model="value.items[activeItemIndex].notes"
:readonly="formState.readOnly" :readonly="formState.readOnly"
@@ -125,7 +123,7 @@
:error-messages=" :error-messages="
form().serverErrors(this, `items[${activeItemIndex}].sequence`) form().serverErrors(this, `items[${activeItemIndex}].sequence`)
" "
@input="fieldValueChanged('sequence')" @input="fieldValueChanged(`items[${activeItemIndex}].sequence`)"
type="number" type="number"
></v-text-field> ></v-text-field>
</v-col> </v-col>