fix(placement):filter

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-11-25 15:42:07 +07:00
parent 273487cb50
commit b5f54c05a0

View file

@ -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