This commit is contained in:
2021-05-04 22:56:20 +00:00
parent 5b11e3324e
commit cbb3b07497
4 changed files with 239 additions and 213 deletions

View File

@@ -57,6 +57,9 @@ todo: workorders - need to set billing and service address from customers on mig
todo: Translation: "Physical" address seems wierd, rename to Street address or Delivery address or Service Address or whatever
todo: Any "Priority" type value in UI that has colors should use ayaFireAlt icon instead of round circle which is for minor status only
Flag is for major status like all of workorder
todo: be sure to address items in case https://rockfish.ayanova.com/default.htm#!/rfcaseEdit/3864
before next update to server / windows build for Joyce
@@ -301,21 +304,12 @@ todo: many biz objects are not using new PUT methodology
CURRENTLY DOING: woitempriority, woitemstatus edit forms first so have something to test the control on
TODO: Need control for selection.
it's just a select list but needs to show the color, background is sketchy as might conflict with text color so keep in mind
check vuetify docs for select see about color, I'm thinking if I can get a round dot color in there at start or stop will be ok
could use emoji or similar if necessary or maybe it's like the grid lists and just colors a border on one side (!!!!!)
TODO: Componentize the priority and woitem status controls from working examples in form now
also it needs to auto filter out the inactive ones unless it's the current selection
TOOD: Grid is showing id for status / priority and not the actual items
will need something funky with colors etc I guess
wo should prefetch and store picklist style like the wostatus already does on open
TODO: help docs for woitemstatus and woitempriority
Joyce is going to:
1797-B 10th street
East courtenay
past superstore area
taking van
TODO: help docs for woitemstatus and woitempriority edit and list forms

View File

