ปรับ summary อัตรากำลัง

This commit is contained in:
Warunee Tamkoo 2024-02-12 09:41:52 +07:00
parent 2a7051f5f6
commit 6245e552aa
5 changed files with 68 additions and 12 deletions

View file

@ -268,6 +268,7 @@ function onClickDelete(id: string) {
.then(() => {
success($q, "ลบข้อมูลสำเร็จ");
props.fetchDataTable?.(reqMaster.value.id, reqMaster.value.type, false);
getSummary();
})
.catch((err) => {
messageError($q, err);
@ -336,6 +337,7 @@ function removePerson(id: string) {
reqMaster.value.type,
false
);
getSummary();
})
.catch((err) => {
messageError($q, err);
@ -348,6 +350,39 @@ function removePerson(id: string) {
"ต้องการยืนยันการลบคนครองนี้ใช่หรือไม่?"
);
}
/** ดึงข้อมูลสถิติจำนวนด้านบน*/
function getSummary() {
showLoader();
http
.post(config.API.orgSummary, {
id: reqMaster.value.id, //*Id node
type: reqMaster.value.type, //*node
isNode: reqMaster.value.isAll, //* node
})
.then(async (res: any) => {
const data = await res.data.result;
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,
});
})
.catch((err) => {
// messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
</script>
<template>
@ -657,6 +692,7 @@ function removePerson(id: string) {
:rowId="rowId"
v-model:reqMaster="reqMaster"
:fetchDataTable="props.fetchDataTable"
:getSummary="getSummary"
/>
<!-- ดลำด -->
@ -683,6 +719,7 @@ function removePerson(id: string) {
v-model:modal="modalSelectPerson"
:dataDetailPos="dataDetailPos"
:fetchDataTable="props.fetchDataTable"
:getSummary="getSummary"
/>
</template>