This commit is contained in:
2021-04-02 19:17:17 +00:00
parent aecaed01f7
commit 82d912d7c9
3 changed files with 243 additions and 43 deletions

View File

@@ -4,8 +4,20 @@
<div v-if="formState.ready">
<gz-error :error-box-message="formState.errorBoxMessage"></gz-error>
<v-form ref="form">
<GzWoHeader data-cy="woHeader" />
<GzWoItems data-cy="woItems" />
<GzWoHeader
v-model="obj"
:form-key="formCustomTemplateKey"
:readonly="formState.readOnly"
:pvm="this"
data-cy="woHeader"
/>
<GzWoItems
v-model="obj"
:form-key="formCustomTemplateKey"
:readonly="formState.readOnly"
:pvm="this"
data-cy="woItems"
/>
</v-form>
</div>
<template v-if="!formState.ready">
@@ -73,6 +85,9 @@ export default {
});
generateMenu(vm);
if (vm.obj.items.count > 0) {
selectedItemIndex = 0;
}
} catch (error) {
window.$gz.errorHandler.handleFormError(error, vm);
} finally {
@@ -100,19 +115,58 @@ export default {
//IMPORTANT NOTE: Fields that are NON NULLABLE in the schema for the table but *are* hideable **MUST** have a default value set here or else there will be no way to save the record
//I.E. Serial, usertype fields, ACTIVE
//Also, if it's a non-nullable Enum backed field then it should have a valid selection i.e. not zero if there is no zero
// {
// id: 0,
// concurrency: 0,
// name: null,
// active: true,
// notes: null,
// wiki: null,
// customFields: "{}",
// tags: [],
// dateStarted: window.$gz.locale.nowUTC8601String(),
// dateCompleted: null,
// workorderOverseerId: null,
// accountNumber: null
// }
{
id: 0,
concurrency: 0,
name: null,
active: true,
notes: null,
wiki: null,
customFields: "{}",
tags: [],
dateStarted: window.$gz.locale.nowUTC8601String(),
dateCompleted: null,
workorderOverseerId: null,
accountNumber: null
data: {
id: 0,
concurrency: 0,
serial: null,
notes: null,
wiki: null,
customFields: "{}",
tags: [],
customerId: null,
projectId: null,
internalReferenceNumber: null,
customerReferenceNumber: null,
customerContactName: null,
fromQuoteId: null,
fromPMId: null,
fromCSRId: null,
serviceDate: null,
completeByDate: null,
invoiceNumber: null,
customerSignature: null,
customerSignatureName: null,
customerSignatureCaptured: null,
postAddress: null,
postCity: null,
postRegion: null,
postCountry: null,
postCode: null,
address: null,
city: null,
region: null,
country: null,
latitude: null,
longitude: null,
items: [],
states: [],
isDirty: false
}
},
formState: {
ready: false,
@@ -125,7 +179,8 @@ export default {
serverError: {}
},
rights: window.$gz.role.defaultRightsObject(),
ayaType: window.$gz.type.WorkOrder
ayaType: window.$gz.type.WorkOrder,
selectedItemIndex: null
};
},
//WATCHERS
@@ -533,8 +588,8 @@ async function initForm(vm) {
async function fetchTranslatedText(vm) {
await window.$gz.translation.cacheTranslations([
"WorkOrder",
"WorkOrderName",
"WorkOrderNotes",
"WorkOrderSerialNumber",
"WorkOrderSummary",
"WorkOrderCustom1",
"WorkOrderCustom2",
"WorkOrderCustom3",