@@ -1,213 +1,240 @@
<template>
<div v-if="value != null">
<!-- Title and menu -->
<v-col cols="12">
<v-menu offset-y>
<template v-slot:activator="{ on, attrs }">
<div class="text-h6">
<v-icon large color="primary">$ayiWrench</v-icon>
{{ $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-item v-if="canDelete && !isDeleted" @click="deleteItem">
<v-list-item-icon>
<v-icon>$ayiTrashAlt</v-icon>
</v-list-item-icon>
<v-list-item-title>{{ $ay.t("SoftDelete") }}</v-list-item-title>
</v-list-item>
<v-list-item v-if="canDelete && isDeleted" @click="unDeleteItem">
<v-list-item-icon>
<v-icon>$ayiTrashRestoreAlt</v-icon>
</v-list-item-icon>
<v-list-item-title>{{ $ay.t("Undelete") }}</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
</v-col>
<v-row>
<!-- Title and menu -->
<v-col cols="12">
<v-menu offset-y>
<template v-slot:activator="{ on, attrs }">
<div class="text-h6">
<v-icon large color="primary">$ayiWrench</v-icon>
{{ $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-item v-if="canDelete && !isDeleted" @click="deleteItem">
<v-list-item-icon>
<v-icon>$ayiTrashAlt</v-icon>
</v-list-item-icon>
<v-list-item-title>{{ $ay.t("SoftDelete") }}</v-list-item-title>
</v-list-item>
<v-list-item v-if="canDelete && isDeleted" @click="unDeleteItem">
<v-list-item-icon>
<v-icon>$ayiTrashRestoreAlt</v-icon>
</v-list-item-icon>
<v-list-item-title>{{ $ay.t("Undelete") }}</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
</v-col>
<template v-if="showTable">
<!-- ################################ WORK ORDER ITEMS TABLE ############################### -->
<v-col cols="12" class="mb-10">
<v-data-table
:headers="headerList"
:items="itemList"
item-key="index"
v-model="selectedRow"
class="elevation-1"
disable-pagination
disable-filtering
disable-sort
hide-default-footer
data-cy="itemsTable"
dense
:item-class="itemRowClasses"
@click:row="handleRowClick"
:show-select="$vuetify.breakpoint.xs"
single-select
<template v-if="showTable">
<!-- ################################ WORK ORDER ITEMS TABLE ############################### -->
<v-col cols="12" class="mb-10">
<v-data-table
:headers="headerList"
:items="itemList"
item-key="index"
v-model="selectedRow"
class="elevation-1"
disable-pagination
disable-filtering
disable-sort
hide-default-footer
data-cy="itemsTable"
dense
:item-class="itemRowClasses"
@click:row="handleRowClick"
:show-select="$vuetify.breakpoint.xs"
single-select
>
</v-data-table>
</v-col>
</template>
<template v-if="activeItemIndex != null">
<v-btn
v-if="canDelete && isDeleted"
large
@click="unDeleteItem"
color="primary"
>{{ $ay.t("Undelete")
}}<v-icon right large>$ayiTrashRestoreAlt</v-icon></v-btn
>
</v-data-table>
</v-col>
</template>
<template v-if="activeItemIndex != null">
<v-btn
v-if="canDelete && isDeleted"
large
@click="unDeleteItem"
color="primary"
>{{ $ay.t("Undelete")
}}<v-icon right large>$ayiTrashRestoreAlt</v-icon></v-btn
>
<v-col v-if="form().showMe(this, 'WorkOrderItemSummary')" cols="12">
<v-textarea
v-model="value.items[activeItemIndex].notes"
:readonly="formState.readOnly"
:disabled="isDeleted"
:label="$ay.t('WorkOrderItemSummary')"
:error-messages="
form().serverErrors(this, `items[${activeItemIndex}].notes`)
"
ref="notes"
data-cy="notes"
@input="fieldValueChanged('notes')"
auto-grow
></v-textarea>
</v-col>
<v-col v-if="form().showMe(this, 'WorkOrderItemSummary')" cols="12">
<v-textarea
v-model="value.items[activeItemIndex].notes"
:readonly="formState.readOnly"
:disabled="isDeleted"
:label="$ay.t('WorkOrderItemSummary')"
:error-messages="
form().serverErrors(this, `items[${activeItemIndex}].notes`)
"
ref="notes"
data-cy="notes"
@input="fieldValueChanged('notes')"
auto-grow
></v-textarea>
</v-col>
<v-col
v-if="form().showMe(this, 'WorkOrderItemSequence')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<v-text-field
v-model="value.items[activeItemIndex].sequence"
:readonly="formState.readOnly"
:disabled="isDeleted"
:label="$ay.t('Sequence')"
ref="sequence"
:rules="[form().integerValid(this, 'sequence')]"
:error-messages="form().serverErrors(this, 'sequence')"
@input="fieldValueChanged('sequence')"
type="number"
></v-text-field>
</v-col>
<v-col v-if="form().showMe(this, 'WorkOrderItemTechNotes')" cols="12">
<v-textarea
v-model="value.items[activeItemIndex].techNotes"
:readonly="formState.readOnly"
:disabled="isDeleted"
:label="$ay.t('WorkOrderItemTechNotes')"
:error-messages="form().serverErrors(this, 'techNotes')"
ref="techNotes"
data-cy="techNotes"
@input="fieldValueChanged('techNotes')"
auto-grow
></v-textarea>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-autocomplete
v-model="value.items[activeItemIndex].workorderItemStatusId"
@input="fieldValueChanged('workorderItemStatusId')"
:items="pvm.selectLists.woItemStatus"
item-text="name"
item-value="id"
:label="$ay.t('WorkOrderItemWorkOrderStatusID')"
prepend-icon="$ayiEdit"
@click:prepend="handleEditItemStatusClick()"
<v-col
v-if="form().showMe(this, 'WorkOrderItemSequence')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<template v-slot:selection="{ item }">
<v-icon class="mr-3" :color="item.color">$ayiCircle</v-icon
>{{ item.name }}
</template>
<v-text-field
v-model="value.items[activeItemIndex].sequence"
:readonly="formState.readOnly"
:disabled="isDeleted"
:label="$ay.t('Sequence')"
ref="sequence"
:rules="[form().integerValid(this, 'sequence')]"
:error-messages="form().serverErrors(this, 'sequence')"
@input="fieldValueChanged('sequence')"
type="number"
></v-text-field>
</v-col>
<template v-slot:item="{ item }">
<v-list-item-avatar>
<v-icon :color="item.color">$ayiCircle</v-icon>
</v-list-item-avatar>
<v-list-item-content>
<v-list-item-title
><span
:class="
item.active
? ''
: 'disabled--text text-decoration-line-through'
"
>{{ item.name }}</span
></v-list-item-title
>
<v-list-item-subtitle> {{ item.notes }}</v-list-item-subtitle>
</v-list-item-content>
</template>
</v-autocomplete>
</v-col>
<v-col v-if="form().showMe(this, 'WorkOrderItemTechNotes')" cols="12">
<v-textarea
v-model="value.items[activeItemIndex].techNotes"
:readonly="formState.readOnly"
:disabled="isDeleted"
:label="$ay.t('WorkOrderItemTechNotes')"
:error-messages="form().serverErrors(this, 'techNotes')"
ref="techNotes"
data-cy="techNotes"
@input="fieldValueChanged('techNotes')"
auto-grow
></v-textarea>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-autocomplete
v-model="value.items[activeItemIndex].workorderItemPriorityId"
@input="fieldValueChanged('workorderItemPriorityId')"
:items="pvm.selectLists.woItemPriorities"
item-text="name"
item-value="id"
:label="$ay.t('WorkOrderItemPriorityID')"
prepend-icon="$ayiEdit"
@click:prepend="handleEditItemPriorityClick()"
<v-col
v-if="form().showMe(this, 'WorkOrderItemWorkOrderStatusID')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<template v-slot:selection="{ item }">
<v-icon class="mr-3" :color="item.color">$ayiFireAlt</v-icon
>{{ item.name }}
</template>
<v-autocomplete
v-model="value.items[activeItemIndex].workorderItemStatusId"
:readonly="formState.readOnly"
:disabled="isDeleted"
@input="fieldValueChanged('workorderItemStatusId')"
:items="pvm.selectLists.woItemStatus"
item-text="name"
item-value="id"
:label="$ay.t('WorkOrderItemWorkOrderStatusID')"
:error-messages="form().serverErrors(this, 'workorderItemStatusId')"
ref="workorderItemStatusId"
data-cy="workorderItemStatusId"
prepend-icon="$ayiEdit"
@click:prepend="handleEditItemStatusClick()"
>
<template v-slot:selection="{ item }">
<v-icon class="mr-3" :color="item.color">$ayiCircle</v-icon
>{{ item.name }}
</template>
<template v-slot:item="{ item }">
<v-list-item-avatar>
<v-icon :color="item.color">$ayiFireAlt</v-icon>
</v-list-item-avatar>
<v-list-item-content>
<v-list-item-title
><span
:class="
item.active
? ''
: 'disabled--text text-decoration-line-through'
"
>{{ item.name }}</span
></v-list-item-title
>
</v-list-item-content>
</template>
</v-autocomplete>
</v-col>
<template v-slot:item="{ item }">
<v-list-item-avatar>
<v-icon :color="item.color">$ayiCircle</v-icon>
</v-list-item-avatar>
<v-list-item-content>
<v-list-item-title
><span
:class="
item.active
? ''
: 'disabled--text text-decoration-line-through'
"
>{{ item.name }}</span
></v-list-item-title
>
<v-list-item-subtitle> {{ item.notes }}</v-list-item-subtitle>
</v-list-item-content>
</template>
</v-autocomplete>
</v-col>
//status WorkOrderItemWorkOrderStatusID WorkorderItemStatusId //priority
<v-col
v-if="form().showMe(this, 'WorkOrderItemPriorityID')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<v-autocomplete
v-model="value.items[activeItemIndex].workorderItemPriorityId"
:readonly="formState.readOnly"
:disabled="isDeleted"
@input="fieldValueChanged('workorderItemPriorityId')"
:items="pvm.selectLists.woItemPriorities"
item-text="name"
item-value="id"
:label="$ay.t('WorkOrderItemPriorityID')"
:error-messages="
form().serverErrors(this, 'workorderItemPriorityId')
"
ref="workorderItemPriorityId"
data-cy="workorderItemPriorityId"
prepend-icon="$ayiEdit"
@click:prepend="handleEditItemPriorityClick()"
>
<template v-slot:selection="{ item }">
<v-icon class="mr-3" :color="item.color">$ayiFireAlt</v-icon
>{{ item.name }}
</template>
<template v-slot:item="{ item }">
<v-list-item-avatar>
<v-icon :color="item.color">$ayiFireAlt</v-icon>
</v-list-item-avatar>
<v-list-item-content>
<v-list-item-title
><span
:class="
item.active
? ''
: 'disabled--text text-decoration-line-through'
"
>{{ item.name }}</span
></v-list-item-title
>
</v-list-item-content>
</template>
</v-autocomplete>
</v-col>
<!-- //status WorkOrderItemWorkOrderStatusID WorkorderItemStatusId //priority
WorkOrderItemPriorityID WorkorderItemPriorityId //requestdate
WorkOrderItemRequestDate RequestDate //warrantyservice
WorkOrderItemWarrantyService WarrantyService
<GzWoItemScheduledUsers
v-if="
pvm.subRights.scheduledUsers.visible &&
form().showMe(this, 'WorkOrderItemScheduledUserList')
"
v-model="value"
:pvm="pvm"
:active-wo-item-index="activeItemIndex"
data-cy="woItemScheduledUsers"
@change="$emit('change')"
/>
</template>
WorkOrderItemWarrantyService WarrantyService -->
<v-col cols="12">
<GzWoItemScheduledUsers
v-if="
pvm.subRights.scheduledUsers.visible &&
form().showMe(this, 'WorkOrderItemScheduledUserList')
"
v-model="value"
:pvm="pvm"
:active-wo-item-index="activeItemIndex"
data-cy="woItemScheduledUsers"
@change="$emit('change')"
/>
</v-col>
</template>
</v-row>
</div>
</template>
<script>
@@ -453,7 +480,7 @@ and it's probably not a big list to fill anyway
x.quantityReceived,
this.pvm.languageName
),
status: x.workorderItemStatusId, //todo: get real status name etc here
status: x.workorderItemStatusId, //todo: get real status name etc here use
requestDate: window.$gz.locale.utcDateToShortDateAndTimeLocalized(
x.requestDate,
this.pvm.timeZoneName,
@@ -492,5 +519,10 @@ and it's probably not a big list to fill anyway
);
}
}
//TODO: Function status name from woitemstatusid
//and priority same
//this.pvm.pickLists.woItemStatus.find(x=>x.id==x.workorderItemStatusId)
};
</script>

View File

@@ -392,7 +392,7 @@ function generateMenu(vm) {
let menuOptions = {
isMain: false,
readOnly: vm.formState.readOnly,
icon: "$ayiCircle",
icon: "$ayiFireAlt",
title: "WorkOrderItemPriority",
helpUrl: "svc-work-order-item-priority",
formData: {

View File

@@ -89,7 +89,7 @@ async function clickHandler(menuItem) {
function generateMenu(vm) {
let menuOptions = {
isMain: true,
icon: "$ayiCircle",
icon: "$ayiFireAlt",
title: "WorkOrderItemPriorityList",
helpUrl: "svc-work-order-item-priority",
menuItems: [],