From 3e39d421f384606b6bf1c02a7c20273c710f69a6 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 18 Mar 2024 16:03:57 +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=82=E0=B9=89=E0=B8=B2=E0=B8=A3=E0=B8=B2?= =?UTF-8?q?=E0=B8=8A=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=AF=20=3D>=20new?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/13_salary/api.salary.ts | 26 +- .../SalaryEmployeeLists/DialogAddPerson.vue | 2 +- .../SalaryEmployeeLists/TabMain.vue | 10 +- .../SalaryEmployeeLists/TableTypeOther.vue | 16 +- .../SalaryLists/DialogMoveLevel.vue | 9 +- .../components/SalaryLists/TabMain.vue | 59 ++-- .../components/SalaryLists/TableTypeOther.vue | 16 +- .../SalaryLists/TableTypePending.vue | 61 ++-- .../interface/response/SalaryList.ts | 2 +- .../store/SalaryEmployeeListsStore.ts | 289 +++++++++--------- .../13_salary/views/salaryEmployeeLists.vue | 6 +- src/modules/13_salary/views/salaryLists.vue | 33 +- 12 files changed, 301 insertions(+), 228 deletions(-) diff --git a/src/api/13_salary/api.salary.ts b/src/api/13_salary/api.salary.ts index c99cdd567..cc44168ef 100644 --- a/src/api/13_salary/api.salary.ts +++ b/src/api/13_salary/api.salary.ts @@ -2,6 +2,7 @@ import env from "../index"; const salary = `${env.API_URI}/salary`; const salaryRate = `${env.API_URI}/salary/rate`; const salaryPeriod = `${env.API_URI}/salary/period`; +const salaryPeriodEmp = `${env.API_URI}/salary/period-employee`; const salaryOrg = `${env.API_URI}/org/employee`; const salaryFormula = `${env.API_URI}/salary/formula`; @@ -31,7 +32,8 @@ export default { salaryListPeriodProfileById: (id: string) => `${salaryPeriod}/profile/${id}`, salaryListPerson: `${env.API_URI}/org/profile/salary/gen`, salaryPeriodProfile: `${salary}/period/org/profile`, - + salaryReportListsByid: (type: string, rootId: string, periodId: string) => + `${salary}/report/${type}/${rootId}/${periodId}`, salaryProperty: (id: string) => `${salaryPeriod}/org/property/${id}`, /** รายการเงินเดือนลูกจ้างประจำ*/ @@ -45,13 +47,21 @@ export default { salaryEmployeeRateList: `${salaryRate}/employee`, salaryEmployeeRateListByid: (id: string) => `${salaryRate}/employee/${id}`, - salaryEmployeePosType:()=>`${salaryOrg}/pos/type`, - salaryFormula:()=>`${salaryFormula}`, - salaryFormulaById:(id:string)=>`${salaryFormula}/${id}`, - salaryEmployeePositionType:(key:string)=>`${salaryOrg}/pos/position?keyword=${key}&type=positionType`, - salaryEmployeeActive :()=>`${salary}/employee/active`, + salaryEmployeePosType: () => `${salaryOrg}/pos/type`, + salaryFormula: () => `${salaryFormula}`, + salaryFormulaById: (id: string) => `${salaryFormula}/${id}`, + salaryEmployeePositionType: (key: string) => + `${salaryOrg}/pos/position?keyword=${key}&type=positionType`, + salaryEmployeeActive: () => `${salary}/employee/active`, + salaryPeriodStatus: (type: string, periodId: string, rootId: string) => + `${salaryPeriod}/${type}/approve/${periodId}/${rootId}`, + salaryPeriodStatusComment: (type: string, periodId: string, rootId: string) => + `${salaryPeriod}/${type}/comment/${periodId}/${rootId}`, - salaryPeriodStatus:(type:string,periodId:string,rootId:string)=>`${salaryPeriod}/${type}/approve/${periodId}/${rootId}`, - salaryPeriodStatusComment:(type:string,periodId:string,rootId:string)=>`${salaryPeriod}/${type}/comment/${periodId}/${rootId}` + /** รายการเงินเดือนลูกจ้างประจำ*/ + salaryListPeriodLatestEmp: `${salaryPeriodEmp}/latest`, + salaryListPeriodQuotaEmp: (id: string) => `${salaryPeriodEmp}/quota/${id}`, + salaryListPeriodORGEmp: (id: string) => `${salaryPeriodEmp}/org/${id}`, + salaryPeriodProfileEmp: `${salaryPeriodEmp}/org/profile`, }; diff --git a/src/modules/13_salary/components/SalaryEmployeeLists/DialogAddPerson.vue b/src/modules/13_salary/components/SalaryEmployeeLists/DialogAddPerson.vue index b178d0430..43af0c493 100644 --- a/src/modules/13_salary/components/SalaryEmployeeLists/DialogAddPerson.vue +++ b/src/modules/13_salary/components/SalaryEmployeeLists/DialogAddPerson.vue @@ -146,7 +146,7 @@ function onClickAddPerson(data: DataPerson) { $q, () => { http - .post(config.API.salaryPeriodProfile, body) + .post(config.API.salaryPeriodProfileEmp, body) .then(() => { props.fetchData?.(); success($q, "เพื่มรายชื่อสำเร็จ"); diff --git a/src/modules/13_salary/components/SalaryEmployeeLists/TabMain.vue b/src/modules/13_salary/components/SalaryEmployeeLists/TabMain.vue index a2aa41812..29e088306 100644 --- a/src/modules/13_salary/components/SalaryEmployeeLists/TabMain.vue +++ b/src/modules/13_salary/components/SalaryEmployeeLists/TabMain.vue @@ -200,7 +200,7 @@ const maxPage = ref(1); function fetchDataQuota(id: string) { // showLoader(); http - .get(config.API.salaryListPeriodQuota(id)) + .get(config.API.salaryListPeriodQuotaEmp(id)) .then((res) => { const data = res.data.result; store.remaining = data.remaining; @@ -242,7 +242,7 @@ function fetchDataPeriod(id: string) { }; http - .put(config.API.salaryListPeriodORG(id), formData) + .put(config.API.salaryListPeriodORGEmp(id), formData) .then((res) => { rows.value = res.data.result.data; total.value = res.data.result.total; @@ -298,9 +298,9 @@ function onClickDownload(data: DataOption) { } const modalDialogInfoCriteria = ref(false); -onMounted(async () => { - await fetchDataQuota(store.groupId); - await fetchDataPeriod(store.groupId); +onMounted(() => { + fetchDataQuota(store.groupId); + fetchDataPeriod(store.groupId); splitterModel.value = store.roundMainCode === "APR" ? 13 : 16; }); diff --git a/src/modules/13_salary/components/SalaryEmployeeLists/TableTypeOther.vue b/src/modules/13_salary/components/SalaryEmployeeLists/TableTypeOther.vue index 734a5ad74..6ec17d63d 100644 --- a/src/modules/13_salary/components/SalaryEmployeeLists/TableTypeOther.vue +++ b/src/modules/13_salary/components/SalaryEmployeeLists/TableTypeOther.vue @@ -289,7 +289,13 @@ watch( :display-value="$q.lang.table.columns" emit-value map-options - :options="store.roundMainCode === 'OCT' ? columns : columns.slice(0, 10)" + :options=" + store.roundMainCode === 'OCT' + ? columns + : columns + ? columns.slice(0, 10) + : [] + " option-value="name" options-cover style="min-width: 150px" @@ -299,7 +305,13 @@ watch( { { id: "FULL", name: "1 ขั้น" }, { id: "FULLHAFT", name: "1.5 ขั้น" }, ] - : [ + : store.roundMainCode == "ARP" + ? [ { id: "NONE", name: "ไม่ได้เลื่อน" }, { id: "HAFT", name: "0.5 ขั้น" }, { id: "FULL", name: "1 ขั้น" }, + ] + : [ + { id: "HAFT", name: "0.5 ขั้น" }, + { id: "FULL", name: "1 ขั้น" }, ]; }); @@ -104,7 +109,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/SalaryLists/TabMain.vue b/src/modules/13_salary/components/SalaryLists/TabMain.vue index 83cf99173..b7f05377a 100644 --- a/src/modules/13_salary/components/SalaryLists/TabMain.vue +++ b/src/modules/13_salary/components/SalaryLists/TabMain.vue @@ -31,6 +31,8 @@ const { messageError, showLoader, hideLoader } = useCounterMixin(); /** props*/ const props = defineProps({ periodLatest: { type: Object as () => DataPeriodLatest, require: true }, + rootId: { type: String, require: true }, + periodId: { type: String, require: true }, }); const total = ref(); @@ -84,7 +86,8 @@ const itemsTabType = computed(() => { type: "NONE", }, ] - : [ + : store.roundMainCode === "APR" + ? [ { lable: "รายชื่อคนครอง", name: "tab1", @@ -105,6 +108,23 @@ const itemsTabType = computed(() => { name: "tab4", type: "NONE", }, + ] + : [ + { + lable: "รายชื่อคนครอง", + name: "tab1", + type: "PENDING", + }, + { + lable: "1 ขั้น", + name: "tab2", + type: "FULL", + }, + { + lable: "0.5 ขั้น", + name: "tab3", + type: "HAFT", + }, ]; }); @@ -282,26 +302,29 @@ function fetchDataPeriodNew() { } function onClickDownload(data: DataOption) { - console.log(data); - // showLoader(); - // http - // .get(config.API.salaryReportByid(salaryId.value)) - // .then((res) => { - // const dataList = res.data.result; - // genReportXLSX(dataList, "อัตราเงินเดือน"); - // }) - // .catch((e) => { - // messageError($q, e); - // }) - // .finally(() => { - // hideLoader(); - // }); + if (props.rootId && props.periodId) { + showLoader(); + http + .get( + config.API.salaryReportListsByid(data.id, props.rootId, props.periodId) + ) + .then((res) => { + const dataList = res.data.result; + genReportXLSX(dataList, data.name); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); + } } const modalDialogInfoCriteria = ref(false); -onMounted(async () => { - await fetchDataQuota(store.groupId); - await fetchDataPeriod(store.groupId); +onMounted(() => { + fetchDataQuota(store.groupId); + fetchDataPeriod(store.groupId); splitterModel.value = store.roundMainCode === "APR" ? 13 : 16; }); diff --git a/src/modules/13_salary/components/SalaryLists/TableTypeOther.vue b/src/modules/13_salary/components/SalaryLists/TableTypeOther.vue index bae1d8d94..a65ec42dd 100644 --- a/src/modules/13_salary/components/SalaryLists/TableTypeOther.vue +++ b/src/modules/13_salary/components/SalaryLists/TableTypeOther.vue @@ -289,7 +289,13 @@ watch( :display-value="$q.lang.table.columns" emit-value map-options - :options="store.roundMainCode === 'OCT' ? columns : columns.slice(0, 10)" + :options=" + store.roundMainCode === 'OCT' + ? columns + : columns + ? columns.slice(0, 10) + : [] + " option-value="name" options-cover style="min-width: 150px" @@ -299,7 +305,13 @@ watch( (false); /** ตัวแปร*/ const profileId = ref(""); const amount = ref(0); -const isPunish = ref(false) -const isSuspension = ref(false) -const isAbsent = ref(false) -const isLeave = ref(false) +const isPunish = ref(false); +const isSuspension = ref(false); +const isAbsent = ref(false); +const isLeave = ref(false); /** * function ยืนยันการลบรายชื่อ * @param id profileId @@ -282,14 +282,13 @@ function searchData() { props.fetchDataTable?.(); } -function onProperties(data:any){ - console.log(data) - modalDialogProperties.value = true - profileId.value = data.id - isPunish.value = data.isPunish - isSuspension.value = data.isSuspension - isAbsent.value = data.isAbsent - isLeave.value = data.isLeave +function onProperties(data: any) { + modalDialogProperties.value = true; + profileId.value = data.id; + isPunish.value = data.isPunish; + isSuspension.value = data.isSuspension; + isAbsent.value = data.isAbsent; + isLeave.value = data.isLeave; } /** callblack function เรียกข้อมูลรายชื่อใหม่ เมื่อมีการเปลี่ยน PageSize*/ watch( @@ -302,7 +301,14 @@ watch( diff --git a/src/modules/13_salary/interface/response/SalaryList.ts b/src/modules/13_salary/interface/response/SalaryList.ts index 2f5c3fb0f..3b00b392d 100644 --- a/src/modules/13_salary/interface/response/SalaryList.ts +++ b/src/modules/13_salary/interface/response/SalaryList.ts @@ -20,7 +20,7 @@ interface DataRound { revisionId: string; status: string; year: number; - isClose: boolean + isClose: boolean; } interface DataAgency { diff --git a/src/modules/13_salary/store/SalaryEmployeeListsStore.ts b/src/modules/13_salary/store/SalaryEmployeeListsStore.ts index 418f37873..880ae97de 100644 --- a/src/modules/13_salary/store/SalaryEmployeeListsStore.ts +++ b/src/modules/13_salary/store/SalaryEmployeeListsStore.ts @@ -8,152 +8,155 @@ import type { } from "@/modules/13_salary/interface/index/Main"; import type { DataPeriodLatest } from "@/modules/13_salary/interface/response/SalaryList"; -export const useSalaryEmployeeListSDataStore = defineStore("salaryEmployeeListStore", () => { - const tabGroup = ref("group1"); - const tabType = ref("PENDING"); - const groupOp = ref([ - { id: "", name: "กลุ่ม1" }, - { id: "", name: "กลุ่ม2" }, - ]); +export const useSalaryEmployeeListSDataStore = defineStore( + "salaryEmployeeListStore", + () => { + const tabGroup = ref("group1"); + const tabType = ref("PENDING"); + const groupOp = ref([ + { id: "", name: "กลุ่ม1" }, + { id: "", name: "กลุ่ม2" }, + ]); - const remaining = ref(0); + const remaining = ref(0); - const groupId = ref(""); - const rootId = ref(""); - const roundMainCode = ref(""); - const roundYear = ref(0); - const roundCode = ref(""); - const isClosedRound = ref(false); // การปิดรอบ - /** List Menu*/ - const itemMenu = ref([ - { - label: "แก้ไขเงินเดือน", - icon: "edit", - color: "edit", - type: "edit", - }, - { - label: "ย้ายกลุ่ม", - icon: "mdi-account-arrow-right-outline", - color: "indigo-6", - type: "moveGroup", - }, - { - label: "ย้ายขั้น", - icon: "mdi-swap-vertical-bold", - color: "green-6", - type: "moveLevel", - }, - { - label: "แก้ไขคุณสมบัติ", - icon: "mdi-format-list-checks", - color: "blue-6", - type: "properties", - }, - { - label: "ลบ", - icon: "delete", - color: "red", - type: "delete", - }, - ]); + const groupId = ref(""); + const rootId = ref(""); + const roundMainCode = ref(""); + const roundYear = ref(0); + const roundCode = ref(""); + const isClosedRound = ref(false); // การปิดรอบ + /** List Menu*/ + const itemMenu = ref([ + { + label: "แก้ไขเงินเดือน", + icon: "edit", + color: "edit", + type: "edit", + }, + { + label: "ย้ายกลุ่ม", + icon: "mdi-account-arrow-right-outline", + color: "indigo-6", + type: "moveGroup", + }, + { + label: "ย้ายขั้น", + icon: "mdi-swap-vertical-bold", + color: "green-6", + type: "moveLevel", + }, + { + label: "แก้ไขคุณสมบัติ", + icon: "mdi-format-list-checks", + color: "blue-6", + type: "properties", + }, + { + label: "ลบ", + icon: "delete", + color: "red", + type: "delete", + }, + ]); - /** List Download รายงานของรอบเมษายน*/ - const itemDownloadApr = ref([ - { - id: "gov1-01", - name: "รายชื่อข้าราชการผู้ที่ครองตำแหน่ง ณ วันที่ 1 มีนาคม", - }, - { - id: "gov1-02", - name: "บัญชีการคำนวณโควตาเลื่อนเงินเดือน รอบเมษายน", - }, - { - id: "gov1-03", - name: "รายชื่อข้าราชการที่ได้รับการเสนอขอเลื่อนหนึ่งขั้น", - }, - { - id: "gov1-04", - name: "แบบ 1 กท รอบเมษายน", - }, - { - id: "gov1-05", - name: "แบบ 2 กท รอบเมษายน", - }, - { - id: "gov1-06", - name: "แบบ 3 กท บัญชีแสดงวันลาครึ่งปี ขรก.", - }, - { - id: "gov1-07", - name: "คำสั่งเลื่อนเงินเดือน รอบเมษายน", - }, - { - id: "gov1-08", - name: "คำสั่งค่าตอบแทนพิเศษ และผู้ไม่ได้เลื่อน รอบเมษายน", - }, - ]); + /** List Download รายงานของรอบเมษายน*/ + const itemDownloadApr = ref([ + { + id: "gov1-01", + name: "รายชื่อข้าราชการผู้ที่ครองตำแหน่ง ณ วันที่ 1 มีนาคม", + }, + { + id: "gov1-02", + name: "บัญชีการคำนวณโควตาเลื่อนเงินเดือน รอบเมษายน", + }, + { + id: "gov1-03", + name: "รายชื่อข้าราชการที่ได้รับการเสนอขอเลื่อนหนึ่งขั้น", + }, + { + id: "gov1-04", + name: "แบบ 1 กท รอบเมษายน", + }, + { + id: "gov1-05", + name: "แบบ 2 กท รอบเมษายน", + }, + { + id: "gov1-06", + name: "แบบ 3 กท บัญชีแสดงวันลาครึ่งปี ขรก.", + }, + { + id: "gov1-07", + name: "คำสั่งเลื่อนเงินเดือน รอบเมษายน", + }, + { + id: "gov1-08", + name: "คำสั่งค่าตอบแทนพิเศษ และผู้ไม่ได้เลื่อน รอบเมษายน", + }, + ]); - /** List Download รายงานของรอบตุลาคม*/ - const itemDownloadOct = ref([ - { - id: "gov2-01", - name: "รายชื่อข้าราชการผู้ที่ครองตำแหน่ง ณ วันที่ 1 กันยายน", - }, - { - id: "gov2-02", - name: "บัญชีการคำนวณวงเงินเลื่อนเงินเดือน รอบตุลาคม", - }, - { - id: "gov2-03", - name: "รายชื่อข้าราชการผู้ที่ได้รับการเสนอขอเลื่อนเงินเดือนทั้งปีสองขั้น", - }, - { - id: "gov2-04", - name: "แบบ 1 กท รอบตุลาคม", - }, - { - id: "gov2-05", - name: "แบบ 2 กท รอบตุลาคม", - }, - { - id: "gov2-06", - name: "แบบ 3 กท บัญชีแสดงวันลาครึ่งปี ขรก. ", - }, - { - id: "gov2-07", - name: "คำสั่งเลื่อนเงินเดือนข้าราชการเกษียณ", - }, - { - id: "gov2-08", - name: "คำสั่งเลื่อนเงินเดือน รอบตุลาคม", - }, - { - id: "gov2-09", - name: "คำสั่งค่าตอบแทนพิเศษ และผู้ไม่ได้เลื่อนเงินเดือน รอบตุลาคม", - }, - ]); + /** List Download รายงานของรอบตุลาคม*/ + const itemDownloadOct = ref([ + { + id: "gov2-01", + name: "รายชื่อข้าราชการผู้ที่ครองตำแหน่ง ณ วันที่ 1 กันยายน", + }, + { + id: "gov2-02", + name: "บัญชีการคำนวณวงเงินเลื่อนเงินเดือน รอบตุลาคม", + }, + { + id: "gov2-03", + name: "รายชื่อข้าราชการผู้ที่ได้รับการเสนอขอเลื่อนเงินเดือนทั้งปีสองขั้น", + }, + { + id: "gov2-04", + name: "แบบ 1 กท รอบตุลาคม", + }, + { + id: "gov2-05", + name: "แบบ 2 กท รอบตุลาคม", + }, + { + id: "gov2-06", + name: "แบบ 3 กท บัญชีแสดงวันลาครึ่งปี ขรก. ", + }, + { + id: "gov2-07", + name: "คำสั่งเลื่อนเงินเดือนข้าราชการเกษียณ", + }, + { + id: "gov2-08", + name: "คำสั่งเลื่อนเงินเดือน รอบตุลาคม", + }, + { + id: "gov2-09", + name: "คำสั่งค่าตอบแทนพิเศษ และผู้ไม่ได้เลื่อนเงินเดือน รอบตุลาคม", + }, + ]); - function fetchPeriodLatest(data: DataPeriodLatest, type: string) { - groupId.value = type === "group1" ? data.group1id : data.group2id; - roundCode.value = data.period; - groupOp.value[0].id = data.group1id; - groupOp.value[1].id = data.group2id; + function fetchPeriodLatest(data: DataPeriodLatest, type: string) { + groupId.value = data.group1id; + roundCode.value = data.period; + groupOp.value[0].id = data.group1id; + groupOp.value[1].id = data.group2id; + } + return { + tabGroup, + tabType, + itemMenu, + itemDownloadOct, + itemDownloadApr, + groupId, + fetchPeriodLatest, + rootId, + roundCode, + groupOp, + roundMainCode, + remaining, + isClosedRound, + roundYear, + }; } - return { - tabGroup, - tabType, - itemMenu, - itemDownloadOct, - itemDownloadApr, - groupId, - fetchPeriodLatest, - rootId, - roundCode, - groupOp, - roundMainCode, - remaining, - isClosedRound, - roundYear, - }; -}); +); diff --git a/src/modules/13_salary/views/salaryEmployeeLists.vue b/src/modules/13_salary/views/salaryEmployeeLists.vue index b285ef056..8a5fd8291 100644 --- a/src/modules/13_salary/views/salaryEmployeeLists.vue +++ b/src/modules/13_salary/views/salaryEmployeeLists.vue @@ -21,11 +21,11 @@ import TabGroup from "@/modules/13_salary/components/SalaryEmployeeLists/TabMain // import PageDashBoard from "@/modules/13_salary/components/SalaryEmployeeLists/Dashboard.vue"; /** importStore*/ -import { useSalaryListSDataStore } from "@/modules/13_salary/store/SalaryListsStore"; +import { useSalaryEmployeeListSDataStore } from "@/modules/13_salary/store/SalaryEmployeeListsStore"; import { useCounterMixin } from "@/stores/mixin"; /** use*/ -const store = useSalaryListSDataStore(); +const store = useSalaryEmployeeListSDataStore(); const $q = useQuasar(); const { messageError, showLoader, hideLoader } = useCounterMixin(); @@ -215,7 +215,7 @@ function fetchSalalyPeriod(rootId: string, periodId: string, snap: string) { }; http - .post(config.API.salaryListPeriodLatest, body) + .post(config.API.salaryListPeriodLatestEmp, body) .then(async (res) => { const data = res.data.result; if (Object.values(data).includes(null)) { diff --git a/src/modules/13_salary/views/salaryLists.vue b/src/modules/13_salary/views/salaryLists.vue index f48f0aa44..30fbd068b 100644 --- a/src/modules/13_salary/views/salaryLists.vue +++ b/src/modules/13_salary/views/salaryLists.vue @@ -85,14 +85,6 @@ function getRound() { await getSnap(roundFilter.value.shortCode); await getAgency(roundFilter.value.revisionId); await getAgencyPosition(roundFilter.value.revisionId); - - // if (agencyFilter.value && roundFilter.value.id && snapFilter.value) { - // await fetchSalalyPeriod( - // agencyFilter.value, - // roundFilter.value.id, - // snapFilter.value - // ); - // } }) .catch((e) => { messageError($q, e); @@ -219,6 +211,7 @@ function fetchSalalyPeriod(rootId: string, periodId: string, snap: string) { .post(config.API.salaryListPeriodLatest, body) .then(async (res) => { const data = res.data.result; + if (Object.values(data).includes(null)) { isLoad.value = false; } else { @@ -241,7 +234,6 @@ function fetchSalalyPeriod(rootId: string, periodId: string, snap: string) { async function onChangeRound() { // เก็บสถานะการปิดรอบในตัวแปร isClosedRound เพื่อใช้ในการเช็ค store.isClosedRound = roundFilter.value.isClose; - console.log(roundFilter.value); await getSnap(roundFilter.value.shortCode); await getAgency(roundFilter.value.revisionId); @@ -263,7 +255,7 @@ async function onChangeRound() { /** function เปลี่ยนรอบ*/ async function onChangeSnap() { if (agencyFilter.value && roundFilter.value.id && snapFilter.value) { - await fetchSalalyPeriod( + fetchSalalyPeriod( agencyFilter.value, roundFilter.value.id, snapFilter.value @@ -280,7 +272,7 @@ async function onChangeAgency() { roundFilter.value.id && snapFilter.value ) { - await fetchSalalyPeriod( + fetchSalalyPeriod( agencyFilter.value, roundFilter.value.id, snapFilter.value @@ -311,8 +303,8 @@ function onScroll({ to, ref }: { to: number; ref: any }) { } } -onMounted(async () => { - await getRound(); +onMounted(() => { + getRound(); }); @@ -346,7 +338,9 @@ onMounted(async () => { + { -->
- +
@@ -421,7 +420,11 @@ onMounted(async () => { bordered class="row col-12 q-mt-xs" > - +