diff --git a/src/modules/04_registryPerson/components/Dialog/01_Information.vue b/src/modules/04_registryPerson/components/Dialog/01_Information.vue index 53bb9cd32..4923e6d08 100644 --- a/src/modules/04_registryPerson/components/Dialog/01_Information.vue +++ b/src/modules/04_registryPerson/components/Dialog/01_Information.vue @@ -128,7 +128,7 @@ watch( :rules="[(val: string) => !!val || `${'กรุณากรอก คำนำหน้าชื่อ'}`]" /> -
+
-
+ +
diff --git a/src/modules/04_registryPerson/components/Dialog/DialogUpdate.vue b/src/modules/04_registryPerson/components/Dialog/DialogUpdate.vue index 65e635510..4d8b9bd18 100644 --- a/src/modules/04_registryPerson/components/Dialog/DialogUpdate.vue +++ b/src/modules/04_registryPerson/components/Dialog/DialogUpdate.vue @@ -10,6 +10,7 @@ import { useLinkageStore } from "@/stores/linkage"; import { useDataLinkCenter } from "@/modules/04_registryPerson/stores/LinkCenter"; import { useRequestEditStore } from "@/modules/04_registryPerson/stores/RequestEdit"; +import type { DataOption } from "@/modules/04_registryPerson/interface/index/Main"; import type { RequestregistrationAddressObject } from "@/modules/04_registryPerson/interface/request/Address"; import type { RequestObject } from "@/modules/04_registryPerson/interface/request/Profile"; import type { @@ -159,12 +160,12 @@ function onSubmit() { registrationProvinceId: formDataAddress.registrationProvinceId, registrationAddress: formDataAddress.registrationAddress, - bloodGroup: formInformations.bloodGroup, + // bloodGroup: formInformations.bloodGroup, relationship: formInformations.relationship, gender: formInformations.gender, - religion: formInformations.religion, + // religion: formInformations.religion, nationality: formInformations.nationality, - ethnicity: formInformations.ethnicity, + // ethnicity: formInformations.ethnicity, birthDate: formInformations.birthDate, lastName: formInformations.lastName, firstName: formInformations.firstName, @@ -174,7 +175,10 @@ function onSubmit() { showLoader(); http .patch( - config.API.requestInformationbyType("myprofile", storeRequestEdit.profileId), + config.API.requestInformationbyType( + "myprofile", + storeRequestEdit.profileId + ), body ) .then(async (res) => { @@ -195,51 +199,55 @@ async function amiRequest() { data.value = profile; } else { data.value = { - titleCode: 3, - titleDesc: "นาย", - titleName: "นาย", - titleSex: 1, - firstName: "ชัยชนะ", - middleName: "", - lastName: "เรืองโรจน์", - genderCode: 1, - genderDesc: "ชาย", - dateOfBirth: 25211228, - nationalityCode: 99, - nationalityDesc: "ไทย", - ownerStatusDesc: "เจ้าบ้าน", - statusOfPersonCode: 0, - statusOfPersonDesc: "บุคคลนี้มีภูมิลำเนาอยู่ในบ้านนี้", - dateOfMoveIn: 25580728, - age: 45, - - fatherPersonalID: 3102100621479, - fatherName: "บุญเชิด", - fatherNationalityCode: 99, - fatherNationalityDesc: "ไทย", - - motherPersonalID: 3102100621487, - motherName: "พยอม", - motherNationalityCode: 99, - motherNationalityDesc: "ไทย", - - fullnameAndRank: "นายสุพลชัย พูลสวัสดิ์", - englishTitleDesc: "MR.", - englishFirstName: "SUPHONCHAI", - englishMiddleName: "", - englishLastName: "PHOONSAWAT", - - registrationAddress: "1220-1222 ถนนเพชรบุรี", - registrationProvinceId: "24bf701c-33d6-436e-ad49-6f82bb3ae017", - registrationDistrictId: "34bf701c-33d6-436e-ad49-6f82bb3b0586", - registrationSubDistrictId: "44bf701c-33d6-436e-ad49-6f82bb3b5649", - registrationZipCode: "10400", - currentAddress: "1220-1222 ถนนเพชรบุรี", - currentProvinceId: "24bf701c-33d6-436e-ad49-6f82bb3ae017", - currentDistrictId: "34bf701c-33d6-436e-ad49-6f82bb3b0586", - currentSubDistrictId: "44bf701c-33d6-436e-ad49-6f82bb3b5649", - currentZipCode: "10400", + // titleCode: 3, + // titleDesc: "นาย", + titleName: "นาย", // use + // titleSex: 1, + firstName: "ชัยชนะ", // use + middleName: "", // use + lastName: "เรืองโรจน์", // use + // genderCode: 1, + genderDesc: "ชาย", // use + dateOfBirth: 25211228, // use + // nationalityCode: 99, + nationalityDesc: "ไทย", // use + // ownerStatusDesc: "เจ้าบ้าน", + // statusOfPersonCode: 0, + // statusOfPersonDesc: "บุคคลนี้มีภูมิลำเนาอยู่ในบ้านนี้", + // dateOfMoveIn: 25580728, + // age: 45, }; + + const address = { + // houseID: 12020203651, + houseNo: "62/25", // use + // houseType: 1, + // houseTypeDesc: "บ้าน", + villageNo: 5, // use + // alleyWayCode: 0, + alleyWayDesc: null, // use + // alleyCode: 0, + alleyDesc: null, // use + // roadCode: 3, + roadDesc: "เทอดพระเกียรติ", // use + // subdistrictCode: 1, + subdistrictDesc: "วัดชลอ", // use + // districtCode: 2, + districtDesc: "บางกรวย", // use + // provinceCode: 12, + provinceDesc: "นนทบุรี", // use + // rcodeCode: "1296", + // rcodeDesc: "ท้องถิ่นเทศบาลเมืองบางกรวย", + // dateOfTerminate: 0, + // alleyWayEnglishDesc: null, + // alleyEnglishDesc: null, + // roadEnglishDesc: "Terdpragied", + // subdistrictEnglishDesc: "Wat Chalo", + // districtEnglishDesc: "Bang Kruai", + // provinceEnglishDesc: "Nonthaburi", + }; + + data.value = { ...data.value, ...address }; } formInformations.citizenId = idCard.value; formInformations.prefix = data.value.titleName; @@ -247,16 +255,94 @@ async function amiRequest() { formInformations.firstName = data.value.firstName; formInformations.lastName = data.value.lastName; formInformations.nationality = data.value.nationalityDesc; - formInformations.birthDate = data.value.dateOfBirth; + + // แปลง dateOfBirth เป็น format 1989-01-01 + formInformations.birthDate = conventDateOfBirth(`${data.value.dateOfBirth}`); age.value = storeLinkCenter.calculateAge(data.value.age); formInformations.gender = data.value.genderDesc; - formDataAddress.registrationAddress = data.value.registrationAddress; - formDataAddress.registrationProvinceId = data.value.registrationProvinceId; - formDataAddress.registrationDistrictId = data.value.registrationDistrictId; - formDataAddress.registrationSubDistrictId = - data.value.registrationSubDistrictId; - formDataAddress.registrationZipCode = data.value.registrationZipCode; + let registrationAddress = data.value.houseNo ? data.value.houseNo : ""; + registrationAddress += data.value.villageNo + ? ` หมู่ ${data.value.villageNo}` + : ""; + registrationAddress += data.value.alleyWayDesc + ? ` ${data.value.alleyWayDesc}` + : ""; + registrationAddress += data.value.roadDesc + ? `ถนน ${data.value.roadDesc}` + : ""; + formDataAddress.registrationAddress = registrationAddress; + + // ค้นหา จังหวัด อำเภอ ตำบล และรหัสไปรษณื + formDataAddress.registrationProvinceId = await convertProvince( + data.value.provinceDesc + ); + formDataAddress.registrationDistrictId = await convertDistrict( + data.value.districtDesc + ); + formDataAddress.registrationSubDistrictId = await convertSubdistrict( + data.value.subdistrictDesc + ); + // formDataAddress.registrationZipCode = data.value.registrationZipCode; + + // console.log("province===>", data.value.provinceDesc); + // console.log("district===>", data.value.districtDesc); + // console.log("subdistrict===>", data.value.subdistrictDesc); +} + +/** + * ฟังก์ชันแปลง dateOfBirth เป็น format 1989-01-01 + * @param val dateOfBirth '25211228' + */ +function conventDateOfBirth(val: string) { + // Extract year, month, and day + const year = parseInt(val.slice(0, 4), 10) - 543; + const month = val.slice(4, 6); + const day = val.slice(6, 8); + + // Format as YYYY-MM-DD + return `${year}-${month}-${day}`; +} + +/** + * ฟังก์ชันแปลงชื่อจังหวัดเป็น ID + * @param val ชื่อจังหวัด + */ +async function convertProvince(val: string) { + const id = storeLinkCenter.OpsAddress.provinceOps.find( + (e: DataOption) => e.name === val + )?.id; + + // เรียกฟังก์ชันดึงข้อมูล เขต / อำเภอ + await storeLinkCenter.fetchDistrict(id ? id : null, "1", false); + + return id ? id : null; +} + +/** + * ฟังก์ชันแปลงชื่อเขต / อำเภอ เป็น ID + * @param val ชื่อเขต / อำเภอ + */ +async function convertDistrict(val: string) { + const id = storeLinkCenter.OpsAddress.districtOps.find( + (e: DataOption) => e.name === val + )?.id; + // เรียกฟังก์ชันดึงข้อมูล แขวง / ตำบล + await storeLinkCenter.fetchSubDistrict(id ? id : null, "1", false); + + return id ? id : null; +} + +/** + * ฟังก์ชันแปลงชื่อแขวง / ตำบล เป็น ID + * @param val ชื่อแขวง / ตำบล + */ +async function convertSubdistrict(val: string) { + const result = storeLinkCenter.OpsAddress.subdistrictOps.find( + (e: DataOption) => e.name === val + ); + formDataAddress.registrationZipCode = result ? result.zipCode : null; + return result ? result.id : null; } watch( @@ -266,29 +352,37 @@ watch( showLoader(); count.value = 0; await storeLinkCenter.fetchPerson(); + await storeLinkCenter.fetchProvince(false); await amiRequest(); presentAddress.value = formDataAddress.registrationZipCode ? "0" : "1"; - if ( - storeLinkCenter.OpsAddress.provinceOps.length === 0 || - storeLinkCenter.OpsAddress.districtOps.length === 0 || - storeLinkCenter.OpsAddress.districtCOps.length === 0 || - storeLinkCenter.OpsAddress.subdistrictOps.length === 0 || - storeLinkCenter.OpsAddress.subdistrictCOps.length === 0 - ) { - await storeLinkCenter.fetchProvince(false); - storeLinkCenter.fetchDistrict( - formDataAddress.registrationProvinceId, - "1", - false - ); - storeLinkCenter.fetchSubDistrict( - formDataAddress.registrationDistrictId, - "1", - false - ); - } + // if ( + // storeLinkCenter.OpsAddress.provinceOps.length === 0 || + // storeLinkCenter.OpsAddress.districtOps.length === 0 || + // storeLinkCenter.OpsAddress.districtCOps.length === 0 || + // storeLinkCenter.OpsAddress.subdistrictOps.length === 0 || + // storeLinkCenter.OpsAddress.subdistrictCOps.length === 0 + // ) { + // await storeLinkCenter.fetchProvince(false); + // storeLinkCenter.fetchDistrict( + // formDataAddress.registrationProvinceId, + // "1", + // false + // ); + // storeLinkCenter.fetchSubDistrict( + // formDataAddress.registrationDistrictId, + // "1", + // false + // ); + // } hideLoader(); + } else { + age.value = ""; + formDataAddress.registrationAddress = ""; + formDataAddress.registrationProvinceId = null; + formDataAddress.registrationDistrictId = null; + formDataAddress.registrationSubDistrictId = null; + formDataAddress.registrationZipCode = null; } } ); @@ -300,7 +394,6 @@ watch(
-
diff --git a/src/modules/04_registryPerson/interface/request/Profile.ts b/src/modules/04_registryPerson/interface/request/Profile.ts index f3bc095c5..c4f49124c 100644 --- a/src/modules/04_registryPerson/interface/request/Profile.ts +++ b/src/modules/04_registryPerson/interface/request/Profile.ts @@ -1,5 +1,5 @@ interface RequestObject { - birthDate: Date | null; + birthDate: Date | null | string; bloodGroup: string | null; citizenId: string; // email: string | null; @@ -11,10 +11,10 @@ interface RequestObject { // posLevelId: string; // posTypeId: string; prefix: string; - rank: string | null; - relationship: string | null; - religion: string | null; - phone: string | null; + rank?: string | null; + relationship?: string | null; + religion?: string | null; + phone?: string | null; // telephoneNumber: string | null; } diff --git a/src/modules/05_placement/components/Transfer/TransferDetail.vue b/src/modules/05_placement/components/Transfer/TransferDetail.vue index a51a98417..eae5ad5aa 100644 --- a/src/modules/05_placement/components/Transfer/TransferDetail.vue +++ b/src/modules/05_placement/components/Transfer/TransferDetail.vue @@ -142,7 +142,6 @@ const isCheckData = computed(() => { positionTypeOld.value !== "" && positionLevelOld.value !== "" && posNo.value !== "" && - salary.value !== 0 && organization.value !== "" && date.value !== null ) { diff --git a/src/modules/06_retirement/components/resign/ResignByid.vue b/src/modules/06_retirement/components/resign/ResignByid.vue index b91dff6a9..d1cc03626 100644 --- a/src/modules/06_retirement/components/resign/ResignByid.vue +++ b/src/modules/06_retirement/components/resign/ResignByid.vue @@ -95,7 +95,6 @@ const isCheckData = computed(() => { positionTypeOld.value !== "" && positionLevelOld.value !== "" && posNo.value !== "" && - salary.value !== 0 && date.value !== null && dataDetail.value.commanderReject !== null && dataDetail.value.oligarchReject !== null diff --git a/src/modules/06_retirement/components/resign/ResignReject.vue b/src/modules/06_retirement/components/resign/ResignReject.vue index 7e60ae7da..64d5f8fa6 100644 --- a/src/modules/06_retirement/components/resign/ResignReject.vue +++ b/src/modules/06_retirement/components/resign/ResignReject.vue @@ -92,7 +92,6 @@ const isCheckData = computed(() => { positionTypeOld.value !== "" && positionLevelOld.value !== "" && posNo.value !== "" && - salary.value !== 0 && date.value !== null && dataDetail.value.commanderReject !== null && dataDetail.value.oligarchReject !== null diff --git a/src/modules/06_retirement/components/resignEMP/ResignByid.vue b/src/modules/06_retirement/components/resignEMP/ResignByid.vue index c057295b9..098d765cd 100644 --- a/src/modules/06_retirement/components/resignEMP/ResignByid.vue +++ b/src/modules/06_retirement/components/resignEMP/ResignByid.vue @@ -95,7 +95,6 @@ const isCheckData = computed(() => { positionTypeOld.value !== "" && positionLevelOld.value !== "" && posNo.value !== "" && - salary.value !== 0 && date.value !== null && dataDetail.value.commanderReject !== null && dataDetail.value.oligarchReject !== null diff --git a/src/modules/06_retirement/components/resignEMP/ResignReject.vue b/src/modules/06_retirement/components/resignEMP/ResignReject.vue index 7fdd04bae..528a548f1 100644 --- a/src/modules/06_retirement/components/resignEMP/ResignReject.vue +++ b/src/modules/06_retirement/components/resignEMP/ResignReject.vue @@ -92,7 +92,6 @@ const isCheckData = computed(() => { positionTypeOld.value !== "" && positionLevelOld.value !== "" && posNo.value !== "" && - salary.value !== 0 && date.value !== null && dataDetail.value.commanderReject !== null && dataDetail.value.oligarchReject !== null diff --git a/src/modules/07_insignia/views/03_ResultMain.vue b/src/modules/07_insignia/views/03_ResultMain.vue index e600bc9df..6d42aa4e7 100644 --- a/src/modules/07_insignia/views/03_ResultMain.vue +++ b/src/modules/07_insignia/views/03_ResultMain.vue @@ -85,6 +85,7 @@ const columns = ref([ sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, + { name: "citizenId", align: "left", @@ -103,6 +104,15 @@ const columns = ref([ sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, + { + name: "position", + align: "left", + label: "ตำแหน่ง", + field: "position", + sortable: true, + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, { name: "employeeType", align: "left", @@ -219,6 +229,7 @@ const visibleColumns = ref([ "status", "citizenId", "name", + "position", "type", "dateReceive", "date", diff --git a/src/modules/09_leave/components/2_Leave/DetailLeave.vue b/src/modules/09_leave/components/2_Leave/DetailLeave.vue index bdb15c37e..6d7d0cc28 100644 --- a/src/modules/09_leave/components/2_Leave/DetailLeave.vue +++ b/src/modules/09_leave/components/2_Leave/DetailLeave.vue @@ -167,8 +167,7 @@ async function fetchDetailLeave(paramsId: string) { formData.leaveDraftDocument = data.leaveDraftDocument; formData.leaveLastStart = data.leaveLastStart && date2Thai(data.leaveLastStart); - formData.leaveLastEnd = - data.leaveLastStart && date2Thai(data.leaveLastEnd); + formData.leaveLastEnd = data.leaveLastEnd && date2Thai(data.leaveLastEnd); formData.leaveTotal = data.leaveTotal ? data.leaveTotal : "0"; formData.leavebirthDate = data.leaveBirthDate && date2Thai(data.leaveBirthDate); @@ -263,7 +262,7 @@ async function fetchDetailLeave(paramsId: string) { formData.coupleDaySumTotalHistory = data.coupleDaySumTotalHistory ? data.coupleDaySumTotalHistory : "-"; - formData.approveStep = data.approveStep; + formData.approveStep = data.approveStep ? data.approveStep : "-"; formData.dear = data.dear ? data.dear : "-"; /** ส่งประเภทของการลาไป Function เช็คประเภทการลา*/ diff --git a/src/modules/09_leave/components/2_Leave/formDetail/formCheckSelect.vue b/src/modules/09_leave/components/2_Leave/formDetail/formCheckSelect.vue index c38db2a18..8559b57b8 100644 --- a/src/modules/09_leave/components/2_Leave/formDetail/formCheckSelect.vue +++ b/src/modules/09_leave/components/2_Leave/formDetail/formCheckSelect.vue @@ -36,7 +36,13 @@ const props = defineProps({
ลงวันที่
-
{{ props.data.absentDayRegistorDate }}
+
+ {{ + props.data.absentDayRegistorDate + ? props.data.absentDayRegistorDate + : "-" + }} +
ให้เข้ารับการ
diff --git a/src/modules/09_leave/components/2_Leave/formDetail/formChildbirth.vue b/src/modules/09_leave/components/2_Leave/formDetail/formChildbirth.vue index 9b46c2309..9127575c1 100644 --- a/src/modules/09_leave/components/2_Leave/formDetail/formChildbirth.vue +++ b/src/modules/09_leave/components/2_Leave/formDetail/formChildbirth.vue @@ -31,7 +31,9 @@ const props = defineProps({
วันที่คลอด
-
{{ props.data.wifeDayDateBorn }}
+
+ {{ props.data.wifeDayDateBorn ? props.data.wifeDayDateBorn : "-" }} +
หมายเลขที่ติดต่อขณะลา
diff --git a/src/modules/09_leave/components/2_Leave/formDetail/formLeave.vue b/src/modules/09_leave/components/2_Leave/formDetail/formLeave.vue index 65bc14d48..316010402 100644 --- a/src/modules/09_leave/components/2_Leave/formDetail/formLeave.vue +++ b/src/modules/09_leave/components/2_Leave/formDetail/formLeave.vue @@ -42,7 +42,9 @@ const props = defineProps({
ลาครั้งสุดท้ายในประเภทนั้น ๆ เมื่อวันที่
-
{{ props.data.leaveLastStart }}
+
+ {{ props.data.leaveLastStart ? props.data.leaveLastStart : "-" }} +
หมายเลขที่ติดต่อขณะลา
diff --git a/src/modules/09_leave/components/2_Leave/formDetail/formLeaveToTraining.vue b/src/modules/09_leave/components/2_Leave/formDetail/formLeaveToTraining.vue index 3f8a44d5d..28179b58c 100644 --- a/src/modules/09_leave/components/2_Leave/formDetail/formLeaveToTraining.vue +++ b/src/modules/09_leave/components/2_Leave/formDetail/formLeaveToTraining.vue @@ -71,7 +71,13 @@ function convertDateToEng(dataThia: string) {
วันที่เข้ารับราชการ
-
{{ props.data.leavegovernmentDate }}
+
+ {{ + props.data.leavegovernmentDate + ? props.data.leavegovernmentDate + : "-" + }} +
เงินเดือนปัจจุบัน
diff --git a/src/modules/09_leave/components/2_Leave/formDetail/formSpouse.vue b/src/modules/09_leave/components/2_Leave/formDetail/formSpouse.vue index e3ce29314..e6c4c9154 100644 --- a/src/modules/09_leave/components/2_Leave/formDetail/formSpouse.vue +++ b/src/modules/09_leave/components/2_Leave/formDetail/formSpouse.vue @@ -67,11 +67,19 @@ function convertDateToEng(dataThia: string) {
วันเดือนปีเกิด
-
{{ props.data.leavebirthDate }}
+
+ {{ props.data.leavebirthDate ? props.data.leavebirthDate : "-" }} +
วันที่เข้ารับราชการ
-
{{ props.data.leavegovernmentDate }}
+
+ {{ + props.data.leavegovernmentDate + ? props.data.leavegovernmentDate + : "-" + }} +
เงินเดือนปัจจุบัน
diff --git a/src/modules/09_leave/components/2_Leave/formDetail/formUpasom.vue b/src/modules/09_leave/components/2_Leave/formDetail/formUpasom.vue index e340333cf..d009f26b4 100644 --- a/src/modules/09_leave/components/2_Leave/formDetail/formUpasom.vue +++ b/src/modules/09_leave/components/2_Leave/formDetail/formUpasom.vue @@ -16,11 +16,11 @@ const props = defineProps({
ลาตั้งแต่วันที่
-
{{ props.data.leaveLastStart }}
+
{{ props.data.leaveDateStart }}
ลาถึงวันที่
-
{{ props.data.leaveLastEnd }}
+
{{ props.data.leaveDateEnd }}
จำนวนวันที่ลา
@@ -28,11 +28,19 @@ const props = defineProps({
วันเดือนปีเกิด
-
{{ props.data.leavebirthDate }}
+
+ {{ props.data.leavebirthDate ? props.data.leavebirthDate : "-" }} +
วันที่เข้ารับราชการ
-
{{ props.data.leavegovernmentDate }}
+
+ {{ + props.data.leavegovernmentDate + ? props.data.leavegovernmentDate + : "-" + }} +
เคย/ไม่เคยบวช
diff --git a/src/modules/13_salary/components/04_salaryLists/TabMain.vue b/src/modules/13_salary/components/04_salaryLists/TabMain.vue index 1631d2154..9f3fdc137 100644 --- a/src/modules/13_salary/components/04_salaryLists/TabMain.vue +++ b/src/modules/13_salary/components/04_salaryLists/TabMain.vue @@ -251,7 +251,7 @@ function fetchDataQuota(id: string) { * function เรียกข้อมูลรายชื่อ * @param id กลุ่ม */ -function fetchDataPeriod(id: string) { +async function fetchDataPeriod(id: string) { showLoader(); rows.value = []; let formData = { @@ -267,7 +267,7 @@ function fetchDataPeriod(id: string) { : "0", }; - http + await http .put(config.API.salaryListPeriodORG(id), formData) .then((res) => { rows.value = res.data.result.data; @@ -278,9 +278,7 @@ function fetchDataPeriod(id: string) { messageError($q, err); }) .finally(() => { - setTimeout(() => { - hideLoader(); - }, 1000); + hideLoader(); }); } diff --git a/src/modules/13_salary/views/04_salaryLists.vue b/src/modules/13_salary/views/04_salaryLists.vue index c1277a66e..9b1f9883a 100644 --- a/src/modules/13_salary/views/04_salaryLists.vue +++ b/src/modules/13_salary/views/04_salaryLists.vue @@ -121,11 +121,9 @@ async function getRound() { store.isClosedRound = roundFilter.value.isClose; salaryPeriodId.value = roundFilter.value.id; - await Promise.all([ - getSnap(roundFilter.value.shortCode), - getAgency(roundFilter.value.revisionId), - getAgencyPosition(roundFilter.value.revisionId), - ]); + await getSnap(roundFilter.value.shortCode); + await getAgency(roundFilter.value.revisionId); + await getAgencyPosition(roundFilter.value.revisionId); } else { isLoad.value = false; roundFilter.value = "ไม่มีข้อมูล"; @@ -143,7 +141,7 @@ async function getRound() { /** * function เรียกรอบ */ -function getSnap(code: string) { +async function getSnap(code: string) { snapOptions.value = code == "OCT" ? [ @@ -232,7 +230,7 @@ async function getAgencyPosition(id: string) { agencyFilter.value = position ? position.id : "ALL"; if (agencyFilter.value && roundFilter.value.id && snapFilter.value) { - fetchSalalyPeriod( + await fetchSalalyPeriod( agencyFilter.value, roundFilter.value.id, snapFilter.value @@ -257,7 +255,6 @@ async function fetchSalalyPeriod( snap: string ) { if (rootId) { - showLoader(); isLoad.value = false; const body = { rootId: rootId, @@ -286,11 +283,6 @@ async function fetchSalalyPeriod( }) .catch((err) => { messageError($q, err); - }) - .finally(() => { - setTimeout(() => { - hideLoader(); - }, 800); }); } } diff --git a/src/modules/13_salary/views/05_salaryListsEmployee.vue b/src/modules/13_salary/views/05_salaryListsEmployee.vue index 8a5ba899a..bd7d5daae 100644 --- a/src/modules/13_salary/views/05_salaryListsEmployee.vue +++ b/src/modules/13_salary/views/05_salaryListsEmployee.vue @@ -112,11 +112,9 @@ async function getRound() { store.roundMainCode = roundFilter.value.shortCode; store.isClosedRound = roundFilter.value.isClose; - await Promise.all([ - getSnap(roundFilter.value.shortCode), - getAgency(roundFilter.value.revisionId), - getAgencyPosition(roundFilter.value.revisionId), - ]); + await getSnap(roundFilter.value.shortCode); + await getAgency(roundFilter.value.revisionId); + await getAgencyPosition(roundFilter.value.revisionId); } else { isLoad.value = false; roundFilter.value = "ไม่มีข้อมูล"; @@ -220,7 +218,7 @@ async function getAgencyPosition(id: string) { agencyFilter.value = position ? position.id : "ALL"; if (agencyFilter.value && roundFilter.value.id && snapFilter.value) { - fetchSalalyPeriod( + await fetchSalalyPeriod( agencyFilter.value, roundFilter.value.id, snapFilter.value @@ -245,7 +243,6 @@ async function fetchSalalyPeriod( snap: string ) { if (rootId) { - showLoader(); isLoad.value = false; const body = { rootId: rootId, @@ -263,11 +260,6 @@ async function fetchSalalyPeriod( }) .catch((err) => { messageError($q, err); - }) - .finally(() => { - setTimeout(() => { - hideLoader(); - }, 1500); }); } } diff --git a/src/modules/15_development/components/history/AddPage.vue b/src/modules/15_development/components/history/AddPage.vue index 042e43f47..1ad00f9df 100644 --- a/src/modules/15_development/components/history/AddPage.vue +++ b/src/modules/15_development/components/history/AddPage.vue @@ -60,9 +60,9 @@ function getClass() { } /** ดึงข้อมูล */ -function fetchData() { +async function fetchData() { showLoader(); - http + await http .get(config.API.developmentHistoryListByid("officer", id.value)) .then((res) => { const data = res.data.result; @@ -104,9 +104,9 @@ function fetchData() { } /** ดึงข้อมูลเมื่อคอมโพเนนต์โหลดเสร็จสมบูรณ์ */ -onMounted(() => { +onMounted(async () => { if (id.value) { - fetchData(); + await fetchData(); } }); @@ -232,7 +232,11 @@ onMounted(() => {
- {{ Number(formMainProject.year) + 543 ?? "-" }} + {{ + formMainProject.year + ? Number(formMainProject.year) + 543 + : "-" + }}
diff --git a/src/modules/15_development/components/history/DialogGov.vue b/src/modules/15_development/components/history/DialogGov.vue index 96541bfaa..753b7ecb2 100644 --- a/src/modules/15_development/components/history/DialogGov.vue +++ b/src/modules/15_development/components/history/DialogGov.vue @@ -254,7 +254,6 @@ watch( :options="govOp" map-options emit-value - :class="getClass()" @update:model-value="inputSearch = ''" />
@@ -264,7 +263,6 @@ watch( outlined label="ค้นหา" v-model="inputSearch" - :class="getClass()" :mask="search === 'citizenId' ? '#############' : undefined" />
@@ -274,7 +272,7 @@ watch( class="full-width full-height" unelevated color="teal" - @click="searchFilter()" + @click="(formFilter.page = 1), searchFilter()" > diff --git a/src/modules/15_development/components/historyEmployee/AddPage.vue b/src/modules/15_development/components/historyEmployee/AddPage.vue index 4266de2b1..8319c75e2 100644 --- a/src/modules/15_development/components/historyEmployee/AddPage.vue +++ b/src/modules/15_development/components/historyEmployee/AddPage.vue @@ -235,7 +235,11 @@ onMounted(() => {
- {{ Number(formMainProject.year) + 543 ?? "-" }} + {{ + formMainProject.year + ? Number(formMainProject.year) + 543 + : "-" + }}
diff --git a/src/modules/15_development/components/scholarship/DetailView.vue b/src/modules/15_development/components/scholarship/DetailView.vue index 438cdacbe..463bdf5c8 100644 --- a/src/modules/15_development/components/scholarship/DetailView.vue +++ b/src/modules/15_development/components/scholarship/DetailView.vue @@ -173,9 +173,9 @@ const formBody = reactive({ * ดึงข้อมูลรายละเอียด * @param id จาก id */ -function fetchDataDetail(id: string) { +async function fetchDataDetail(id: string) { showLoader(); - http + await http .get(config.API.devScholarshipByid(id)) .then(async (res) => { const data: DataSholarship = await res.data.result; @@ -303,7 +303,7 @@ function onSubmit() { await http[method](url, formBody); scholarshipId.value - ? fetchDataDetail(scholarshipId.value) + ? await fetchDataDetail(scholarshipId.value) : router.push("/development/scholarship"); success($q, "บันทึกข้อมูลสำเร็จ"); } catch (e) { @@ -374,9 +374,9 @@ function onClickUpdateStatus(type: string) { showLoader(); http .get(config.API.devScholarshipStatus(scholarshipId.value, type)) - .then(() => { + .then(async () => { if (scholarshipId.value) { - fetchDataDetail(scholarshipId.value); + await fetchDataDetail(scholarshipId.value); } }) .catch((err) => { @@ -474,17 +474,12 @@ function upDate(data: DataPerson) { * @param id id ของรายการ */ async function checkFileBackReceived(id: string) { - showLoader(); await http .get( config.API.file("ระบบพัฒนาบุคคล", "ฟอร์มรายงานตัวกลับเข้ารับราชการ", id) ) .then(async (res) => { fileBackReceived.value = res.data.length > 0 ? res.data[0].fileName : ""; - }) - .catch(() => {}) - .finally(() => { - hideLoader(); }); } @@ -560,10 +555,10 @@ const convertCourse = () => { }; /** ดึงข้อมูลเมื่อคอมโพเนนต์โหลดเสร็จสมบูรณ์ */ -onMounted(() => { +onMounted(async () => { if (scholarshipId.value) { - fetchDataDetail(scholarshipId.value); - checkFileBackReceived(scholarshipId.value); + await fetchDataDetail(scholarshipId.value); + await checkFileBackReceived(scholarshipId.value); } }); @@ -621,395 +616,153 @@ onMounted(() => {
- - -
- -
- ข้อมูลราชการ - - เพิ่ม - -
-
-
-
-
-
เลขประจำตัวประชาชน
-
- {{ dataPerson.citizenId }} +
+ + +
+ +
+ ข้อมูลราชการ + + เพิ่ม + +
+
+
+
+
+
เลขประจำตัวประชาชน
+
+ {{ dataPerson.citizenId }} +
+
ชื่อ-นามสกุล
+
+ {{ dataPerson.name }} +
+
ตำแหน่ง
+
+ {{ dataPerson.position }} +
+
ตำแหน่งประเภท
+
+ {{ dataPerson.type }} +
-
ชื่อ-นามสกุล
-
- {{ dataPerson.name }} -
-
ตำแหน่ง
-
- {{ dataPerson.position }} -
-
ตำแหน่งประเภท
-
- {{ dataPerson.type }} +
+
+
+
ระดับตำแหน่ง
+
+ {{ dataPerson.level }} +
+
ตำแหน่งทางการบริหาร
+
+ {{ dataPerson.positionSide }} +
+
หน่วยงานที่สังกัด
+
+ {{ dataPerson.org }} +
-
-
-
ระดับตำแหน่ง
-
- {{ dataPerson.level }} -
-
ตำแหน่งทางการบริหาร
-
- {{ dataPerson.positionSide }} -
-
หน่วยงานที่สังกัด
-
{{ dataPerson.org }}
-
+
+ + เลือกข้าราชการ +
-
-
- - เลือกข้าราชการ - -
- -
- -
-
- -
-
- +
-
- - -
- -
-
- - - - - -
-
+
+
-
-
-
-
- -
-
- -
-
- + + !!val || `${'กรุณาเลือกประเภททุน'}`, + ]" />
-
- - - - - -
-
- - - - - -
-
- + +
-
-
- -
- -
- -
-
@@ -1019,21 +772,24 @@ onMounted(() => { }}