diff --git a/src/interface/request/main/main.ts b/src/interface/request/main/main.ts index bc0f2b8ea..5257be006 100644 --- a/src/interface/request/main/main.ts +++ b/src/interface/request/main/main.ts @@ -175,11 +175,23 @@ const menuList = readonly([ }, { key: 6, - icon: "mdi-home-variant-outline", - activeIcon: "mdi-home-variant", - label: "บรรจุ แต่งตั้ง ย้าย โอน", path: "placement", + icon: "how_to_reg", + activeIcon: "how_to_reg", + label: "บรรจุ แต่งตั้ง ย้าย โอน", role: "placement", + children: [ + { + label: "รายชื่อผู้สอบผ่าน" /* รายชื่อผู้สอบผ่าน */, + path: "placement", + role: "placement", + }, + { + label: "ออกคำสั่งบรรจุ" /* ออกคำสั่งบรรจุ */, + path: "Orderplacement", + role: "placement", + }, + ], }, { key: 7, @@ -310,5 +322,5 @@ const tabList_placement = readonly([ }, ]); -export { menuList, tabList ,tabList_placement }; +export { menuList, tabList, tabList_placement }; export type { ScrollType, tabType, menuType, notiType, optionType }; diff --git a/src/modules/01_metadata/components/organization/Status.vue b/src/modules/01_metadata/components/organization/Status.vue index baf15ad77..cb94b07cd 100644 --- a/src/modules/01_metadata/components/organization/Status.vue +++ b/src/modules/01_metadata/components/organization/Status.vue @@ -546,7 +546,7 @@ const save = async (publish: boolean) => { .catch((e) => { messageError($q, e); }) - .finally(() => { + .finally(async () => { hideLoader(); await fetchData(true); }); diff --git a/src/modules/01_metadata/components/position/Type.vue b/src/modules/01_metadata/components/position/Type.vue index 90016d15b..34b069487 100644 --- a/src/modules/01_metadata/components/position/Type.vue +++ b/src/modules/01_metadata/components/position/Type.vue @@ -543,7 +543,7 @@ const save = async (publish: boolean) => { .catch((e) => { messageError($q, e); }) - .finally(() => { + .finally(async () => { hideLoader(); await fetchData(true); }); diff --git a/src/modules/01_metadata/components/positionEmployee/Position.vue b/src/modules/01_metadata/components/positionEmployee/Position.vue index 874901210..fabc8e0b6 100644 --- a/src/modules/01_metadata/components/positionEmployee/Position.vue +++ b/src/modules/01_metadata/components/positionEmployee/Position.vue @@ -585,7 +585,7 @@ const save = async (publish: boolean) => { .catch((e) => { messageError($q, e); }) - .finally(() => { + .finally(async () => { hideLoader(); await fetchData(true); }); diff --git a/src/modules/05_placement/components/OrderReplace/MainOrderReplace.vue b/src/modules/05_placement/components/OrderReplace/MainOrderReplace.vue index 91a5d7fda..59c72013b 100644 --- a/src/modules/05_placement/components/OrderReplace/MainOrderReplace.vue +++ b/src/modules/05_placement/components/OrderReplace/MainOrderReplace.vue @@ -80,14 +80,14 @@
+ ([ field: "Order", headerStyle: "font-size: 14px", style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "OrderNum", @@ -290,57 +298,85 @@ const columns = ref([ field: "OrderStatus", headerStyle: "font-size: 14px", style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "OrderType", + align: "left", + label: "ประเภท", + sortable: false, + field: "OrderType", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, ]); // ข้อมูลตาราง (จำลอง) const rows = ref([ { - Order: 1, + Order: "คำสั่งแต่งตั้งผู้สอบแข่งขันได้", OrderNum: "1/2565", fiscalYear: 2565, OrderDate: "30 พ.ค. 2565", OrderBy: "สำนักงาน กทม.", Signer: "นาม สมคิด ยอดใจ ", - OrderStatus: true, + OrderStatus: "ยังไม่ได้บรรจุ", + OrderType: "คำสั่งย้าย", }, + { - Order: 2, + Order: "คำสั่งแต่งตั้งผู้สอบแข่งขันได้", OrderNum: "1/2565", fiscalYear: 2565, OrderDate: "30 พ.ค. 2565", OrderBy: "สำนักงาน กทม.", Signer: "นาม สมคิด ยอดใจ ", - OrderStatus: true, + OrderStatus: "ยังไม่ได้บรรจุ", + OrderType: "คำสั่งบรรจุและแต่งตั้ง", }, + { - Order: 3, + Order: "คำสั่งแต่งตั้งผู้สอบแข่งขันได้", OrderNum: "1/2565", fiscalYear: 2565, OrderDate: "30 พ.ค. 2565", OrderBy: "สำนักงาน กทม.", Signer: "นาม สมคิด ยอดใจ ", - OrderStatus: false, + OrderStatus: "บรรจุแล้ว", + OrderType: "คำสั่งย้าย", }, + { - Order: 4, + Order: "คำสั่งแต่งตั้งผู้สอบแข่งขันได้", OrderNum: "1/2564", fiscalYear: 2564, OrderDate: "30 พ.ค. 2564", OrderBy: "สำนักงาน กทม.", Signer: "นาม สมคิด ยอดใจ ", - OrderStatus: true, + OrderStatus: "บรรจุแล้ว", + OrderType: "คำสั่งแต่งตั้ง", }, + { - Order: 5, + Order: "คำสั่งแต่งตั้งผู้สอบแข่งขันได้", OrderNum: "1/2566", fiscalYear: 2566, OrderDate: "30 พ.ค. 2566", OrderBy: "สำนักงาน กทม.", Signer: "นาม สมคิด ยอดใจ ", - OrderStatus: true, + OrderStatus: "สละสิทธิ์", + OrderType: "คำสั่งแต่งตั้ง", }, ]); +// const OrderStatusOption = [ +// "ทั้งหมด", +// "ยังไม่ได้บรรจุ", +// "บรรจุแล้ว", +// "สละสิทธิ์", +// ]; let OriginalData = ref([]); let UpdataData = ref([]); @@ -364,14 +400,15 @@ const OriginalDataFetch = async () => { onMounted(async () => { await OriginalDataFetch(); fiscalYearFilter(); - examTypeFilter(); searchFilterTable(); + OrderStatusFilter(); + OrderTypeFilter(); }); // ดูรายการสอบแข่งขัน หน้าต่อไป const redirectToPage = (id?: number) => { // router.push({ name: 'placementDetail'}); - router.push(`/placement/detail`); + router.push(`/orderPlacement/detail`); }; const clickDelete = (id: string) => { @@ -391,6 +428,22 @@ const clickDelete = (id: string) => { .onDismiss(() => {}); }; +// const deleteData = async (id: string) => { +// loaderPage(true); +// await http +// .delete(config.API.orderReplace(id)) +// .then((res) => { +// success($q, "ลบข้อมูลสำเร็จ"); +// }) +// .catch((e) => { +// messageError($q, e); +// }) +// .finally(async () => { +// loaderPage(false); +// await fetchData(); +// }); +// }; + const clickAdd = () => { router.push({ name: "addOrderReplace" }); }; @@ -426,6 +479,66 @@ const fiscalYearFilter = async () => { } }; +const OrderType = ref(0); +const OrderTypeOption = reactive([{ id: 0, name: "ทั้งหมด" }]); +const addedOrderTypeValues: number[] = []; +const OrderTypeFilter = async () => { + // API + // await http + // .get(config.API.// ตัวอย่าง) + // .then((res: any) => { + // DataStore.DataMainYearSet(rows.value); + // fiscalyearOP.value = DataStore.DataMainYearGet; + // }) + // .catch((e: any) => { + // messageError($q, e); + // }) + // .finally(async () => { + // }); + for (let data of OriginalData.value) { + const OrderType = data.OrderType; + + if (OrderType.value === null || OrderType > OrderType.value) { + OrderType.value = OrderType; + } + + if (!addedOrderTypeValues.includes(OrderType)) { + OrderTypeOption.push({ id: OrderType, name: OrderType.toString() }); + addedOrderTypeValues.push(OrderType); + } + } +}; + +const OrderStatus = ref(0); +const OrderStatusOption = reactive([{ id: 0, name: "ทั้งหมด" }]); +const addedOrderStatusValues: number[] = []; +const OrderStatusFilter = async () => { + // API + // await http + // .get(config.API.// ตัวอย่าง) + // .then((res: any) => { + // DataStore.DataMainYearSet(rows.value); + // fiscalyearOP.value = DataStore.DataMainYearGet; + // }) + // .catch((e: any) => { + // messageError($q, e); + // }) + // .finally(async () => { + // }); + for (let data of OriginalData.value) { + const OrderStatus = data.OrderStatus; + + if (OrderStatus.value === null || OrderStatus > OrderStatus.value) { + OrderStatus.value = OrderStatus; + } + + if (!addedOrderStatusValues.includes(OrderStatus)) { + OrderStatusOption.push({ id: OrderStatus, name: OrderStatus.toString() }); + addedOrderStatusValues.push(OrderStatus); + } + } +}; + // เลือกปีงบประมาณตาม API const searchfiscalyear = () => { console.log("Input value changed:", fiscalyear.value); @@ -459,32 +572,11 @@ const visibleColumns = ref([ "OrderStatus", ]); //ค้นหา คอลัมน์ คอลัมน์ที่แสดง -// ประเภทการสอบ -const examType = ref(0); -const examTypeOP = reactive([{ id: 0, name: "ทั้งหมด" }]); -const addedexamTypeValues: number[] = []; -const examTypeFilter = async () => { - for (let data of OriginalData.value) { - const examTypeValue = data.examType; - if (examTypeValue == 1 && !addedexamTypeValues.includes(1)) { - examTypeOP.push({ id: 1, name: "คัดเลือก" }); - addedexamTypeValues.push(1); - } else if (examTypeValue == 2 && !addedexamTypeValues.includes(2)) { - examTypeOP.push({ id: 2, name: "สอบแข่งขัน" }); - addedexamTypeValues.push(2); - } - } -}; - const searchFilterTable = async () => { - // console.log('Input value changed:', examTime.value, examType.value, expiredAccount.value); - await DataStore.DataUpdateMain( - examTime.value, - examType.value, - expiredAccount.value - ); - UpdataData.value = DataStore.DataMainUpdate; + await DataStore.DataUpdateMain(OrderStatus.value, OrderType.value); }; +// UpdataData.value = DataStore.DataMainUpdate; +// console.log("Input value changed:", OrderStatus.value, OrderType.value); const paging = ref(true); const paginationLabel = (start: string, end: string, total: string) => { diff --git a/src/modules/05_placement/interface/request/Main.ts b/src/modules/05_placement/interface/request/Main.ts index 0b84ae5f0..cf01f9fe4 100644 --- a/src/modules/05_placement/interface/request/Main.ts +++ b/src/modules/05_placement/interface/request/Main.ts @@ -11,13 +11,14 @@ interface FormPlacementMainData { } interface FormOrderPlacementMainData { - Order: number; + Order: string; OrderNum: string; fiscalYear: number; OrderDate: string; OrderBy: string; Signer: string; - OrderStatus: boolean; + OrderStatus: string; + OrderType: string; } export type { FormPlacementMainData }; diff --git a/src/modules/05_placement/router.ts b/src/modules/05_placement/router.ts index 406c6158d..cad0932c5 100644 --- a/src/modules/05_placement/router.ts +++ b/src/modules/05_placement/router.ts @@ -12,9 +12,11 @@ const Placement2Detail = () => import("@/modules/05_placement/components/exams_other/Detail.vue"); const addOrderReplace = () => import("@/modules/05_placement/components/OrderReplace/addOrderReplace.vue"); +const MainOrderPlacement = () => + import("@/modules/05_placement/components/OrderReplace/MainOrderReplace.vue"); export default [ { - path: "/placement", + path: "/placement/Sorkorcho", name: "placement", component: MainSorkorcho, meta: { @@ -23,6 +25,16 @@ export default [ Role: "placement", }, }, + { + path: "/placement/OrderPlacement", + name: "Orderplacement", + component: MainOrderPlacement, + meta: { + Auth: true, + Key: [7], + Role: "placement", + }, + }, { path: "/placement/detail", name: "placementDetail", diff --git a/src/views/MainLayout.vue b/src/views/MainLayout.vue index 7b30a2e92..224ec4a5b 100644 --- a/src/views/MainLayout.vue +++ b/src/views/MainLayout.vue @@ -10,7 +10,11 @@ import type { notiType, optionType, } from "../interface/request/main/main"; -import { menuList, tabList ,tabList_placement } from "../interface/request/main/main"; +import { + menuList, + tabList, + tabList_placement, +} from "../interface/request/main/main"; const { setVerticalScrollPosition, getVerticalScrollPosition } = scroll; const store = useDataStore(); @@ -696,7 +700,9 @@ if (keycloak.tokenParsed != null) { class="menuSub" expand-icon="mdi-chevron-down" expanded-icon="mdi-chevron-up" - v-if="menuItem.key == 3 || menuItem.key == 5" + v-if=" + menuItem.key == 3 || menuItem.key == 5 || menuItem.key == 6 + " >