This commit is contained in:
@@ -219,7 +219,7 @@ CURRENTLY DOING: workorder front POC
|
||||
- test out, confirm can CRUD as planned independantly and all at once
|
||||
- will need some dirty fields and viz fields likely added to models so go minimal route as possible to POC it
|
||||
- NEED editable field at every level to test out the updating and partial updating process
|
||||
- NEED state control right away to test that aspect
|
||||
|
||||
- once pass this step then second pass at new features that affect models (not necessarily UI stuff just fields required etc)
|
||||
shouldn't be too much as already did that when recently fleshed out models but no doubt missed much
|
||||
- then full in front end and flow out to back end as required, remove any backend that was a defunct evolutionary path so no cruft left around
|
||||
|
||||
@@ -7,12 +7,12 @@
|
||||
<v-col cols="12">
|
||||
<v-menu offset-y>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<h3>
|
||||
<div class="text-subtitle-1">
|
||||
{{ $ay.t("WorkOrderItemScheduledUserList") }}
|
||||
</h3>
|
||||
<v-btn large icon v-bind="attrs" v-on="on">
|
||||
<v-icon small color="primary">$ayiEllipsisV</v-icon>
|
||||
</v-btn>
|
||||
<v-btn large icon v-bind="attrs" v-on="on">
|
||||
<v-icon small color="primary">$ayiEllipsisV</v-icon>
|
||||
</v-btn>
|
||||
</div>
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-item v-if="canAdd" @click="newItem">
|
||||
@@ -25,6 +25,21 @@
|
||||
</v-menu>
|
||||
</v-col>
|
||||
|
||||
<span class="text-caption"
|
||||
>[selected su_index: {{ pvm.selectedScheduledUserItemIndex }}]</span
|
||||
>
|
||||
<template v-if="pvm.scheduledUserItemCount > 1">
|
||||
scheduled user table here
|
||||
</template>
|
||||
<template v-if="pvm.hasSelectedScheduledUserItem">
|
||||
scheduled user form here
|
||||
</template>
|
||||
|
||||
<!-- public long? UserId { get; set; }
|
||||
public decimal EstimatedQuantity { get; set; }
|
||||
public DateTime? StartDate { get; set; }
|
||||
public DateTime? StopDate { get; set; }
|
||||
public long? ServiceRateId { get; set; } -->
|
||||
<!-- <h5 class="ml-12">WorkOrderItemScheduledUsers</h5>
|
||||
<div v-if="pvm.hasSelectedWoItem">
|
||||
{{ value.items[pvm.selectedItemIndex].scheduledUsers }}
|
||||
|
||||
@@ -1,6 +1,26 @@
|
||||
<template>
|
||||
<div v-if="pvm != null">
|
||||
<h2>WorkOrder items</h2>
|
||||
<!-- Title and menu -->
|
||||
<v-col cols="12">
|
||||
<v-menu offset-y>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<div class="text-h6">
|
||||
{{ $ay.t("WorkOrderItemList") }}
|
||||
<v-btn large icon v-bind="attrs" v-on="on">
|
||||
<v-icon small color="primary">$ayiEllipsisV</v-icon>
|
||||
</v-btn>
|
||||
</div>
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-item v-if="canAdd" @click="newItem">
|
||||
<v-list-item-icon>
|
||||
<v-icon>$ayiPlus</v-icon>
|
||||
</v-list-item-icon>
|
||||
<v-list-item-title>{{ $ay.t("New") }}</v-list-item-title>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</v-col>
|
||||
|
||||
<!-- items:{{ value.items }}<br /> -->
|
||||
<span class="text-caption"
|
||||
@@ -10,62 +30,18 @@
|
||||
<!-- Workorder item table here -->
|
||||
</template>
|
||||
<template v-if="pvm.hasSelectedWoItem">
|
||||
<!-- grid with edit form below in each collection section. Edit form Has controls to navigate to other collection items so no need to go up and click on table if don't want to or it's huge -->
|
||||
<!-- Want to support the case that when it's a single woitem workorder then user can just scroll down and enter shit and doesn't need to open or go anywhere to enter things all the way down
|
||||
so a single workorderitem workorder would have all fields exposed and if any grandchildren those are entered in a single form too until the user has more than one
|
||||
|
||||
in v7 it's three clicks to go to a grandchild items specific field from the top header, woitem click -> left nav button row selection of area click -> grid row column click
|
||||
in v8 it would be one more click then if it was a multi record grandchild but if it was a single record all teh way down then all would be exposed and visible at hand could go directly to the field in question
|
||||
so in this concept every level exposes an edit form below a grid of one or more items, but grid doesn't show if there is one item so it's very clean.
|
||||
if there is no record at that collection then just a click to add button as unobtrusive but clearly marked as possible (if user has selected to hide that section then doesn't even show and some users don't see at all)
|
||||
if multiple at that level then a grid to select the active row to edit below it showing as much data as possible in each row to help user see at a glance while editing a sibling item
|
||||
When select in grid it highlights that row very well so that user knows for sure which row they are editing (plus it will live update I bet so clear to see)
|
||||
This gives the user as much as possible at hand immediately to view and edit and the option of adding and selecting more items
|
||||
It also ensures a clean interface more like a piece of paper with only stuff added showing
|
||||
|
||||
So every level and collection including woitem and down is shown as a control with 4 major states (may have sub states or alternates):
|
||||
HIDDEN, EMPTY, SINGLE, MULTIPLE
|
||||
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
Customized to not show at all or not allowed: is just not visible at all, doesn't render doesn't affect anything
|
||||
None entered: it's exposed as a clean and not too intrusive "Section title" control affordance with a title so "Scheduled users +" taking up very little vertical space
|
||||
but distinct enough and large enough to quickly find visually on the page (this is always visible)
|
||||
1 entered: it's exposed as a edit form below the Title control (no grid)
|
||||
More than 1 entered: it's exposed as a grid below the title control which is used to select a row and an edit form below the grid that is displayed ONLY when a row is selected in the grid
|
||||
so if they just open the form and haven't picked a row yet then no edit form shows to save vertical space and be cleaner
|
||||
|
||||
Visually each section is separated by a distinctive title and whitespace around it, no lines or boxes or other ugly shit. It should look as much as possible like a clean sheet of paper and be minimalist.
|
||||
Roles and rights
|
||||
some controls may have an alternative format for differing roles and rights users, so if it's a subcontractor then they may see an alternate view
|
||||
|
||||
|
||||
e.g.
|
||||
# single all the way down:
|
||||
WOHEADER
|
||||
singlewoitem record form with all fields showing for edit here
|
||||
schedusers is just an add button until there is one then it's an exposed form until there's two then it's a grid only with click to open and edit each record
|
||||
|
||||
# two all the way down
|
||||
WOHEADER
|
||||
woitemgrid, click to select second item (first automatically selected when opened?), after click it shows immediately below the woitemheader fields and below that the grandchild collections as grids or add button or whole form if one
|
||||
schedusers shows as a grid, click on it to open the form below it, not popup??
|
||||
Showing the form below the grid of all the other items is actually a handy affordance because you can see what was entered and refer to it in the companion same group items
|
||||
so if you forgot if you entered a particular user or not in the midst of entry you can see it just above
|
||||
|
||||
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 projects title be turned to a hyper link to projects list
|
||||
ideally not in menu because it would be a lot on a workorder and need space for wo graph subitem links
|
||||
todo: need to implement layered (ordered) save now so can test
|
||||
todo: need an editable control at every level for proper test of partical update
|
||||
todo: need the state control at least enough to test as it's a critical part
|
||||
todo: need dirty tracking stuff for each level to set / check so top level save can know what to update
|
||||
do I need "IsNew" as well?? or can I infer that somehow (no concurrency)
|
||||
|
||||
|
||||
USAGE NOTES:
|
||||
v-if should always be as high up as possible for performance, so don't let a component decide to render, make the parent do the v-if!!
|
||||
e.g. don't let a GzWoItemParts component check if it should display, instead do it in here
|
||||
-->
|
||||
<v-col v-if="form().showMe(this, 'TechNotes')" cols="12">
|
||||
<v-textarea
|
||||
v-model="value.items[pvm.selectedItemIndex].techNotes"
|
||||
:readonly="formState.readOnly"
|
||||
:label="$ay.t('WorkOrderItemTechNotes')"
|
||||
:error-messages="form().serverErrors(this, 'notes')"
|
||||
ref="notes"
|
||||
data-cy="notes"
|
||||
@input="fieldValueChanged('notes')"
|
||||
auto-grow
|
||||
></v-textarea>
|
||||
</v-col>
|
||||
|
||||
<GzWoItemScheduledUsers
|
||||
v-if="pvm.subRights.scheduledUsers.visible"
|
||||
@@ -74,9 +50,6 @@
|
||||
data-cy="woItemScheduledUsers"
|
||||
/>
|
||||
</template>
|
||||
<template v-else>
|
||||
<h5>select a woitem to view the form</h5>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@@ -84,7 +57,13 @@
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
import GzWoItemScheduledUsers from "../components/work-order-item-scheduled-users.vue";
|
||||
|
||||
/*
|
||||
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 projects title be turned to a hyper link to projects list
|
||||
ideally not in menu because it would be a lot on a workorder and need space for wo graph subitem links
|
||||
todo: need an editable control at every level for proper test of partial update
|
||||
*/
|
||||
export default {
|
||||
components: {
|
||||
GzWoItemScheduledUsers
|
||||
@@ -104,6 +83,9 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
newItem() {
|
||||
console.log("STUB: NEW ITEM");
|
||||
},
|
||||
form() {
|
||||
return window.$gz.form;
|
||||
},
|
||||
@@ -119,6 +101,13 @@ export default {
|
||||
},
|
||||
formCustomTemplateKey: function() {
|
||||
return this.pvm.formCustomTemplateKey;
|
||||
},
|
||||
canAdd: function() {
|
||||
return (
|
||||
!this.value.isLockedAtServer &&
|
||||
this.pvm.rights.change &&
|
||||
this.pvm.subRights.items.create
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -55,23 +55,12 @@
|
||||
<v-list-item-action> </v-list-item-action>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
<div>
|
||||
allstates:
|
||||
{{ value.states }}
|
||||
</div>
|
||||
<div>currentstate:{{ pvm.currentState }}</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!--
|
||||
Display as drop down box set to last status entered, user selects new status and it appends a new record to the wostate collection
|
||||
and shows dirty and as new state.
|
||||
Also a button to show more info which pops up a dialog showing the entire state history in a data table
|
||||
|
||||
TODO: POC for now don't worry about rights to unset / set certain states, just hook it up for testing
|
||||
|
||||
todo: it must be clear to user why they can not change if they have too low a role to change, perhaps text under state instead of selector box that says "Only select roles can change this state"
|
||||
todo: view state history
|
||||
todo: view state historya button to show more info which pops up a dialog showing the entire state history in a data table
|
||||
-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -88,6 +88,8 @@ export default {
|
||||
valid: true
|
||||
});
|
||||
|
||||
//todo: TEMPORARY FOR TESTING??
|
||||
//IDEALLY IT WOULD BE CLEANER IF NOTHING SELECTED ON OPEN, BUT IF ONLY ONE THEN IT SHOULD SELECT??
|
||||
if (vm.obj.items.length > 0) {
|
||||
vm.selectedItemIndex = 0;
|
||||
} else {
|
||||
@@ -187,6 +189,7 @@ export default {
|
||||
rights: window.$gz.role.defaultRightsObject(), //overall workorder rights, supersedes subrights
|
||||
ayaType: window.$gz.type.WorkOrder,
|
||||
selectedItemIndex: null,
|
||||
selectedScheduledUserItemIndex: null,
|
||||
selectLists: {
|
||||
wostatus: [],
|
||||
allowedwostatus: []
|
||||
@@ -313,6 +316,21 @@ export default {
|
||||
}
|
||||
return this.obj.items.length;
|
||||
},
|
||||
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() {
|
||||
//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
|
||||
@@ -816,6 +834,8 @@ async function fetchTranslatedText(vm) {
|
||||
"WorkOrderCustom14",
|
||||
"WorkOrderCustom15",
|
||||
"WorkOrderCustom16",
|
||||
"WorkOrderItemList",
|
||||
"WorkOrderItemTechNotes",
|
||||
"WorkOrderItemScheduledUserList"
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user