รายการเงินเดือน

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-02-28 14:53:38 +07:00
parent 9955bc4fe0
commit 42badd9978
3 changed files with 105 additions and 36 deletions

View file

@ -11,33 +11,28 @@ import type { DataFilterPerson } from "@/modules/13_salary/interface/index/Salar
import type { DataPersonReq } from "@/modules/13_salary/interface/request/SalaryList";
import type { DataPerson } from "@/modules/13_salary/interface/response/SalaryList";
/** importComponents*/
import Header from "@/components/DialogHeader.vue";
/** importStore*/
import { useCounterMixin } from "@/stores/mixin";
import { useSalaryListSDataStore } from "@/modules/13_salary/store/SalaryListsStore";
const store = useSalaryListSDataStore();
/** use*/
const $q = useQuasar();
const {
date2Thai,
dialogRemove,
messageError,
showLoader,
hideLoader,
dialogConfirm,
success,
} = useCounterMixin();
const store = useSalaryListSDataStore();
const { messageError, showLoader, hideLoader, dialogConfirm, success } =
useCounterMixin();
/** props*/
const modal = defineModel<boolean>("modal", { required: true });
const props = defineProps({
fetchData: {
type: Function,
},
});
/** Table*/
const columns = ref<QTableProps["columns"]>([
{
name: "no",
@ -96,6 +91,7 @@ const columns = ref<QTableProps["columns"]>([
]);
const rows = ref<DataPerson[]>([]);
/** ข้อมูุลค้นหา*/
const formFilter = reactive<DataFilterPerson>({
page: 1,
pageSize: 10,
@ -103,10 +99,13 @@ const formFilter = reactive<DataFilterPerson>({
});
const maxPage = ref<number>(1);
/** function close popup*/
function closeModal() {
modal.value = false;
formFilter.page = 1;
}
/** function เรียกรายชื่อ คนเลื่อนเงินเดือน*/
async function fetchListPerson() {
showLoader();
await http
@ -125,6 +124,10 @@ async function fetchListPerson() {
});
}
/**
* function นยนการเพมคนเลอนเงนเดอน
* @param data อมลคนทเพ
*/
async function onClickAddPerson(data: DataPerson) {
const body: DataPersonReq = {
id: store.groupId,
@ -154,22 +157,24 @@ async function onClickAddPerson(data: DataPerson) {
);
}
/** function updatePage*/
async function updatePagePagination() {
fetchListPerson();
}
/** function updatePageSize*/
function updatePageSizePagination(newPagination: NewPagination) {
console.log("teset");
formFilter.page = 1;
formFilter.pageSize = newPagination.rowsPerPage;
}
/** function ค้นหาข้อมูลตาม keyword*/
function searchData() {
formFilter.page = 1;
fetchListPerson();
}
/** callblack function เรียกข้อมูลรายชื่อคนเลื่อนเงินเดือน เมื่อมีการเปิด Popup*/
watch(
() => modal.value,
async () => {
@ -179,6 +184,7 @@ watch(
}
);
/** callblack function เรียกข้อมูลรายชื่อคนเลื่อนเงินเดือน เมื่อมีการเปลี่ยน PageSize*/
watch(
() => formFilter.pageSize,
() => {