fix ==> โครงสร้างอัตรากำลัง ประวัติคนครอง

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-09-01 10:52:43 +07:00
parent 3bc0c2557a
commit ecc9ab9a4c
2 changed files with 49 additions and 1 deletions

View file

@ -191,7 +191,17 @@ async function fetchHistoryPos(id: string) {
.get(pathAPI)
.then((res) => {
const data = res.data.result;
rows.value = data;
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,
}));
})
.catch((err) => {
messageError($q, err);
@ -206,6 +216,10 @@ watch(
() => modal.value,
() => {
modal.value && props.rowId && fetchHistoryPos(props.rowId);
if (!modal.value) {
rows.value = [];
}
}
);
</script>