Merge branch 'develop' into devTee

This commit is contained in:
setthawutttty 2025-09-05 14:42:28 +07:00
commit 3d4185f717
2 changed files with 26 additions and 15 deletions

View file

@ -7,9 +7,7 @@ import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useOrganizational } from "@/modules/02_organization/store/organizational";
/**
* import Type
*/
/** import Type*/
import type { QTableProps } from "quasar";
import type { HistoryPos } from "@/modules/02_organization/interface/response/organizational";
@ -56,11 +54,11 @@ const baseColumns = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "orgShortName",
name: "shortName",
align: "left",
label: "อักษรย่อ",
sortable: true,
field: "orgShortName",
field: "shortName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
@ -193,15 +191,8 @@ async function fetchHistoryPos(id: string) {
const data = res.data.result;
rows.value =
props.historyType === "HISTORY"
? data
: data.map((e: any) => ({
...e,
fullname:
e.prefix && e.firstName && e.lastName
? `${e.prefix ?? ""} ${e.firstName ?? ""} ${e.lastName ?? ""}`
: "-",
shortName: e.orgShortName,
}));
? formatHistoryData(data)
: formatHistoryOwnerData(data);
})
.catch((err) => {
messageError($q, err);
@ -211,6 +202,23 @@ async function fetchHistoryPos(id: string) {
});
}
function formatHistoryData(data: HistoryPos[]) {
return data.map((item) => ({
...item,
shortName: item.orgShortName ?? "-",
}));
}
function formatHistoryOwnerData(data: HistoryPos[]) {
return data.map((item) => ({
...item,
fullname:
item.prefix && item.firstName && item.lastName
? `${item.prefix} ${item.firstName} ${item.lastName}`.trim()
: "-",
}));
}
/** ดูการเปลี่ยนแปลง modal เมื่อเป็น true จะเรียกเรียกข้อมูลประวัติตำแหน่ง*/
watch(
() => modal.value,

View file

@ -167,11 +167,14 @@ interface PosMaster2 {
interface HistoryPos {
id: string; //id node
orgShotName: string; //ชื่อย่อส่วนราชการ
orgShortName: string; //ชื่อย่อส่วนราชการ
lastUpdatedAt: Date; //วันที่แก้ไข
posMasterNoPrefix: string; //Prefix นำหน้าเลขที่ตำแหน่ง เป็น Optional (ไม่ใช่อักษรย่อของหน่วยงาน/ส่วนราชการ)
posMasterNo: number; //เลขที่ตำแหน่ง เป็นตัวเลข
posMasterNoSuffix: string; //Suffix หลังเลขที่ตำแหน่ง เช่น ช.
prefix: string; //คำนำหน้าชื่อผู้ครองตำแหน่ง
firstName: string; //ชื่อผู้ครองตำแหน่ง
lastName: string; //นามสกุลผู้ครองตำแหน่ง
}
interface SelectPerson {