วินัย => fix bug
This commit is contained in:
parent
7a483649d4
commit
17b801eede
15 changed files with 197 additions and 90 deletions
|
|
@ -31,7 +31,7 @@ const rows = ref<tableType[]>([]);
|
|||
const search = ref<string>("");
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError, showLoader, dialogMessageNotify, hideLoader } = mixin;
|
||||
const { messageError, showLoader, hideLoader } = mixin;
|
||||
|
||||
/** รับ props มาจาก page หลัก */
|
||||
const props = defineProps({
|
||||
|
|
@ -194,7 +194,11 @@ async function getSearch() {
|
|||
keyword: search.value,
|
||||
};
|
||||
await http
|
||||
.post(config.API.orgSearchPersonal()+`?page=${pagination.value.page}&pageSize=${pagination.value.rowsPerPage}&searchKeyword=${search.value}`, body)
|
||||
.post(
|
||||
config.API.orgSearchPersonal() +
|
||||
`?page=${pagination.value.page}&pageSize=${pagination.value.rowsPerPage}&searchKeyword=${search.value}`,
|
||||
body
|
||||
)
|
||||
.then((res) => {
|
||||
totalList.value = Math.ceil(
|
||||
res.data.result.total / pagination.value.rowsPerPage
|
||||
|
|
@ -207,7 +211,9 @@ async function getSearch() {
|
|||
prefix: e.prefix,
|
||||
firstName: e.firstName,
|
||||
lastName: e.lastName,
|
||||
name: `${e.prefix ? e.prefix :''}${e.firstName ? e.firstName :''} ${e.lastName ? e.lastName :''}`,
|
||||
name: `${e.prefix ? e.prefix : ""}${e.firstName ? e.firstName : ""} ${
|
||||
e.lastName ? e.lastName : ""
|
||||
}`,
|
||||
posNo: e.posNo ?? "-",
|
||||
position: e.position ?? "-",
|
||||
positionLevel: e.positionLevel ?? "-",
|
||||
|
|
@ -219,18 +225,20 @@ async function getSearch() {
|
|||
|
||||
rows.value = list;
|
||||
})
|
||||
.catch((err) => {})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
function returnDetail(data: any) {
|
||||
function returnDetail(data: ResponsePreson) {
|
||||
formData.prefix = data.prefix;
|
||||
formData.firstname = data.firstName;
|
||||
formData.lastname = data.lastName;
|
||||
formData.position = data.position;
|
||||
formData.phone = data.phone;
|
||||
formData.phone = data.phone !== "-" ? data.phone.replace(/\D/g, "") : "";
|
||||
formData.email = data.email;
|
||||
}
|
||||
|
||||
|
|
@ -254,7 +262,6 @@ function updatemodalPersonal(modal: boolean) {
|
|||
function updatePagination(newPagination: any) {
|
||||
pagination.value.page = 1;
|
||||
pagination.value.rowsPerPage = newPagination.rowsPerPage;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -274,8 +281,8 @@ watch(props.data, async () => {
|
|||
|
||||
watch(
|
||||
() => pagination.value.rowsPerPage,
|
||||
async() => {
|
||||
await getSearch();
|
||||
async () => {
|
||||
await getSearch();
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
|
@ -342,20 +349,20 @@ watch(
|
|||
:rows-per-page-options="[1, 25, 50, 100]"
|
||||
@update:pagination="updatePagination"
|
||||
>
|
||||
<template v-slot:pagination="scope">
|
||||
ทั้งหมด {{ total }} รายการ
|
||||
<q-pagination
|
||||
v-model="pagination.page"
|
||||
active-color="primary"
|
||||
color="dark"
|
||||
:max="Number(totalList)"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
:max-pages="5"
|
||||
@update:model-value="getSearch"
|
||||
></q-pagination>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
ทั้งหมด {{ total }} รายการ
|
||||
<q-pagination
|
||||
v-model="pagination.page"
|
||||
active-color="primary"
|
||||
color="dark"
|
||||
:max="Number(totalList)"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
:max-pages="5"
|
||||
@update:model-value="getSearch"
|
||||
></q-pagination>
|
||||
</template>
|
||||
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
|
|
@ -377,13 +384,13 @@ watch(
|
|||
:props="props"
|
||||
@click="returnDetail(props.row)"
|
||||
>
|
||||
<div v-if="col.name == 'no'">
|
||||
{{
|
||||
(pagination.page - 1) * pagination.rowsPerPage +
|
||||
props.rowIndex +
|
||||
1
|
||||
}}
|
||||
</div>
|
||||
<div v-if="col.name == 'no'">
|
||||
{{
|
||||
(pagination.page - 1) * pagination.rowsPerPage +
|
||||
props.rowIndex +
|
||||
1
|
||||
}}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'info'">
|
||||
<!-- <router-link
|
||||
target="_blank"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue