Merge branch 'develop' into devTee

This commit is contained in:
STW_TTTY\stwtt 2024-06-28 11:28:56 +07:00
commit 7bb72d96f9
13 changed files with 277 additions and 160 deletions

View file

@ -134,7 +134,7 @@ watch(
<q-img :src="profile.avatar" v-if="profile.avatar !== ''" />
<q-img src="@/assets/avatar_user.jpg" v-else />
</div>
<div class="col-xs-6 col-sm-3 row items-center">
<div class="col-xs-6 col-sm-3 row">
<div class="col-12 q-pl-md">
<div class="col-12 text-top">
{{ props.type == "employee" ? "ตำแหน่ง" : "ตำแหน่งในสายงาน" }}
@ -144,7 +144,7 @@ watch(
</div>
</div>
</div>
<div class="col-xs-6 col-sm-3 row items-center">
<div class="col-xs-6 col-sm-3 row">
<div class="col-12">
<div class="col-12 text-top">
{{ props.type == "employee" ? "กลุ่มงาน" : "ประเภทตำแหน่ง" }}
@ -154,7 +154,7 @@ watch(
</div>
</div>
</div>
<div class="col-xs-6 col-sm-3 row items-center">
<div class="col-xs-6 col-sm-3 row">
<div class="col-12">
<div class="col-12 text-top">งก</div>
<div class="col-12 text-detail">

View file

@ -661,7 +661,86 @@ onMounted(async () => {
</q-btn>
</div>
<q-card>
<q-card class="my-card" flat bordered>
<q-card-section>
<div class="col row items-center">
<div class="row col-12">
<div class="col" style="padding-left: 13%">
<div class="col-12 text-primary">
<h2
class="title q-ma-none q-pa-none"
v-if="formDetail && formDetail.firstName && formDetail.lastName"
>
{{
`${formDetail?.prefix ? formDetail?.prefix : ""}${
formDetail?.firstName
} ${formDetail?.lastName} ${leaveReason}`
}}
</h2>
</div>
<!-- <div class="col-12 subtitle">{{ formDetail?.position }}</div> -->
</div>
</div>
</div>
</q-card-section>
<q-card-section style="padding: 0px">
<div
class="absolute"
style="top: 0; left: 12px; transform: translateY(-50%)"
>
<q-avatar size="90px" class="bg-grey-2">
<q-img :src="profilePicture" />
</q-avatar>
<q-btn
round
text-color="primary"
icon="mdi-pencil-outline"
@click="openDialogImg"
size="sm"
unelevated
class="bg-white btnEditImg"
>
</q-btn>
</div>
<div class="row items-center bg-toolbar">
<div class="row col-12" style="padding-left: 14%">
<div class="col-4">
<div class="col-sm-3 col-md-3">
<div class="col text-grey-6 text-caption">
{{ empType === "" ? "ตำแหน่งในสายงาน" : "ตำแหน่ง" }}
</div>
<div class="col">{{ formDetail?.position || "-" }}</div>
</div>
</div>
<div class="col-4">
<div class="col-sm-3 col-md-3">
<div class="col text-grey-6 text-caption">
{{ empType === "" ? "ตำแหน่งประเภท" : "กลุ่มงาน" }}
</div>
<div class="col">
{{ formDetail?.posType?.posTypeName || "-" }}
</div>
</div>
</div>
<div class="col-4">
<div class="col-sm-3 col-md-3">
<div class="col text-grey-6 text-caption">
{{ empType === "" ? "ระดับ" : "ระดับชั้นงาน" }}
</div>
<div class="col">
{{ formDetail?.posLevel?.posLevelName || "-" }}
</div>
</div>
</div>
</div>
</div>
</q-card-section>
<q-separator />
</q-card>
<!-- <q-card>
<div class="column" style="height: 120px">
<div class="col row items-center">
<div class="row col-12">
@ -678,7 +757,6 @@ onMounted(async () => {
}}
</h2>
</div>
<!-- <div class="col-12 subtitle">{{ formDetail?.position }}</div> -->
</div>
</div>
</div>
@ -732,7 +810,7 @@ onMounted(async () => {
</div>
</div>
</div>
</q-card>
</q-card> -->
<q-card bordered class="q-mt-md rounded">
<TabMain :fetchDataPersonal="fetchDataPersonal" />

View file

@ -316,7 +316,12 @@ onMounted(() => {
<div
v-else
:class="col.name === 'affiliation' ? 'table_ellipsis' : ''"
:class="
col.name === 'organizationPositionOld' ||
col.name === 'organization'
? 'table_ellipsis'
: ''
"
>
{{ col.value ? col.value : "-" }}
</div>

View file

@ -287,7 +287,7 @@ const pagination = ref({
<div
v-else
:class="col.name === 'org' ? 'table_ellipsis' : ''"
:class="col.name === 'organizationPositionOld' ? 'table_ellipsis' : ''"
>
{{ col.value ? col.value : "-" }}
</div>

View file

@ -341,7 +341,7 @@ const pagination = ref({
: ''
"
>
{{ col.value == null ? "" : col.value }}
{{ col.value == null ? "-" : col.value }}
</div>
</q-td>
</q-tr>

View file

@ -364,7 +364,7 @@ const typeReportChangeName = (val: string) => {
{{ props.rowIndex + 1 }}
</q-td>
<q-td key="signDate" :props="props">
{{ props.row.signDate }}
{{ props.row.signDate ? props.row.signDate : "-" }}
</q-td>
<q-td key="Date" :props="props">
{{ props.row.Date }}

View file

@ -26,7 +26,7 @@ const leaveStore = useLeavelistDataStore();
<q-tab name="2" label="รายการยกเลิกใบลา" />
</q-tabs>
<q-separator />
<div class="q-pa-sm">
<div>
<q-tab-panels v-model="leaveStore.tabMenu" animated>
<q-tab-panel name="1"> <Tab1 /> </q-tab-panel>

View file

@ -348,6 +348,7 @@ const columnsSpeciel = ref<QTableProps["columns"]>([
format: (v) => Number(v).toLocaleString(),
},
]);
const columns = computed(() => {
const columnsss =
store.roundMainCode === "APR"
@ -371,8 +372,9 @@ const visibleColumns = ref<string[]>(
"remainingAmount",
"totalBackup",
]
: []
: ["org", "total", "chosen", "totalBackup"]
);
const filter = ref<string>("");
function fetchDataDashboard() {
showLoader();
@ -462,59 +464,75 @@ watch([() => props?.snapShot, () => props.roundFilter], () => {
</q-card-section>
</q-card>
</div>
<!-- <div class="row col justify-end self-center">
<q-btn-dropdown color="blue-5" label="ดาวน์โหลด">
<q-list>
<q-item
v-for="(item, index) in store.roundMainCode === 'APR'
? store.itemDownloadApr
: store.roundMainCode === 'OCT'
? store.itemDownloadOct
: []"
:key="index"
clickable
v-close-popup
@click="onClickDownload(item)"
>
<q-item-section>
<q-item-label>{{ item.name }}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</div> -->
</div>
</div>
<q-separator />
<div class="col-12 q-pa-md">
<d-table
for="table"
ref="table"
:columns="columns"
:rows="rows"
row-key="id"
flat
bordered
dense
class="custom-header-table"
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div class="table_ellipsis">
{{ col.value }}
</div>
</q-td>
</q-tr>
</template>
</d-table>
<div class="row q-pa-md">
<div class="col-12">
<q-toolbar style="padding: 0px">
<q-space />
<div class="row q-col-gutter-sm">
<q-input
borderless
dense
debounce="300"
v-model="filter"
placeholder="ค้นหา"
outlined
>
<template v-slot:append>
<q-icon name="search" />
</template>
</q-input>
<q-select
v-model="visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
options-cover
style="min-width: 150px"
/>
</div>
</q-toolbar>
</div>
<div class="col-12">
<d-table
for="table"
ref="table"
:columns="columns"
:rows="rows"
row-key="id"
flat
bordered
dense
class="custom-header-table"
:filter="filter"
:visible-columns="visibleColumns"
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div class="table_ellipsis">
{{ col.value }}
</div>
</q-td>
</q-tr>
</template>
</d-table>
</div>
</div>
</template>

View file

@ -360,6 +360,22 @@ const columnsSpeciel = ref<QTableProps["columns"]>([
format: (v) => Number(v).toLocaleString(),
},
]);
const visibleColumns = ref<string[]>(
store.roundMainCode === "APR"
? ["org", "total", "chosen", "totalBackup"]
: store.roundMainCode === "OCT"
? [
"org",
"currentAmount",
"sixPercentAmount",
"spentAmount",
"sixPercentSpentAmount",
"useAmount",
"remainingAmount",
"totalBackup",
]
: ["org", "total", "fifteenPercent", "chosen", "remaining", "totalBackup"]
);
const columns = computed(() => {
const columnsss =
store.roundMainCode === "APR"
@ -369,6 +385,7 @@ const columns = computed(() => {
: columnsSpeciel.value;
return columnsss;
});
const filter = ref<string>("");
/** function fetch ข้อมูลสถิติ*/
function fetchDataDashboard() {
@ -500,58 +517,74 @@ watch([() => props?.snapShot, () => props.roundFilter], () => {
</q-card-section>
</q-card>
</div>
<!-- <div class="row col justify-end self-center">
<q-btn-dropdown color="blue-5" label="ดาวน์โหลด">
<q-list>
<q-item
v-for="(item, index) in store.roundMainCode === 'APR'
? store.itemDownloadApr
: store.roundMainCode === 'OCT'
? store.itemDownloadOct
: []"
:key="index"
clickable
v-close-popup
@click="onClickDownload(item)"
>
<q-item-section>
<q-item-label>{{ item.name }}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</div> -->
</div>
</div>
<q-separator />
<div class="col-12 q-pa-md">
<d-table
for="table"
ref="table"
:columns="columns"
:rows="rows"
row-key="id"
flat
bordered
dense
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div class="table_ellipsis">
{{ col.value }}
</div>
</q-td>
</q-tr>
</template>
</d-table>
<div class="row q-pa-md">
<div class="col-12">
<q-toolbar style="padding: 0px">
<q-space />
<div class="row q-col-gutter-sm">
<q-input
borderless
dense
debounce="300"
v-model="filter"
placeholder="ค้นหา"
outlined
>
<template v-slot:append>
<q-icon name="search" />
</template>
</q-input>
<q-select
v-model="visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
options-cover
style="min-width: 150px"
/>
</div>
</q-toolbar>
</div>
<div class="col-12">
<d-table
for="table"
ref="table"
:columns="columns"
:rows="rows"
row-key="id"
flat
bordered
dense
:filter="filter"
:visible-columns="visibleColumns"
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div class="table_ellipsis">
{{ col.value }}
</div>
</q-td>
</q-tr>
</template>
</d-table>
</div>
</div>
</template>

View file

@ -356,7 +356,6 @@ function onClickDownload(data: DataOption) {
const modalDialogInfoCriteria = ref<boolean>(false);
onMounted(() => {
console.log(props.rootId);
if (props.rootId) {
fetchDataQuota(store.groupId);
fetchDataPeriod(store.groupId);

View file

@ -154,6 +154,8 @@ async function getAgency(id: string) {
(await http
.get(config.API.activeOrganizationRootById(id))
.then(async (res) => {
agencyOptions.value = [];
agencyOptionsMain.value = [];
const data = res.data.result;
agencyOptionsMain.value = await [
{
@ -247,13 +249,14 @@ async function onChangeRound() {
await getSnap(roundFilter.value.shortCode);
await getAgency(roundFilter.value.revisionId);
// await getAgencyPosition(roundFilter.value.revisionId);
await getAgencyPosition(roundFilter.value.revisionId);
if (agencyFilter.value && roundFilter.value.id && snapFilter.value) {
fetchSalalyPeriod(
agencyFilter.value,
roundFilter.value.id,
snapFilter.value
);
// fetchSalalyPeriod(
// agencyFilter.value,
// roundFilter.value.id,
// snapFilter.value
// );
store.tabType = "PENDING";
store.roundMainCode = roundFilter.value.shortCode;
} else {
@ -320,6 +323,7 @@ function filterSelector(val: any, update: Function, refData: string) {
switch (refData) {
case "agencyFilter":
update(() => {
agencyFilter.value = "";
agencyOptions.value = agencyOptionsMain.value.filter(
(v: DataOption) => v.name.indexOf(val) > -1
);

View file

@ -89,8 +89,6 @@ function getRound() {
store.roundYear = roundFilter.value.year;
store.isClosedRound = roundFilter.value.isClose;
console.log(roundFilter.value);
await getSnap(roundFilter.value.shortCode);
await getAgency(roundFilter.value.revisionId);
await getAgencyPosition(roundFilter.value.revisionId);
@ -157,6 +155,8 @@ async function getAgency(id: string) {
.get(config.API.activeOrganizationRootById(id))
.then(async (res) => {
const data = res.data.result;
agencyOptions.value = [];
agencyOptionsMain.value = [];
agencyOptionsMain.value = await [
{
id: "ALL",
@ -189,14 +189,12 @@ async function getAgencyPosition(id: string) {
.get(config.API.keycloakPositionByid(id))
.then(async (res) => {
const data = await res.data.result;
store.rootId = data.rootId;
const position = agencyOptions.value?.find(
(e: DataOption) => e.id === data.rootId
);
agencyFilter.value = position ? position.id : "ALL";
if (agencyFilter.value && roundFilter.value.id && snapFilter.value) {
fetchSalalyPeriod(
agencyFilter.value,
@ -266,12 +264,8 @@ async function onChangeRound() {
}
getSnap(roundFilter.value.shortCode);
await getAgency(roundFilter.value.revisionId);
await getAgencyPosition(roundFilter.value.revisionId);
if (agencyFilter.value && roundFilter.value.id && snapFilter.value) {
fetchSalalyPeriod(
agencyFilter.value,
roundFilter.value.id,
snapFilter.value
);
store.tabType = "PENDING";
store.roundMainCode = roundFilter.value.shortCode;
store.roundYear = roundFilter.value.year;
@ -282,6 +276,7 @@ async function onChangeRound() {
/** function เปลี่ยนรอบ*/
async function onChangeSnap() {
agencyFilter.value = "";
if (agencyFilter.value && roundFilter.value.id && snapFilter.value) {
await fetchSalalyPeriod(
agencyFilter.value,
@ -307,29 +302,6 @@ async function onChangeAgency() {
}
}
/** function onScrollSelect รอบการขึ้นเงินเดือน*/
function onScroll({ to, ref }: { to: number; ref: any }) {
const lastIndex = roundOptions.value.length - 1;
if (
loading.value !== true &&
nextPage.value < lastPage.value &&
to === lastIndex
) {
loading.value = true;
setTimeout(() => {
nextPage.value++;
page.value = nextPage.value;
getRound();
nextTick(() => {
ref.refresh();
loading.value = false;
});
}, 500);
}
}
/** function fetch PeriodQuota*/
function getQuota() {
http
@ -340,8 +312,7 @@ function getQuota() {
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {});
});
}
/**
@ -354,6 +325,7 @@ function filterSelector(val: string, update: Function, refData: string) {
switch (refData) {
case "agencyFilter":
update(() => {
agencyFilter.value = "";
agencyOptions.value = agencyOptionsMain.value.filter(
(v: DataOption) => v.name.indexOf(val) > -1
);
@ -422,8 +394,6 @@ onMounted(() => {
hide-bottom-space
bg-color="white"
@update:model-value="onChangeRound"
:loading="loading"
@virtual-scroll="onScroll"
:disable="!isDisable"
>
<template v-slot:option="scope">
@ -452,6 +422,7 @@ onMounted(() => {
@update:model-value="onChangeSnap"
:disable="!isDisable"
/>
<q-select
class="q-ml-xs"
v-model="agencyFilter"
@ -463,7 +434,6 @@ onMounted(() => {
option-label="name"
option-value="id"
:options="agencyOptions"
lazy-rules
hide-bottom-space
bg-color="white"
@update:model-value="onChangeAgency"
@ -473,13 +443,19 @@ onMounted(() => {
doneFn:Function) => filterSelector(inputValue, doneFn,'agencyFilter'
) "
>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey"> ไมอม </q-item-section>
</q-item>
</template>
<template v-if="agencyFilter !== 'ALL'" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="agencyFilter = 'ALL'"
class="cursor-pointer"
/> </template
></q-select>
/>
</template>
</q-select>
</div>
<q-card flat bordered>

View file

@ -324,17 +324,21 @@ const columns = ref<QTableProps["columns"]>([
]);
function onClickModal() {
modal.value = !modal.value;
modal.value = true;
if ((modal.value = true)) {
fetchListPerson();
}
}
function onCloseModal() {
modal.value = false;
}
function fetchListPerson() {}
function onSelectPerson(id: string) {
persanalId.value = id;
modal.value = false;
onCloseModal();
fetchReport();
}
@ -624,7 +628,7 @@ onMounted(() => {
<q-dialog v-model="modal" persistent>
<q-card style="width: 900px; max-width: 80vw">
<DialogHeader :tittle="'เลือกราชชื่อ'" :close="onClickModal" />
<DialogHeader :tittle="'เลือกราชชื่อ'" :close="onCloseModal" />
<q-separator />
<q-card-section class="q-col-gutter-sm">
<div class="col-12">