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 attrs = ref<any>(useAttrs());
|
||||
const paging2 = ref<boolean>(true);
|
||||
const fillterStatus = ref<any>([]);
|
||||
const fillter = ref<any>("");
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterKeyword2 = ref<string>("");
|
||||
const rows = ref<FormMainProbation[]>([]);
|
||||
const rows2 = ref<FormMainProbation2[]>([]);
|
||||
const dataUpdate = ref<FormMainProbation[]>([]);
|
||||
const Opfillter = ref<OpfillterTypeSt[]>([]);
|
||||
const Opfillter2 = ref<OpfillterTypeSt[]>([]);
|
||||
const formProbation = reactive({ keyword: "", pageSize: 10, page: 1 });
|
||||
|
|
@ -239,22 +237,22 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
|
||||
/** get ข้อมูล */
|
||||
async function getpersonalList() {
|
||||
rows.value = [];
|
||||
showLoader();
|
||||
await http
|
||||
.get(
|
||||
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) => {
|
||||
const data = await res.data.data.data;
|
||||
const resTotal = await res.data.data.total;
|
||||
rows.value = data;
|
||||
fillterStatus.value = data;
|
||||
dataUpdate.value = rows.value;
|
||||
.then((res) => {
|
||||
rows.value = res.data.data.data;
|
||||
Opfillter.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();
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -376,11 +374,6 @@ function resetFilter2() {
|
|||
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) {
|
||||
if (paging2.value == true) return " " + start + "-" + end + " ใน " + total;
|
||||
else return start + "-" + end + " ใน " + total;
|
||||
|
|
@ -448,14 +441,14 @@ function closeAdd() {
|
|||
topic.value = "แต่งตั้งคณะกรรมการประเมินผลการทดลองปฏิบัติหน้าที่ราชการ";
|
||||
}
|
||||
|
||||
watch([() => formProbation.page, () => formProbation.pageSize], () => {
|
||||
onclickAddProbation();
|
||||
});
|
||||
|
||||
function getSearch() {
|
||||
pagination.value.page = 1;
|
||||
getpersonalList();
|
||||
}
|
||||
watch(
|
||||
() => pagination.value.rowsPerPage,
|
||||
async () => {
|
||||
await getpersonalList();
|
||||
() => {
|
||||
getSearch();
|
||||
}
|
||||
);
|
||||
|
||||
|
|
@ -537,6 +530,7 @@ onMounted(async () => {
|
|||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter.prevent="getSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword == ''" name="search" />
|
||||
|
|
@ -567,21 +561,15 @@ onMounted(async () => {
|
|||
</div>
|
||||
<div class="col-12">
|
||||
<d-table
|
||||
ref="table"
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:filter="filterKeyword"
|
||||
row-key="Order"
|
||||
flat
|
||||
bordered
|
||||
:paging="true"
|
||||
dense
|
||||
class="custom-header-table"
|
||||
v-bind="attrs"
|
||||
:visible-columns="visibleColumns"
|
||||
:pagination-label="paginationLabel"
|
||||
v-model:pagination="pagination"
|
||||
:rows-per-page-options="[10, 25, 50, 100]"
|
||||
:rows-per-page-options="[1, 25, 50, 100]"
|
||||
@update:pagination="updatePagination"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue