From 90b933d2889ab5b6d408c1122fc7e1689c24bbb4 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 15 May 2024 09:10:18 +0700 Subject: [PATCH 1/3] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=84?= =?UTF-8?q?=E0=B8=B3=E0=B8=9C=E0=B8=B7=E0=B8=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/detail/PersonalInformation/04_FamilyNew.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/04_registryNew/components/detail/PersonalInformation/04_FamilyNew.vue b/src/modules/04_registryNew/components/detail/PersonalInformation/04_FamilyNew.vue index 2b9ebe1d9..bf800018b 100644 --- a/src/modules/04_registryNew/components/detail/PersonalInformation/04_FamilyNew.vue +++ b/src/modules/04_registryNew/components/detail/PersonalInformation/04_FamilyNew.vue @@ -793,7 +793,7 @@ onMounted(() => { - +
From b0e5bc6b469464795275e03fc8316176c13b9b87 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 15 May 2024 09:52:44 +0700 Subject: [PATCH 2/3] check citizenId --- .../components/DialogAddData.vue | 4 +++- .../04_registryNew/components/TableView.vue | 1 + .../detail/PersonalInformation/01_Profile.vue | 23 ++++++++++++++++++- .../PersonalInformation/04_FamilyNew.vue | 16 ++++--------- 4 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/modules/04_registryNew/components/DialogAddData.vue b/src/modules/04_registryNew/components/DialogAddData.vue index 0ddfae294..10a72a587 100644 --- a/src/modules/04_registryNew/components/DialogAddData.vue +++ b/src/modules/04_registryNew/components/DialogAddData.vue @@ -30,6 +30,7 @@ const { } = useCounterMixin(); const { calculateAge } = profileStore; const modal = defineModel("modal", { required: true }); +const empType = defineModel("empType", { required: true }); const props = defineProps({ fetchData: { type: Function }, @@ -140,8 +141,9 @@ function clearFormData() { async function onSubmit() { dialogConfirm($q, async () => { + const type = empType.value !== "officer" ? "-employee" : ""; await http - .post(config.API.registryNew, formData) + .post(config.API.registryNew(type), formData) .then(() => { success($q, "บันทึกข้อมูลสำเร็จ"); props.fetchData?.(); diff --git a/src/modules/04_registryNew/components/TableView.vue b/src/modules/04_registryNew/components/TableView.vue index c413313f4..6f8bc3084 100644 --- a/src/modules/04_registryNew/components/TableView.vue +++ b/src/modules/04_registryNew/components/TableView.vue @@ -457,6 +457,7 @@ watch( v-model:modal="modalDialogAdd" :fetchData="props.fetchData" :fetchType="props.fetchType" + :empType="empType" /> diff --git a/src/modules/04_registryNew/components/detail/PersonalInformation/01_Profile.vue b/src/modules/04_registryNew/components/detail/PersonalInformation/01_Profile.vue index 84021f7e6..a22ac5703 100644 --- a/src/modules/04_registryNew/components/detail/PersonalInformation/01_Profile.vue +++ b/src/modules/04_registryNew/components/detail/PersonalInformation/01_Profile.vue @@ -23,6 +23,7 @@ const { date2Thai, messageError, dialogConfirm, + dialogMessageNotify, } = mixin; const { calculateAge, fetchPerson, filterSelector } = store; const profileId = ref( @@ -334,7 +335,7 @@ function onSubmit() { async function clickHistory() { modalHistory.value = true; await http - .get(config.API.profileNewProfileHisById(id.value,empType.value)) + .get(config.API.profileNewProfileHisById(id.value, empType.value)) .then((res) => { rowsHistory.value = res.data.result; }) @@ -346,6 +347,25 @@ async function clickHistory() { }); } +function changeCardID(citizenId: string | number | null) { + if (citizenId != null && typeof citizenId == "string") { + if (citizenId.length == 13 && citizenId) { + http + .put(config.API.profileNewCitizenId(citizenId), { + citizenId: citizenId, + }) + .then(() => {}) + .catch((err) => { + if (err.response.data.status === 500) { + dialogMessageNotify($q, err.response.data.message); + } else { + messageError($q, err); + } + }); + } + } +} + watch( () => formData.birthDate, (v) => { @@ -498,6 +518,7 @@ onMounted(async () => { val.length >= 13 || `${'กรุณากรอกเลขประจำตัวประชาชนให้ครบ'}`, ]" + @update:model-value="changeCardID" />
diff --git a/src/modules/04_registryNew/components/detail/PersonalInformation/04_FamilyNew.vue b/src/modules/04_registryNew/components/detail/PersonalInformation/04_FamilyNew.vue index bf800018b..007107ec1 100644 --- a/src/modules/04_registryNew/components/detail/PersonalInformation/04_FamilyNew.vue +++ b/src/modules/04_registryNew/components/detail/PersonalInformation/04_FamilyNew.vue @@ -133,7 +133,9 @@ const fromData = reactive({ statusMarital: "", }); -function onSubmit() { +function onSubmit(type: string) { + console.log(type); + dialogConfirm($q, () => { closeDialog(); }); @@ -224,14 +226,6 @@ function fetchData() { }, ]; - const data3 = { - isLive: 1, - citizenId: "1231231231231", - prefix: "นาย", - firstName: "ตรีชาไทย", - lastName: "หวังดี", - job: "จอมพล", - }; spouseData.value = data; childData.value = data2; } @@ -605,7 +599,7 @@ onMounted(() => { - + { บันทึกข้อมูล From 48e2209c30b09fc04eedf12b15fe1246707508df Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 15 May 2024 10:57:02 +0700 Subject: [PATCH 3/3] =?UTF-8?q?=E0=B9=82=E0=B8=84=E0=B8=A3=E0=B8=87?= =?UTF-8?q?=E0=B8=AA=E0=B8=A3=E0=B9=89=E0=B8=B2=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../02_organizationalNew/components/DialogSuccession.vue | 9 +++++---- .../16_positionEmployee/components/DialogSuccession.vue | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/modules/02_organizationalNew/components/DialogSuccession.vue b/src/modules/02_organizationalNew/components/DialogSuccession.vue index 51f37a424..d6fca2c21 100644 --- a/src/modules/02_organizationalNew/components/DialogSuccession.vue +++ b/src/modules/02_organizationalNew/components/DialogSuccession.vue @@ -128,11 +128,12 @@ async function fetchTable() { const list = data.map((e: PosMaster) => ({ ...e, posMasterNo: - e.orgShortname + - e.posMasterNoPrefix + - e.posMasterNo + - e.posMasterNoSuffix, + (e.orgShortname !== null ? e.orgShortname : "") + + (e.posMasterNoPrefix ? e.posMasterNoPrefix : "") + + (e.posMasterNo !== null ? e.posMasterNo : "") + + (e.posMasterNoSuffix !== null ? e.posMasterNoPrefix : ""), })); + rows.value = list; }) .catch((err) => { diff --git a/src/modules/16_positionEmployee/components/DialogSuccession.vue b/src/modules/16_positionEmployee/components/DialogSuccession.vue index 0693b9b52..3334c340b 100644 --- a/src/modules/16_positionEmployee/components/DialogSuccession.vue +++ b/src/modules/16_positionEmployee/components/DialogSuccession.vue @@ -127,10 +127,10 @@ async function fetchTable() { const list = data.map((e: PosMaster) => ({ ...e, posMasterNo: - e.orgShortname + - e.posMasterNoPrefix + - e.posMasterNo + - e.posMasterNoSuffix, + (e.orgShortname !== null ? e.orgShortname : "") + + (e.posMasterNoPrefix ? e.posMasterNoPrefix : "") + + (e.posMasterNo !== null ? e.posMasterNo : "") + + (e.posMasterNoSuffix !== null ? e.posMasterNoPrefix : ""), })); rows.value = list; })