fix(discipline-appealcomplain):API
This commit is contained in:
parent
c9120a72bb
commit
d14a58538e
2 changed files with 18 additions and 8 deletions
|
|
@ -74,6 +74,8 @@ export default {
|
||||||
orgSearchPersonal: () => `${organization}/profile/search-personal`,
|
orgSearchPersonal: () => `${organization}/profile/search-personal`,
|
||||||
orgSearchPersonalByType: (type: string) =>
|
orgSearchPersonalByType: (type: string) =>
|
||||||
`${organization}/profile${type}/search-personal`,
|
`${organization}/profile${type}/search-personal`,
|
||||||
|
orgSearchPersonalByTypeNoKeycloak: (type: string) =>
|
||||||
|
`${organization}/profile${type}/search-personal-no-keycloak`,
|
||||||
|
|
||||||
/** บรรจุแต่งตั้ง*/
|
/** บรรจุแต่งตั้ง*/
|
||||||
orgPosPlacement: `${orgPos}/placement/search`,
|
orgPosPlacement: `${orgPos}/placement/search`,
|
||||||
|
|
|
||||||
|
|
@ -140,19 +140,27 @@ async function searchInput() {
|
||||||
|
|
||||||
async function getSearch() {
|
async function getSearch() {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
// API ค้นหารายบุคคล
|
||||||
|
const employeeSuffix = employeeClass.value === "officer" ? "" : "-employee";
|
||||||
|
const apiMethod =
|
||||||
|
props.system === "SYS_DISCIPLINE_APPEAL"
|
||||||
|
? config.API.orgSearchPersonalByTypeNoKeycloak
|
||||||
|
: config.API.orgSearchPersonalByType;
|
||||||
|
|
||||||
|
const apiPath = apiMethod(employeeSuffix);
|
||||||
|
|
||||||
|
// สร้าง query params
|
||||||
|
const queryParams = `?page=${pagination.value.page}&pageSize=${pagination.value.rowsPerPage}`;
|
||||||
|
|
||||||
|
// สร้าง body
|
||||||
const body = {
|
const body = {
|
||||||
fieldName: type.value,
|
fieldName: type.value,
|
||||||
keyword: search.value ? search.value.trim() : "",
|
keyword: search.value ? search.value.trim() : "",
|
||||||
system: props.system ?? undefined,
|
system: props.system ?? undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
await http
|
await http
|
||||||
.post(
|
.post(apiPath + queryParams, body)
|
||||||
config.API.orgSearchPersonalByType(
|
|
||||||
employeeClass.value == "officer" ? "" : "-employee"
|
|
||||||
) +
|
|
||||||
`?page=${pagination.value.page}&pageSize=${pagination.value.rowsPerPage}`,
|
|
||||||
body
|
|
||||||
)
|
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res.data.result.data;
|
const data = res.data.result.data;
|
||||||
totalList.value = Math.ceil(
|
totalList.value = Math.ceil(
|
||||||
|
|
@ -358,7 +366,7 @@ watch(
|
||||||
@update:pagination="updatePagination"
|
@update:pagination="updatePagination"
|
||||||
>
|
>
|
||||||
<template v-slot:pagination="scope">
|
<template v-slot:pagination="scope">
|
||||||
ทั้งหมด {{ total }} รายการ
|
ทั้งหมด {{ total?.toLocaleString() }} รายการ
|
||||||
<q-pagination
|
<q-pagination
|
||||||
v-model="pagination.page"
|
v-model="pagination.page"
|
||||||
active-color="primary"
|
active-color="primary"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue