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