diff --git a/src/modules/13_salary/components/SalaryLists/DialogFormEdit.vue b/src/modules/13_salary/components/SalaryLists/DialogFormEdit.vue index 342b1f64d..028ddd183 100644 --- a/src/modules/13_salary/components/SalaryLists/DialogFormEdit.vue +++ b/src/modules/13_salary/components/SalaryLists/DialogFormEdit.vue @@ -1,37 +1,41 @@ + { :key="index" :name="item.name" > + { - {{ item.total }} + {{ item.total.toLocaleString() }} @@ -306,9 +321,9 @@ onMounted(async () => { - + @@ -358,14 +373,14 @@ onMounted(async () => { :rows="rows" v-model:maxPage="maxPage" v-model:formFilter="formFilter" - :fetchDataTable="updatePagination" + :fetchDataTable="fetchDataPeriodNew" /> diff --git a/src/modules/13_salary/components/SalaryLists/TableTypeOther.vue b/src/modules/13_salary/components/SalaryLists/TableTypeOther.vue index f944d8da0..90c9637bb 100644 --- a/src/modules/13_salary/components/SalaryLists/TableTypeOther.vue +++ b/src/modules/13_salary/components/SalaryLists/TableTypeOther.vue @@ -6,10 +6,7 @@ import http from "@/plugins/http"; /** importType*/ import type { QTableProps } from "quasar"; -import type { - NewPagination, - ItemsMenu, -} from "@/modules/13_salary/interface/index/Main"; +import type { NewPagination } from "@/modules/13_salary/interface/index/Main"; import type { DataFilter } from "@/modules/13_salary/interface/index/SalaryList"; /** importComponents*/ @@ -22,17 +19,13 @@ import DialogMoveLevel from "@/modules/13_salary/components/SalaryLists/DialogMo import { useCounterMixin } from "@/stores/mixin"; import { useSalaryListSDataStore } from "@/modules/13_salary/store/SalaryListsStore"; +/** use*/ const $q = useQuasar(); const store = useSalaryListSDataStore(); -const { - date2Thai, - dialogRemove, - messageError, - showLoader, - hideLoader, - success, -} = useCounterMixin(); +const { dialogRemove, messageError, showLoader, hideLoader, success } = + useCounterMixin(); +/** props*/ const formFilter = defineModel("formFilter", { required: true }); const maxPage = defineModel("maxPage", { required: true }); const props = defineProps({ @@ -42,6 +35,7 @@ const props = defineProps({ }, }); +/** ข้อมูล Table*/ const columns = ref([ { name: "no", @@ -127,34 +121,56 @@ const visibleColumns = ref([ "amountUse", ]); -/** modal*/ +/** modalDialog*/ const modalDialogAddPerson = ref(false); const modalDialogForm = ref(false); const modalDialogMoveGroup = ref(false); const modalDialogMoveLeve = ref(false); +const profileId = ref(""); +const amount = ref(0); + +/** function openPopup เพิ่มคนเลื่อนเงินเดือน*/ function onClickAddPerson() { modalDialogAddPerson.value = !modalDialogAddPerson.value; } -const profileId = ref(""); -const amount = ref(0); +/** + * function openPopup แก้ไขเงินเดือน + * @param id profileId + * @param amountSalary จำนวนเงินเดือน + * + */ function onClickEdit(id: string, amountSalary: number) { profileId.value = id; amount.value = amountSalary; modalDialogForm.value = !modalDialogForm.value; } +/** + * function openPopup ย้ายกลุ่ม + * @param id profileId + * + */ function onClickMovieGroup(id: string) { profileId.value = id; modalDialogMoveGroup.value = !modalDialogMoveGroup.value; } +/** + * function openPopup ย้ายกขั้น + * @param id profileId + * + */ function onClickMoveLevel(id: string) { profileId.value = id; modalDialogMoveLeve.value = !modalDialogMoveLeve.value; } +/** + * function ยืนยันการลบรายชื่อ + * @param id profileId + */ function onClickDelete(id: string) { dialogRemove($q, async () => { showLoader(); @@ -173,19 +189,24 @@ function onClickDelete(id: string) { }); } +/** function updatePageTable*/ function updatePagePagination() { props.fetchDataTable?.(); } +/** function updatePageSizeTable*/ function updatePageSizePagination(newPagination: NewPagination) { formFilter.value.page = 1; formFilter.value.pageSize = newPagination.rowsPerPage; } +/** function ค้นหาข้อมูล Table*/ function searchData() { formFilter.value.page = 1; props.fetchDataTable?.(); } + +/** callblack function เรียกข้อมูลรายชื่อใหม่ เมื่อมีการเปลี่ยน PageSize*/ watch( () => formFilter.value.pageSize, () => { diff --git a/src/modules/13_salary/components/SalaryLists/TableTypePending.vue b/src/modules/13_salary/components/SalaryLists/TableTypePending.vue index fc4a24453..c154f21c7 100644 --- a/src/modules/13_salary/components/SalaryLists/TableTypePending.vue +++ b/src/modules/13_salary/components/SalaryLists/TableTypePending.vue @@ -19,18 +19,26 @@ import { useSalaryListSDataStore } from "@/modules/13_salary/store/SalaryListsSt import http from "@/plugins/http"; import config from "@/app.config"; -const store = useSalaryListSDataStore(); - +/** use*/ const $q = useQuasar(); -const { - date2Thai, - dialogRemove, - messageError, - showLoader, - hideLoader, - success, -} = useCounterMixin(); +const store = useSalaryListSDataStore(); +const { dialogRemove, messageError, showLoader, hideLoader, success } = + useCounterMixin(); +/** Props*/ +const formFilter = defineModel("formFilter", { required: true }); +const maxPage = defineModel("maxPage", { required: true }); +const props = defineProps({ + rows: { type: Array }, + fetchDataTable: { + type: Function, + }, + maxPage: { + type: Number, + }, +}); + +/** ข้อมูล Table*/ const columns = ref([ { name: "no", @@ -126,27 +134,20 @@ const visibleColumns = ref([ "retired2", ]); -const formFilter = defineModel("formFilter", { required: true }); -const maxPage = defineModel("maxPage", { required: true }); -const props = defineProps({ - rows: { type: Array }, - fetchDataTable: { - type: Function, - }, - maxPage: { - type: Number, - }, -}); - -/** modal*/ +/** modalDialog*/ const modalDialogAddPerson = ref(false); const modalDialogForm = ref(false); const modalDialogMoveGroup = ref(false); const modalDialogMoveLeve = ref(false); +/** ตัวแปร*/ const profileId = ref(""); const amount = ref(0); +/** + * function ยืนยันการลบรายชื่อ + * @param id profileId + */ function onClickDelete(id: string) { dialogRemove($q, async () => { showLoader(); @@ -164,39 +165,62 @@ function onClickDelete(id: string) { }); }); } + +/** function openPopup เพิ่มคนเลื่อนเงินเดือน*/ function onClickAddPerson() { modalDialogAddPerson.value = !modalDialogAddPerson.value; } +/** + * function openPopup แก้ไขเงินเดือน + * @param id profileId + * @param amountSalary จำนวนเงินเดือน + * + */ function onClickEdit(id: string, amountSalary: number) { profileId.value = id; amount.value = amountSalary; modalDialogForm.value = !modalDialogForm.value; } +/** + * function openPopup ย้ายกลุ่ม + * @param id profileId + * + */ function onClickMovieGroup(id: string) { profileId.value = id; modalDialogMoveGroup.value = !modalDialogMoveGroup.value; } +/** + * function openPopup ย้ายกขั้น + * @param id profileId + * + */ function onClickMoveLevel(id: string) { profileId.value = id; modalDialogMoveLeve.value = !modalDialogMoveLeve.value; } +/** function updatePageTable*/ function updatePagePagination() { props.fetchDataTable?.(); } +/** function updatePageSizeTable*/ function updatePageSizePagination(newPagination: NewPagination) { formFilter.value.page = 1; formFilter.value.pageSize = newPagination.rowsPerPage; } +/** function ค้นหาข้อมูล Table*/ function searchData() { formFilter.value.page = 1; props.fetchDataTable?.(); } + +/** callblack function เรียกข้อมูลรายชื่อใหม่ เมื่อมีการเปลี่ยน PageSize*/ watch( () => formFilter.value.pageSize, () => { diff --git a/src/modules/13_salary/interface/response/SalaryList.ts b/src/modules/13_salary/interface/response/SalaryList.ts index 7c8ea0350..d32951527 100644 --- a/src/modules/13_salary/interface/response/SalaryList.ts +++ b/src/modules/13_salary/interface/response/SalaryList.ts @@ -74,10 +74,56 @@ interface DataPerson { root: string; rootId: string; } + +interface DataPeriod { + amount: number; + amountSpecial: null | number; + amountUse: null | number; + child1: string | null; + child1Id: string | null; + child2: string | null; + child2Id: string | null; + child3: string | null; + child3Id: string | null; + child4: string | null; + child4Id: string | null; + citizenId: string; + createdAt: string; + createdFullName: string; + createdUserId: string; + duration: null | number; + firstName: string; + id: string; + lastName: string; + lastUpdateFullName: string; + lastUpdateUserId: string; + lastUpdatedAt: string; + orgShortName: string; + posExecutive: null | string; + posLevel: string; + posMasterNo: number; + posMasterNoPrefix: string; + posMasterNoSuffix: string; + posType: string; + position: string; + positionSalaryAmount: null | number; + prefix: string; + punish: null | string; + result: null | string; + retired: null | string; + retired2: null | string; + revisionId: string; + root: string; + rootId: string; + salaryOrgId: string; + status: string; + type: string; +} export type { DataPeriodLatest, DataPeriodQuota, DataRound, DataAgency, DataPerson, + DataPeriod, };