เพิ่ม API รายการลา และ รายการขอยกเลิกการลา
This commit is contained in:
parent
b78b1c99c0
commit
f79335d5b9
5 changed files with 89 additions and 53 deletions
|
|
@ -47,20 +47,12 @@ function updateQuerySting(
|
|||
|
||||
/** function ค้นหาข้อมูลใน Table*/
|
||||
async function filterListLeave() {
|
||||
console.log("test");
|
||||
|
||||
// filter.status &&
|
||||
// filter.type &&
|
||||
// (await updateQuerySting(1, Number(props.rowsPerPage), filter));
|
||||
updateQuerySting(1, 0, filter);
|
||||
}
|
||||
|
||||
/** Option*/
|
||||
const optionType = ref<DataOption[]>([
|
||||
{
|
||||
id: "00000000-0000-0000-0000-000000000000",
|
||||
name: "ทั้งหมด",
|
||||
},
|
||||
]);
|
||||
const optionTypeMain = ref<DataOption[]>([]);
|
||||
const optionType = ref<DataOption[]>([]);
|
||||
const optionStatus = ref<DataOption[]>([
|
||||
{
|
||||
id: "ALL",
|
||||
|
|
@ -93,29 +85,37 @@ const optionStatus2 = ref<DataOption[]>([
|
|||
name: "ขอยกเลิก",
|
||||
},
|
||||
{
|
||||
id: "PENDING ",
|
||||
id: "APPROVE ",
|
||||
name: "อนุมัติ",
|
||||
},
|
||||
{
|
||||
id: "APPROVE ",
|
||||
id: "REJECT ",
|
||||
name: "ไม่อนุมัติ",
|
||||
},
|
||||
]);
|
||||
const optionTypeMain = ref<DataOption[]>(optionType.value);
|
||||
|
||||
const optionStatusMain = ref<DataOption[]>(
|
||||
leaveStore.tabMenu == "1" ? optionStatus.value : optionStatus2.value
|
||||
);
|
||||
|
||||
async function fetchOption() {
|
||||
console.log("loadOption รอ API");
|
||||
// await http
|
||||
// .get(config.API.leaveType())
|
||||
// .then((res) => {
|
||||
// console.log(res);
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// console.log(err);
|
||||
// });
|
||||
await http
|
||||
.get(config.API.leaveType())
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
optionTypeMain.value = [
|
||||
{ id: "00000000-0000-0000-0000-000000000000", name: "ทั้งหมด" },
|
||||
];
|
||||
const option = data.map((e: DataOption) => ({
|
||||
id: e.id,
|
||||
name: e.name,
|
||||
}));
|
||||
optionTypeMain.value.push(...option);
|
||||
optionType.value = optionTypeMain.value;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -141,8 +141,6 @@ function filterOption(val: string, update: any, name: string) {
|
|||
|
||||
onMounted(async () => {
|
||||
await fetchOption();
|
||||
// optionTypeMain.value =
|
||||
// leaveStore.tabMenu == "1" ? optionStatus.value : optionStatus2.value;
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
@ -182,19 +180,6 @@ onMounted(async () => {
|
|||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
<!-- <q-select
|
||||
for="selectYear"
|
||||
emit-value
|
||||
map-options
|
||||
outlined
|
||||
dense
|
||||
v-model="filter.year"
|
||||
:options="optionStatus"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
label="ปีงบประมาณ"
|
||||
@update:model-value="filterListLeave"
|
||||
/> -->
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-2">
|
||||
<q-select
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue