fix ==> filter แต่งตั้ง-เลื่อน-ย้าย
This commit is contained in:
parent
4d61d5cb6f
commit
d95042ba0e
1 changed files with 14 additions and 14 deletions
|
|
@ -276,26 +276,19 @@ async function sendToCommand() {
|
|||
// });
|
||||
}
|
||||
|
||||
/** ฟังก์ชันเลือกประเภทคำสั่ง */
|
||||
function filterSelectOrder() {
|
||||
const data = rowsData.value;
|
||||
|
||||
selected.value = [];
|
||||
rows.value = data.filter((v: PersonData) => {
|
||||
function filterSelectOrder(data: PersonData[]) {
|
||||
return data.filter((v: PersonData) => {
|
||||
switch (commandType.value) {
|
||||
case "C-PM-05":
|
||||
return v.typeCommand === "APPOINT";
|
||||
|
||||
case "C-PM-39":
|
||||
return v.typeCommand === "SLIP";
|
||||
|
||||
case "C-PM-07":
|
||||
return v.typeCommand === "MOVE";
|
||||
|
||||
case "C-PM-47":
|
||||
return v.posTypeName === "บริหาร" || v.posTypeName === "อำนวยการ";
|
||||
return v.typeCommand === "ROYAL";
|
||||
default:
|
||||
return [];
|
||||
return []; // ไม่กรอง ถ้าไม่มีประเภท
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -314,9 +307,11 @@ function filterSelector(val: string, update: Function) {
|
|||
}
|
||||
|
||||
function onSearch() {
|
||||
selected.value = [];
|
||||
const filteredByType = filterSelectOrder(rowsData.value);
|
||||
rows.value = onSearchDataTable(
|
||||
filterKeyword2.value,
|
||||
rowsData.value,
|
||||
filteredByType,
|
||||
columns2.value ? columns2.value : []
|
||||
);
|
||||
}
|
||||
|
|
@ -330,6 +325,7 @@ watch(
|
|||
async () => {
|
||||
if (props.Modal === true) {
|
||||
selected.value = [];
|
||||
rows.value = rowsData.value;
|
||||
commandType.value = "";
|
||||
const data = await storeCommand.getCommandTypes();
|
||||
commandMainOp.value = data.filter(
|
||||
|
|
@ -366,7 +362,7 @@ watch(
|
|||
use-input
|
||||
hide-selected
|
||||
fill-input
|
||||
@update:model-value="filterSelectOrder"
|
||||
@update:model-value="onSearch"
|
||||
@filter="(inputValue:string,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn
|
||||
) "
|
||||
|
|
@ -456,6 +452,7 @@ watch(
|
|||
<div
|
||||
v-else-if="col.name == 'organizationNameOld'"
|
||||
class="text-html"
|
||||
style="min-width: 200px"
|
||||
>
|
||||
{{
|
||||
props.row.organizationPositionOld !== null
|
||||
|
|
@ -464,7 +461,10 @@ watch(
|
|||
}}
|
||||
</div>
|
||||
|
||||
<div v-else-if="col.name == 'organizationName'">
|
||||
<div
|
||||
v-else-if="col.name == 'organizationName'"
|
||||
style="min-width: 200px"
|
||||
>
|
||||
{{
|
||||
props.row.position !== null ? props.row.position : ""
|
||||
}}{{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue