KPI สิทธิ์

This commit is contained in:
STW_TTTY\stwtt 2024-08-07 17:26:54 +07:00
parent 0496b01da1
commit 6aa405e688
12 changed files with 126 additions and 44 deletions

View file

@ -10,6 +10,7 @@ import { useRoute } from "vue-router";
const $q = useQuasar();
const route = useRoute();
const checkRoutePermisson = ref<boolean>(route.name == "KPIDetailPage");
const id = ref<string>(route.params.id ? route.params.id.toString() : "");
const {
dialogConfirm,
@ -158,6 +159,7 @@ onMounted(() => {
<div class="row col-12 q-col-gutter-y-sm q-pa-sm">
<div class="col-12 row">
<q-file
:readonly="checkRoutePermisson"
for="inputFiles"
class="col-12"
outlined
@ -213,7 +215,7 @@ onMounted(() => {
>
<q-btn
v-if="!isReadonly"
v-if="!isReadonly &&!checkRoutePermisson"
size="12px"
flat
round

View file

@ -17,6 +17,8 @@ import { useKpiDataStore } from "@/modules/14_KPI/store";
const numLevel = ref<string>("");
const store = useKpiDataStore();
const $q = useQuasar();
const route = useRoute();
const checkRoutePermisson = ref<boolean>(route.name == "KPIDetailPage");
const mixin = useCounterMixin();
const {
dialogConfirm,
@ -254,9 +256,10 @@ watch(
<div class="q-pa-sm">
<q-btn
v-if="
type == 'capacity' ||
type == 'development' ||
(type != 'capacity' &&
(!checkRoutePermisson && type == 'capacity') ||
(!checkRoutePermisson && type == 'development') ||
(!checkRoutePermisson &&
type != 'capacity' &&
type != 'development' &&
store.rolePerson == 'USER')
"
@ -407,6 +410,7 @@ watch(
outlined
dense
:readonly="
checkRoutePermisson ||
formDataView.reasonEvaluator !== null ||
store.rolePerson !== 'EVALUATOR'
"
@ -422,6 +426,7 @@ watch(
<div
v-if="
!checkRoutePermisson &&
formDataView.reasonEvaluator == null &&
store.rolePerson == 'EVALUATOR'
"
@ -463,6 +468,7 @@ watch(
class="inputgreen"
lazy-rules
:readonly="
checkRoutePermisson ||
formDataView.reasonCommander !== null ||
store.rolePerson !== 'COMMANDER'
"
@ -473,6 +479,7 @@ watch(
<div
v-if="
!checkRoutePermisson &&
formDataView.reasonCommander == null &&
store.rolePerson == 'COMMANDER'
"
@ -513,6 +520,7 @@ watch(
class="inputgreen"
lazy-rules
:readonly="
checkRoutePermisson ||
formDataView.reasonCommanderHigh !== null ||
store.rolePerson !== 'COMMANDERHIGH'
"
@ -523,6 +531,7 @@ watch(
<div
v-if="
!checkRoutePermisson &&
formDataView.reasonCommanderHigh == null &&
store.rolePerson == 'COMMANDERHIGH'
"

View file

@ -20,6 +20,7 @@ import { useKpiDataStore } from "@/modules/14_KPI/store";
const $q = useQuasar();
const store = useKpiDataStore();
const route = useRoute();
const checkRoutePermisson = ref<boolean>(route.name == "KPIDetailPage");
const {
date2Thai,
dialogRemove,
@ -245,7 +246,7 @@ const isEditStep3 = computed(() => {
<div class="col">
<span class="text-weight-medium">{{ title }}</span>
<q-btn
v-if="isEditStep1"
v-if="isEditStep1 && !checkRoutePermisson"
class="q-ml-xs"
flat
round
@ -260,7 +261,7 @@ const isEditStep3 = computed(() => {
</div>
<div class="col-auto">
<q-btn
v-if="isEditStep3"
v-if="isEditStep3 && !checkRoutePermisson"
flat
round
icon="mdi-clipboard-check-outline"
@ -303,6 +304,7 @@ const isEditStep3 = computed(() => {
<q-tr :props="props" class="cursor-pointer">
<q-td>
<q-btn
v-if="isEditStep1"
flat
round
icon="mdi-eye"
@ -372,6 +374,7 @@ const isEditStep3 = computed(() => {
<q-tooltip>รายงานความกาวหน</q-tooltip>
</q-btn>
<q-btn
v-if="!checkRoutePermisson"
flat
round
icon="warning"
@ -385,7 +388,7 @@ const isEditStep3 = computed(() => {
</q-btn>
</div>
<div v-if="isEditStep1">
<div v-if="isEditStep1 && !checkRoutePermisson">
<q-btn
flat
round
@ -413,7 +416,7 @@ const isEditStep3 = computed(() => {
</td>
</q-tr>
</template>
<template #item="props">
<!-- <template #item="props">
<div class="q-pa-xs col-xs-12 col-sm-6 col-md-4 col-lg-3">
<q-card bordered flat>
<div class="row justify-end">
@ -425,7 +428,7 @@ const isEditStep3 = computed(() => {
size="14px"
@click="onClickView(props.row.id)"
>
<q-tooltip>คำอธบายผลสำเรจของงาน</q-tooltip>
<q-tooltip>รายละเอยด</q-tooltip>
</q-btn>
</div>
@ -502,7 +505,7 @@ const isEditStep3 = computed(() => {
</q-card-actions>
</q-card>
</div>
</template>
</template> -->
</d-table>
</q-card-section>
</q-card>

View file

@ -39,6 +39,7 @@ const modalEvaluate = ref<boolean>(false);
const store = useKpiDataStore();
const route = useRoute();
const checkRoutePermisson = ref<boolean>(route.name == "KPIDetailPage");
const id = ref<string>(route.params.id as string);
const isReadonly = <boolean>(route.name === "KPIEditEvaluator" ? true : false);
@ -324,7 +325,7 @@ onMounted(() => {
<div class="col">
<span class="text-weight-medium">{{ item.name }}</span>
<q-btn
v-if="isEditStep1 && item.id != 'HEAD' && item.id != 'GROUP'"
v-if="!checkRoutePermisson && isEditStep1 && item.id != 'HEAD' && item.id != 'GROUP'"
class="q-ml-xs"
flat
round
@ -340,7 +341,7 @@ onMounted(() => {
<q-space />
<q-btn
v-if="isEditStep3"
v-if="!checkRoutePermisson && isEditStep3"
flat
round
icon="mdi-clipboard-check-outline"
@ -471,7 +472,7 @@ onMounted(() => {
</q-btn>
</div>
<div v-if="isEditStep1">
<div v-if="isEditStep1 && !checkRoutePermisson">
<q-btn
flat
round
@ -485,7 +486,7 @@ onMounted(() => {
</q-td>
</q-tr>
</template>
<template #item="props">
<!-- <template #item="props">
<div class="q-pa-xs col-xs-12 col-sm-6 col-md-4 col-lg-3">
<q-card bordered flat>
<q-list>
@ -583,7 +584,7 @@ onMounted(() => {
</q-card-actions>
</q-card>
</div>
</template>
</template> -->
</d-table>
</q-card-section>
</q-card>

View file

@ -16,7 +16,7 @@ const store = useKpiDataStore();
const route = useRoute();
const evaluationId = ref<string>(route.params.id.toString());
const modalEvaluate = ref<boolean>(false);
const checkRoutePermisson = ref<boolean>(route.name == "KPIDetailPage");
const rows = ref<any[]>([]);
const modalDevelop = ref<boolean>(false);
const idEditDevelop = ref<string>("");
@ -106,8 +106,8 @@ const columns = ref<QTableProps["columns"]>([
const visibleColumns = ref<string[]>(
store.tabOpen === 3 && store.tabMain === "3"
? ['no',"name", "develop", "target", "achievement", "summary"]
: ['no',"name", "develop", "target"]
? ["no", "name", "develop", "target", "achievement", "summary"]
: ["no", "name", "develop", "target"]
);
function onAdd() {
@ -206,7 +206,7 @@ onMounted(() => {
<div class="col">
<span class="text-weight-medium">การพฒนาตนเอง</span>
<q-btn
v-if="isEditStep1"
v-if="isEditStep1 && !checkRoutePermisson"
class="q-ml-xs"
flat
round
@ -222,7 +222,7 @@ onMounted(() => {
<q-space />
<q-btn
v-if="isEditStep3"
v-if="isEditStep3 && !checkRoutePermisson"
flat
round
icon="mdi-clipboard-check-outline"
@ -320,7 +320,7 @@ onMounted(() => {
</q-td>
<q-td>
<div
v-if="
v-if="
(store.dataEvaluation.evaluationStatus == 'APPROVE' &&
store.tabMain === '2') ||
store.tabMain === '3'
@ -351,7 +351,7 @@ onMounted(() => {
</q-btn> -->
</div>
<div v-if="isEditStep1">
<div v-if="isEditStep1 && !checkRoutePermisson">
<q-btn
flat
round