Merge branch 'nice_dev' into develop
This commit is contained in:
commit
ec9cf57066
2 changed files with 17 additions and 2 deletions
|
|
@ -125,6 +125,7 @@ watch(
|
||||||
() => {
|
() => {
|
||||||
reqMaster.value.page = 1;
|
reqMaster.value.page = 1;
|
||||||
filterTree.value = "";
|
filterTree.value = "";
|
||||||
|
|
||||||
title.value = `ย้ายตำแหน่งจากหน่วยงาน/ส่วนราชการปัจจุบัน ${props.mainTree.orgName}`;
|
title.value = `ย้ายตำแหน่งจากหน่วยงาน/ส่วนราชการปัจจุบัน ${props.mainTree.orgName}`;
|
||||||
if (modal.value && props.type === "SINGER") {
|
if (modal.value && props.type === "SINGER") {
|
||||||
const data = rows.value.filter((e: PosMaster2) => e.id === props.rowId);
|
const data = rows.value.filter((e: PosMaster2) => e.id === props.rowId);
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,8 @@ async function fetchDataTree(id: string) {
|
||||||
* @param level levelTree
|
* @param level levelTree
|
||||||
*/
|
*/
|
||||||
async function fetchDataTable(id: string, level: number, action: boolean) {
|
async function fetchDataTable(id: string, level: number, action: boolean) {
|
||||||
mainTree.value = nodeTree.value?.find((e) => e.orgTreeId === id);
|
searchAndReplaceOrgName(nodeTree.value, id);
|
||||||
|
|
||||||
orgLevel.value = level;
|
orgLevel.value = level;
|
||||||
reqMaster.id = id;
|
reqMaster.id = id;
|
||||||
reqMaster.type = level;
|
reqMaster.type = level;
|
||||||
|
|
@ -138,7 +139,6 @@ function getSummary() {
|
||||||
})
|
})
|
||||||
.then(async (res: any) => {
|
.then(async (res: any) => {
|
||||||
const data = await res.data.result;
|
const data = await res.data.result;
|
||||||
|
|
||||||
store.getSumPosition({
|
store.getSumPosition({
|
||||||
totalPosition: data.totalPosition,
|
totalPosition: data.totalPosition,
|
||||||
totalPositionCurrentUse: data.totalPositionCurrentUse,
|
totalPositionCurrentUse: data.totalPositionCurrentUse,
|
||||||
|
|
@ -161,6 +161,20 @@ async function filterKeyword() {
|
||||||
fetchDataTable(reqMaster.id, reqMaster.type, false);
|
fetchDataTable(reqMaster.id, reqMaster.type, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function searchAndReplaceOrgName(data: any, targetId: string) {
|
||||||
|
for (const child of data) {
|
||||||
|
if (child.orgTreeId === targetId) {
|
||||||
|
mainTree.value = child;
|
||||||
|
|
||||||
|
return true; // Found the targetId in this level
|
||||||
|
}
|
||||||
|
if (child.children && searchAndReplaceOrgName(child.children, targetId)) {
|
||||||
|
return true; // Found the targetId in the nested children
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false; // Not found in this branch
|
||||||
|
}
|
||||||
|
|
||||||
/**lifecycle Hook*/
|
/**lifecycle Hook*/
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
const id =
|
const id =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue