This commit is contained in:
2021-04-02 20:49:34 +00:00
parent b75281ef4a
commit 5ae526dbe2
3 changed files with 14 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
<template> <template>
<div> <div>
<h1>WorkOrder header</h1> <h1>WorkOrder header</h1>
<v-row> <v-row>
<v-col cols="12" sm="6" lg="4" xl="3" v-if="value.serial != 0"> <v-col cols="12" sm="6" lg="4" xl="3" v-if="value.serial != 0">
<template v-if="canEditSerial"> <template v-if="canEditSerial">

View File

@@ -2,18 +2,20 @@
<div> <div>
<h2>WorkOrder items here</h2> <h2>WorkOrder items here</h2>
items:{{ value.items }}<br /> <!-- items:{{ value.items }}<br /> -->
selected index: {{ pvm.selectedItemIndex }}
<template v-if="value.items && value.items.length > 0"> <template v-if="value.items && value.items.length > 1">
<h3>table of woitems here</h3> <h3>table of woitems here</h3>
itemcount:{{ value.items.length }} itemcount:{{ value.items.length }}
</template> </template>
<template v-if="pvm.selectedItemIndex != null"> <template v-if="pvm.selectedItemIndex != null">
selected index: {{ pvm.selectedItemIndex }}
<h4>woitemform here</h4> <h4>woitemform here</h4>
<h5 class="ml-5">woitem grandchildren here</h5> <h5 class="ml-5">woitem grandchildren here</h5>
<GzWoItemScheduledUsers data-cy="woItemScheduledUsers" /> <GzWoItemScheduledUsers data-cy="woItemScheduledUsers" />
</template> </template>
<template v-else>
<h5>select a woitem to view the form</h5>
</template>
</div> </div>
</template> </template>
<script> <script>

View File

@@ -70,7 +70,9 @@ export default {
loading: false loading: false
}); });
} else { } else {
console.log("Fetching wo");
await vm.getDataFromApi(vm.$route.params.recordid); //let getdata handle loading await vm.getDataFromApi(vm.$route.params.recordid); //let getdata handle loading
console.log("fetched wo");
} }
} else { } else {
window.$gz.form.setFormState({ window.$gz.form.setFormState({
@@ -85,8 +87,11 @@ export default {
}); });
generateMenu(vm); generateMenu(vm);
if (vm.obj.items.count > 0) { console.log("about to select index, vm.obj is", vm.obj);
selectedItemIndex = 0; if (vm.obj.items.length > 0) {
vm.selectedItemIndex = 0;
} else {
vm.selectedItemIndex = null;
} }
} catch (error) { } catch (error) {
window.$gz.errorHandler.handleFormError(error, vm); window.$gz.errorHandler.handleFormError(error, vm);