This commit is contained in:
2021-04-09 17:14:53 +00:00
parent efe1b2bf2b
commit a1feb78c13
4 changed files with 40 additions and 64 deletions

View File

@@ -10,6 +10,7 @@
:readonly="formState.readOnly"
:pvm="this"
data-cy="woHeader"
@change="setDirty()"
/>
<GzWoItems
v-model="obj"
@@ -17,6 +18,7 @@
:readonly="formState.readOnly"
:pvm="this"
data-cy="woItems"
@change="setDirty()"
/>
</v-form>
</div>
@@ -311,15 +313,6 @@ export default {
}
},
computed: {
hasSelectedWoItem: function() {
if (this.selectedItemIndex != null) {
return true;
}
return false;
},
woItemCount: function() {
return this.obj.items.length;
},
hasSelectedScheduledUserItem: function() {
if (
this.hasSelectedWoItem &&
@@ -362,25 +355,9 @@ export default {
}
},
methods: {
selectItem: function(itemIndex) {
if (itemIndex == this.selectedItemIndex) {
return;
}
if (itemIndex == null) {
//if there is only one then it should be selected otherwise null is ok for a bunch
if (this.woItemCount == 1) {
itemIndex = 0;
}
}
this.selectedItemIndex = itemIndex;
//reset all children
this.selectedScheduledUserItemIndex = null;
//todo: all children here
//this.selectedLaborIndex...blahblah etc
},
deleteItem: function(itemIndex) {
if (itemIndex == null) {
itemIndex = this.selectedItemIndex;
throw new Error("svc-workorder: delete item itemIndex is null!");
}
//add to deleted items if has concurrency / id
let o = this.obj.items[itemIndex];