This commit is contained in:
2021-04-09 19:09:39 +00:00
parent 46e09644eb
commit 063c9bd205
2 changed files with 44 additions and 83 deletions

View File

@@ -98,6 +98,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
e.g. can projects title be turned to a hyper link to projects list e.g. can projects title be turned to a hyper link to projects list

View File

@@ -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,25 +113,7 @@ 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
//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
// }
{
data: { data: {
id: 0, id: 0,
concurrency: 0, concurrency: 0,
@@ -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