This commit is contained in:
2021-06-16 23:08:44 +00:00
parent 68768a47c6
commit b944da77ed

View File

@@ -40,7 +40,7 @@
<v-divider></v-divider>
<v-subheader>{{ $ay.t("Add") }}</v-subheader>
<v-list-item
v-if="pvm.subRights.units.create"
v-if="canAddUnit"
@click="newSubItem($ay.ayt.WorkOrderItemUnit)"
>
<v-list-item-icon>
@@ -387,13 +387,7 @@
/>
</v-col>
<v-col
cols="12"
v-if="
pvm.subRights.scheduledUsers.visible &&
form().showMe(this, 'WorkOrderItemScheduledUserList')
"
>
<v-col cols="12" v-show="showScheduledUsers">
<GzWoItemScheduledUsers
v-model="value"
:pvm="pvm"
@@ -1044,13 +1038,25 @@ and it's probably not a big list to fill anyway
this.pvm.subRights.items.delete
);
},
canAddUnit: function() {
return (
this.pvm.subRights.units.create &&
this.form().showMe(this, "WorkOrderItemUnitList")
);
},
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
);
},
showScheduledUsers: function() {
return (
this.pvm.subRights.scheduledUsers.visible &&
this.form().showMe(this, "WorkOrderItemScheduledUserList") &&
this.value.items[this.activeItemIndex].scheduledUsers.length > 0
);
}
}
};