ปรับโครงสร้างอัตรากำลัง

This commit is contained in:
Warunee Tamkoo 2024-02-13 10:45:46 +07:00
parent 4e7ea67e01
commit 833ab217e6
4 changed files with 184 additions and 147 deletions

View file

@ -96,39 +96,39 @@ const orgId = ref<string>("");
* @param data อม Tree
*/
function updateSelected(data: DataTree) {
store.treeId = data.orgTreeId;
store.level = data.orgLevel;
// if (data.orgTreeId === nodeId.value) {
// nodeId.value = "";
// } else {
nodeId.value = data.orgTreeId ? data.orgTreeId : "111";
if (!store.treeId || store.treeId != data.orgTreeId) {
store.treeId = data.orgTreeId;
store.level = data.orgLevel;
data.orgTreeId && props.fetchDataTable?.(data.orgTreeId, data.orgLevel, true);
/** ดึงข้อมูลสถิติจำนวนด้านบน*/
http
.post(config.API.orgSummary, {
id: data.orgTreeId, //*Id node
type: data.orgLevel, //*node
isNode: false, //* node
})
.then(async (res: any) => {
const data = await res.data.result;
if (data) {
store.getSumPosition({
totalPosition: data.totalPosition,
totalPositionCurrentUse: data.totalPositionCurrentUse,
totalPositionCurrentVacant: data.totalPositionCurrentVacant,
totalPositionNextUse: data.totalPositionNextUse,
totalPositionNextVacant: data.totalPositionNextVacant,
totalRootPosition: data.totalPosition,
totalRootPositionCurrentUse: data.totalPositionCurrentUse,
totalRootPositionCurrentVacant: data.totalPositionCurrentVacant,
totalRootPositionNextUse: data.totalPositionNextUse,
totalRootPositionNextVacant: data.totalPositionNextVacant,
});
}
});
// }
nodeId.value = data.orgTreeId ? data.orgTreeId : "111";
data.orgTreeId &&
props.fetchDataTable?.(data.orgTreeId, data.orgLevel, true);
/** ดึงข้อมูลสถิติจำนวนด้านบน*/
http
.post(config.API.orgSummary, {
id: data.orgTreeId, //*Id node
type: data.orgLevel, //*node
isNode: false, //* node
})
.then(async (res: any) => {
const data = await res.data.result;
if (data) {
store.getSumPosition({
totalPosition: data.totalPosition,
totalPositionCurrentUse: data.totalPositionCurrentUse,
totalPositionCurrentVacant: data.totalPositionCurrentVacant,
totalPositionNextUse: data.totalPositionNextUse,
totalPositionNextVacant: data.totalPositionNextVacant,
totalRootPosition: data.totalPosition,
totalRootPositionCurrentUse: data.totalPositionCurrentUse,
totalRootPositionCurrentVacant: data.totalPositionCurrentVacant,
totalRootPositionNextUse: data.totalPositionNextUse,
totalRootPositionNextVacant: data.totalPositionNextVacant,
});
}
});
}
}
const breakLoop = ref<boolean>(false);