diff --git a/src/api/15_development/api.development.ts b/src/api/15_development/api.development.ts index 499edda5a..d8a52d8c3 100644 --- a/src/api/15_development/api.development.ts +++ b/src/api/15_development/api.development.ts @@ -29,4 +29,7 @@ export default { developmentReportHistoryOfficer: () => `${developmentReport}/history-employee`, developmentReportScholarship: () => `${developmentReport}/scholarship`, + + + }; diff --git a/src/modules/15_development/views/MainPage.vue b/src/modules/15_development/views/MainPage.vue index a093ac698..9f36cc244 100644 --- a/src/modules/15_development/views/MainPage.vue +++ b/src/modules/15_development/views/MainPage.vue @@ -25,6 +25,10 @@ const $q = useQuasar(); const router = useRouter(); const { showLoader, hideLoader, messageError } = useCounterMixin(); +const ticked = ref([]); +const node = ref([]); +const expanded = ref([]); +const splitterModel = ref(60); const modal = ref(false); const projectName = ref(""); const orgName = ref(""); @@ -186,10 +190,60 @@ function closeDialog() { /** dialog submit */ function onSubmit() { - router.push("/development/add"); + http + .post(config.API.developmentMain,{ + year:year.value, + projectName:projectName.value + }) + .then((res) => { + closeDialog(); + router.push(`/development/${res.data.result}`); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => {}); +} + +function updateTicked(val: any) { + console.log(expanded.value); + + ticked.value = []; + ticked.value.push(val[val.length - 1]); +} + +function fetchActive() { + showLoader(); + http + .get(config.API.activeOrganization) + .then((res) => { + const data = res.data.result; + fetchTree(data.activeId); + }) + .catch((err) => { + messageError($q, err); + hideLoader(); + }); +} + +async function fetchTree(id: string) { + showLoader(); + http + .get(config.API.orgByid(id.toString())) + .then((res) => { + const data = res.data.result; + node.value = data; + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + }); } onMounted(() => { + fetchActive(); fetchListProject(); }); @@ -421,72 +475,106 @@ onMounted(() => { :close="closeDialog" /> - -
-
- - - - + +