This commit is contained in:
@@ -47,17 +47,9 @@ function isNumber(n) {
|
||||
// Get control from ref
|
||||
//
|
||||
function getControl(vm, ref) {
|
||||
//NOTE: Due to automatic code formatting some refs will come here with newlines in them resulting in no matches
|
||||
ref = ref.replace(/\s/g, "");
|
||||
let ctrl = vm.$refs[ref];
|
||||
|
||||
//I don't think this is required anymore
|
||||
// if (ctrl === undefined) {
|
||||
// //it's either a sub field in custom fields component or it's a coding error
|
||||
// let customFields = vm.$refs["customFields"];
|
||||
// if (customFields !== undefined) {
|
||||
// ctrl = customFields.$refs[ref];
|
||||
// }
|
||||
// }
|
||||
|
||||
return ctrl;
|
||||
}
|
||||
|
||||
@@ -807,6 +799,8 @@ export default {
|
||||
if (formReference == undefined) {
|
||||
formControl = vm.$refs.form;
|
||||
} else {
|
||||
//NOTE: Due to automatic code formatting some refs will come here with newlines in them resulting in no matches
|
||||
formReference = formReference.replace(/\s/g, "");
|
||||
formControl = vm.$refs[formReference];
|
||||
}
|
||||
|
||||
@@ -1006,6 +1000,8 @@ export default {
|
||||
// Get validity of referenced control
|
||||
//
|
||||
controlIsValid(vm, ref) {
|
||||
//NOTE: Due to automatic code formatting some refs will come here with newlines in them resulting in no matches
|
||||
ref = ref.replace(/\s/g, "");
|
||||
if (vm.$refs[ref]) {
|
||||
return vm.$refs[ref].valid;
|
||||
}
|
||||
|
||||
@@ -90,6 +90,14 @@
|
||||
`Items[${activeWoItemIndex}].units[${activeItemIndex}].unitId`
|
||||
"
|
||||
data-cy="units.unitId"
|
||||
:rules="[
|
||||
form().required(
|
||||
this,
|
||||
`Items[${activeWoItemIndex}].units[
|
||||
${activeItemIndex}
|
||||
].unitId`
|
||||
)
|
||||
]"
|
||||
:error-messages="
|
||||
form().serverErrors(
|
||||
this,
|
||||
|
||||
@@ -789,6 +789,8 @@ export default {
|
||||
this.$emit("change");
|
||||
this.selectedRow = [{ index: newIndex }];
|
||||
this.activeItemIndex = newIndex;
|
||||
//trigger rule breaking / validation
|
||||
this.fieldValueChanged(`items[${this.activeItemIndex}].notes`);
|
||||
},
|
||||
unDeleteItem() {
|
||||
this.value.items[this.activeItemIndex].deleted = false;
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
data-cy="woHeader"
|
||||
@change="setDirty()"
|
||||
/>
|
||||
{{ formState }}
|
||||
<GzWoItems
|
||||
v-model="obj"
|
||||
:form-key="formCustomTemplateKey"
|
||||
@@ -349,7 +350,12 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
setDirty: function() {
|
||||
//console.log("WO HEADER SET DIRTY!! TRIGGERED");
|
||||
this.formState.dirty = true;
|
||||
// window.$gz.form.setFormState({
|
||||
// vm: this,
|
||||
// dirty: true
|
||||
// });
|
||||
},
|
||||
canSave: function() {
|
||||
return this.formState.valid && this.formState.dirty;
|
||||
|
||||
Reference in New Issue
Block a user