เพิ่มฟิลเตอร์
This commit is contained in:
parent
b925026c2f
commit
07962731fa
12 changed files with 403 additions and 36 deletions
|
|
@ -6,6 +6,7 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
import type {
|
||||
FormPlacementMainData,
|
||||
OpfillterTypeSt,
|
||||
DataOptions,
|
||||
} from "@/modules/05_placement/interface/request/Main";
|
||||
import type { FormOrderPlacementMainData } from "@/modules/05_placement/interface/request/Main";
|
||||
|
||||
|
|
@ -357,6 +358,15 @@ export const useTransferDataStore = defineStore("transferDataStore", () => {
|
|||
value: "ออกคำสั่งเสร็จแล้ว",
|
||||
},
|
||||
]);
|
||||
const statusOp = ref<DataOptions[]>([]);
|
||||
const statusMainOp = ref<DataOptions[]>([
|
||||
{ id: "WAITTING", name: "รอดำเนินการ" },
|
||||
{ id: "PENDING", name: "เลือกตำแหน่งแล้ว" },
|
||||
{ id: "APPROVE", name: "อนุมัติ" },
|
||||
{ id: "REJECT", name: "ไม่อนุมัติ" },
|
||||
{ id: "REPORT", name: "ส่งรายชื่อไปออกคำสั่ง" },
|
||||
{ id: "DONE", name: "ออกคำสั่งเสร็จแล้ว" },
|
||||
]);
|
||||
|
||||
const statusText = (val: string) => {
|
||||
switch (val) {
|
||||
|
|
@ -377,6 +387,22 @@ export const useTransferDataStore = defineStore("transferDataStore", () => {
|
|||
return "-";
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* ฟังก์ชั่นค้นหาข้อมูลของ Option Filter
|
||||
* @param val คำที่ค้นหา
|
||||
* @param update Function
|
||||
*/
|
||||
function filterOption(val: string, update: any) {
|
||||
update(() => {
|
||||
const needle = val.toLowerCase();
|
||||
|
||||
statusOp.value = statusMainOp.value.filter(
|
||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
function statusProbationMain(val: number) {
|
||||
switch (val) {
|
||||
case 1:
|
||||
|
|
@ -406,5 +432,8 @@ export const useTransferDataStore = defineStore("transferDataStore", () => {
|
|||
statusText,
|
||||
statusProbationMain,
|
||||
optionStatusProbation,
|
||||
statusOp,
|
||||
statusMainOp,
|
||||
filterOption,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue