diff --git a/src/modules/09_leave/components/4_specialTime/DialogApprove.vue b/src/modules/09_leave/components/4_specialTime/DialogApprove.vue index 546748699..ab93f817b 100644 --- a/src/modules/09_leave/components/4_specialTime/DialogApprove.vue +++ b/src/modules/09_leave/components/4_specialTime/DialogApprove.vue @@ -16,8 +16,8 @@ const { dialogConfirm, date2Thai } = mixin; const currentDate = ref(new Date()); const startTimeMorningRef = ref(null); const endTimeMorningRef = ref(null); -const startTimeAfternoonRef = ref(null); -const endTimeAfternoonRef = ref(null); +const checkInStatusRef = ref(null); +const checkOutStatusRef = ref(null); const formData = reactive({ startTimeMorning: "", @@ -25,13 +25,15 @@ const formData = reactive({ startTimeAfternoon: "", endTimeAfternoon: "", note: "", + checkInStatus: "", + checkOutStatus: "", }); const objectRound: MyObjectRoundRef = { startTimeMorning: startTimeMorningRef, endTimeMorning: endTimeMorningRef, - startTimeAfternoon: startTimeAfternoonRef, - endTimeAfternoon: endTimeAfternoonRef, + checkInStatus: checkInStatusRef, + checkOutStatus: checkOutStatusRef, }; function validateForm() { @@ -169,11 +171,6 @@ watch( - -
-

ครึ่งเช้า

เวลาเข้างาน

-

ครึ่งบ่าย

+

สถานะเข้างาน

-

เวลาเข้างาน

- + dense + v-model="SpecialTimeStore.checkInStatus" + :options="SpecialTimeStore.optionStatus" + option-value="id" + option-label="name" + label="สถานะ" + use-input + > +
- -
-

เวลาออกงาน

- + +
+

สถานะออกงาน

+
+ + dense + v-model="SpecialTimeStore.checkOutStatus" + :options="SpecialTimeStore.optionStatus" + option-value="id" + option-label="name" + label="สถานะ" + use-input + > +
{ 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("ปกติ"); + const checkOutStatus = ref("ปกติ"); //--------------|ฟิลเตอร์|--------------------------------------// const searchFilterTable = async (searchDate: any) => { @@ -68,6 +73,11 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => { rows.value = dataArr; } }; + const optionStatus = ref([ + { 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, }; }); diff --git a/src/modules/09_leave/views/SpecialTimeMain.vue b/src/modules/09_leave/views/SpecialTimeMain.vue index e5500531d..c64a61901 100644 --- a/src/modules/09_leave/views/SpecialTimeMain.vue +++ b/src/modules/09_leave/views/SpecialTimeMain.vue @@ -74,6 +74,8 @@ onMounted(async () => { startTimeAfternoon: "08:00", endTimeAfternoon: "12:00", status: "PENDING", + checkInStatus: "normal", + checkOutStatus: "late", }, { id: "00000000-0000-0000-0000-000000000000", @@ -85,6 +87,8 @@ onMounted(async () => { startTimeAfternoon: null, endTimeAfternoon: null, status: "APPROVE", + checkInStatus: "normal", + checkOutStatus: "late", }, { id: "00000000-0000-0000-0000-000000000000", @@ -96,6 +100,8 @@ onMounted(async () => { startTimeAfternoon: "13:00", endTimeAfternoon: "16:30", status: "REJECT", + checkInStatus: "normal", + checkOutStatus: "late", }, ]); });