|
@@ -20,7 +20,7 @@
|
|
|
placeholder="Ex: Ponto facultativo, Natal..."
|
|
placeholder="Ex: Ponto facultativo, Natal..."
|
|
|
icon="mdi-pencil-outline"
|
|
icon="mdi-pencil-outline"
|
|
|
outlined
|
|
outlined
|
|
|
- :disable="isReadOnly"
|
|
|
|
|
|
|
+ :disable="isReadOnly || !canEdit"
|
|
|
autofocus
|
|
autofocus
|
|
|
/>
|
|
/>
|
|
|
|
|
|
|
@@ -31,13 +31,13 @@
|
|
|
emit-value
|
|
emit-value
|
|
|
map-options
|
|
map-options
|
|
|
outlined
|
|
outlined
|
|
|
- :disable="isReadOnly"
|
|
|
|
|
|
|
+ :disable="isReadOnly || !canEdit"
|
|
|
/>
|
|
/>
|
|
|
</q-card-section>
|
|
</q-card-section>
|
|
|
|
|
|
|
|
<q-separator />
|
|
<q-separator />
|
|
|
|
|
|
|
|
- <template v-if="isReadOnly">
|
|
|
|
|
|
|
+ <template v-if="isReadOnly || !canEdit">
|
|
|
<q-card-actions align="right">
|
|
<q-card-actions align="right">
|
|
|
<q-btn outline color="primary" label="FECHAR" no-caps @click="onDialogCancel" />
|
|
<q-btn outline color="primary" label="FECHAR" no-caps @click="onDialogCancel" />
|
|
|
</q-card-actions>
|
|
</q-card-actions>
|
|
@@ -46,6 +46,7 @@
|
|
|
<template v-else>
|
|
<template v-else>
|
|
|
<q-card-actions align="between">
|
|
<q-card-actions align="between">
|
|
|
<q-btn
|
|
<q-btn
|
|
|
|
|
+ v-if="canDelete"
|
|
|
outline
|
|
outline
|
|
|
color="negative"
|
|
color="negative"
|
|
|
label="EXCLUIR"
|
|
label="EXCLUIR"
|
|
@@ -78,11 +79,19 @@ import DefaultDialogHeader from "src/components/defaults/DefaultDialogHeader.vue
|
|
|
import DefaultInput from "src/components/defaults/DefaultInput.vue";
|
|
import DefaultInput from "src/components/defaults/DefaultInput.vue";
|
|
|
import DefaultSelect from "src/components/defaults/DefaultSelect.vue";
|
|
import DefaultSelect from "src/components/defaults/DefaultSelect.vue";
|
|
|
import { updateHoliday, deleteHoliday } from "src/api/holiday";
|
|
import { updateHoliday, deleteHoliday } from "src/api/holiday";
|
|
|
|
|
+import { permissionStore } from "src/stores/permission";
|
|
|
|
|
|
|
|
defineEmits([...useDialogPluginComponent.emits]);
|
|
defineEmits([...useDialogPluginComponent.emits]);
|
|
|
|
|
|
|
|
const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } = useDialogPluginComponent();
|
|
const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } = useDialogPluginComponent();
|
|
|
const $q = useQuasar();
|
|
const $q = useQuasar();
|
|
|
|
|
+const permissions = permissionStore();
|
|
|
|
|
+const canEdit = computed(() =>
|
|
|
|
|
+ permissions.getAccess("franchisee_dashboard", "edit"),
|
|
|
|
|
+);
|
|
|
|
|
+const canDelete = computed(() =>
|
|
|
|
|
+ permissions.getAccess("franchisee_dashboard", "delete"),
|
|
|
|
|
+);
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
|
holiday: {
|
|
holiday: {
|