This commit is contained in:
2021-04-02 23:36:20 +00:00
parent b2b5e9ce7b
commit 1c58bc5b8d
3 changed files with 34 additions and 20 deletions

View File

@@ -1,6 +1,9 @@
<template>
<div>
<h5 class="ml-12">WorkOrderItemScheduledUsers here</h5>
<div v-if="pvm != null">
<h5 class="ml-12">WorkOrderItemScheduledUsers</h5>
<div v-if="pvm.hasSelectedWoItem">
{{ value.items[pvm.selectedItemIndex].scheduledUsers }}
</div>
</div>
</template>
<script>
@@ -15,13 +18,10 @@ export default {
props: {
value: {
default: "{}",
type: String
default: null,
type: Object
},
formKey: { type: String, default: "" }, //used to grab template from store
readonly: Boolean,
disabled: Boolean,
parentVM: {
pvm: {
default: null,
type: Object
}
@@ -32,14 +32,18 @@ export default {
return window.$gz.form;
},
fieldValueChanged(ref) {
if (
!this.parentVM.formState.loading &&
!this.parentVM.formState.readonly
) {
window.$gz.form.fieldValueChanged(this.parentVM, ref);
if (!this.formState.loading && !this.formState.readonly) {
window.$gz.form.fieldValueChanged(this.pvm, ref);
}
}
},
computed: {}
computed: {
formState: function() {
return this.pvm.formState;
},
formCustomTemplateKey: function() {
return this.pvm.formCustomTemplateKey;
}
}
};
</script>

View File

@@ -1,6 +1,6 @@
<template>
<div>
<h2>WorkOrder items here</h2>
<div v-if="pvm != null">
<h2>WorkOrder items</h2>
<!-- items:{{ value.items }}<br /> -->
<span class="text-caption"
@@ -10,10 +10,12 @@
<h3>table of woitems here</h3>
itemcount:{{ value.items.length }}
</template>
<template v-if="pvm.selectedItemIndex != null">
<h4>woitemform here</h4>
<h5 class="ml-5">woitem grandchildren here</h5>
<GzWoItemScheduledUsers data-cy="woItemScheduledUsers" />
<template v-if="pvm.hasSelectedWoItem">
<GzWoItemScheduledUsers
v-model="value"
:pvm="pvm"
data-cy="woItemScheduledUsers"
/>
</template>
<template v-else>
<h5>select a woitem to view the form</h5>

View File

@@ -220,6 +220,14 @@ export default {
deep: true
}
},
computed: {
hasSelectedWoItem: function() {
if (this.selectedItemIndex != null) {
return true;
}
return false;
}
},
methods: {
canSave: function() {
return this.formState.valid && this.formState.dirty;