From 72eb0c0643b046d97bdd8ab7b4c5a197de6c9043 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 7 Feb 2024 17:07:52 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=AA=E0=B8=94=E0=B8=87=E0=B8=84?= =?UTF-8?q?=E0=B8=99=E0=B8=84=E0=B8=A3=E0=B8=AD=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/02_organizationalNew/components/listView.vue | 2 +- .../interface/response/organizational.ts | 2 ++ src/modules/02_organizationalNew/store/organizational.ts | 8 +++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/modules/02_organizationalNew/components/listView.vue b/src/modules/02_organizationalNew/components/listView.vue index 365ad22db..78a34c112 100644 --- a/src/modules/02_organizationalNew/components/listView.vue +++ b/src/modules/02_organizationalNew/components/listView.vue @@ -106,9 +106,9 @@ async function fetchDataTable(id: string, level: number, action: boolean) { const { id, ...rest } = a ? a : p[0]; const test = { ...e, ...rest }; dataMain.push(test); - posMaster.value = store.fetchPosMaster(dataMain); } }); + posMaster.value = store.fetchPosMaster(dataMain); }) .catch((err) => { messageError($q, err); diff --git a/src/modules/02_organizationalNew/interface/response/organizational.ts b/src/modules/02_organizationalNew/interface/response/organizational.ts index 700f20911..6dd00ece6 100644 --- a/src/modules/02_organizationalNew/interface/response/organizational.ts +++ b/src/modules/02_organizationalNew/interface/response/organizational.ts @@ -103,6 +103,8 @@ interface PosMaster { positionExecutiveField: string; // ด้านทางการบริหาร positionArea: string; // ด้าน/สาขา positionIsSelected: boolean; // เป็นตำแหน่งที่ถูกเลือกในรอบนั้น ๆ หรือไม่? + fullNameCurrentHolder: string | null; + fullNameNextHolder: string | null; positions: Position[]; // ตำแหน่ง } interface Position2 { diff --git a/src/modules/02_organizationalNew/store/organizational.ts b/src/modules/02_organizationalNew/store/organizational.ts index fa7ed8822..ca1af9179 100644 --- a/src/modules/02_organizationalNew/store/organizational.ts +++ b/src/modules/02_organizationalNew/store/organizational.ts @@ -48,7 +48,13 @@ export const useOrganizational = defineStore("organizationalStore", () => { function fetchPosMaster(data: PosMaster[]) { const newPosMaster = data.map((e: PosMaster) => ({ ...e, - positionIsSelected: e.positionIsSelected ? "มี" : "ว่าง", + positionIsSelected: + typeOrganizational.value === "draft" && e.fullNameNextHolder !== null + ? e.fullNameNextHolder + : typeOrganizational.value !== "draft" && + e.fullNameCurrentHolder !== null + ? e.fullNameCurrentHolder + : "ว่าง", posMasterNo: e.orgShortname + e.posMasterNoPrefix +