From 6a4568ec368376010f3637585146bd077f8fccf0 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Wed, 1 May 2024 10:07:45 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=E0=B8=9A?= =?UTF-8?q?=E0=B8=A3=E0=B8=A3=E0=B8=88=E0=B8=B8=20=E0=B9=81=E0=B8=95?= =?UTF-8?q?=E0=B9=88=E0=B8=87=E0=B8=95=E0=B8=B1=E0=B9=89=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PersonalList/DialogSelectOrg.vue | 25 +++++------------ .../components/PersonalList/Table.vue | 27 ++++++++++++++++--- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/src/modules/05_placement/components/PersonalList/DialogSelectOrg.vue b/src/modules/05_placement/components/PersonalList/DialogSelectOrg.vue index 0d0252ad7..218ad5501 100644 --- a/src/modules/05_placement/components/PersonalList/DialogSelectOrg.vue +++ b/src/modules/05_placement/components/PersonalList/DialogSelectOrg.vue @@ -139,8 +139,6 @@ function updateSelected(data: TreeMain) { const isAll = ref(false); const isBlank = ref(false); async function fetchDataTable(id: string, level: number = 0) { - console.log(props.dataRow); - showLoader(); const body = { node: level, @@ -196,9 +194,6 @@ async function fetchPosFind(level: number, id: string) { .post(config.API.orgPosFind, body) .then((res) => { const data = res.data.result; - - console.log(props?.dataRow); - expanded.value = data; nodeId.value = id; positionId.value = props?.dataRow?.posmasterId; @@ -224,7 +219,6 @@ async function onClickSubmit() { } else { dialogConfirm($q, async () => { showLoader(); - const body = { personalId: props?.dataRow?.personalId, node: dataPosMaster.node, @@ -239,6 +233,7 @@ async function onClickSubmit() { posLevelId: selectedPos.value[0].posLevelId, //ชื่อตำแหน่ง posLevelName: selectedPos.value[0].posLevelName, //ชื่อตำแหน่ง reportingDate: datePos.value, + posmasterId: dataPosMaster.id, typeCommand: props.typeCommand, }; @@ -277,8 +272,6 @@ watch( () => modal.value, async () => { if (modal.value) { - console.log(props?.dataRow); - await fetchOrganizationActive(); if (props?.dataRow?.node !== null && props?.dataRow?.nodeId !== null) { await fetchPosFind(props?.dataRow?.node, props?.dataRow?.nodeId); @@ -319,22 +312,18 @@ function filterNodeFn(data: any, id: string) { watch( () => isAll.value, (value, oldVal) => { - console.log("value", value); - console.log("oldVal", oldVal); - isAll.value = value; - - fetchDataTable(nodeId.value, nodeLevel.value); + if (value !== oldVal) { + fetchDataTable(nodeId.value, nodeLevel.value); + } } ); watch( () => isBlank.value, (value, oldVal) => { - console.log("isBlank value", value); - console.log("isBlank oldVal", oldVal); - isBlank.value = value; - - fetchDataTable(nodeId.value, nodeLevel.value); + if (value !== oldVal) { + fetchDataTable(nodeId.value, nodeLevel.value); + } } ); diff --git a/src/modules/05_placement/components/PersonalList/Table.vue b/src/modules/05_placement/components/PersonalList/Table.vue index 5ffb35a3a..623cc78f1 100644 --- a/src/modules/05_placement/components/PersonalList/Table.vue +++ b/src/modules/05_placement/components/PersonalList/Table.vue @@ -234,14 +234,14 @@ function convertBmaOfficer(val: string) { * แปลงสถานะบรรจุ * @param val type */ -function convertContainStatus(val: string) { +function convertContainStatus(val: string, type: string = "") { switch (val) { case "UN-CONTAIN": return "ยังไม่บรรจุ"; case "PREPARE-CONTAIN": - return "เตรียมบรรจุ"; + return "เตรียม" + (type != "" ? type : "บรรจุ"); case "CONTAIN": - return "บรรจุแล้ว"; + return (type != "" ? type : "บรรจุ") + "แล้ว"; case "DISCLAIM": return "สละสิทธิ์"; default: @@ -249,6 +249,21 @@ function convertContainStatus(val: string) { } } +function convertTypeCommand(val: string) { + switch (val) { + case "APPOINTED": + return "บรรจุแต่งตั้ง"; + case "APPOINT": + return "แต่งตั้ง"; + case "SLIP": + return "เลื่อน"; + case "MOVE": + return "ย้าย"; + default: + return ""; + } +} + /** * แปลงสถานะการส่งรายชื่อ * @param val true/false @@ -322,7 +337,11 @@ async function getTable() { posLevelCandidateName: data.posLevelCandidateName, posmasterId: data.posmasterId, - statusName: convertContainStatus(data.statusId), + statusName: + convertContainStatus(data.statusId) + + (data.typeCommand != "" + ? convertTypeCommand(data.typeCommand) + : ""), organizationName: data.root + " " +