From f3a7f92540978209ceb21a0e60d6810dc6136149 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Tue, 5 Nov 2024 10:36:31 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=E0=B8=9F=E0=B8=B4=E0=B8=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../probation/FormAppoint/FormAppoint.vue | 84 ++++++++++++++++--- .../05_placement/interface/request/Main.ts | 4 + 2 files changed, 77 insertions(+), 11 deletions(-) diff --git a/src/modules/05_placement/components/probation/FormAppoint/FormAppoint.vue b/src/modules/05_placement/components/probation/FormAppoint/FormAppoint.vue index 75028aadf..1f487a436 100644 --- a/src/modules/05_placement/components/probation/FormAppoint/FormAppoint.vue +++ b/src/modules/05_placement/components/probation/FormAppoint/FormAppoint.vue @@ -36,6 +36,7 @@ const id = ref(route.params.id as string); const profileId = ref(""); const isSave = ref(false); const isDirector = ref(false); +const isAct = ref(false); const topic = ref(""); const status = ref(""); @@ -74,18 +75,22 @@ const rowsDirector = ref([]); const visibleColumns = ref([ "no", + "positionNo", "role", "name", "position", "positionType", "positionLevel", + "actFullName", ]); const visibleColumnsMember = ref([ "no", + "posNo", "name", "position", "posLevel", "posType", + "actFullName", ]); /** หัวตาราง */ const columns = ref([ @@ -98,6 +103,15 @@ const columns = ref([ headerStyle: "font-size: 14px", style: "font-size: 14px", }, + { + name: "positionNo", + align: "left", + label: "เลขที่ตำแหน่ง", + sortable: true, + field: "positionNo", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, { name: "role", align: "left", @@ -143,6 +157,15 @@ const columns = ref([ headerStyle: "font-size: 14px", style: "font-size: 14px", }, + { + name: "actFullName", + align: "left", + label: "รักษาการแทน", + sortable: true, + field: "actFullName", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, ]); const columnsMember = ref([ { @@ -154,6 +177,15 @@ const columnsMember = ref([ headerStyle: "font-size: 14px", style: "font-size: 14px", }, + { + name: "posNo", + align: "left", + label: "เลขที่ตำแหน่ง", + sortable: true, + field: "posNo", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, { name: "name", align: "left", @@ -191,14 +223,25 @@ const columnsMember = ref([ headerStyle: "font-size: 14px", style: "font-size: 14px", }, + { + name: "actFullName", + align: "left", + label: "รักษาการแทน", + sortable: true, + field: "actFullName", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, ]); -/** เพิ่ม ประธาน/กรรมการ */ +/** เพิ่ม คณะกรรมการ */ function onAdd() { modal.value = true; } function close() { + isAct.value = false; + isDirector.value = false; modal.value = false; member.value = ""; selected.value = []; @@ -221,6 +264,8 @@ function onAddPerson() { position: item.position, positionType: item.posType, positionLevel: item.posLevel, + actFullName: item.actFullName, + positionNo: item.posNo, role: member.value, })); rows.value = [...rows.value, ...data]; @@ -232,6 +277,7 @@ async function getPerson() { showLoader(); await http .post(config.API.orgProfileDirector, { + isAct: isAct.value, isDirector: isDirector.value, pageSize: pagination.value.rowsPerPage, page: pagination.value.page, @@ -241,7 +287,10 @@ async function getPerson() { const data = await res.data.result.data; const dataTotal = await res.data.result.total; - rowsDirector.value = data; + rowsDirector.value = data.filter( + (item: MemBerType, index: number, self: any[]) => + index === self.findIndex((t: any) => t.id === item.id) + ); rowsDirector.value = rowsDirector.value.filter( (item: MemBerType) => !rows.value.some((i: PersonsAppointData) => i.profileId == item.id) @@ -293,7 +342,7 @@ function onSubmit() { const body = { topic: topic.value, persons: rows.value.map( - ({ prefix, firstName, lastName, citizenId, ...newData }) => newData + ({ prefix, firstName, lastName, citizenId,actFullName,positionNo, ...newData }) => newData ), }; dialogConfirm($q, () => { @@ -348,6 +397,13 @@ async function getData() { async function onDirector() { pagination.value.page = 1; + isAct.value = false; + await getPerson(); + selected.value = []; +} +async function onAct() { + pagination.value.page = 1; + isDirector.value = false; await getPerson(); selected.value = []; } @@ -441,7 +497,7 @@ onMounted(async () => {
- ประธาน/กรรมการ + คณะกรรมการ { @click="onAdd" icon="mdi-plus" > - เพิ่มประธาน/กรรมการ + เพิ่มคณะกรรมการ
@@ -466,11 +522,8 @@ onMounted(async () => { flat :visible-columns="visibleColumns" bordered - :paging="true" dense - v-model:pagination="pagination" - :rows-per-page-options="[10, 25, 50, 100]" - @update:pagination="updatePagination" + hide-pagination >