Merge pull request #1531 from Frappet/fix/leave-report
fix:orgTreeDnaId
This commit is contained in:
commit
3aa1a5907a
1 changed files with 6 additions and 2 deletions
|
|
@ -112,6 +112,7 @@ const nodeId = ref<string>("");
|
||||||
const nodeLevel = ref<number>(0);
|
const nodeLevel = ref<number>(0);
|
||||||
const node = ref<DataStructureTree[]>([]);
|
const node = ref<DataStructureTree[]>([]);
|
||||||
const expanded = ref<string[]>([]);
|
const expanded = ref<string[]>([]);
|
||||||
|
const orgTreeDnaId = ref<string>("");
|
||||||
|
|
||||||
/** ฟังก์ชันเรียกข้อมูลโครงสร้างหน่วยงาน*/
|
/** ฟังก์ชันเรียกข้อมูลโครงสร้างหน่วยงาน*/
|
||||||
async function fetchDataTree() {
|
async function fetchDataTree() {
|
||||||
|
|
@ -135,6 +136,7 @@ function onSelectedNode(data: any) {
|
||||||
nodeId.value = data.orgTreeId;
|
nodeId.value = data.orgTreeId;
|
||||||
nodeLevel.value = data.orgLevel;
|
nodeLevel.value = data.orgLevel;
|
||||||
expandedModal.value = false;
|
expandedModal.value = false;
|
||||||
|
orgTreeDnaId.value = data.orgTreeDnaId;
|
||||||
updateLeaveday();
|
updateLeaveday();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -219,6 +221,7 @@ async function fetchLeaveday(
|
||||||
startDate: Date,
|
startDate: Date,
|
||||||
endDate: Date
|
endDate: Date
|
||||||
) {
|
) {
|
||||||
|
const nodeIdVal = typeReport.value === 3 ? orgTreeDnaId.value : nodeId.value;
|
||||||
const body = {
|
const body = {
|
||||||
type:
|
type:
|
||||||
year === "FULL"
|
year === "FULL"
|
||||||
|
|
@ -232,7 +235,7 @@ async function fetchLeaveday(
|
||||||
: "WEEKLY",
|
: "WEEKLY",
|
||||||
startDate: dateToISO(startDate),
|
startDate: dateToISO(startDate),
|
||||||
endDate: dateToISO(endDate),
|
endDate: dateToISO(endDate),
|
||||||
nodeId: nodeId.value,
|
nodeId: nodeIdVal,
|
||||||
node: nodeLevel.value,
|
node: nodeLevel.value,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -334,6 +337,7 @@ function filterOption(val: string, update: any, typeOp: string) {
|
||||||
function clearData() {
|
function clearData() {
|
||||||
nodeId.value = "";
|
nodeId.value = "";
|
||||||
nodeLevel.value = 0;
|
nodeLevel.value = 0;
|
||||||
|
orgTreeDnaId.value = "";
|
||||||
org.value = "";
|
org.value = "";
|
||||||
typeReport.value = null;
|
typeReport.value = null;
|
||||||
yearType.value = "FULL";
|
yearType.value = "FULL";
|
||||||
|
|
@ -410,7 +414,7 @@ function getReport() {
|
||||||
: "WEEKLY",
|
: "WEEKLY",
|
||||||
startDate: dateToISO(dateStart.value),
|
startDate: dateToISO(dateStart.value),
|
||||||
endDate: dateToISO(dateEnd.value),
|
endDate: dateToISO(dateEnd.value),
|
||||||
nodeId: nodeId.value,
|
nodeId: orgTreeDnaId.value,
|
||||||
node: nodeLevel.value,
|
node: nodeLevel.value,
|
||||||
};
|
};
|
||||||
http
|
http
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue