|
@@ -53,7 +53,7 @@
|
|
|
|
|
|
|
|
<!-- Responsável — só aparece quando destino é Interno -->
|
|
<!-- Responsável — só aparece quando destino é Interno -->
|
|
|
<DefaultSelect
|
|
<DefaultSelect
|
|
|
- v-if="form.scope === 'internal'"
|
|
|
|
|
|
|
+ v-if="canViewUsers && form.scope === 'internal'"
|
|
|
v-model="form.responsible_user_id"
|
|
v-model="form.responsible_user_id"
|
|
|
label="Responsável"
|
|
label="Responsável"
|
|
|
:options="userOptions"
|
|
:options="userOptions"
|
|
@@ -103,7 +103,7 @@
|
|
|
|
|
|
|
|
<!-- Tab: Comentários -->
|
|
<!-- Tab: Comentários -->
|
|
|
<div v-show="currentTab === 'comentarios'">
|
|
<div v-show="currentTab === 'comentarios'">
|
|
|
- <div class="flex justify-end q-mb-sm">
|
|
|
|
|
|
|
+ <div v-if="canAdd" class="flex justify-end q-mb-sm">
|
|
|
<q-btn
|
|
<q-btn
|
|
|
color="primary"
|
|
color="primary"
|
|
|
icon="mdi-plus"
|
|
icon="mdi-plus"
|
|
@@ -141,7 +141,7 @@
|
|
|
|
|
|
|
|
<!-- Tab: Mídias -->
|
|
<!-- Tab: Mídias -->
|
|
|
<div v-show="currentTab === 'midias'">
|
|
<div v-show="currentTab === 'midias'">
|
|
|
- <div class="flex justify-end q-mb-sm">
|
|
|
|
|
|
|
+ <div v-if="canAdd" class="flex justify-end q-mb-sm">
|
|
|
<q-btn
|
|
<q-btn
|
|
|
color="primary"
|
|
color="primary"
|
|
|
icon="mdi-upload-outline"
|
|
icon="mdi-upload-outline"
|
|
@@ -188,7 +188,7 @@
|
|
|
|
|
|
|
|
<q-card-actions align="right" class="q-px-md q-pb-md" style="flex-shrink: 0">
|
|
<q-card-actions align="right" class="q-px-md q-pb-md" style="flex-shrink: 0">
|
|
|
<q-btn outline color="primary" label="Cancelar" @click="onDialogCancel" />
|
|
<q-btn outline color="primary" label="Cancelar" @click="onDialogCancel" />
|
|
|
- <q-btn color="primary" label="Salvar" type="submit" :loading="loading" />
|
|
|
|
|
|
|
+ <q-btn v-if="canSave" color="primary" label="Salvar" type="submit" :loading="loading" />
|
|
|
</q-card-actions>
|
|
</q-card-actions>
|
|
|
</q-form>
|
|
</q-form>
|
|
|
</q-card>
|
|
</q-card>
|
|
@@ -221,6 +221,7 @@ import {
|
|
|
deleteKanbanMedia,
|
|
deleteKanbanMedia,
|
|
|
} from "src/api/kanban_media";
|
|
} from "src/api/kanban_media";
|
|
|
import { getUsersByUnit } from "src/api/user";
|
|
import { getUsersByUnit } from "src/api/user";
|
|
|
|
|
+import { permissionStore } from "src/stores/permission";
|
|
|
|
|
|
|
|
defineEmits([...useDialogPluginComponent.emits]);
|
|
defineEmits([...useDialogPluginComponent.emits]);
|
|
|
|
|
|
|
@@ -233,6 +234,11 @@ const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } =
|
|
|
useDialogPluginComponent();
|
|
useDialogPluginComponent();
|
|
|
|
|
|
|
|
const $q = useQuasar();
|
|
const $q = useQuasar();
|
|
|
|
|
+const permissions = permissionStore();
|
|
|
|
|
+const canAdd = computed(() => permissions.getAccess("franchisee_activities", "add"));
|
|
|
|
|
+const canEdit = computed(() => permissions.getAccess("franchisee_activities", "edit"));
|
|
|
|
|
+const canSave = computed(() => card?.id ? canEdit.value : canAdd.value);
|
|
|
|
|
+const canViewUsers = computed(() => permissions.getAccess("franchisee_users", "view"));
|
|
|
|
|
|
|
|
const formRef = ref(null);
|
|
const formRef = ref(null);
|
|
|
const loading = ref(false);
|
|
const loading = ref(false);
|
|
@@ -310,6 +316,7 @@ const buildPayload = () => ({
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const loadUsers = async () => {
|
|
const loadUsers = async () => {
|
|
|
|
|
+ if (!canViewUsers.value) return;
|
|
|
try {
|
|
try {
|
|
|
const users = await getUsersByUnit();
|
|
const users = await getUsersByUnit();
|
|
|
userOptions.value = users.map((u) => ({ label: u.name, value: u.id }));
|
|
userOptions.value = users.map((u) => ({ label: u.name, value: u.id }));
|