This commit is contained in:
@@ -1,9 +1,27 @@
|
||||
<template>
|
||||
<div v-if="value != null" class="mt-8">
|
||||
<!-- {{
|
||||
{
|
||||
isRestrictedType: value.userIsRestrictedType,
|
||||
isTechRestricted: value.userIsTechRestricted,
|
||||
subfull: value.userIsSubContractorFull,
|
||||
subRestricted: value.userIsSubContractorRestricted,
|
||||
showLabors: showLabors,
|
||||
showTravels: showTravels,
|
||||
showExpenses: showExpenses,
|
||||
showLoans: showLoans,
|
||||
showOutsideServices: showOutsideServices,
|
||||
showParts: showParts,
|
||||
showPartRequests: showPartRequests,
|
||||
showScheduledUsers: showScheduledUsers,
|
||||
showTasks: showTasks,
|
||||
showUnits: showUnits
|
||||
}
|
||||
}} -->
|
||||
<v-row>
|
||||
<!-- Title and menu -->
|
||||
<v-col cols="12">
|
||||
<v-menu offset-y>
|
||||
<v-menu offset-y max-width="600px">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<div class="text-h5">
|
||||
<v-icon x-large :color="hasData ? 'primary' : null" class="mr-2"
|
||||
@@ -1202,38 +1220,47 @@ and it's probably not a big list to fill anyway
|
||||
canAdd: function() {
|
||||
return (
|
||||
!this.pvm.formState.readOnly &&
|
||||
!this.value.userIsRestrictedType &&
|
||||
this.pvm.rights.change &&
|
||||
this.pvm.subRights.items.create
|
||||
);
|
||||
},
|
||||
canDelete: function() {
|
||||
return this.activeItemIndex != null && this.canDeleteAll;
|
||||
return (
|
||||
this.activeItemIndex != null &&
|
||||
this.canDeleteAll &&
|
||||
!this.value.userIsRestrictedType
|
||||
);
|
||||
},
|
||||
canDeleteAll: function() {
|
||||
return (
|
||||
!this.pvm.formState.readOnly &&
|
||||
this.pvm.rights.change &&
|
||||
this.pvm.subRights.items.delete &&
|
||||
this.hasData
|
||||
this.hasData &&
|
||||
!this.value.userIsRestrictedType
|
||||
);
|
||||
},
|
||||
canAddUnit: function() {
|
||||
return (
|
||||
this.pvm.subRights.units.create &&
|
||||
this.form().showMe(this, "WorkOrderItemUnitList")
|
||||
this.form().showMe(this, "WorkOrderItemUnitList") &&
|
||||
!this.value.userIsRestrictedType
|
||||
);
|
||||
},
|
||||
showUnits: function() {
|
||||
return (
|
||||
this.pvm.subRights.units.visible &&
|
||||
this.form().showMe(this, "WorkOrderItemUnitList") &&
|
||||
this.value.items[this.activeItemIndex].units.length > 0
|
||||
this.value.items[this.activeItemIndex].units.length > 0 &&
|
||||
!this.value.userIsSubContractorRestricted
|
||||
);
|
||||
},
|
||||
canAddScheduledUser: function() {
|
||||
return (
|
||||
this.pvm.subRights.scheduledUsers.create &&
|
||||
this.form().showMe(this, "WorkOrderItemScheduledUserList")
|
||||
this.form().showMe(this, "WorkOrderItemScheduledUserList") &&
|
||||
!this.value.userIsRestrictedType
|
||||
);
|
||||
},
|
||||
showScheduledUsers: function() {
|
||||
@@ -1246,27 +1273,30 @@ and it's probably not a big list to fill anyway
|
||||
canAddTask: function() {
|
||||
return (
|
||||
this.pvm.subRights.tasks.create &&
|
||||
this.form().showMe(this, "WorkOrderItemTaskList")
|
||||
this.form().showMe(this, "WorkOrderItemTasks") &&
|
||||
!this.value.userIsRestrictedType
|
||||
);
|
||||
},
|
||||
showTasks: function() {
|
||||
return (
|
||||
this.pvm.subRights.tasks.visible &&
|
||||
this.form().showMe(this, "WorkOrderItemTaskList") &&
|
||||
this.form().showMe(this, "WorkOrderItemTasks") &&
|
||||
this.value.items[this.activeItemIndex].tasks.length > 0
|
||||
);
|
||||
},
|
||||
canAddPart: function() {
|
||||
return (
|
||||
this.pvm.subRights.parts.create &&
|
||||
this.form().showMe(this, "WorkOrderItemUnitList")
|
||||
this.form().showMe(this, "WorkOrderItemPartList") &&
|
||||
!this.value.userIsRestrictedType
|
||||
);
|
||||
},
|
||||
showParts: function() {
|
||||
return (
|
||||
this.pvm.subRights.parts.visible &&
|
||||
this.form().showMe(this, "WorkOrderItemUnitList") &&
|
||||
this.value.items[this.activeItemIndex].parts.length > 0
|
||||
this.form().showMe(this, "WorkOrderItemPartList") &&
|
||||
this.value.items[this.activeItemIndex].parts.length > 0 &&
|
||||
!this.value.userIsSubContractorRestricted
|
||||
);
|
||||
},
|
||||
showPartRequests: function() {
|
||||
@@ -1274,73 +1304,83 @@ and it's probably not a big list to fill anyway
|
||||
this.pvm.useInventory &&
|
||||
this.value.items[this.activeItemIndex].partRequests.length > 0 &&
|
||||
this.pvm.subRights.partRequests.visible &&
|
||||
this.form().showMe(this, "WorkOrderItemPartRequestList")
|
||||
this.form().showMe(this, "WorkOrderItemPartRequestList") &&
|
||||
!this.value.userIsSubContractorRestricted
|
||||
);
|
||||
},
|
||||
|
||||
canAddLabor: function() {
|
||||
return (
|
||||
this.pvm.subRights.labors.create &&
|
||||
this.form().showMe(this, "WorkOrderItemUnitList")
|
||||
this.form().showMe(this, "WorkOrderItemLaborList")
|
||||
);
|
||||
},
|
||||
showLabors: function() {
|
||||
return (
|
||||
this.pvm.subRights.labors.visible &&
|
||||
this.form().showMe(this, "WorkOrderItemUnitList") &&
|
||||
this.form().showMe(this, "WorkOrderItemLaborList") &&
|
||||
this.value.items[this.activeItemIndex].labors.length > 0
|
||||
);
|
||||
},
|
||||
canAddTravel: function() {
|
||||
return (
|
||||
this.pvm.subRights.travels.create &&
|
||||
this.form().showMe(this, "WorkOrderItemUnitList")
|
||||
this.form().showMe(this, "WorkOrderItemTravelList")
|
||||
);
|
||||
},
|
||||
showTravels: function() {
|
||||
return (
|
||||
this.pvm.subRights.travels.visible &&
|
||||
this.form().showMe(this, "WorkOrderItemUnitList") &&
|
||||
this.form().showMe(this, "WorkOrderItemTravelList") &&
|
||||
this.value.items[this.activeItemIndex].travels.length > 0
|
||||
);
|
||||
},
|
||||
canAddExpense: function() {
|
||||
return (
|
||||
this.pvm.subRights.expenses.create &&
|
||||
this.form().showMe(this, "WorkOrderItemUnitList")
|
||||
this.form().showMe(this, "WorkOrderItemExpenseList") &&
|
||||
!this.value.userIsSubContractorFull &&
|
||||
!this.value.userIsSubContractorRestricted
|
||||
);
|
||||
},
|
||||
showExpenses: function() {
|
||||
return (
|
||||
this.pvm.subRights.expenses.visible &&
|
||||
this.form().showMe(this, "WorkOrderItemUnitList") &&
|
||||
this.value.items[this.activeItemIndex].expenses.length > 0
|
||||
this.form().showMe(this, "WorkOrderItemExpenseList") &&
|
||||
this.value.items[this.activeItemIndex].expenses.length > 0 &&
|
||||
!this.value.userIsSubContractorFull &&
|
||||
!this.value.userIsSubContractorRestricted
|
||||
);
|
||||
},
|
||||
canAddLoan: function() {
|
||||
return (
|
||||
this.pvm.subRights.loans.create &&
|
||||
this.form().showMe(this, "WorkOrderItemUnitList")
|
||||
this.form().showMe(this, "WorkOrderItemLoanList") &&
|
||||
!this.value.userIsRestrictedType
|
||||
);
|
||||
},
|
||||
showLoans: function() {
|
||||
return (
|
||||
this.pvm.subRights.loans.visible &&
|
||||
this.form().showMe(this, "WorkOrderItemUnitList") &&
|
||||
this.value.items[this.activeItemIndex].loans.length > 0
|
||||
this.form().showMe(this, "WorkOrderItemLoanList") &&
|
||||
this.value.items[this.activeItemIndex].loans.length > 0 &&
|
||||
!this.value.userIsSubContractorRestricted
|
||||
);
|
||||
},
|
||||
canAddOutsideService: function() {
|
||||
return (
|
||||
this.pvm.subRights.outsideServices.create &&
|
||||
this.form().showMe(this, "WorkOrderItemUnitList")
|
||||
this.form().showMe(this, "WorkOrderItemOutsideServiceList") &&
|
||||
!this.value.userIsRestrictedType
|
||||
);
|
||||
},
|
||||
showOutsideServices: function() {
|
||||
return (
|
||||
this.pvm.subRights.outsideServices.visible &&
|
||||
this.form().showMe(this, "WorkOrderItemUnitList") &&
|
||||
this.value.items[this.activeItemIndex].outsideServices.length > 0
|
||||
this.form().showMe(this, "WorkOrderItemOutsideServiceList") &&
|
||||
this.value.items[this.activeItemIndex].outsideServices.length > 0 &&
|
||||
!this.value.userIsSubContractorFull &&
|
||||
!this.value.userIsSubContractorRestricted
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user