This commit is contained in:
2021-06-11 23:53:11 +00:00
parent e72fcc879a
commit ed8fd2c4fa
3 changed files with 18 additions and 3 deletions

View File

@@ -152,6 +152,12 @@
`Items[${activeWoItemIndex}].parts[${activeItemIndex}].partId`
)
"
:rules="[
form().required(
this,
`Items[${activeWoItemIndex}].parts[${activeItemIndex}].partId`
)
]"
@input="
fieldValueChanged(
`Items[${activeWoItemIndex}].parts[${activeItemIndex}].partId`
@@ -476,7 +482,7 @@ export default {
userId: null,
description: null,
serials: null,
partId: null,
partId: 0, //deliberately zero to break rule on new
partWarehouseId: 1, //important always default to "default" warehouse id 1 as even with inventory turned off it's required
quantity: 1,
taxPartSaleId: null,
@@ -491,6 +497,15 @@ export default {
this.$emit("change");
this.selectedRow = [{ index: newIndex }];
this.activeItemIndex = newIndex;
//trigger rule breaking / validation
this.$nextTick(() => {
this.value.items[this.activeWoItemIndex].parts[
this.activeItemIndex
].partId = null;
this.fieldValueChanged(
`Items[${this.activeWoItemIndex}].parts[${this.activeItemIndex}].partId`
);
});
},
unDeleteItem() {
this.value.items[this.activeWoItemIndex].parts[

View File

@@ -280,7 +280,7 @@ export default {
customFields: "{}",
tags: [],
userId: null,
unitId: 0,
unitId: 0,//zero to break rule on new
estimatedQuantity: 0,
startDate: null,
stopDate: null,