Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m47s

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-05-11 15:56:07 +07:00
commit dd875380df
4 changed files with 51 additions and 21 deletions

View file

@ -212,17 +212,17 @@ const columnsPosition = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "type",
align: "left",
label: "ประเภทแบบฟอร์ม",
sortable: true,
field: "type",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
// {
// name: "type",
// align: "left",
// label: "",
// sortable: true,
// field: "type",
// headerStyle: "font-size: 14px",
// style: "font-size: 14px",
// sort: (a: string, b: string) =>
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
// },
]);
const shouldShowPaymentFields = computed(() => {
@ -1476,7 +1476,7 @@ onMounted(async () => {
</div>
</q-td>
<q-td key="type" :props="props">
<!-- <q-td key="type" :props="props">
<selector
class=""
outlined
@ -1490,7 +1490,7 @@ onMounted(async () => {
lazy-rules
:rules="[(val:any) => !!val || `${'กรุณาเลือกประเภทแบบฟอร์ม'}`]"
></selector>
</q-td>
</q-td> -->
</q-tr>
</template>
</ProfileTable>

View file

@ -150,21 +150,41 @@ const rows = ref<RowsType>();
//
const idCheck = computed(() => {
if (typeAdd.value == "COMMANDER") {
return rows.value?.commanders.map((items: SeqTypeRow) => items.profileId);
return rows.value?.commanders.map((items: SeqTypeRow) => items.keyId);
} else if (typeAdd.value == "APPROVER") {
return rows.value?.approvers.map((items: SeqTypeRow) => items.profileId);
return rows.value?.approvers.map((items: SeqTypeRow) => items.keyId);
}
});
//
const commanderList = computed(() => {
if (typeAdd.value == "COMMANDER") {
return rows.value?.approvers.map((items: SeqTypeRow) => items.profileId);
} else if (typeAdd.value == "APPROVER") {
return rows.value?.commanders.map((items: SeqTypeRow) => items.profileId);
if (typeAdd.value === "COMMANDER") {
return rows.value?.approvers.map((items: SeqTypeRow) => ({
profileId: items.profileId,
isAct: items.isAct,
}));
} else if (typeAdd.value === "APPROVER") {
return rows.value?.commanders.map((items: SeqTypeRow) => ({
profileId: items.profileId,
isAct: items.isAct,
}));
}
return [];
});
//
const isAct = computed(() => {
if (typeAdd.value === "COMMANDER") {
return rows.value?.commanders && rows.value.commanders.length > 0
? rows.value.commanders[0].isAct
: false;
} else if (typeAdd.value === "APPROVER") {
return rows.value?.approvers && rows.value.approvers.length > 0
? rows.value.approvers[0].isAct
: false;
}
return false;
});
//
const approveCheck = computed(() => {
const commanders = rows.value?.commanders;
@ -1272,5 +1292,6 @@ onMounted(async () => {
:id-check="idCheck"
:keycloak-user-id="keycloakUserId"
:commanders-list="commanderList"
:commanders-is-act="isAct"
/>
</template>

View file

@ -30,6 +30,7 @@ const props = defineProps({
fetchDetailLeave: Function,
idCheck: Array,
commandersList: Array,
commandersIsAct: Boolean,
});
const pageId = ref<string>(route.params.id as string);
@ -117,7 +118,7 @@ async function getData() {
total.value = data.total;
rows.value = data.data;
selected.value = data.data.filter((items: any) => {
return props.idCheck?.some((i: any) => i === items.id);
return props.idCheck?.some((i: any) => i === items.key);
});
})
.catch((err) => {
@ -153,10 +154,14 @@ function onSubmit() {
]
.filter(Boolean)
.join(" "),
isAct: isAct.value,
keyId: items.key,
}));
const hasCommander = selected.value.some((e) =>
props.commandersList?.some((i: any) => i === e.id)
props.commandersList?.some(
(i: any) => i.profileId === e.id && i.isAct === isAct.value
)
);
if (hasCommander) {
@ -205,6 +210,7 @@ watch(
() => modal.value,
() => {
if (modal.value) {
isAct.value = props.commandersIsAct ?? false;
getSearch();
}
}
@ -233,6 +239,7 @@ watch(
label="ค้นหา"
v-model="keyword"
style="width: 300px"
@keydown.enter.prevent="onSearchData()"
>
<template v-slot:append>
<q-icon name="search"></q-icon>

View file

@ -50,6 +50,8 @@ interface SeqTypeRow {
keycloakId: string;
approveStatus: string;
comment: string;
keyId?: string;
isAct?: boolean;
}
interface DataDateMonthObject {
month: number;