ปรับ summary อัตรากำลัง
This commit is contained in:
parent
2a7051f5f6
commit
6245e552aa
5 changed files with 68 additions and 12 deletions
|
|
@ -39,4 +39,5 @@ export default {
|
||||||
orgSearchProfile: `${orgProfile}/search`,
|
orgSearchProfile: `${orgProfile}/search`,
|
||||||
orgProfile: `${orgPos}/profile`,
|
orgProfile: `${orgPos}/profile`,
|
||||||
orgDeleteProfile: (id: string) => `${orgPos}/profile/delete/${id}`,
|
orgDeleteProfile: (id: string) => `${orgPos}/profile/delete/${id}`,
|
||||||
|
orgSummary: `${orgPos}/summary`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ const props = defineProps({
|
||||||
actionType: String,
|
actionType: String,
|
||||||
rowId: String,
|
rowId: String,
|
||||||
fetchDataTable: Function,
|
fetchDataTable: Function,
|
||||||
|
getSummary: Function,
|
||||||
});
|
});
|
||||||
|
|
||||||
const modalAdd = ref<boolean>(false);
|
const modalAdd = ref<boolean>(false);
|
||||||
|
|
@ -376,6 +377,7 @@ function onSubmit() {
|
||||||
reqMaster.value.type,
|
reqMaster.value.type,
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
props.getSummary?.();
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,10 @@ const props = defineProps({
|
||||||
type: Function,
|
type: Function,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
getSummary: {
|
||||||
|
type: Function,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
dataDetailPos: { type: Object, require: true },
|
dataDetailPos: { type: Object, require: true },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -290,6 +294,7 @@ function onSubmit() {
|
||||||
.post(config.API.orgProfile, body)
|
.post(config.API.orgProfile, body)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
props.fetchDataTable?.(store.treeId, store.level, false);
|
props.fetchDataTable?.(store.treeId, store.level, false);
|
||||||
|
props.getSummary();
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
|
||||||
|
|
@ -105,18 +105,29 @@ function updateSelected(data: DataTree) {
|
||||||
nodeId.value = data.orgTreeId ? data.orgTreeId : "111";
|
nodeId.value = data.orgTreeId ? data.orgTreeId : "111";
|
||||||
|
|
||||||
data.orgTreeId && props.fetchDataTable?.(data.orgTreeId, data.orgLevel, true);
|
data.orgTreeId && props.fetchDataTable?.(data.orgTreeId, data.orgLevel, true);
|
||||||
store.getSumPosition({
|
/** ดึงข้อมูลสถิติจำนวนด้านบน*/
|
||||||
totalPosition: data.totalPosition,
|
http
|
||||||
totalPositionCurrentUse: data.totalPositionCurrentUse,
|
.post(config.API.orgSummary, {
|
||||||
totalPositionCurrentVacant: data.totalPositionCurrentVacant,
|
id: data.orgTreeId, //*Id node
|
||||||
totalPositionNextUse: data.totalPositionNextUse,
|
type: data.orgLevel, //*ประเภทnode
|
||||||
totalPositionNextVacant: data.totalPositionNextVacant,
|
isNode: false, //*นับทั้ง node ไหม
|
||||||
totalRootPosition: data.totalRootPosition,
|
})
|
||||||
totalRootPositionCurrentUse: data.totalRootPositionCurrentUse,
|
.then(async (res: any) => {
|
||||||
totalRootPositionCurrentVacant: data.totalRootPositionCurrentVacant,
|
const data = await res.data.result;
|
||||||
totalRootPositionNextUse: data.totalRootPositionNextUse,
|
|
||||||
totalRootPositionNextVacant: data.totalRootPositionNextVacant,
|
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,
|
||||||
|
});
|
||||||
|
});
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -268,6 +268,7 @@ function onClickDelete(id: string) {
|
||||||
.then(() => {
|
.then(() => {
|
||||||
success($q, "ลบข้อมูลสำเร็จ");
|
success($q, "ลบข้อมูลสำเร็จ");
|
||||||
props.fetchDataTable?.(reqMaster.value.id, reqMaster.value.type, false);
|
props.fetchDataTable?.(reqMaster.value.id, reqMaster.value.type, false);
|
||||||
|
getSummary();
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -336,6 +337,7 @@ function removePerson(id: string) {
|
||||||
reqMaster.value.type,
|
reqMaster.value.type,
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
getSummary();
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, 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>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -657,6 +692,7 @@ function removePerson(id: string) {
|
||||||
:rowId="rowId"
|
:rowId="rowId"
|
||||||
v-model:reqMaster="reqMaster"
|
v-model:reqMaster="reqMaster"
|
||||||
:fetchDataTable="props.fetchDataTable"
|
:fetchDataTable="props.fetchDataTable"
|
||||||
|
:getSummary="getSummary"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- จัดลำดับ -->
|
<!-- จัดลำดับ -->
|
||||||
|
|
@ -683,6 +719,7 @@ function removePerson(id: string) {
|
||||||
v-model:modal="modalSelectPerson"
|
v-model:modal="modalSelectPerson"
|
||||||
:dataDetailPos="dataDetailPos"
|
:dataDetailPos="dataDetailPos"
|
||||||
:fetchDataTable="props.fetchDataTable"
|
:fetchDataTable="props.fetchDataTable"
|
||||||
|
:getSummary="getSummary"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue