This commit is contained in:
2021-07-14 23:32:46 +00:00
parent 0c4aa5a92d
commit 9e8b9ad128
13 changed files with 105 additions and 61 deletions

View File

@@ -461,7 +461,7 @@ Subcontractor / tech limited modifications
todo: units on work order are not limited to customer on work order?? todo: units on work order are not limited to customer on work order??
todo: looks like wont' need subrights system, need to disentangle and remove it from workorder
todo: Status on work order doesn't seem to be preventing "Who can select" by role properly todo: Status on work order doesn't seem to be preventing "Who can select" by role properly
Make it not present status that are not supposed to be available Make it not present status that are not supposed to be available
put a back end rule in validation to prevent it as well put a back end rule in validation to prevent it as well

View File

@@ -1,14 +1,5 @@
<template> <template>
<div> <div>
{{
{
isRestrictedType: value.userIsRestrictedType,
isTechRestricted: value.userIsTechRestricted,
subfull: value.userIsSubContractorFull,
subRestricted: value.userIsSubContractorRestricted
}
}}
<v-row> <v-row>
<v-col <v-col
cols="12" cols="12"
@@ -68,16 +59,21 @@
data-cy="customerSignature" data-cy="customerSignature"
/> />
</v-col> </v-col>
<v-col cols="12" sm="6" lg="4" xl="3"> <v-col
v-if="
pvm.subRights.states.visible &&
form().showMe(this, 'WorkOrderStatus') &&
!(
value.userIsSubContractorFull ||
value.userIsSubContractorRestricted
)
"
cols="12"
sm="6"
lg="4"
xl="3"
>
<GzWoState <GzWoState
v-if="
pvm.subRights.states.visible &&
form().showMe(this, 'WorkOrderStatus') &&
!(
value.userIsSubContractorFull ||
value.userIsSubContractorRestricted
)
"
v-model="value" v-model="value"
:form-key="formCustomTemplateKey" :form-key="formCustomTemplateKey"
:readonly="formState.readOnly" :readonly="formState.readOnly"
@@ -88,12 +84,16 @@
/> />
</v-col> </v-col>
<v-col cols="12" sm="6" lg="4" xl="3"> <v-col
v-if="
form().showMe(this, 'Address') && !value.userIsSubContractorRestricted
"
cols="12"
sm="6"
lg="4"
xl="3"
>
<GzWoAddress <GzWoAddress
v-if="
form().showMe(this, 'Address') &&
!value.userIsSubContractorRestricted
"
v-model="value" v-model="value"
:form-key="formCustomTemplateKey" :form-key="formCustomTemplateKey"
:readonly="formState.readOnly || value.userIsRestrictedType" :readonly="formState.readOnly || value.userIsRestrictedType"

View File

@@ -2,7 +2,7 @@
<div v-if="value != null" class="mt-8"> <div v-if="value != null" class="mt-8">
<v-row> <v-row>
<v-col cols="12"> <v-col cols="12">
<v-menu offset-y> <v-menu offset-y max-width="600px">
<template v-slot:activator="{ on, attrs }"> <template v-slot:activator="{ on, attrs }">
<div class="text-h6"> <div class="text-h6">
<v-icon large :color="hasData ? 'primary' : null" class="mr-2" <v-icon large :color="hasData ? 'primary' : null" class="mr-2"

View File

@@ -2,7 +2,7 @@
<div v-if="value != null" class="mt-8"> <div v-if="value != null" class="mt-8">
<v-row> <v-row>
<v-col cols="12"> <v-col cols="12">
<v-menu offset-y> <v-menu offset-y max-width="600px">
<template v-slot:activator="{ on, attrs }"> <template v-slot:activator="{ on, attrs }">
<div class="text-h6"> <div class="text-h6">
<v-icon large :color="hasData ? 'primary' : null" class="mr-2" <v-icon large :color="hasData ? 'primary' : null" class="mr-2"
@@ -523,7 +523,9 @@ export default {
this.value.items[this.activeWoItemIndex].labors.push({ this.value.items[this.activeWoItemIndex].labors.push({
id: 0, id: 0,
concurrency: 0, concurrency: 0,
userId: null, userId: this.value.userIsRestrictedType
? this.$store.state.userId
: null,
serviceStartDate: null, serviceStartDate: null,
serviceStopDate: null, serviceStopDate: null,
serviceRateId: null, serviceRateId: null,
@@ -536,7 +538,9 @@ export default {
isDirty: true, isDirty: true,
workOrderItemId: this.value.items[this.activeWoItemIndex].id, workOrderItemId: this.value.items[this.activeWoItemIndex].id,
uid: Date.now(), uid: Date.now(),
userViz: null, userViz: this.value.userIsRestrictedType
? this.$store.state.userName
: null,
serviceRateViz: null, serviceRateViz: null,
taxCodeViz: null taxCodeViz: null
}); });

View File

@@ -2,7 +2,7 @@
<div v-if="value != null" class="mt-8"> <div v-if="value != null" class="mt-8">
<v-row> <v-row>
<v-col cols="12"> <v-col cols="12">
<v-menu offset-y> <v-menu offset-y max-width="600px">
<template v-slot:activator="{ on, attrs }"> <template v-slot:activator="{ on, attrs }">
<div class="text-h6"> <div class="text-h6">
<v-icon large :color="hasData ? 'primary' : null" class="mr-2" <v-icon large :color="hasData ? 'primary' : null" class="mr-2"

View File

@@ -2,7 +2,7 @@
<div v-if="value != null" class="mt-8"> <div v-if="value != null" class="mt-8">
<v-row> <v-row>
<v-col cols="12"> <v-col cols="12">
<v-menu offset-y> <v-menu offset-y max-width="600px">
<template v-slot:activator="{ on, attrs }"> <template v-slot:activator="{ on, attrs }">
<div class="text-h6"> <div class="text-h6">
<v-icon large :color="hasData ? 'primary' : null" class="mr-2" <v-icon large :color="hasData ? 'primary' : null" class="mr-2"

View File

@@ -3,7 +3,7 @@
<div ref="partrequesttopform" /> <div ref="partrequesttopform" />
<v-row> <v-row>
<v-col cols="12"> <v-col cols="12">
<v-menu offset-y> <v-menu offset-y max-width="600px">
<template v-slot:activator="{ on, attrs }"> <template v-slot:activator="{ on, attrs }">
<div class="text-h6"> <div class="text-h6">
<v-icon large :color="hasData ? 'primary' : null" class="mr-2" <v-icon large :color="hasData ? 'primary' : null" class="mr-2"

View File

@@ -2,7 +2,7 @@
<div v-if="value != null" class="mt-8"> <div v-if="value != null" class="mt-8">
<v-row> <v-row>
<v-col cols="12"> <v-col cols="12">
<v-menu offset-y> <v-menu offset-y max-width="600px">
<template v-slot:activator="{ on, attrs }"> <template v-slot:activator="{ on, attrs }">
<div class="text-h6"> <div class="text-h6">
<v-icon large :color="hasData ? 'primary' : null" class="mr-2" <v-icon large :color="hasData ? 'primary' : null" class="mr-2"

View File

@@ -2,7 +2,7 @@
<div v-if="value != null" class="mt-8"> <div v-if="value != null" class="mt-8">
<v-row> <v-row>
<v-col cols="12"> <v-col cols="12">
<v-menu offset-y> <v-menu offset-y max-width="600px">
<template v-slot:activator="{ on, attrs }"> <template v-slot:activator="{ on, attrs }">
<div class="text-h6"> <div class="text-h6">
<v-icon large :color="hasData ? 'primary' : null" class="mr-2" <v-icon large :color="hasData ? 'primary' : null" class="mr-2"

View File

@@ -2,7 +2,7 @@
<div v-if="value != null" class="mt-8"> <div v-if="value != null" class="mt-8">
<v-row> <v-row>
<v-col cols="12"> <v-col cols="12">
<v-menu offset-y> <v-menu offset-y max-width="600px">
<template v-slot:activator="{ on, attrs }"> <template v-slot:activator="{ on, attrs }">
<div class="text-h6"> <div class="text-h6">
<v-icon large :color="hasData ? 'primary' : null" class="mr-2" <v-icon large :color="hasData ? 'primary' : null" class="mr-2"

View File

@@ -2,7 +2,7 @@
<div v-if="value != null" class="mt-8"> <div v-if="value != null" class="mt-8">
<v-row> <v-row>
<v-col cols="12"> <v-col cols="12">
<v-menu offset-y> <v-menu offset-y max-width="600px">
<template v-slot:activator="{ on, attrs }"> <template v-slot:activator="{ on, attrs }">
<div class="text-h6"> <div class="text-h6">
<v-icon large :color="hasData ? 'primary' : null" class="mr-2" <v-icon large :color="hasData ? 'primary' : null" class="mr-2"

View File

@@ -2,7 +2,7 @@
<div v-if="value != null" class="mt-8"> <div v-if="value != null" class="mt-8">
<v-row> <v-row>
<v-col cols="12"> <v-col cols="12">
<v-menu offset-y> <v-menu offset-y max-width="600px">
<template v-slot:activator="{ on, attrs }"> <template v-slot:activator="{ on, attrs }">
<div class="text-h6"> <div class="text-h6">
<v-icon large :color="hasData ? 'primary' : null" class="mr-2" <v-icon large :color="hasData ? 'primary' : null" class="mr-2"

View File

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