|
@@ -53,6 +53,7 @@
|
|
|
:api-call="getAssociadosPaginated"
|
|
:api-call="getAssociadosPaginated"
|
|
|
:add-item="false"
|
|
:add-item="false"
|
|
|
:extra-filters="extraFilters"
|
|
:extra-filters="extraFilters"
|
|
|
|
|
+ align-actions-left
|
|
|
open-item
|
|
open-item
|
|
|
@on-row-click="onRowClick"
|
|
@on-row-click="onRowClick"
|
|
|
>
|
|
>
|
|
@@ -65,6 +66,7 @@
|
|
|
color="violet-normal"
|
|
color="violet-normal"
|
|
|
class="col-xs-12 col-sm-6 col-md-auto"
|
|
class="col-xs-12 col-sm-6 col-md-auto"
|
|
|
style="min-width: 180px"
|
|
style="min-width: 180px"
|
|
|
|
|
+ :placeholder="$t('associado.filter_by_position')"
|
|
|
/>
|
|
/>
|
|
|
<SectorSelect
|
|
<SectorSelect
|
|
|
v-model="selectedSector"
|
|
v-model="selectedSector"
|
|
@@ -74,11 +76,12 @@
|
|
|
color="violet-normal"
|
|
color="violet-normal"
|
|
|
class="col-xs-12 col-sm-6 col-md-auto"
|
|
class="col-xs-12 col-sm-6 col-md-auto"
|
|
|
style="min-width: 180px"
|
|
style="min-width: 180px"
|
|
|
|
|
+ :placeholder="$t('associado.filter_by_sector')"
|
|
|
/>
|
|
/>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<template #body-cell-actions="{ row }">
|
|
<template #body-cell-actions="{ row }">
|
|
|
- <div class="row no-wrap items-center" style="gap: 4px">
|
|
|
|
|
|
|
+ <div class="row no-wrap justify-start items-center" style="gap: 4px">
|
|
|
<q-btn flat round dense color="violet-normal" icon="mdi-pencil" @click.stop="onRowClick({ row })" />
|
|
<q-btn flat round dense color="violet-normal" icon="mdi-pencil" @click.stop="onRowClick({ row })" />
|
|
|
<q-btn
|
|
<q-btn
|
|
|
flat round dense
|
|
flat round dense
|
|
@@ -89,6 +92,16 @@
|
|
|
/>
|
|
/>
|
|
|
<q-btn flat round dense color="violet-normal" icon="mdi-calendar" @click.stop />
|
|
<q-btn flat round dense color="violet-normal" icon="mdi-calendar" @click.stop />
|
|
|
<q-btn flat round dense color="violet-normal" icon="mdi-sofa" @click.stop />
|
|
<q-btn flat round dense color="violet-normal" icon="mdi-sofa" @click.stop />
|
|
|
|
|
+ <q-btn
|
|
|
|
|
+ v-if="row.status === 'pending' || row.status?.value === 'pending'"
|
|
|
|
|
+ flat
|
|
|
|
|
+ round
|
|
|
|
|
+ dense
|
|
|
|
|
+ color="violet-normal"
|
|
|
|
|
+ icon="mdi-check-circle-outline"
|
|
|
|
|
+ :title="$t('associado.approve_confirm')"
|
|
|
|
|
+ @click.stop="onApprove(row)"
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -114,7 +127,7 @@ import { ref, computed, defineAsyncComponent, useTemplateRef } from "vue";
|
|
|
import { useQuasar } from "quasar";
|
|
import { useQuasar } from "quasar";
|
|
|
import { useI18n } from "vue-i18n";
|
|
import { useI18n } from "vue-i18n";
|
|
|
import { permissionStore } from "src/stores/permission";
|
|
import { permissionStore } from "src/stores/permission";
|
|
|
-import { getAssociadosPaginated, importAssociados, setUserOnLeave } from "src/api/user";
|
|
|
|
|
|
|
+import { getAssociadosPaginated, importAssociados, setUserOnLeave, approveUser } from "src/api/user";
|
|
|
import { getStatusColor, getStatusI18nKey } from "src/helpers/utils";
|
|
import { getStatusColor, getStatusI18nKey } from "src/helpers/utils";
|
|
|
import { useImportPoller } from "src/composables/useImportPoller";
|
|
import { useImportPoller } from "src/composables/useImportPoller";
|
|
|
import DefaultHeaderPage from "src/components/layout/DefaultHeaderPage.vue";
|
|
import DefaultHeaderPage from "src/components/layout/DefaultHeaderPage.vue";
|
|
@@ -188,7 +201,7 @@ const columns = computed(() => [
|
|
|
{
|
|
{
|
|
|
name: "actions",
|
|
name: "actions",
|
|
|
label: t("common.terms.actions"),
|
|
label: t("common.terms.actions"),
|
|
|
- align: "right",
|
|
|
|
|
|
|
+ align: "center",
|
|
|
required: true,
|
|
required: true,
|
|
|
width: "15%",
|
|
width: "15%",
|
|
|
},
|
|
},
|
|
@@ -250,6 +263,28 @@ const onSetOnLeave = (row) => {
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const onApprove = (row) => {
|
|
|
|
|
+ if (!permission_store.getAccess("associado", "edit")) {
|
|
|
|
|
+ $q.notify({ type: "negative", message: t("validation.permissions.edit") });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $q.dialog({
|
|
|
|
|
+ title: t("associado.approve_title"),
|
|
|
|
|
+ message: t("associado.approve_message", { name: row.name }),
|
|
|
|
|
+ cancel: { flat: true, label: t("common.actions.cancel"), color: "grey-7" },
|
|
|
|
|
+ ok: { unelevated: true, label: t("associado.approve_confirm"), color: "violet-normal" },
|
|
|
|
|
+ persistent: true,
|
|
|
|
|
+ }).onOk(async () => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ await approveUser(row.id);
|
|
|
|
|
+ tableRef.value?.refresh();
|
|
|
|
|
+ } catch {
|
|
|
|
|
+ // silent
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
const onOpenImportHistory = () => {
|
|
const onOpenImportHistory = () => {
|
|
|
$q.dialog({ component: ImportHistoryDialog, componentProps: { type: 'associado' } });
|
|
$q.dialog({ component: ImportHistoryDialog, componentProps: { type: 'associado' } });
|
|
|
};
|
|
};
|