Merge branch 'develop' of https://github.com/Frappet/bma-ehr-frontend into develop
This commit is contained in:
commit
2bcbbe8c9f
1 changed files with 17 additions and 29 deletions
|
|
@ -34,13 +34,11 @@ const paging = ref<boolean>(true);
|
||||||
const filterRef2 = ref<any>(null);
|
const filterRef2 = ref<any>(null);
|
||||||
const attrs = ref<any>(useAttrs());
|
const attrs = ref<any>(useAttrs());
|
||||||
const paging2 = ref<boolean>(true);
|
const paging2 = ref<boolean>(true);
|
||||||
const fillterStatus = ref<any>([]);
|
|
||||||
const fillter = ref<any>("");
|
const fillter = ref<any>("");
|
||||||
const filterKeyword = ref<string>("");
|
const filterKeyword = ref<string>("");
|
||||||
const filterKeyword2 = ref<string>("");
|
const filterKeyword2 = ref<string>("");
|
||||||
const rows = ref<FormMainProbation[]>([]);
|
const rows = ref<FormMainProbation[]>([]);
|
||||||
const rows2 = ref<FormMainProbation2[]>([]);
|
const rows2 = ref<FormMainProbation2[]>([]);
|
||||||
const dataUpdate = ref<FormMainProbation[]>([]);
|
|
||||||
const Opfillter = ref<OpfillterTypeSt[]>([]);
|
const Opfillter = ref<OpfillterTypeSt[]>([]);
|
||||||
const Opfillter2 = ref<OpfillterTypeSt[]>([]);
|
const Opfillter2 = ref<OpfillterTypeSt[]>([]);
|
||||||
const formProbation = reactive({ keyword: "", pageSize: 10, page: 1 });
|
const formProbation = reactive({ keyword: "", pageSize: 10, page: 1 });
|
||||||
|
|
@ -239,22 +237,22 @@ const columns2 = ref<QTableProps["columns"]>([
|
||||||
|
|
||||||
/** get ข้อมูล */
|
/** get ข้อมูล */
|
||||||
async function getpersonalList() {
|
async function getpersonalList() {
|
||||||
|
rows.value = [];
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(
|
.get(
|
||||||
config.API.probationPersonalList() +
|
config.API.probationPersonalList() +
|
||||||
`?status=${fillter.value}&page=${pagination.value.page}&pageSize=${pagination.value.rowsPerPage}`
|
`?status=${fillter.value}&page=${pagination.value.page}&pageSize=${pagination.value.rowsPerPage}&keyword=${filterKeyword.value}`
|
||||||
)
|
)
|
||||||
.then(async (res) => {
|
.then((res) => {
|
||||||
const data = await res.data.data.data;
|
rows.value = res.data.data.data;
|
||||||
const resTotal = await res.data.data.total;
|
|
||||||
rows.value = data;
|
|
||||||
fillterStatus.value = data;
|
|
||||||
dataUpdate.value = rows.value;
|
|
||||||
Opfillter.value = storeFn.optionStatusProbation;
|
Opfillter.value = storeFn.optionStatusProbation;
|
||||||
Opfillter2.value = storeFn.optionStatusProbation;
|
Opfillter2.value = storeFn.optionStatusProbation;
|
||||||
totalList.value = Math.ceil(resTotal / pagination.value.rowsPerPage);
|
|
||||||
total.value = resTotal;
|
totalList.value = Math.ceil(
|
||||||
|
res.data.data.total / pagination.value.rowsPerPage
|
||||||
|
);
|
||||||
|
total.value = res.data.data.total;
|
||||||
hideLoader();
|
hideLoader();
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
|
|
@ -376,11 +374,6 @@ function resetFilter2() {
|
||||||
filterRef2.value.focus();
|
filterRef2.value.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
function paginationLabel(start: string, end: string, total: string) {
|
|
||||||
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
|
|
||||||
else return start + "-" + end + " ใน " + total;
|
|
||||||
}
|
|
||||||
|
|
||||||
function paginationLabel2(start: string, end: string, total: string) {
|
function paginationLabel2(start: string, end: string, total: string) {
|
||||||
if (paging2.value == true) return " " + start + "-" + end + " ใน " + total;
|
if (paging2.value == true) return " " + start + "-" + end + " ใน " + total;
|
||||||
else return start + "-" + end + " ใน " + total;
|
else return start + "-" + end + " ใน " + total;
|
||||||
|
|
@ -448,14 +441,14 @@ function closeAdd() {
|
||||||
topic.value = "แต่งตั้งคณะกรรมการประเมินผลการทดลองปฏิบัติหน้าที่ราชการ";
|
topic.value = "แต่งตั้งคณะกรรมการประเมินผลการทดลองปฏิบัติหน้าที่ราชการ";
|
||||||
}
|
}
|
||||||
|
|
||||||
watch([() => formProbation.page, () => formProbation.pageSize], () => {
|
function getSearch() {
|
||||||
onclickAddProbation();
|
pagination.value.page = 1;
|
||||||
});
|
getpersonalList();
|
||||||
|
}
|
||||||
watch(
|
watch(
|
||||||
() => pagination.value.rowsPerPage,
|
() => pagination.value.rowsPerPage,
|
||||||
async () => {
|
() => {
|
||||||
await getpersonalList();
|
getSearch();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -537,6 +530,7 @@ onMounted(async () => {
|
||||||
outlined
|
outlined
|
||||||
debounce="300"
|
debounce="300"
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
|
@keydown.enter.prevent="getSearch"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon v-if="filterKeyword == ''" name="search" />
|
<q-icon v-if="filterKeyword == ''" name="search" />
|
||||||
|
|
@ -567,21 +561,15 @@ onMounted(async () => {
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<d-table
|
<d-table
|
||||||
ref="table"
|
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:filter="filterKeyword"
|
|
||||||
row-key="Order"
|
|
||||||
flat
|
flat
|
||||||
bordered
|
bordered
|
||||||
:paging="true"
|
|
||||||
dense
|
dense
|
||||||
class="custom-header-table"
|
class="custom-header-table"
|
||||||
v-bind="attrs"
|
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
:pagination-label="paginationLabel"
|
|
||||||
v-model:pagination="pagination"
|
v-model:pagination="pagination"
|
||||||
:rows-per-page-options="[10, 25, 50, 100]"
|
:rows-per-page-options="[1, 25, 50, 100]"
|
||||||
@update:pagination="updatePagination"
|
@update:pagination="updatePagination"
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue