fix(placement):filter
This commit is contained in:
parent
273487cb50
commit
b5f54c05a0
1 changed files with 26 additions and 2 deletions
|
|
@ -415,14 +415,19 @@ async function getTable() {
|
|||
rowsAwait.value = rowData;
|
||||
await onUpdateNewRows(typeEmployee.value, positionCandidate.value);
|
||||
|
||||
const filteredRows = await filterRowsMain(
|
||||
typeEmployee.value,
|
||||
positionCandidate.value
|
||||
);
|
||||
|
||||
// รายชื่อไปยังหน่วยงาน
|
||||
rowsFilter.value = await rows.value.filter(
|
||||
rowsFilter.value = await filteredRows.filter(
|
||||
(e: any) =>
|
||||
e.draft == "รอส่งตัว" &&
|
||||
e.nodeName !== null &&
|
||||
e.reportingDate !== null
|
||||
);
|
||||
rowsFilterData.value = await rows.value.filter(
|
||||
rowsFilterData.value = await filteredRows.filter(
|
||||
(e: any) =>
|
||||
e.draft == "รอส่งตัว" &&
|
||||
e.nodeName !== null &&
|
||||
|
|
@ -830,6 +835,25 @@ async function onUpdateNewRows(type: string, pos: string) {
|
|||
});
|
||||
}
|
||||
|
||||
async function filterRowsMain(type: string, pos: string) {
|
||||
return rowsAwait.value.filter((item: any) => {
|
||||
const isTypeMatch =
|
||||
type === "OFFICER"
|
||||
? item.bmaOfficerCheck === "OFFICER"
|
||||
: type === "EXTERNAL"
|
||||
? item.bmaOfficerCheck === null
|
||||
: item.bmaOfficerCheck === "OFFICER" || item.bmaOfficerCheck === null;
|
||||
|
||||
const isPositionMatch = pos === "" || item.positionCandidate === pos;
|
||||
|
||||
const isStatusMatch = containStatus.value
|
||||
? item.statusId === "DONE"
|
||||
: item.statusId !== "DONE";
|
||||
|
||||
return isTypeMatch && isPositionMatch && isStatusMatch;
|
||||
});
|
||||
}
|
||||
|
||||
async function getWorkFlow() {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue