feat: เพิ่ม แก้ไขรอบการปฏิบัติงานของลูกจ้าง

This commit is contained in:
setthawutttty 2025-07-11 14:18:52 +07:00
parent 8d42f39bb5
commit cb65cdb737
5 changed files with 438 additions and 11 deletions

View file

@ -123,11 +123,15 @@ export const useChangeRoundDataStore = defineStore(
const maxPageMain = ref<number>(0);
const totalListMain = ref<number>(0);
async function fetchDataForCardId(dataDetail: any) {
async function fetchDataForCardId(dataDetail: any, type?: string) {
if (dataDetail) {
showLoader();
const url =
type && type == "emp"
? config.API.leaveSearchEMP()
: config.API.leaveSearch();
await http
.post(config.API.leaveSearch(), {
.post(url, {
citizenId: dataDetail.cardId.trim() || "", //เลขประจำตัวประชาชน
firstname: dataDetail.firstName.trim() || "", //ชื่อจริง
lastname: dataDetail.lastName.trim() || "", //นามสกุล
@ -180,18 +184,26 @@ export const useChangeRoundDataStore = defineStore(
* @param pageVal page
* @param pageSizeVal pagesize
*/
async function changePage(pageVal: number, pageSizeVal: number) {
async function changePage(
pageVal: number,
pageSizeVal: number,
type?: string
) {
page.value = pageVal;
pageSize.value = pageSizeVal;
fetchDatainHistory();
fetchDatainHistory(type);
}
/**ฟังก์ชั่นดึงดาต้าประวัติ */
async function fetchDatainHistory() {
async function fetchDatainHistory(type?: string) {
rowsHistory.value = [];
showLoader();
const url =
type == "emp"
? config.API.leaveRoundByIdEMP(profileId.value)
: config.API.leaveRoundById(profileId.value);
await http
.get(
config.API.leaveRoundById(profileId.value) +
url +
`?page=${page.value}&pageSize=${pageSize.value}&keyword=${filter.value}`
)
.then((res) => {
@ -237,7 +249,7 @@ export const useChangeRoundDataStore = defineStore(
totalListMain,
maxPageMain,
roundOp,
roundOpMain
roundOpMain,
};
}
);