ปรับรายการลา
This commit is contained in:
parent
72483b2d6d
commit
9e3ee0030d
6 changed files with 55 additions and 51 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue