From 2a815f4f40c8edf6fdd21ec9658f1691adb4a957 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 4 Mar 2024 13:41:25 +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=87=E0=B8=B4=E0=B8=99=E0=B9=80=E0=B8=94?= =?UTF-8?q?=E0=B8=B7=E0=B8=AD=E0=B8=99=20=3D>=20MessageNotif=20=E0=B8=A2?= =?UTF-8?q?=E0=B9=89=E0=B8=B2=E0=B8=A2=E0=B8=82=E0=B8=B1=E0=B9=89=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SalaryLists/DialogMoveLevel.vue | 20 ++++++++++++++++--- .../components/SalaryLists/TabMain.vue | 1 + .../13_salary/store/SalaryListsStore.ts | 6 +++++- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/modules/13_salary/components/SalaryLists/DialogMoveLevel.vue b/src/modules/13_salary/components/SalaryLists/DialogMoveLevel.vue index 927edf3d1..bf17891a0 100644 --- a/src/modules/13_salary/components/SalaryLists/DialogMoveLevel.vue +++ b/src/modules/13_salary/components/SalaryLists/DialogMoveLevel.vue @@ -14,8 +14,14 @@ import { useSalaryListSDataStore } from "@/modules/13_salary/store/SalaryListsSt /** use*/ const $q = useQuasar(); const store = useSalaryListSDataStore(); -const { dialogConfirm, success, messageError, showLoader, hideLoader } = - useCounterMixin(); +const { + dialogConfirm, + success, + messageError, + showLoader, + hideLoader, + dialogMessageNotify, +} = useCounterMixin(); /**porps*/ const modal = defineModel("modal", { required: true }); @@ -48,7 +54,15 @@ const typeRangeOps = computed(() => { /*** ฟังก์ชั่นสำหรับ validate ฟอร์ม */ function validateForm() { if (typeRef.value.validate()) { - onSubmit(); + if ( + store.roundMainCode === "APR" && + store.remaining === 0 && + type.value === "FULL" + ) { + dialogMessageNotify($q, "ไม่สามารถย้ายขั้นได้เนื่องจากโควตาลงเหลือไม่พอ"); + } else { + onSubmit(); + } } } diff --git a/src/modules/13_salary/components/SalaryLists/TabMain.vue b/src/modules/13_salary/components/SalaryLists/TabMain.vue index 2c3ecafd1..82029d672 100644 --- a/src/modules/13_salary/components/SalaryLists/TabMain.vue +++ b/src/modules/13_salary/components/SalaryLists/TabMain.vue @@ -187,6 +187,7 @@ async function fetchDataQuota(id: string) { .get(config.API.salaryListPeriodQuota(id)) .then((res) => { const data = res.data.result; + store.remaining = data.remaining; itemsCard.value[0].total = data.total; itemsCard.value[1].total = data.fifteenPercent; itemsCard.value[2].total = data.chosen; diff --git a/src/modules/13_salary/store/SalaryListsStore.ts b/src/modules/13_salary/store/SalaryListsStore.ts index 93fcb323c..b30efff38 100644 --- a/src/modules/13_salary/store/SalaryListsStore.ts +++ b/src/modules/13_salary/store/SalaryListsStore.ts @@ -16,6 +16,8 @@ export const useSalaryListSDataStore = defineStore("salaryListStore", () => { { id: "", name: "กลุ่ม2" }, ]); + const remaining = ref(0); + const groupId = ref(""); const rootId = ref(""); const roundMainCode = ref(""); @@ -63,6 +65,8 @@ export const useSalaryListSDataStore = defineStore("salaryListStore", () => { rootId, roundCode, groupOp, - roundMainCode + roundMainCode, + + remaining, }; });