API รายการลา
This commit is contained in:
parent
6d12f50399
commit
035696b5b0
18 changed files with 273 additions and 196 deletions
|
|
@ -134,8 +134,7 @@ async function fetchListTimeRecord() {
|
||||||
await http
|
await http
|
||||||
.get(
|
.get(
|
||||||
config.API.timeRecord() +
|
config.API.timeRecord() +
|
||||||
`?startDate=${querySting.startDate}&endDate=${querySting.startDate}
|
`?startDate=${querySting.startDate}&endDate=${querySting.startDate}&status=${querySting.status}&page=${querySting.page}&pageSize=${querySting.pageSize}&keyword=${querySting.keyword}`
|
||||||
&status=${querySting.status}&page=${querySting.page}&pageSize=${querySting.pageSize}&keyword=${querySting.keyword}`
|
|
||||||
)
|
)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value);
|
maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value);
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,9 @@
|
||||||
import { ref, reactive, onMounted } from "vue";
|
import { ref, reactive, onMounted } from "vue";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
import http from "@/plugins/http";
|
||||||
|
import config from "@/app.config";
|
||||||
|
|
||||||
/** importStore */
|
/** importStore */
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useLeavelistDataStore } from "@/modules/09_leave/stores/LeaveStore";
|
import { useLeavelistDataStore } from "@/modules/09_leave/stores/LeaveStore";
|
||||||
|
|
@ -11,6 +14,7 @@ const APIDATA = useLeavelistDataStoreTest();
|
||||||
|
|
||||||
/** importType */
|
/** importType */
|
||||||
import type { FremData } from "@/modules/09_leave/interface/request/leave";
|
import type { FremData } from "@/modules/09_leave/interface/request/leave";
|
||||||
|
import type { LeaveType } from "@/modules/09_leave/interface/response/leave";
|
||||||
|
|
||||||
/** importForm*/
|
/** importForm*/
|
||||||
import FormMain from "@/modules/09_leave/components/2_Leave/formDetail/formMain.vue"; // from ซ้าย
|
import FormMain from "@/modules/09_leave/components/2_Leave/formDetail/formMain.vue"; // from ซ้าย
|
||||||
|
|
@ -18,7 +22,7 @@ import FormLeave from "@/modules/09_leave/components/2_Leave/formDetail/formLeav
|
||||||
import FormChildbirth from "@/modules/09_leave/components/2_Leave/formDetail/formChildbirth.vue"; // ลาไปช่วยเหลือภริยาที่คลอดบุตร
|
import FormChildbirth from "@/modules/09_leave/components/2_Leave/formDetail/formChildbirth.vue"; // ลาไปช่วยเหลือภริยาที่คลอดบุตร
|
||||||
import FormHoliday from "@/modules/09_leave/components/2_Leave/formDetail/formHoliday.vue"; //ลาพักผ่อน
|
import FormHoliday from "@/modules/09_leave/components/2_Leave/formDetail/formHoliday.vue"; //ลาพักผ่อน
|
||||||
import FormUpasom from "@/modules/09_leave/components/2_Leave/formDetail/formUpasom.vue"; // ลาอุปสมบท
|
import FormUpasom from "@/modules/09_leave/components/2_Leave/formDetail/formUpasom.vue"; // ลาอุปสมบท
|
||||||
import FormHajj from "@/modules/09_leave/components/2_Leave/formDetail/formHajj.vue"; //ลาประกอบพิธีฮัจย์
|
import FormHajj from "@/modules/09_leave/components/2_Leave/formDetail/formHajj.vue"; //ลาประกอบพิธีฮัจญ์
|
||||||
import FormCheckSelect from "@/modules/09_leave/components/2_Leave/formDetail/formCheckSelect.vue"; //ลาเข้ารับการตรวจเลือกหรือเข้ารับการเตรียมพล
|
import FormCheckSelect from "@/modules/09_leave/components/2_Leave/formDetail/formCheckSelect.vue"; //ลาเข้ารับการตรวจเลือกหรือเข้ารับการเตรียมพล
|
||||||
import FormStudy from "@/modules/09_leave/components/2_Leave/formDetail/formStudy.vue"; //ลาไปศึกษา
|
import FormStudy from "@/modules/09_leave/components/2_Leave/formDetail/formStudy.vue"; //ลาไปศึกษา
|
||||||
import FormLeaveToTraining from "@/modules/09_leave/components/2_Leave/formDetail/formLeaveToTraining.vue"; // ลาไปฝึกอบรม ปฏิบัติการวิจัย หรือดูงาน
|
import FormLeaveToTraining from "@/modules/09_leave/components/2_Leave/formDetail/formLeaveToTraining.vue"; // ลาไปฝึกอบรม ปฏิบัติการวิจัย หรือดูงาน
|
||||||
|
|
@ -29,7 +33,8 @@ import FormVocationalRehabilitation from "@/modules/09_leave/components/2_Leave/
|
||||||
/** use */
|
/** use */
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { dialogConfirm, showLoader, hideLoader, date2Thai } = mixin;
|
const { dialogConfirm, showLoader, hideLoader, date2Thai, messageError } =
|
||||||
|
mixin;
|
||||||
const stores = useLeavelistDataStore();
|
const stores = useLeavelistDataStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
@ -61,7 +66,7 @@ const formData = reactive<FremData>({
|
||||||
organizationName: "", //สังกัดผู้ยื่นขอ
|
organizationName: "", //สังกัดผู้ยื่นขอ
|
||||||
leaveTypeName: "", // Name ประเภทการลา
|
leaveTypeName: "", // Name ประเภทการลา
|
||||||
leaveTypeId: "", //Id ประเภทการลา
|
leaveTypeId: "", //Id ประเภทการลา
|
||||||
fullname: "", //คำนำหน้า ชื่อ นามสกุล คนขอลา
|
fullName: "", //คำนำหน้า ชื่อ นามสกุล คนขอลา
|
||||||
dateSendLeave: new Date(), // วันที่ยื่นใบลา
|
dateSendLeave: new Date(), // วันที่ยื่นใบลา
|
||||||
leaveDateStart: new Date(), //วันเริ่มการลา
|
leaveDateStart: new Date(), //วันเริ่มการลา
|
||||||
leaveDateEnd: new Date(), //วันสิ้นสุดการลา
|
leaveDateEnd: new Date(), //วันสิ้นสุดการลา
|
||||||
|
|
@ -97,7 +102,7 @@ const formData = reactive<FremData>({
|
||||||
ordainDayOrdination: new Date(), //สถานที่บวช วันอุปสมบท(ลาอุปสมบท)
|
ordainDayOrdination: new Date(), //สถานที่บวช วันอุปสมบท(ลาอุปสมบท)
|
||||||
ordainDayBuddhistLentName: "", //สถานที่จำพรรษา ชื่อวัด(ลาอุปสมบท)
|
ordainDayBuddhistLentName: "", //สถานที่จำพรรษา ชื่อวัด(ลาอุปสมบท)
|
||||||
ordainDayBuddhistLentAddress: "", //สถานที่จำพรรษา ที่อยู่(ลาอุปสมบท)
|
ordainDayBuddhistLentAddress: "", //สถานที่จำพรรษา ที่อยู่(ลาอุปสมบท)
|
||||||
hajjDayStatus: false, //เคย/ไม่เคยไปประกอบพิธีฮัจย์ (ให้เลือก) (ลาประกอบพิธีฮัจย์)
|
hajjDayStatus: false, //เคย/ไม่เคยไปประกอบพิธีฮัจญ์ (ให้เลือก) (ลาประกอบพิธีฮัจญ์)
|
||||||
absentDaySummon: "", //ได้รับหมายเรียกของ (ลาเข้ารับการตรวจเลือกหรือเข้ารับการเตรียมพล)
|
absentDaySummon: "", //ได้รับหมายเรียกของ (ลาเข้ารับการตรวจเลือกหรือเข้ารับการเตรียมพล)
|
||||||
absentDayLocation: "", //ที่ (ลาเข้ารับการตรวจเลือกหรือเข้ารับการเตรียมพล)
|
absentDayLocation: "", //ที่ (ลาเข้ารับการตรวจเลือกหรือเข้ารับการเตรียมพล)
|
||||||
absentDayRegistorDate: new Date(), //ลงวันที่ (ลาเข้ารับการตรวจเลือกหรือเข้ารับการเตรียมพล)
|
absentDayRegistorDate: new Date(), //ลงวันที่ (ลาเข้ารับการตรวจเลือกหรือเข้ารับการเตรียมพล)
|
||||||
|
|
@ -122,10 +127,10 @@ const formData = reactive<FremData>({
|
||||||
step: "",
|
step: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
// showLoader();
|
// showLoader();
|
||||||
if (paramsId) {
|
if (paramsId) {
|
||||||
fetchDetailLeave(paramsId);
|
await fetchDetailLeave(paramsId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -133,90 +138,117 @@ onMounted(() => {
|
||||||
* Function fetch รายละเอียดของข้อมูล
|
* Function fetch รายละเอียดของข้อมูล
|
||||||
* @param paramsId รับ ID จาก paramID
|
* @param paramsId รับ ID จาก paramID
|
||||||
*/
|
*/
|
||||||
function fetchDetailLeave(paramsId: string) {
|
async function fetchDetailLeave(paramsId: string) {
|
||||||
const dataAPI = APIDATA.data;
|
showLoader();
|
||||||
const data = dataAPI.filter((e: any) => e.id === paramsId);
|
await http
|
||||||
console.log(data);
|
.get(config.API.leaveListById(paramsId))
|
||||||
data.map((e: any) => {
|
.then(async (res) => {
|
||||||
formData.id = e.id;
|
console.log(res);
|
||||||
formData.reasonCommander = e.reasonCommander;
|
const data = res.data.result;
|
||||||
formData.reasonOligarch = e.reasonOligarch;
|
console.log(data);
|
||||||
formData.positionName = e.positionName;
|
formData.id = data.id;
|
||||||
formData.positionLevelName = e.positionLevelName;
|
formData.reasonCommander = data.reasonCommander;
|
||||||
formData.organizationName = e.organizationName;
|
formData.reasonOligarch = data.reasonOligarch;
|
||||||
formData.leaveTypeName = e.leaveTypeName
|
formData.positionName = data.positionName;
|
||||||
? e.leaveTypeName
|
formData.positionLevelName = data.positionLevelName;
|
||||||
: stores.convertLeave(e.leaveTypeId);
|
formData.organizationName = data.organizationName;
|
||||||
formData.leaveTypeId = e.leaveTypeId;
|
formData.leaveTypeName = data.leaveTypeName;
|
||||||
formData.fullname = e.fullname;
|
formData.leaveTypeId = data.leaveTypeId;
|
||||||
formData.dateSendLeave = e.dateSendLeave && date2Thai(e.dateSendLeave);
|
formData.fullName = data.fullName;
|
||||||
formData.leaveDateStart = e.leaveDateStart && date2Thai(e.leaveDateStart);
|
formData.dateSendLeave =
|
||||||
formData.leaveDateEnd = e.leaveDateEnd && date2Thai(e.leaveDateEnd);
|
data.dateSendLeave && date2Thai(data.dateSendLeave);
|
||||||
formData.leaveCount = e.leaveCount;
|
formData.leaveDateStart =
|
||||||
formData.status = e.status && e.status;
|
data.leaveStartDate && date2Thai(data.leaveStartDate);
|
||||||
formData.leaveLimit = e.leaveLimit;
|
formData.leaveDateEnd = data.leaveEndDate && date2Thai(data.leaveEndDate);
|
||||||
formData.leaveSummary = e.leaveSummary;
|
formData.leaveCount = data.leaveCount;
|
||||||
formData.leaveRemain = e.leaveRemain;
|
formData.status = data.status && data.status;
|
||||||
formData.leaveWrote = e.leaveWrote;
|
formData.leaveLimit = data.leaveLimit;
|
||||||
formData.leaveAddress = e.leaveAddress;
|
formData.leaveSummary = data.leaveSummary;
|
||||||
formData.leaveNumber = e.leaveNumber;
|
formData.leaveRemain = data.leaveRemain;
|
||||||
formData.leaveDetail = e.leaveDetail;
|
formData.leaveWrote = data.leaveWrote;
|
||||||
formData.leaveDocument = e.leaveDocument;
|
formData.leaveAddress = data.leaveAddress;
|
||||||
formData.leaveDraftDocument = e.leaveDraftDocument;
|
formData.leaveNumber = data.leaveNumber;
|
||||||
formData.leaveLastStart = e.leaveLastStart && date2Thai(e.leaveLastStart);
|
formData.leaveDetail = data.leaveDetail;
|
||||||
formData.leaveLastEnd = e.leaveLastStart && date2Thai(e.leaveLastEnd);
|
formData.leaveDocument = data.leaveDocument;
|
||||||
formData.leaveTotal = e.leaveTotal;
|
formData.leaveDraftDocument = data.leaveDraftDocument;
|
||||||
formData.leavebirthDate = e.leavebirthDate && date2Thai(e.leavebirthDate);
|
formData.leaveLastStart =
|
||||||
formData.leavegovernmentDate =
|
data.leaveLastStart && date2Thai(data.leaveLastStart);
|
||||||
e.leavegovernmentDate && date2Thai(e.leavegovernmentDate);
|
formData.leaveLastEnd =
|
||||||
formData.leaveSalary = e.leaveSalary;
|
data.leaveLastStart && date2Thai(data.leaveLastEnd);
|
||||||
formData.leaveSalaryText = e.leaveSalaryText;
|
formData.leaveTotal = data.leaveTotal;
|
||||||
formData.leaveTypeDay =
|
formData.leavebirthDate =
|
||||||
e.leaveTypeDay && stores.convertLeaveDaytype(e.leaveTypeDay);
|
data.leavebirthDate && date2Thai(data.leavebirthDate);
|
||||||
formData.wifeDayName = e.wifeDayName;
|
formData.leavegovernmentDate =
|
||||||
formData.wifeDayDateBorn =
|
data.leavegovernmentDate && date2Thai(data.leavegovernmentDate);
|
||||||
e.wifeDayDateBorn && date2Thai(e.wifeDayDateBorn);
|
formData.leaveSalary = data.leaveSalary;
|
||||||
formData.restDayOldTotal = e.restDayOldTotal;
|
formData.leaveSalaryText = data.leaveSalaryText;
|
||||||
formData.restDayCurrentTotal = e.restDayCurrentTotal;
|
formData.leaveTypeDay =
|
||||||
formData.ordainDayStatus = e.ordainDayStatus;
|
data.leaveTypeDay && stores.convertLeaveDaytype(data.leaveTypeDay);
|
||||||
formData.ordainDayLocationName = e.ordainDayLocationName;
|
formData.wifeDayName = data.wifeDayName;
|
||||||
formData.ordainDayLocationAddress = e.ordainDayLocationAddress;
|
formData.wifeDayDateBorn =
|
||||||
formData.ordainDayLocationNumber = e.ordainDayLocationNumber;
|
data.wifeDayDateBorn && date2Thai(data.wifeDayDateBorn);
|
||||||
formData.ordainDayOrdination =
|
formData.restDayOldTotal = data.restDayOldTotal;
|
||||||
e.ordainDayOrdination && date2Thai(e.ordainDayOrdination);
|
formData.restDayCurrentTotal = data.restDayCurrentTotal;
|
||||||
formData.ordainDayBuddhistLentName = e.ordainDayBuddhistLentName;
|
formData.ordainDayStatus = data.ordainDayStatus;
|
||||||
formData.ordainDayBuddhistLentAddress = e.ordainDayBuddhistLentAddress;
|
formData.ordainDayLocationName = data.ordainDayLocationName;
|
||||||
formData.hajjDayStatus = e.hajjDayStatus;
|
formData.ordainDayLocationAddress = data.ordainDayLocationAddress;
|
||||||
formData.absentDaySummon = e.absentDaySummon;
|
formData.ordainDayLocationNumber = data.ordainDayLocationNumber;
|
||||||
formData.absentDayLocation = e.absentDayLocation;
|
formData.ordainDayOrdination =
|
||||||
formData.absentDayRegistorDate =
|
data.ordainDayOrdination && date2Thai(data.ordainDayOrdination);
|
||||||
e.absentDayRegistorDate && date2Thai(e.absentDayRegistorDate);
|
formData.ordainDayBuddhistLentName = data.ordainDayBuddhistLentName;
|
||||||
formData.absentDayGetIn = e.absentDayGetIn;
|
formData.ordainDayBuddhistLentAddress = data.ordainDayBuddhistLentAddress;
|
||||||
formData.absentDayAt = e.absentDayAt;
|
formData.hajjDayStatus = data.hajjDayStatus;
|
||||||
formData.studyDaySubject = e.studyDaySubject;
|
formData.absentDaySummon = data.absentDaySummon;
|
||||||
formData.studyDayDegreeLevel = e.studyDayDegreeLevel;
|
formData.absentDayLocation = data.absentDayLocation;
|
||||||
formData.studyDayUniversityName = e.studyDayUniversityName;
|
formData.absentDayRegistorDate =
|
||||||
formData.studyDayTrainingSubject = e.studyDayTrainingSubject;
|
data.absentDayRegistorDate && date2Thai(data.absentDayRegistorDate);
|
||||||
formData.studyDayTrainingName = e.studyDayTrainingName;
|
formData.absentDayGetIn = data.absentDayGetIn;
|
||||||
formData.studyDayCountry = e.studyDayCountry;
|
formData.absentDayAt = data.absentDayAt;
|
||||||
formData.studyDayScholarship = e.studyDayScholarship;
|
formData.studyDaySubject = data.studyDaySubject;
|
||||||
formData.coupleDayName = e.coupleDayName;
|
formData.studyDayDegreeLevel = data.studyDayDegreeLevel;
|
||||||
formData.coupleDayPosition = e.coupleDayPosition;
|
formData.studyDayUniversityName = data.studyDayUniversityName;
|
||||||
formData.coupleDayLevel = e.coupleDayLevel;
|
formData.studyDayTrainingSubject = data.studyDayTrainingSubject;
|
||||||
formData.coupleDayLevelCountry = e.coupleDayLevelCountry;
|
formData.studyDayTrainingName = data.studyDayTrainingName;
|
||||||
formData.coupleDayCountryHistory = e.coupleDayCountryHistory;
|
formData.studyDayCountry = data.studyDayCountry;
|
||||||
formData.coupleDayTotalHistory = e.coupleDayTotalHistory;
|
formData.studyDayScholarship = data.studyDayScholarship;
|
||||||
formData.coupleDayStartDateHistory =
|
formData.coupleDayName = data.coupleDayName;
|
||||||
e.coupleDayStartDateHistory && date2Thai(e.coupleDayStartDateHistory);
|
formData.coupleDayPosition = data.coupleDayPosition;
|
||||||
formData.coupleDayEndDateHistory =
|
formData.coupleDayLevel = data.coupleDayLevel;
|
||||||
e.coupleDayEndDateHistory && date2Thai(e.coupleDayEndDateHistory);
|
formData.coupleDayLevelCountry = data.coupleDayLevelCountry;
|
||||||
formData.coupleDaySumTotalHistory = e.coupleDaySumTotalHistory;
|
formData.coupleDayCountryHistory = data.coupleDayCountryHistory;
|
||||||
formData.step = e.step;
|
formData.coupleDayTotalHistory = data.coupleDayTotalHistory;
|
||||||
});
|
formData.coupleDayStartDateHistory =
|
||||||
|
data.coupleDayStartDateHistory &&
|
||||||
|
date2Thai(data.coupleDayStartDateHistory);
|
||||||
|
formData.coupleDayEndDateHistory =
|
||||||
|
data.coupleDayEndDateHistory && date2Thai(data.coupleDayEndDateHistory);
|
||||||
|
formData.coupleDaySumTotalHistory = data.coupleDaySumTotalHistory;
|
||||||
|
formData.step = data.step;
|
||||||
|
await fectOptionType();
|
||||||
|
|
||||||
/** ส่งประเภทของการลาไป Function เช็คประเภทการลา*/
|
/** ส่งประเภทของการลาไป Function เช็คประเภทการลา*/
|
||||||
checkLeaveType(formData.leaveTypeId ? formData.leaveTypeId : "");
|
})
|
||||||
// hideLoader();
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const leaveType = ref<LeaveType[]>();
|
||||||
|
/** function เรียกประเภทการลา */
|
||||||
|
async function fectOptionType() {
|
||||||
|
await http
|
||||||
|
.get(config.API.leaveType())
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
leaveType.value = res.data.result;
|
||||||
|
checkLeaveType(formData.leaveTypeId, formData.leaveTypeName);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
/**Status Form การลา*/
|
/**Status Form การลา*/
|
||||||
const checkForm = ref<string>("");
|
const checkForm = ref<string>("");
|
||||||
|
|
@ -224,29 +256,35 @@ const checkForm = ref<string>("");
|
||||||
* Function เช็คประเภทการลา
|
* Function เช็คประเภทการลา
|
||||||
* @param type รับค่า
|
* @param type รับค่า
|
||||||
*/
|
*/
|
||||||
function checkLeaveType(type: string) {
|
function checkLeaveType(leaveTypeId: string, leaveTypeName: string) {
|
||||||
if (type === "leave1" || type === "leave2" || type === "leave3") {
|
if (leaveType.value) {
|
||||||
checkForm.value = "FormLeave";
|
const filtertype: LeaveType | undefined = leaveType.value.find(
|
||||||
} else if (type === "leave4") {
|
(e: any) => e.id === leaveTypeId
|
||||||
checkForm.value = "FormChildbirth";
|
);
|
||||||
} else if (type === "leave5") {
|
const type = filtertype?.code;
|
||||||
checkForm.value = "FormHoliday";
|
if (type === "LV-001" || type === "LV-002" || type === "LV-003") {
|
||||||
} else if (type === "leave6") {
|
checkForm.value = "FormLeave";
|
||||||
checkForm.value = "FormUpasom";
|
} else if (type === "LV-004") {
|
||||||
} else if (type === "leave7") {
|
checkForm.value = "FormChildbirth";
|
||||||
checkForm.value = "FormHajj";
|
} else if (type === "LV-005") {
|
||||||
} else if (type === "leave8") {
|
checkForm.value = "FormHoliday";
|
||||||
checkForm.value = "FormCheckSelect";
|
} else if (type === "LV-006") {
|
||||||
} else if (type === "leave9") {
|
checkForm.value = "FormUpasom";
|
||||||
checkForm.value = "FormStudy";
|
} else if (type === "LV-006" && leaveTypeName === "พิธีฮัจญ์ฯ") {
|
||||||
} else if (type === "leave10") {
|
checkForm.value = "FormHajj";
|
||||||
checkForm.value = "FormLeaveToTraining";
|
} else if (type === "LV-007") {
|
||||||
} else if (type === "leave11") {
|
checkForm.value = "FormCheckSelect";
|
||||||
checkForm.value = "FormLeaveToWorkInternational";
|
} else if (type === "LV-008" && leaveTypeName === "ลาไปศีกษา") {
|
||||||
} else if (type === "leave12") {
|
checkForm.value = "FormStudy";
|
||||||
checkForm.value = "FormSpouse";
|
} else if (type === "LV-008") {
|
||||||
} else if (type === "leave13") {
|
checkForm.value = "FormLeaveToTraining";
|
||||||
checkForm.value = "FormVocationalRehabilitation";
|
} else if (type === "LV-009") {
|
||||||
|
checkForm.value = "FormLeaveToWorkInternational";
|
||||||
|
} else if (type === "LV-010") {
|
||||||
|
checkForm.value = "FormSpouse";
|
||||||
|
} else if (type === "LV-011") {
|
||||||
|
checkForm.value = "FormVocationalRehabilitation";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -323,7 +361,7 @@ function clickSave() {
|
||||||
class="q-mr-sm"
|
class="q-mr-sm"
|
||||||
@click="router.push(`/leave`)"
|
@click="router.push(`/leave`)"
|
||||||
/>
|
/>
|
||||||
รายละเอียดการลาของ {{ formData.fullname }}
|
รายละเอียดการลาของ {{ formData.fullName }}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<q-btn
|
<q-btn
|
||||||
|
|
@ -373,10 +411,7 @@ function clickSave() {
|
||||||
<div class="col-12 row">
|
<div class="col-12 row">
|
||||||
<div class="col-xs-5 col-sm-3 text-grey-8">ประเภทการลา</div>
|
<div class="col-xs-5 col-sm-3 text-grey-8">ประเภทการลา</div>
|
||||||
<div class="col text-primary">
|
<div class="col text-primary">
|
||||||
{{
|
{{ formData.leaveTypeName }}
|
||||||
formData.leaveTypeId &&
|
|
||||||
stores.convertLeave(formData.leaveTypeId)
|
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 row">
|
<div class="col-12 row">
|
||||||
|
|
@ -384,7 +419,7 @@ function clickSave() {
|
||||||
ชื่อ - นามสกุล
|
ชื่อ - นามสกุล
|
||||||
</div>
|
</div>
|
||||||
<div class="col text-weight-medium">
|
<div class="col text-weight-medium">
|
||||||
{{ formData.fullname }}
|
{{ formData.fullName }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -409,7 +444,7 @@ function clickSave() {
|
||||||
class="col-12 items-center row q-px-md q-py-sm"
|
class="col-12 items-center row q-px-md q-py-sm"
|
||||||
>
|
>
|
||||||
<div class="text-h6 text-weight-bold text-light-blue-6">
|
<div class="text-h6 text-weight-bold text-light-blue-6">
|
||||||
{{ formData.leaveTotal }}
|
{{ formData.leaveSummary }}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 text-subtitle2 text-weight-regular">
|
<div class="col-12 text-subtitle2 text-weight-regular">
|
||||||
<span class="gt-xs">ใช้ไป</span>
|
<span class="gt-xs">ใช้ไป</span>
|
||||||
|
|
@ -464,7 +499,7 @@ function clickSave() {
|
||||||
:data="formData"
|
:data="formData"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- ลาประกอบพิธีฮัจย์ -->
|
<!-- ลาประกอบพิธีฮัจญ์ -->
|
||||||
<FormHajj v-else-if="checkForm === 'FormHajj'" :data="formData" />
|
<FormHajj v-else-if="checkForm === 'FormHajj'" :data="formData" />
|
||||||
|
|
||||||
<!-- ลาเข้ารับการตรวจเลือกหรือเข้ารับการเตรียมพล -->
|
<!-- ลาเข้ารับการตรวจเลือกหรือเข้ารับการเตรียมพล -->
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, onMounted } from "vue";
|
import { ref, reactive, onMounted, watch } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
@ -29,34 +29,35 @@ const $q = useQuasar(); //ใช้ noti quasar
|
||||||
|
|
||||||
//
|
//
|
||||||
const querySting = reactive<QuerySting>({
|
const querySting = reactive<QuerySting>({
|
||||||
year: new Date().getFullYear(), //*ปีในการยื่นขอใบลา(ใช้เป็น คศ.)
|
year: leaveStore.filter.year, //*ปีในการยื่นขอใบลา(ใช้เป็น คศ.)
|
||||||
type: "00000000-0000-0000-0000-000000000000", //*Id ประเภทการลา
|
type: leaveStore.filter.type, //*Id ประเภทการลา
|
||||||
status: "ALL", //*สถานะการของลา
|
status: leaveStore.filter.status, //*สถานะการของลา
|
||||||
page: 1, //*หน้า
|
page: 1, //*หน้า
|
||||||
pageSize: 10, //*จำนวนแถวต่อหน้า
|
pageSize: 10, //*จำนวนแถวต่อหน้า
|
||||||
keyword: "", //keyword ค้นหา
|
keyword: leaveStore.filter.keyword, //keyword ค้นหา
|
||||||
});
|
});
|
||||||
const maxPage = ref<number>(1);
|
const maxPage = ref<number>(1);
|
||||||
|
|
||||||
//** เรียกข้อมูลจาก API*/
|
//** เรียกข้อมูลจาก API*/
|
||||||
async function fecthLeaveList() {
|
async function fecthLeaveList() {
|
||||||
// showLoader();
|
showLoader();
|
||||||
// await http
|
await http
|
||||||
// .post(config.API.leaveList(), querySting)
|
.post(config.API.leaveList(), querySting)
|
||||||
// .then((res) => {
|
.then((res) => {
|
||||||
// console.log(res);
|
console.log(res);
|
||||||
|
const data = res.data.result;
|
||||||
// maxPage.value = Math.ceil(data.length / querySting.pageSize);
|
maxPage.value = Math.ceil(data.total / querySting.pageSize);
|
||||||
// })
|
fetchListLeave(data.data); /** ส่งข้อมูลไป stores*/
|
||||||
// .catch((err) => {
|
console.log(maxPage.value);
|
||||||
// messageError($q, err);
|
})
|
||||||
// })
|
.catch((err) => {
|
||||||
// .finally(() => {
|
messageError($q, err);
|
||||||
// hideLoader();
|
})
|
||||||
// });
|
.finally(() => {
|
||||||
const data = APIDATA.data;
|
hideLoader();
|
||||||
maxPage.value = Math.ceil(data.length / querySting.pageSize);
|
});
|
||||||
fetchListLeave(data); /** ส่งข้อมูลไป stores*/
|
// const data = APIDATA.data;
|
||||||
|
// maxPage.value = Math.ceil(data.length / querySting.pageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -83,6 +84,13 @@ async function updatePaging(
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await fecthLeaveList();
|
await fecthLeaveList();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => leaveStore.tabView,
|
||||||
|
async () => {
|
||||||
|
leaveStore.tabView === "list" && (await fecthLeaveList());
|
||||||
|
}
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<q-toolbar class="text-primary" style="padding: 0">
|
<q-toolbar class="text-primary" style="padding: 0">
|
||||||
|
|
|
||||||
|
|
@ -27,31 +27,31 @@ const { fetchListLeaveReject } = leaveStore;
|
||||||
const $q = useQuasar(); //ใช้ noti quasar
|
const $q = useQuasar(); //ใช้ noti quasar
|
||||||
|
|
||||||
const querySting = reactive<QuerySting>({
|
const querySting = reactive<QuerySting>({
|
||||||
year: new Date().getFullYear(), //*ปีในการยื่นขอใบลา(ใช้เป็น คศ.)
|
year: leaveStore.filter.year, //*ปีในการยื่นขอใบลา(ใช้เป็น คศ.)
|
||||||
type: "00000000-0000-0000-0000-000000000000", //*Id ประเภทการลา
|
type: leaveStore.filter.type, //*Id ประเภทการลา
|
||||||
status: "ALL", //*สถานะการของลา
|
status: leaveStore.filter.status, //*สถานะการของลา
|
||||||
page: 1, //*หน้า
|
page: 1, //*หน้า
|
||||||
pageSize: 5, //*จำนวนแถวต่อหน้า
|
pageSize: 5, //*จำนวนแถวต่อหน้า
|
||||||
keyword: "", //keyword ค้นหา
|
keyword: leaveStore.filter.keyword, //keyword ค้นหา
|
||||||
});
|
});
|
||||||
const maxPage = ref<number>(1);
|
const maxPage = ref<number>(1);
|
||||||
|
|
||||||
//** เรียกข้อมูลจาก API*/
|
//** เรียกข้อมูลจาก API*/
|
||||||
async function fecthLeaveList() {
|
async function fecthLeaveList() {
|
||||||
// showLoader();
|
showLoader();
|
||||||
// await http
|
await http
|
||||||
// .post(config.API.leaveListDelete(), querySting)
|
.post(config.API.leaveListDelete(), querySting)
|
||||||
// .then((res) => {
|
.then((res) => {
|
||||||
// console.log(res);
|
console.log(res);
|
||||||
|
|
||||||
// maxPage.value = Math.ceil(data.length / querySting.pageSize);
|
maxPage.value = Math.ceil(data.length / querySting.pageSize);
|
||||||
// })
|
})
|
||||||
// .catch((err) => {
|
.catch((err) => {
|
||||||
// messageError($q, err);
|
messageError($q, err);
|
||||||
// })
|
})
|
||||||
// .finally(() => {
|
.finally(() => {
|
||||||
// hideLoader();
|
hideLoader();
|
||||||
// });
|
});
|
||||||
const data = APIDATA.data;
|
const data = APIDATA.data;
|
||||||
|
|
||||||
fetchListLeaveReject(data); /** ส่งข้อมูลไป stores*/
|
fetchListLeaveReject(data); /** ส่งข้อมูลไป stores*/
|
||||||
|
|
|
||||||
|
|
@ -36,11 +36,11 @@ const columnsLeave = ref<QTableProps["columns"]>([
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "fullname",
|
name: "fullName",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ผู้ยื่นใบลา",
|
label: "ผู้ยื่นใบลา",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "fullname",
|
field: "fullName",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
|
|
@ -66,7 +66,7 @@ const columnsLeave = ref<QTableProps["columns"]>([
|
||||||
const visibleColumnsLeave = ref<string[]>([
|
const visibleColumnsLeave = ref<string[]>([
|
||||||
"no",
|
"no",
|
||||||
"leaveTypeName",
|
"leaveTypeName",
|
||||||
"fullname",
|
"fullName",
|
||||||
"dateSendLeave",
|
"dateSendLeave",
|
||||||
"status",
|
"status",
|
||||||
]);
|
]);
|
||||||
|
|
@ -91,11 +91,11 @@ const columnsReject = ref<QTableProps["columns"]>([
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "fullname",
|
name: "fullName",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ผู้ยื่นยกเลิกใบลา",
|
label: "ผู้ยื่นยกเลิกใบลา",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "fullname",
|
field: "fullName",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
|
|
@ -121,7 +121,7 @@ const columnsReject = ref<QTableProps["columns"]>([
|
||||||
const visibleReject = ref<string[]>([
|
const visibleReject = ref<string[]>([
|
||||||
"no",
|
"no",
|
||||||
"leaveTypeName",
|
"leaveTypeName",
|
||||||
"fullname",
|
"fullName",
|
||||||
"dateSendLeave",
|
"dateSendLeave",
|
||||||
"status",
|
"status",
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ function updateQuerySting(
|
||||||
|
|
||||||
/** function ค้นหาข้อมูลใน Table*/
|
/** function ค้นหาข้อมูลใน Table*/
|
||||||
async function filterListLeave() {
|
async function filterListLeave() {
|
||||||
updateQuerySting(1, 0, filter);
|
updateQuerySting(1, 0, leaveStore.filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Option*/
|
/** Option*/
|
||||||
|
|
@ -150,7 +150,7 @@ onMounted(async () => {
|
||||||
<div class="col-xs-12 col-sm-3 col-md-2">
|
<div class="col-xs-12 col-sm-3 col-md-2">
|
||||||
<datepicker
|
<datepicker
|
||||||
menu-class-name="modalfix"
|
menu-class-name="modalfix"
|
||||||
v-model="filter.year"
|
v-model="leaveStore.filter.year"
|
||||||
class="col-2"
|
class="col-2"
|
||||||
:locale="'th'"
|
:locale="'th'"
|
||||||
autoApply
|
autoApply
|
||||||
|
|
@ -167,7 +167,7 @@ onMounted(async () => {
|
||||||
dense
|
dense
|
||||||
lazy-rules
|
lazy-rules
|
||||||
outlined
|
outlined
|
||||||
:model-value="Number(filter.year) + 543"
|
:model-value="Number(leaveStore.filter.year) + 543"
|
||||||
:label="`${'ปีงบประมาณ'}`"
|
:label="`${'ปีงบประมาณ'}`"
|
||||||
>
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
|
|
@ -189,7 +189,7 @@ onMounted(async () => {
|
||||||
map-options
|
map-options
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
v-model="filter.type"
|
v-model="leaveStore.filter.type"
|
||||||
:options="optionType"
|
:options="optionType"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
|
|
@ -215,7 +215,7 @@ onMounted(async () => {
|
||||||
map-options
|
map-options
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
v-model="filter.status"
|
v-model="leaveStore.filter.status"
|
||||||
:options="optionStatus"
|
:options="optionStatus"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
|
|
@ -240,7 +240,7 @@ onMounted(async () => {
|
||||||
for="filterTable"
|
for="filterTable"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
v-model="filter.keyword"
|
v-model="leaveStore.filter.keyword"
|
||||||
label="ค้นหา"
|
label="ค้นหา"
|
||||||
@keydown.enter.prevent="filterListLeave"
|
@keydown.enter.prevent="filterListLeave"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ console.log(props);
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-grey-8">จำนวนวันที่ลา</div>
|
<div class="col text-grey-8">จำนวนวันที่ลา</div>
|
||||||
<div class="col">{{ props.data.leaveCount }}</div>
|
<div class="col">{{ props.data.leaveTotal }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-grey-8">ได้รับหมายเรียกของ</div>
|
<div class="col text-grey-8">ได้รับหมายเรียกของ</div>
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ const props = defineProps({
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-grey-8">จำนวนวันที่ลา</div>
|
<div class="col text-grey-8">จำนวนวันที่ลา</div>
|
||||||
<div class="col">{{ props.data.leaveCount }}</div>
|
<div class="col">{{ props.data.leaveTotal }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-grey-8">ชื่อภรรยา</div>
|
<div class="col text-grey-8">ชื่อภรรยา</div>
|
||||||
|
|
|
||||||
|
|
@ -24,14 +24,14 @@ const props = defineProps({
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-grey-8">จำนวนวันที่ลา</div>
|
<div class="col text-grey-8">จำนวนวันที่ลา</div>
|
||||||
<div class="col">{{ props.data.leaveCount }}</div>
|
<div class="col">{{ props.data.leaveTotal }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-grey-8">วันที่เข้ารับราชการ</div>
|
<div class="col text-grey-8">วันที่เข้ารับราชการ</div>
|
||||||
<div class="col">{{ props.data.leavegovernmentDate }}</div>
|
<div class="col">{{ props.data.leavegovernmentDate }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-grey-8">เคย/ไม่เคยไปประกอบพิธีฮัจย์</div>
|
<div class="col text-grey-8">เคย/ไม่เคยไปประกอบพิธีฮัจญ์</div>
|
||||||
<div class="col">{{ props.data.hajjDayStatus ? "เคย" : "ไม่เคย" }}</div>
|
<div class="col">{{ props.data.hajjDayStatus ? "เคย" : "ไม่เคย" }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ const props = defineProps({
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-grey-8">จำนวนวันที่ลา</div>
|
<div class="col text-grey-8">จำนวนวันที่ลา</div>
|
||||||
<div class="col">{{ props.data.leaveCount }}</div>
|
<div class="col">{{ props.data.leaveTotal }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-grey-8"></div>
|
<div class="col text-grey-8"></div>
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ const props = defineProps({
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-grey-8">จำนวนวันที่ลา</div>
|
<div class="col text-grey-8">จำนวนวันที่ลา</div>
|
||||||
<div class="col">{{ props.data.leaveCount }}</div>
|
<div class="col">{{ props.data.leaveTotal }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-grey-8"></div>
|
<div class="col text-grey-8"></div>
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ const props = defineProps({
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-grey-8">จำนวนวันที่ลา</div>
|
<div class="col text-grey-8">จำนวนวันที่ลา</div>
|
||||||
<div class="col">{{ props.data.leaveCount }}</div>
|
<div class="col">{{ props.data.leaveTotal }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-grey-8">วันเดือนปีเกิด</div>
|
<div class="col text-grey-8">วันเดือนปีเกิด</div>
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ console.log(props);
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-4 text-grey-8">ชื่อผู้ยื่นขอ</div>
|
<div class="col-4 text-grey-8">ชื่อผู้ยื่นขอ</div>
|
||||||
<div class="col">{{ props.data.fullname }}</div>
|
<div class="col">{{ props.data.fullName }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-4 text-grey-8">ตำแหน่งผู้ยืนขอ</div>
|
<div class="col-4 text-grey-8">ตำแหน่งผู้ยืนขอ</div>
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ const props = defineProps({
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-grey-8">จำนวนวันที่ลา</div>
|
<div class="col text-grey-8">จำนวนวันที่ลา</div>
|
||||||
<div class="col">{{ props.data.leaveCount }}</div>
|
<div class="col">{{ props.data.leaveTotal }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-grey-8">วันเดือนปีเกิด</div>
|
<div class="col text-grey-8">วันเดือนปีเกิด</div>
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ const props = defineProps({
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-grey-8">จำนวนวันที่ลา</div>
|
<div class="col text-grey-8">จำนวนวันที่ลา</div>
|
||||||
<div class="col">{{ props.data.leaveCount }}</div>
|
<div class="col">{{ props.data.leaveTotal }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-grey-8">วันเดือนปีเกิด</div>
|
<div class="col text-grey-8">วันเดือนปีเกิด</div>
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,9 @@ interface FremData {
|
||||||
positionName: string; //ตำแหน่งผู้ยื่นขอ
|
positionName: string; //ตำแหน่งผู้ยื่นขอ
|
||||||
positionLevelName: string; //ระดับผู้ยื่นขอ
|
positionLevelName: string; //ระดับผู้ยื่นขอ
|
||||||
organizationName: string; //สังกัดผู้ยื่นขอ
|
organizationName: string; //สังกัดผู้ยื่นขอ
|
||||||
leaveTypeName: string | null; //Name ประเภทการลา
|
leaveTypeName: string; //Name ประเภทการลา
|
||||||
leaveTypeId: string | null; //Id ประเภทการลา
|
leaveTypeId: string; //Id ประเภทการลา
|
||||||
fullname: string; //คำนำหน้า ชื่อ นามสกุล คนขอลา
|
fullName: string; //คำนำหน้า ชื่อ นามสกุล คนขอลา
|
||||||
dateSendLeave: Date | null; //วันที่ยื่นใบลา
|
dateSendLeave: Date | null; //วันที่ยื่นใบลา
|
||||||
leaveDateStart: Date | null; //วันเริ่มการลา
|
leaveDateStart: Date | null; //วันเริ่มการลา
|
||||||
leaveDateEnd: Date | null; //วันสิ้นสุดการลา
|
leaveDateEnd: Date | null; //วันสิ้นสุดการลา
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,18 @@ interface DataRows {
|
||||||
id: string; //*Id การยื่นขอลา
|
id: string; //*Id การยื่นขอลา
|
||||||
leaveTypeName: string | null; //Name ประเภทการลา
|
leaveTypeName: string | null; //Name ประเภทการลา
|
||||||
leaveTypeId: string; //Id ประเภทการลา
|
leaveTypeId: string; //Id ประเภทการลา
|
||||||
fullname: string; //คำนำหน้า ชื่อ นามสกุล คนขอลา
|
fullName: string; //คำนำหน้า ชื่อ นามสกุล คนขอลา
|
||||||
dateSendLeave: string | null; //วันที่ยื่นใบลา
|
dateSendLeave: string | null; //วันที่ยื่นใบลา
|
||||||
status: string | null; //ส
|
status: string | null; //ส
|
||||||
}
|
}
|
||||||
|
interface ListLeave {
|
||||||
|
id: string; //*Id การยื่นขอลา
|
||||||
|
leaveTypeName: string | null; //Name ประเภทการลา
|
||||||
|
leaveTypeId: string; //Id ประเภทการลา
|
||||||
|
fullName: string; //คำนำหน้า ชื่อ นามสกุล คนขอลา
|
||||||
|
dateSendLeave: Date | null; //วันที่ยื่นใบลา
|
||||||
|
status: string | null; //ส
|
||||||
|
}
|
||||||
interface FormData {
|
interface FormData {
|
||||||
id: string;
|
id: string;
|
||||||
leaveType: string;
|
leaveType: string;
|
||||||
|
|
@ -18,5 +26,17 @@ interface DataDateMonthObject {
|
||||||
month: number;
|
month: number;
|
||||||
year: number;
|
year: number;
|
||||||
}
|
}
|
||||||
|
interface LeaveType {
|
||||||
|
code: string;
|
||||||
|
createdAt: Date;
|
||||||
|
createdFullName: string;
|
||||||
|
createdUserId: string;
|
||||||
|
id: string;
|
||||||
|
lastUpdateFullName: string;
|
||||||
|
lastUpdateUserId: string;
|
||||||
|
lastUpdatedAt: Date | null;
|
||||||
|
limit: Number;
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
export type { DataRows, FormData, DataDateMonthObject };
|
export type { DataRows, FormData, DataDateMonthObject, ListLeave, LeaveType };
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,14 @@
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, reactive } from "vue";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
/** importType*/
|
/** importType*/
|
||||||
|
import type { DateFilter } from "@/modules/09_leave/interface/request/leave";
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
import type { DataRows } from "@/modules/09_leave/interface/response/leave";
|
import type {
|
||||||
|
DataRows,
|
||||||
|
ListLeave,
|
||||||
|
} from "@/modules/09_leave/interface/response/leave";
|
||||||
import type { FremData } from "@/modules/09_leave/interface/request/leave";
|
import type { FremData } from "@/modules/09_leave/interface/request/leave";
|
||||||
|
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
|
|
@ -16,6 +20,13 @@ export const useLeavelistDataStore = defineStore("leave", () => {
|
||||||
|
|
||||||
/** ข้อมูล Tab 1*/
|
/** ข้อมูล Tab 1*/
|
||||||
const tabView = ref<string>("list");
|
const tabView = ref<string>("list");
|
||||||
|
/** filter*/
|
||||||
|
const filter = reactive<DateFilter>({
|
||||||
|
year: new Date().getFullYear(), //*ปีในการยื่นขอใบลา(ใช้เป็น คศ.)
|
||||||
|
type: "00000000-0000-0000-0000-000000000000", //*Id ประเภทการลา
|
||||||
|
status: "ALL", //*สถานะการของลา
|
||||||
|
keyword: "", //keyword ค้นหา
|
||||||
|
});
|
||||||
|
|
||||||
/**ข้อมูลใน Table*/
|
/**ข้อมูลใน Table*/
|
||||||
const mainData = ref<any>([]);
|
const mainData = ref<any>([]);
|
||||||
|
|
@ -29,14 +40,14 @@ export const useLeavelistDataStore = defineStore("leave", () => {
|
||||||
* ฟังก์ชั่น fetchListLeave
|
* ฟังก์ชั่น fetchListLeave
|
||||||
* @param data รับข้อมูลจาก Page
|
* @param data รับข้อมูลจาก Page
|
||||||
*/
|
*/
|
||||||
async function fetchListLeave(data: any[]) {
|
async function fetchListLeave(data: ListLeave[]) {
|
||||||
let datalist = data.map((e: FremData) => ({
|
let datalist = data.map((e: ListLeave) => ({
|
||||||
id: e.id,
|
id: e.id,
|
||||||
leaveTypeName: e.leaveTypeId && convertLeave(e.leaveTypeId),
|
leaveTypeName: e.leaveTypeName,
|
||||||
leaveTypeId: e.leaveTypeId,
|
leaveTypeId: e.leaveTypeId,
|
||||||
fullname: e.fullname,
|
fullName: e.fullName,
|
||||||
dateSendLeave: e.dateSendLeave && date2Thai(e.dateSendLeave),
|
dateSendLeave: e.dateSendLeave && date2Thai(e.dateSendLeave),
|
||||||
status: convertSatatus(e.status),
|
status: e.status && convertSatatus(e.status),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
mainData.value = datalist;
|
mainData.value = datalist;
|
||||||
|
|
@ -52,7 +63,7 @@ export const useLeavelistDataStore = defineStore("leave", () => {
|
||||||
id: e.id,
|
id: e.id,
|
||||||
leaveTypeName: e.leaveTypeId && convertLeave(e.leaveTypeId),
|
leaveTypeName: e.leaveTypeId && convertLeave(e.leaveTypeId),
|
||||||
leaveTypeId: e.leaveTypeId,
|
leaveTypeId: e.leaveTypeId,
|
||||||
fullname: e.fullname,
|
fullName: e.fullName,
|
||||||
dateSendLeave: e.dateSendLeave && date2Thai(e.dateSendLeave),
|
dateSendLeave: e.dateSendLeave && date2Thai(e.dateSendLeave),
|
||||||
status: convertSatatus2(e.status),
|
status: convertSatatus2(e.status),
|
||||||
}));
|
}));
|
||||||
|
|
@ -75,6 +86,8 @@ export const useLeavelistDataStore = defineStore("leave", () => {
|
||||||
return "อนุมัติ";
|
return "อนุมัติ";
|
||||||
case "REJECT":
|
case "REJECT":
|
||||||
return "ไม่อนุมัติ";
|
return "ไม่อนุมัติ";
|
||||||
|
case "DELETE":
|
||||||
|
return "ยกเลิก";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -175,6 +188,8 @@ export const useLeavelistDataStore = defineStore("leave", () => {
|
||||||
/** ข้อมูล Main*/
|
/** ข้อมูล Main*/
|
||||||
tabMenu,
|
tabMenu,
|
||||||
/** ข้อมูล Tab1*/
|
/** ข้อมูล Tab1*/
|
||||||
|
/** filter */
|
||||||
|
filter,
|
||||||
tabView,
|
tabView,
|
||||||
/**ข้อมูลใน Table */
|
/**ข้อมูลใน Table */
|
||||||
rows,
|
rows,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue