-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add year selection to reports and contracts, update API calls t…
…o filter by year
- Loading branch information
Showing
10 changed files
with
175 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,48 @@ | ||
<template> | ||
<el-tabs type="border-card"> | ||
<el-tab-pane lazy label="Satu Mitra Banyak Kegiatan" | ||
><FormContractByPartner /> | ||
</el-tab-pane> | ||
<el-tab-pane lazy label="Satu Kegiatan Banyak Mitra" | ||
><FormContractByActivity | ||
/></el-tab-pane> | ||
</el-tabs> | ||
<div> | ||
<div style="display: flex; justify-content: space-between"> | ||
<div style="display: flex; align-items: center; gap:20px"> | ||
<span>Tahun</span> | ||
<el-select v-model="yearSelected" placeholder="Select" clearable style="width: 240px" | ||
@change="handleYearChange"> | ||
<el-option v-for="item in years" :key="item.value" :label="item.text" :value="item.value" /> | ||
</el-select> | ||
</div> | ||
|
||
|
||
</div> | ||
<el-divider /> | ||
|
||
<el-tabs type="border-card"> | ||
<el-tab-pane lazy label="Satu Mitra Banyak Kegiatan"> | ||
<FormContractByPartner /> | ||
</el-tab-pane> | ||
<el-tab-pane lazy label="Satu Kegiatan Banyak Mitra"> | ||
<FormContractByActivity /> | ||
</el-tab-pane> | ||
</el-tabs> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { ref } from "vue"; | ||
import FormContractByPartner from "@/components/contract/FormContractByPartner.vue"; | ||
import FormContractByActivity from "@/components/contract/FormContractByActivity.vue"; | ||
import { useRoute, useRouter } from "vue-router"; | ||
import { generateYear } from "@/utils/date"; | ||
const route = useRoute(); | ||
const router = useRouter(); | ||
const years = generateYear(); | ||
const yearSelected = ref(route.query.year); | ||
const handleYearChange = (value: string) => { | ||
const query: any = {}; | ||
if (value) { | ||
query.year = value; | ||
} | ||
router.push({ name: "createContract", query }); | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,47 @@ | ||
<template> | ||
<el-tabs type="border-card"> | ||
<el-tab-pane lazy label="Satu Mitra Banyak Output" | ||
><FormReportByPartner /> | ||
</el-tab-pane> | ||
<el-tab-pane lazy label="Satu Output Banyak Mitra" | ||
><FormReportByActivity | ||
/></el-tab-pane> | ||
</el-tabs> | ||
<div> | ||
<div style="display: flex; justify-content: space-between"> | ||
<div style="display: flex; align-items: center; gap:20px"> | ||
<span>Tahun</span> | ||
<el-select v-model="yearSelected" placeholder="Select" clearable style="width: 240px" | ||
@change="handleYearChange"> | ||
<el-option v-for="item in years" :key="item.value" :label="item.text" :value="item.value" /> | ||
</el-select> | ||
</div> | ||
|
||
|
||
</div> | ||
<el-divider /> | ||
<el-tabs type="border-card"> | ||
<el-tab-pane lazy label="Satu Mitra Banyak Output"> | ||
<FormReportByPartner /> | ||
</el-tab-pane> | ||
<el-tab-pane lazy label="Satu Output Banyak Mitra"> | ||
<FormReportByActivity /> | ||
</el-tab-pane> | ||
</el-tabs> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { ref } from "vue"; | ||
import FormReportByPartner from "@/components/report/FormReportByPartner.vue"; | ||
import FormReportByActivity from "@/components/report/FormReportByActivity.vue"; | ||
import { useRoute, useRouter } from "vue-router"; | ||
import { generateYear } from "@/utils/date"; | ||
const route = useRoute(); | ||
const router = useRouter(); | ||
const years = generateYear(); | ||
const yearSelected = ref(route.query.year); | ||
const handleYearChange = (value: string) => { | ||
const query: any = {}; | ||
if (value) { | ||
query.year = value; | ||
} | ||
router.push({ name: "createReport", query }); | ||
}; | ||
</script> |