diff --git a/src/components/Sidebar.vue b/src/components/Sidebar.vue index 84512dcbd0fbd3a160a10265ba0402a6580f398f..e9e79cf09186754c90010c21b578c31de92048a6 100644 --- a/src/components/Sidebar.vue +++ b/src/components/Sidebar.vue @@ -62,7 +62,7 @@ <div class="fw-bolder">Daily Report</div> </router-link> </li> - <li class="menu-item" :class="{ active: $route.path === '/ajuan/overtime' }"> + <li v-if="isAuthorized('pengajuanLembur')" class="menu-item" :class="{ active: $route.path === '/ajuan/overtime' }"> <router-link to="/ajuan/overtime" class="menu-link"> <i class="menu-icon tf-icons bx bxs-hourglass"></i> <div>Lembur</div> @@ -153,12 +153,13 @@ export default defineComponent({ dataProject: ['HRD', 'CTO'], dataKaryawan: ['HRD', 'CTO'], dataKeyResult: ['HRD'], + pengajuanLembur: ['HRD', 'UIUX', 'Frontend', 'PM'], presensi: ['UIUX', 'HRD', 'PM','Frontend'], dailyReport: ['UIUX', 'HRD', 'Frontend'], readpresensi: ['HRD', 'PM', 'CTO'], readdailyReport: ['HRD', 'PM', 'CTO'], - lembur: ['HRD', 'CTO','Frontend'], - cuti: ['HRD', 'CTO', 'Frontend'], + lembur: ['HRD', 'CTO','PM'], + cuti: ['HRD', 'CTO', 'PM'], kelolaAbsensi: ['HRD', 'CTO', 'PM'], okr: ['HRD', 'PM', 'CTO'], meeting: ['HRD', 'PM'], diff --git a/src/pages/kelola/overtime.vue b/src/pages/kelola/overtime.vue index 9b6b345fa8fcb57736b7cca92c62115b8e757e6b..3335f0aac005cf6da0b0f2e561e9c199688cf756 100644 --- a/src/pages/kelola/overtime.vue +++ b/src/pages/kelola/overtime.vue @@ -11,6 +11,7 @@ import Pagination from '@/components/pagination/Pagination2.vue'; import { useApiOvertimeStrore } from '@/stores/api/ajuan/overtime'; import { useApiEmployeeStore } from '@/stores/api/master/karyawan'; import { storeToRefs } from 'pinia'; +import { useAuthStore } from '@/stores/api/authStore'; const searchMonthYear = ref(''); const searchQuery = ref(''); @@ -24,6 +25,7 @@ const apiOvertimeStore = useApiOvertimeStrore(); const { listOvertime, totalData } = storeToRefs(apiOvertimeStore); const apiEmployeeStore = useApiEmployeeStore(); const { listEmployee } = storeToRefs(apiEmployeeStore); +const auth = useAuthStore(); const getData = async () => { await apiOvertimeStore.getOvertime({ ...paramsOvertime.value, q: searchQuery.value, date: searchMonthYear.value }); @@ -359,7 +361,7 @@ const fetchAttachment = async () => { </div> </div> <div class="modal-footer justify-content-between"> - <div> + <div v-if="auth.employee?.jabatan !== 'PM'&& auth.employee?.jabatan !== 'CTO'"> <button v-if="viewItem.status === 'pending'" type="button" diff --git a/src/pages/kelola/time-off.vue b/src/pages/kelola/time-off.vue index dd128dabf9771b4a1d3ee527b17a7271619ff447..bc8915386cc40ddb628c658518af8c4ebdccd16e 100644 --- a/src/pages/kelola/time-off.vue +++ b/src/pages/kelola/time-off.vue @@ -11,6 +11,7 @@ import Pagination from '@/components/pagination/Pagination2.vue'; import { useApiTimeOffStore } from '@/stores/api/ajuan/time-off'; import { useApiEmployeeStore } from '@/stores/api/master/karyawan'; import { storeToRefs } from 'pinia'; +import { useAuthStore } from '@/stores/api/authStore'; interface TimeOff { id_employee: string; @@ -36,6 +37,7 @@ const apiTimeOffStore = useApiTimeOffStore(); const { listTimeOff, totalData } = storeToRefs(apiTimeOffStore); const apiEmployeeStore = useApiEmployeeStore(); const { listEmployee } = storeToRefs(apiEmployeeStore); +const auth = useAuthStore(); const getData = async () => { await apiTimeOffStore.getTimeOff({ ...paramsTimeOff.value, q: searchQuery.value, date: searchMonthYear.value }); @@ -361,7 +363,7 @@ const fetchAttachment = async () => { </div> </div> <div class="modal-footer justify-content-between"> - <div> + <div v-if="auth.employee?.jabatan !== 'PM' && auth.employee?.jabatan !== 'CTO'"> <button v-if="viewItem.status === 'pending'" type="button" diff --git a/src/pages/report/okr.vue b/src/pages/report/okr.vue index e6caba2b05424c5002da778aaeda82b47e766e6d..89f37dc5a547c9ae8391f9ff8cb6831eab88f5c2 100644 --- a/src/pages/report/okr.vue +++ b/src/pages/report/okr.vue @@ -7,6 +7,7 @@ import { useApiEmployeeStore } from '@/stores/api/master/karyawan'; import { useApiKeyResultStore } from '@/stores/api/master/keyResult'; import { storeToRefs } from 'pinia'; import { formatTanggal, getAvgTarget, getKeyResultName, formatType, getKeyResultTarget, formatDateForInput } from './helper/okr' +import { useAuthStore } from '@/stores/api/authStore'; const searchQuery = ref(''); const searchMonthYear = ref(''); @@ -25,6 +26,7 @@ const apiEmployeeStore = useApiEmployeeStore(); const { selectedEmployee } = storeToRefs(apiEmployeeStore); const apiKeyResultStore = useApiKeyResultStore(); const { listKeyResult, selectKeyResult } = storeToRefs(apiKeyResultStore); +const auth = useAuthStore(); const getData = async () => { await apiAssessmentStore.getAssessment({ ...paramsAssessment.value, q: searchQuery.value, date: searchMonthYear.value}); @@ -218,7 +220,7 @@ const deleteData = async () => { <input type="month" class="form-control" v-model="searchMonthYear" placeholder="Pilih Bulan dan Tahun" @input="getData"/> </div> </div> - <div class="col-md-6 d-flex justify-content-end align-items-center"> + <div v-if="auth.employee?.jabatan !== 'CTO'" class="col-md-6 d-flex justify-content-end align-items-center"> <button class="btn btn-primary" type="button" @@ -271,6 +273,7 @@ const deleteData = async () => { ><i class="bx bx-show-alt me-1"></i> View</span > <span + v-if="auth.employee?.jabatan !== 'CTO'" class="badge bg-label-warning me-1" role="button" @click="openModal('edit', index)" @@ -279,6 +282,7 @@ const deleteData = async () => { ><i class="bx bx-edit-alt me-1"></i> Edit </span> <span + v-if="auth.employee?.jabatan !== 'CTO'" class="badge bg-label-danger me-1" role="button" data-bs-toggle="modal"