รายการลาออก
This commit is contained in:
parent
770457319e
commit
8c9441e4ee
4 changed files with 104 additions and 237 deletions
|
|
@ -125,13 +125,10 @@ const visibleColumns = ref<string[]>([
|
|||
"datetext",
|
||||
"status",
|
||||
]);
|
||||
|
||||
const filters = ref<ResponseItems[]>([]);
|
||||
const rowsSendToCommand = ref<ResponseItems[]>([]);
|
||||
const modal = ref<boolean>(false);
|
||||
const filterKeyword2 = ref<string>("");
|
||||
const filterKeyword = ref<string>("");
|
||||
const openModal = () => (modal.value = true);
|
||||
|
||||
const status = ref<string>("");
|
||||
const optionStatus = ref<any[]>([]);
|
||||
|
|
@ -144,66 +141,57 @@ const pagination = ref({
|
|||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
// ปิดโมเดล
|
||||
/** ฟังก์ชันปิด Popup*/
|
||||
function closeModal() {
|
||||
modal.value = false;
|
||||
filterKeyword2.value = "";
|
||||
}
|
||||
|
||||
//เปิด Modal
|
||||
/** */
|
||||
async function openModalOrder() {
|
||||
const row = await filters.value.filter(
|
||||
(r: ResponseItems) =>
|
||||
(r.status == "REJECT" || r.status == "APPROVE") &&
|
||||
r.organizationPositionOld &&
|
||||
r.positionTypeOld &&
|
||||
r.positionLevelOld &&
|
||||
r.positionNumberOld &&
|
||||
r.salary &&
|
||||
r.location &&
|
||||
r.sendDate
|
||||
);
|
||||
rowsSendToCommand.value = row;
|
||||
openModal();
|
||||
}
|
||||
|
||||
//นำข้อมูลจาก API มาแสดง
|
||||
async function fecthlist() {
|
||||
const pathAPI =
|
||||
stroeResign.mainTabs === "1"
|
||||
? `${config.API.listResign()}?type=APPROVE`
|
||||
: `${config.API.listResign()}/cancel?type=APPROVE`;
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.listResign())
|
||||
.get(pathAPI)
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
// let list: ResponseItems[] = [];
|
||||
// data.map((r: ResponseItems) => {
|
||||
// list.push({
|
||||
// datetext:
|
||||
// r.createdAt == null ? "-" : date2Thai(new Date(r.createdAt)),
|
||||
// activeDate: new Date(),
|
||||
// createdAt: new Date(r.createdAt),
|
||||
// citizenId: r.citizenId,
|
||||
// firstName: r.firstName ?? "",
|
||||
// id: r.id ?? "",
|
||||
// isActive: r.isActive ? r.isActive : false,
|
||||
// lastName: r.lastName ?? "",
|
||||
// location: r.location ?? "",
|
||||
// organizationPositionOld: r.organizationPositionOld ?? "",
|
||||
// positionLevelOld: r.positionLevelOld ?? "",
|
||||
// positionNumberOld: r.positionNumberOld ?? "",
|
||||
// positionTypeOld: r.positionTypeOld ?? "",
|
||||
// prefix: r.prefix ?? "",
|
||||
// profileId: r.profileId ?? "",
|
||||
// reason: r.reason ?? "",
|
||||
// salary: r.salary ? r.salary : 0,
|
||||
// sendDate: r.sendDate,
|
||||
// status: r.status ?? "",
|
||||
// statustext: statusText(r.status ?? ""),
|
||||
// fullname: `${r.prefix ?? ""}${r.firstName ?? ""} ${r.lastName ?? ""}`,
|
||||
// });
|
||||
// });
|
||||
const row = await data.filter(
|
||||
(r: ResponseItems) =>
|
||||
(r.status == "REJECT" || r.status == "APPROVE") &&
|
||||
r.organizationPositionOld &&
|
||||
r.positionTypeOld &&
|
||||
r.positionLevelOld &&
|
||||
r.positionNumberOld &&
|
||||
r.salary &&
|
||||
r.location &&
|
||||
r.sendDate
|
||||
);
|
||||
rowsSendToCommand.value = row;
|
||||
modal.value = true;
|
||||
})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/** รายการลาออก*/
|
||||
async function fecthlist() {
|
||||
const pathAPI =
|
||||
stroeResign.mainTabs === "1"
|
||||
? `${config.API.listResign()}?type=${status.value}`
|
||||
: `${config.API.listResign()}/cancel?type=${status.value}`;
|
||||
showLoader();
|
||||
await http
|
||||
.get(pathAPI)
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
rows.value = data;
|
||||
filters.value = data;
|
||||
})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -258,7 +246,9 @@ onMounted(async () => {
|
|||
hide-bottom-space
|
||||
outlined
|
||||
use-input
|
||||
@update:model-value="stroeResign.formQurey.status = status"
|
||||
@update:model-value="
|
||||
(stroeResign.formQurey.status = status), fecthlist()
|
||||
"
|
||||
@filter="(inputValue:string,doneFn:Function) => filterOption(inputValue, doneFn) "
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue