This commit is contained in:
2021-04-02 15:07:43 +00:00
parent 1f368a137e
commit d4e0bcd06e
7 changed files with 102 additions and 61 deletions

View File

@@ -0,0 +1,45 @@
<template>
<div>
barebones template
</div>
</template>
<script>
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* XXXeslint-disable */
////////////////////////////////////////////////////////////////////////////////////////////////////////////
export default {
data() {
return {};
},
props: {
value: {
default: "{}",
type: String
},
formKey: { type: String, default: "" }, //used to grab template from store
readonly: Boolean,
disabled: Boolean,
parentVM: {
default: null,
type: Object
}
},
methods: {
form() {
return window.$gz.form;
},
fieldValueChanged(ref) {
if (
!this.parentVM.formState.loading &&
!this.parentVM.formState.readonly
) {
window.$gz.form.fieldValueChanged(this.parentVM, ref);
}
}
},
computed: {}
};
</script>

View File

@@ -0,0 +1,45 @@
<template>
<div>
<h1>WorkOrder header</h1>
</div>
</template>
<script>
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* XXXeslint-disable */
////////////////////////////////////////////////////////////////////////////////////////////////////////////
export default {
data() {
return {};
},
props: {
value: {
default: "{}",
type: String
},
formKey: { type: String, default: "" }, //used to grab template from store
readonly: Boolean,
disabled: Boolean,
parentVM: {
default: null,
type: Object
}
},
methods: {
form() {
return window.$gz.form;
},
fieldValueChanged(ref) {
if (
!this.parentVM.formState.loading &&
!this.parentVM.formState.readonly
) {
window.$gz.form.fieldValueChanged(this.parentVM, ref);
}
}
},
computed: {}
};
</script>

View File

@@ -4,67 +4,8 @@
<div v-if="formState.ready">
<gz-error :error-box-message="formState.errorBoxMessage"></gz-error>
<v-form ref="form">
<v-row>
organize as controls see dashboard <br />
woheader here <br />wostate control here<br />
woitems control here
<!-- --------------------------------- -->
<v-col v-if="form().showMe(this, 'Notes')" cols="12">
<v-textarea
v-model="obj.notes"
:readonly="formState.readOnly"
:label="$ay.t('WorkOrderNotes')"
:error-messages="form().serverErrors(this, 'notes')"
ref="notes"
data-cy="notes"
@input="fieldValueChanged('notes')"
auto-grow
></v-textarea>
</v-col>
<v-col v-if="form().showMe(this, 'Tags')" cols="12">
<gz-tag-picker
v-model="obj.tags"
:readonly="formState.readOnly"
ref="tags"
data-cy="tags"
:error-messages="form().serverErrors(this, 'tags')"
@input="fieldValueChanged('tags')"
></gz-tag-picker>
</v-col>
<v-col cols="12">
<gz-custom-fields
v-model="obj.customFields"
:form-key="formCustomTemplateKey"
:readonly="formState.readOnly"
:parent-v-m="this"
ref="customFields"
data-cy="customFields"
:error-messages="form().serverErrors(this, 'customFields')"
@input="fieldValueChanged('customFields')"
></gz-custom-fields>
</v-col>
<v-col v-if="form().showMe(this, 'Wiki')" cols="12">
<gz-wiki
:aya-type="ayaType"
:aya-id="obj.id"
ref="wiki"
v-model="obj.wiki"
:readonly="formState.readOnly"
@input="fieldValueChanged('wiki')"
></gz-wiki
></v-col>
<v-col v-if="form().showMe(this, 'Attachments') && obj.id" cols="12">
<gz-attachments
:readonly="formState.readOnly"
:aya-type="ayaType"
:aya-id="obj.id"
></gz-attachments
></v-col>
</v-row>
<GzWoHeader data-cy="woHeader" />
<GzWoItems data-cy="woItems" />
</v-form>
</div>
<template v-if="!formState.ready">
@@ -83,11 +24,19 @@
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
import GzWoHeader from "../components/work-order-header.vue";
import GzWoItems from "../components/work-order-items.vue";
const FORM_KEY = "workorder-edit";
const API_BASE_URL = "workorder/";
const FORM_CUSTOM_TEMPLATE_KEY = "WorkOrder"; //<-- Should always be CoreBizObject AyaType name here where possible
export default {
components: {
GzWoHeader,
GzWoItems
},
async created() {
let vm = this;