แก้ไข ui pop up อนุมัติคำขอ

This commit is contained in:
AnandaTon 2023-11-06 17:49:30 +07:00
parent 61026107cd
commit 288fad12e1
5 changed files with 80 additions and 79 deletions

View file

@ -4,6 +4,7 @@ import type { QTableProps } from "quasar";
import type { DataRows } from "@/modules/09_leave/interface/response/specialTime";
import type { ListData } from "@/modules/09_leave/interface/request/specialTime";
import { useCounterMixin } from "@/stores/mixin";
import type { DataOption } from "@/modules/09_leave/interface/index/Main";
const mixin = useCounterMixin();
const { date2Thai } = mixin;
@ -16,7 +17,7 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
let datalist: DataRows[] = data.map((e: ListData) => ({
id: e.id,
fullname: e.fullname,
date: date2Thai(new Date(e.date)),
date: date2Thai(new Date(e.date), false, true),
dateFix: date2Thai(new Date(e.dateFix)),
timeMorning:
e.startTimeMorning == null
@ -31,6 +32,8 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
startTimeAfternoon: e.startTimeAfternoon,
endTimeAfternoon: e.endTimeAfternoon,
status: e.status,
checkInStatus: convertStatus(e.checkInStatus),
checkOutStatus: convertStatus(e.checkOutStatus),
}));
rows.value = datalist;
DataMainOrig.value = datalist;
@ -43,6 +46,8 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
DataMainUpdate.value = DataMainOrig.value;
}
};
const checkInStatus = ref<String>("ปกติ");
const checkOutStatus = ref<String>("ปกติ");
//--------------|ฟิลเตอร์|--------------------------------------//
const searchFilterTable = async (searchDate: any) => {
@ -68,6 +73,11 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
rows.value = dataArr;
}
};
const optionStatus = ref<DataOption[]>([
{ id: "0", name: "ปกติ" },
{ id: "1", name: "สาย" },
{ id: "2", name: "ขาดราชการ" },
]);
// const filterSelector = (val: any, update: Function, refData: string) => {
// switch (refData) {
@ -150,6 +160,18 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
},
]);
// convertSatatus
function convertStatus(val: string) {
switch (val) {
case "normal":
return "ปกติ";
case "late":
return "สาย";
case "absent":
return "ขาดราชการ";
}
}
return {
fecthList,
rows,
@ -158,5 +180,8 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
DataMain,
searchFilterTable,
selectDate,
checkInStatus,
checkOutStatus,
optionStatus,
};
});