This commit is contained in:
@@ -392,6 +392,9 @@ TODO: Hiding sections not used when empty and now added from the menu to present
|
||||
add from fab floating action button when new?
|
||||
something that stays so users can use either way so no confusion about shifting UI elements that disappear
|
||||
|
||||
bugbug: service completed (closed status) workorder goes gray initially but when go out and back in it's editable again WTF??
|
||||
Seems to have just happened
|
||||
|
||||
todo: check Joyce's cases
|
||||
|
||||
--------- TEST RELEASE HERE ---------------
|
||||
|
||||
@@ -243,6 +243,10 @@ export default {
|
||||
gotoIndex: {
|
||||
default: null,
|
||||
type: Number
|
||||
},
|
||||
addNew: {
|
||||
default: null,
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -253,8 +257,13 @@ export default {
|
||||
},
|
||||
gotoIndex(val, oldVal) {
|
||||
if (val != oldVal) {
|
||||
this.selectedRow = [{ index: val }];
|
||||
this.activeItemIndex = val;
|
||||
let gotoIndex = val;
|
||||
if (val < 0) {
|
||||
//it's a create request
|
||||
gotoIndex = this.newItem();
|
||||
}
|
||||
this.selectedRow = [{ index: gotoIndex }];
|
||||
this.activeItemIndex = gotoIndex;
|
||||
this.$nextTick(() => {
|
||||
const el = this.$refs.unittopform;
|
||||
if (el) {
|
||||
@@ -301,6 +310,8 @@ export default {
|
||||
`Items[${this.activeWoItemIndex}].units[${this.activeItemIndex}].unitId`
|
||||
);
|
||||
});
|
||||
|
||||
return newIndex; //for create new on goto
|
||||
},
|
||||
unDeleteItem() {
|
||||
this.value.items[this.activeWoItemIndex].units[
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
>
|
||||
{{ $ay.t("WorkOrderItemList") }}
|
||||
<v-btn large icon v-bind="attrs" v-on="on">
|
||||
<v-icon small color="primary">$ayiEllipsisV</v-icon>
|
||||
<v-icon color="primary">$ayiEllipsisV</v-icon>
|
||||
</v-btn>
|
||||
</div>
|
||||
</template>
|
||||
@@ -35,6 +35,20 @@
|
||||
</v-list-item-icon>
|
||||
<v-list-item-title>{{ $ay.t("Undelete") }}</v-list-item-title>
|
||||
</v-list-item>
|
||||
|
||||
<template v-if="hasData && hasSelection && pvm.rights.change">
|
||||
<v-divider></v-divider>
|
||||
<v-subheader>{{ $ay.t("Add") }}</v-subheader>
|
||||
<v-list-item
|
||||
v-if="pvm.subRights.units.create"
|
||||
@click="newSubItem($ay.ayt.WorkOrderItemUnit)"
|
||||
>
|
||||
<v-list-item-icon>
|
||||
<v-icon>$ayiFan</v-icon>
|
||||
</v-list-item-icon>
|
||||
<v-list-item-title>{{ $ay.t("Unit") }}</v-list-item-title>
|
||||
</v-list-item>
|
||||
</template>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</v-col>
|
||||
@@ -362,13 +376,7 @@
|
||||
GRANDCHILDREN
|
||||
############################################################################ -->
|
||||
|
||||
<v-col
|
||||
cols="12"
|
||||
v-if="
|
||||
pvm.subRights.units.visible &&
|
||||
form().showMe(this, 'WorkOrderItemUnitList')
|
||||
"
|
||||
>
|
||||
<v-col cols="12" v-show="showUnits">
|
||||
<GzWoItemUnits
|
||||
v-model="value"
|
||||
:pvm="pvm"
|
||||
@@ -795,6 +803,15 @@ export default {
|
||||
this.fieldValueChanged(`items[${this.activeItemIndex}].notes`);
|
||||
});
|
||||
},
|
||||
newSubItem(atype) {
|
||||
//new Id value to use (by convention goto negative will trigger create and then goto instead of simple goto)
|
||||
let newId = -Math.abs(Date.now());
|
||||
switch (atype) {
|
||||
case window.$gz.WorkOrderItemUnit:
|
||||
this.gotoUnitIndex = newId;
|
||||
break;
|
||||
}
|
||||
},
|
||||
unDeleteItem() {
|
||||
this.value.items[this.activeItemIndex].deleted = false;
|
||||
//CHILDREN
|
||||
@@ -1026,6 +1043,14 @@ and it's probably not a big list to fill anyway
|
||||
this.pvm.rights.change &&
|
||||
this.pvm.subRights.items.delete
|
||||
);
|
||||
},
|
||||
showUnits: function() {
|
||||
return (
|
||||
this.pvm.subRights.units.visible &&
|
||||
this.form().showMe(this, "WorkOrderItemUnitList") &&
|
||||
this.value.items[this.activeItemIndex].units &&
|
||||
this.value.items[this.activeItemIndex].units.length > 0
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -301,12 +301,15 @@ function generateMenu(vm) {
|
||||
vm: vm
|
||||
});
|
||||
|
||||
menuOptions.menuItems.push({
|
||||
title: "DirectNotification",
|
||||
icon: "$ayiCommentAlt",
|
||||
data: "home-notify-direct",
|
||||
key: "app:nav"
|
||||
});
|
||||
if (!window.$gz.store.state.isCustomerUser) {
|
||||
menuOptions.menuItems.push({
|
||||
title: "DirectNotification",
|
||||
icon: "$ayiCommentAlt",
|
||||
data: "home-notify-direct",
|
||||
key: "app:nav"
|
||||
});
|
||||
}
|
||||
|
||||
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
||||
}
|
||||
/////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user