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

@@ -399,7 +399,7 @@ bugubg: completely fresh workorder riddled with errors when attempting to create
at AyaNova.Biz.WorkOrderBiz.TravelCreateAsync(WorkOrderItemTravel newObject) in C:\data\code\raven\server\AyaNova\biz\WorkOrderBiz.cs:line 4930
at AyaNova.Api.Controllers.WorkOrderController.PostWorkOrderItemTravel(WorkOrderItemTravel newObject, ApiVersion apiVersion) in C:\data\code\raven\server\AyaNova\Controllers\WorkOrderController.cs:line 1317
tasks -> task field required but doesn't show required in UI
parts -> quantity required but doesn't show that in UI (no rule)
labor -> error at server:
2021-06-11 11:45:46.3095|ERROR|SERVER|Error=>System.NullReferenceException: Object reference not set to an instance of an object.

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,