From 421b410a03b23076353a8941b4fb908ff69849d5 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 13 Sep 2023 11:31:54 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=AB=E0=B8=99=E0=B9=89=E0=B8=B2=E0=B8=97?= =?UTF-8?q?=E0=B8=B0=E0=B9=80=E0=B8=9A=E0=B8=B5=E0=B8=A2=E0=B8=99=E0=B8=9B?= =?UTF-8?q?=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1=E0=B8=95=E0=B8=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Information/Address.vue | 31 ++++++++++++---- .../components/Information/Certicate.vue | 7 ++-- .../components/Information/Family.vue | 16 ++++++--- .../components/Information/Information.vue | 25 ++++++++++--- .../PersonalDetail/Information/Address.vue | 26 +++++++------- .../views/Information/Address.vue | 36 ++++++++++++++----- .../views/Information/Information.vue | 15 ++++++-- .../views/Information/Tempinformation.vue | 16 +++++++-- .../views/SalaryEmployee.vue | 6 ++-- 9 files changed, 131 insertions(+), 47 deletions(-) diff --git a/src/modules/04_registry/components/Information/Address.vue b/src/modules/04_registry/components/Information/Address.vue index 703c3dc98..0409ca28d 100644 --- a/src/modules/04_registry/components/Information/Address.vue +++ b/src/modules/04_registry/components/Information/Address.vue @@ -638,12 +638,31 @@ const fetchData = async () => { const data: ResponseObject = res.data.result; addressData.value.address = data.registrationAddress; addressData.value.addressC = data.currentAddress; - addressData.value.districtId = data.registrationDistrictId; - addressData.value.districtIdC = data.currentDistrictId; - addressData.value.provinceId = data.registrationProvinceId; - addressData.value.provinceIdC = data.currentProvinceId; - addressData.value.subdistrictId = data.registrationSubDistrictId; - addressData.value.subdistrictIdC = data.currentSubDistrictId; + addressData.value.districtId = + data.registrationDistrictId !== "00000000-0000-0000-0000-000000000000" + ? data.registrationDistrictId + : ""; + addressData.value.districtIdC = + data.currentDistrictId !== "00000000-0000-0000-0000-000000000000" + ? data.currentDistrictId + : ""; + addressData.value.provinceId = + data.registrationProvinceId !== "00000000-0000-0000-0000-000000000000" + ? data.registrationProvinceId + : ""; + addressData.value.provinceIdC = + data.currentProvinceId !== "00000000-0000-0000-0000-000000000000" + ? data.currentProvinceId + : ""; + addressData.value.subdistrictId = + data.registrationSubDistrictId !== + "00000000-0000-0000-0000-000000000000" + ? data.registrationSubDistrictId + : ""; + addressData.value.subdistrictIdC = + data.currentSubDistrictId !== "00000000-0000-0000-0000-000000000000" + ? data.currentSubDistrictId + : ""; addressData.value.same = data.registrationSame ? "1" : "0"; addressData.value.codec = data.currentZipCode; addressData.value.codep = data.registrationZipCode; diff --git a/src/modules/04_registry/components/Information/Certicate.vue b/src/modules/04_registry/components/Information/Certicate.vue index 5248f136d..28dccf505 100644 --- a/src/modules/04_registry/components/Information/Certicate.vue +++ b/src/modules/04_registry/components/Information/Certicate.vue @@ -47,8 +47,8 @@ icon="mdi-history" @click="clickHistory(props.row)" > - ประวัติแก้ไขใบอนุญาตประกอบอาชีพ - + ประวัติแก้ไขใบอนุญาตประกอบอาชีพ + @@ -294,7 +294,8 @@ const store = useProfileDataStore(); const { profileData, changeProfileColumns } = store; const mixin = useCounterMixin(); -const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } = mixin; +const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } = + mixin; const route = useRoute(); const id = ref(""); const certificateNo = ref(); diff --git a/src/modules/04_registry/components/Information/Family.vue b/src/modules/04_registry/components/Information/Family.vue index 346a2ad9e..4684dc02a 100644 --- a/src/modules/04_registry/components/Information/Family.vue +++ b/src/modules/04_registry/components/Information/Family.vue @@ -1345,7 +1345,10 @@ const fetchData = async () => { .then((res) => { const data: ResponseObject = res.data.result; familyData.value.prefixC = ""; - familyData.value.prefixIdC = data.couplePrefixId; + familyData.value.prefixIdC = + data.couplePrefixId !== "00000000-0000-0000-0000-000000000000" + ? data.couplePrefixId + : ""; familyData.value.firstnameC = data.coupleFirstName; familyData.value.lastnameC = data.coupleLastName; familyData.value.lastnameCOld = data.coupleLastNameOld; @@ -1359,10 +1362,15 @@ const fetchData = async () => { familyData.value.lastnameM = data.fatherLastName; familyData.value.occupationM = data.fatherCareer; familyData.value.liveM = data.fatherLive ? "1" : "0"; - familyData.value.citizenIdM = data.fatherCitizenId; - + familyData.value.citizenIdM = + data.fatherCitizenId !== "00000000-0000-0000-0000-000000000000" + ? data.fatherCitizenId + : ""; familyData.value.prefixF = ""; - familyData.value.prefixIdF = data.motherPrefixId; + familyData.value.prefixIdF = + data.motherPrefixId !== "00000000-0000-0000-0000-000000000000" + ? data.motherPrefixId + : ""; familyData.value.firstnameF = data.motherFirstName; familyData.value.lastnameF = data.motherLastName; familyData.value.occupationF = data.motherCareer; diff --git a/src/modules/04_registry/components/Information/Information.vue b/src/modules/04_registry/components/Information/Information.vue index a2aaa480e..21655e314 100644 --- a/src/modules/04_registry/components/Information/Information.vue +++ b/src/modules/04_registry/components/Information/Information.vue @@ -1017,16 +1017,31 @@ const fetchData = async () => { defaultCitizenData.value = data.citizenId; informaData.value.cardid = data.citizenId; informaData.value.prefix = ""; - informaData.value.prefixId = data.prefixId; + informaData.value.prefixId = + data.prefixId !== "00000000-0000-0000-0000-000000000000" + ? data.prefixId + : ""; informaData.value.firstname = data.firstName; informaData.value.lastname = data.lastName; informaData.value.birthDate = new Date(data.birthDate); - informaData.value.genderId = data.genderId; - informaData.value.bloodId = data.bloodGroupId; + informaData.value.genderId = + data.genderId !== "00000000-0000-0000-0000-000000000000" + ? data.genderId + : ""; + informaData.value.bloodId = + data.bloodGroupId !== "00000000-0000-0000-0000-000000000000" + ? data.bloodGroupId + : ""; informaData.value.nationality = data.nationality; informaData.value.ethnicity = data.race; - informaData.value.statusId = data.relationshipId; - informaData.value.religionId = data.religionId; + informaData.value.statusId = + data.relationshipId !== "00000000-0000-0000-0000-000000000000" + ? data.relationshipId + : ""; + informaData.value.religionId = + data.religionId !== "00000000-0000-0000-0000-000000000000" + ? data.religionId + : ""; informaData.value.tel = data.telephoneNumber; informaData.value.age = data.age; informaData.value.employeeType = data.employeeType; diff --git a/src/modules/05_placement/components/PersonalDetail/Information/Address.vue b/src/modules/05_placement/components/PersonalDetail/Information/Address.vue index ce83dfee2..1aa8ead26 100644 --- a/src/modules/05_placement/components/PersonalDetail/Information/Address.vue +++ b/src/modules/05_placement/components/PersonalDetail/Information/Address.vue @@ -46,8 +46,6 @@ const { date2Thai, success, messageError, showLoader, hideLoader } = mixin; const edit = ref(false); const addressData = ref(props.data); const myform = ref(); -const codep = ref(""); -const codec = ref(""); const Ops = ref({ provinceOps: [], districtOps: [], @@ -132,7 +130,7 @@ const editData = async () => { registrationSubDistrictId: addressData.value.registSubDistrictId, registrationDistrictId: addressData.value.registDistrictId, registrationProvinceId: addressData.value.registProvinceId, - registrationZipCode: codep.value, + registrationZipCode: addressData.value.registZipCode, currentAddress: addressData.value.registSame == "1" ? addressData.value.registAddress @@ -143,14 +141,16 @@ const editData = async () => { : addressData.value.currentSubDistrictId, currentDistrictId: addressData.value.registSame == "1" - ? addressData.value.registDistrict + ? addressData.value.registDistrictId : addressData.value.currentDistrictId, currentProvinceId: addressData.value.registSame == "1" ? addressData.value.registProvinceId : addressData.value.currentProvinceId, currentZipCode: - addressData.value.registSame == "1" ? codep.value : codec.value, + addressData.value.registSame == "1" + ? addressData.value.registZipCode + : addressData.value.currentZipCode, }; showLoader(); await http @@ -184,11 +184,11 @@ const selectProvince = async (e: string | null, name: string) => { if (name == "1") { addressData.value.registDistrictId = ""; addressData.value.registSubDistrictId = ""; - codep.value = ""; + addressData.value.registZipCode = ""; } else { addressData.value.currentDistrictId = ""; addressData.value.currentSubDistrictId = ""; - codec.value = ""; + addressData.value.currentZipCode = ""; } myform.value.resetValidation(); await fetchDistrict(e, name); @@ -199,10 +199,10 @@ const selectDistrict = async (e: string | null, name: string) => { if (e != null) { if (name == "1") { addressData.value.registSubDistrictId = ""; - codep.value = ""; + addressData.value.registZipCode = ""; } else { addressData.value.currentSubDistrictId = ""; - codec.value = ""; + addressData.value.currentZipCode = ""; } myform.value.resetValidation(); await fetchSubDistrict(e, name); @@ -214,11 +214,11 @@ const selectSubDistrict = (e: string | null, name: string) => { if (name == "1") { const findcode = Ops.value.subdistrictOps.filter((r) => r.id == e); const namecode = findcode.length > 0 ? findcode[0].zipCode : ""; - codep.value = namecode; + addressData.value.registZipCode = namecode; } else { const findcode = Ops.value.subdistrictCOps.filter((r) => r.id == e); const namecode = findcode.length > 0 ? findcode[0].zipCode : ""; - codec.value = namecode; + addressData.value.currentZipCode = namecode; } } }; @@ -440,7 +440,7 @@ const getClass = (val: boolean) => { lazy-rules readonly borderless - v-model="codep" + v-model="addressData.registZipCode" :style="!edit ? '' : 'padding:0 12px;'" :label="`${'รหัสไปรษณีย์'}`" /> @@ -584,7 +584,7 @@ const getClass = (val: boolean) => { lazy-rules readonly borderless - v-model="codec" + v-model="addressData.currentZipCode" :style="!edit ? '' : 'padding:0 12px;'" :label="`${'รหัสไปรษณีย์'}`" /> diff --git a/src/modules/08_registryEmployee/views/Information/Address.vue b/src/modules/08_registryEmployee/views/Information/Address.vue index abd64d95c..fe29239b4 100644 --- a/src/modules/08_registryEmployee/views/Information/Address.vue +++ b/src/modules/08_registryEmployee/views/Information/Address.vue @@ -643,24 +643,44 @@ const fetchData = async () => { .get(config.API.profileAdrsId(route.params.id.toString())) .then((res) => { const data: ResponseObject = res.data.result; + console.log(data); + addressData.value.address = data.registrationAddress; addressData.value.addressC = data.currentAddress; - addressData.value.districtId = data.registrationDistrictId; - addressData.value.districtIdC = data.currentDistrictId; - addressData.value.provinceId = data.registrationProvinceId; - addressData.value.provinceIdC = data.currentProvinceId; - addressData.value.subdistrictId = data.registrationSubDistrictId; - addressData.value.subdistrictIdC = data.currentSubDistrictId; + addressData.value.districtId = + data.registrationDistrictId !== "00000000-0000-0000-0000-000000000000" + ? data.registrationDistrictId + : ""; + addressData.value.districtIdC = + data.currentDistrictId !== "00000000-0000-0000-0000-000000000000" + ? data.currentDistrictId + : ""; + addressData.value.provinceId = + data.registrationProvinceId !== "00000000-0000-0000-0000-000000000000" + ? data.registrationProvinceId + : ""; + addressData.value.provinceIdC = + data.currentProvinceId !== "00000000-0000-0000-0000-000000000000" + ? data.currentProvinceId + : ""; + addressData.value.subdistrictId = + data.registrationSubDistrictId !== + "00000000-0000-0000-0000-000000000000" + ? data.registrationSubDistrictId + : ""; + addressData.value.subdistrictIdC = + data.currentSubDistrictId !== "00000000-0000-0000-0000-000000000000" + ? data.currentSubDistrictId + : ""; addressData.value.same = data.registrationSame ? "1" : "0"; addressData.value.codec = data.currentZipCode; addressData.value.codep = data.registrationZipCode; - console.log(res); }) .catch((e) => { messageError($q, e); }) - .finally(() => { + .finally(async () => { hideLoader(); }); } diff --git a/src/modules/08_registryEmployee/views/Information/Information.vue b/src/modules/08_registryEmployee/views/Information/Information.vue index c6d077732..795814635 100644 --- a/src/modules/08_registryEmployee/views/Information/Information.vue +++ b/src/modules/08_registryEmployee/views/Information/Information.vue @@ -1022,12 +1022,21 @@ const fetchData = async () => { informaData.value.firstname = data.firstName; informaData.value.lastname = data.lastName; informaData.value.birthDate = new Date(data.birthDate); - informaData.value.genderId = data.genderId; + informaData.value.genderId = + data.genderId !== "00000000-0000-0000-0000-000000000000" + ? data.genderId + : ""; informaData.value.bloodId = data.bloodGroupId; informaData.value.nationality = data.nationality; informaData.value.ethnicity = data.race; - informaData.value.statusId = data.relationshipId; - informaData.value.religionId = data.religionId; + informaData.value.statusId = + data.relationshipId !== "00000000-0000-0000-0000-000000000000" + ? data.relationshipId + : ""; + informaData.value.religionId = + data.religionId !== "00000000-0000-0000-0000-000000000000" + ? data.religionId + : ""; informaData.value.tel = data.telephoneNumber; informaData.value.age = data.age; informaData.value.employeeType = data.employeeType; diff --git a/src/modules/08_registryEmployee/views/Information/Tempinformation.vue b/src/modules/08_registryEmployee/views/Information/Tempinformation.vue index 74a1e51b4..e060d1ec4 100644 --- a/src/modules/08_registryEmployee/views/Information/Tempinformation.vue +++ b/src/modules/08_registryEmployee/views/Information/Tempinformation.vue @@ -486,6 +486,8 @@ const fetchData = async () => { // console.log(res); // }); const data: any = res.data.result; + console.log(data); + informaTempData.value.employeeMoneyIncrease = data.employeeMoneyIncrease; informaTempData.value.employeeMoneyAllowance = @@ -495,11 +497,19 @@ const fetchData = async () => { informaTempData.value.employeeMoneyEmployer = data.employeeMoneyEmployer; informaTempData.value.positionEmployeeGroupId = - data.positionEmployeeGroupId; + data.positionEmployeeGroupId !== + "00000000-0000-0000-0000-000000000000" + ? data.positionEmployeeGroupId + : ""; informaTempData.value.positionEmployeePositionId = - data.positionEmployeePositionId; + data.positionEmployeePositionId !== + "00000000-0000-0000-0000-000000000000" + ? data.positionEmployeePositionId + : ""; informaTempData.value.positionEmployeeLineId = - data.positionEmployeeLineId; + data.positionEmployeeLineId !== "00000000-0000-0000-0000-000000000000" + ? data.positionEmployeeLineId + : ""; informaTempData.value.employeeTypeIndividual = data.employeeTypeIndividual; informaTempData.value.employeeOc = data.employeeOc; diff --git a/src/modules/08_registryEmployee/views/SalaryEmployee.vue b/src/modules/08_registryEmployee/views/SalaryEmployee.vue index 5c4a7d51e..047b169da 100644 --- a/src/modules/08_registryEmployee/views/SalaryEmployee.vue +++ b/src/modules/08_registryEmployee/views/SalaryEmployee.vue @@ -1498,7 +1498,6 @@ const fetchData = async () => { .get(config.API.profileSalaryEmployeeId(profileId.value)) .then((res) => { const data = res.data.result; - // console.log(data); rows.value = []; data.map((e: ResponseObjectEmployee) => { rows.value.push({ @@ -1510,7 +1509,10 @@ const fetchData = async () => { oc: e.oc, ocId: e.ocId, posNo: e.posNo, - posNoId: e.posNoId, + posNoId: + e.posNoId !== "00000000-0000-0000-0000-000000000000" + ? e.posNoId + : "", posNoEmployee: e.posNoEmployee, positionEmployeeGroup: e.positionEmployeeGroup, positionEmployeeGroupId: e.positionEmployeeGroupId,