From 4291052cc08e42a0011978f76dae483bffa4ee1e Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 20 May 2025 14:44:20 +0700 Subject: [PATCH 01/44] fix bug datepicker --- .../04_registryPerson/views/edit/components/FormPosition.vue | 4 +--- src/style/quasar-variables.sass | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/04_registryPerson/views/edit/components/FormPosition.vue b/src/modules/04_registryPerson/views/edit/components/FormPosition.vue index 9d73f5cca..32221626b 100644 --- a/src/modules/04_registryPerson/views/edit/components/FormPosition.vue +++ b/src/modules/04_registryPerson/views/edit/components/FormPosition.vue @@ -1,4 +1,5 @@ + + + diff --git a/src/modules/04_registryPerson/views/edit/components/Table.vue b/src/modules/04_registryPerson/views/edit/components/Table.vue index 241a43c54..86f34ba6f 100644 --- a/src/modules/04_registryPerson/views/edit/components/Table.vue +++ b/src/modules/04_registryPerson/views/edit/components/Table.vue @@ -12,6 +12,7 @@ import type { QTableColumn } from "quasar"; import type { DataPosition } from "@/modules/04_registryPerson/interface/response/Edit"; import DialogForm from "@/modules/04_registryPerson/views/edit/components/DialogForm.vue"; +import DialogSort from "@/modules/04_registryPerson/views/edit/components/DialogSort.vue"; const $q = useQuasar(); const route = useRoute(); @@ -276,6 +277,7 @@ const columns = computed(() => { }); const modal = ref(false); +const modalSort = ref(false); /** function fetch ข้อมูลรายการตำแหน่งเงินเดือน*/ async function fetchData() { @@ -410,7 +412,19 @@ onMounted(() => { From a9886869f743ef93b1f58b5ecee74659574e31e2 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 21 May 2025 16:35:28 +0700 Subject: [PATCH 07/44] fix --- .../04_registryPerson/views/edit/components/DialogSort.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/modules/04_registryPerson/views/edit/components/DialogSort.vue b/src/modules/04_registryPerson/views/edit/components/DialogSort.vue index 2eb33fb9d..8ae625f38 100644 --- a/src/modules/04_registryPerson/views/edit/components/DialogSort.vue +++ b/src/modules/04_registryPerson/views/edit/components/DialogSort.vue @@ -14,7 +14,6 @@ import type { DataPosition } from "@/modules/04_registryPerson/interface/respons /** importComponents*/ import DialogHeader from "@/components/DialogHeader.vue"; -import { co } from "@fullcalendar/core/internal-common"; /** use*/ const $q = useQuasar(); @@ -55,7 +54,6 @@ function onSubmit() { dialogConfirm($q, async () => { showLoader(); const body = rowsData.value.map((e: any) => e.id); - console.log("body", body); await http .put(config.API.salaryTemp + `/change/sort/${profileId.value}`, { id: body, From 77455843f08743c187fb54a18ed9c21a9ac4a20d Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 22 May 2025 09:19:41 +0700 Subject: [PATCH 08/44] fix isConfirmEdit --- src/modules/04_registryPerson/views/edit/components/Table.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/04_registryPerson/views/edit/components/Table.vue b/src/modules/04_registryPerson/views/edit/components/Table.vue index 86f34ba6f..aef4b53a1 100644 --- a/src/modules/04_registryPerson/views/edit/components/Table.vue +++ b/src/modules/04_registryPerson/views/edit/components/Table.vue @@ -414,7 +414,7 @@ onMounted(() => {
Date: Thu, 22 May 2025 16:57:36 +0700 Subject: [PATCH 09/44] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84?= =?UTF-8?q?=E0=B8=82=E0=B8=97=E0=B8=B0=E0=B9=80=E0=B8=9A=E0=B8=B5=E0=B8=A2?= =?UTF-8?q?=E0=B8=99=20=3D=3D=3D>=20=20fix=20DragandDrop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/edit/components/DialogSort.vue | 219 +++++++++++------- 1 file changed, 135 insertions(+), 84 deletions(-) diff --git a/src/modules/04_registryPerson/views/edit/components/DialogSort.vue b/src/modules/04_registryPerson/views/edit/components/DialogSort.vue index 8ae625f38..6cae824e4 100644 --- a/src/modules/04_registryPerson/views/edit/components/DialogSort.vue +++ b/src/modules/04_registryPerson/views/edit/components/DialogSort.vue @@ -40,14 +40,14 @@ const profileId = ref(route.params.id.toString()); //id profile /** ข้อมูล Table*/ const rowsData = ref([]); -/** - * fiunction จัดลำดับ - * @param from ตำแหน่งปัจุบัน - * @param to ตำแหน่งที่จะย้ายไป - */ -function onDrop(from: number, to: number) { - rowsData.value.splice(to - 1, 0, rowsData.value.splice(from - 1, 1)[0]); -} +// /** +// * fiunction จัดลำดับ +// * @param from ตำแหน่งปัจุบัน +// * @param to ตำแหน่งที่จะย้ายไป +// */ +// function onDrop(from: number, to: number) { +// rowsData.value.splice(to - 1, 0, rowsData.value.splice(from - 1, 1)[0]); +// } /** function บันทึกการจัดลำดับ*/ function onSubmit() { @@ -72,6 +72,62 @@ function onSubmit() { }); } +let draggedIndex = -1; // index ของ item ที่ถูก drag +const cardSectionRef = ref(null); // ref สำหรับ container ที่จะ scroll + +/** + * ฟังก์ชันนี้ใช้สำหรับการ drag item + * @param index index ของ item ที่ถูก drag + */ +function onDragStart(index: number) { + //จะทำการ set draggedIndex เป็น index ที่ถูก drag + draggedIndex = index; +} + +/** + * ฟังก์ชันนี้ใช้สำหรับการ drop item + * @param targetIndex index ที่จะ drop + */ +function onDrop(targetIndex: number) { + // ถ้า draggedIndex เป็น -1 หรือ draggedIndex เท่ากับ targetIndex จะไม่ทำอะไร + if (draggedIndex === -1 || draggedIndex === targetIndex) return; + // ถ้า draggedIndex ไม่เท่ากับ targetIndex จะทำการย้าย item + const item = rowsData.value.splice(draggedIndex, 1)[0]; + rowsData.value.splice(targetIndex, 0, item); + draggedIndex = -1; +} + +/** + * ฟังก์ชันนี้ใช้สำหรับการเลื่อน scroll ของ container + * @param e DragEvent + * @description ทำให้ scroll container ได้เวลา drag อยู่ใกล้ขอบ + */ +function onDragOver(e: DragEvent) { + let container = cardSectionRef.value; + // ถ้าเป็น vue proxy ให้ใช้ container.$el + if (container && (container as any).$el) { + container = (container as any).$el; + } + // ถ้า container ไม่ใช่ HTMLElement ให้แสดง warning + if ( + !container || + typeof (container as HTMLElement).getBoundingClientRect !== "function" + ) { + console.warn("container is not HTMLElement:", container); + return; + } + const rect = (container as HTMLElement).getBoundingClientRect(); + const offset = 40; // ระยะห่างจากขอบที่ต้องการให้ scroll + const scrollSpeed = 30; // ความเร็วในการ scroll + + // ถ้า mouse อยู่ใกล้ขอบบนหรือขอบล่างของ container ให้ scroll + if (e.clientY < rect.top + offset) { + (container as HTMLElement).scrollTop -= scrollSpeed; + } else if (e.clientY > rect.bottom - offset) { + (container as HTMLElement).scrollTop += scrollSpeed; + } +} + watch(modal, async () => { if (modal.value && props.dataSort) { const dataList = props.dataSort; @@ -82,82 +138,77 @@ watch(modal, async () => { }); From 9912c0c068c414ff130b6655c6e27d51fb2200c5 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Thu, 22 May 2025 17:37:24 +0700 Subject: [PATCH 10/44] modify display order column position salary --- .../views/edit/components/Table.vue | 177 +++++++++--------- 1 file changed, 89 insertions(+), 88 deletions(-) diff --git a/src/modules/04_registryPerson/views/edit/components/Table.vue b/src/modules/04_registryPerson/views/edit/components/Table.vue index aef4b53a1..90f6edbfb 100644 --- a/src/modules/04_registryPerson/views/edit/components/Table.vue +++ b/src/modules/04_registryPerson/views/edit/components/Table.vue @@ -65,48 +65,6 @@ const baseColumns = ref([ style: "font-size: 14px", format: (v) => date2Thai(v), }, - { - name: "commandDateSign", - align: "left", - label: "วันที่ลงนาม", - sortable: false, - field: "commandDateSign", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format: (v) => date2Thai(v), - }, - { - name: "posNumCodeSit", - align: "left", - label: "หน่วยงานที่ออกคำสั่ง", - sortable: false, - field: "posNumCodeSit", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format(val, row) { - return row.posNumCodeSitAbb && row.posNumCodeSit - ? `${row.posNumCodeSit} (${row.posNumCodeSitAbb})` - : row.posNumCodeSit - ? row.posNumCodeSit - : "-"; - }, - }, - { - name: "posNo", - align: "left", - label: empType.value === "employee" ? "ตำแหน่งเลขที่" : "เลขที่ตำแหน่ง", - sortable: false, - field: "posNo", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format(val, row) { - return row.posNoAbb && row.posNo - ? `${row.posNoAbb} ${row.posNo}` - : row.posNo - ? row.posNo - : "-"; - }, - }, { name: "positionName", align: "left", @@ -152,50 +110,6 @@ const baseColumns = ref([ headerStyle: "font-size: 14px", style: "font-size: 14px", }, - { - name: "commandNo", - align: "left", - label: "เลขที่คำสั่ง", - sortable: false, - field: "commandNo", - format(val, row) { - return row.commandNo && row.commandYear - ? `${row.commandNo}/${Number(row.commandYear) + 543}` - : ""; - }, - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "commandCode", - align: "left", - label: "ประเภทคำสั่ง", - sortable: false, - field: "commandCode", - format(val, row) { - return store.convertCommandCodeName(val); - }, - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "organization", - align: "left", - label: "สังกัด", - sortable: false, - field: "organization", - headerStyle: "font-size: 14px;min-width: 280px", - style: "font-size: 14px", - format(val, row) { - return findOrgName({ - root: row.orgRoot, - child1: row.orgChild1, - child2: row.orgChild2, - child3: row.orgChild3, - child4: row.orgChild4, - }); - }, - }, { name: "amount", align: "left", @@ -234,7 +148,92 @@ const baseColumns = ref([ style: "font-size: 14px", format: (v) => Number(v).toLocaleString(), }, - + { + name: "organization", + align: "left", + label: "สังกัด", + sortable: false, + field: "organization", + headerStyle: "font-size: 14px;min-width: 280px", + style: "font-size: 14px", + format(val, row) { + return findOrgName({ + root: row.orgRoot, + child1: row.orgChild1, + child2: row.orgChild2, + child3: row.orgChild3, + child4: row.orgChild4, + }); + }, + }, + { + name: "posNo", + align: "left", + label: empType.value === "employee" ? "ตำแหน่งเลขที่" : "เลขที่ตำแหน่ง", + sortable: false, + field: "posNo", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + format(val, row) { + return row.posNoAbb && row.posNo + ? `${row.posNoAbb} ${row.posNo}` + : row.posNo + ? row.posNo + : "-"; + }, + }, + { + name: "posNumCodeSit", + align: "left", + label: "หน่วยงานที่ออกคำสั่ง", + sortable: false, + field: "posNumCodeSit", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + format(val, row) { + return row.posNumCodeSitAbb && row.posNumCodeSit + ? `${row.posNumCodeSit} (${row.posNumCodeSitAbb})` + : row.posNumCodeSit + ? row.posNumCodeSit + : "-"; + }, + }, + { + name: "commandNo", + align: "left", + label: "เลขที่คำสั่ง", + sortable: false, + field: "commandNo", + format(val, row) { + return row.commandNo && row.commandYear + ? `${row.commandNo}/${Number(row.commandYear) + 543}` + : ""; + }, + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "commandDateSign", + align: "left", + label: "วันที่ลงนาม", + sortable: false, + field: "commandDateSign", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + format: (v) => date2Thai(v), + }, + { + name: "commandCode", + align: "left", + label: "ประเภทคำสั่ง", + sortable: false, + field: "commandCode", + format(val, row) { + return store.convertCommandCodeName(val); + }, + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, { name: "remark", align: "left", @@ -414,7 +413,9 @@ onMounted(() => {
Date: Fri, 23 May 2025 11:34:22 +0700 Subject: [PATCH 11/44] =?UTF-8?q?fix=20=20rules=20=E0=B9=80=E0=B8=87?= =?UTF-8?q?=E0=B8=B4=E0=B8=99=E0=B9=80=E0=B8=94=E0=B8=B7=E0=B8=AD=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/edit/components/DialogForm.vue | 24 ++++++++++--------- .../views/edit/components/FormPosition.vue | 1 - .../views/edit/components/Table.vue | 4 ++-- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/modules/04_registryPerson/views/edit/components/DialogForm.vue b/src/modules/04_registryPerson/views/edit/components/DialogForm.vue index e2efa0648..6e352bc59 100644 --- a/src/modules/04_registryPerson/views/edit/components/DialogForm.vue +++ b/src/modules/04_registryPerson/views/edit/components/DialogForm.vue @@ -268,7 +268,7 @@ async function updateSelectType(val: string, status: boolean = false) { })); formData.positionLevel = !status ? "" : formData.positionLevel; - } + } // else { // store.posLevelData = []; // // formData.positionLevel = ""; @@ -369,16 +369,18 @@ function onSubmit() { type: empType.value?.toLocaleUpperCase(), commandDateAffect: convertDateToAPI(formData.commandDateAffect), commandDateSign: convertDateToAPI(formData.commandDateSign), - amount: Number(String(formData.amount)?.replace(/,/g, "")), - amountSpecial: Number( - String(formData.amountSpecial)?.replace(/,/g, "") - ), - positionSalaryAmount: Number( - String(formData.positionSalaryAmount)?.replace(/,/g, "") - ), - mouthSalaryAmount: Number( - String(formData.mouthSalaryAmount)?.replace(/,/g, "") - ), + amount: formData.amount + ? Number(String(formData.amount)?.replace(/,/g, "")) + : null, + amountSpecial: formData.amountSpecial + ? Number(String(formData.amountSpecial)?.replace(/,/g, "")) + : null, + positionSalaryAmount: formData.positionSalaryAmount + ? Number(String(formData.positionSalaryAmount)?.replace(/,/g, "")) + : null, + mouthSalaryAmount: formData.mouthSalaryAmount + ? Number(String(formData.mouthSalaryAmount)?.replace(/,/g, "")) + : null, }) .then(async () => { await props.fetchData?.(); diff --git a/src/modules/04_registryPerson/views/edit/components/FormPosition.vue b/src/modules/04_registryPerson/views/edit/components/FormPosition.vue index e0e169407..2beb7b820 100644 --- a/src/modules/04_registryPerson/views/edit/components/FormPosition.vue +++ b/src/modules/04_registryPerson/views/edit/components/FormPosition.vue @@ -588,7 +588,6 @@ function classInput(val: boolean) { label="เงินเดือน" mask="###,###,###,###" reverse-fill-mask - :rules="!isReadonly ? [(val:string) => !!val || `${'กรุณากรอกเงินเดือน'}`] :[]" lazy-rules hide-bottom-space /> diff --git a/src/modules/04_registryPerson/views/edit/components/Table.vue b/src/modules/04_registryPerson/views/edit/components/Table.vue index 90f6edbfb..1d88103f3 100644 --- a/src/modules/04_registryPerson/views/edit/components/Table.vue +++ b/src/modules/04_registryPerson/views/edit/components/Table.vue @@ -136,7 +136,7 @@ const baseColumns = ref([ field: "mouthSalaryAmount", headerStyle: "font-size: 14px", style: "font-size: 14px", - format: (v) => Number(v).toLocaleString(), + format: (v) => (v ? Number(v).toLocaleString() : "-"), }, { name: "positionSalaryAmount", @@ -146,7 +146,7 @@ const baseColumns = ref([ field: "positionSalaryAmount", headerStyle: "font-size: 14px", style: "font-size: 14px", - format: (v) => Number(v).toLocaleString(), + format: (v) => (v ? Number(v).toLocaleString() : "-"), }, { name: "organization", From 1b42277dcb58baf2982336d2cf2fd46f17de67b8 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 23 May 2025 11:47:17 +0700 Subject: [PATCH 12/44] fix .prevent --- src/modules/01_masterdata/views/Assignment.vue | 2 +- src/modules/02_organization/components/DialogMovePos.vue | 2 +- src/modules/03_recruiting/components/Table.vue | 2 +- src/modules/03_recruiting/components/Table1.vue | 2 +- src/modules/03_recruiting/components/TableCan.vue | 2 +- src/modules/03_recruiting/interface/index/Main.ts | 2 +- .../components/requestEdit/01_TabInformation.vue | 2 +- .../04_registryPerson/components/requestEdit/02_TabIDP.vue | 2 +- .../05_placement/components/AppointEmployee/DialogOrders.vue | 2 +- .../05_placement/components/AppointMent/DialogOrders.vue | 2 +- .../05_placement/components/Help-Government/DialogOrders.vue | 2 +- src/modules/05_placement/components/Other/DialogOrders.vue | 2 +- .../components/PersonalDetail/Information/TableEducation.vue | 2 +- .../05_placement/components/PersonalList/CardPosition.vue | 2 +- .../05_placement/components/PersonalList/DialogOrders.vue | 2 +- src/modules/05_placement/components/PersonalList/Table.vue | 2 +- .../05_placement/components/PersonalList/TableView.vue | 2 +- src/modules/05_placement/components/Receive/DialogOrders.vue | 2 +- .../05_placement/components/Repatriate/DialogOrders.vue | 2 +- src/modules/05_placement/components/Transfer/DialogOrders.vue | 2 +- src/modules/05_placement/components/probation/DialogOrder.vue | 2 +- .../components/probation/DialogOrder/DialogSendToCommand.vue | 2 +- src/modules/05_placement/components/probation/MainAppoint.vue | 2 +- .../05_placement/components/probation/ProbationDetail.vue | 2 +- src/modules/05_placement/views/01_Main.vue | 2 +- src/modules/05_placement/views/03_receiveMain.vue | 2 +- src/modules/05_placement/views/04_helpGovernmentMain.vue | 2 +- src/modules/05_placement/views/05_repatriateMain.vue | 2 +- src/modules/05_placement/views/06_appointPromoteMain.vue | 2 +- src/modules/05_placement/views/07_appointEmployeeMain.vue | 2 +- src/modules/05_placement/views/08_otherMain.vue | 2 +- .../components/01_retirement/RetirementDetail.vue | 2 +- .../components/02_resign/DialogSendToCommand.vue | 2 +- src/modules/06_retirement/components/02_resign/Table.vue | 2 +- .../components/03_resignEmp/DialogSendToCommand.vue | 2 +- src/modules/06_retirement/components/03_resignEmp/Table.vue | 2 +- .../06_retirement/components/05_deceased/SendCircularPage.vue | 2 +- .../components/06_dismissOrder/DialogSendToCommand.vue | 2 +- .../components/06_dismissOrder/DialogSendToCommandEmp.vue | 2 +- src/modules/06_retirement/views/01_retirement.vue | 2 +- src/modules/06_retirement/views/04_exitInterview.vue | 2 +- src/modules/06_retirement/views/05_deceased.vue | 2 +- src/modules/06_retirement/views/06_dismissOrder.vue | 2 +- src/modules/06_retirement/views/08_dismissOrderEmp.vue | 2 +- src/modules/07_insignia/components/1_Round/DialogDetail.vue | 2 +- .../07_insignia/components/2_Manage/InfoAssessments.vue | 2 +- src/modules/07_insignia/components/2_Manage/InfoInsignia.vue | 2 +- src/modules/07_insignia/components/2_Manage/Tab1.vue | 4 ++-- src/modules/07_insignia/components/2_Manage/Tab2.vue | 2 +- src/modules/07_insignia/components/2_Manage/Tab3.vue | 2 +- src/modules/07_insignia/views/01_RoundMain.vue | 2 +- src/modules/09_leave/views/01_RoundMain.vue | 2 +- .../components/6_BasicInformation/Channel/MainPage.vue | 2 +- .../components/Detail/viewTab2/DialogDirector.vue | 2 +- .../components/Detail/viewTab2/DialogMeet.vue | 2 +- .../12_evaluatePersonal/components/Director/MainPage.vue | 2 +- .../12_evaluatePersonal/components/Meeting/MainPage.vue | 2 +- src/modules/13_salary/components/04_salaryLists/Dashboard.vue | 2 +- .../13_salary/components/05_salaryListsEmployee/Dashboard.vue | 2 +- src/modules/13_salary/components/InfoDiscipline.vue | 2 +- src/modules/13_salary/components/InfoLeave.vue | 2 +- src/modules/13_salary/components/InfoSalary.vue | 2 +- src/modules/14_KPI/components/results/tableIndividual.vue | 2 +- src/modules/14_KPI/components/results/tableResults.vue | 2 +- src/modules/16_positionEmployee/components/DialogMovePos.vue | 2 +- src/modules/17_acting/views/main.vue | 4 ++-- src/modules/18_command/components/Step/2_ListPersons.vue | 2 +- src/modules/18_command/components/Step/3_ReceivedCopy.vue | 2 +- src/modules/18_command/views/lists.vue | 2 +- src/modules/20_positionTemp/components/DialogMovePos.vue | 2 +- 70 files changed, 72 insertions(+), 72 deletions(-) diff --git a/src/modules/01_masterdata/views/Assignment.vue b/src/modules/01_masterdata/views/Assignment.vue index 853ca7bf0..ee4f43807 100644 --- a/src/modules/01_masterdata/views/Assignment.vue +++ b/src/modules/01_masterdata/views/Assignment.vue @@ -258,7 +258,7 @@ onMounted(() => { outlined v-model="formFilter.keyword" label="ค้นหา" - @keydown.enter="fetchNewList" + @keydown.enter.prevent="fetchNewList" >