From 56c6c7ce0592145152d827e9ec66789f8079ba14 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Fri, 25 Oct 2024 15:15:43 +0700 Subject: [PATCH] =?UTF-8?q?UI=20=E0=B8=9A=E0=B8=A3=E0=B8=A3=E0=B8=88?= =?UTF-8?q?=E0=B8=B8=E0=B9=81=E0=B8=95=E0=B9=88=E0=B8=87=E0=B8=95=E0=B8=B1?= =?UTF-8?q?=E0=B9=89=E0=B8=87=20=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=8A?= =?UTF-8?q?=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=9C=E0=B8=B9=E0=B9=89=E0=B8=AA?= =?UTF-8?q?=E0=B8=AD=E0=B8=9A=E0=B8=9C=E0=B9=88=E0=B8=B2=E0=B8=99=20popup?= =?UTF-8?q?=20=E0=B9=80=E0=B8=A5=E0=B8=B7=E0=B8=AD=E0=B8=81=E0=B8=AB?= =?UTF-8?q?=E0=B8=99=E0=B9=88=E0=B8=A7=E0=B8=A2=E0=B8=87=E0=B8=B2=E0=B8=99?= =?UTF-8?q?=20=E0=B9=81=E0=B8=A5=E0=B8=B0=20filter=20=E0=B8=84=E0=B8=99?= =?UTF-8?q?=E0=B8=AB=E0=B8=99=E0=B9=89=E0=B8=B2=E0=B8=A3=E0=B8=B2=E0=B8=A2?= =?UTF-8?q?=E0=B8=8A=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=95=E0=B8=B2=E0=B8=A1?= =?UTF-8?q?=E0=B8=AA=E0=B8=96=E0=B8=B2=E0=B8=99=E0=B8=A0=E0=B8=B2=E0=B8=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/PersonalList/CardPosition.vue | 107 ++++++++++++++---- .../PersonalList/DialogSelectOrg.vue | 62 +++++++++- .../components/PersonalList/Table.vue | 18 +++ .../components/PersonalList/TableView.vue | 30 ++++- .../interface/response/SelectOrg.ts | 16 ++- 5 files changed, 210 insertions(+), 23 deletions(-) diff --git a/src/modules/05_placement/components/PersonalList/CardPosition.vue b/src/modules/05_placement/components/PersonalList/CardPosition.vue index e977b283c..cb6074ed2 100644 --- a/src/modules/05_placement/components/PersonalList/CardPosition.vue +++ b/src/modules/05_placement/components/PersonalList/CardPosition.vue @@ -3,8 +3,13 @@ import { ref, onMounted, watch } from "vue"; /** importType*/ import type { QTableProps } from "quasar"; -import type { Positions } from "@/modules/05_placement/interface/response/SelectOrg"; +import type { + Positions, + FormPosType, + FormPosLevel, +} from "@/modules/05_placement/interface/response/SelectOrg"; import type { DataPositionNo } from "@/modules/05_placement/interface/index/SelectOrg"; +import { useSelectOrgStore } from "@/modules/05_placement/stores/storeSelect"; /** importStore*/ import { useCounterMixin } from "@/stores/mixin"; @@ -12,6 +17,8 @@ import { useCounterMixin } from "@/stores/mixin"; /** use*/ const { date2Thai } = useCounterMixin(); +const store = useSelectOrgStore(); + /** props*/ const selected = defineModel("selectedPos", { required: true }); //ตำแหน่งที่เลือก const positionId = defineModel("positionId", { required: true }); //id ตำแหน่งที่เลือก @@ -20,9 +27,25 @@ const date = defineModel("datePos", { required: true }); //วันยท const positionData = defineModel("position", { required: true }); //ข้อมูลรายการตำแหน่งเลขที่ const isAll = defineModel("isAll", { required: true }); //แสดงตำแหน่งทั้งหมด const isBlank = defineModel("isBlank", { required: true }); //แสดงเฉพาะตำแหน่งว่าง +const isPosition = defineModel("isPosition", { required: true }); +const isPositionOld = defineModel("isPositionOld", { required: true }); //แสดงตำแหน่งที่ตรงกับประเภทและระดับเดิม +const posType = defineModel("posType", { required: true }); //ประเภทตำแหน่ง +const posLevel = defineModel("posLevel", { required: true }); //ระดับตำแหน่ง +const optionPosType = defineModel("optionPosType", { + required: true, +}); +const optionPosLevel = defineModel("optionPosLevel", { + required: true, +}); const positionRows = ref(positionData.value); -const isPosition = ref(true); + +const props = defineProps({ + fetchDataTable: Function, + onPosType: Function, + nodeId: String, + nodeLevel: Number, +}); //Table const filters = ref(""); //คำค้นหา @@ -196,26 +219,22 @@ async function onClickSelectPos(id: string) { } } -/** - * function ค้นหาตำแหน่งตามการเลือกแสดงเฉพาะตำแหน่งที่ตรงกับการสอบ - */ -async function fetchIsPosition() { - // ถ้าเลือกแสดงเฉพาะตำแหน่งที่ตรงกับการสอบ ระบบจะ filter เลือกเฉพาะข้อมูลที่ตรงกับการสอบ - if (isPosition.value) { - const lists = await positionData.value.filter( - (e: any) => e.isPosition === true - ); - positionRows.value = lists; - } - // ถ้าไม่ได้เลือกระบบจะแสดงตำแหน่งทั้งหมด - else { - positionRows.value = positionData.value; +function onPositionOld() { + props.fetchDataTable?.(props.nodeId, props.nodeLevel); + if (isPositionOld.value == false) { + posType.value.id = ""; + posType.value.posTypeName = ""; + posType.value.posTypeRank = null; + posType.value.posLevels = []; + posLevel.value = ""; } } // เช็คว่าถ้ามีการปรับ filter ระบบจะนำข้อมูลไปเช็ค filter แสดงเฉพาะตำแหน่งที่ตรงกับการสอบใหม่อีกครั้ง watch(positionData, (newVal, oldVal) => { - if (newVal != oldVal) fetchIsPosition(); + if (newVal != oldVal) { + positionRows.value = positionData.value; + } }); /** @@ -227,7 +246,7 @@ onMounted(async () => { await onClickSelectPos(positionId.value); }, 1000); } else { - fetchIsPosition(); + positionRows.value = positionData.value; } }); @@ -255,7 +274,9 @@ onMounted(async () => { v-model="isPosition" label="แสดงเฉพาะตำแหน่งที่ตรงกับการสอบ" color="primary" - @update:model-value="fetchIsPosition" + @update:model-value=" + props.fetchDataTable?.(props.nodeId, props.nodeLevel) + " > แสดงเฉพาะตำแหน่งที่ตรงกับการสอบ @@ -271,6 +292,54 @@ onMounted(async () => { > +
+
+
+ + แสดงตำแหน่งที่ตรงกับประเภทและระดับเดิม + +
+ +
+ + +
+
+ + +
+
+
diff --git a/src/modules/05_placement/components/PersonalList/DialogSelectOrg.vue b/src/modules/05_placement/components/PersonalList/DialogSelectOrg.vue index ca86fbd9b..66b4f79e8 100644 --- a/src/modules/05_placement/components/PersonalList/DialogSelectOrg.vue +++ b/src/modules/05_placement/components/PersonalList/DialogSelectOrg.vue @@ -1,5 +1,5 @@