From a51c1fe518b1b08d87e42d769a64a28f08fde99b Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 11 Nov 2024 09:33:25 +0700 Subject: [PATCH 1/9] =?UTF-8?q?=E0=B8=A3=E0=B8=B0=E0=B8=9A=E0=B8=9A?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=A5=E0=B8=B2>>=E0=B8=A5?= =?UTF-8?q?=E0=B8=B2=E0=B8=AD=E0=B8=B8=E0=B8=9B=E0=B8=AA=E0=B8=A1=E0=B8=9A?= =?UTF-8?q?=E0=B8=97=20(=E0=B8=82=E0=B9=89=E0=B8=AD=E0=B8=A1=E0=B8=B9?= =?UTF-8?q?=E0=B8=A5=E0=B8=A7=E0=B8=B1=E0=B8=99=E0=B8=97=E0=B8=B5=E0=B9=88?= =?UTF-8?q?=E0=B8=A5=E0=B8=B2=E0=B9=84=E0=B8=A1=E0=B9=88=E0=B9=81=E0=B8=AA?= =?UTF-8?q?=E0=B8=94=E0=B8=87)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../09_leave/components/2_Leave/formDetail/formUpasom.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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..e300a49bf 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 }}
จำนวนวันที่ลา
From f0187c9ffea9dbc1dace997b8c7aa65dca9b9897 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 11 Nov 2024 10:05:51 +0700 Subject: [PATCH 2/9] =?UTF-8?q?=E0=B8=A3=E0=B8=B0=E0=B8=9A=E0=B8=9A?= =?UTF-8?q?=E0=B9=80=E0=B8=84=E0=B8=A3=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=87?= =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=8A=E0=B8=AF>>=E0=B8=9A=E0=B8=B1?= =?UTF-8?q?=E0=B8=99=E0=B8=97=E0=B8=B6=E0=B8=81=E0=B8=9C=E0=B8=A5=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=E0=B9=80=E0=B8=AA=E0=B8=99=E0=B8=AD=E0=B8=82?= =?UTF-8?q?=E0=B8=AD=20(=E0=B8=82=E0=B9=89=E0=B8=AD=E0=B8=A1=E0=B8=B9?= =?UTF-8?q?=E0=B8=A5=E0=B8=84=E0=B8=AD=E0=B8=A5=E0=B8=B1=E0=B8=A1=E0=B8=99?= =?UTF-8?q?=E0=B9=8C=E0=B8=95=E0=B8=B3=E0=B9=81=E0=B8=AB=E0=B8=99=E0=B9=88?= =?UTF-8?q?=E0=B8=87)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/07_insignia/views/03_ResultMain.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) 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", From f7b89557ad2923be2cd8b1519323f09b51fd48b8 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 11 Nov 2024 10:13:18 +0700 Subject: [PATCH 3/9] =?UTF-8?q?=E0=B8=A3=E0=B8=B0=E0=B8=9A=E0=B8=9A?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=A5=E0=B8=B2=20Admin=20>>=20?= =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=A5=E0=B8=B0=E0=B9=80=E0=B8=AD?= =?UTF-8?q?=E0=B8=B5=E0=B8=A2=E0=B8=94=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=A5?= =?UTF-8?q?=E0=B8=B2=20(=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=E0=B8=82=E0=B8=B5=E0=B8=94=20(-)=20=E0=B9=80=E0=B8=A1=E0=B8=B7?= =?UTF-8?q?=E0=B9=88=E0=B8=AD=E0=B8=82=E0=B9=89=E0=B8=AD=E0=B8=A1=E0=B8=B9?= =?UTF-8?q?=E0=B8=A5=E0=B9=84=E0=B8=A1=E0=B9=88=E0=B8=A1=E0=B8=B5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../09_leave/components/2_Leave/DetailLeave.vue | 5 ++--- .../2_Leave/formDetail/formCheckSelect.vue | 8 +++++++- .../components/2_Leave/formDetail/formChildbirth.vue | 4 +++- .../components/2_Leave/formDetail/formLeave.vue | 4 +++- .../2_Leave/formDetail/formLeaveToTraining.vue | 8 +++++++- .../components/2_Leave/formDetail/formSpouse.vue | 12 ++++++++++-- .../components/2_Leave/formDetail/formUpasom.vue | 12 ++++++++++-- 7 files changed, 42 insertions(+), 11 deletions(-) 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 e300a49bf..d009f26b4 100644 --- a/src/modules/09_leave/components/2_Leave/formDetail/formUpasom.vue +++ b/src/modules/09_leave/components/2_Leave/formDetail/formUpasom.vue @@ -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 + : "-" + }} +
เคย/ไม่เคยบวช
From a97db383ae768831b2d7ff5d1e5c8b25a47163a4 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 11 Nov 2024 10:38:30 +0700 Subject: [PATCH 4/9] =?UTF-8?q?fix=20=E0=B8=82=E0=B8=AD=20=E0=B9=82?= =?UTF-8?q?=E0=B8=AD=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/05_placement/components/Transfer/TransferDetail.vue | 1 - 1 file changed, 1 deletion(-) 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 ) { From 74981c4217cc30d84c1df8cb0c72360c0f83212e Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 11 Nov 2024 10:43:22 +0700 Subject: [PATCH 5/9] fix workflow --- src/modules/06_retirement/components/resign/ResignByid.vue | 1 - src/modules/06_retirement/components/resign/ResignReject.vue | 1 - src/modules/06_retirement/components/resignEMP/ResignByid.vue | 1 - src/modules/06_retirement/components/resignEMP/ResignReject.vue | 1 - 4 files changed, 4 deletions(-) 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 From 247989c9e853364d3228b98d7b4ef5d3adfda450 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 11 Nov 2024 11:23:34 +0700 Subject: [PATCH 6/9] =?UTF-8?q?fix=20=E0=B8=A3=E0=B8=B0=E0=B8=9A=E0=B8=9A?= =?UTF-8?q?=E0=B8=9E=E0=B8=B1=E0=B8=92=E0=B8=99=E0=B8=B2=E0=B8=9A=E0=B8=B8?= =?UTF-8?q?=E0=B8=84=E0=B8=84=E0=B8=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/history/AddPage.vue | 14 +- .../components/history/DialogGov.vue | 4 +- .../components/historyEmployee/AddPage.vue | 6 +- .../components/scholarship/DetailView.vue | 4700 +++++++++-------- .../15_development/views/EmployeeHistory.vue | 14 +- src/modules/15_development/views/History.vue | 16 +- .../15_development/views/Scholarship.vue | 2 - 7 files changed, 2387 insertions(+), 2369 deletions(-) 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(() => { }} diff --git a/src/modules/04_registryPerson/components/Dialog/DialogUpdate.vue b/src/modules/04_registryPerson/components/Dialog/DialogUpdate.vue index 65e635510..45a403489 100644 --- a/src/modules/04_registryPerson/components/Dialog/DialogUpdate.vue +++ b/src/modules/04_registryPerson/components/Dialog/DialogUpdate.vue @@ -159,12 +159,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 +174,10 @@ function onSubmit() { showLoader(); http .patch( - config.API.requestInformationbyType("myprofile", storeRequestEdit.profileId), + config.API.requestInformationbyType( + "myprofile", + storeRequestEdit.profileId + ), body ) .then(async (res) => { @@ -195,51 +198,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 +254,34 @@ async function amiRequest() { formInformations.firstName = data.value.firstName; formInformations.lastName = data.value.lastName; formInformations.nationality = data.value.nationalityDesc; + + // แปลง dateOfBirth เป็น format 1989-01-01 formInformations.birthDate = 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 = data.value.registrationProvinceId; + // formDataAddress.registrationDistrictId = data.value.registrationDistrictId; + // formDataAddress.registrationSubDistrictId = + // data.value.registrationSubDistrictId; + // formDataAddress.registrationZipCode = data.value.registrationZipCode; + + console.log("province===>", data.value.provinceDesc); + console.log("district===>", data.value.districtDesc); + console.log("subdistrict===>", data.value.subdistrictDesc); } watch( @@ -300,7 +325,6 @@ watch(
-
diff --git a/src/modules/04_registryPerson/interface/request/Profile.ts b/src/modules/04_registryPerson/interface/request/Profile.ts index f3bc095c5..fcd9e6232 100644 --- a/src/modules/04_registryPerson/interface/request/Profile.ts +++ b/src/modules/04_registryPerson/interface/request/Profile.ts @@ -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; } From 0d769363a460c76fd64307f1126dbbc7d51cbeaa Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 11 Nov 2024 16:12:58 +0700 Subject: [PATCH 9/9] =?UTF-8?q?=E0=B8=82=E0=B8=AD=E0=B9=81=E0=B8=81?= =?UTF-8?q?=E0=B9=89=E0=B9=84=E0=B8=82=E0=B8=97=E0=B8=B0=E0=B9=80=E0=B8=9A?= =?UTF-8?q?=E0=B8=B5=E0=B8=A2=E0=B8=99=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7?= =?UTF-8?q?=E0=B8=B1=E0=B8=95=E0=B8=B4=20mapping=20=E0=B9=81=E0=B8=A5?= =?UTF-8?q?=E0=B8=B0=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20format=20?= =?UTF-8?q?=E0=B8=82=E0=B9=89=E0=B8=AD=E0=B8=A1=E0=B8=B9=E0=B8=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Dialog/DialogUpdate.vue | 123 ++++++++++++++---- .../interface/request/Profile.ts | 2 +- 2 files changed, 97 insertions(+), 28 deletions(-) diff --git a/src/modules/04_registryPerson/components/Dialog/DialogUpdate.vue b/src/modules/04_registryPerson/components/Dialog/DialogUpdate.vue index 45a403489..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 { @@ -256,7 +257,7 @@ async function amiRequest() { formInformations.nationality = data.value.nationalityDesc; // แปลง dateOfBirth เป็น format 1989-01-01 - formInformations.birthDate = data.value.dateOfBirth; + formInformations.birthDate = conventDateOfBirth(`${data.value.dateOfBirth}`); age.value = storeLinkCenter.calculateAge(data.value.age); formInformations.gender = data.value.genderDesc; @@ -273,15 +274,75 @@ async function amiRequest() { formDataAddress.registrationAddress = registrationAddress; // ค้นหา จังหวัด อำเภอ ตำบล และรหัสไปรษณื - // formDataAddress.registrationProvinceId = data.value.registrationProvinceId; - // formDataAddress.registrationDistrictId = data.value.registrationDistrictId; - // formDataAddress.registrationSubDistrictId = - // data.value.registrationSubDistrictId; + 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); + // 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( @@ -291,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; } } ); diff --git a/src/modules/04_registryPerson/interface/request/Profile.ts b/src/modules/04_registryPerson/interface/request/Profile.ts index fcd9e6232..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;