Merge branch 'develop' into devTee
This commit is contained in:
commit
832cb12367
134 changed files with 4809 additions and 1610 deletions
|
|
@ -181,11 +181,11 @@ export default {
|
|||
|
||||
//EditPage
|
||||
salaryTemp: `${orgProfile}/salaryTemp`,
|
||||
profilePermission: `${orgProfile}/keycloak/permissionProfile`,
|
||||
profilePermission: (rootId: string) =>
|
||||
`${orgProfile}/keycloak/permissionProfile/${rootId}`,
|
||||
profileidPosition: (type: string) =>
|
||||
`${orgProfile}${type}/profileid/position`,
|
||||
|
||||
workflowCommanderOperate:`${workflow}/commander/operate`,
|
||||
workflowCommanderSign:`${workflow}/commander/sign`,
|
||||
|
||||
workflowCommanderOperate: `${workflow}/commander/operate`,
|
||||
workflowCommanderSign: `${workflow}/commander/sign`,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -77,9 +77,31 @@ export default {
|
|||
//รายงาน
|
||||
retirementReport: `${report}`,
|
||||
|
||||
addResign: (profileType:string,type: string, id: string) =>
|
||||
addResign: (profileType: string, type: string, id: string) =>
|
||||
`${retirement}/resign${profileType}/officer/add-resign/${type}/${id}`,
|
||||
|
||||
sendApproveRetirement:(type:string,id:string)=>`${retirement}/resign${type}/admin/approve/officer/${id}`,
|
||||
commanderApproveRetirement:(type:string,id:string,typeApprove:string,path:string)=>`${retirement}/resign${type}/admin/${typeApprove}${path}/${id}`
|
||||
addResignCancel: (profileType: string, type: string, id: string) =>
|
||||
`${retirement}/resign${profileType}/officer-cancel/add-resign/${type}/${id}`,
|
||||
|
||||
sendApproveRetirement: (type: string, id: string) =>
|
||||
`${retirement}/resign${type}/admin/approve/officer/${id}`,
|
||||
commanderApproveRetirement: (
|
||||
type: string,
|
||||
id: string,
|
||||
typeApprove: string,
|
||||
path: string = ""
|
||||
) => `${retirement}/resign${type}/admin/${typeApprove}${path}/${id}`,
|
||||
|
||||
// รายการยกเลิกการลาออก
|
||||
// สำหรับเจ้าหน้าที่
|
||||
officerCancelResign: (typeEmp: string, id: string) =>
|
||||
`${retirement}/resign${typeEmp}/admin-cancel/approve/officer/${id}`,
|
||||
|
||||
// สำหรับผู้บังคับบัญชา
|
||||
comanderCancelResign: (typeEmp: string, action: string, id: string) =>
|
||||
`${retirement}/resign${typeEmp}/admin-cancel/${action}/comander/${id}`,
|
||||
|
||||
// สำหรับผู้มีอำนาจ
|
||||
approverCancelResign: (typeEmp: string, action: string, id: string) =>
|
||||
`${retirement}/resign${typeEmp}/admin-cancel/${action}/${id}`,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -23,33 +23,44 @@ export default {
|
|||
ocId: string,
|
||||
role: string,
|
||||
status: any,
|
||||
isDeputy: boolean = false
|
||||
isDeputy: boolean = false,
|
||||
type: string = "officer"
|
||||
) =>
|
||||
`${insignia}/request/${insigniaPeriodId}/${ocId}/${role}/${status}/${isDeputy}`,
|
||||
`${insignia}/request/${insigniaPeriodId}/${ocId}/${role}/${status}/${isDeputy}/${type}`,
|
||||
insigniaReject: (profileId: string) =>
|
||||
`${insignia}/request/status/reject/${profileId}`,
|
||||
insigniaDelete: (profileId: string) =>
|
||||
`${insignia}/request/status/delete/${profileId}`,
|
||||
insigniaEdit: (profileId: string) => `${insignia}/request/${profileId}`,
|
||||
insigniaNosend: (insigniaPeriodId: any) =>
|
||||
`${insignia}/request/org/no-send/${insigniaPeriodId}`,
|
||||
insigniaNosend: (insigniaPeriodId: any, type: string = "officer") =>
|
||||
`${insignia}/request/org/no-send/${type}/${insigniaPeriodId}`,
|
||||
insigniaAgency: () => `${insignia}/request/agency`,
|
||||
insigniaDashboard: (insigniaPeriodId: string) =>
|
||||
`${insignia}/request/dashboard/${insigniaPeriodId}`,
|
||||
insigniaDashboard: (insigniaPeriodId: string, type: string = "officer") =>
|
||||
`${insignia}/request/dashboard/${type}/${insigniaPeriodId}`,
|
||||
// record
|
||||
noteround: () => `${insignia}/request/note`,
|
||||
requestDocNote: (id: string) => `${insignia}/request/note/doc/${id}`,
|
||||
noteSearch: () => `${insignia}/request/note/search`,
|
||||
noteSearch: (type: string = "officer") =>
|
||||
`${insignia}/request/note/search/${type}`,
|
||||
noteSearchList: () => `${insignia}/request/note-list/search`,
|
||||
noteAdd: (insigniaId: string) => `${insignia}/request/note/${insigniaId}`,
|
||||
noteByid: (id: string) => `${insignia}/request/note/${id}`,
|
||||
|
||||
insigniaSendToDirector: (roundId: string, ocId: string) =>
|
||||
`${insignia}/request/officer/approve/${roundId}/${ocId}`,
|
||||
insigniaDirectorBackToEdit: (roundId: string, ocId: string) =>
|
||||
`${insignia}/request/director/reject/${roundId}/${ocId}`,
|
||||
insigniaDirectorApproved: (roundId: string, ocId: string) =>
|
||||
`${insignia}/request/director/approve/${roundId}/${ocId}`,
|
||||
insigniaSendToDirector: (
|
||||
roundId: string,
|
||||
ocId: string,
|
||||
type: string = "officer"
|
||||
) => `${insignia}/request/officer/approve/${type}/${roundId}/${ocId}`,
|
||||
insigniaDirectorBackToEdit: (
|
||||
roundId: string,
|
||||
ocId: string,
|
||||
type: string = "officer"
|
||||
) => `${insignia}/request/director/reject/${type}/${roundId}/${ocId}`,
|
||||
insigniaDirectorApproved: (
|
||||
roundId: string,
|
||||
ocId: string,
|
||||
type: string = "officer"
|
||||
) => `${insignia}/request/director/approve/${type}/${roundId}/${ocId}`,
|
||||
insigniaRequestSendNote: (insigniaPeriodId: string) =>
|
||||
`${insignia}/request/send/note/${insigniaPeriodId}`,
|
||||
|
||||
|
|
@ -105,8 +116,8 @@ export default {
|
|||
uploadfileOnlyInsignia: (requestId: string) =>
|
||||
`${insignia}/request/upload/${requestId}`,
|
||||
// สกจ. ตีกลับให้หัวหน้าเขต
|
||||
rejectRequest: (id: string, ocId: string) =>
|
||||
`${insignia}/request/head/reject/${id}/${ocId}`,
|
||||
rejectRequest: (id: string, ocId: string, type: string = "officer") =>
|
||||
`${insignia}/request/head/reject/${type}/${id}/${ocId}`,
|
||||
|
||||
reportInsigniaNew: `${insignia}/report`,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -49,4 +49,7 @@ export default {
|
|||
|
||||
checkIsofficer: `${env.API_URI}/org/workflow/keycloak/isofficer/`,
|
||||
insigniaReclaim,
|
||||
|
||||
// update คุณสมบัติการจัดการเครื่องราชฯ
|
||||
insigniaUpdateProperty: `${env.API_URI}/insignia/request/update`,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -42,5 +42,9 @@ export default {
|
|||
exportPassExamList: (id: string) => `${recruit_report}pass/${id}`,
|
||||
periodRecruitToPlacement: (examId: string) => `${recruit}placement/${examId}`,
|
||||
|
||||
reportRecruit:(type:string)=>`${recruit}${type}`
|
||||
reportRecruit:(type:string)=>`${recruit}${type}`,
|
||||
|
||||
|
||||
exportCandidateListNew: (id: string) => `${recruit_report}candidate-new/${id}`,
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ interface Goverment {
|
|||
positionLevel: string;
|
||||
positionExecutive: string;
|
||||
positionExecutiveSide: string;
|
||||
dateLeave: string;
|
||||
dateRetireLaw: string;
|
||||
dateLeave?: string;
|
||||
dateRetireLaw?: string;
|
||||
}
|
||||
|
||||
interface GovermentEmpTemp {
|
||||
|
|
|
|||
|
|
@ -43,4 +43,18 @@ interface DataRoles {
|
|||
parentNode: string;
|
||||
}
|
||||
|
||||
export type { ListMenu, ChildLevelTree, ChildConfig, DataPermissions,DataRoles };
|
||||
interface DataRoleWorkflow {
|
||||
isDeputy: boolean;
|
||||
isDirector: boolean;
|
||||
isOfficer: boolean;
|
||||
isStaff: boolean;
|
||||
}
|
||||
|
||||
export type {
|
||||
ListMenu,
|
||||
ChildLevelTree,
|
||||
ChildConfig,
|
||||
DataPermissions,
|
||||
DataRoles,
|
||||
DataRoleWorkflow,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ onMounted(() => {
|
|||
outlined
|
||||
v-model="formFilter.keyword"
|
||||
label="ค้นหา"
|
||||
@keydown.enter="fetchNewList"
|
||||
@keydown.enter.prevent="fetchNewList"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ watch(
|
|||
dense
|
||||
v-model="filterTable"
|
||||
label="ค้นหา"
|
||||
@keydown.enter="onSearchData"
|
||||
@keydown.enter.prevent="onSearchData"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -4,7 +4,11 @@ import { useQuasar } from "quasar";
|
|||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import {
|
||||
checkPermission,
|
||||
checkPermissionList,
|
||||
checkPermissionCreate,
|
||||
} from "@/utils/permissions";
|
||||
import { useOrganizational } from "@/modules/02_organization/store/organizational";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
|
|
@ -338,7 +342,9 @@ onMounted(async () => {
|
|||
<q-btn
|
||||
v-if="
|
||||
store.typeOrganizational === 'draft' &&
|
||||
(store.isOfficer === true || store.isStaff === true)
|
||||
(store.isOfficer === true || store.isStaff === true) &&
|
||||
checkPermissionList(['COMMAND']) &&
|
||||
checkPermissionCreate('COMMAND')
|
||||
"
|
||||
flat
|
||||
round
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ function resetFilter() {
|
|||
outlined
|
||||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
@keydown.enter="props.onSearch?.()"
|
||||
@keydown.enter.prevent="props.onSearch?.()"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ const resetFilter = () => {
|
|||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
class="q-ml-sm"
|
||||
@keydown.enter="props.onSearch?.(name)"
|
||||
@keydown.enter.prevent="props.onSearch?.(name)"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ function resetFilter() {
|
|||
dense
|
||||
v-model="filter"
|
||||
ref="filterRef"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
outlined
|
||||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { ref } from "vue";
|
||||
interface Pagination {
|
||||
rowsPerPage: number;
|
||||
sortBy: string;
|
||||
sortBy?: string;
|
||||
}
|
||||
|
||||
interface DataDateMonthObject {
|
||||
|
|
|
|||
|
|
@ -206,40 +206,42 @@ async function fetchData() {
|
|||
* ดาวน์โหลดรายชื่อผู้สอบแข่งขันได้
|
||||
* @param id รอบสอบเเข่งขัน
|
||||
*/
|
||||
function clickPassExam(id: string) {
|
||||
async function clickPassExam(id: string) {
|
||||
showLoader();
|
||||
http
|
||||
await http
|
||||
.get(config.API.exportPassExamList(id))
|
||||
.then((res) => {
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
data.reportName = `CandidateList`;
|
||||
genReport(data, data.reportName, "pdf");
|
||||
await genReport(data, data.reportName, "pdf");
|
||||
})
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
hideLoader();
|
||||
})
|
||||
.finally(() => {});
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ดาวน์โหลดรายชื่อผู้มีสิทธิ์สอบ
|
||||
* @param id รอบสอบเเข่งขัน
|
||||
*/
|
||||
function clickCandidateList(id: string) {
|
||||
async function clickCandidateList(id: string) {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.exportCandidateList(id))
|
||||
.then((res) => {
|
||||
await http
|
||||
.get(config.API.exportCandidateListNew(id))
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
data.reportName = `CandidateList`;
|
||||
genReport(data, data.reportName, "pdf");
|
||||
await genReport(data, data.reportName, "pdf");
|
||||
})
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
hideLoader();
|
||||
})
|
||||
.finally(() => {});
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -168,37 +168,39 @@ const visibleColumnsHistory = ref<String[]>([
|
|||
]);
|
||||
|
||||
/** ดาวน์โหลดรายชื่อผู้สอบคัดเลือกคนพิการได้ */
|
||||
function clickPassExam(id: string) {
|
||||
async function clickPassExam(id: string) {
|
||||
showLoader();
|
||||
http
|
||||
await http
|
||||
.get(config.API.exportDisablePassExamList(id))
|
||||
.then((res) => {
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
data.reportName = `CandidateList`;
|
||||
genReport(data, data.reportName, "pdf");
|
||||
await genReport(data, data.reportName, "pdf");
|
||||
})
|
||||
.catch(async (e) => {
|
||||
hideLoader();
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {});
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/** ดาวน์โหลดรายชื่อผู้มีสิทธิ์สอบ */
|
||||
function clickCandidateList(id: string) {
|
||||
async function clickCandidateList(id: string) {
|
||||
showLoader();
|
||||
http
|
||||
await http
|
||||
.get(config.API.exportDisableCandidateList(id))
|
||||
.then((res) => {
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
data.reportName = `CandidateList`;
|
||||
genReport(data, data.reportName, "pdf");
|
||||
await genReport(data, data.reportName, "pdf");
|
||||
})
|
||||
.catch(async (e) => {
|
||||
hideLoader();
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {});
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ function onSubmit() {
|
|||
watch(modal, async () => {
|
||||
if (modal.value && props.dataSort) {
|
||||
const dataList = props.dataSort;
|
||||
rows.value = dataList;
|
||||
rows.value.push(...dataList);
|
||||
selected.value = dataList.filter((item: any) => item.isUse == true);
|
||||
} else {
|
||||
selected.value = [];
|
||||
|
|
@ -294,7 +294,7 @@ watch(modal, async () => {
|
|||
bordered
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
:rows-per-page-options="[100]"
|
||||
:rows-per-page-options="[0]"
|
||||
row-key="id"
|
||||
hide-bottom
|
||||
hide-pagination
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ onMounted(() => {
|
|||
dense
|
||||
label="ค้นหา"
|
||||
style="min-width: 250px"
|
||||
@keydown.enter="updateStatusValue()"
|
||||
@keydown.enter.prevent="updateStatusValue()"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -327,7 +327,7 @@ onMounted(() => {
|
|||
outlined
|
||||
dense
|
||||
label="ค้นหา"
|
||||
@keydown.enter="updateStatusValue()"
|
||||
@keydown.enter.prevent="updateStatusValue()"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -8,4 +8,23 @@ interface DataProfile {
|
|||
org: string;
|
||||
}
|
||||
|
||||
export type { DataProfile };
|
||||
interface FormDataSalary {
|
||||
positionLevel: string;
|
||||
positionCee: string;
|
||||
amount: number;
|
||||
amountSpecial: number;
|
||||
posNoAbb: string;
|
||||
posNo: string;
|
||||
orgRoot: string;
|
||||
orgChild1: string;
|
||||
orgChild2: string;
|
||||
orgChild3: string;
|
||||
orgChild4: string;
|
||||
commandCode: string;
|
||||
posNumCodeSit: string;
|
||||
posNumCodeSitAbb: string;
|
||||
commandNo: string;
|
||||
commandYear: null | number;
|
||||
}
|
||||
|
||||
export type { DataProfile, FormDataSalary };
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ interface DataPosition {
|
|||
amount: number;
|
||||
amountSpecial: number;
|
||||
commandCode: string;
|
||||
commandDateAffect: string;
|
||||
commandDateSign: string;
|
||||
commandDateAffect: Date;
|
||||
commandDateSign: Date;
|
||||
commandId: string;
|
||||
commandName: string;
|
||||
commandNo: string;
|
||||
|
|
@ -68,6 +68,8 @@ interface DataPosition {
|
|||
remark: string;
|
||||
salaryId: string;
|
||||
status: string;
|
||||
posNumCodeSitAbb: string;
|
||||
posNumCodeSit: string;
|
||||
}
|
||||
|
||||
export type { DataSalaryPos, DataPosition };
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { ref, reactive, computed } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import axios from "axios";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
import type { DataOption } from "@/modules/04_registryPerson/interface/index/Main";
|
||||
|
|
@ -15,9 +13,6 @@ import type {
|
|||
} from "@/modules/04_registryPerson/interface/response/Main";
|
||||
import type { FormFilter } from "@/modules/04_registryPerson/interface/request/Main";
|
||||
|
||||
const $q = useQuasar();
|
||||
const { messageError } = useCounterMixin();
|
||||
|
||||
export const useRegistryNewDataStore = defineStore("registryNew", () => {
|
||||
const route = useRoute();
|
||||
const tab = ref<string>("1");
|
||||
|
|
@ -188,7 +183,7 @@ export const useRegistryNewDataStore = defineStore("registryNew", () => {
|
|||
|
||||
return res.data["เอกสารหลักฐาน"].uploadUrl;
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
console.log(err);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -216,7 +211,7 @@ export const useRegistryNewDataStore = defineStore("registryNew", () => {
|
|||
);
|
||||
return res.data;
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
console.log(err);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -233,7 +228,7 @@ export const useRegistryNewDataStore = defineStore("registryNew", () => {
|
|||
},
|
||||
});
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
console.log(err);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -261,6 +256,6 @@ export const useRegistryNewDataStore = defineStore("registryNew", () => {
|
|||
createPathUploadFlie,
|
||||
getPathUploadFlie,
|
||||
uploadFile,
|
||||
tab
|
||||
tab,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -249,10 +249,15 @@ async function fetchDataOptionExecutive() {
|
|||
* @param status แก่ไข , เพิ่ม
|
||||
*/
|
||||
async function updateSelectType(val: string, status: boolean = false) {
|
||||
console.log(val);
|
||||
console.log(dataLevel.value);
|
||||
|
||||
const listLevel = val
|
||||
? dataLevel.value.find((e: DataPosType) => e.posTypeName === val)
|
||||
: null;
|
||||
|
||||
console.log("เช็คประเภทตำแหน่งงาน", listLevel);
|
||||
// เช็คประเภทตำแหน่งงาน
|
||||
if (listLevel) {
|
||||
store.posLevelData = listLevel.posLevels.map((e: DataPosLevel) => ({
|
||||
id: e.id,
|
||||
|
|
@ -263,10 +268,11 @@ async function updateSelectType(val: string, status: boolean = false) {
|
|||
}));
|
||||
|
||||
formData.positionLevel = !status ? "" : formData.positionLevel;
|
||||
} else {
|
||||
store.posLevelData = [];
|
||||
formData.positionLevel = "";
|
||||
}
|
||||
// else {
|
||||
// store.posLevelData = [];
|
||||
// // formData.positionLevel = "";
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -363,16 +369,18 @@ function onSubmit() {
|
|||
type: empType.value?.toLocaleUpperCase(),
|
||||
commandDateAffect: convertDateToAPI(formData.commandDateAffect),
|
||||
commandDateSign: convertDateToAPI(formData.commandDateSign),
|
||||
amount: Number(String(formData.amount)?.replace(/,/g, "")),
|
||||
amountSpecial: Number(
|
||||
String(formData.amountSpecial)?.replace(/,/g, "")
|
||||
),
|
||||
positionSalaryAmount: Number(
|
||||
String(formData.positionSalaryAmount)?.replace(/,/g, "")
|
||||
),
|
||||
mouthSalaryAmount: Number(
|
||||
String(formData.mouthSalaryAmount)?.replace(/,/g, "")
|
||||
),
|
||||
amount: formData.amount
|
||||
? Number(String(formData.amount)?.replace(/,/g, ""))
|
||||
: null,
|
||||
amountSpecial: formData.amountSpecial
|
||||
? Number(String(formData.amountSpecial)?.replace(/,/g, ""))
|
||||
: null,
|
||||
positionSalaryAmount: formData.positionSalaryAmount
|
||||
? Number(String(formData.positionSalaryAmount)?.replace(/,/g, ""))
|
||||
: null,
|
||||
mouthSalaryAmount: formData.mouthSalaryAmount
|
||||
? Number(String(formData.mouthSalaryAmount)?.replace(/,/g, ""))
|
||||
: null,
|
||||
})
|
||||
.then(async () => {
|
||||
await props.fetchData?.();
|
||||
|
|
@ -394,8 +402,8 @@ watch(modal, async (val) => {
|
|||
if (empType.value === "officer") {
|
||||
await Promise.all([
|
||||
fetchType(),
|
||||
fetchDataOption(),
|
||||
fetchDataOptionExecutive(),
|
||||
// fetchDataOption(),
|
||||
// fetchDataOptionExecutive(),
|
||||
]);
|
||||
} else {
|
||||
await fetchOptionGroup();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,214 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, watch } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
/** importType*/
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { PropType } from "vue";
|
||||
import type { DataPosition } from "@/modules/04_registryPerson/interface/response/Edit";
|
||||
|
||||
/** importComponents*/
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
/** use*/
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const {
|
||||
dialogConfirm,
|
||||
showLoader,
|
||||
success,
|
||||
hideLoader,
|
||||
messageError,
|
||||
findOrgNameHtml,
|
||||
} = useCounterMixin();
|
||||
|
||||
/** props*/
|
||||
const modal = defineModel<boolean>("modal", { required: true });
|
||||
|
||||
const props = defineProps({
|
||||
dataSort: Array as PropType<DataPosition[]>,
|
||||
columns: Array as PropType<QTableProps["columns"]>,
|
||||
fetchData: Function,
|
||||
});
|
||||
const profileId = ref<string>(route.params.id.toString()); //id profile
|
||||
|
||||
/** ข้อมูล Table*/
|
||||
const rowsData = ref<DataPosition[]>([]);
|
||||
|
||||
// /**
|
||||
// * fiunction จัดลำดับ
|
||||
// * @param from ตำแหน่งปัจุบัน
|
||||
// * @param to ตำแหน่งที่จะย้ายไป
|
||||
// */
|
||||
// function onDrop(from: number, to: number) {
|
||||
// rowsData.value.splice(to - 1, 0, rowsData.value.splice(from - 1, 1)[0]);
|
||||
// }
|
||||
|
||||
/** function บันทึกการจัดลำดับ*/
|
||||
function onSubmit() {
|
||||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
const body = rowsData.value.map((e: any) => e.id);
|
||||
await http
|
||||
.put(config.API.salaryTemp + `/change/sort/${profileId.value}`, {
|
||||
id: body,
|
||||
})
|
||||
.then(async () => {
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
props.fetchData?.();
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
let draggedIndex = -1; // index ของ item ที่ถูก drag
|
||||
const cardSectionRef = ref<HTMLElement | null>(null); // ref สำหรับ container ที่จะ scroll
|
||||
|
||||
/**
|
||||
* ฟังก์ชันนี้ใช้สำหรับการ drag item
|
||||
* @param index index ของ item ที่ถูก drag
|
||||
*/
|
||||
function onDragStart(index: number) {
|
||||
//จะทำการ set draggedIndex เป็น index ที่ถูก drag
|
||||
draggedIndex = index;
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันนี้ใช้สำหรับการ drop item
|
||||
* @param targetIndex index ที่จะ drop
|
||||
*/
|
||||
function onDrop(targetIndex: number) {
|
||||
// ถ้า draggedIndex เป็น -1 หรือ draggedIndex เท่ากับ targetIndex จะไม่ทำอะไร
|
||||
if (draggedIndex === -1 || draggedIndex === targetIndex) return;
|
||||
// ถ้า draggedIndex ไม่เท่ากับ targetIndex จะทำการย้าย item
|
||||
const item = rowsData.value.splice(draggedIndex, 1)[0];
|
||||
rowsData.value.splice(targetIndex, 0, item);
|
||||
draggedIndex = -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันนี้ใช้สำหรับการเลื่อน scroll ของ container
|
||||
* @param e DragEvent
|
||||
* @description ทำให้ scroll container ได้เวลา drag อยู่ใกล้ขอบ
|
||||
*/
|
||||
function onDragOver(e: DragEvent) {
|
||||
let container = cardSectionRef.value;
|
||||
// ถ้าเป็น vue proxy ให้ใช้ container.$el
|
||||
if (container && (container as any).$el) {
|
||||
container = (container as any).$el;
|
||||
}
|
||||
// ถ้า container ไม่ใช่ HTMLElement ให้แสดง warning
|
||||
if (
|
||||
!container ||
|
||||
typeof (container as HTMLElement).getBoundingClientRect !== "function"
|
||||
) {
|
||||
console.warn("container is not HTMLElement:", container);
|
||||
return;
|
||||
}
|
||||
const rect = (container as HTMLElement).getBoundingClientRect();
|
||||
const offset = 40; // ระยะห่างจากขอบที่ต้องการให้ scroll
|
||||
const scrollSpeed = 30; // ความเร็วในการ scroll
|
||||
|
||||
// ถ้า mouse อยู่ใกล้ขอบบนหรือขอบล่างของ container ให้ scroll
|
||||
if (e.clientY < rect.top + offset) {
|
||||
(container as HTMLElement).scrollTop -= scrollSpeed;
|
||||
} else if (e.clientY > rect.bottom - offset) {
|
||||
(container as HTMLElement).scrollTop += scrollSpeed;
|
||||
}
|
||||
}
|
||||
|
||||
watch(modal, async () => {
|
||||
if (modal.value && props.dataSort) {
|
||||
const dataList = props.dataSort;
|
||||
rowsData.value.push(...dataList);
|
||||
} else {
|
||||
rowsData.value = [];
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<q-dialog v-model="modal" persistent full-width>
|
||||
<q-card style="min-width: 80vw">
|
||||
<DialogHeader :tittle="`จัดลำดับการ`" :close="() => (modal = false)" />
|
||||
<q-separator />
|
||||
<q-card-section
|
||||
ref="cardSectionRef"
|
||||
style="max-height: 70vh; overflow-y: auto"
|
||||
@dragover.prevent="onDragOver"
|
||||
>
|
||||
<q-table
|
||||
class="custom-header-table"
|
||||
v-if="rowsData.length > 0"
|
||||
flat
|
||||
bordered
|
||||
:rows="rowsData"
|
||||
:columns="columns"
|
||||
:rows-per-page-options="[0]"
|
||||
row-key="id"
|
||||
hide-bottom
|
||||
hide-pagination
|
||||
>
|
||||
<template v-slot:body="props">
|
||||
<q-tr
|
||||
:props="props"
|
||||
draggable="true"
|
||||
@dragstart="onDragStart(props.rowIndex)"
|
||||
@drop="onDrop(props.rowIndex)"
|
||||
@dragover.prevent.stop="onDragOver"
|
||||
style="cursor: move"
|
||||
>
|
||||
<q-td v-for="col in props.cols" :key="col.id">
|
||||
<div v-if="col.name === 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name === 'organization'" class="text-html">
|
||||
{{
|
||||
findOrgNameHtml({
|
||||
root: props.row.orgRoot,
|
||||
child1: props.row.orgChild1,
|
||||
child2: props.row.orgChild2,
|
||||
child3: props.row.orgChild3,
|
||||
child4: props.row.orgChild4,
|
||||
})
|
||||
}}
|
||||
</div>
|
||||
<div v-else-if="col.name === 'commandCode'">
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</q-table>
|
||||
<div v-else class="bg-grey-1 text-center q-pa-md">ไม่มีข้อมูล</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
:disable="rowsData.length === 0"
|
||||
type="submit"
|
||||
:label="`บันทึก`"
|
||||
color="public"
|
||||
@click="onSubmit"
|
||||
>
|
||||
<q-tooltip>บันทึก</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
|
||||
<style lang="scss"></style>
|
||||
|
|
@ -149,7 +149,6 @@ function classInput(val: boolean) {
|
|||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
:class="classInput(isReadonly)"
|
||||
teleport-center
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
|
|
@ -161,9 +160,15 @@ function classInput(val: boolean) {
|
|||
outlined
|
||||
dense
|
||||
borderless
|
||||
:model-value="date2Thai(formData.commandDateAffect)"
|
||||
:model-value="
|
||||
formData.commandDateAffect
|
||||
? date2Thai(formData.commandDateAffect)
|
||||
: null
|
||||
"
|
||||
:label="`${'วันที่คำสั่งมีผล'}`"
|
||||
hide-bottom-space
|
||||
clearable
|
||||
@clear="formData.commandDateAffect = null"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="event" color="primary" class="cursor-pointer">
|
||||
|
|
@ -230,7 +235,6 @@ function classInput(val: boolean) {
|
|||
:enableTimePicker="false"
|
||||
:class="classInput(isReadonly)"
|
||||
:readonly="isReadonly"
|
||||
teleport-center
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
|
|
@ -248,6 +252,8 @@ function classInput(val: boolean) {
|
|||
: formData.commandYear + 543
|
||||
"
|
||||
:label="`${'พ.ศ.'}`"
|
||||
clearable
|
||||
@clear="formData.commandYear = null"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
|
|
@ -274,7 +280,6 @@ function classInput(val: boolean) {
|
|||
week-start="0"
|
||||
:class="classInput(isReadonly)"
|
||||
:readonly="isReadonly"
|
||||
teleport-center
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
|
|
@ -286,9 +291,15 @@ function classInput(val: boolean) {
|
|||
outlined
|
||||
dense
|
||||
borderless
|
||||
:model-value="date2Thai(formData.commandDateSign)"
|
||||
:model-value="
|
||||
formData.commandDateSign
|
||||
? date2Thai(formData.commandDateSign)
|
||||
: null
|
||||
"
|
||||
:label="`${'วันที่ลงนาม'}`"
|
||||
hide-bottom-space
|
||||
clearable
|
||||
@clear="formData.commandDateSign = null"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="event" color="primary" class="cursor-pointer">
|
||||
|
|
@ -359,7 +370,7 @@ function classInput(val: boolean) {
|
|||
lazy-rules
|
||||
borderless
|
||||
v-model="formData.positionType"
|
||||
:label="empType === 'officer' ? 'ประเภทตำแหน่ง' : 'กลุ่มงาน'"
|
||||
:label="empType === 'officer' ? 'ตำแหน่งประเภท' : 'กลุ่มงาน'"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
|
|
@ -433,7 +444,18 @@ function classInput(val: boolean) {
|
|||
</div>
|
||||
|
||||
<div class="col-xs-6 col-sm-6 col-md-4" v-if="empType === 'officer'">
|
||||
<q-select
|
||||
<q-input
|
||||
:class="classInput(isReadonly)"
|
||||
:readonly="isReadonly"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
v-model="formData.positionLine"
|
||||
hide-bottom-space
|
||||
:label="`${'สายงาน'}`"
|
||||
/>
|
||||
<!-- <q-select
|
||||
outlined
|
||||
:class="classInput(isReadonly)"
|
||||
:readonly="isReadonly"
|
||||
|
|
@ -462,11 +484,22 @@ function classInput(val: boolean) {
|
|||
<q-item-section class="text-grey"> ไม่มีข้อมูล </q-item-section>
|
||||
</q-item>
|
||||
</template></q-select
|
||||
>
|
||||
> -->
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6 col-sm-6 col-md-4" v-if="empType === 'officer'">
|
||||
<q-select
|
||||
<q-input
|
||||
:class="classInput(isReadonly)"
|
||||
:readonly="isReadonly"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
v-model="formData.positionPathSide"
|
||||
hide-bottom-space
|
||||
:label="`${'ด้าน/สาขา'}`"
|
||||
/>
|
||||
<!-- <q-select
|
||||
:class="classInput(isReadonly)"
|
||||
:readonly="isReadonly"
|
||||
outlined
|
||||
|
|
@ -495,11 +528,22 @@ function classInput(val: boolean) {
|
|||
<q-item-section class="text-grey"> ไม่มีข้อมูล </q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</q-select> -->
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6 col-sm-6 col-md-4" v-if="empType === 'officer'">
|
||||
<q-select
|
||||
<q-input
|
||||
:class="classInput(isReadonly)"
|
||||
:readonly="isReadonly"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
v-model="formData.positionExecutive"
|
||||
hide-bottom-space
|
||||
:label="`${'ตำแหน่งทางการบริหาร'}`"
|
||||
/>
|
||||
<!-- <q-select
|
||||
:class="classInput(isReadonly)"
|
||||
:readonly="isReadonly"
|
||||
outlined
|
||||
|
|
@ -528,7 +572,7 @@ function classInput(val: boolean) {
|
|||
<q-item-section class="text-grey"> ไม่มีข้อมูล </q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</q-select> -->
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
|
|
@ -544,7 +588,6 @@ function classInput(val: boolean) {
|
|||
label="เงินเดือน"
|
||||
mask="###,###,###,###"
|
||||
reverse-fill-mask
|
||||
:rules="!isReadonly ? [(val:string) => !!val || `${'กรุณากรอกเงินเดือน'}`] :[]"
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
/>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -47,6 +47,7 @@ async function fetchDataProfile() {
|
|||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
statusCheckEdit.value = data.statusCheckEdit;
|
||||
fetchPromission(data.rootId);
|
||||
dataProfile.value = {
|
||||
fullName: `${data.prefix}${data.firstName} ${data.lastName}`,
|
||||
position: data.position,
|
||||
|
|
@ -62,9 +63,9 @@ async function fetchDataProfile() {
|
|||
});
|
||||
}
|
||||
|
||||
function fetchPromission() {
|
||||
function fetchPromission(rootId: string) {
|
||||
http
|
||||
.get(config.API.profilePermission)
|
||||
.get(config.API.profilePermission(rootId))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
isConfirmEdit.value = data.isEdit;
|
||||
|
|
@ -133,7 +134,7 @@ function onConfirmDone() {
|
|||
onMounted(async () => {
|
||||
try {
|
||||
showLoader();
|
||||
await Promise.all([fetchDataProfile(), fetchPromission()]);
|
||||
await fetchDataProfile();
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
} finally {
|
||||
|
|
|
|||
|
|
@ -348,7 +348,7 @@ watch(
|
|||
dense
|
||||
v-model="filterKeyword2"
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -358,7 +358,7 @@ watch(
|
|||
dense
|
||||
v-model="filterKeyword2"
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ function onSearch() {
|
|||
dense
|
||||
v-model="filterKeyword2"
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append> <q-icon name="search" /> </template>
|
||||
</q-input>
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ watch(
|
|||
dense
|
||||
v-model="filterKeyword2"
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ const resetFilter = () => {
|
|||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
class="q-ml-sm"
|
||||
@keydown.enter="props.onSearch?.()"
|
||||
@keydown.enter.prevent="props.onSearch?.()"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -366,7 +366,7 @@ onMounted(async () => {
|
|||
dense
|
||||
v-model="filters"
|
||||
label="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -294,7 +294,7 @@ watch(
|
|||
v-model="filter"
|
||||
placeholder="ค้นหา"
|
||||
style="width: 200px; max-width: auto"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -1459,7 +1459,7 @@ onMounted(async () => {
|
|||
v-model="filterlistAdd"
|
||||
placeholder="ค้นหา"
|
||||
style="width: 850px; max-width: auto"
|
||||
@keydown.enter="onSearchAdd"
|
||||
@keydown.enter.prevent="onSearchAdd"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, useAttrs } from "vue";
|
||||
import { QTooltip, useQuasar } from "quasar";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import {
|
||||
checkPermission,
|
||||
checkPermissionList,
|
||||
checkPermissionCreate,
|
||||
} from "@/utils/permissions";
|
||||
|
||||
import type { PropType } from "vue";
|
||||
import type { optionData } from "@/modules/05_placement/interface/index/Main";
|
||||
|
|
@ -267,6 +271,11 @@ function filterSelector(val: string, update: Function) {
|
|||
</div>
|
||||
|
||||
<q-btn
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
checkPermissionList(['COMMAND']) &&
|
||||
checkPermissionCreate('COMMAND')
|
||||
"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
|
|
@ -296,7 +305,7 @@ function filterSelector(val: string, update: Function) {
|
|||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
class="q-ml-sm"
|
||||
@keydown.enter="onUpdateNewRows"
|
||||
@keydown.enter.prevent="onUpdateNewRows"
|
||||
>
|
||||
<template v-slot:append> </template>
|
||||
</q-input>
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ watchEffect(() => {
|
|||
:model-value="filterKeyword2"
|
||||
@update:model-value="updateInput"
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ watch(
|
|||
dense
|
||||
v-model="filterKeyword2"
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ watch(
|
|||
dense
|
||||
v-model="filter"
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ watch(
|
|||
v-model="filter"
|
||||
placeholder="ค้นหา"
|
||||
style="width: 200px; max-width: auto"
|
||||
@keydown.enter="(pagination.page = 1), getList()"
|
||||
@keydown.enter.prevent="(pagination.page = 1), getList()"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ watchEffect(() => {
|
|||
dense
|
||||
placeholder="ค้นหา"
|
||||
v-model="filterKeyword"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -875,13 +875,13 @@ async function clickdownloadFile(type: string) {
|
|||
`แบบมอบหมายงานการทดลองปฏิบัติหน้าที่ราชการ-${fullname.value}`,
|
||||
type
|
||||
);
|
||||
hideLoader();
|
||||
})
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
hideLoader();
|
||||
})
|
||||
.finally(() => {});
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/** เช็ค จำนวนเดือน เเละ วันที่เริ่ม ไม่เท่ากับ undefined*/
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { useRoute, useRouter } from "vue-router";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useProbationDataStore } from "@/modules/05_placement/storeProbation";
|
||||
import genReport from "@/plugins/genreport";
|
||||
|
||||
|
||||
import FormUploadFile from "@/modules/05_placement/components/probation/FormEvaluation/FormUploadFile.vue";
|
||||
import DialogSelectAuthority from "@/modules/05_placement/components/probation/FormEvaluation/DialogSelectAuthority.vue";
|
||||
|
|
|
|||
|
|
@ -97,13 +97,13 @@ async function FileDownload(type: string) {
|
|||
`แบบบันทึกผล(ผู้บังคับบัญชา)_${probationStore.person.name}_ครั้งที่${numTab.no}`,
|
||||
type
|
||||
);
|
||||
hideLoader();
|
||||
})
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
hideLoader();
|
||||
})
|
||||
.finally(() => {});
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
} else {
|
||||
//ผุ้บังคับ
|
||||
showLoader();
|
||||
|
|
@ -116,13 +116,13 @@ async function FileDownload(type: string) {
|
|||
`แบบบันทึกผล(ผู้บังคับบัญชา)_${probationStore.person.name}_ครั้งที่${numTab.no}`,
|
||||
type
|
||||
);
|
||||
hideLoader();
|
||||
})
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
hideLoader();
|
||||
})
|
||||
.finally(() => {});
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,11 @@ import { useRouter } from "vue-router";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import {
|
||||
checkPermission,
|
||||
checkPermissionList,
|
||||
checkPermissionCreate,
|
||||
} from "@/utils/permissions";
|
||||
|
||||
import type { AppointMainRows } from "@/modules/05_placement/interface/request/Main";
|
||||
import DialogOrder from "@/modules/05_placement/components/probation/DialogOrder/DialogSendToCommand.vue";
|
||||
|
|
@ -181,7 +185,11 @@ onMounted(async () => {
|
|||
<div class="row q-col-gutter-sm">
|
||||
<div class="q-px-sm">
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
checkPermissionList(['COMMAND']) &&
|
||||
checkPermissionCreate('COMMAND')
|
||||
"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
|
|
@ -200,7 +208,7 @@ onMounted(async () => {
|
|||
ref="filterRef"
|
||||
outlined
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -5,7 +5,11 @@ import { useRouter } from "vue-router";
|
|||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import {
|
||||
checkPermission,
|
||||
checkPermissionList,
|
||||
checkPermissionCreate,
|
||||
} from "@/utils/permissions";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||
|
||||
|
|
@ -511,7 +515,9 @@ onMounted(() => {
|
|||
<q-btn
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
checkPermission($route)?.attrIsGet
|
||||
checkPermission($route)?.attrIsGet &&
|
||||
checkPermissionList(['COMMAND']) &&
|
||||
checkPermissionCreate('COMMAND')
|
||||
"
|
||||
@click="onCommand"
|
||||
flat
|
||||
|
|
|
|||
|
|
@ -421,7 +421,7 @@ onMounted(async () => {
|
|||
ref="filterRef"
|
||||
outlined
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -423,7 +423,7 @@ onMounted(() => {
|
|||
ref="filterRef"
|
||||
outlined
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -3,7 +3,11 @@ import { ref, onMounted, computed } from "vue";
|
|||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useRouter } from "vue-router";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import {
|
||||
checkPermission,
|
||||
checkPermissionList,
|
||||
checkPermissionCreate,
|
||||
} from "@/utils/permissions";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||
import http from "@/plugins/http";
|
||||
|
|
@ -240,7 +244,11 @@ onMounted(async () => {
|
|||
</q-select>
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
checkPermissionList(['COMMAND']) &&
|
||||
checkPermissionCreate('COMMAND')
|
||||
"
|
||||
@click="openModalOrder"
|
||||
flat
|
||||
round
|
||||
|
|
|
|||
|
|
@ -3,7 +3,11 @@ import { ref, onMounted } from "vue";
|
|||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useRouter } from "vue-router";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import {
|
||||
checkPermission,
|
||||
checkPermissionList,
|
||||
checkPermissionCreate,
|
||||
} from "@/utils/permissions";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||
import http from "@/plugins/http";
|
||||
|
|
@ -445,7 +449,11 @@ onMounted(async () => {
|
|||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
checkPermissionList(['COMMAND']) &&
|
||||
checkPermissionCreate('COMMAND')
|
||||
"
|
||||
size="14px"
|
||||
flat
|
||||
round
|
||||
|
|
@ -463,7 +471,7 @@ onMounted(async () => {
|
|||
ref="filterRef"
|
||||
outlined
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -2,7 +2,11 @@
|
|||
import { ref, onMounted } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import {
|
||||
checkPermission,
|
||||
checkPermissionList,
|
||||
checkPermissionCreate,
|
||||
} from "@/utils/permissions";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
|
@ -301,7 +305,11 @@ onMounted(async () => {
|
|||
</q-select>
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
checkPermissionList(['COMMAND']) &&
|
||||
checkPermissionCreate('COMMAND')
|
||||
"
|
||||
@click="openModalOrder"
|
||||
size="14px"
|
||||
flat
|
||||
|
|
@ -319,7 +327,7 @@ onMounted(async () => {
|
|||
ref="filterRef"
|
||||
outlined
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -3,7 +3,11 @@ import { ref, onMounted } from "vue";
|
|||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useRouter } from "vue-router";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import {
|
||||
checkPermission,
|
||||
checkPermissionList,
|
||||
checkPermissionCreate,
|
||||
} from "@/utils/permissions";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||
import http from "@/plugins/http";
|
||||
|
|
@ -273,7 +277,11 @@ onMounted(async () => {
|
|||
</q-select>
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
checkPermissionList(['COMMAND']) &&
|
||||
checkPermissionCreate('COMMAND')
|
||||
"
|
||||
flat
|
||||
round
|
||||
size="14px"
|
||||
|
|
@ -291,7 +299,7 @@ onMounted(async () => {
|
|||
ref="filterRef"
|
||||
outlined
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -3,7 +3,11 @@ import { ref, onMounted } from "vue";
|
|||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useRouter } from "vue-router";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import {
|
||||
checkPermission,
|
||||
checkPermissionList,
|
||||
checkPermissionCreate,
|
||||
} from "@/utils/permissions";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||
import http from "@/plugins/http";
|
||||
|
|
@ -403,7 +407,11 @@ onMounted(async () => {
|
|||
</div>
|
||||
<div>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
checkPermissionList(['COMMAND']) &&
|
||||
checkPermissionCreate('COMMAND')
|
||||
"
|
||||
@click="sendToCommand()"
|
||||
size="14px"
|
||||
flat
|
||||
|
|
@ -423,7 +431,7 @@ onMounted(async () => {
|
|||
ref="filterRef"
|
||||
outlined
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -2,7 +2,11 @@
|
|||
import { ref, onMounted } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import {
|
||||
checkPermission,
|
||||
checkPermissionList,
|
||||
checkPermissionCreate,
|
||||
} from "@/utils/permissions";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||
|
|
@ -400,7 +404,11 @@ onMounted(async () => {
|
|||
</q-select>
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
checkPermissionList(['COMMAND']) &&
|
||||
checkPermissionCreate('COMMAND')
|
||||
"
|
||||
@click="popup()"
|
||||
size="14px"
|
||||
flat
|
||||
|
|
@ -419,7 +427,7 @@ onMounted(async () => {
|
|||
ref="filterRef"
|
||||
outlined
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
@ -586,7 +594,8 @@ onMounted(async () => {
|
|||
props.row.posTypeName === "อำนวยการ"
|
||||
? `${props.row.posTypeName}`
|
||||
: ""
|
||||
}} {{
|
||||
}}
|
||||
{{
|
||||
props.row.posLevelName !== null
|
||||
? `(${props.row.posLevelName})`
|
||||
: ""
|
||||
|
|
|
|||
|
|
@ -3,7 +3,11 @@ import { ref, onMounted } from "vue";
|
|||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useRouter } from "vue-router";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import {
|
||||
checkPermission,
|
||||
checkPermissionList,
|
||||
checkPermissionCreate,
|
||||
} from "@/utils/permissions";
|
||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
|
|
@ -353,7 +357,11 @@ onMounted(() => {
|
|||
</q-select>
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
checkPermissionList(['COMMAND']) &&
|
||||
checkPermissionCreate('COMMAND')
|
||||
"
|
||||
@click="popup()"
|
||||
size="14px"
|
||||
flat
|
||||
|
|
@ -371,7 +379,7 @@ onMounted(() => {
|
|||
ref="filterRef"
|
||||
outlined
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -566,7 +566,7 @@ onMounted(async () => {
|
|||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
class="q-ml-sm"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { useQuasar } from "quasar";
|
|||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRetirementDataStore } from "@/modules/06_retirement/store/Main";
|
||||
import { useRoleWorkflowDataStore } from "@/stores/roleWorkflow";
|
||||
|
||||
import type { PropType } from "vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
|
|
@ -15,6 +16,7 @@ import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCom
|
|||
/** use */
|
||||
const $q = useQuasar();
|
||||
const stroe = useRetirementDataStore();
|
||||
const { fetchDataCheckIsoffice } = useRoleWorkflowDataStore();
|
||||
const { statusText } = stroe;
|
||||
const selected = ref<ResponseItems[]>([]);
|
||||
const dataMapToSend = computed(() => {
|
||||
|
|
@ -33,7 +35,7 @@ const dataMapToSend = computed(() => {
|
|||
}));
|
||||
});
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogConfirm, date2Thai, onSearchDataTable } = mixin;
|
||||
const { dialogConfirm, date2Thai, onSearchDataTable, messageError } = mixin;
|
||||
|
||||
/** props*/
|
||||
const props = defineProps({
|
||||
|
|
@ -54,7 +56,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: false,
|
||||
field: (row) => props?.rows!.indexOf(row) + 1,
|
||||
field: (row) => rowsData.value!.indexOf(row) + 1,
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
|
|
@ -144,8 +146,11 @@ const columns = ref<QTableProps["columns"]>([
|
|||
sortable: true,
|
||||
field: "status",
|
||||
format(val, row) {
|
||||
return statusText(row.status);
|
||||
return props.mainTabs === "1"
|
||||
? statusText(row.status)
|
||||
: statusText(row.status, "อนุญาต");
|
||||
},
|
||||
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
|
@ -190,13 +195,36 @@ async function onSearch() {
|
|||
);
|
||||
}
|
||||
|
||||
const isOfficer = ref<boolean>(false);
|
||||
const isStaff = ref<boolean>(false);
|
||||
|
||||
/** ฟังก์ดึงข้อมูลผู้บังคับบัญชา*/
|
||||
async function fetchCheckOfficer() {
|
||||
try {
|
||||
const data = await fetchDataCheckIsoffice("SYS_RESIGN");
|
||||
isOfficer.value = data.isOfficer;
|
||||
isStaff.value = data.isStaff;
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
}
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.modal,
|
||||
(val) => {
|
||||
async (val) => {
|
||||
if (val) {
|
||||
selected.value = [];
|
||||
rowsData.value = props.rows ? props.rows : [];
|
||||
rowsDataMain.value = props.rows ? props.rows : [];
|
||||
await fetchCheckOfficer();
|
||||
const data = props?.rows?.filter((e: any) => {
|
||||
if (isStaff.value) {
|
||||
return e.group === "1.1";
|
||||
} else {
|
||||
return e.group !== "1.1";
|
||||
}
|
||||
});
|
||||
|
||||
rowsData.value = data ? data : [];
|
||||
rowsDataMain.value = data ? data : [];
|
||||
} else {
|
||||
rowsData.value = [];
|
||||
rowsDataMain.value = [];
|
||||
|
|
@ -218,7 +246,7 @@ watch(
|
|||
outlined
|
||||
dense
|
||||
v-model="filterKeyword"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
placeholder="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import http from "@/plugins/http";
|
|||
import config from "@/app.config";
|
||||
import genReport from "@/plugins/genreport";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useRoleWorkflowDataStore } from "@/stores/roleWorkflow";
|
||||
import { useRetirementDataStore } from "@/modules/06_retirement/store/Main";
|
||||
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
|
@ -25,7 +25,6 @@ import type { DataProfile } from "@/modules/05_placement/interface/index/Main";
|
|||
|
||||
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
|
||||
import CardProfile from "@/components/CardProfile.vue";
|
||||
import WorkFlow from "@/components/Workflow/Main.vue";
|
||||
import DialogAddCommander from "@/modules/06_retirement/components/DialogAddCommander.vue";
|
||||
|
||||
/** Use */
|
||||
|
|
@ -34,6 +33,7 @@ const route = useRoute();
|
|||
const router = useRouter();
|
||||
|
||||
const store = useRetirementDataStore();
|
||||
const { fetchDataCheckIsoffice } = useRoleWorkflowDataStore();
|
||||
const { convertStatusText } = store;
|
||||
const checkRoutePermisson = ref<boolean>(route.name == "resignDetailbyid");
|
||||
const mixin = useCounterMixin();
|
||||
|
|
@ -43,7 +43,6 @@ const {
|
|||
showLoader,
|
||||
hideLoader,
|
||||
success,
|
||||
|
||||
dialogConfirm,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
|
@ -54,16 +53,8 @@ const personId = ref<string>("");
|
|||
const roleUser = ref<string>("");
|
||||
const dataProfile = ref<DataProfile>();
|
||||
const approveStep = ref<string>("");
|
||||
const group = ref<string>("");
|
||||
|
||||
// const approveCheck = computed(() => {
|
||||
// return (
|
||||
// rowsApprover.value?.commanders?.every(
|
||||
// (commander) =>
|
||||
// commander.approveStatus === "APPROVE" ||
|
||||
// commander.approveStatus === "REJECT"
|
||||
// ) ?? false
|
||||
// );
|
||||
// });
|
||||
const idCheck = computed(() => {
|
||||
if (
|
||||
typeAdd.value == "COMMANDER" &&
|
||||
|
|
@ -84,31 +75,6 @@ const idCheck = computed(() => {
|
|||
}
|
||||
});
|
||||
|
||||
// const approvePendingCheck = computed(() => {
|
||||
// const commanders = rowsApprover.value?.commanders || [];
|
||||
// const index = commanders.findIndex((c) => c.profileId === myProfileId.value);
|
||||
|
||||
// if (index === -1) {
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// const currentCommander = commanders[index];
|
||||
|
||||
// if (currentCommander.approveStatus !== "PENDING") {
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// if (index === 0) {
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// const previousApproved = commanders
|
||||
// .slice(0, index)
|
||||
// .every(
|
||||
// (c) => c.approveStatus === "APPROVE" || c.approveStatus === "REJECT"
|
||||
// );
|
||||
// return previousApproved;
|
||||
// });
|
||||
const isOfficer = ref<boolean>(false);
|
||||
const isStaff = ref<boolean>(false);
|
||||
const profileType = ref<string>("");
|
||||
|
|
@ -211,7 +177,6 @@ const dataDetail = ref<any>({
|
|||
reasonResign: "",
|
||||
});
|
||||
|
||||
const workflowRef = ref<any>(null);
|
||||
const organizationPositionOld = ref<string>("");
|
||||
const positionTypeOld = ref<string>("");
|
||||
const positionLevelOld = ref<string>("");
|
||||
|
|
@ -228,20 +193,6 @@ const actionPass = ref<boolean>(false);
|
|||
const reasonReign = ref<string>("");
|
||||
const dateBreak = ref<Date | null>(null);
|
||||
|
||||
const isCheckData = computed(() => {
|
||||
if (
|
||||
organizationPositionOld.value !== "" &&
|
||||
positionTypeOld.value !== "" &&
|
||||
positionLevelOld.value !== "" &&
|
||||
posNo.value !== "" &&
|
||||
date.value !== null &&
|
||||
dataDetail.value.commanderReject !== null &&
|
||||
dataDetail.value.oligarchReject !== null
|
||||
) {
|
||||
return true;
|
||||
} else return false;
|
||||
});
|
||||
|
||||
/** คอลัมน์ */
|
||||
const rows = ref<TypeFile[]>([]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
|
|
@ -309,9 +260,11 @@ function diffDate() {
|
|||
return false;
|
||||
}
|
||||
|
||||
/** นำข้อมูลมาจาก API*/
|
||||
/**
|
||||
* ฟังก์ชันดึงข้อมูลรายละเอียดการลาออก
|
||||
* @param id id ของผู้ใช้งาน
|
||||
*/
|
||||
async function fetchData(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.resingByid(id))
|
||||
.then(async (res) => {
|
||||
|
|
@ -346,6 +299,7 @@ async function fetchData(id: string) {
|
|||
isDiscipline.value = data.isDiscipline;
|
||||
statusCheck.value = data.status;
|
||||
approveStep.value = data.approveStep;
|
||||
group.value = data.group;
|
||||
profileType.value = data.profileType;
|
||||
keycloakUserId.value = data.keycloakUserId;
|
||||
rowsApprover.value = {
|
||||
|
|
@ -355,13 +309,14 @@ async function fetchData(id: string) {
|
|||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**Pop up */
|
||||
/**
|
||||
* ฟังก์ชันเปิด pop up อนุญาตหรือยับยั้ง
|
||||
* @param action action อนุญาตหรือยับยั้ง
|
||||
* @param type ประเภทผู้ใช้งาน
|
||||
*/
|
||||
function popUp(action: "pass" | "passNot", type: string) {
|
||||
reasonReign.value = "";
|
||||
dateBreak.value = null;
|
||||
|
|
@ -370,7 +325,10 @@ function popUp(action: "pass" | "passNot", type: string) {
|
|||
openModal();
|
||||
}
|
||||
|
||||
//เงื่อนไขpop up
|
||||
/**
|
||||
* ฟังก์ชันยืนยันการอนุญาตหรือยับยั้ง
|
||||
* @param type ประเภทผู้บัริหาร
|
||||
*/
|
||||
function onSubmit(type: string) {
|
||||
if (roleUser.value === "commander" && actionPass.value) {
|
||||
confirmpopUp("/comander");
|
||||
|
|
@ -381,22 +339,12 @@ function onSubmit(type: string) {
|
|||
} else if (roleUser.value === "oligarch" && !actionPass.value) {
|
||||
rejectpopUp("");
|
||||
}
|
||||
// if (actionPass.value) {
|
||||
// if (type === "approver") {
|
||||
// confirmpopUp("/comander");
|
||||
// } else {
|
||||
// confirmpopUp("");
|
||||
// }
|
||||
// } else {
|
||||
// if (type === "approver") {
|
||||
// rejectpopUp("/comander");
|
||||
// } else {
|
||||
// rejectpopUp("");
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
//pop up ยืนยันการอนุญาต
|
||||
/**
|
||||
* ฟังก์ชันยืนยันการอนุญาต
|
||||
* @param path path สำหรับการอนุญาต
|
||||
*/
|
||||
async function confirmpopUp(path: string) {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
|
|
@ -427,7 +375,10 @@ async function confirmpopUp(path: string) {
|
|||
);
|
||||
}
|
||||
|
||||
//pop up การยับยั้งสำเร็จ
|
||||
/**
|
||||
* ฟังก์ชันยืนยันการยับยั้ง
|
||||
* @param path path สำหรับการยับยั้ง
|
||||
*/
|
||||
async function rejectpopUp(path: string) {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
|
|
@ -459,9 +410,7 @@ async function rejectpopUp(path: string) {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* กดยกเลิก
|
||||
*/
|
||||
/** ฟังก์ชันยกเลิกการแก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย*/
|
||||
async function clickCancel() {
|
||||
edit.value = false;
|
||||
const data = dataDetail.value;
|
||||
|
|
@ -483,19 +432,23 @@ async function clickCancel() {
|
|||
}
|
||||
myForm.value?.resetValidation();
|
||||
}
|
||||
/**
|
||||
* กดยกเลิก
|
||||
*/
|
||||
|
||||
/** ฟังก์ชันยกเลิกการแก้ไขข้อมูลรายการตรวจสอบเงื่อนไขต่างๆ*/
|
||||
async function clickCancelConditions() {
|
||||
await fetchData(id.value);
|
||||
conditions.value = false;
|
||||
const data = dataDetail.value;
|
||||
if (data) {
|
||||
isNoDebt.value = data.isNoDebt;
|
||||
isNoBurden.value = data.isNoBurden;
|
||||
isDiscipline.value = data.isDiscipline;
|
||||
conditions.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
/** Function บันทึก รายการตรวจสอบเงื่อนไขต่างๆ*/
|
||||
/** ฟังก์ชันบันทึกเงื่อนไขต่างๆ*/
|
||||
function onSubmitConditions() {
|
||||
dialogConfirm($q, () => {
|
||||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
http
|
||||
await http
|
||||
.put(config.API.resignConditions(id.value), {
|
||||
isNoDebt: isNoDebt.value,
|
||||
isNoBurden: isNoBurden.value,
|
||||
|
|
@ -515,9 +468,9 @@ function onSubmitConditions() {
|
|||
});
|
||||
}
|
||||
|
||||
/** Function บันทึก ,แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย*/
|
||||
/** ฟังก์ชันบันทึกข้อมูลเพื่อลงบัญชีแนบท้าย*/
|
||||
function onSubmitAttached() {
|
||||
dialogConfirm($q, () => {
|
||||
dialogConfirm($q, async () => {
|
||||
const formData = new FormData();
|
||||
const send = date.value !== null ? new Date(date.value).toUTCString() : "";
|
||||
const activeDate =
|
||||
|
|
@ -533,7 +486,7 @@ function onSubmitAttached() {
|
|||
formData.append("AmountOld", salary.value.toString());
|
||||
formData.append("remarkHorizontal", remarkHorizontal.value);
|
||||
showLoader();
|
||||
http
|
||||
await http
|
||||
.put(config.API.resingByid(id.value), formData)
|
||||
.then(async () => {
|
||||
await fetchData(id.value);
|
||||
|
|
@ -550,7 +503,7 @@ function onSubmitAttached() {
|
|||
}
|
||||
|
||||
/**
|
||||
* Function เพิ่ม Class เวลา Edit
|
||||
* ฟังก์ชันเปลี่ยน Class
|
||||
* @param val เมื่อเป็นEdit จะเปลี่ยน Class
|
||||
*/
|
||||
function getClass(val: boolean) {
|
||||
|
|
@ -560,16 +513,6 @@ function getClass(val: boolean) {
|
|||
};
|
||||
}
|
||||
|
||||
/** แปลง StatusOrder */
|
||||
function statusOrder(val: boolean) {
|
||||
switch (val) {
|
||||
case true:
|
||||
return "ยับยั้ง";
|
||||
case false:
|
||||
return "อนุญาต";
|
||||
}
|
||||
}
|
||||
|
||||
// ดาว์นโหลดไฟล์
|
||||
async function fileDownload(type: string, fileName: string) {
|
||||
showLoader();
|
||||
|
|
@ -592,7 +535,6 @@ function updatemodalPersonal(modal: boolean) {
|
|||
}
|
||||
|
||||
async function fetchFile() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.file("พ้นจากราชการ", "หลักฐานลาออก", id.value))
|
||||
.then(async (res) => {
|
||||
|
|
@ -600,13 +542,12 @@ async function fetchFile() {
|
|||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
function uploadFiles() {
|
||||
async function uploadFiles() {
|
||||
showLoader();
|
||||
http
|
||||
await http
|
||||
.post(config.API.file("พ้นจากราชการ", "หลักฐานลาออก", id.value), {
|
||||
replace: true,
|
||||
fileList: [
|
||||
|
|
@ -673,13 +614,13 @@ async function downloadFiles(fileName: string) {
|
|||
}
|
||||
|
||||
/**
|
||||
* ลบไฟล์
|
||||
* ฟังก์ชันลบไฟล์
|
||||
* @param id id file
|
||||
*/
|
||||
function removeFile(fileName: string) {
|
||||
dialogRemove($q, () => {
|
||||
dialogRemove($q, async () => {
|
||||
showLoader();
|
||||
http
|
||||
await http
|
||||
.delete(
|
||||
config.API.fileByFile(
|
||||
"พ้นจากราชการ",
|
||||
|
|
@ -688,15 +629,16 @@ function removeFile(fileName: string) {
|
|||
fileName
|
||||
)
|
||||
)
|
||||
.then(() => {
|
||||
.then(async () => {
|
||||
setTimeout(async () => {
|
||||
await fetchFile();
|
||||
success($q, `ลบไฟล์สำเร็จ`);
|
||||
hideLoader();
|
||||
}, 1000);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
|
|
@ -719,47 +661,51 @@ function convertStatus(val: string) {
|
|||
} else return val;
|
||||
}
|
||||
|
||||
/** เปิด POP UP */
|
||||
/**
|
||||
* ฟังก์ชันเปิด modal เพิ่มผู้บังคับบัญชา
|
||||
* @param type บังคับบัญชา,ผู้มีอำนาจ
|
||||
*/
|
||||
function onAddPerson(type: string) {
|
||||
modalAdd.value = true;
|
||||
typeAdd.value = type;
|
||||
}
|
||||
|
||||
/** ฟังก์ดึงข้อมูลผู้บังคับบัญชา*/
|
||||
async function checkOfficer() {
|
||||
http
|
||||
.get(config.API.checkIsofficer + `SYS_RESIGN`)
|
||||
.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("SYS_RESIGN");
|
||||
isOfficer.value = data.isOfficer;
|
||||
isStaff.value = data.isStaff;
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
}
|
||||
}
|
||||
|
||||
/** ฟังก์ชันส่งไปพิจารณา*/
|
||||
function onSend() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => {
|
||||
async () => {
|
||||
showLoader();
|
||||
http
|
||||
await http
|
||||
.get(config.API.sendApproveRetirement("", id.value))
|
||||
.then(async (res) => {
|
||||
await fetchFile();
|
||||
await fetchData(id.value);
|
||||
.then(async () => {
|
||||
await Promise.all([fetchFile(), fetchData(id.value)]);
|
||||
success($q, "ส่งไปพิจารณา");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {});
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
},
|
||||
"ยืนยันการส่งไปพิจารณา",
|
||||
"ต้องการส่งไปพิจารณาใช่หรือไม่"
|
||||
);
|
||||
}
|
||||
|
||||
/** ฟังก์ชันดึงข้อมูลตำแหน่งจาก Keycloak*/
|
||||
async function fetchKeycloakPosition() {
|
||||
if (myProfileId.value == "") {
|
||||
await http
|
||||
|
|
@ -774,13 +720,13 @@ async function fetchKeycloakPosition() {
|
|||
}
|
||||
}
|
||||
|
||||
/** Hook */
|
||||
/** hook ฟังก์ชันเมื่อโหลดคอมโพเนนต์*/
|
||||
onMounted(async () => {
|
||||
showLoader();
|
||||
await Promise.all([
|
||||
await fetchData(id.value),
|
||||
await fetchKeycloakPosition(),
|
||||
await checkOfficer(),
|
||||
fetchData(id.value),
|
||||
fetchKeycloakPosition(),
|
||||
checkOfficer(),
|
||||
fetchFile(),
|
||||
]).finally(() => {
|
||||
hideLoader();
|
||||
|
|
@ -813,39 +759,6 @@ onMounted(async () => {
|
|||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-dark">ข้อมูลการลาออก</div>
|
||||
<!-- <q-space />
|
||||
<div
|
||||
class="q-gutter-x-sm"
|
||||
v-if="
|
||||
(roleUser === 'officer' && dataDetail.officerReject === null) ||
|
||||
(roleUser === 'commander' &&
|
||||
dataDetail.commanderReject === null &&
|
||||
dataDetail.officerReject !== null) ||
|
||||
(roleUser === 'oligarch' &&
|
||||
dataDetail.oligarchReject === null &&
|
||||
dataDetail.commanderReject !== null &&
|
||||
dataDetail.officerReject !== null)
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
outline
|
||||
color="primary"
|
||||
dense
|
||||
icon-right="check"
|
||||
class="q-px-sm"
|
||||
label="อนุญาต"
|
||||
@click="popUp('pass')"
|
||||
/>
|
||||
<q-btn
|
||||
outline
|
||||
color="red"
|
||||
dense
|
||||
icon-right="close"
|
||||
class="q-px-sm"
|
||||
label="ยับยั้ง"
|
||||
@click="popUp('passNot')"
|
||||
/>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row col-12 q-pa-md">
|
||||
|
|
@ -1025,11 +938,11 @@ onMounted(async () => {
|
|||
เงื่อนไขต่างๆ
|
||||
</div>
|
||||
<q-space />
|
||||
<!-- workflowRef?.permission.isUpdate && -->
|
||||
|
||||
<div
|
||||
v-if="
|
||||
!checkRoutePermisson && dataDetail.statusMain === 'WAITTING'
|
||||
!checkRoutePermisson &&
|
||||
((isStaff && group === '1.1' && approveStep === 'st1') ||
|
||||
(isOfficer && group !== '1.1' && approveStep === 'st3'))
|
||||
"
|
||||
>
|
||||
<div v-if="!conditions">
|
||||
|
|
@ -1107,7 +1020,9 @@ onMounted(async () => {
|
|||
|
||||
<q-file
|
||||
v-if="
|
||||
!checkRoutePermisson && dataDetail.statusMain === 'WAITTING'
|
||||
!checkRoutePermisson &&
|
||||
((isStaff && group === '1.1' && approveStep === 'st1') ||
|
||||
(isOfficer && group !== '1.1' && approveStep === 'st3'))
|
||||
"
|
||||
class="col-12"
|
||||
for="#evidenceFiles"
|
||||
|
|
@ -1164,7 +1079,12 @@ onMounted(async () => {
|
|||
<q-btn
|
||||
v-if="
|
||||
!checkRoutePermisson &&
|
||||
dataDetail.statusMain === 'WAITTING'
|
||||
((isStaff &&
|
||||
group === '1.1' &&
|
||||
approveStep === 'st1') ||
|
||||
(isOfficer &&
|
||||
group !== '1.1' &&
|
||||
approveStep === 'st3'))
|
||||
"
|
||||
dense
|
||||
flat
|
||||
|
|
@ -1191,51 +1111,6 @@ onMounted(async () => {
|
|||
</div>
|
||||
</q-card>
|
||||
|
||||
<!-- ผลการพิจารณาของการเจ้าหน้าที่ของหน่วยงาน -->
|
||||
<!-- <q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-dark">
|
||||
ผลการพิจารณาของการเจ้าหน้าที่ของหน่วยงาน
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row col-12 q-pa-md">
|
||||
<div class="col-12 row bg-white q-col-gutter-md">
|
||||
<div class="col-xs-6 row items-start">
|
||||
<div class="col-12 text-top">สถานะ</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{
|
||||
dataDetail.officerReject !== null
|
||||
? statusOrder(dataDetail.officerReject)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 row items-start">
|
||||
<div class="col-12 text-top">วันสุดท้ายที่ยับยั้ง</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{
|
||||
dataDetail.officerRejectDate !== null
|
||||
? date2Thai(dataDetail.officerRejectDate)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 row items-start">
|
||||
<div class="col-12 text-top">ความคิดเห็นและเหตุผล</div>
|
||||
|
||||
<div class="col-12 text-detail">
|
||||
{{
|
||||
dataDetail.officerReject
|
||||
? dataDetail.officerRejectReason
|
||||
: dataDetail.officerApproveReason
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card> -->
|
||||
|
||||
<!-- ผลการพิจารณาของผู้บังคับบัญชา -->
|
||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
|
|
@ -1243,8 +1118,13 @@ onMounted(async () => {
|
|||
ผลการพิจารณาของผู้บังคับบัญชา
|
||||
</div>
|
||||
<!-- ตัวอย่างเช็คของ การลา -->
|
||||
|
||||
<q-btn
|
||||
v-if="statusCheck == 'WAITTING' && (isOfficer || isStaff)"
|
||||
v-if="
|
||||
!checkRoutePermisson &&
|
||||
((isStaff && group === '1.1' && approveStep === 'st1') ||
|
||||
(isStaff && group !== '1.1' && approveStep === 'st1'))
|
||||
"
|
||||
flat
|
||||
round
|
||||
icon="add"
|
||||
|
|
@ -1256,34 +1136,6 @@ onMounted(async () => {
|
|||
<q-tooltip>เพิ่มรายชื่อผู้บังคับบัญชา</q-tooltip>
|
||||
</q-btn>
|
||||
<q-space />
|
||||
<!-- workflowRef?.permission.isUpdate && -->
|
||||
|
||||
<!-- <div
|
||||
class="q-gutter-x-sm"
|
||||
v-if="
|
||||
dataDetail.commanderReject === null &&
|
||||
dataDetail.statusMain === 'WAITTING'
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
outline
|
||||
color="primary"
|
||||
dense
|
||||
icon-right="check"
|
||||
class="q-px-sm"
|
||||
label="อนุญาต"
|
||||
@click="popUp('pass', 'commander')"
|
||||
/>
|
||||
<q-btn
|
||||
outline
|
||||
color="red"
|
||||
dense
|
||||
icon-right="close"
|
||||
class="q-px-sm"
|
||||
label="ยับยั้ง"
|
||||
@click="popUp('passNot', 'commander')"
|
||||
/>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<div class="col-12"><q-separator /></div>
|
||||
|
|
@ -1316,12 +1168,16 @@ onMounted(async () => {
|
|||
<div
|
||||
v-if="
|
||||
props.row.approveStatus == 'PENDING' &&
|
||||
props.row.comment == ''
|
||||
props.row.comment == '' &&
|
||||
approveStep === 'st2'
|
||||
"
|
||||
class="q-gutter-x-xs"
|
||||
>
|
||||
<q-btn
|
||||
v-if="props.row.profileId === myProfileId"
|
||||
v-if="
|
||||
props.row.profileId === myProfileId &&
|
||||
approveStep === 'st2'
|
||||
"
|
||||
outline
|
||||
dense
|
||||
color="primary"
|
||||
|
|
@ -1331,7 +1187,10 @@ onMounted(async () => {
|
|||
@click="popUp('pass', 'commander')"
|
||||
/>
|
||||
<q-btn
|
||||
v-if="props.row.profileId === myProfileId"
|
||||
v-if="
|
||||
props.row.profileId === myProfileId &&
|
||||
approveStep === 'st2'
|
||||
"
|
||||
outline
|
||||
color="red"
|
||||
dense
|
||||
|
|
@ -1376,8 +1235,13 @@ onMounted(async () => {
|
|||
<div class="q-pl-sm text-weight-bold text-dark">
|
||||
ผลการพิจารณาของผู้มีอำนาจ
|
||||
</div>
|
||||
|
||||
<q-btn
|
||||
v-if="statusCheck == 'WAITTING' && (isOfficer || isStaff)"
|
||||
v-if="
|
||||
!checkRoutePermisson &&
|
||||
((isStaff && group === '1.1' && approveStep === 'st1') ||
|
||||
(isOfficer && group !== '1.1' && approveStep === 'st3'))
|
||||
"
|
||||
flat
|
||||
round
|
||||
icon="add"
|
||||
|
|
@ -1394,11 +1258,12 @@ onMounted(async () => {
|
|||
<div
|
||||
class="q-gutter-x-sm"
|
||||
v-if="
|
||||
approveStep == 'st3' &&
|
||||
rowsApprover &&
|
||||
rowsApprover.approvers &&
|
||||
rowsApprover.approvers[0]?.profileId == myProfileId &&
|
||||
rowsApprover.approvers[0]?.approveStatus == 'PENDING'
|
||||
rowsApprover.approvers[0]?.approveStatus == 'PENDING' &&
|
||||
((group === '1.1' && approveStep === 'st3') ||
|
||||
(group !== '1.1' && approveStep === 'st4'))
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
|
|
@ -1479,20 +1344,33 @@ onMounted(async () => {
|
|||
<q-card
|
||||
bordered
|
||||
class="row col-12 text-dark q-mt-sm q-pa-sm"
|
||||
v-if="statusCheck == 'WAITTING' && (isOfficer || isStaff)"
|
||||
v-if="
|
||||
!checkRoutePermisson &&
|
||||
((isStaff && group === '1.1' && approveStep === 'st1') ||
|
||||
(isStaff && group !== '1.1' && approveStep === 'st1') ||
|
||||
(isOfficer && group !== '1.1' && approveStep === 'st3'))
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
@click="onSend"
|
||||
:disable="
|
||||
rowsApprover?.approvers.length == 0 ||
|
||||
rowsApprover?.commanders.length == 0
|
||||
(group === '1.1' &&
|
||||
(rowsApprover?.approvers.length == 0 ||
|
||||
rowsApprover?.commanders.length == 0)) ||
|
||||
(group !== '1.1 ' &&
|
||||
rowsApprover?.commanders.length == 0 &&
|
||||
approveStep === 'st1') ||
|
||||
(group !== '1.1 ' &&
|
||||
rowsApprover?.approvers.length == 0 &&
|
||||
approveStep === 'st3')
|
||||
"
|
||||
@click="onSend"
|
||||
label="ส่งไปพิจารณา"
|
||||
color="secondary"
|
||||
class="q-ml-auto"
|
||||
><q-tooltip>คลิกเพื่อส่งไปพิจารณา</q-tooltip></q-btn
|
||||
>
|
||||
</q-card>
|
||||
|
||||
<!-- แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย -->
|
||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||
<q-form
|
||||
|
|
@ -1510,7 +1388,12 @@ onMounted(async () => {
|
|||
<!-- workflowRef?.permission.isUpdate && -->
|
||||
|
||||
<div
|
||||
v-if="!checkRoutePermisson && dataDetail.statusMain === 'WAITTING'"
|
||||
v-if="
|
||||
!checkRoutePermisson &&
|
||||
(dataDetail.statusMain === 'APPROVE' ||
|
||||
dataDetail.statusMain === 'REJECT') &&
|
||||
((isStaff && group === '1.1') || (isOfficer && group !== '1.1'))
|
||||
"
|
||||
>
|
||||
<div class="q-gutter-sm" v-if="!edit">
|
||||
<q-btn
|
||||
|
|
@ -1758,7 +1641,7 @@ onMounted(async () => {
|
|||
dense
|
||||
outlined
|
||||
lazy-rules
|
||||
:rules="[(val:string) => !!val || 'กรุณากรอกความคิดเห็น/เหตุผล']"
|
||||
:rules=" !actionPass ? [(val:string) => !!val || 'กรุณากรอกความคิดเห็น/เหตุผล'] :[]"
|
||||
v-model="reasonReign"
|
||||
:label="`${'กรอกความคิดเห็น/เหตุผล'}`"
|
||||
type="textarea"
|
||||
|
|
@ -1809,12 +1692,11 @@ onMounted(async () => {
|
|||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right" class="bg-white text-teal">
|
||||
<q-card-actions align="right">
|
||||
<q-btn label="บันทึก" color="secondary" type="submit"
|
||||
><q-tooltip>บันทึกข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
</q-card-actions>
|
||||
<!-- <DialogFooter :editvisible="true" :save="conditionPopup" /> -->
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ import { useQuasar, QForm, type QTableProps } from "quasar";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useRetirementDataStore } from "@/modules/06_retirement/store/Main";
|
||||
import { useRoleWorkflowDataStore } from "@/stores/roleWorkflow";
|
||||
|
||||
import type { DataProfile } from "@/modules/05_placement/interface/index/Main";
|
||||
import type {
|
||||
|
|
@ -18,7 +18,6 @@ import type {
|
|||
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import CardProfile from "@/components/CardProfile.vue";
|
||||
import WorkFlow from "@/components/Workflow/Main.vue";
|
||||
import DialogAddCommander from "@/modules/06_retirement/components/DialogAddCommander.vue";
|
||||
|
||||
/** Use */
|
||||
|
|
@ -26,9 +25,8 @@ const $q = useQuasar();
|
|||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const store = useRetirementDataStore();
|
||||
const { fetchDataCheckIsoffice } = useRoleWorkflowDataStore();
|
||||
const { convertStatusText } = store;
|
||||
const checkRoutePermisson = ref<boolean>(route.name == "resignDetailReject");
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
messageError,
|
||||
date2Thai,
|
||||
|
|
@ -36,19 +34,16 @@ const {
|
|||
hideLoader,
|
||||
success,
|
||||
dialogConfirm,
|
||||
} = mixin;
|
||||
} = useCounterMixin();
|
||||
|
||||
const checkRoutePermisson = ref<boolean>(route.name == "resignDetailReject");
|
||||
|
||||
/** ตัวแปร */
|
||||
const roleUser = ref<string>("");
|
||||
const dataProfile = ref<DataProfile>();
|
||||
const group = ref<string>("");
|
||||
const approveStep = ref<string>("");
|
||||
|
||||
const approveCheck = computed(() => {
|
||||
return (
|
||||
rowsApprover.value?.commanders?.every(
|
||||
(commander) => commander.approveStatus === "APPROVE"
|
||||
) ?? false
|
||||
);
|
||||
});
|
||||
const idCheck = computed(() => {
|
||||
if (
|
||||
typeAdd.value == "COMMANDER" &&
|
||||
|
|
@ -69,29 +64,6 @@ const idCheck = computed(() => {
|
|||
}
|
||||
});
|
||||
|
||||
const approvePendingCheck = computed(() => {
|
||||
const commanders = rowsApprover.value?.commanders || [];
|
||||
const index = commanders.findIndex((c) => c.profileId === keycloakId.value);
|
||||
|
||||
if (index === -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const currentCommander = commanders[index];
|
||||
|
||||
if (currentCommander.approveStatus !== "PENDING") {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (index === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const previousApproved = commanders
|
||||
.slice(0, index)
|
||||
.every((c) => c.approveStatus === "APPROVE");
|
||||
return previousApproved;
|
||||
});
|
||||
const isOfficer = ref<boolean>(false);
|
||||
const isStaff = ref<boolean>(false);
|
||||
const profileType = ref<string>("");
|
||||
|
|
@ -151,15 +123,6 @@ const columnsCommanders = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "rejectDate",
|
||||
align: "left",
|
||||
label: "วันสุดท้ายที่ยับยั้ง",
|
||||
field: "rejectDate",
|
||||
sortable: true,
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
|
||||
const id = ref<string>(route.params.id.toString());
|
||||
|
|
@ -187,9 +150,11 @@ const dataDetail = ref<any>({
|
|||
statustext: "",
|
||||
fullname: "",
|
||||
statusMain: "",
|
||||
cancelReason: "",
|
||||
remark: "",
|
||||
reasonResign: "",
|
||||
});
|
||||
|
||||
const workflowRef = ref<any>(null);
|
||||
const organizationPositionOld = ref<string>("");
|
||||
const positionTypeOld = ref<string>("");
|
||||
const positionLevelOld = ref<string>("");
|
||||
|
|
@ -206,32 +171,21 @@ const actionPass = ref<boolean>(false);
|
|||
const reasonReign = ref<string>("");
|
||||
const dateBreak = ref<Date | null>(null);
|
||||
|
||||
const isCheckData = computed(() => {
|
||||
if (
|
||||
organizationPositionOld.value !== "" &&
|
||||
positionTypeOld.value !== "" &&
|
||||
positionLevelOld.value !== "" &&
|
||||
posNo.value !== "" &&
|
||||
date.value !== null &&
|
||||
dataDetail.value.commanderReject !== null &&
|
||||
dataDetail.value.oligarchReject !== null
|
||||
) {
|
||||
return true;
|
||||
} else return false;
|
||||
});
|
||||
|
||||
/**เปิด-ปิด modal */
|
||||
function closeModal() {
|
||||
modal.value = false;
|
||||
}
|
||||
function openModal() {
|
||||
modal.value = true;
|
||||
}
|
||||
|
||||
const isNoDebt = ref<boolean>(false);
|
||||
const isNoBurden = ref<boolean>(false);
|
||||
const isDiscipline = ref<boolean>(false);
|
||||
|
||||
/** ฟังก์ชันปิด popup อนุญาตหรือยับยั้ง*/
|
||||
function closeModal() {
|
||||
modal.value = false;
|
||||
}
|
||||
|
||||
/** ฟังก์ชันเปิด popup อนุญาตหรือยับยั้ง*/
|
||||
function openModal() {
|
||||
modal.value = true;
|
||||
}
|
||||
|
||||
/** ฟังก์ชันตรวจสอบวันที่ขอลาออกจากราชการน้อยกว่า 30 วัน*/
|
||||
function diffDate() {
|
||||
if (date.value !== null && dateLeave.value !== null) {
|
||||
const time = dateLeave.value.getTime() - date.value.getTime();
|
||||
|
|
@ -245,9 +199,11 @@ function diffDate() {
|
|||
return false;
|
||||
}
|
||||
|
||||
/** นำข้อมูลมาจาก API*/
|
||||
/**
|
||||
* ฟังก์ชันดึงข้อมูลรายละเอียดการยกเลิกการลาออก
|
||||
* @param id id ของผู้ใช้งาน
|
||||
*/
|
||||
async function fetchData(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.listResign() + `/cancel/${id}`)
|
||||
.then(async (res) => {
|
||||
|
|
@ -269,6 +225,8 @@ async function fetchData(id: string) {
|
|||
isNoDebt.value = data.isNoDebt;
|
||||
isNoBurden.value = data.isNoBurden;
|
||||
isDiscipline.value = data.isDiscipline;
|
||||
approveStep.value = data.approveStep;
|
||||
group.value = data.group;
|
||||
|
||||
statusCheck.value = data.status;
|
||||
profileType.value = data.profileType;
|
||||
|
|
@ -280,13 +238,14 @@ async function fetchData(id: string) {
|
|||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**Pop up */
|
||||
/**
|
||||
* ฟังก์ชันเปิด pop up อนุญาตหรือยับยั้ง
|
||||
* @param action action อนุญาตหรือยับยั้ง
|
||||
* @param type ประเภทผู้ใช้งาน
|
||||
*/
|
||||
function popUp(action: "pass" | "passNot", type: string) {
|
||||
reasonReign.value = "";
|
||||
dateBreak.value = null;
|
||||
|
|
@ -295,16 +254,24 @@ function popUp(action: "pass" | "passNot", type: string) {
|
|||
openModal();
|
||||
}
|
||||
|
||||
//เงื่อนไขpop up
|
||||
/** ฟังก์ชันยืนยันการอนุญาตหรือไม่อนุญาตการยกเลิกการลาออก*/
|
||||
function onSubmit() {
|
||||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
const body = {
|
||||
reason: reasonReign.value,
|
||||
reject: !actionPass.value,
|
||||
// reject: !actionPass.value,
|
||||
Date: new Date(),
|
||||
};
|
||||
|
||||
const action = actionPass.value ? "approve" : "reject";
|
||||
|
||||
const endpoint =
|
||||
roleUser.value === "commander"
|
||||
? config.API.comanderCancelResign("", action, id.value)
|
||||
: config.API.approverCancelResign("", action, id.value);
|
||||
await http
|
||||
.put(config.API.resignReject(`${roleUser.value}-cancel`, id.value), body)
|
||||
.put(endpoint, body)
|
||||
.then(async () => {
|
||||
await fetchData(id.value);
|
||||
closeModal();
|
||||
|
|
@ -319,9 +286,7 @@ function onSubmit() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* กดยกเลิก
|
||||
*/
|
||||
/** ฟังก์ชันยกเลิกการแก้ไขข้อมูลแนบท้าย*/
|
||||
async function clickCancel() {
|
||||
edit.value = false;
|
||||
const data = dataDetail.value;
|
||||
|
|
@ -344,7 +309,7 @@ async function clickCancel() {
|
|||
myForm.value?.resetValidation();
|
||||
}
|
||||
|
||||
/** Function บันทึก ,แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย*/
|
||||
/** ฟังก์ชันบันทึกข้อมูลเพื่อลงบัญชีแนบท้าย*/
|
||||
function onSubmitAttached() {
|
||||
dialogConfirm($q, () => {
|
||||
const formData = new FormData();
|
||||
|
|
@ -379,7 +344,7 @@ function onSubmitAttached() {
|
|||
}
|
||||
|
||||
/**
|
||||
* Function เพิ่ม Class เวลา Edit
|
||||
* ฟังก์ชันเปลี่ยน Class
|
||||
* @param val เมื่อเป็นEdit จะเปลี่ยน Class
|
||||
*/
|
||||
function getClass(val: boolean) {
|
||||
|
|
@ -389,56 +354,51 @@ function getClass(val: boolean) {
|
|||
};
|
||||
}
|
||||
|
||||
/** แปลง StatusOrder */
|
||||
function statusOrder(val: boolean) {
|
||||
switch (val) {
|
||||
case true:
|
||||
return "ยับยั้ง";
|
||||
case false:
|
||||
return "อนุญาต";
|
||||
}
|
||||
}
|
||||
|
||||
/** เปิด POP UP */
|
||||
/**
|
||||
* ฟังก์ชันเปิด popup เพิ่มผู้บังคับบัญชา, ผู้มีอำนาจ
|
||||
* @param type ผู้บังคับบัญชา, ผู้มีอำนาจ
|
||||
*/
|
||||
function onAddPerson(type: string) {
|
||||
modalAdd.value = true;
|
||||
typeAdd.value = type;
|
||||
}
|
||||
|
||||
/** ฟังก์ดึงข้อมูลสิทธ์ สกจ,กจ*/
|
||||
async function checkOfficer() {
|
||||
http
|
||||
.get(config.API.checkIsofficer + `SYS_RESIGN`)
|
||||
.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("SYS_RESIGN");
|
||||
isOfficer.value = data.isOfficer;
|
||||
isStaff.value = data.isStaff;
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
}
|
||||
}
|
||||
|
||||
/** ฟังก์ชันส่งไปพิจารณา*/
|
||||
function onSend() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => {
|
||||
async () => {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.sendApproveRetirement("", id.value))
|
||||
.then(async (res) => {
|
||||
await http
|
||||
.get(config.API.officerCancelResign("", id.value))
|
||||
.then(async () => {
|
||||
await fetchData(id.value);
|
||||
success($q, "ส่งไปพิจารณา");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {});
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
},
|
||||
"ยืนยันการส่งไปพิจารณา",
|
||||
"ต้องการส่งไปพิจารณาใช่หรือไม่"
|
||||
);
|
||||
}
|
||||
|
||||
/** ฟังก์ชันดึงข้อมูลตำแหน่งจาก Keycloak*/
|
||||
async function fetchKeycloakPosition() {
|
||||
if (keycloakId.value == "") {
|
||||
await http
|
||||
|
|
@ -453,11 +413,16 @@ async function fetchKeycloakPosition() {
|
|||
}
|
||||
}
|
||||
|
||||
/** Hook */
|
||||
/** hook ฟังก์ชันเมื่อโหลดคอมโพเนนต์*/
|
||||
onMounted(async () => {
|
||||
await fetchData(id.value);
|
||||
await fetchKeycloakPosition()
|
||||
await checkOfficer();
|
||||
showLoader();
|
||||
await Promise.all([
|
||||
fetchData(id.value),
|
||||
fetchKeycloakPosition(),
|
||||
checkOfficer(),
|
||||
]).finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
@ -486,39 +451,6 @@ onMounted(async () => {
|
|||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-dark">ข้อมูลการลาออก</div>
|
||||
<!-- <q-space />
|
||||
<div
|
||||
class="q-gutter-x-sm"
|
||||
v-if="
|
||||
(roleUser === 'officer' && dataDetail.officerReject === null) ||
|
||||
(roleUser === 'commander' &&
|
||||
dataDetail.commanderReject === null &&
|
||||
dataDetail.officerReject !== null) ||
|
||||
(roleUser === 'oligarch' &&
|
||||
dataDetail.oligarchReject === null &&
|
||||
dataDetail.commanderReject !== null &&
|
||||
dataDetail.officerReject !== null)
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
outline
|
||||
color="primary"
|
||||
dense
|
||||
icon-right="check"
|
||||
class="q-px-sm"
|
||||
label="อนุญาต"
|
||||
@click="popUp('pass')"
|
||||
/>
|
||||
<q-btn
|
||||
outline
|
||||
color="red"
|
||||
dense
|
||||
icon-right="close"
|
||||
class="q-px-sm"
|
||||
label="ยับยั้ง"
|
||||
@click="popUp('passNot')"
|
||||
/>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row col-12 q-pa-md">
|
||||
|
|
@ -566,6 +498,15 @@ onMounted(async () => {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 row items-start">
|
||||
<div class="col-12">
|
||||
<div class="col-12 text-top">เหตุผลการขอยกเลิก</div>
|
||||
<div class="col-12 text-detail text-red">
|
||||
{{ dataDetail.cancelReason }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
|
@ -577,7 +518,11 @@ onMounted(async () => {
|
|||
ผลการพิจารณาของผู้บังคับบัญชา
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="statusCheck == 'WAITTING' && (isOfficer || isStaff)"
|
||||
v-if="
|
||||
!checkRoutePermisson &&
|
||||
((isStaff && group === '1.1' && approveStep === 'st1') ||
|
||||
(isStaff && group !== '1.1' && approveStep === 'st1'))
|
||||
"
|
||||
flat
|
||||
round
|
||||
icon="add"
|
||||
|
|
@ -589,34 +534,6 @@ onMounted(async () => {
|
|||
<q-tooltip>เพิ่มรายชื่อผู้บังคับบัญชา</q-tooltip>
|
||||
</q-btn>
|
||||
<q-space />
|
||||
<!-- workflowRef?.permission.isUpdate && -->
|
||||
|
||||
<!-- <div
|
||||
class="q-gutter-x-sm"
|
||||
v-if="
|
||||
dataDetail.commanderReject === null &&
|
||||
dataDetail.statusMain === 'WAITTING'
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
outline
|
||||
color="primary"
|
||||
dense
|
||||
icon-right="check"
|
||||
class="q-px-sm"
|
||||
label="อนุญาต"
|
||||
@click="popUp('pass', 'commander')"
|
||||
/>
|
||||
<q-btn
|
||||
outline
|
||||
color="red"
|
||||
dense
|
||||
icon-right="close"
|
||||
class="q-px-sm"
|
||||
label="ยับยั้ง"
|
||||
@click="popUp('passNot', 'commander')"
|
||||
/>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<div class="col-12"><q-separator /></div>
|
||||
|
|
@ -647,25 +564,19 @@ onMounted(async () => {
|
|||
</div>
|
||||
<div v-else-if="col.name == 'comment'">
|
||||
<div
|
||||
class="q-gutter-x-xs"
|
||||
v-if="
|
||||
props.row.approveStatus == 'PENDING' &&
|
||||
props.row.comment == ''
|
||||
props.row.comment == '' &&
|
||||
approveStep === 'st2'
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
:disable="
|
||||
statusCheck == 'NEW' ||
|
||||
!approvePendingCheck ||
|
||||
(props.row.profileId !== keycloakId &&
|
||||
checkPermission($route)?.attrIsUpdate)
|
||||
"
|
||||
:outline="
|
||||
props.row.profileId !== keycloakId ||
|
||||
statusCheck == 'NEW' ||
|
||||
!approvePendingCheck
|
||||
? false
|
||||
: true
|
||||
v-if="
|
||||
props.row.profileId === keycloakId &&
|
||||
approveStep === 'st2'
|
||||
"
|
||||
outline
|
||||
dense
|
||||
color="primary"
|
||||
icon-right="check"
|
||||
|
|
@ -674,24 +585,16 @@ onMounted(async () => {
|
|||
@click="popUp('pass', 'commander')"
|
||||
/>
|
||||
<q-btn
|
||||
:disable="
|
||||
statusCheck == 'NEW' ||
|
||||
!approvePendingCheck ||
|
||||
(props.row.profileId !== keycloakId &&
|
||||
checkPermission($route)?.attrIsUpdate)
|
||||
"
|
||||
:outline="
|
||||
props.row.profileId !== keycloakId ||
|
||||
statusCheck == 'NEW' ||
|
||||
!approvePendingCheck
|
||||
? false
|
||||
: true
|
||||
v-if="
|
||||
props.row.profileId === keycloakId &&
|
||||
approveStep === 'st2'
|
||||
"
|
||||
outline
|
||||
color="red"
|
||||
dense
|
||||
icon-right="close"
|
||||
class="q-px-sm"
|
||||
label="ยับยั้ง"
|
||||
label="ไม่อนุญาต"
|
||||
@click="popUp('passNot', 'commander')"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -702,7 +605,7 @@ onMounted(async () => {
|
|||
<div v-else-if="col.name == 'approveStatus'">
|
||||
{{
|
||||
props.row.approveStatus
|
||||
? convertStatusText(props.row.approveStatus)
|
||||
? convertStatusText(props.row.approveStatus, "ไม่อนุญาต")
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
|
|
@ -723,7 +626,11 @@ onMounted(async () => {
|
|||
ผลการพิจารณาของผู้มีอำนาจ
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="statusCheck == 'WAITTING' && (isOfficer || isStaff)"
|
||||
v-if="
|
||||
!checkRoutePermisson &&
|
||||
((isStaff && group === '1.1' && approveStep === 'st1') ||
|
||||
(isOfficer && group !== '1.1' && approveStep === 'st3'))
|
||||
"
|
||||
flat
|
||||
round
|
||||
icon="add"
|
||||
|
|
@ -735,20 +642,17 @@ onMounted(async () => {
|
|||
<q-tooltip>เพิ่มรายชื่อผู้มีอำนาจ</q-tooltip>
|
||||
</q-btn>
|
||||
<q-space />
|
||||
<!-- workflowRef?.permission.isUpdate && -->
|
||||
|
||||
<div
|
||||
class="q-gutter-x-sm"
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
dataDetail.oligarchReject === null &&
|
||||
dataDetail.statusMain === 'WAITTING' &&
|
||||
rowsApprover &&
|
||||
rowsApprover.approvers &&
|
||||
rowsApprover.approvers[0]?.profileId == keycloakId &&
|
||||
rowsApprover.approvers[0]?.approveStatus == 'PENDING' &&
|
||||
approveCheck
|
||||
((group === '1.1' && approveStep === 'st3') ||
|
||||
(group !== '1.1' && approveStep === 'st4'))
|
||||
"
|
||||
class="q-gutter-x-sm"
|
||||
>
|
||||
<q-btn
|
||||
outline
|
||||
|
|
@ -765,7 +669,7 @@ onMounted(async () => {
|
|||
dense
|
||||
icon-right="close"
|
||||
class="q-px-sm"
|
||||
label="ยับยั้ง"
|
||||
label="ไม่อนุญาต"
|
||||
@click="popUp('passNot', 'oligarch')"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -792,44 +696,55 @@ onMounted(async () => {
|
|||
rowsApprover &&
|
||||
rowsApprover.approvers &&
|
||||
rowsApprover.approvers[0]?.approveStatus
|
||||
? convertStatusText(rowsApprover?.approvers[0].approveStatus)
|
||||
? convertStatusText(
|
||||
rowsApprover?.approvers[0].approveStatus,
|
||||
"ไม่อนุญาต"
|
||||
)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="col-xs-6 row items-start">
|
||||
<div class="col-12 text-top">วันสุดท้ายที่ยับยั้ง</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{
|
||||
dataDetail.oligarchRejectDate !== null
|
||||
? date2Thai(dataDetail.oligarchRejectDate)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="col-xs-12 row items-start">
|
||||
<div class="col-12 text-top">ความคิดเห็นและเหตุผล</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{
|
||||
dataDetail.oligarchReject
|
||||
? dataDetail.oligarchApproveReason
|
||||
: dataDetail.oligarchApproveReason
|
||||
rowsApprover &&
|
||||
rowsApprover.approvers &&
|
||||
rowsApprover.approvers[0]?.comment
|
||||
? rowsApprover?.approvers[0].comment
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<!-- ส่งไปพิจารณา -->
|
||||
|
||||
<q-card
|
||||
bordered
|
||||
class="row col-12 text-dark q-mt-sm q-pa-sm"
|
||||
v-if="statusCheck == 'WAITTING' && (isOfficer || isStaff)"
|
||||
v-if="
|
||||
!checkRoutePermisson &&
|
||||
((isStaff && group === '1.1' && approveStep === 'st1') ||
|
||||
(isStaff && group !== '1.1' && approveStep === 'st1') ||
|
||||
(isOfficer && group !== '1.1' && approveStep === 'st3'))
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
@click="onSend"
|
||||
:disable="
|
||||
rowsApprover?.approvers.length == 0 ||
|
||||
rowsApprover?.commanders.length == 0
|
||||
(group === '1.1' &&
|
||||
(rowsApprover?.approvers.length == 0 ||
|
||||
rowsApprover?.commanders.length == 0)) ||
|
||||
(group !== '1.1 ' &&
|
||||
rowsApprover?.commanders.length == 0 &&
|
||||
approveStep === 'st1') ||
|
||||
(group !== '1.1 ' &&
|
||||
rowsApprover?.approvers.length == 0 &&
|
||||
approveStep === 'st3')
|
||||
"
|
||||
label="ส่งไปพิจารณา"
|
||||
color="secondary"
|
||||
|
|
@ -837,6 +752,7 @@ onMounted(async () => {
|
|||
><q-tooltip>คลิกเพื่อส่งไปพิจารณา</q-tooltip></q-btn
|
||||
>
|
||||
</q-card>
|
||||
|
||||
<!-- แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย -->
|
||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||
<q-form
|
||||
|
|
@ -852,7 +768,14 @@ onMounted(async () => {
|
|||
</div>
|
||||
<q-space />
|
||||
<!-- && workflowRef?.permission.isUpdate -->
|
||||
<div v-if="!checkRoutePermisson">
|
||||
<div
|
||||
v-if="
|
||||
!checkRoutePermisson &&
|
||||
(dataDetail.status === 'APPROVE' ||
|
||||
dataDetail.status === 'REJECT') &&
|
||||
((isStaff && group === '1.1') || (isOfficer && group !== '1.1'))
|
||||
"
|
||||
>
|
||||
<div class="q-gutter-sm" v-if="!edit">
|
||||
<q-btn
|
||||
outline
|
||||
|
|
@ -956,24 +879,7 @@ onMounted(async () => {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="col-xs-6 col-sm-3 row">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
v-model="salary"
|
||||
:outlined="edit"
|
||||
dense
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
hide-bottom-space
|
||||
:label="`${'เงินเดือน'}`"
|
||||
:rules="[(val:number) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
|
||||
lazy-rules
|
||||
:class="getClass(edit)"
|
||||
mask="###,###,###,###"
|
||||
reverse-fill-mask
|
||||
/>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="col-xs-4 row">
|
||||
<div class="col-12">
|
||||
|
|
@ -1076,13 +982,6 @@ onMounted(async () => {
|
|||
</div>
|
||||
</q-form>
|
||||
</q-card>
|
||||
|
||||
<!-- <WorkFlow
|
||||
ref="workflowRef"
|
||||
v-model:is-check-data="isCheckData"
|
||||
:id="id"
|
||||
sys-name="RETIREMENT_CANCEL"
|
||||
/> -->
|
||||
</div>
|
||||
|
||||
<q-dialog v-model="modal" persistent>
|
||||
|
|
@ -1090,7 +989,7 @@ onMounted(async () => {
|
|||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||
<DialogHeader
|
||||
:tittle="`${
|
||||
actionPass ? 'อนุญาตยกเลิกการลาออก' : 'ยับยั้งยกเลิกการลาออก'
|
||||
actionPass ? 'อนุญาตยกเลิกการลาออก' : 'ไม่อนุญาตยกเลิกการลาออก'
|
||||
}`"
|
||||
:close="closeModal"
|
||||
/>
|
||||
|
|
@ -1102,7 +1001,7 @@ onMounted(async () => {
|
|||
dense
|
||||
outlined
|
||||
lazy-rules
|
||||
:rules="[(val:string) => !!val || 'กรุณากรอกความคิดเห็น/เหตุผล']"
|
||||
:rules=" !actionPass ? [(val:string) => !!val || 'กรุณากรอกความคิดเห็น/เหตุผล'] :[]"
|
||||
v-model="reasonReign"
|
||||
:label="`${'กรอกความคิดเห็น/เหตุผล'}`"
|
||||
type="textarea"
|
||||
|
|
@ -1111,12 +1010,11 @@ onMounted(async () => {
|
|||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right" class="bg-white text-teal">
|
||||
<q-card-actions align="right">
|
||||
<q-btn label="บันทึก" color="secondary" type="submit"
|
||||
><q-tooltip>บันทึกข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
</q-card-actions>
|
||||
<!-- <DialogFooter :editvisible="true" :save="conditionPopup" /> -->
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,11 @@ import { useRouter } from "vue-router";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useDataStore } from "@/modules/06_retirement/store/resignMain";
|
||||
import { useRetirementDataStore } from "@/modules/06_retirement/store/Main";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import {
|
||||
checkPermission,
|
||||
checkPermissionList,
|
||||
checkPermissionCreate,
|
||||
} from "@/utils/permissions";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
|
|
@ -131,7 +135,9 @@ const columns = ref<QTableProps["columns"]>([
|
|||
sortable: true,
|
||||
field: "status",
|
||||
format(val, row) {
|
||||
return statusText(row.status);
|
||||
return stroeResign.mainTabs === "1"
|
||||
? statusText(row.status)
|
||||
: statusText(row.status, "อนุญาต");
|
||||
},
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
@ -290,7 +296,11 @@ onMounted(async () => {
|
|||
</template>
|
||||
</q-select>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
checkPermissionList(['COMMAND']) &&
|
||||
checkPermissionCreate('COMMAND')
|
||||
"
|
||||
@click="openModalOrder"
|
||||
flat
|
||||
round
|
||||
|
|
@ -309,7 +319,7 @@ onMounted(async () => {
|
|||
ref="filterRef"
|
||||
outlined
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
@ -367,7 +377,11 @@ onMounted(async () => {
|
|||
<q-btn
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsGet &&
|
||||
checkPermission($route)?.attrIsUpdate
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
(props.row.status === 'WAITTING' ||
|
||||
props.row.status === 'PENDING' ||
|
||||
props.row.status === 'APPROVE' ||
|
||||
props.row.status === 'REJECT')
|
||||
"
|
||||
flat
|
||||
dense
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
field: "organizationPositionOld",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
||||
|
||||
// กรณี copy ทั้งหมด เเล้ว ค้นหา
|
||||
// format(val, row) {
|
||||
// return `${row.organizationPositionOld.replace(/\n/g, " ")}`;
|
||||
|
|
@ -145,7 +145,9 @@ const columns = ref<QTableProps["columns"]>([
|
|||
sortable: true,
|
||||
field: "status",
|
||||
format(val, row) {
|
||||
return statusText(row.status);
|
||||
return props.mainTabs === "1"
|
||||
? statusText(row.status)
|
||||
: statusText(row.status, "อนุญาต");
|
||||
},
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
@ -220,7 +222,7 @@ watch(
|
|||
dense
|
||||
:model-value="filterKeyword"
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ import http from "@/plugins/http";
|
|||
import config from "@/app.config";
|
||||
import genReport from "@/plugins/genreport";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useRetirementDataStore } from "@/modules/06_retirement/store/Main";
|
||||
import { useRoleWorkflowDataStore } from "@/stores/roleWorkflow";
|
||||
|
||||
import type {
|
||||
TypeFile,
|
||||
|
|
@ -27,7 +27,6 @@ import type {
|
|||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
|
||||
import CardProfile from "@/components/CardProfile.vue";
|
||||
import WorkFlow from "@/components/Workflow/Main.vue";
|
||||
import DialogAddCommander from "@/modules/06_retirement/components/DialogAddCommander.vue";
|
||||
|
||||
/** Use */
|
||||
|
|
@ -35,6 +34,7 @@ const $q = useQuasar();
|
|||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const store = useRetirementDataStore();
|
||||
const { fetchDataCheckIsoffice } = useRoleWorkflowDataStore();
|
||||
const { convertStatusText } = store;
|
||||
const checkRoutePermisson = ref<boolean>(route.name == "resignDetailbyidEMP");
|
||||
const mixin = useCounterMixin();
|
||||
|
|
@ -54,14 +54,8 @@ const modalPersonal = ref<boolean>(false);
|
|||
const personId = ref<string>("");
|
||||
const roleUser = ref<string>("");
|
||||
const dataProfile = ref<DataProfile>();
|
||||
const approveStep = ref<string>("");
|
||||
|
||||
const approveCheck = computed(() => {
|
||||
return (
|
||||
rowsApprover.value?.commanders?.every(
|
||||
(commander) => commander.approveStatus === "APPROVE"
|
||||
) ?? false
|
||||
);
|
||||
});
|
||||
const idCheck = computed(() => {
|
||||
if (
|
||||
typeAdd.value == "COMMANDER" &&
|
||||
|
|
@ -82,29 +76,6 @@ const idCheck = computed(() => {
|
|||
}
|
||||
});
|
||||
|
||||
const approvePendingCheck = computed(() => {
|
||||
const commanders = rowsApprover.value?.commanders || [];
|
||||
const index = commanders.findIndex((c) => c.profileId === keycloakId.value);
|
||||
|
||||
if (index === -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const currentCommander = commanders[index];
|
||||
|
||||
if (currentCommander.approveStatus !== "PENDING") {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (index === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const previousApproved = commanders
|
||||
.slice(0, index)
|
||||
.every((c) => c.approveStatus === "APPROVE");
|
||||
return previousApproved;
|
||||
});
|
||||
const isOfficer = ref<boolean>(false);
|
||||
const isStaff = ref<boolean>(false);
|
||||
const profileType = ref<string>("");
|
||||
|
|
@ -169,6 +140,9 @@ const columnsCommanders = ref<QTableProps["columns"]>([
|
|||
align: "left",
|
||||
label: "วันสุดท้ายที่ยับยั้ง",
|
||||
field: "rejectDate",
|
||||
format(val, row) {
|
||||
return date2Thai(val);
|
||||
},
|
||||
sortable: true,
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
@ -206,7 +180,6 @@ const dataDetail = ref<any>({
|
|||
reasonResign: "",
|
||||
});
|
||||
|
||||
const workflowRef = ref<any>(null);
|
||||
const organizationPositionOld = ref<string>("");
|
||||
const positionTypeOld = ref<string>("");
|
||||
const positionLevelOld = ref<string>("");
|
||||
|
|
@ -223,20 +196,6 @@ const actionPass = ref<boolean>(false);
|
|||
const reasonReign = ref<string>("");
|
||||
const dateBreak = ref<Date | null>(null);
|
||||
|
||||
const isCheckData = computed(() => {
|
||||
if (
|
||||
organizationPositionOld.value !== "" &&
|
||||
positionTypeOld.value !== "" &&
|
||||
positionLevelOld.value !== "" &&
|
||||
posNo.value !== "" &&
|
||||
date.value !== null &&
|
||||
dataDetail.value.commanderReject !== null &&
|
||||
dataDetail.value.oligarchReject !== null
|
||||
) {
|
||||
return true;
|
||||
} else return false;
|
||||
});
|
||||
|
||||
/** คอลัมน์ */
|
||||
const rows = ref<TypeFile[]>([]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
|
|
@ -269,13 +228,10 @@ const columns = ref<QTableProps["columns"]>([
|
|||
},
|
||||
]);
|
||||
|
||||
/**เปิด-ปิด modal */
|
||||
/**ฟังก์ชันปิด popup อนุญาตการลาออก,ยับยั้งการลาออก*/
|
||||
function closeModal() {
|
||||
modal.value = false;
|
||||
}
|
||||
function openModal() {
|
||||
modal.value = true;
|
||||
}
|
||||
|
||||
const file = ref<any>(null);
|
||||
const fileList = ref<FileList[]>([]);
|
||||
|
|
@ -291,6 +247,7 @@ const rowsFileDownload = ref<rowFile[]>([
|
|||
},
|
||||
]);
|
||||
|
||||
/** ฟังก์ชันคำนวนวันที่ขอลาออกจากราชการ*/
|
||||
function diffDate() {
|
||||
if (date.value !== null && dateLeave.value !== null) {
|
||||
const time = dateLeave.value.getTime() - date.value.getTime();
|
||||
|
|
@ -304,9 +261,11 @@ function diffDate() {
|
|||
return false;
|
||||
}
|
||||
|
||||
/** นำข้อมูลมาจาก API*/
|
||||
/**
|
||||
* ฟังก์ชันดึงข้อมูลรายละเอียดการลาออก
|
||||
* @param id รายการลาออก
|
||||
*/
|
||||
async function fetchData(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.resingByidEMP(id))
|
||||
.then(async (res) => {
|
||||
|
|
@ -339,7 +298,7 @@ async function fetchData(id: string) {
|
|||
isNoDebt.value = data.isNoDebt;
|
||||
isNoBurden.value = data.isNoBurden;
|
||||
isDiscipline.value = data.isDiscipline;
|
||||
|
||||
approveStep.value = data.approveStep;
|
||||
statusCheck.value = data.status;
|
||||
profileType.value = data.profileType;
|
||||
keycloakUserId.value = data.keycloakUserId;
|
||||
|
|
@ -350,32 +309,40 @@ async function fetchData(id: string) {
|
|||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**Pop up */
|
||||
/**
|
||||
* ฟังก์ชันเปิด popup อนุญาต,ยับยั้ง
|
||||
* @param action อนุญาต, ยับยั้ง
|
||||
* @param type ผู้บังคับบัญชา, ผู้มีอำนาจ
|
||||
*/
|
||||
function popUp(action: "pass" | "passNot", type: string) {
|
||||
reasonReign.value = "";
|
||||
dateBreak.value = null;
|
||||
actionPass.value = action === "pass";
|
||||
roleUser.value = type;
|
||||
openModal();
|
||||
modal.value = true;
|
||||
}
|
||||
|
||||
//เงื่อนไขpop up
|
||||
/** ฟังก์ชันบันทึกผลการพิจารณา*/
|
||||
function onSubmit() {
|
||||
if (actionPass.value) {
|
||||
confirmpopUp();
|
||||
} else {
|
||||
rejectpopUp();
|
||||
if (roleUser.value === "commander" && actionPass.value) {
|
||||
confirmpopUp("/comander");
|
||||
} else if (roleUser.value === "commander" && !actionPass.value) {
|
||||
rejectpopUp("/comander");
|
||||
} else if (roleUser.value === "oligarch" && actionPass.value) {
|
||||
confirmpopUp("");
|
||||
} else if (roleUser.value === "oligarch" && !actionPass.value) {
|
||||
rejectpopUp("");
|
||||
}
|
||||
}
|
||||
|
||||
//pop up ยืนยันการอนุญาต
|
||||
async function confirmpopUp() {
|
||||
/**
|
||||
* ฟังก์ชันยืนยันการอนุญาตผลการพิจารณา
|
||||
* @param path ประเภทของผู้พิจารณา comander === 'บังคับบัญชา', '' === 'ผู้มีอำนาจ'
|
||||
*/
|
||||
async function confirmpopUp(path: string) {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
|
|
@ -384,7 +351,15 @@ async function confirmpopUp() {
|
|||
reason: reasonReign.value,
|
||||
};
|
||||
await http
|
||||
.put(config.API.commanderApproveRetirement("-employee", id.value,'approve'), body)
|
||||
.put(
|
||||
config.API.commanderApproveRetirement(
|
||||
"-employee",
|
||||
id.value,
|
||||
"approve",
|
||||
path
|
||||
),
|
||||
body
|
||||
)
|
||||
.then(async () => {
|
||||
await fetchData(id.value);
|
||||
closeModal();
|
||||
|
|
@ -402,8 +377,11 @@ async function confirmpopUp() {
|
|||
);
|
||||
}
|
||||
|
||||
//pop up การยับยั้งสำเร็จ
|
||||
async function rejectpopUp() {
|
||||
/**
|
||||
ฟังก์ชันยืนยันการยับยั้งผลการพิจารณา
|
||||
* @param path ประเภทของผู้พิจารณา comander === 'บังคับบัญชา', '' === 'ผู้มีอำนาจ'
|
||||
*/
|
||||
async function rejectpopUp(path: string) {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
|
|
@ -413,7 +391,15 @@ async function rejectpopUp() {
|
|||
date: dateBreak.value,
|
||||
};
|
||||
await http
|
||||
.put(config.API.commanderApproveRetirement('-employee', id.value,'reject'), body)
|
||||
.put(
|
||||
config.API.commanderApproveRetirement(
|
||||
"-employee",
|
||||
id.value,
|
||||
"reject",
|
||||
path
|
||||
),
|
||||
body
|
||||
)
|
||||
.then(async () => {
|
||||
await fetchData(id.value);
|
||||
closeModal();
|
||||
|
|
@ -431,9 +417,7 @@ async function rejectpopUp() {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* กดยกเลิก
|
||||
*/
|
||||
/** ฟังก์ชันยกเลิกการแก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย*/
|
||||
async function clickCancel() {
|
||||
edit.value = false;
|
||||
const data = dataDetail.value;
|
||||
|
|
@ -454,17 +438,20 @@ async function clickCancel() {
|
|||
isDiscipline.value = data.isDiscipline;
|
||||
}
|
||||
myForm.value?.resetValidation();
|
||||
// await fetchData(id.value);
|
||||
}
|
||||
/**
|
||||
* กดยกเลิก
|
||||
*/
|
||||
async function clickCancelConditions() {
|
||||
await fetchData(id.value);
|
||||
conditions.value = false;
|
||||
}
|
||||
|
||||
/** Function บันทึก รายการตรวจสอบเงื่อนไขต่างๆ*/
|
||||
/** ฟังก์ขันยกเลิกการแก้ไขเงื่อนไขต่างๆ*/
|
||||
async function clickCancelConditions() {
|
||||
const data = dataDetail.value;
|
||||
if (data) {
|
||||
isNoDebt.value = data.isNoDebt;
|
||||
isNoBurden.value = data.isNoBurden;
|
||||
isDiscipline.value = data.isDiscipline;
|
||||
conditions.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
/** ฟังก์ชันบันทึกรายการตรวจสอบเงื่อนไขต่างๆ*/
|
||||
function onSubmitConditions() {
|
||||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
|
|
@ -488,7 +475,7 @@ function onSubmitConditions() {
|
|||
});
|
||||
}
|
||||
|
||||
/** Function บันทึก ,แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย*/
|
||||
/** ฟังก์ชันบันทึกข้อมูลเพื่อลงบัญชีแนบท้าย*/
|
||||
function onSubmitAttached() {
|
||||
dialogConfirm($q, () => {
|
||||
const formData = new FormData();
|
||||
|
|
@ -522,7 +509,7 @@ function onSubmitAttached() {
|
|||
}
|
||||
|
||||
/**
|
||||
* Function เพิ่ม Class เวลา Edit
|
||||
* ฟังก์ชัน Class เวลา Edit
|
||||
* @param val เมื่อเป็นEdit จะเปลี่ยน Class
|
||||
*/
|
||||
function getClass(val: boolean) {
|
||||
|
|
@ -532,17 +519,11 @@ function getClass(val: boolean) {
|
|||
};
|
||||
}
|
||||
|
||||
/** แปลง StatusOrder */
|
||||
function statusOrder(val: boolean) {
|
||||
switch (val) {
|
||||
case true:
|
||||
return "ยับยั้ง";
|
||||
case false:
|
||||
return "อนุญาต";
|
||||
}
|
||||
}
|
||||
|
||||
// ดาว์นโหลดไฟล์
|
||||
/**
|
||||
* ฟังก์ชันดาว์นโหลดไฟล์
|
||||
* @param type นามสกุลไฟล์
|
||||
* @param fileName ชื่อไฟล์ที่ต้องการโหลด
|
||||
*/
|
||||
async function fileDownload(type: string, fileName: string) {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -559,12 +540,16 @@ async function fileDownload(type: string, fileName: string) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันอัปเดท modal ของ popup ทะเบียนประวัติ
|
||||
* @param modal modal
|
||||
*/
|
||||
function updatemodalPersonal(modal: boolean) {
|
||||
modalPersonal.value = modal;
|
||||
}
|
||||
|
||||
/** ฟังก์ชันดึงข้อมูลไฟล์*/
|
||||
async function fetchFile() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.file("พ้นจากราชการ", "หลักฐานลาออก", id.value))
|
||||
.then(async (res) => {
|
||||
|
|
@ -572,10 +557,10 @@ async function fetchFile() {
|
|||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/** ฟังก์ชันสร้าง Path ที่เก็บไฟล์*/
|
||||
function uploadFiles() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -603,6 +588,10 @@ function uploadFiles() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันอัปโหลดไฟล์
|
||||
* @param uploadUrl ที่อยู่ที่เก็บไฟล์
|
||||
*/
|
||||
async function uploadFileURL(uploadUrl: string) {
|
||||
const Data = new FormData();
|
||||
Data.append("file", file.value);
|
||||
|
|
@ -626,6 +615,10 @@ async function uploadFileURL(uploadUrl: string) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันโหลดไฟล์
|
||||
* @param fileName ชื่อไฟล์ที่ต้องการโหลด
|
||||
*/
|
||||
async function downloadFiles(fileName: string) {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -645,13 +638,13 @@ async function downloadFiles(fileName: string) {
|
|||
}
|
||||
|
||||
/**
|
||||
* ลบไฟล์
|
||||
* @param id id file
|
||||
* ฟังก์ชันลบไฟล์
|
||||
* @param fileName ชื่อไฟล์ที่ต้องการลบ
|
||||
*/
|
||||
function removeFile(fileName: string) {
|
||||
dialogRemove($q, () => {
|
||||
dialogRemove($q, async () => {
|
||||
showLoader();
|
||||
http
|
||||
await http
|
||||
.delete(
|
||||
config.API.fileByFile(
|
||||
"พ้นจากราชการ",
|
||||
|
|
@ -660,20 +653,25 @@ function removeFile(fileName: string) {
|
|||
fileName
|
||||
)
|
||||
)
|
||||
.then(() => {
|
||||
.then(async () => {
|
||||
setTimeout(async () => {
|
||||
await fetchFile();
|
||||
success($q, `ลบไฟล์สำเร็จ`);
|
||||
hideLoader();
|
||||
}, 1000);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันแปลงเหตุผลที่ลาออก
|
||||
* @param val เหตุผลที่ลาออก
|
||||
*/
|
||||
function convertStatus(val: string) {
|
||||
if (/^[A-Za-z]+$/.test(val)) {
|
||||
switch (val) {
|
||||
|
|
@ -691,25 +689,27 @@ function convertStatus(val: string) {
|
|||
} else return val;
|
||||
}
|
||||
|
||||
/** เปิด POP UP */
|
||||
/**
|
||||
* ฟังกฺชันเปิด pop up เพิ่มรายชื่อพิจารณา
|
||||
* @param type COMMANDER === ผู้บังคับบัญชา, APPROVER === ผู้มีอำนาจ
|
||||
*/
|
||||
function onAddPerson(type: string) {
|
||||
modalAdd.value = true;
|
||||
typeAdd.value = type;
|
||||
}
|
||||
|
||||
/** ฟังก์ชันดึงข้อมูลสิทธ์ของผู้ใช่*/
|
||||
async function checkOfficer() {
|
||||
http
|
||||
.get(config.API.checkIsofficer + `SYS_RESIGN_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("SYS_RESIGN_EMP");
|
||||
isOfficer.value = data.isOfficer;
|
||||
isStaff.value = data.isStaff;
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
}
|
||||
}
|
||||
|
||||
/** ฟังก์ชันยืนยันการส่งไปพิจารณา*/
|
||||
function onSend() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
|
|
@ -717,20 +717,23 @@ function onSend() {
|
|||
showLoader();
|
||||
http
|
||||
.get(config.API.sendApproveRetirement("-employee", id.value))
|
||||
.then(async (res) => {
|
||||
.then(async () => {
|
||||
await fetchData(id.value);
|
||||
success($q, "ส่งไปพิจารณา");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {});
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
},
|
||||
"ยืนยันการส่งไปพิจารณา",
|
||||
"ต้องการส่งไปพิจารณาใช่หรือไม่"
|
||||
);
|
||||
}
|
||||
|
||||
/** ฟังก์ชันดึงข้อมูลตำแหน่งจาก Keycloak*/
|
||||
async function fetchKeycloakPosition() {
|
||||
if (keycloakId.value == "") {
|
||||
await http
|
||||
|
|
@ -749,10 +752,10 @@ async function fetchKeycloakPosition() {
|
|||
onMounted(async () => {
|
||||
showLoader();
|
||||
await Promise.all([
|
||||
await fetchData(id.value),
|
||||
await fetchKeycloakPosition(),
|
||||
fetchData(id.value),
|
||||
fetchKeycloakPosition(),
|
||||
fetchFile(),
|
||||
await checkOfficer(),
|
||||
checkOfficer(),
|
||||
]).finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
|
|
@ -784,39 +787,6 @@ onMounted(async () => {
|
|||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-dark">ข้อมูลการลาออก</div>
|
||||
<!-- <q-space />
|
||||
<div
|
||||
class="q-gutter-x-sm"
|
||||
v-if="
|
||||
(roleUser === 'officer' && dataDetail.officerReject === null) ||
|
||||
(roleUser === 'commander' &&
|
||||
dataDetail.commanderReject === null &&
|
||||
dataDetail.officerReject !== null) ||
|
||||
(roleUser === 'oligarch' &&
|
||||
dataDetail.oligarchReject === null &&
|
||||
dataDetail.commanderReject !== null &&
|
||||
dataDetail.officerReject !== null)
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
outline
|
||||
color="primary"
|
||||
dense
|
||||
icon-right="check"
|
||||
class="q-px-sm"
|
||||
label="อนุญาต"
|
||||
@click="popUp('pass')"
|
||||
/>
|
||||
<q-btn
|
||||
outline
|
||||
color="red"
|
||||
dense
|
||||
icon-right="close"
|
||||
class="q-px-sm"
|
||||
label="ยับยั้ง"
|
||||
@click="popUp('passNot')"
|
||||
/>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row col-12 q-pa-md">
|
||||
|
|
@ -998,11 +968,7 @@ onMounted(async () => {
|
|||
<q-space />
|
||||
|
||||
<div
|
||||
v-if="
|
||||
!checkRoutePermisson &&
|
||||
isStaff &&
|
||||
dataDetail.statusMain === 'WAITTING'
|
||||
"
|
||||
v-if="!checkRoutePermisson && isStaff && approveStep === 'st1'"
|
||||
>
|
||||
<div v-if="!conditions">
|
||||
<q-btn
|
||||
|
|
@ -1164,51 +1130,6 @@ onMounted(async () => {
|
|||
</div>
|
||||
</q-card>
|
||||
|
||||
<!-- ผลการพิจารณาของการเจ้าหน้าที่ของหน่วยงาน -->
|
||||
<!-- <q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-dark">
|
||||
ผลการพิจารณาของการเจ้าหน้าที่ของหน่วยงาน
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row col-12 q-pa-md">
|
||||
<div class="col-12 row bg-white q-col-gutter-md">
|
||||
<div class="col-xs-6 row items-start">
|
||||
<div class="col-12 text-top">สถานะ</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{
|
||||
dataDetail.officerReject !== null
|
||||
? statusOrder(dataDetail.officerReject)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 row items-start">
|
||||
<div class="col-12 text-top">วันสุดท้ายที่ยับยั้ง</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{
|
||||
dataDetail.officerRejectDate !== null
|
||||
? date2Thai(dataDetail.officerRejectDate)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 row items-start">
|
||||
<div class="col-12 text-top">ความคิดเห็นและเหตุผล</div>
|
||||
|
||||
<div class="col-12 text-detail">
|
||||
{{
|
||||
dataDetail.officerReject
|
||||
? dataDetail.officerRejectReason
|
||||
: dataDetail.officerApproveReason
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card> -->
|
||||
|
||||
<!-- ผลการพิจารณาของผู้บังคับบัญชา -->
|
||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
|
|
@ -1216,7 +1137,7 @@ onMounted(async () => {
|
|||
ผลการพิจารณาของผู้บังคับบัญชา
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="statusCheck == 'WAITTING' && (isOfficer || isStaff)"
|
||||
v-if="!checkRoutePermisson && isStaff && approveStep === 'st1'"
|
||||
flat
|
||||
round
|
||||
icon="add"
|
||||
|
|
@ -1229,33 +1150,6 @@ onMounted(async () => {
|
|||
</q-btn>
|
||||
|
||||
<q-space />
|
||||
<!-- <div
|
||||
class="q-gutter-x-sm"
|
||||
v-if="
|
||||
isDirector &&
|
||||
dataDetail.commanderReject === null &&
|
||||
dataDetail.statusMain === 'WAITTING'
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
outline
|
||||
color="primary"
|
||||
dense
|
||||
icon-right="check"
|
||||
class="q-px-sm"
|
||||
label="อนุญาต"
|
||||
@click="popUp('pass', 'commander')"
|
||||
/>
|
||||
<q-btn
|
||||
outline
|
||||
color="red"
|
||||
dense
|
||||
icon-right="close"
|
||||
class="q-px-sm"
|
||||
label="ยับยั้ง"
|
||||
@click="popUp('passNot', 'commander')"
|
||||
/>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<div class="col-12"><q-separator /></div>
|
||||
|
|
@ -1286,25 +1180,19 @@ onMounted(async () => {
|
|||
</div>
|
||||
<div v-else-if="col.name == 'comment'">
|
||||
<div
|
||||
class="q-gutter-x-xs"
|
||||
v-if="
|
||||
props.row.approveStatus == 'PENDING' &&
|
||||
props.row.comment == ''
|
||||
props.row.comment == '' &&
|
||||
approveStep === 'st2'
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
:disable="
|
||||
statusCheck == 'NEW' ||
|
||||
!approvePendingCheck ||
|
||||
(props.row.profileId !== keycloakId &&
|
||||
checkPermission($route)?.attrIsUpdate)
|
||||
"
|
||||
:outline="
|
||||
props.row.profileId !== keycloakId ||
|
||||
statusCheck == 'NEW' ||
|
||||
!approvePendingCheck
|
||||
? false
|
||||
: true
|
||||
v-if="
|
||||
props.row.profileId === keycloakId &&
|
||||
approveStep === 'st2'
|
||||
"
|
||||
outline
|
||||
dense
|
||||
color="primary"
|
||||
icon-right="check"
|
||||
|
|
@ -1312,20 +1200,13 @@ onMounted(async () => {
|
|||
label="อนุญาต"
|
||||
@click="popUp('pass', 'commander')"
|
||||
/>
|
||||
|
||||
<q-btn
|
||||
:disable="
|
||||
statusCheck == 'NEW' ||
|
||||
!approvePendingCheck ||
|
||||
(props.row.profileId !== keycloakId &&
|
||||
checkPermission($route)?.attrIsUpdate)
|
||||
"
|
||||
:outline="
|
||||
props.row.profileId !== keycloakId ||
|
||||
statusCheck == 'NEW' ||
|
||||
!approvePendingCheck
|
||||
? false
|
||||
: true
|
||||
v-if="
|
||||
props.row.profileId === keycloakId &&
|
||||
approveStep === 'st2'
|
||||
"
|
||||
outline
|
||||
color="red"
|
||||
dense
|
||||
icon-right="close"
|
||||
|
|
@ -1334,6 +1215,7 @@ onMounted(async () => {
|
|||
@click="popUp('passNot', 'commander')"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
{{ props.row.comment ? props.row.comment : "-" }}
|
||||
</div>
|
||||
|
|
@ -1362,7 +1244,7 @@ onMounted(async () => {
|
|||
ผลการพิจารณาของผู้มีอำนาจ
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="statusCheck == 'WAITTING' && (isOfficer || isStaff)"
|
||||
v-if="!checkRoutePermisson && isStaff && approveStep === 'st1'"
|
||||
flat
|
||||
round
|
||||
icon="add"
|
||||
|
|
@ -1374,17 +1256,15 @@ onMounted(async () => {
|
|||
<q-tooltip>เพิ่มรายชื่อผู้มีอำนาจ</q-tooltip>
|
||||
</q-btn>
|
||||
<q-space />
|
||||
|
||||
<div
|
||||
class="q-gutter-x-sm"
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
dataDetail.oligarchReject === null &&
|
||||
dataDetail.statusMain === 'WAITTING' &&
|
||||
rowsApprover &&
|
||||
rowsApprover.approvers &&
|
||||
rowsApprover.approvers[0]?.profileId == keycloakId &&
|
||||
rowsApprover.approvers[0]?.approveStatus == 'PENDING' &&
|
||||
approveCheck
|
||||
approveStep === 'st3'
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
|
|
@ -1438,8 +1318,10 @@ onMounted(async () => {
|
|||
<div class="col-12 text-top">วันสุดท้ายที่ยับยั้ง</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{
|
||||
dataDetail.oligarchRejectDate !== null
|
||||
? date2Thai(dataDetail.oligarchRejectDate)
|
||||
rowsApprover &&
|
||||
rowsApprover.approvers &&
|
||||
rowsApprover.approvers[0]?.rejectDate
|
||||
? date2Thai(rowsApprover?.approvers[0].rejectDate)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
|
|
@ -1448,19 +1330,23 @@ onMounted(async () => {
|
|||
<div class="col-12 text-top">ความคิดเห็นและเหตุผล</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{
|
||||
dataDetail.oligarchReject
|
||||
? dataDetail.oligarchRejectReason
|
||||
: dataDetail.oligarchApproveReason
|
||||
rowsApprover &&
|
||||
rowsApprover.approvers &&
|
||||
rowsApprover.approvers[0]?.comment
|
||||
? rowsApprover?.approvers[0].comment
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<!-- ส่งไปพิจารณา -->
|
||||
<q-card
|
||||
bordered
|
||||
class="row col-12 text-dark q-mt-sm q-pa-sm"
|
||||
v-if="statusCheck == 'WAITTING' && (isOfficer || isStaff)"
|
||||
v-if="!checkRoutePermisson && isStaff && approveStep === 'st1'"
|
||||
>
|
||||
<q-btn
|
||||
@click="onSend"
|
||||
|
|
@ -1474,6 +1360,7 @@ onMounted(async () => {
|
|||
><q-tooltip>คลิกเพื่อส่งไปพิจารณา</q-tooltip></q-btn
|
||||
>
|
||||
</q-card>
|
||||
|
||||
<!-- แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย -->
|
||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||
<q-form
|
||||
|
|
@ -1492,8 +1379,9 @@ onMounted(async () => {
|
|||
<div
|
||||
v-if="
|
||||
!checkRoutePermisson &&
|
||||
isStaff &&
|
||||
dataDetail.statusMain === 'WAITTING'
|
||||
(dataDetail.statusMain === 'APPROVE' ||
|
||||
dataDetail.statusMain === 'REJECT') &&
|
||||
isStaff
|
||||
"
|
||||
>
|
||||
<div class="q-gutter-sm" v-if="!edit">
|
||||
|
|
@ -1599,24 +1487,7 @@ onMounted(async () => {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="col-xs-6 col-sm-3 row">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
v-model="salary"
|
||||
:outlined="edit"
|
||||
dense
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
hide-bottom-space
|
||||
:label="`${'เงินเดือน'}`"
|
||||
:rules="[(val:number) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
|
||||
lazy-rules
|
||||
:class="getClass(edit)"
|
||||
mask="###,###,###,###"
|
||||
reverse-fill-mask
|
||||
/>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="col-xs-4 row">
|
||||
<div class="col-12">
|
||||
|
|
@ -1718,15 +1589,9 @@ onMounted(async () => {
|
|||
</div>
|
||||
</q-form>
|
||||
</q-card>
|
||||
|
||||
<!-- <WorkFlow
|
||||
ref="workflowRef"
|
||||
v-model:is-check-data="isCheckData"
|
||||
:id="id"
|
||||
sys-name="SYS_RESIGN"
|
||||
/> -->
|
||||
</div>
|
||||
|
||||
<!-- popup อนุญาตการลาออก,ยับยั้งการลาออก -->
|
||||
<q-dialog v-model="modal" persistent>
|
||||
<q-card style="width: 800px">
|
||||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||
|
|
@ -1742,7 +1607,7 @@ onMounted(async () => {
|
|||
dense
|
||||
outlined
|
||||
lazy-rules
|
||||
:rules="[(val:string) => !!val || 'กรุณากรอกความคิดเห็น/เหตุผล']"
|
||||
:rules=" !actionPass ? [(val:string) => !!val || 'กรุณากรอกความคิดเห็น/เหตุผล'] :[]"
|
||||
v-model="reasonReign"
|
||||
:label="`${'กรอกความคิดเห็น/เหตุผล'}`"
|
||||
type="textarea"
|
||||
|
|
@ -1812,7 +1677,7 @@ onMounted(async () => {
|
|||
<DialogAddCommander
|
||||
v-model:modal="modalAdd"
|
||||
:type="typeAdd"
|
||||
:profileType="'officer'"
|
||||
:profileType="'-employee'"
|
||||
:get-data="fetchData"
|
||||
:id-check="idCheck"
|
||||
:keycloak-user-id="keycloakUserId"
|
||||
|
|
|
|||
|
|
@ -1,22 +1,16 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, computed } from "vue";
|
||||
import axios from "axios";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useQuasar, QForm } from "quasar";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import genReport from "@/plugins/genreport";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import { useRetirementDataStore } from "@/modules/06_retirement/store/Main";
|
||||
import { useRoleWorkflowDataStore } from "@/stores/roleWorkflow";
|
||||
|
||||
import type {
|
||||
TypeFile,
|
||||
rowFile,
|
||||
FileList,
|
||||
} from "@/modules/06_retirement/interface/response/Main";
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { DataProfile } from "@/modules/05_placement/interface/index/Main";
|
||||
import type {
|
||||
|
|
@ -25,15 +19,14 @@ import type {
|
|||
} from "@/modules/06_retirement/interface/response/Main";
|
||||
|
||||
import DialogAddCommander from "@/modules/06_retirement/components/DialogAddCommander.vue";
|
||||
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
|
||||
import CardProfile from "@/components/CardProfile.vue";
|
||||
import WorkFlow from "@/components/Workflow/Main.vue";
|
||||
|
||||
/** Use */
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const store = useRetirementDataStore();
|
||||
const { fetchDataCheckIsoffice } = useRoleWorkflowDataStore();
|
||||
const { convertStatusText } = store;
|
||||
const checkRoutePermisson = ref<boolean>(route.name == "resignDetailRejectEMP");
|
||||
const mixin = useCounterMixin();
|
||||
|
|
@ -43,22 +36,14 @@ const {
|
|||
showLoader,
|
||||
hideLoader,
|
||||
success,
|
||||
|
||||
dialogConfirm,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
||||
/** ตัวแปร */
|
||||
const roleUser = ref<string>("");
|
||||
const dataProfile = ref<DataProfile>();
|
||||
const approveStep = ref<string>("");
|
||||
|
||||
const approveCheck = computed(() => {
|
||||
return (
|
||||
rowsApprover.value?.commanders?.every(
|
||||
(commander) => commander.approveStatus === "APPROVE"
|
||||
) ?? false
|
||||
);
|
||||
});
|
||||
const idCheck = computed(() => {
|
||||
if (
|
||||
typeAdd.value == "COMMANDER" &&
|
||||
|
|
@ -79,29 +64,6 @@ const idCheck = computed(() => {
|
|||
}
|
||||
});
|
||||
|
||||
const approvePendingCheck = computed(() => {
|
||||
const commanders = rowsApprover.value?.commanders || [];
|
||||
const index = commanders.findIndex((c) => c.profileId === keycloakId.value);
|
||||
|
||||
if (index === -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const currentCommander = commanders[index];
|
||||
|
||||
if (currentCommander.approveStatus !== "PENDING") {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (index === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const previousApproved = commanders
|
||||
.slice(0, index)
|
||||
.every((c) => c.approveStatus === "APPROVE");
|
||||
return previousApproved;
|
||||
});
|
||||
const isOfficer = ref<boolean>(false);
|
||||
const profileType = ref<string>("");
|
||||
const keycloakUserId = ref<string>("");
|
||||
|
|
@ -159,15 +121,6 @@ const columnsCommanders = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "rejectDate",
|
||||
align: "left",
|
||||
label: "วันสุดท้ายที่ยับยั้ง",
|
||||
field: "rejectDate",
|
||||
sortable: true,
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
|
||||
const id = ref<string>(route.params.id.toString());
|
||||
|
|
@ -197,7 +150,6 @@ const dataDetail = ref<any>({
|
|||
statusMain: "",
|
||||
});
|
||||
|
||||
const workflowRef = ref<any>(null);
|
||||
const organizationPositionOld = ref<string>("");
|
||||
const positionTypeOld = ref<string>("");
|
||||
const positionLevelOld = ref<string>("");
|
||||
|
|
@ -214,32 +166,16 @@ const actionPass = ref<boolean>(false);
|
|||
const reasonReign = ref<string>("");
|
||||
const dateBreak = ref<Date | null>(null);
|
||||
|
||||
const isCheckData = computed(() => {
|
||||
if (
|
||||
organizationPositionOld.value !== "" &&
|
||||
positionTypeOld.value !== "" &&
|
||||
positionLevelOld.value !== "" &&
|
||||
posNo.value !== "" &&
|
||||
date.value !== null &&
|
||||
dataDetail.value.commanderReject !== null &&
|
||||
dataDetail.value.oligarchReject !== null
|
||||
) {
|
||||
return true;
|
||||
} else return false;
|
||||
});
|
||||
|
||||
/**เปิด-ปิด modal */
|
||||
function closeModal() {
|
||||
modal.value = false;
|
||||
}
|
||||
function openModal() {
|
||||
modal.value = true;
|
||||
}
|
||||
|
||||
const isNoDebt = ref<boolean>(false);
|
||||
const isNoBurden = ref<boolean>(false);
|
||||
const isDiscipline = ref<boolean>(false);
|
||||
|
||||
/** ฟังก์ชันคำนวนวันที่ขอลาออกจากราชการ*/
|
||||
function diffDate() {
|
||||
if (date.value !== null && dateLeave.value !== null) {
|
||||
const time = dateLeave.value.getTime() - date.value.getTime();
|
||||
|
|
@ -253,9 +189,11 @@ function diffDate() {
|
|||
return false;
|
||||
}
|
||||
|
||||
/** นำข้อมูลมาจาก API*/
|
||||
/**
|
||||
* ฟังก์ชันดึงข้อมูลรายละเอียดการยกเลิกลาออก
|
||||
* @param id รายการยกเลิกลาออก
|
||||
*/
|
||||
async function fetchData(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.listResignEMP() + `/cancel/${id}`)
|
||||
.then(async (res) => {
|
||||
|
|
@ -272,43 +210,55 @@ async function fetchData(id: string) {
|
|||
dateLeave.value = data.activeDate ? new Date(data.activeDate) : null;
|
||||
reason.value = data.reason ?? "";
|
||||
location.value = data.location ?? "";
|
||||
approveStep.value = data.approveStep ?? "";
|
||||
status.value = data.status ?? "";
|
||||
remarkHorizontal.value = data.remarkHorizontal ?? "-";
|
||||
isNoDebt.value = data.isNoDebt;
|
||||
statusCheck.value = data.status;
|
||||
isNoBurden.value = data.isNoBurden;
|
||||
isDiscipline.value = data.isDiscipline;
|
||||
profileType.value = data.profileType;
|
||||
keycloakUserId.value = data.keycloakUserId;
|
||||
|
||||
rowsApprover.value = {
|
||||
commanders: data.commanders,
|
||||
approvers: data.approvers,
|
||||
};
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**Pop up */
|
||||
/**
|
||||
* ฟังก์ชันเปิด popup อนุญาต,ไม่อนุญาต
|
||||
* @param action อนุญาต, ไม่อนุญาต
|
||||
* @param type ผู้บังคับบัญชา, ผู้มีอำนาจ
|
||||
*/
|
||||
function popUp(action: "pass" | "passNot", type: string) {
|
||||
reasonReign.value = "";
|
||||
dateBreak.value = null;
|
||||
actionPass.value = action === "pass";
|
||||
roleUser.value = type;
|
||||
openModal();
|
||||
modal.value = true;
|
||||
}
|
||||
|
||||
//เงื่อนไขpop up
|
||||
/** ฟังก์ชันยืนยันการอนุญาตผลการพิจารณา*/
|
||||
function onSubmit() {
|
||||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
const body = {
|
||||
reason: reasonReign.value,
|
||||
reject: !actionPass.value,
|
||||
Date: new Date(),
|
||||
};
|
||||
const action = actionPass.value ? "approve" : "reject";
|
||||
|
||||
const endpoint =
|
||||
roleUser.value === "commander"
|
||||
? config.API.comanderCancelResign("-employee", action, id.value)
|
||||
: config.API.approverCancelResign("-employee", action, id.value);
|
||||
await http
|
||||
.put(
|
||||
config.API.resignRejectEMP(`${roleUser.value}-cancel`, id.value),
|
||||
body
|
||||
)
|
||||
.put(endpoint, body)
|
||||
.then(async () => {
|
||||
await fetchData(id.value);
|
||||
closeModal();
|
||||
|
|
@ -323,7 +273,7 @@ function onSubmit() {
|
|||
});
|
||||
}
|
||||
|
||||
/** กดยกเลิก*/
|
||||
/** ฟังก์ชันยกเลิกการแก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย*/
|
||||
async function clickCancel() {
|
||||
edit.value = false;
|
||||
const data = dataDetail.value;
|
||||
|
|
@ -346,7 +296,7 @@ async function clickCancel() {
|
|||
myForm.value?.resetValidation();
|
||||
}
|
||||
|
||||
/** Function บันทึก ,แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย*/
|
||||
/** ฟังก์ชันบันทึกข้อมูลเพื่อลงบัญชีแนบท้าย*/
|
||||
function onSubmitAttached() {
|
||||
dialogConfirm($q, () => {
|
||||
const formData = new FormData();
|
||||
|
|
@ -381,7 +331,7 @@ function onSubmitAttached() {
|
|||
}
|
||||
|
||||
/**
|
||||
* Function เพิ่ม Class เวลา Edit
|
||||
* ฟังก์ชัน Class เวลา Edit
|
||||
* @param val เมื่อเป็นEdit จะเปลี่ยน Class
|
||||
*/
|
||||
function getClass(val: boolean) {
|
||||
|
|
@ -391,71 +341,53 @@ function getClass(val: boolean) {
|
|||
};
|
||||
}
|
||||
|
||||
/** แปลง StatusOrder */
|
||||
function statusOrder(val: boolean) {
|
||||
switch (val) {
|
||||
case true:
|
||||
return "ยับยั้ง";
|
||||
case false:
|
||||
return "อนุญาต";
|
||||
}
|
||||
}
|
||||
|
||||
const isDirector = ref<boolean>(false);
|
||||
const isStaff = ref<boolean>(false);
|
||||
|
||||
function fetchCheckIsofficer() {
|
||||
http
|
||||
.get(config.API.workflowKeycloakSystem("RETIREMENT_CANCEL_EMP"))
|
||||
.then((res) => {
|
||||
isStaff.value = res.data.result.isStaff;
|
||||
isDirector.value = res.data.result.isDirector;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
});
|
||||
}
|
||||
|
||||
/** เปิด POP UP */
|
||||
/**
|
||||
* ฟังกฺชันเปิด pop up เพิ่มรายชื่อพิจารณา
|
||||
* @param type COMMANDER === ผู้บังคับบัญชา, APPROVER === ผู้มีอำนาจ
|
||||
*/
|
||||
function onAddPerson(type: string) {
|
||||
modalAdd.value = true;
|
||||
typeAdd.value = type;
|
||||
}
|
||||
|
||||
/** ฟังก์ชันดึงข้อมูลสิทธ์ของผู้ใช่*/
|
||||
async function checkOfficer() {
|
||||
http
|
||||
.get(config.API.checkIsofficer + `SYS_RESIGN_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("SYS_RESIGN_EMP");
|
||||
isOfficer.value = data.isOfficer;
|
||||
isStaff.value = data.isStaff;
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
}
|
||||
}
|
||||
|
||||
/** ฟังก์ชันยืนยันการส่งไปพิจารณา*/
|
||||
function onSend() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => {
|
||||
async () => {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.sendApproveRetirement("-employee", id.value))
|
||||
.then(async (res) => {
|
||||
await http
|
||||
.get(config.API.officerCancelResign("-employee", id.value))
|
||||
.then(async () => {
|
||||
await fetchData(id.value);
|
||||
success($q, "ส่งไปพิจารณา");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {});
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
},
|
||||
"ยืนยันการส่งไปพิจารณา",
|
||||
"ต้องการส่งไปพิจารณาใช่หรือไม่"
|
||||
);
|
||||
}
|
||||
|
||||
/** ฟังก์ชันดึงข้อมูลตำแหน่งจาก Keycloak*/
|
||||
async function fetchKeycloakPosition() {
|
||||
if (keycloakId.value == "") {
|
||||
await http
|
||||
|
|
@ -472,7 +404,14 @@ async function fetchKeycloakPosition() {
|
|||
|
||||
/** Hook */
|
||||
onMounted(async () => {
|
||||
await Promise.all([await fetchKeycloakPosition(),fetchData(id.value), checkOfficer()]);
|
||||
showLoader();
|
||||
await Promise.all([
|
||||
fetchData(id.value),
|
||||
fetchKeycloakPosition(),
|
||||
checkOfficer(),
|
||||
]).finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
@ -490,7 +429,9 @@ onMounted(async () => {
|
|||
@click="router.push('/retirement/resign-employee')"
|
||||
/>
|
||||
รายละเอียดการยกเลิกลาออก
|
||||
{{ dataDetail.prefix.dataDetail.firstName + " " + dataDetail.lastName }}
|
||||
{{
|
||||
dataDetail.prefix + dataDetail.firstName + " " + dataDetail.lastName
|
||||
}}
|
||||
</div>
|
||||
|
||||
<CardProfile :type="'employee'" :data="dataProfile as DataProfile" />
|
||||
|
|
@ -499,39 +440,6 @@ onMounted(async () => {
|
|||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-dark">ข้อมูลการลาออก</div>
|
||||
<!-- <q-space />
|
||||
<div
|
||||
class="q-gutter-x-sm"
|
||||
v-if="
|
||||
(roleUser === 'officer' && dataDetail.officerReject === null) ||
|
||||
(roleUser === 'commander' &&
|
||||
dataDetail.commanderReject === null &&
|
||||
dataDetail.officerReject !== null) ||
|
||||
(roleUser === 'oligarch' &&
|
||||
dataDetail.oligarchReject === null &&
|
||||
dataDetail.commanderReject !== null &&
|
||||
dataDetail.officerReject !== null)
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
outline
|
||||
color="primary"
|
||||
dense
|
||||
icon-right="check"
|
||||
class="q-px-sm"
|
||||
label="อนุญาต"
|
||||
@click="popUp('pass')"
|
||||
/>
|
||||
<q-btn
|
||||
outline
|
||||
color="red"
|
||||
dense
|
||||
icon-right="close"
|
||||
class="q-px-sm"
|
||||
label="ยับยั้ง"
|
||||
@click="popUp('passNot')"
|
||||
/>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row col-12 q-pa-md">
|
||||
|
|
@ -579,6 +487,15 @@ onMounted(async () => {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 row items-start">
|
||||
<div class="col-12">
|
||||
<div class="col-12 text-top">เหตุผลการขอยกเลิก</div>
|
||||
<div class="col-12 text-detail text-red">
|
||||
{{ dataDetail.cancelReason }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
|
@ -590,7 +507,7 @@ onMounted(async () => {
|
|||
ผลการพิจารณาของผู้บังคับบัญชา
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="statusCheck == 'WAITTING' && (isOfficer || isStaff)"
|
||||
v-if="!checkRoutePermisson && isStaff && approveStep === 'st1'"
|
||||
flat
|
||||
round
|
||||
icon="add"
|
||||
|
|
@ -602,33 +519,6 @@ onMounted(async () => {
|
|||
<q-tooltip>เพิ่มรายชื่อผู้บังคับบัญชา</q-tooltip>
|
||||
</q-btn>
|
||||
<q-space />
|
||||
<!-- <div
|
||||
class="q-gutter-x-sm"
|
||||
v-if="
|
||||
isDirector &&
|
||||
dataDetail.commanderReject === null &&
|
||||
dataDetail.statusMain === 'WAITTING'
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
outline
|
||||
color="primary"
|
||||
dense
|
||||
icon-right="check"
|
||||
class="q-px-sm"
|
||||
label="อนุญาต"
|
||||
@click="popUp('pass', 'commander')"
|
||||
/>
|
||||
<q-btn
|
||||
outline
|
||||
color="red"
|
||||
dense
|
||||
icon-right="close"
|
||||
class="q-px-sm"
|
||||
label="ยับยั้ง"
|
||||
@click="popUp('passNot', 'commander')"
|
||||
/>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<div class="col-12"><q-separator /></div>
|
||||
|
|
@ -659,25 +549,19 @@ onMounted(async () => {
|
|||
</div>
|
||||
<div v-else-if="col.name == 'comment'">
|
||||
<div
|
||||
class="q-gutter-x-xs"
|
||||
v-if="
|
||||
props.row.approveStatus == 'PENDING' &&
|
||||
props.row.comment == ''
|
||||
props.row.comment == '' &&
|
||||
approveStep === 'st2'
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
:disable="
|
||||
statusCheck == 'NEW' ||
|
||||
!approvePendingCheck ||
|
||||
(props.row.profileId !== keycloakId &&
|
||||
checkPermission($route)?.attrIsUpdate)
|
||||
"
|
||||
:outline="
|
||||
props.row.profileId !== keycloakId ||
|
||||
statusCheck == 'NEW' ||
|
||||
!approvePendingCheck
|
||||
? false
|
||||
: true
|
||||
v-if="
|
||||
props.row.profileId === keycloakId &&
|
||||
approveStep === 'st2'
|
||||
"
|
||||
outline
|
||||
dense
|
||||
color="primary"
|
||||
icon-right="check"
|
||||
|
|
@ -686,24 +570,16 @@ onMounted(async () => {
|
|||
@click="popUp('pass', 'commander')"
|
||||
/>
|
||||
<q-btn
|
||||
:disable="
|
||||
statusCheck == 'NEW' ||
|
||||
!approvePendingCheck ||
|
||||
(props.row.profileId !== keycloakId &&
|
||||
checkPermission($route)?.attrIsUpdate)
|
||||
"
|
||||
:outline="
|
||||
props.row.profileId !== keycloakId ||
|
||||
statusCheck == 'NEW' ||
|
||||
!approvePendingCheck
|
||||
? false
|
||||
: true
|
||||
v-if="
|
||||
props.row.profileId === keycloakId &&
|
||||
approveStep === 'st2'
|
||||
"
|
||||
outline
|
||||
color="red"
|
||||
dense
|
||||
icon-right="close"
|
||||
class="q-px-sm"
|
||||
label="ยับยั้ง"
|
||||
label="ไม่อนุญาต"
|
||||
@click="popUp('passNot', 'commander')"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -714,7 +590,7 @@ onMounted(async () => {
|
|||
<div v-else-if="col.name == 'approveStatus'">
|
||||
{{
|
||||
props.row.approveStatus
|
||||
? convertStatusText(props.row.approveStatus)
|
||||
? convertStatusText(props.row.approveStatus, "ไม่อนุญาต")
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
|
|
@ -735,7 +611,8 @@ onMounted(async () => {
|
|||
ผลการพิจารณาของผู้มีอำนาจ
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="statusCheck == 'WAITTING' && (isOfficer || isStaff)"
|
||||
q-btn
|
||||
v-if="!checkRoutePermisson && isStaff && approveStep === 'st1'"
|
||||
flat
|
||||
round
|
||||
icon="add"
|
||||
|
|
@ -751,14 +628,11 @@ onMounted(async () => {
|
|||
<div
|
||||
class="q-gutter-x-sm"
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
dataDetail.oligarchReject === null &&
|
||||
dataDetail.statusMain === 'WAITTING' &&
|
||||
rowsApprover &&
|
||||
rowsApprover.approvers &&
|
||||
rowsApprover.approvers[0]?.profileId == keycloakId &&
|
||||
rowsApprover.approvers[0]?.approveStatus == 'PENDING' &&
|
||||
approveCheck
|
||||
approveStep === 'st3'
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
|
|
@ -776,7 +650,7 @@ onMounted(async () => {
|
|||
dense
|
||||
icon-right="close"
|
||||
class="q-px-sm"
|
||||
label="ยับยั้ง"
|
||||
label="ไม่อนุญาต"
|
||||
@click="popUp('passNot', 'oligarch')"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -803,38 +677,36 @@ onMounted(async () => {
|
|||
rowsApprover &&
|
||||
rowsApprover.approvers &&
|
||||
rowsApprover.approvers[0]?.approveStatus
|
||||
? convertStatusText(rowsApprover?.approvers[0].approveStatus)
|
||||
? convertStatusText(
|
||||
rowsApprover?.approvers[0].approveStatus,
|
||||
"ไม่อนุญาต"
|
||||
)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="col-xs-6 row items-start">
|
||||
<div class="col-12 text-top">วันสุดท้ายที่ยับยั้ง</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{
|
||||
dataDetail.oligarchRejectDate !== null
|
||||
? date2Thai(dataDetail.oligarchRejectDate)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="col-xs-12 row items-start">
|
||||
<div class="col-12 text-top">ความคิดเห็นและเหตุผล</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{
|
||||
dataDetail.oligarchReject
|
||||
? dataDetail.oligarchApproveReason
|
||||
: dataDetail.oligarchApproveReason
|
||||
rowsApprover &&
|
||||
rowsApprover.approvers &&
|
||||
rowsApprover.approvers[0]?.comment
|
||||
? rowsApprover?.approvers[0].comment
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<!-- ส่งไปพิจารณา -->
|
||||
<q-card
|
||||
bordered
|
||||
class="row col-12 text-dark q-mt-sm q-pa-sm"
|
||||
v-if="statusCheck == 'WAITTING' && (isOfficer || isStaff)"
|
||||
v-if="!checkRoutePermisson && isStaff && approveStep === 'st1'"
|
||||
>
|
||||
<q-btn
|
||||
@click="onSend"
|
||||
|
|
@ -848,6 +720,7 @@ onMounted(async () => {
|
|||
><q-tooltip>คลิกเพื่อส่งไปพิจารณา</q-tooltip></q-btn
|
||||
>
|
||||
</q-card>
|
||||
|
||||
<!-- แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย -->
|
||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||
<q-form
|
||||
|
|
@ -863,11 +736,13 @@ onMounted(async () => {
|
|||
</div>
|
||||
<q-space />
|
||||
<!-- && workflowRef?.permission.isUpdate -->
|
||||
|
||||
<div
|
||||
v-if="
|
||||
!checkRoutePermisson &&
|
||||
isStaff &&
|
||||
dataDetail.statusMain === 'WAITTING'
|
||||
(dataDetail.status === 'APPROVE' ||
|
||||
dataDetail.status === 'REJECT') &&
|
||||
isStaff
|
||||
"
|
||||
>
|
||||
<div class="q-gutter-sm" v-if="!edit">
|
||||
|
|
@ -1093,20 +968,15 @@ onMounted(async () => {
|
|||
</div>
|
||||
</q-form>
|
||||
</q-card>
|
||||
<!-- <WorkFlow
|
||||
ref="workflowRef"
|
||||
v-model:is-check-data="isCheckData"
|
||||
:id="id"
|
||||
sys-name="RETIREMENT_CANCEL"
|
||||
/> -->
|
||||
</div>
|
||||
|
||||
<!-- pooup อนุญาตยกเลิกการลาออก -->
|
||||
<q-dialog v-model="modal" persistent>
|
||||
<q-card style="width: 800px">
|
||||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||
<DialogHeader
|
||||
:tittle="`${
|
||||
actionPass ? 'อนุญาตยกเลิกการลาออก' : 'ยับยั้งยกเลิกการลาออก'
|
||||
actionPass ? 'อนุญาตยกเลิกการลาออก' : 'ไม่อนุญาตยกเลิกการลาออก'
|
||||
}`"
|
||||
:close="closeModal"
|
||||
/>
|
||||
|
|
@ -1118,7 +988,7 @@ onMounted(async () => {
|
|||
dense
|
||||
outlined
|
||||
lazy-rules
|
||||
:rules="[(val:string) => !!val || 'กรุณากรอกความคิดเห็น/เหตุผล']"
|
||||
:rules=" !actionPass ? [(val:string) => !!val || 'กรุณากรอกความคิดเห็น/เหตุผล'] :[]"
|
||||
v-model="reasonReign"
|
||||
:label="`${'กรอกความคิดเห็น/เหตุผล'}`"
|
||||
type="textarea"
|
||||
|
|
@ -1140,7 +1010,7 @@ onMounted(async () => {
|
|||
<DialogAddCommander
|
||||
v-model:modal="modalAdd"
|
||||
:type="typeAdd"
|
||||
:profileType="'officer'"
|
||||
:profileType="'-employee'"
|
||||
:get-data="fetchData"
|
||||
:id-check="idCheck"
|
||||
:keycloak-user-id="keycloakUserId"
|
||||
|
|
|
|||
|
|
@ -6,7 +6,11 @@ import { useRouter } from "vue-router";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useDataStore } from "@/modules/06_retirement/store/resignMain";
|
||||
import { useRetirementDataStore } from "@/modules/06_retirement/store/Main";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import {
|
||||
checkPermission,
|
||||
checkPermissionList,
|
||||
checkPermissionCreate,
|
||||
} from "@/utils/permissions";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
|
|
@ -23,13 +27,8 @@ const stroeResign = useDataStore();
|
|||
const { statusText } = stroe;
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
messageError,
|
||||
date2Thai,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
onSearchDataTable
|
||||
} = mixin;
|
||||
const { messageError, date2Thai, showLoader, hideLoader, onSearchDataTable } =
|
||||
mixin;
|
||||
|
||||
/** Table */
|
||||
const rows = ref<ResponseItems[]>([]);
|
||||
|
|
@ -130,7 +129,9 @@ const columns = ref<QTableProps["columns"]>([
|
|||
sortable: true,
|
||||
field: "status",
|
||||
format(val, row) {
|
||||
return statusText(row.status);
|
||||
return stroeResign.mainTabs === "1"
|
||||
? statusText(row.status)
|
||||
: statusText(row.status, "อนุญาต");
|
||||
},
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
@ -291,7 +292,11 @@ onMounted(async () => {
|
|||
</q-select>
|
||||
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
checkPermissionList(['COMMAND']) &&
|
||||
checkPermissionCreate('COMMAND')
|
||||
"
|
||||
@click="openModalOrder"
|
||||
flat
|
||||
round
|
||||
|
|
@ -310,7 +315,7 @@ onMounted(async () => {
|
|||
ref="filterRef"
|
||||
outlined
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@ onMounted(async () => {
|
|||
outlined
|
||||
placeholder="ค้นหา"
|
||||
class="q-ml-sm"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ watchEffect(() => {
|
|||
dense
|
||||
v-model="filterKeyword"
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ watchEffect(() => {
|
|||
dense
|
||||
v-model="filterKeyword"
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ const {
|
|||
} = mixin;
|
||||
|
||||
const pageId = ref<string>(route.params.id as string);
|
||||
const routeName = ref<string>(route?.name as string);
|
||||
|
||||
const keyword = ref<string>("");
|
||||
const isAct = ref<boolean>(false);
|
||||
|
||||
|
|
@ -114,6 +116,7 @@ async function getData() {
|
|||
keyword: keyword.value,
|
||||
isAct: isAct.value,
|
||||
keycloakId: props.keycloakUserId,
|
||||
type: props.profileType === "officer" ? props.profileType : "employee",
|
||||
})
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
|
|
@ -134,7 +137,7 @@ async function getData() {
|
|||
|
||||
function onSubmit() {
|
||||
if (selected.value.length !== 0) {
|
||||
dialogConfirm($q, () => {
|
||||
dialogConfirm($q, async () => {
|
||||
if (props.keycloakUserId) {
|
||||
const body = selected.value.map((items: any, index: any) => ({
|
||||
seq: index,
|
||||
|
|
@ -146,26 +149,36 @@ function onSubmit() {
|
|||
keycloakId: items.keycloakId,
|
||||
}));
|
||||
showLoader();
|
||||
http
|
||||
.post(
|
||||
config.API.addResign(
|
||||
(props.profileType?.toLocaleLowerCase() as string) == "officer"
|
||||
? ""
|
||||
: "-employee",
|
||||
props.type?.toLocaleLowerCase() as string,
|
||||
pageId.value
|
||||
),
|
||||
body
|
||||
)
|
||||
.then((res) => {
|
||||
const profileSuffix =
|
||||
(props.profileType?.toLocaleLowerCase() as string) === "officer"
|
||||
? ""
|
||||
: "-employee";
|
||||
|
||||
const apiEndpoint =
|
||||
routeName.value === "resignReject" || routeName.value === "resignRejectEMP"
|
||||
? config.API.addResignCancel(
|
||||
profileSuffix,
|
||||
props.type?.toLocaleLowerCase() as string,
|
||||
pageId.value
|
||||
)
|
||||
: config.API.addResign(
|
||||
profileSuffix,
|
||||
props.type?.toLocaleLowerCase() as string,
|
||||
pageId.value
|
||||
);
|
||||
await http
|
||||
.post(apiEndpoint, body)
|
||||
.then(async () => {
|
||||
await props.getData?.(pageId.value);
|
||||
closeDialog();
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
props.getData?.(pageId.value);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {});
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
} else {
|
||||
closeDialog();
|
||||
}
|
||||
|
|
@ -179,6 +192,7 @@ function closeDialog() {
|
|||
modal.value = false;
|
||||
rows.value = [];
|
||||
selected.value = [];
|
||||
keyword.value = "";
|
||||
}
|
||||
|
||||
watch(
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
import { defineStore } from "pinia";
|
||||
|
||||
export const useRetirementDataStore = defineStore("retirement", () => {
|
||||
const statusText = (val: string) => {
|
||||
const statusText = (val: string, rejectText: string = "อนุมัติ") => {
|
||||
switch (val) {
|
||||
case "WAITTING":
|
||||
return "ใหม่";
|
||||
case "PENDING":
|
||||
return "รอดำเนินการ";
|
||||
case "APPROVE":
|
||||
return "อนุมัติ";
|
||||
return rejectText;
|
||||
case "REJECT":
|
||||
return "ไม่อนุมัติ";
|
||||
return `ไม่${rejectText}`;
|
||||
case "REPORT":
|
||||
return "ส่งรายชื่อไปออกคำสั่ง";
|
||||
case "WAITING":
|
||||
|
|
@ -18,29 +18,31 @@ export const useRetirementDataStore = defineStore("retirement", () => {
|
|||
case "DONE":
|
||||
return "ออกคำสั่งเสร็จสิ้น";
|
||||
case "DONECANCEL":
|
||||
return "ยกเลิกการลาออก";
|
||||
return "ยกเลิกการลาออกสำเร็จ";
|
||||
case "CANCEL":
|
||||
return "ยกเลิกการลาออก";
|
||||
return "ยกเลิกการลาออกสำเร็จ";
|
||||
case "DONEREJECT":
|
||||
return "ออกคำสั่งยกเลิกลาออกเสร็จแล้ว";
|
||||
case "CANCELING":
|
||||
return "กำลังดำเนินการยกเลิก";
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
};
|
||||
|
||||
function convertStatusText(val: string) {
|
||||
function convertStatusText(val: string, rejectText: string = "ไม่อนุมัติ") {
|
||||
switch (val) {
|
||||
case "PENDING":
|
||||
return "รอดำเนินการ";
|
||||
case "APPROVE":
|
||||
return "อนุญาต";
|
||||
case "REJECT":
|
||||
return "ยับยั้ง";
|
||||
return rejectText;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
statusText,
|
||||
convertStatusText
|
||||
convertStatusText,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ export const useDataStore = defineStore("resign", () => {
|
|||
group: "1",
|
||||
},
|
||||
{
|
||||
name: "อนุมัติแล้ว",
|
||||
name: "อนุมัติ/ยับยั้ง",
|
||||
value: "APPROVE",
|
||||
group: "1",
|
||||
},
|
||||
|
|
@ -37,9 +37,13 @@ export const useDataStore = defineStore("resign", () => {
|
|||
value: "DONE",
|
||||
group: "1",
|
||||
},
|
||||
|
||||
{
|
||||
name: "ยกเลิกลาออก",
|
||||
name: "กำลังดำเนินการยกเลิก",
|
||||
value: "CANCELING",
|
||||
group: "1",
|
||||
},
|
||||
{
|
||||
name: "ยกเลิกลาออกสำเร็จ",
|
||||
value: "CANCEL",
|
||||
group: "1",
|
||||
},
|
||||
|
|
@ -54,7 +58,7 @@ export const useDataStore = defineStore("resign", () => {
|
|||
group: "2",
|
||||
},
|
||||
{
|
||||
name: "อนุมัติแล้ว",
|
||||
name: "อนุญาต/ไม่อนุญาต",
|
||||
value: "APPROVE",
|
||||
group: "2",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -321,7 +321,7 @@ onMounted(async () => {
|
|||
ref="filterRef"
|
||||
outlined
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -328,7 +328,7 @@ onMounted(async () => {
|
|||
ref="filterRef"
|
||||
outlined
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ onMounted(() => {
|
|||
ref="filterRef"
|
||||
outlined
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -7,7 +7,11 @@ import { useRouter } from "vue-router";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import {
|
||||
checkPermission,
|
||||
checkPermissionList,
|
||||
checkPermissionCreate,
|
||||
} from "@/utils/permissions";
|
||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||
|
||||
import type { DataOption } from "@/modules/06_retirement/interface/index/Main";
|
||||
|
|
@ -259,7 +263,11 @@ onMounted(async () => {
|
|||
</q-select>
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
checkPermissionList(['COMMAND']) &&
|
||||
checkPermissionCreate('COMMAND')
|
||||
"
|
||||
@click="openModalOrder"
|
||||
size="14px"
|
||||
flat
|
||||
|
|
@ -278,7 +286,7 @@ onMounted(async () => {
|
|||
v-model="filterKeyword"
|
||||
outlined
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -7,7 +7,11 @@ import { useRouter } from "vue-router";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import {
|
||||
checkPermission,
|
||||
checkPermissionList,
|
||||
checkPermissionCreate,
|
||||
} from "@/utils/permissions";
|
||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||
|
||||
import type { DataOption } from "@/modules/06_retirement/interface/index/Main";
|
||||
|
|
@ -261,7 +265,11 @@ onMounted(async () => {
|
|||
</q-select>
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
checkPermissionList(['COMMAND']) &&
|
||||
checkPermissionCreate('COMMAND')
|
||||
"
|
||||
@click="openModalOrder"
|
||||
size="14px"
|
||||
flat
|
||||
|
|
@ -281,7 +289,7 @@ onMounted(async () => {
|
|||
v-model="filterKeyword"
|
||||
outlined
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -527,7 +527,7 @@ watch(
|
|||
lazy-rules
|
||||
label="คำค้น"
|
||||
hide-bottom-space
|
||||
@keydown.enter="fetchDataPos()"
|
||||
@keydown.enter.prevent="fetchDataPos()"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ onMounted(() => {
|
|||
v-model="keyword"
|
||||
label="ค้นหา"
|
||||
class="q-mr-sm"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ onMounted(async () => {
|
|||
v-model="keyword"
|
||||
label="ค้นหา"
|
||||
class="q-mr-sm"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -144,15 +144,15 @@ const columns = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "employeeType",
|
||||
align: "left",
|
||||
label: "ประเภทตำแหน่ง",
|
||||
sortable: true,
|
||||
field: "employeeType",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
// {
|
||||
// name: "employeeType",
|
||||
// align: "left",
|
||||
// label: "ประเภทตำแหน่ง",
|
||||
// sortable: true,
|
||||
// field: "employeeType",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// },
|
||||
{
|
||||
name: "position",
|
||||
align: "left",
|
||||
|
|
@ -375,7 +375,7 @@ async function fecthlistperson() {
|
|||
http
|
||||
.get(
|
||||
config.API.registryNewOtherSystem(
|
||||
employeeType.value == "officer" ? `` : `-employee`
|
||||
DataStore.employeeClass == "officer" ? `` : `-employee`
|
||||
),
|
||||
{
|
||||
params: { ...formFilter, nodeId: organization.value },
|
||||
|
|
@ -501,8 +501,7 @@ async function downloadFileexcel() {
|
|||
.put(
|
||||
config.API.insigniaDowanload(DataStore.requestId),
|
||||
{
|
||||
profileType:
|
||||
DataStore.employeeClass == "all" ? null : DataStore.employeeClass,
|
||||
profileType: DataStore.employeeClass,
|
||||
InsigniaId:
|
||||
DataStore.typeinsignia == "all"
|
||||
? null
|
||||
|
|
@ -782,32 +781,32 @@ function clickCloseReson() {
|
|||
dialogNote.value = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* function แสดงแจ้งเตือน
|
||||
* @param markDiscipline มีโทษทางวินัย
|
||||
* @param markLeave ไม่ได้เลื่อนเงินเดือน/ไม่ได้เลื่อนขั้น เนื่องจากลาเกิน
|
||||
* @param markRate ผลการประเมินการปฏิบัติราชการในรอบ 5 ปี ต่ำกว่าระดับดี (น้อยกว่าร้อยละ 70)
|
||||
*/
|
||||
function clickShowWarn(
|
||||
markDiscipline: boolean,
|
||||
markLeave: boolean,
|
||||
markRate: boolean
|
||||
) {
|
||||
checkboxData.value = [
|
||||
{ id: 1, name: "มีโทษทางวินัย", val: markDiscipline },
|
||||
{
|
||||
id: 2,
|
||||
name: "ไม่ได้เลื่อนเงินเดือน/ไม่ได้เลื่อนขั้น เนื่องจากลาเกิน",
|
||||
val: markLeave,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "ผลการประเมินการปฏิบัติราชการในรอบ 5 ปี ต่ำกว่าระดับดี (น้อยกว่าร้อยละ 70)",
|
||||
val: markRate,
|
||||
},
|
||||
];
|
||||
dialogWarn.value = true;
|
||||
}
|
||||
// /**
|
||||
// * function แสดงแจ้งเตือน
|
||||
// * @param markDiscipline มีโทษทางวินัย
|
||||
// * @param markLeave ไม่ได้เลื่อนเงินเดือน/ไม่ได้เลื่อนขั้น เนื่องจากลาเกิน
|
||||
// * @param markRate ผลการประเมินการปฏิบัติราชการในรอบ 5 ปี ต่ำกว่าระดับดี (น้อยกว่าร้อยละ 70)
|
||||
// */
|
||||
// function clickShowWarn(
|
||||
// markDiscipline: boolean,
|
||||
// markLeave: boolean,
|
||||
// markRate: boolean
|
||||
// ) {
|
||||
// checkboxData.value = [
|
||||
// { id: 1, name: "มีโทษทางวินัย", val: markDiscipline },
|
||||
// {
|
||||
// id: 2,
|
||||
// name: "ไม่ได้เลื่อนเงินเดือน/ไม่ได้เลื่อนขั้น เนื่องจากลาเกิน",
|
||||
// val: markLeave,
|
||||
// },
|
||||
// {
|
||||
// id: 3,
|
||||
// name: "ผลการประเมินการปฏิบัติราชการในรอบ 5 ปี ต่ำกว่าระดับดี (น้อยกว่าร้อยละ 70)",
|
||||
// val: markRate,
|
||||
// },
|
||||
// ];
|
||||
// dialogWarn.value = true;
|
||||
// }
|
||||
|
||||
/**
|
||||
* function ค้นหาข้อมูล option
|
||||
|
|
@ -842,10 +841,11 @@ function clearInsigniaFilters(name: string) {
|
|||
if (name === "typeinsigniaOptions") {
|
||||
DataStore.typeinsignia = "all";
|
||||
typeinsigniaOptions.value = DataStore.typeinsigniaOptions;
|
||||
} else if (name === "employeeClassOps") {
|
||||
DataStore.employeeClass = "all";
|
||||
employeeClassOps.value = DataStore.employeeClassOps;
|
||||
}
|
||||
// else if (name === "employeeClassOps") {
|
||||
// DataStore.employeeClass = "all";
|
||||
// employeeClassOps.value = DataStore.employeeClassOps;
|
||||
// }
|
||||
}
|
||||
|
||||
watch(
|
||||
|
|
@ -954,7 +954,7 @@ onMounted(async () => {
|
|||
ref="filterRef"
|
||||
outlined
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
@ -1026,7 +1026,7 @@ onMounted(async () => {
|
|||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
<q-select
|
||||
<!-- <q-select
|
||||
v-model="DataStore.employeeClass"
|
||||
dense
|
||||
outlined
|
||||
|
|
@ -1072,15 +1072,12 @@ onMounted(async () => {
|
|||
<q-item-section class="text-grey"> ไม่มีข้อมูล </q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</q-select> -->
|
||||
<q-space />
|
||||
<div>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
:disable="
|
||||
DataStore.employeeClass === 'all' ||
|
||||
DataStore.typeinsignia === 'all'
|
||||
"
|
||||
:disable="DataStore.typeinsignia === 'all'"
|
||||
icon="mdi-download"
|
||||
flat
|
||||
round
|
||||
|
|
@ -1089,6 +1086,7 @@ onMounted(async () => {
|
|||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
|
|
@ -1096,10 +1094,10 @@ onMounted(async () => {
|
|||
icon="mdi-plus"
|
||||
@click="clickmodalAdd"
|
||||
v-if="
|
||||
(DataStore.isLock == false &&
|
||||
DataStore.requestStatus == 'st5' &&
|
||||
DataStore.isOfficer) ||
|
||||
(checkStatus == true && checkPermission($route)?.attrIsCreate)
|
||||
DataStore.isLock == false &&
|
||||
checkPermission($route)?.attrIsCreate &&
|
||||
((DataStore.requestStatus == 'st5' && DataStore.isOfficer) ||
|
||||
checkStatus == true)
|
||||
"
|
||||
>
|
||||
<q-tooltip>เพิ่ม</q-tooltip>
|
||||
|
|
@ -1330,11 +1328,14 @@ onMounted(async () => {
|
|||
</q-td> -->
|
||||
<q-td key="discipline" class="text-center">
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsGet &&
|
||||
props.row.markDiscipline
|
||||
"
|
||||
flat
|
||||
dense
|
||||
icon="info"
|
||||
color="info"
|
||||
color="red"
|
||||
@click.pervent="
|
||||
onClickViewInfo(
|
||||
'discipline',
|
||||
|
|
@ -1344,14 +1345,17 @@ onMounted(async () => {
|
|||
"
|
||||
>
|
||||
</q-btn>
|
||||
<div v-else>-</div>
|
||||
</q-td>
|
||||
<q-td key="leave" class="text-center">
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsGet && props.row.markLeave
|
||||
"
|
||||
flat
|
||||
dense
|
||||
icon="info"
|
||||
color="info"
|
||||
color="red"
|
||||
@click.pervent="
|
||||
onClickViewInfo(
|
||||
'leave',
|
||||
|
|
@ -1361,11 +1365,14 @@ onMounted(async () => {
|
|||
"
|
||||
>
|
||||
</q-btn>
|
||||
<div v-else>-</div>
|
||||
</q-td>
|
||||
<q-td key="assessments" class="text-center">
|
||||
<!-- ผลการประเมินการปฏิบัติราชการในรอบ 5 ปี ต่ำกว่าระดับดี (น้อยกว่าร้อยละ 70) -->
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsGet && props.row.markRate
|
||||
"
|
||||
flat
|
||||
dense
|
||||
icon="info"
|
||||
|
|
@ -1379,10 +1386,13 @@ onMounted(async () => {
|
|||
"
|
||||
>
|
||||
</q-btn>
|
||||
<div v-else>-</div>
|
||||
</q-td>
|
||||
<q-td key="insignia" class="text-center">
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsGet && props.row.markInsignia
|
||||
"
|
||||
flat
|
||||
dense
|
||||
icon="info"
|
||||
|
|
@ -1396,6 +1406,7 @@ onMounted(async () => {
|
|||
"
|
||||
>
|
||||
</q-btn>
|
||||
<div v-else>-</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
|
|
@ -1415,7 +1426,7 @@ onMounted(async () => {
|
|||
<div class="col-xs-12 col-sm-7">
|
||||
<q-card flat bordered class="fit q-pa-sm">
|
||||
<div class="row q-col-gutter-sm q-mb-sm">
|
||||
<div class="col-3">
|
||||
<!-- <div class="col-3">
|
||||
<q-select
|
||||
outlined
|
||||
dense
|
||||
|
|
@ -1429,7 +1440,7 @@ onMounted(async () => {
|
|||
@update:model-value="clearForm(), fecthlistperson()"
|
||||
>
|
||||
</q-select>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="col-3">
|
||||
<q-select
|
||||
dense
|
||||
|
|
@ -1451,7 +1462,9 @@ onMounted(async () => {
|
|||
dense
|
||||
placeholder="ค้นหา"
|
||||
v-model="formFilter.searchKeyword"
|
||||
@keydown.enter="(formFilter.page = 1), fecthlistperson()"
|
||||
@keydown.enter.prevent="
|
||||
(formFilter.page = 1), fecthlistperson()
|
||||
"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -67,15 +67,15 @@ const columns = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "employeeType",
|
||||
align: "left",
|
||||
label: "ประเภทตำแหน่ง",
|
||||
sortable: true,
|
||||
field: "employeeType",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
// {
|
||||
// name: "employeeType",
|
||||
// align: "left",
|
||||
// label: "ประเภทตำแหน่ง",
|
||||
// sortable: true,
|
||||
// field: "employeeType",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// },
|
||||
{
|
||||
name: "position",
|
||||
align: "left",
|
||||
|
|
@ -253,7 +253,7 @@ function clearInsigniaFilters(name: string) {
|
|||
DataStore.typeinsignia = "all";
|
||||
typeinsigniaOptions.value = DataStore.typeinsigniaOptions;
|
||||
} else if (name === "employeeClassOps") {
|
||||
DataStore.employeeClass = "all";
|
||||
// DataStore.employeeClass = "all";
|
||||
employeeClassOps.value = DataStore.employeeClassOps;
|
||||
}
|
||||
}
|
||||
|
|
@ -334,7 +334,7 @@ watch(
|
|||
ref="filterRef"
|
||||
outlined
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
@ -405,7 +405,7 @@ watch(
|
|||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
<q-select
|
||||
<!-- <q-select
|
||||
v-model="DataStore.employeeClass"
|
||||
dense
|
||||
outlined
|
||||
|
|
@ -451,7 +451,7 @@ watch(
|
|||
<q-item-section class="text-grey"> ไม่มีข้อมูล </q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</q-select> -->
|
||||
</div>
|
||||
</q-card>
|
||||
<div class="col-12 q-pt-sm">
|
||||
|
|
|
|||
|
|
@ -68,15 +68,15 @@ const columns = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "employeeType",
|
||||
align: "left",
|
||||
label: "ประเภทตำแหน่ง",
|
||||
sortable: true,
|
||||
field: "employeeType",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
// {
|
||||
// name: "employeeType",
|
||||
// align: "left",
|
||||
// label: "ประเภทตำแหน่ง",
|
||||
// sortable: true,
|
||||
// field: "employeeType",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// },
|
||||
{
|
||||
name: "position",
|
||||
align: "left",
|
||||
|
|
@ -254,10 +254,11 @@ function clearInsigniaFilters(name: string) {
|
|||
if (name === "typeinsigniaOptions") {
|
||||
DataStore.typeinsignia = "all";
|
||||
typeinsigniaOptions.value = DataStore.typeinsigniaOptions;
|
||||
} else if (name === "employeeClassOps") {
|
||||
DataStore.employeeClass = "all";
|
||||
employeeClassOps.value = DataStore.employeeClassOps;
|
||||
}
|
||||
// else if (name === "employeeClassOps") {
|
||||
// DataStore.employeeClass = "all";
|
||||
// employeeClassOps.value = DataStore.employeeClassOps;
|
||||
// }
|
||||
}
|
||||
|
||||
function onSearch() {
|
||||
|
|
@ -337,7 +338,7 @@ onMounted(async () => {
|
|||
ref="filterRef"
|
||||
outlined
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
@ -406,7 +407,7 @@ onMounted(async () => {
|
|||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
<q-select
|
||||
<!-- <q-select
|
||||
v-model="DataStore.employeeClass"
|
||||
dense
|
||||
outlined
|
||||
|
|
@ -450,7 +451,7 @@ onMounted(async () => {
|
|||
<q-item-section class="text-grey"> ไม่มีข้อมูล </q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</q-select> -->
|
||||
</div>
|
||||
</q-card>
|
||||
<div class="col-12 q-pt-sm">
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ const pagination = ref({
|
|||
async function fecthOrg() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.insigniaNosend(props.roundId))
|
||||
.get(config.API.insigniaNosend(props.roundId, DataStore.employeeClass))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = data.map((e: ResponseNoSend) => ({
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ function findlist(id: string = "", idCard: string) {
|
|||
function fectDataByid(id: string) {
|
||||
showLoader();
|
||||
if (props.profileType !== undefined) {
|
||||
employeeClass.value = "officer";
|
||||
employeeClass.value = props.profileType;
|
||||
}
|
||||
http
|
||||
.get(config.API.noteByid(id))
|
||||
|
|
@ -291,7 +291,7 @@ function classInput(val: boolean) {
|
|||
watch(props, () => {
|
||||
if (props.modal === true) {
|
||||
filterinsigniaOp2.value = DataStore.insigniaOp2;
|
||||
employeeClass.value = "";
|
||||
employeeClass.value = props.profileType || "";
|
||||
cardid.value = "";
|
||||
fullName.value = "";
|
||||
position.value = "";
|
||||
|
|
@ -335,9 +335,6 @@ watch(props, () => {
|
|||
<div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs">
|
||||
<div class="col-4">
|
||||
<q-select
|
||||
:rules="[
|
||||
(val:string) => !!val || 'กรุณาเลือก ขรก.สามัญ/ลูกจ้างประจำ',
|
||||
]"
|
||||
hide-bottom-space
|
||||
:options="employeeClassOps"
|
||||
dense
|
||||
|
|
@ -348,9 +345,9 @@ watch(props, () => {
|
|||
map-options
|
||||
outlined
|
||||
v-model="employeeClass"
|
||||
:label="`ขรก.สามัญ/ลูกจ้างประจำ`"
|
||||
label="ประเภทตำแหน่ง"
|
||||
@update:model-value="selectType"
|
||||
:class="classInput(status !== '')"
|
||||
disable
|
||||
:readonly="status !== ''"
|
||||
lazy-rules
|
||||
/>
|
||||
|
|
@ -383,7 +380,7 @@ watch(props, () => {
|
|||
label="เลขประจำตัวประชาชน"
|
||||
maxlength="13"
|
||||
mask="#############"
|
||||
@keyup="searchcardid"
|
||||
@change="searchcardid"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ interface ResponseInsigniaType {
|
|||
}
|
||||
|
||||
interface ResponseRecordLists {
|
||||
profileId?: string;
|
||||
address: string;
|
||||
citizenId: string;
|
||||
date: Date;
|
||||
|
|
@ -128,6 +129,7 @@ interface ResponseManageList {
|
|||
markDiscipline: boolean;
|
||||
markLeave: boolean;
|
||||
markRate: boolean;
|
||||
markInsignia: boolean;
|
||||
posNo: string;
|
||||
position: string;
|
||||
profileId: string;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,12 @@ const report_02 = () =>
|
|||
const ReclaimMain = () =>
|
||||
import("@/modules/07_insignia/views/07_ReclaimMain.vue");
|
||||
|
||||
// รายชื่อลูกจ้างประจำ ที่มีสิทธิ์ยื่นขอพระราชทานเครื่องราชอิสริยาภรณ์
|
||||
const ManageEmpMain = () =>
|
||||
import("@/modules/07_insignia/views/08_ManageEmpMain.vue");
|
||||
const RecordInsigniaEmp = () =>
|
||||
import("@/modules/07_insignia/views/09_ResultMainEmp.vue");
|
||||
|
||||
export default [
|
||||
{
|
||||
path: "/insignia/round",
|
||||
|
|
@ -124,4 +130,24 @@ export default [
|
|||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/insignia/manage-emp/list-manage",
|
||||
name: "insigniaManageEmp",
|
||||
component: ManageEmpMain,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: "SYS_INSIGNIA_MANAGE_EMP",
|
||||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/insignia/record-emp",
|
||||
name: "insigniaRecordEmp",
|
||||
component: RecordInsigniaEmp,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: "SYS_INSIGNIA_RECORD_EMP",
|
||||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
|
|||
|
|
@ -37,11 +37,11 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
const typeinsigniaOptions = ref<OptionData[]>([
|
||||
{ id: "all", name: "ทั้งหมด" },
|
||||
]);
|
||||
const employeeClass = ref<string>("all");
|
||||
const employeeClass = ref<string>("officer");
|
||||
const employeeClassOps = ref<OptionData[]>([
|
||||
{ name: "ทั้งหมด", id: "all" },
|
||||
// { name: "ทั้งหมด", id: "all" },
|
||||
{ name: "ข้าราชการ กทม.สามัญ", id: "officer" },
|
||||
{ name: "ลูกจ้างประจำ", id: "perm" },
|
||||
{ name: "ลูกจ้างประจำ", id: "employee" },
|
||||
]);
|
||||
|
||||
const isOfficer = ref<boolean>(false);
|
||||
|
|
@ -101,6 +101,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
markDiscipline: e.markDiscipline,
|
||||
markLeave: e.markLeave,
|
||||
markRate: e.markRate,
|
||||
markInsignia: e.markInsignia,
|
||||
isApprove: e.isApprove,
|
||||
statusMark:
|
||||
e.markDiscipline === true ||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ export const useBrrowDataStore = defineStore("insigniaBrrow", () => {
|
|||
const employeeClassOps = ref<OptionData[]>([
|
||||
{ name: "ทั้งหมด", id: "all" },
|
||||
{ name: "ข้าราชการ กทม.สามัญ", id: "officer" },
|
||||
{ name: "ลูกจ้างประจำ", id: "perm" },
|
||||
{ name: "ลูกจ้างประจำ", id: "employee" },
|
||||
]);
|
||||
const type = ref<any[]>([]);
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ export const useInsigniaReclaimStore = defineStore("insigniaReclaim", () => {
|
|||
const employeeClassData = ref<OptionData[]>([
|
||||
{ name: "ทั้งหมด", id: "all" },
|
||||
{ name: "ข้าราชการ กทม.สามัญ", id: "officer" },
|
||||
{ name: "ลูกจ้างประจำ", id: "perm" },
|
||||
{ name: "ลูกจ้างประจำ", id: "employee" },
|
||||
]);
|
||||
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
|
|||
rows.value = [];
|
||||
const alllist = await data.map((e: ResponseRecordLists) => ({
|
||||
id: e.id,
|
||||
profileId: e.profileId,
|
||||
citizenId: e.citizenId,
|
||||
prefix: e.prefix,
|
||||
position: e.position,
|
||||
|
|
|
|||
192
src/modules/07_insignia/views/!08_ManageEmpMain.vue
Normal file
192
src/modules/07_insignia/views/!08_ManageEmpMain.vue
Normal file
|
|
@ -0,0 +1,192 @@
|
|||
<script setup lang="ts">
|
||||
import { useQuasar } from "quasar";
|
||||
import { onMounted, ref } from "vue";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRoleWorkflowDataStore } from "@/stores/roleWorkflow";
|
||||
|
||||
/** import Type*/
|
||||
import type { DataStat } from "@/modules/07_insignia/interface/index/Main";
|
||||
import type { ResponsePeriod } from "@/modules/07_insignia/interface/response/Main";
|
||||
|
||||
/**import Componrnts*/
|
||||
import cardTop from "@/modules/07_insignia/components/2_Manage/StatCard.vue"; // stat
|
||||
|
||||
/**use */
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const { fetchDataCheckIsoffice } = useRoleWorkflowDataStore();
|
||||
const { messageError, dialogConfirm, showLoader, hideLoader, success } =
|
||||
useCounterMixin();
|
||||
|
||||
//การเจ้าหน้าที่
|
||||
const isStaff = ref<boolean>(false);
|
||||
const isOfficer = ref<boolean>(false);
|
||||
const isDirector = ref<boolean>(false);
|
||||
const isDeputy = ref<boolean>(false);
|
||||
|
||||
//ข้อมูล สถิติ
|
||||
const stat = ref<DataStat>({
|
||||
allUserUser: 0,
|
||||
orgAllCount: 0,
|
||||
orgNoSendCount: 0,
|
||||
orgSendCount: 0,
|
||||
});
|
||||
|
||||
//ข้อมูลรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์
|
||||
const round = ref<string>("");
|
||||
const optionRound = ref<
|
||||
Array<{ id: number; year: string; name: string; period_revision: string }>
|
||||
>([]);
|
||||
|
||||
/** ฟังก์ชันเรียกข้อมูลการเป็นเจ้าหน้าที่*/
|
||||
async function fetchCheckIsofficer() {
|
||||
try {
|
||||
const data = await fetchDataCheckIsoffice("SYS_INSIGNIA_MANAGE_EMP");
|
||||
isStaff.value = data.isStaff;
|
||||
// isStaff.value = true; // สำหรับการทดสอบ
|
||||
isOfficer.value = data.isOfficer;
|
||||
isDirector.value = data.isDirector;
|
||||
isDeputy.value = data.isDeputy;
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
}
|
||||
}
|
||||
|
||||
/** ฟังก์ชันเรียกข้อมูลรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์*/
|
||||
async function fecthRoundData() {
|
||||
await http
|
||||
.get(config.API.listRoundInsignia(), { params: { path: "MANAGE" } })
|
||||
.then(async (res) => {
|
||||
optionRound.value = await res.data.result.map((e: ResponsePeriod) => ({
|
||||
id: e.period_id,
|
||||
year: e.period_year,
|
||||
name: e.period_name,
|
||||
period_revision: e.period_revision,
|
||||
}));
|
||||
//มีรอบการเสนอขอพระราชทานเครื่อง
|
||||
if (optionRound.value.length !== 0) {
|
||||
// DataStore.optionRound = optionRound.value;
|
||||
// const lastValue = optionRound.value[0];
|
||||
// await fetchListOrg(lastValue.period_revision);
|
||||
// await fecthAgency(lastValue.period_revision);
|
||||
// if (DataStore.roundId) {
|
||||
// round.value = DataStore.roundId; // รอบการเสนอให้ใช้รอบที่เลือก
|
||||
// } else {
|
||||
// round.value = lastValue.id.toString(); // รอบการเสนอให้ใช้รอบล่าสุด
|
||||
// }
|
||||
// await fecthStat(round.value);
|
||||
// DataStore.roundId = round.value;
|
||||
// roundName.value = lastValue.name;
|
||||
// loadview.value = true;
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
});
|
||||
}
|
||||
|
||||
/** ฟังก์ชันยื่นยันการล็อกข้อมูล*/
|
||||
function onConfrimIsLockData() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => {},
|
||||
"ยืนยันการล็อกข้อมูล",
|
||||
"คุณต้องการล็อกข้อมูลใช่หรือไม่"
|
||||
);
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
showLoader();
|
||||
try {
|
||||
await fetchCheckIsofficer();
|
||||
if (isStaff.value || isOfficer.value || isDirector.value) {
|
||||
await Promise.all([fecthRoundData()]);
|
||||
}
|
||||
} catch (error) {
|
||||
messageError($q, error);
|
||||
} finally {
|
||||
hideLoader();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
รายชื่อลูกจ้างประจำ ที่มีสิทธิ์ยื่นขอพระราชทานเครื่องราชอิสริยาภรณ์
|
||||
</div>
|
||||
|
||||
<q-card
|
||||
bordered
|
||||
class="row col-12 q-mt-sm"
|
||||
v-if="isDirector || isOfficer || isStaff"
|
||||
>
|
||||
<div class="row col-12 items-center bg-grey-1">
|
||||
<div class="q-pl-md q-pr-sm text-weight-medium text-grey-7">รอบ</div>
|
||||
<q-select
|
||||
borderless
|
||||
dense
|
||||
v-model="round"
|
||||
:options="optionRound"
|
||||
map-options
|
||||
emit-value
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
/>
|
||||
<!-- @update:model-value="changround" -->
|
||||
|
||||
<q-space />
|
||||
<!-- สกจ. Freez ข้อมูล -->
|
||||
<q-btn
|
||||
v-if="isOfficer && checkPermission($route)?.attrIsUpdate"
|
||||
dense
|
||||
unelevated
|
||||
label="ล็อกข้อมูล"
|
||||
color="public"
|
||||
class="q-px-md q-ml-md"
|
||||
@click="onConfrimIsLockData"
|
||||
>
|
||||
<q-tooltip>ล็อกข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div v-if="isOfficer" class="col-12 row bg-white">
|
||||
<div class="fit q-px-md q-py-sm">
|
||||
<div class="row col-12 q-col-gutter-sm fit">
|
||||
<cardTop
|
||||
:amount="stat.orgAllCount"
|
||||
label="หน่วยงานทั้งหมด"
|
||||
color="#016987"
|
||||
/>
|
||||
<cardTop
|
||||
:amount="stat.orgSendCount"
|
||||
label="หน่วยงานที่ส่งรายชื่อเเล้ว"
|
||||
color="#02A998"
|
||||
/>
|
||||
<cardTop
|
||||
:amount="stat.orgNoSendCount"
|
||||
label="หน่วยงานที่ยังไม่ได้ส่งรายชื่อ"
|
||||
color="#2EA0FF"
|
||||
/>
|
||||
<cardTop
|
||||
:amount="stat.allUserUser"
|
||||
label="จำนวนคนที่ยื่นขอ"
|
||||
color="#4154B3"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<q-card v-else>
|
||||
<div class="q-pa-md q-gutter-sm">
|
||||
<q-banner inline-actions rounded class="bg-grey-1 text-center">
|
||||
ไม่มีข้อมูลรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์
|
||||
</q-banner>
|
||||
</div>
|
||||
</q-card>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
|
@ -210,7 +210,7 @@ onMounted(async () => {
|
|||
v-model="filterKeyword"
|
||||
outlined
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
@keydown.enter.prevent="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import { useQuasar } from "quasar";
|
|||
import { useRoute } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
|
||||
import { useRoleWorkflowDataStore } from "@/stores/roleWorkflow";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
|
@ -33,6 +34,7 @@ const tab1 = defineAsyncComponent(
|
|||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const route = useRoute();
|
||||
const DataStore = useInsigniaDataStore();
|
||||
const { fetchDataCheckIsoffice } = useRoleWorkflowDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError, dialogConfirm, showLoader, hideLoader, success } = mixin;
|
||||
|
||||
|
|
@ -184,18 +186,15 @@ async function fecthInsignia() {
|
|||
}
|
||||
|
||||
async function fetchCheckIsofficer() {
|
||||
http
|
||||
.get(config.API.checkIsofficer + `SYS_INSIGNIA_MANAGE`)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
DataStore.isStaff = data.isStaff;
|
||||
DataStore.isOfficer = data.isOfficer;
|
||||
DataStore.isDirector = data.isDirector;
|
||||
DataStore.isDeputy = data.isDeputy;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
});
|
||||
try {
|
||||
const data = await fetchDataCheckIsoffice("SYS_INSIGNIA_MANAGE");
|
||||
DataStore.isStaff = data.isStaff;
|
||||
DataStore.isOfficer = data.isOfficer;
|
||||
DataStore.isDirector = data.isDirector;
|
||||
DataStore.isDeputy = data.isDeputy;
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -235,7 +234,7 @@ async function fecthInsigniaByOc(
|
|||
ocId: string,
|
||||
role: string,
|
||||
status: string,
|
||||
isDeputy: boolean = false
|
||||
isDeputy: boolean = DataStore.isDeputy
|
||||
) {
|
||||
DataStore.rows = [];
|
||||
if (roundId && ocId && role && status) {
|
||||
|
|
@ -243,6 +242,7 @@ async function fecthInsigniaByOc(
|
|||
await http
|
||||
.get(config.API.insigniaList(roundId, ocId, role, status, isDeputy))
|
||||
.then(async (res) => {
|
||||
DataStore.isLock = res.data.result.isLock; // เช็คว่ามีการล็อกข้อมูลหรือไม่
|
||||
requestNote.value = res.data.result.requestNote;
|
||||
requestStatus.value = res.data.result.requestStatus;
|
||||
requestId.value = res.data.result.requestId;
|
||||
|
|
@ -423,6 +423,35 @@ function requestSendNote() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function อัปเดตข้อมูลคุณสมบัติ
|
||||
*/
|
||||
async function updateDataProperty() {
|
||||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.insigniaUpdateProperty, {
|
||||
insigniaPeriodId: round.value,
|
||||
agencyId: DataStore.agency,
|
||||
type: "officer",
|
||||
})
|
||||
.then(async () => {
|
||||
hideLoader();
|
||||
await fecthInsigniaByOc(
|
||||
round.value,
|
||||
DataStore.agency,
|
||||
"officer",
|
||||
tab.value
|
||||
);
|
||||
success($q, "อัปเดตข้อมูลคุณสมบัติสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function อัปโหลดไฟล์เจ้าหน้าที่
|
||||
* @param event file
|
||||
|
|
@ -456,6 +485,7 @@ async function uploadFile(event: any) {
|
|||
* hook
|
||||
*/
|
||||
onMounted(async () => {
|
||||
DataStore.employeeClass = "officer"; // กำหนดประเภทข้าราชการสามัญฯ เป็น ขรก.
|
||||
tab.value = DataStore.mainTab ?? "";
|
||||
await Promise.all([fecthlistRound(), fecthInsignia(), fetchCheckIsofficer()]);
|
||||
});
|
||||
|
|
@ -508,6 +538,23 @@ onUnmounted(() => {
|
|||
>
|
||||
<q-tooltip>ล็อกข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<!-- อัปเดตข้อมูลคุณสมบัติ -->
|
||||
<q-btn
|
||||
v-if="
|
||||
((DataStore.isOfficer && DataStore.optionsTypeOc.findIndex(
|
||||
(v: OptionData) => v.id === DataStore.selectOrganization && v.isDeputy === true) > -1) || DataStore.isStaff) &&
|
||||
DataStore.isLock !== true && (requestStatus == 'st1' || requestStatus == 'st4') &&
|
||||
checkPermission($route)?.attrIsUpdate
|
||||
"
|
||||
dense
|
||||
unelevated
|
||||
label="อัปเดตข้อมูลคุณสมบัติ"
|
||||
color="info"
|
||||
class="q-px-md q-ml-sm"
|
||||
@click="updateDataProperty"
|
||||
>
|
||||
<q-tooltip>อัปเดตข้อมูลคุณสมบัติ</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div v-if="DataStore.isOfficer" class="col-12 row bg-white">
|
||||
|
|
@ -643,7 +690,7 @@ onUnmounted(() => {
|
|||
dense
|
||||
v-model="fileUpload"
|
||||
accept=".pdf"
|
||||
:style="fileUpload === null ? 'width: 150px' : 'width: auto'"
|
||||
:style="fileUpload === null ? 'width: 250px' : 'width: auto'"
|
||||
label="อัปโหลดไฟล์"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
|
|
@ -689,6 +736,7 @@ onUnmounted(() => {
|
|||
|
||||
<q-btn
|
||||
v-if="
|
||||
!DataStore.isLock &&
|
||||
((DataStore.isOfficer && DataStore.optionsTypeOc.findIndex(
|
||||
(v: OptionData) => v.id === DataStore.selectOrganization && v.isDeputy === true) > -1) || DataStore.isStaff) &&
|
||||
(requestStatus == 'st1' || requestStatus == 'st4') &&
|
||||
|
|
@ -702,6 +750,7 @@ onUnmounted(() => {
|
|||
/>
|
||||
<q-btn
|
||||
v-if="
|
||||
!DataStore.isLock &&
|
||||
DataStore.isDirector &&
|
||||
(requestStatus == 'st3' || requestStatus == 'st5') &&
|
||||
checkPermission($route)?.attrIsUpdate
|
||||
|
|
@ -714,6 +763,7 @@ onUnmounted(() => {
|
|||
/>
|
||||
<q-btn
|
||||
v-if="
|
||||
!DataStore.isLock &&
|
||||
DataStore.isDirector &&
|
||||
requestStatus == 'st3' &&
|
||||
checkPermission($route)?.attrIsUpdate
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import DialogHeader from "@/components/DialogHeader.vue";
|
|||
import Dialogbody from "@/modules/07_insignia/components/3_result/DialogReceive_Return.vue"; //รับ-คืนเครื่องราชฯ
|
||||
import DialogForm from "@/modules/07_insignia/components/3_result/DialogResults.vue"; //บันทึกผล
|
||||
import fileUploadview from "../components/3_result/TabDocuments.vue";
|
||||
import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
|
||||
|
||||
/** use*/
|
||||
const $q = useQuasar();
|
||||
|
|
@ -106,15 +107,15 @@ const columns = ref<QTableProps["columns"]>([
|
|||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "employeeType",
|
||||
align: "left",
|
||||
label: "ประเภทตำแหน่ง",
|
||||
field: "employeeType",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
// {
|
||||
// name: "employeeType",
|
||||
// align: "left",
|
||||
// label: "ประเภทตำแหน่ง",
|
||||
// field: "employeeType",
|
||||
// sortable: true,
|
||||
// sort: (a: string, b: string) =>
|
||||
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
// },
|
||||
{
|
||||
name: "type",
|
||||
align: "left",
|
||||
|
|
@ -480,12 +481,13 @@ function filterSelector(val: string, update: Function, name: string) {
|
|||
filterInvoice.value = DataStore.invoiceTypeop.filter(
|
||||
(v: OptionData) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
} else if (name === "filterEmployee") {
|
||||
DataStore.employeeClass = val ? "" : DataStore.employeeClass;
|
||||
filterEmployee.value = DataStore.employeeClassOps.filter(
|
||||
(v: OptionData) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
}
|
||||
// else if (name === "filterEmployee") {
|
||||
// DataStore.employeeClass = val ? "" : DataStore.employeeClass;
|
||||
// filterEmployee.value = DataStore.employeeClassOps.filter(
|
||||
// (v: OptionData) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
// );
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -501,7 +503,7 @@ function clearInsigniaFilters(name: string) {
|
|||
DataStore.invoiceType = "all";
|
||||
filterInvoice.value = DataStore.invoiceTypeop;
|
||||
} else if (name === "filterEmployee") {
|
||||
DataStore.employeeClass = "all";
|
||||
// DataStore.employeeClass = "all";
|
||||
filterEmployee.value = DataStore.employeeClassOps;
|
||||
}
|
||||
}
|
||||
|
|
@ -534,6 +536,21 @@ function serchDataTableDailog() {
|
|||
);
|
||||
}
|
||||
|
||||
const modalPersonal = ref<boolean>(false); // popup ทะเบียนประวัติ
|
||||
/**
|
||||
* function redirect to ทะเบียนประวัติ
|
||||
* @param id profileId
|
||||
*/
|
||||
function viewRegistry(id: string, type: string) {
|
||||
modalPersonal.value = true;
|
||||
personId.value = id;
|
||||
profileType.value = type;
|
||||
}
|
||||
|
||||
function updatemodalPersonal(modal: boolean) {
|
||||
modalPersonal.value = modal;
|
||||
}
|
||||
|
||||
/**
|
||||
* callback function จำทำงานเมื่อ tab มีการเปลี่ยนแปลง
|
||||
*/
|
||||
|
|
@ -805,7 +822,7 @@ onMounted(() => {
|
|||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
<q-select
|
||||
<!-- <q-select
|
||||
v-model="DataStore.employeeClass"
|
||||
dense
|
||||
outlined
|
||||
|
|
@ -851,7 +868,7 @@ onMounted(() => {
|
|||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</q-select> -->
|
||||
<div>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsCreate"
|
||||
|
|
@ -884,6 +901,23 @@ onMounted(() => {
|
|||
<template v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
<q-td auto-width>
|
||||
<!-- ดูข้อมูลทะเบียนประวัติ -->
|
||||
<q-btn
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsGet && props.row.profileId
|
||||
"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
icon="info"
|
||||
color="info"
|
||||
@click.stop="
|
||||
viewRegistry(props.row.profileId, props.row.profileType)
|
||||
"
|
||||
>
|
||||
<q-tooltip>ดูข้อมูลทะเบียนประวัติ</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsGet &&
|
||||
|
|
@ -962,7 +996,7 @@ onMounted(() => {
|
|||
:round-id="selectRound"
|
||||
:action="action"
|
||||
:person-id="personId"
|
||||
:profile-type="profileType"
|
||||
profile-type="officer"
|
||||
:fecthlist-insignia="fecthlistInsignia"
|
||||
/>
|
||||
|
||||
|
|
@ -1036,6 +1070,13 @@ onMounted(() => {
|
|||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<PopupPersonal
|
||||
:modal="modalPersonal"
|
||||
:id="personId"
|
||||
:type="profileType"
|
||||
@update:modal="updatemodalPersonal"
|
||||
/>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
.arrow {
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ const isInsigniaRound = ref<boolean>(false); //สถานะรอบ
|
|||
|
||||
const roundOps = ref<DataRound[]>(roundData.value); //รอบเครืองราช
|
||||
const insigniaTypeOps = ref<OptionData[]>(insigniaTypeData.value); //ประเภทเครื่องราช
|
||||
const employeeClassOps = ref<OptionData[]>(employeeClassData.value); //ตำแหน่งประเภท
|
||||
const employeeClassOps = ref<OptionData[]>(employeeClassData.value); //ประเภทตำแหน่ง
|
||||
|
||||
const modalForm = ref<boolean>(false); // modal บันทึกการเรียกคืนเครื่องราชฯ
|
||||
const isEdit = ref<boolean>(false); // สถานะการแก้ไข
|
||||
|
|
@ -515,7 +515,7 @@ onMounted(async () => {
|
|||
outlined
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
:label="`${'ตำแหน่งประเภท'}`"
|
||||
:label="`${'ประเภทตำแหน่ง'}`"
|
||||
emit-value
|
||||
use-input
|
||||
hide-selected
|
||||
|
|
|
|||
799
src/modules/07_insignia/views/08_ManageEmpMain.vue
Normal file
799
src/modules/07_insignia/views/08_ManageEmpMain.vue
Normal file
|
|
@ -0,0 +1,799 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, onUnmounted, defineAsyncComponent, ref } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useRoute } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
|
||||
import { useRoleWorkflowDataStore } from "@/stores/roleWorkflow";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import type { DataStructureTree } from "@/interface/main";
|
||||
import type {
|
||||
OptionData,
|
||||
OptionRound,
|
||||
DataStat,
|
||||
} from "@/modules/07_insignia/interface/index/Main";
|
||||
import type { ResponsePeriod } from "@/modules/07_insignia/interface/response/Main";
|
||||
|
||||
/**import Componrnts*/
|
||||
import cardTop from "@/modules/07_insignia/components/2_Manage/StatCard.vue"; // stat
|
||||
// import tab1 from "@/modules/07_insignia/components/2_Manage/Tab1.vue"; //คนที่ยืนขอ
|
||||
import tab2 from "@/modules/07_insignia/components/2_Manage/Tab2.vue"; //คนไม่ที่ยืนขอ
|
||||
import tab3 from "@/modules/07_insignia/components/2_Manage/Tab3.vue"; //คนที่ถูกลบ
|
||||
import tab4 from "@/modules/07_insignia/components/2_Manage/Tab4.vue"; //หน่วยงานที่ไม่ได้ส่งชื่อ
|
||||
import DialogPopupReason from "@/components/Dialogs/PopupReason.vue"; //หมายเหตุ
|
||||
|
||||
const tab1 = defineAsyncComponent(
|
||||
() => import("@/modules/07_insignia/components/2_Manage/Tab1.vue")
|
||||
);
|
||||
|
||||
/**use */
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const route = useRoute();
|
||||
const DataStore = useInsigniaDataStore();
|
||||
const { fetchDataCheckIsoffice } = useRoleWorkflowDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError, dialogConfirm, showLoader, hideLoader, success } = mixin;
|
||||
|
||||
/**
|
||||
* ตัวแปร
|
||||
*/
|
||||
const loadview = ref<boolean>(false); //แสดง View
|
||||
// const hideBottom = ref<boolean>(false);
|
||||
const round = ref<string>(""); //รอยการเสนอขอ
|
||||
const roundName = ref<string>(""); //ชื่อรอบการเสนอ
|
||||
const optionRound = ref<OptionRound[]>([]);
|
||||
const optiontypeOc = ref<OptionData[]>([]);
|
||||
const tab = ref<string>(""); //tab รายชื่อ
|
||||
//ข้อมูล สถิติ
|
||||
const stat = ref<DataStat>({
|
||||
allUserUser: 0,
|
||||
orgAllCount: 0,
|
||||
orgNoSendCount: 0,
|
||||
orgSendCount: 0,
|
||||
});
|
||||
const requestNote = ref<string>(""); //หมายเหตุ ตีกลับ
|
||||
const requestStatus = ref<string>(""); //สถานะของรอบการเสนอขอ
|
||||
const requestId = ref<string>(""); //id ของรอบการเสนอขอ
|
||||
const document = ref<string>(""); //เอกสารดาวน์โหลด
|
||||
const fileUpload = ref<any>(null); //ไฟล์อัปโหลด
|
||||
const modalPopupBackToEdit = ref<boolean>(false); //model แก้ไข
|
||||
const modalbackInsignia2Role = ref<boolean>(false); // popup หมายเหตุการตีกลับ
|
||||
|
||||
/**
|
||||
* function เรียกรอบการเสนอขอพระราชทานเครื่อง
|
||||
*/
|
||||
async function fecthlistRound() {
|
||||
showLoader();
|
||||
loadview.value = false;
|
||||
await http
|
||||
.get(config.API.listRoundInsignia(), { params: { path: "MANAGE" } })
|
||||
.then(async (res) => {
|
||||
optionRound.value = await res.data.result.map((e: ResponsePeriod) => ({
|
||||
id: e.period_id,
|
||||
year: e.period_year,
|
||||
name: e.period_name,
|
||||
period_revision: e.period_revision,
|
||||
}));
|
||||
|
||||
//มีรอบการเสนอขอพระราชทานเครื่องแสดง UI
|
||||
if (optionRound.value.length !== 0) {
|
||||
DataStore.optionRound = optionRound.value;
|
||||
const lastValue = optionRound.value[0];
|
||||
await fetchListOrg(lastValue.period_revision);
|
||||
await fecthAgency(lastValue.period_revision);
|
||||
if (DataStore.roundId) {
|
||||
round.value = DataStore.roundId; // รอบการเสนอให้ใช้รอบที่เลือก
|
||||
} else {
|
||||
round.value = lastValue.id.toString(); // รอบการเสนอให้ใช้รอบล่าสุด
|
||||
}
|
||||
await fecthStat(round.value);
|
||||
DataStore.roundId = round.value;
|
||||
roundName.value = lastValue.name;
|
||||
loadview.value = true;
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function เรียกดู Stat ของรอบการเสนอขอพระราชทานเครื่อง
|
||||
*/
|
||||
async function fecthStat(id: string) {
|
||||
if (DataStore.isOfficer) {
|
||||
await http
|
||||
.get(config.API.insigniaDashboard(id, "employee"))
|
||||
.then((res) => {
|
||||
stat.value = res.data.result;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* function fetch ข้อมูลโครองสร้างปัจจุบัน
|
||||
* @param id โครงสร้างปัจจุบัน
|
||||
*/
|
||||
async function fetchListOrg(id: string) {
|
||||
if (DataStore.isOfficer) {
|
||||
await http
|
||||
.get(config.API.orgByIdSystemRoot(id, route.meta.Key as string))
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
if (data.length !== 0) {
|
||||
optiontypeOc.value = await res.data.result.map(
|
||||
(item: DataStructureTree) => ({
|
||||
id: item.orgTreeId,
|
||||
name: item.orgName,
|
||||
isDeputy: item.isDeputy,
|
||||
})
|
||||
);
|
||||
|
||||
await DataStore.fetchOption(optiontypeOc.value); //ค่าของหน่วยงานทั้งหมดไว้ที่ DataStore
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* funcion เช็คหน่วยงาน
|
||||
*/
|
||||
async function fecthAgency(id: string) {
|
||||
await http
|
||||
.get(config.API.keycloakPosition(), {
|
||||
params: {
|
||||
revisionId: id,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
DataStore.agency = res.data.result.rootId;
|
||||
DataStore.selectOrganization = res.data.result.rootId;
|
||||
DataStore.typeOc = DataStore.agency;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function เรียกประเภทเครื่องราช
|
||||
*/
|
||||
async function fecthInsignia() {
|
||||
if (DataStore.dataInsigniaType.length === 0) {
|
||||
await http
|
||||
.get(config.API.insigniaOrg)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
DataStore.fetchInsigniaType(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async function fetchCheckIsofficer() {
|
||||
try {
|
||||
const data = await fetchDataCheckIsoffice("SYS_INSIGNIA_MANAGE");
|
||||
DataStore.isStaff = data.isStaff;
|
||||
DataStore.isOfficer = data.isOfficer;
|
||||
DataStore.isDirector = data.isDirector;
|
||||
DataStore.isDeputy = data.isDeputy;
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* function เปลี่ยนรอบการแสดง
|
||||
*/
|
||||
async function changround() {
|
||||
DataStore.roundId = round.value;
|
||||
|
||||
// get round name
|
||||
await fecthStat(round.value); //เรียกดู Stat รอบที่เลือก
|
||||
const roundFilter = optionRound.value.find(
|
||||
(x: OptionRound) => x.id === round.value
|
||||
);
|
||||
if (roundFilter) {
|
||||
await fetchListOrg(roundFilter?.period_revision);
|
||||
await fecthAgency(roundFilter?.period_revision);
|
||||
roundName.value = `รอบการเสนอขอพระราชทานเครื่องราชฯ ปี ${
|
||||
roundFilter.year + 543
|
||||
}`;
|
||||
}
|
||||
var organization =
|
||||
DataStore.agency != null //ถ้ามี agency เรียกข้อมูลตาม agency ถ้าไม่มีเรียนตาม Oc ที่เลือก
|
||||
? DataStore.agency
|
||||
: DataStore.typeOc;
|
||||
await fecthInsigniaByOc(round.value, organization, "officer", tab.value); // เรียกข้อมูลรายชื่อข้าราชการสามัญฯ ที่มีสิทธิ์ยื่นขอพระราชทานเครื่องราชอิสริยาภรณ์
|
||||
}
|
||||
|
||||
/**
|
||||
* function เรียกข้อมูลรายชื่อข้าราชการสามัญฯ ที่มีสิทธิ์ยื่นขอพระราชทานเครื่องราชอิสริยาภรณ์ ตามรอบการเสนอขอ
|
||||
* @param roundId id รอบการเสนอขอ
|
||||
* @param ocId id หน่วยงาน
|
||||
* @param role ประเภท officer,employee
|
||||
* @param status สถานะ
|
||||
*/
|
||||
async function fecthInsigniaByOc(
|
||||
roundId: string,
|
||||
ocId: string,
|
||||
role: string,
|
||||
status: string,
|
||||
isDeputy: boolean = DataStore.isDeputy
|
||||
) {
|
||||
DataStore.rows = [];
|
||||
if (roundId && ocId && role && status) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(
|
||||
config.API.insigniaList(
|
||||
roundId,
|
||||
ocId,
|
||||
role,
|
||||
status,
|
||||
isDeputy,
|
||||
"employee"
|
||||
)
|
||||
)
|
||||
.then(async (res) => {
|
||||
requestNote.value = res.data.result.requestNote;
|
||||
requestStatus.value = res.data.result.requestStatus;
|
||||
requestId.value = res.data.result.requestId;
|
||||
document.value = res.data.result.document;
|
||||
await DataStore.fetchData(res.data.result.items); // ส่งรายชื่อข้าราชการสามัญฯ
|
||||
await DataStore.fetchDataInsignia(res.data.result); // ส่งข้อมูลรอบบการแสดง
|
||||
// แสดงปุมล็อกข้อมูล
|
||||
// if (res.data.result.items !== null) {
|
||||
// if (res.data.result.items.length !== 0) {
|
||||
// hideBottom.value = true;
|
||||
// } else hideBottom.value = false;
|
||||
// }
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* function ยืนยันการส่งรอบการเสนอขอต่อ เฉพาะ รอบที่ requestStatus st1 และ st4
|
||||
*/
|
||||
function sendToDirector() {
|
||||
dialogConfirm($q, () => {
|
||||
showLoader();
|
||||
http
|
||||
.get(
|
||||
config.API.insigniaSendToDirector(
|
||||
round.value,
|
||||
DataStore.agency,
|
||||
"employee"
|
||||
)
|
||||
)
|
||||
.then(async () => {
|
||||
await fecthStat(round.value);
|
||||
await fecthInsigniaByOc(
|
||||
round.value,
|
||||
DataStore.agency,
|
||||
"officer",
|
||||
tab.value
|
||||
);
|
||||
await success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function open popup แก้ไข*
|
||||
*/
|
||||
function popupBackToEdit() {
|
||||
modalPopupBackToEdit.value = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* function open popup ตีกลับ admin
|
||||
*/
|
||||
function popupBackToInsignia2Role() {
|
||||
modalbackInsignia2Role.value = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* funtion ยืนยันการ ตีกลับรอบการเสนอขอ เฉพาะ รอบที่ requestStatus st3 และ insignia2Role
|
||||
* @param reason หมายเหตุการตีกลับ
|
||||
*/
|
||||
function backToEdit(reason: string) {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => {
|
||||
showLoader();
|
||||
http
|
||||
.put(
|
||||
config.API.insigniaDirectorBackToEdit(
|
||||
round.value,
|
||||
DataStore.agency,
|
||||
"employee"
|
||||
),
|
||||
{
|
||||
reason: reason,
|
||||
}
|
||||
)
|
||||
.then(async () => {
|
||||
await fecthInsigniaByOc(
|
||||
round.value,
|
||||
DataStore.agency,
|
||||
"officer",
|
||||
tab.value
|
||||
);
|
||||
await success($q, "บันทึกสำเร็จ");
|
||||
modalPopupBackToEdit.value = false;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
hideLoader();
|
||||
});
|
||||
},
|
||||
"ยืนยันการตีกลับ",
|
||||
"ต้องการยืนยันการตีกลับใช่หรือไม่?"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* function ยืนยันการอนุมัติรอบการเสนอขอ เฉพาะ รอบที่ requestStatus st3 และ insignia2Role
|
||||
*/
|
||||
function directorApproved() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => {
|
||||
showLoader();
|
||||
http
|
||||
.get(
|
||||
config.API.insigniaDirectorApproved(
|
||||
round.value,
|
||||
DataStore.agency,
|
||||
"employee"
|
||||
)
|
||||
)
|
||||
.then(async () => {
|
||||
await fecthInsigniaByOc(
|
||||
round.value,
|
||||
DataStore.agency,
|
||||
"officer",
|
||||
tab.value
|
||||
);
|
||||
await fecthStat(round.value);
|
||||
await success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
hideLoader();
|
||||
});
|
||||
},
|
||||
"ยืนยันการอนุมัติ",
|
||||
"ต้องการยืนยันการอนุมัติใช่หรือไม่?"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* function ยืนยันการตีกลับรอบการเสนอขอ เฉพาะ รอบที่ requestStatus st5 และ adminRole
|
||||
* @param reason หมายเหตุการตีกลับ
|
||||
*/
|
||||
function backToEditinsignia2Role(reason: string) {
|
||||
dialogConfirm($q, () => {
|
||||
http
|
||||
.put(
|
||||
config.API.rejectRequest(round.value, DataStore.typeOc, "employee"),
|
||||
{
|
||||
reason: reason,
|
||||
}
|
||||
)
|
||||
.then(async () => {
|
||||
await fecthInsigniaByOc(
|
||||
round.value,
|
||||
DataStore.typeOc,
|
||||
"officer",
|
||||
tab.value
|
||||
);
|
||||
await success($q, "การตีกลับสำเร็จ");
|
||||
modalbackInsignia2Role.value = false;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function อัปเดตข้อมูลคุณสมบัติ
|
||||
*/
|
||||
async function updateDataProperty() {
|
||||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.insigniaUpdateProperty, {
|
||||
insigniaPeriodId: round.value,
|
||||
agencyId: DataStore.agency,
|
||||
type: "employee",
|
||||
})
|
||||
.then(async () => {
|
||||
hideLoader();
|
||||
await fecthInsigniaByOc(
|
||||
round.value,
|
||||
DataStore.agency,
|
||||
"officer",
|
||||
tab.value
|
||||
);
|
||||
success($q, "อัปเดตข้อมูลคุณสมบัติสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function อัปโหลดไฟล์เจ้าหน้าที่
|
||||
* @param event file
|
||||
*/
|
||||
async function uploadFile(event: any) {
|
||||
dialogConfirm($q, async () => {
|
||||
const selectedFile = event;
|
||||
const formdata = new FormData();
|
||||
formdata.append("Document", selectedFile);
|
||||
await http
|
||||
.put(config.API.uploadfileOnlyInsignia(requestId.value), formdata)
|
||||
.then(async () => {
|
||||
await fecthInsigniaByOc(
|
||||
round.value,
|
||||
DataStore.agency,
|
||||
"officer",
|
||||
tab.value
|
||||
);
|
||||
success($q, "อัปโหลดไฟล์สำเร็จ");
|
||||
fileUpload.value = null;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
}),
|
||||
"ยืนยันการอัปโหลดไฟล์",
|
||||
"ต้องการยืนยันการอัปโหลดไฟล์นี้หรือไม่ ?";
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* hook
|
||||
*/
|
||||
onMounted(async () => {
|
||||
tab.value = DataStore.mainTab ?? "";
|
||||
DataStore.employeeClass = "employee"; // กำหนดประเภทตำแหน่งเป็นลูกจ้างประจำ
|
||||
await Promise.all([fecthlistRound(), fecthInsignia(), fetchCheckIsofficer()]);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
DataStore.typeOc = "";
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
รายชื่อลูกจ้างประจำ ที่มีสิทธิ์ยื่นขอพระราชทานเครื่องราชอิสริยาภรณ์
|
||||
</div>
|
||||
<q-card
|
||||
bordered
|
||||
class="row col-12 q-mt-sm"
|
||||
v-if="
|
||||
loadview &&
|
||||
(DataStore.isDirector || DataStore.isOfficer || DataStore.isStaff)
|
||||
"
|
||||
>
|
||||
<div class="row col-12 items-center bg-grey-1">
|
||||
<div class="q-pl-md q-pr-sm text-weight-medium text-grey-7">รอบ</div>
|
||||
<q-select
|
||||
borderless
|
||||
dense
|
||||
v-model="round"
|
||||
:options="optionRound"
|
||||
map-options
|
||||
emit-value
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
@update:model-value="changround"
|
||||
/>
|
||||
|
||||
<q-space />
|
||||
|
||||
<!-- อัปเดตข้อมูลคุณสมบัติ -->
|
||||
<q-btn
|
||||
v-if="
|
||||
((DataStore.isOfficer && DataStore.optionsTypeOc.findIndex(
|
||||
(v: OptionData) => v.id === DataStore.selectOrganization && v.isDeputy === true) > -1) || DataStore.isStaff) &&
|
||||
DataStore.isLock !== true && (requestStatus == 'st1' || requestStatus == 'st4') &&
|
||||
checkPermission($route)?.attrIsUpdate
|
||||
"
|
||||
dense
|
||||
unelevated
|
||||
label="อัปเดตข้อมูลคุณสมบัติ"
|
||||
color="info"
|
||||
class="q-px-md q-ml-sm"
|
||||
@click="updateDataProperty"
|
||||
>
|
||||
<q-tooltip>อัปเดตข้อมูลคุณสมบัติ</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div v-if="DataStore.isOfficer" class="col-12 row bg-white">
|
||||
<div class="fit q-px-md q-py-sm">
|
||||
<div class="row col-12 q-col-gutter-sm fit">
|
||||
<!-- stat -->
|
||||
<cardTop
|
||||
:amount="stat.orgAllCount"
|
||||
label="หน่วยงานทั้งหมด"
|
||||
color="#016987"
|
||||
/>
|
||||
<cardTop
|
||||
:amount="stat.orgSendCount"
|
||||
label="หน่วยงานที่ส่งรายชื่อเเล้ว"
|
||||
color="#02A998"
|
||||
/>
|
||||
<cardTop
|
||||
:amount="stat.orgNoSendCount"
|
||||
label="หน่วยงานที่ยังไม่ได้ส่งรายชื่อ"
|
||||
color="#2EA0FF"
|
||||
/>
|
||||
<cardTop
|
||||
:amount="stat.allUserUser"
|
||||
label="จำนวนคนที่ยื่นขอ"
|
||||
color="#4154B3"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<q-card v-else>
|
||||
<div class="q-pa-md q-gutter-sm">
|
||||
<q-banner inline-actions rounded class="bg-grey-1 text-center">
|
||||
ไม่มีข้อมูลรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์
|
||||
</q-banner>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<q-card
|
||||
flat
|
||||
bordered
|
||||
class="col-12 q-mt-sm"
|
||||
v-if="
|
||||
loadview &&
|
||||
(DataStore.isDirector || DataStore.isOfficer || DataStore.isStaff)
|
||||
"
|
||||
>
|
||||
<div
|
||||
v-if="
|
||||
(((DataStore.isOfficer && DataStore.optionsTypeOc.findIndex((v: OptionData) => v.id === DataStore.selectOrganization && v.isDeputy === true) > -1) || DataStore.isStaff) && requestStatus == 'st4') ||
|
||||
(DataStore.isDirector && requestStatus == 'st5')
|
||||
"
|
||||
class="q-pa-md q-gutter-sm"
|
||||
>
|
||||
<q-banner
|
||||
inline-actions
|
||||
bordered
|
||||
class="bg-orange-1 text-orange border-orange"
|
||||
>
|
||||
<q-icon name="mdi-information-outline" size="20px" /> หมายเหตุ ตีกลับ
|
||||
{{ requestNote }}
|
||||
</q-banner>
|
||||
</div>
|
||||
|
||||
<q-tabs
|
||||
v-model="tab"
|
||||
dense
|
||||
class="text-grey"
|
||||
active-color="primary"
|
||||
active-class="bg-teal-1"
|
||||
indicator-color="primary"
|
||||
align="left"
|
||||
>
|
||||
<q-tab name="pending" label="ผู้มีคุณสมบัติ" />
|
||||
<q-tab name="delete" label="ผู้ขาดคุณสมบัติ" />
|
||||
<q-tab name="reject" label="ผู้ไม่เสนอขอ" />
|
||||
<q-tab
|
||||
v-if="DataStore.isOfficer"
|
||||
name="organization"
|
||||
label="หน่วยงานที่ยังไม่ได้ส่งรายชื่อ"
|
||||
/>
|
||||
</q-tabs>
|
||||
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<q-tab-panels v-model="tab" animated>
|
||||
<!-- แทบคนที่ยื่นขอ -->
|
||||
<q-tab-panel name="pending" class="q-pa-none">
|
||||
<tab1
|
||||
:tab="tab"
|
||||
:round-id="round"
|
||||
:round-name="roundName"
|
||||
:fecth-insignia-by-oc="fecthInsigniaByOc"
|
||||
:request-status="requestStatus"
|
||||
:fecth-stat="fecthStat"
|
||||
/>
|
||||
</q-tab-panel>
|
||||
|
||||
<!-- แทบคนที่ไม่ยื่นขอ -->
|
||||
<q-tab-panel name="reject" class="q-pa-none">
|
||||
<tab2
|
||||
:tab="tab"
|
||||
:round-id="round"
|
||||
:fecth-insignia-by-oc="fecthInsigniaByOc"
|
||||
/>
|
||||
</q-tab-panel>
|
||||
|
||||
<!-- แทบคนที่ถูกลบออก -->
|
||||
<q-tab-panel name="delete" class="q-pa-none">
|
||||
<tab3
|
||||
:tab="tab"
|
||||
:round-id="round"
|
||||
:fecth-insignia-by-oc="fecthInsigniaByOc"
|
||||
/>
|
||||
</q-tab-panel>
|
||||
|
||||
<!-- แทบหน่วยงานที่ยังไม่ได้ส่งรายชื่อ -->
|
||||
<q-tab-panel
|
||||
v-if="DataStore.isOfficer"
|
||||
name="organization"
|
||||
class="q-pa-none"
|
||||
>
|
||||
<tab4 :tab="tab" :round-id="round" />
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
|
||||
<q-toolbar class="q-py-md text-right">
|
||||
<q-file
|
||||
v-if="((DataStore.isOfficer && DataStore.optionsTypeOc.findIndex((v: OptionData) => v.id === DataStore.selectOrganization && v.isDeputy === true) > -1) || DataStore.isStaff) && checkPermission($route)?.attrIsUpdate"
|
||||
bg-color="white"
|
||||
clearable
|
||||
outlined
|
||||
dense
|
||||
v-model="fileUpload"
|
||||
accept=".pdf"
|
||||
:style="fileUpload === null ? 'width: 250px' : 'width: auto'"
|
||||
label="อัปโหลดไฟล์"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon color="light-blue" name="attach_file" />
|
||||
<q-tooltip>อัปโหลดไฟล์</q-tooltip>
|
||||
</template>
|
||||
</q-file>
|
||||
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="light-blue"
|
||||
icon="upload"
|
||||
@click="uploadFile(fileUpload)"
|
||||
v-if="fileUpload !== null"
|
||||
/>
|
||||
<div v-if="document">
|
||||
<q-btn
|
||||
size="md"
|
||||
icon="mdi-download"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
:href="document"
|
||||
target="_blank"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-else-if="checkPermission($route)?.attrIsGet"
|
||||
color="primary"
|
||||
icon-right="mdi-download"
|
||||
label="ดาวน์โหลดไฟล์"
|
||||
outline
|
||||
:href="document"
|
||||
target="_blank"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
<q-space />
|
||||
|
||||
<q-btn
|
||||
v-if="
|
||||
!DataStore.isLock &&
|
||||
((DataStore.isOfficer && DataStore.optionsTypeOc.findIndex(
|
||||
(v: OptionData) => v.id === DataStore.selectOrganization && v.isDeputy === true) > -1) || DataStore.isStaff) &&
|
||||
(requestStatus == 'st1' || requestStatus == 'st4') &&
|
||||
checkPermission($route)?.attrIsUpdate
|
||||
"
|
||||
unelevated
|
||||
label="บันทึกข้อมูล"
|
||||
color="public"
|
||||
class="q-px-md"
|
||||
@click="sendToDirector"
|
||||
/>
|
||||
<q-btn
|
||||
v-if="
|
||||
!DataStore.isLock &&
|
||||
DataStore.isDirector &&
|
||||
(requestStatus == 'st3' || requestStatus == 'st5') &&
|
||||
checkPermission($route)?.attrIsUpdate
|
||||
"
|
||||
unelevated
|
||||
label="ตีกลับ"
|
||||
color="orange"
|
||||
class="q-px-md"
|
||||
@click="popupBackToEdit"
|
||||
/>
|
||||
<q-btn
|
||||
v-if="
|
||||
!DataStore.isLock &&
|
||||
DataStore.isDirector &&
|
||||
requestStatus == 'st3' &&
|
||||
checkPermission($route)?.attrIsUpdate
|
||||
"
|
||||
unelevated
|
||||
label="อนุมัติ"
|
||||
color="positive"
|
||||
class="q-px-md q-ml-md"
|
||||
@click="directorApproved"
|
||||
/>
|
||||
<q-btn
|
||||
v-if="
|
||||
!DataStore.isLock &&
|
||||
requestStatus == 'st6' &&
|
||||
DataStore.isOfficer &&
|
||||
!DataStore.isLock &&
|
||||
checkPermission($route)?.attrIsUpdate
|
||||
"
|
||||
unelevated
|
||||
label="ตีกลับ"
|
||||
color="orange"
|
||||
class="q-px-md"
|
||||
@click="popupBackToInsignia2Role"
|
||||
/>
|
||||
</q-toolbar>
|
||||
</q-card>
|
||||
|
||||
<!-- popup หมายเหตุ -->
|
||||
<DialogPopupReason
|
||||
v-model:modal="modalPopupBackToEdit"
|
||||
title="หมายเหตุการตีกลับ"
|
||||
label="หมายเหตุ"
|
||||
:savaForm="backToEdit"
|
||||
/>
|
||||
<DialogPopupReason
|
||||
v-model:modal="modalbackInsignia2Role"
|
||||
title="หมายเหตุการตีกลับ"
|
||||
label="หมายเหตุ"
|
||||
:savaForm="backToEditinsignia2Role"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scope>
|
||||
.border-orange {
|
||||
border: 1px solid #ffa800;
|
||||
border-radius: 5px;
|
||||
}
|
||||
</style>
|
||||
1112
src/modules/07_insignia/views/09_ResultMainEmp.vue
Normal file
1112
src/modules/07_insignia/views/09_ResultMainEmp.vue
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -2,7 +2,11 @@
|
|||
import { ref, onMounted, reactive, watch } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRouter } from "vue-router";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import {
|
||||
checkPermission,
|
||||
checkPermissionList,
|
||||
checkPermissionCreate,
|
||||
} from "@/utils/permissions";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRegistryEmp } from "@/modules/08_registryEmployee/stores/registry-employee";
|
||||
import http from "@/plugins/http";
|
||||
|
|
@ -318,7 +322,11 @@ onMounted(async () => {
|
|||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
checkPermissionList(['COMMAND']) &&
|
||||
checkPermissionCreate('COMMAND')
|
||||
"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
});
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue