ปรับรายการลา

This commit is contained in:
setthawutttty 2025-03-27 10:47:56 +07:00
parent 72483b2d6d
commit 9e3ee0030d
6 changed files with 55 additions and 51 deletions

View file

@ -20,7 +20,6 @@ const mixin = useCounterMixin();
const leaveStore = useLeavelistDataStore();
const { showLoader, hideLoader, messageError } = mixin;
const { fetchListLeaveReject } = leaveStore;
const dataToobar = ref<any[]>([]);
const $q = useQuasar(); // noti quasar
const total = ref<number>(0);
@ -32,13 +31,15 @@ const querySting = reactive<QuerySting>({
status: leaveStore.filter.status, //*
page: 1, //*
pageSize: 10, //*
sortBy: "dateSendLeave",
descending: true,
keyword: leaveStore.filter.keyword, //keyword
profileType: 'ALL', //profileType
profileType: "ALL", //profileType
});
//** API*/
async function fecthLeaveList() {
leaveStore.rows = [];
querySting.keyword = querySting.keyword.trim()
querySting.keyword = querySting.keyword.trim();
querySting.status = await (querySting.status == null
? "ALL"
: querySting.status);
@ -69,14 +70,16 @@ async function fecthLeaveList() {
/** function เรียกข้อมูลสถานะ*/
async function fetchOption() {
await http
.get(config.API.leaveType())
.then((res) => {
dataToobar.value = res.data.result;
})
.catch((err) => {
messageError($q, err);
});
if (leaveStore.dataToobar.length == 0) {
await http
.get(config.API.leaveType())
.then((res) => {
leaveStore.leaveTypeOption(res.data.result);
})
.catch((err) => {
messageError($q, err);
});
}
}
function getSearch() {
@ -97,7 +100,7 @@ onMounted(async () => {
</script>
<template>
<ToolBar
:dataToobar="dataToobar"
:dataToobar="leaveStore.dataToobar"
v-model:query-sting="querySting"
:get-list="fecthLeaveList"
:get-search="getSearch"
@ -106,7 +109,7 @@ onMounted(async () => {
v-model:total="total"
v-model:total-list="totalList"
v-model:pagination="querySting"
:dataToobar="dataToobar"
:dataToobar="leaveStore.dataToobar"
:getList="fecthLeaveList"
/>
</template>