แสดงคนครอง

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-02-07 17:07:52 +07:00
parent 0b0ef1d1ff
commit 72eb0c0643
3 changed files with 10 additions and 2 deletions

View file

@ -106,9 +106,9 @@ async function fetchDataTable(id: string, level: number, action: boolean) {
const { id, ...rest } = a ? a : p[0]; const { id, ...rest } = a ? a : p[0];
const test = { ...e, ...rest }; const test = { ...e, ...rest };
dataMain.push(test); dataMain.push(test);
posMaster.value = store.fetchPosMaster(dataMain);
} }
}); });
posMaster.value = store.fetchPosMaster(dataMain);
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);

View file

@ -103,6 +103,8 @@ interface PosMaster {
positionExecutiveField: string; // ด้านทางการบริหาร positionExecutiveField: string; // ด้านทางการบริหาร
positionArea: string; // ด้าน/สาขา positionArea: string; // ด้าน/สาขา
positionIsSelected: boolean; // เป็นตำแหน่งที่ถูกเลือกในรอบนั้น ๆ หรือไม่? positionIsSelected: boolean; // เป็นตำแหน่งที่ถูกเลือกในรอบนั้น ๆ หรือไม่?
fullNameCurrentHolder: string | null;
fullNameNextHolder: string | null;
positions: Position[]; // ตำแหน่ง positions: Position[]; // ตำแหน่ง
} }
interface Position2 { interface Position2 {

View file

@ -48,7 +48,13 @@ export const useOrganizational = defineStore("organizationalStore", () => {
function fetchPosMaster(data: PosMaster[]) { function fetchPosMaster(data: PosMaster[]) {
const newPosMaster = data.map((e: PosMaster) => ({ const newPosMaster = data.map((e: PosMaster) => ({
...e, ...e,
positionIsSelected: e.positionIsSelected ? "มี" : "ว่าง", positionIsSelected:
typeOrganizational.value === "draft" && e.fullNameNextHolder !== null
? e.fullNameNextHolder
: typeOrganizational.value !== "draft" &&
e.fullNameCurrentHolder !== null
? e.fullNameCurrentHolder
: "ว่าง",
posMasterNo: posMasterNo:
e.orgShortname + e.orgShortname +
e.posMasterNoPrefix + e.posMasterNoPrefix +