From cb76bf12c1801c3c52b473bb2d870142867cd75d Mon Sep 17 00:00:00 2001 From: oat_dev Date: Fri, 19 Apr 2024 10:58:23 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84=E0=B8=82?= =?UTF-8?q?=E0=B8=95=E0=B8=B1=E0=B8=A7=E0=B8=8A=E0=B8=B5=E0=B9=89=E0=B8=A7?= =?UTF-8?q?=E0=B8=B1=E0=B8=94=E0=B8=95=E0=B8=B2=E0=B8=A1=E0=B9=81=E0=B8=9C?= =?UTF-8?q?=E0=B8=99=20(U)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indicatorByPlan/IndicatorByPlan.vue | 92 ++--- src/modules/14_KPI/views/indicatorByPlan.vue | 386 ++++++++++++------ 2 files changed, 296 insertions(+), 182 deletions(-) diff --git a/src/modules/14_KPI/components/indicatorByPlan/IndicatorByPlan.vue b/src/modules/14_KPI/components/indicatorByPlan/IndicatorByPlan.vue index 544128734..c57279515 100644 --- a/src/modules/14_KPI/components/indicatorByPlan/IndicatorByPlan.vue +++ b/src/modules/14_KPI/components/indicatorByPlan/IndicatorByPlan.vue @@ -101,11 +101,15 @@ function updateSelected(data: any) { planData.strategyChildPlannedId = data.id; planData.strategyChildPlannedNode = data.level; } +function updateSelectedAgency(data: any) { + planData.agencyId = data.orgTreeId; + planData.agencyLevel = data.orgLevel; +} -onMounted(() => { +onMounted(async () => { // fetchData(); - fetchTree(); - fetchOrganizationActive(); + await fetchTree(); + await fetchOrganizationActive(); setTimeout(async () => { store.activeId && (await fetchDataTree(store.activeId)); }, 200); @@ -116,38 +120,6 @@ onMounted(() => {
-
- -
-
- -
{
-
+
+ +
+
{
@@ -274,11 +266,11 @@ onMounted(() => {
@@ -291,11 +283,11 @@ onMounted(() => {
@@ -308,11 +300,11 @@ onMounted(() => {
@@ -325,11 +317,11 @@ onMounted(() => { @@ -367,7 +359,7 @@ onMounted(() => {
- หน่วยงาน + หน่วยงาน/ส่วนราชการ
@@ -384,11 +376,12 @@ onMounted(() => {
{ ([]); @@ -42,6 +44,10 @@ const columns = ref([ style: "font-size: 14px", }, ]); +const node = ref([]); +const expanded = ref([]); +const filter = ref(""); +const filterMain = ref(""); const visibleColumns = ref([ "indicatorNo", "indicatorPass", @@ -66,6 +72,11 @@ const formFilter = reactive({ keyword: "", }); +const nodeData = reactive({ + node: null, + nodeId: null, +}); + function fetchList() { showLoader(); const data = [ @@ -101,8 +112,49 @@ function onClickDelete(id: number) { }); } +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(); + }); +} + +function updateSelectedTreeMain(data: any) { + if (nodeData.node === data.orgLevel && nodeData.nodeId === data.orgTreeId) { + nodeData.node = null; + nodeData.nodeId = null; + } else { + nodeData.node = data.orgLevel; + nodeData.nodeId = data.orgTreeId; + } +} + onMounted(() => { fetchList(); + fetchActive(); }); @@ -111,139 +163,207 @@ onMounted(() => { รายการตัวชี้วัดตามแผนฯ - -
-
- -
-
- -
-
- - - เพิ่ม - - - - -
-
- - - -
-
- -
-
-
- -
- - - - +
+
+ +
+ + +
+
+
+
+ +
+
+ + เพิ่ม + +
+
+ + + +
+
+ +
+
+
+ + + + +
+
- +