From 90960dd551b8a9f9672479d279031fc4a5e1a31c Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 19 Mar 2024 13:30:19 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=81=E0=B8=B2?= =?UTF-8?q?=E0=B8=A3=E0=B9=80=E0=B8=A5=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=99?= =?UTF-8?q?=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99=E0=B9=80=E0=B8=94=E0=B8=B7?= =?UTF-8?q?=E0=B8=AD=E0=B8=99=E0=B8=A5=E0=B8=B9=E0=B8=81=E0=B8=88=E0=B9=89?= =?UTF-8?q?=E0=B8=B2=E0=B8=87=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=88=E0=B8=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/13_salary/api.salary.ts | 10 +++ .../SalaryEmployeeLists/DialogAddPerson.vue | 17 ++--- .../SalaryEmployeeLists/DialogFormEdit.vue | 2 +- .../SalaryEmployeeLists/DialogMoveLevel.vue | 31 ++++----- .../SalaryEmployeeLists/DialogProperties.vue | 47 ++++---------- .../SalaryEmployeeLists/ProcessStep.vue | 65 ++++++++++++++++--- .../SalaryEmployeeLists/TabMain.vue | 4 -- .../SalaryEmployeeLists/TableTypeOther.vue | 22 +++---- .../SalaryEmployeeLists/TableTypePending.vue | 22 +++---- .../SalaryLists/DialogMoveLevel.vue | 2 +- .../13_salary/views/salaryEmployeeLists.vue | 30 ++++----- src/modules/13_salary/views/salaryLists.vue | 7 +- 12 files changed, 138 insertions(+), 121 deletions(-) diff --git a/src/api/13_salary/api.salary.ts b/src/api/13_salary/api.salary.ts index 09786c1e9..1ebcbf9e1 100644 --- a/src/api/13_salary/api.salary.ts +++ b/src/api/13_salary/api.salary.ts @@ -65,4 +65,14 @@ export default { salaryListPeriodQuotaEmp: (id: string) => `${salaryPeriodEmp}/quota/${id}`, salaryListPeriodORGEmp: (id: string) => `${salaryPeriodEmp}/org/${id}`, salaryPeriodProfileEmp: `${salaryPeriodEmp}/org/profile`, + salaryListPersonEmp: `${env.API_URI}/org/profile-employee/salary/gen`, + salaryPeriodEmp: () => `${salaryPeriodEmp}`, + salaryPropertyEmp: (id: string) => `${salaryPeriodEmp}/org/property/${id}`, + salaryListPeriodProfileByIdEmp: (id: string) => + `${salaryPeriodEmp}/profile/${id}`, + + salaryPeriodStatusEmp: (type: string, periodId: string, rootId: string) => + `${salaryPeriodEmp}/${type}/approve/${periodId}/${rootId}`, + salaryPeriodStatusCommentEmp: (type: string, periodId: string, rootId: string) => + `${salaryPeriodEmp}/${type}/comment/${periodId}/${rootId}`, }; diff --git a/src/modules/13_salary/components/SalaryEmployeeLists/DialogAddPerson.vue b/src/modules/13_salary/components/SalaryEmployeeLists/DialogAddPerson.vue index cd73e137b..2c68cc393 100644 --- a/src/modules/13_salary/components/SalaryEmployeeLists/DialogAddPerson.vue +++ b/src/modules/13_salary/components/SalaryEmployeeLists/DialogAddPerson.vue @@ -112,19 +112,12 @@ function closeModal() { /** function เรียกรายชื่อ คนเลื่อนเงินเดือน*/ function fetchListPerson() { showLoader(); - // formFilter.rootId = store.rootId; - // formFilter.period = store.roundMainCode; - // formFilter.year = store.roundYear; - const reqBody = { - posTypeId: "", // id ประเภทตำแหน่ง - posLevelId: "", // id ระดับตำแหน่ง - position: "", // ตำแหน่ง - page: formFilter.page, //*หน้า - pageSize: formFilter.pageSize, //*จำนวนแถวต่อหน้า - keyword: formFilter.keyword, //นามสกุล ชื่อ สกุล เลขบัตร - }; + formFilter.rootId = store.rootId; + formFilter.period = store.roundMainCode; + formFilter.year = store.roundYear; + http - .post(config.API.orgSearchProfileEmp, reqBody) + .post(config.API.salaryListPersonEmp, formFilter) .then((res) => { const data = res.data.result.data; maxPage.value = Math.ceil(res.data.result.total / formFilter.pageSize); diff --git a/src/modules/13_salary/components/SalaryEmployeeLists/DialogFormEdit.vue b/src/modules/13_salary/components/SalaryEmployeeLists/DialogFormEdit.vue index 832096723..3f8893b56 100644 --- a/src/modules/13_salary/components/SalaryEmployeeLists/DialogFormEdit.vue +++ b/src/modules/13_salary/components/SalaryEmployeeLists/DialogFormEdit.vue @@ -53,7 +53,7 @@ function onSubmit() { : Number(amountString.replace(/,/g, "")), }; http - .post(config.API.salaryPeriod() + `/change/amount`, body) + .post(config.API.salaryPeriodEmp() + `/change/amount`, body) .then(() => { success($q, "บันทึกข้อมูลสำเร็จ"); props.fetchData?.(); diff --git a/src/modules/13_salary/components/SalaryEmployeeLists/DialogMoveLevel.vue b/src/modules/13_salary/components/SalaryEmployeeLists/DialogMoveLevel.vue index 75e6a2f7d..d6113dba8 100644 --- a/src/modules/13_salary/components/SalaryEmployeeLists/DialogMoveLevel.vue +++ b/src/modules/13_salary/components/SalaryEmployeeLists/DialogMoveLevel.vue @@ -14,14 +14,8 @@ import { useSalaryEmployeeListSDataStore } from "@/modules/13_salary/store/Salar /** use*/ const $q = useQuasar(); const store = useSalaryEmployeeListSDataStore(); -const { - dialogConfirm, - success, - messageError, - showLoader, - hideLoader, - dialogMessageNotify, -} = useCounterMixin(); +const { dialogConfirm, success, messageError, showLoader, hideLoader } = + useCounterMixin(); /**porps*/ const modal = defineModel("modal", { required: true }); @@ -41,32 +35,29 @@ const isChange = ref(false); // มีการแก้ไขข้อ const isReserve = ref(false); // สำรองหรือไม่ const typeRangeOps = computed(() => { - return store.roundMainCode == "OCT" + return store.roundMainCode === "OCT" ? [ { id: "NONE", name: "ไม่ได้เลื่อน" }, { id: "HAFT", name: "0.5 ขั้น" }, { id: "FULL", name: "1 ขั้น" }, { id: "FULLHAFT", name: "1.5 ขั้น" }, ] - : [ + : store.roundMainCode === "APR" + ? [ { id: "NONE", name: "ไม่ได้เลื่อน" }, { id: "HAFT", name: "0.5 ขั้น" }, { id: "FULL", name: "1 ขั้น" }, + ] + : [ + { id: "HAFT", name: "0.5 ขั้น" }, + { id: "FULL", name: "1 ขั้น" }, ]; }); /*** ฟังก์ชั่นสำหรับ validate ฟอร์ม */ function validateForm() { if (typeRef.value.validate()) { - // if ( - // store.roundMainCode === "APR" && - // store.remaining === 0 && - // type.value === "FULL" - // ) { - // dialogMessageNotify($q, "ไม่สามารถย้ายขั้นได้เนื่องจากโควตาคงเหลือไม่พอ"); - // } else { onSubmit(); - // } } } @@ -86,7 +77,7 @@ function onSubmit() { isReserve: isReserve.value, }; http - .post(config.API.salaryPeriod() + `/change/type`, body) + .post(config.API.salaryPeriodEmp() + `/change/type`, body) .then(() => { success($q, "บันทึกข้อมูลสำเร็จ"); props.fetchData?.(); @@ -104,7 +95,7 @@ function onSubmit() { watch( () => modal.value, () => { - type.value = props.typeLevel == 'PENDING' ? "" : props.typeLevel; + type.value = props.typeLevel == "PENDING" ? "" : props.typeLevel; isReserve.value = props.isReserve; isChange.value = false; } diff --git a/src/modules/13_salary/components/SalaryEmployeeLists/DialogProperties.vue b/src/modules/13_salary/components/SalaryEmployeeLists/DialogProperties.vue index 0bad57794..c9ed6f8c4 100644 --- a/src/modules/13_salary/components/SalaryEmployeeLists/DialogProperties.vue +++ b/src/modules/13_salary/components/SalaryEmployeeLists/DialogProperties.vue @@ -37,34 +37,16 @@ const props = defineProps({ }); const type = ref(""); -const typeRef = ref(null); -const isReadonly = ref(false); // อ่านได้อย่างเดียว const isPunish = ref(false); // มีการแก้ไขข้อมูลหรือไม่ const isSuspension = ref(false); // สำรองหรือไม่ const isAbsent = ref(false); // สำรองหรือไม่ const isLeave = ref(false); // สำรองหรือไม่ -const typeRangeOps = computed(() => { - return store.roundMainCode == "OCT" - ? [ - { id: "NONE", name: "ไม่ได้เลื่อน" }, - { id: "HAFT", name: "0.5 ขั้น" }, - { id: "FULL", name: "1 ขั้น" }, - { id: "FULLHAFT", name: "1.5 ขั้น" }, - ] - : [ - { id: "NONE", name: "ไม่ได้เลื่อน" }, - { id: "HAFT", name: "0.5 ขั้น" }, - { id: "FULL", name: "1 ขั้น" }, - ]; -}); - /*** ฟังก์ชั่นสำหรับ validate ฟอร์ม */ function validateForm() { - onSubmit(); - } - + onSubmit(); +} /** function ปืด Popup */ function close() { @@ -77,13 +59,13 @@ function onSubmit() { dialogConfirm($q, () => { showLoader(); const body = { - isPunish: isPunish.value, - isSuspension: isSuspension.value, - isAbsent: isAbsent.value, - isLeave: isLeave.value, + isPunish: isPunish.value, + isSuspension: isSuspension.value, + isAbsent: isAbsent.value, + isLeave: isLeave.value, }; http - .put(config.API.salaryProperty(profileId.value), body) + .put(config.API.salaryPropertyEmp(profileId.value), body) .then(() => { success($q, "บันทึกข้อมูลสำเร็จ"); props.fetchData?.(); @@ -107,13 +89,6 @@ watch( isLeave.value = props.isLeave; } ); - -function inputEdit(val: boolean) { - return { - "full-width cursor-pointer inputgreen ": val, - "full-width cursor-pointer inputgreen": !val, - }; -}