Merge branch 'develop' into devTee

This commit is contained in:
setthawutttty 2025-06-05 15:39:20 +07:00
commit 832cb12367
134 changed files with 4809 additions and 1610 deletions

View file

@ -144,6 +144,7 @@ async function fetchListTimeRecord() {
keyword: keyword.value.trim(), //keyword
profileType: roleStatus.value.trim(), //keyword
};
showLoader();
await http
.get(
@ -219,10 +220,11 @@ onMounted(async () => {
@update:pagination="updatePaging"
v-model:role-status="roleStatus"
/>
<TableList
:total="total"
:rows="rows.length > 0 ? rows : []"
:page="page"
v-model:page="page"
:rowsPerPage="rowsPerPage"
:maxPage="maxPage"
@update:pagination="updatePaging"

View file

@ -181,7 +181,7 @@ onMounted(async () => {
<TableList
:total="total"
:rows="rows.length > 0 ? rows : []"
:page="page"
v-model:page="page"
:rowsPerPage="rowsPerPage"
:maxPage="maxPage"
@update:pagination="updatePagingProp"

View file

@ -9,15 +9,18 @@ import DialogDetail from "@/modules/09_leave/components/02_WorkList/DialogDetail
import DialogEdit from "@/modules/09_leave/components/02_WorkList/DialogEdit.vue";
const workStore = useWorklistDataStore();
const currentPage = defineModel<number>("page", {
default: 1,
});
const props = defineProps({
rows: {
type: Object,
require: true,
},
page: {
type: Number,
require: true,
},
// page: {
// type: Number,
// require: true,
// },
rowsPerPage: {
type: Number,
require: true,
@ -48,10 +51,10 @@ const dataDetail = ref<any>();
const modalEdit = ref<boolean>(false);
/** pagination */
const currentPage = ref<number>(1);
// const currentPage = ref<number>(1);
const pagination = ref({
descending: false,
page: Number(props.page),
page: Number(currentPage.value),
rowsPerPage: props.rowsPerPage,
});

View file

@ -9,6 +9,7 @@ import genReport from "@/plugins/genreport";
import { useCounterMixin } from "@/stores/mixin";
import { useLeavelistDataStore } from "@/modules/09_leave/stores/LeaveStore";
import { checkPermission } from "@/utils/permissions";
import { useRoleWorkflowDataStore } from "@/stores/roleWorkflow";
/** importType */
import type { FremData } from "@/modules/09_leave/interface/request/leave";
@ -38,6 +39,7 @@ import DialogAddCommander from "@/modules/09_leave/components/05_Leave/Dialog/Di
/** use */
const $q = useQuasar();
const mixin = useCounterMixin();
const { fetchDataCheckIsoffice } = useRoleWorkflowDataStore();
const {
dialogConfirm,
showLoader,
@ -426,10 +428,7 @@ function checkLeaveType(leaveTypeId: string, formData: FremData) {
checkForm.value = "FormHajj";
} else if (type === "LV-007") {
checkForm.value = "FormCheckSelect";
} else if (
type === "LV-008" &&
formData.leaveSubTypeName === "ศึกษาต่อ"
) {
} else if (type === "LV-008" && formData.leaveSubTypeName === "ศึกษาต่อ") {
checkForm.value = "FormStudy";
} else if (
(type === "LV-008" && formData.leaveSubTypeName === "ฝึกอบรม") ||
@ -615,23 +614,19 @@ function onSend() {
}
async function checkOfficer() {
http
.get(
config.API.checkIsofficer +
`${
formData.profileType == "OFFICER"
? "SYS_LEAVE_LIST"
: "SYS_LEAVE_LIST_EMP"
}`
)
.then(async (res) => {
isOfficer.value = await res.data.result.isOfficer;
isStaff.value = await res.data.result.isStaff;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {});
try {
const data = await fetchDataCheckIsoffice(
`${
formData.profileType == "OFFICER"
? "SYS_LEAVE_LIST"
: "SYS_LEAVE_LIST_EMP"
}`
);
isOfficer.value = data.isOfficer;
isStaff.value = data.isStaff;
} catch (err) {
messageError($q, err);
}
}
async function fetchKeycloakPosition() {

View file

@ -9,6 +9,7 @@ import genReport from "@/plugins/genreport";
import { useCounterMixin } from "@/stores/mixin";
import { useLeavelistDataStore } from "@/modules/09_leave/stores/LeaveStore";
import { checkPermission } from "@/utils/permissions";
import { useRoleWorkflowDataStore } from "@/stores/roleWorkflow";
/** importType */
import type {
@ -35,6 +36,7 @@ import FormVocationalRehabilitation from "@/modules/09_leave/components/05_Leave
/** use */
const $q = useQuasar();
const { fetchDataCheckIsoffice } = useRoleWorkflowDataStore();
const mixin = useCounterMixin();
const {
dialogConfirm,
@ -457,23 +459,19 @@ async function onClickDownloadFile(id: string, fileName: string, type: string) {
}
async function checkOfficer() {
http
.get(
config.API.checkIsofficer +
`${
formData.profileType == "OFFICER"
? "SYS_LEAVE_LIST"
: "SYS_LEAVE_LIST_EMP"
}`
)
.then(async (res) => {
isOfficer.value = await res.data.result.isOfficer;
isStaff.value = await res.data.result.isStaff;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {});
try {
const data = await fetchDataCheckIsoffice(
`${
formData.profileType == "OFFICER"
? "SYS_LEAVE_LIST"
: "SYS_LEAVE_LIST_EMP"
}`
);
isOfficer.value = data.isOfficer;
isStaff.value = data.isStaff;
} catch (err) {
messageError($q, err);
}
}
async function fetchKeycloakPosition() {
@ -839,7 +837,7 @@ async function fetchKeycloakPosition() {
v-if="
rows &&
rows.approvers[0]?.profileId == myProfileId &&
rows.approvers[0]?.approveStatus == 'PENDING'
formDataReject.status == 'NEW'
"
/>
<div
@ -847,12 +845,11 @@ async function fetchKeycloakPosition() {
v-if="
rows &&
rows.approvers[0]?.profileId == myProfileId &&
rows.approvers[0]?.approveStatus == 'PENDING'
formDataReject.status == 'NEW'
"
>
<q-btn
unelevated
:disable="rows?.approvers.length == 0 || rows?.commanders.length == 0"
color="orange-5"
label="ไม่อนุญาต"
@click="openModal('UnApprove')"