This commit is contained in:
@@ -19,6 +19,12 @@
|
||||
</v-list-item-icon>
|
||||
<v-list-item-title>{{ $ay.t("New") }}</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item v-if="canDelete" @click="deleteItem">
|
||||
<v-list-item-icon>
|
||||
<v-icon>$ayiTrashAlt</v-icon>
|
||||
</v-list-item-icon>
|
||||
<v-list-item-title>{{ $ay.t("Delete") }}</v-list-item-title>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</v-col>
|
||||
@@ -54,7 +60,6 @@
|
||||
</v-col>
|
||||
</template>
|
||||
<template v-if="pvm.hasSelectedWoItem">
|
||||
[DELETE BUTTON HERE]
|
||||
<v-col v-if="form().showMe(this, 'TechNotes')" cols="12">
|
||||
<v-textarea
|
||||
v-model="value.items[pvm.selectedItemIndex].techNotes"
|
||||
@@ -88,6 +93,7 @@ import GzWoItemScheduledUsers from "../components/work-order-item-scheduled-user
|
||||
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
|
||||
todo: highlight currently selected row, mobile and full
|
||||
*/
|
||||
export default {
|
||||
components: {
|
||||
@@ -111,6 +117,9 @@ export default {
|
||||
newItem() {
|
||||
console.log("STUB: NEW ITEM");
|
||||
},
|
||||
deleteItem() {
|
||||
console.log("STUB: DELETE ITEM");
|
||||
},
|
||||
selectItem: function(item) {
|
||||
this.pvm.selectedItemIndex = item.index;
|
||||
},
|
||||
@@ -242,6 +251,14 @@ and it's probably not a big list to fill anyway
|
||||
this.pvm.rights.change &&
|
||||
this.pvm.subRights.items.create
|
||||
);
|
||||
},
|
||||
canDelete: function() {
|
||||
return (
|
||||
this.pvm.hasSelectedWoItem &&
|
||||
!this.value.isLockedAtServer &&
|
||||
this.pvm.rights.change &&
|
||||
this.pvm.subRights.items.delete
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user