This commit is contained in:
@@ -97,6 +97,10 @@ import GzWoItemScheduledUsers from "../components/work-order-item-scheduled-user
|
|||||||
/*
|
/*
|
||||||
todo: stop using parent vm directly to control state in graph and instead pass down values via props to children and pass up values to parent via events
|
todo: stop using parent vm directly to control state in graph and instead pass down values via props to children and pass up values to parent via events
|
||||||
https://www.smashingmagazine.com/2020/01/data-components-vue-js/
|
https://www.smashingmagazine.com/2020/01/data-components-vue-js/
|
||||||
|
|
||||||
|
todo: on init:
|
||||||
|
//If there is a single woitem then select it otherwise keep it clean and empty by not selecting thus not showing
|
||||||
|
//edit form as per design
|
||||||
|
|
||||||
todo: can I turn control labels into hyperlinks for getting to feeder records? If not then need to find a way to accomplish it
|
todo: can I turn control labels into hyperlinks for getting to feeder records? If not then need to find a way to accomplish it
|
||||||
e.g. can workorder status title be changed to a hyper link to status list
|
e.g. can workorder status title be changed to a hyper link to status list
|
||||||
|
|||||||
@@ -90,16 +90,6 @@ export default {
|
|||||||
dirty: false,
|
dirty: false,
|
||||||
valid: true
|
valid: true
|
||||||
});
|
});
|
||||||
|
|
||||||
//If there is a single woitem then select it otherwise keep it clean and empty by not selecting thus not showing
|
|
||||||
//edit form as per design
|
|
||||||
if (vm.obj.items.length > 0) {
|
|
||||||
if (vm.obj.items.length == 1) {
|
|
||||||
vm.selectedItemIndex = 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
vm.selectedItemIndex = null;
|
|
||||||
}
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
window.$gz.errorHandler.handleFormError(error, vm);
|
window.$gz.errorHandler.handleFormError(error, vm);
|
||||||
} finally {
|
} finally {
|
||||||
@@ -123,64 +113,46 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
formCustomTemplateKey: FORM_CUSTOM_TEMPLATE_KEY,
|
formCustomTemplateKey: FORM_CUSTOM_TEMPLATE_KEY,
|
||||||
obj:
|
obj: {
|
||||||
//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
|
data: {
|
||||||
//I.E. Serial, usertype fields, ACTIVE
|
id: 0,
|
||||||
//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
|
concurrency: 0,
|
||||||
// {
|
serial: null,
|
||||||
// id: 0,
|
notes: null,
|
||||||
// concurrency: 0,
|
wiki: null,
|
||||||
// name: null,
|
customFields: "{}",
|
||||||
// active: true,
|
tags: [],
|
||||||
// notes: null,
|
customerId: null,
|
||||||
// wiki: null,
|
projectId: null,
|
||||||
// customFields: "{}",
|
internalReferenceNumber: null,
|
||||||
// tags: [],
|
customerReferenceNumber: null,
|
||||||
// dateStarted: window.$gz.locale.nowUTC8601String(),
|
customerContactName: null,
|
||||||
// dateCompleted: null,
|
fromQuoteId: null,
|
||||||
// workorderOverseerId: null,
|
fromPMId: null,
|
||||||
// accountNumber: null
|
fromCSRId: null,
|
||||||
// }
|
serviceDate: null,
|
||||||
{
|
completeByDate: null,
|
||||||
data: {
|
invoiceNumber: null,
|
||||||
id: 0,
|
customerSignature: null,
|
||||||
concurrency: 0,
|
customerSignatureName: null,
|
||||||
serial: null,
|
customerSignatureCaptured: null,
|
||||||
notes: null,
|
postAddress: null,
|
||||||
wiki: null,
|
postCity: null,
|
||||||
customFields: "{}",
|
postRegion: null,
|
||||||
tags: [],
|
postCountry: null,
|
||||||
customerId: null,
|
postCode: null,
|
||||||
projectId: null,
|
address: null,
|
||||||
internalReferenceNumber: null,
|
city: null,
|
||||||
customerReferenceNumber: null,
|
region: null,
|
||||||
customerContactName: null,
|
country: null,
|
||||||
fromQuoteId: null,
|
latitude: null,
|
||||||
fromPMId: null,
|
longitude: null,
|
||||||
fromCSRId: null,
|
items: [],
|
||||||
serviceDate: null,
|
states: [],
|
||||||
completeByDate: null,
|
isDirty: false,
|
||||||
invoiceNumber: null,
|
isLockedAtServer: false
|
||||||
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,
|
|
||||||
isLockedAtServer: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
formState: {
|
formState: {
|
||||||
ready: false,
|
ready: false,
|
||||||
dirty: false,
|
dirty: false,
|
||||||
@@ -314,21 +286,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
hasSelectedScheduledUserItem: function() {
|
|
||||||
if (
|
|
||||||
this.hasSelectedWoItem &&
|
|
||||||
this.selectedScheduledUserItemIndex != null
|
|
||||||
) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
scheduledUserItemCount: function() {
|
|
||||||
if (!this.obj.items || !this.hasSelectedWoItem) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return this.obj.items[this.selectedItemIndex].scheduledUsers.length;
|
|
||||||
},
|
|
||||||
currentState() {
|
currentState() {
|
||||||
//return actual status object from top level shell based on current state
|
//return actual status object from top level shell based on current state
|
||||||
//if state is unknown then it should return a placeholder dummy state showing an error condition or empty I guess
|
//if state is unknown then it should return a placeholder dummy state showing an error condition or empty I guess
|
||||||
|
|||||||
Reference in New Issue
Block a user