diff --git a/src/modules/05_command/interface/index/Main.ts b/src/modules/05_command/interface/index/Main.ts index 32990e48..b7292feb 100644 --- a/src/modules/05_command/interface/index/Main.ts +++ b/src/modules/05_command/interface/index/Main.ts @@ -2,6 +2,11 @@ interface Pagination { rowsPerPage: number; } +interface DateOption { + name: string; + id: string; +} + interface ActiveOptions { value: boolean; label: string; @@ -25,4 +30,11 @@ interface Tabs { value: string; label: string; } -export type { Pagination, ActiveOptions, ListOrder, Tabs, ListTemplateSalary }; +export type { + Pagination, + DateOption, + ActiveOptions, + ListOrder, + Tabs, + ListTemplateSalary, +}; diff --git a/src/modules/05_command/views/lists.vue b/src/modules/05_command/views/lists.vue index d52c8d4d..22b7bbf6 100644 --- a/src/modules/05_command/views/lists.vue +++ b/src/modules/05_command/views/lists.vue @@ -11,6 +11,7 @@ import type { ActiveOptions, ListOrder, Tabs, + DateOption, } from "@/modules/05_command/interface/index/Main"; import Header from "@/components/DialogHeader.vue"; @@ -58,9 +59,13 @@ const tabs = ref([ }, ]); +const dataCategory = ref([]); //ข้อมูล หมดหมู่ +const categoryOP = ref([]); // options หมดหมู่ + const idOrder = ref(""); // Id คำสั่ง const activeOrderId = ref(""); // Id คำสั่งที่เลือก const name = ref(""); // ชื่อคำสั่ง +const category = ref(""); // หมดหมู่ const listOrder = ref([]); // list คำสั่ง const status = ref(false); // สถานะ const isEdit = ref(false); //เก็บ true/false เช็คแก้ไข @@ -153,6 +158,15 @@ async function fetchOrderType() { }); } +function filterSelector(val: string, update: Function) { + update(() => { + category.value = val ? "" : category.value; + categoryOP.value = dataCategory.value.filter( + (v: any) => v.name.indexOf(val) > -1 + ); + }); +} + /** เริ่มเมื่อโหลดหน้านี้*/ onMounted(() => { fetchOrderType(); @@ -353,6 +367,34 @@ onMounted(() => { hide-bottom-space > +
+ + + +

สถานะการใช้งาน