diff --git a/src/api/02_organizational/api.organization.ts b/src/api/02_organizational/api.organization.ts index 6b3848fcf..21dec61c1 100644 --- a/src/api/02_organizational/api.organization.ts +++ b/src/api/02_organizational/api.organization.ts @@ -15,6 +15,8 @@ export default { orgByid: (id: string) => `${organization}/${id}`, orgByIdSystem: (id: string, sys: string) => `${organization}/system/${id}/${sys}`, + orgByIdSystemRoot: (id: string, sys: string) => + `${organization}/system-root/${id}/${sys}`, createOrganization: `${organization}/draft`, createOrgLevel: (type: string) => `${organization}/${type}`, orgLevelByid: (type: string, id: string) => `${organization}/${type}/${id}`, diff --git a/src/modules/07_insignia/components/2_Manage/Tab1.vue b/src/modules/07_insignia/components/2_Manage/Tab1.vue index 9487fedff..b180a1aec 100644 --- a/src/modules/07_insignia/components/2_Manage/Tab1.vue +++ b/src/modules/07_insignia/components/2_Manage/Tab1.vue @@ -82,7 +82,6 @@ const employeeClassOps = ref(DataStore.employeeClassOps); //ปร const dialogWarn = ref(false); const checkboxData = ref([]); -const organizationOptions = ref([{ id: "1", name: "ทั้งหมด" }]); const filterOrganizationOP = ref([]); /** หัวตาราง*/ @@ -768,7 +767,7 @@ function filterSelector(val: string, update: Function, name: string) { (v: OptionData) => v.name.toLowerCase().indexOf(needle) > -1 ); } else if (name === "filterOrganizationOP") { - filterOrganizationOP.value = organizationOptions.value.filter( + filterOrganizationOP.value = DataStore.optionsTypeOc.filter( (v: OptionData) => v.name.toLowerCase().indexOf(needle) > -1 ); } @@ -791,8 +790,10 @@ function clearInsigniaFilters(name: string) { /** Hook*/ onMounted(async () => { - organizationOptions.value = await DataStore.optionsTypeOc; - organization.value = await DataStore.typeOc; + console.log(DataStore.optionsTypeOc); + + filterOrganizationOP.value = await DataStore.optionsTypeOc; + organization.value = DataStore.typeOc; if (organization.value !== "" || organization.value !== undefined) { if (props.fecthInsigniaByOc) { @@ -805,7 +806,6 @@ onMounted(async () => { DataStore.mainTab = props.tab; } } - filterOrganizationOP.value = organizationOptions.value; }); diff --git a/src/modules/07_insignia/components/2_Manage/Tab2.vue b/src/modules/07_insignia/components/2_Manage/Tab2.vue index 6649e6a25..bd6421d14 100644 --- a/src/modules/07_insignia/components/2_Manage/Tab2.vue +++ b/src/modules/07_insignia/components/2_Manage/Tab2.vue @@ -236,7 +236,7 @@ function filterSelector(val: string, update: Function, name: string) { (v: OptionData) => v.name.toLowerCase().indexOf(needle) > -1 ); } else if (name === "filterOrganizationOP") { - filterOrganizationOP.value = organizationOptions.value.filter( + filterOrganizationOP.value = DataStore.optionsTypeOc.filter( (v: OptionData) => v.name.toLowerCase().indexOf(needle) > -1 ); } @@ -259,7 +259,7 @@ function clearInsigniaFilters(name: string) { /*** Hook*/ onMounted(async () => { - organizationOptions.value = await DataStore.optionsTypeOc; + filterOrganizationOP.value = await DataStore.optionsTypeOc; organization.value = await DataStore.typeOc; if (organization.value !== "" || organization.value !== undefined) { if (props.fecthInsigniaByOc) { @@ -272,7 +272,6 @@ onMounted(async () => { DataStore.mainTab = props.tab; } } - filterOrganizationOP.value = organizationOptions.value; });