diff --git a/src/api/appeal/api.appeal.ts b/src/api/appeal/api.appeal.ts index c0c19b9..0f1348c 100644 --- a/src/api/appeal/api.appeal.ts +++ b/src/api/appeal/api.appeal.ts @@ -1,14 +1,24 @@ -import env from "../index" +import env from "../index"; -const appeal = `${env.API_URI}/discipline/complaint_appeal` -const profile = `${env.API_URI}/profile/keycloak` +const appeal = `${env.API_URI}/discipline/complaint_appeal`; +const profile = `${env.API_URI}/profile/keycloak`; export default { - profileBykeycloak:()=>`${profile}`, - appealMainList:(status: string, type: string, year: number, page: number, pageSize: number, keyword: string)=>`${appeal}/user?status=${status}&type=${type}&year=${year}&page=${page}&pageSize=${pageSize}&keyword=${keyword}`, - appealAdd:()=>`${appeal}`, + profileBykeycloak: () => `${profile}`, + positionBykeycloak: () => `${env.API_URI}/org/profile/keycloak/position`, - appealByID:(id:string)=>`${appeal}/${id}`, + appealMainList: ( + status: string, + type: string, + year: number, + page: number, + pageSize: number, + keyword: string + ) => + `${appeal}/user?status=${status}&type=${type}&year=${year}&page=${page}&pageSize=${pageSize}&keyword=${keyword}`, + appealAdd: () => `${appeal}`, - appealByPrintReport:(id:string)=>`${appeal}/report/${id}` -} + appealByID: (id: string) => `${appeal}/${id}`, + + appealByPrintReport: (id: string) => `${appeal}/report/${id}`, +}; diff --git a/src/modules/07_appealComplain/views/Add.vue b/src/modules/07_appealComplain/views/Add.vue index cd2870d..2389b6a 100644 --- a/src/modules/07_appealComplain/views/Add.vue +++ b/src/modules/07_appealComplain/views/Add.vue @@ -12,7 +12,7 @@ const router = useRouter(); const $q = useQuasar(); const mixin = useCounterMixin(); -const { fails, success, messageError, showLoader, hideLoader } = mixin; +const { findOrgName, success, messageError, showLoader, hideLoader } = mixin; const formProfile = reactive({ profileId: "", @@ -24,13 +24,13 @@ const formProfile = reactive({ function getProFile() { showLoader(); http - .get(config.API.profileBykeycloak()) + .get(config.API.positionBykeycloak()) .then((res) => { const data = res.data.result; - formProfile.profileId = data.id; + formProfile.profileId = data.profileId; formProfile.fullname = `${data.prefix}${data.firstName} ${data.lastName}`; formProfile.citizenId = data.citizenId; - formProfile.oc = data.oc; + formProfile.oc = findOrgName(data); formProfile.position = data.position; }) .catch((e) => { @@ -53,9 +53,9 @@ function onSubmit(data: any) { formData.append("title", data.title); formData.append("description", data.description); formData.append("type", data.type); - formData.append("year", ''); - formData.append("caseType", ''); - formData.append("caseNumber", ''); + formData.append("year", ""); + formData.append("caseType", ""); + formData.append("caseNumber", ""); formData.append("file", data.files); formData.append("oc", data.oc); formData.append("position", data.position); diff --git a/src/modules/08_KPI/components/Evaluator/02_TabOther.vue b/src/modules/08_KPI/components/Evaluator/02_TabOther.vue index b081981..4c89395 100644 --- a/src/modules/08_KPI/components/Evaluator/02_TabOther.vue +++ b/src/modules/08_KPI/components/Evaluator/02_TabOther.vue @@ -119,7 +119,11 @@ function onClickApprove(type: string = "") { :visible-columns="visibleColumns" v-model:pagination="pagination" @update:pagination="props.updatePagination" - selection="multiple" + :selection=" + store.tabMainevaluator === '5' || store.tabMainevaluator === '6' + ? 'none' + : 'multiple' + " v-model:selected="store.selected" > diff --git a/src/modules/08_KPI/components/Tab/04_Result.vue b/src/modules/08_KPI/components/Tab/04_Result.vue new file mode 100644 index 0000000..b719c25 --- /dev/null +++ b/src/modules/08_KPI/components/Tab/04_Result.vue @@ -0,0 +1,3 @@ + diff --git a/src/modules/08_KPI/components/Tab/Dialog/DialogStatus.vue b/src/modules/08_KPI/components/Tab/Dialog/DialogStatus.vue index a425cb4..49037a3 100644 --- a/src/modules/08_KPI/components/Tab/Dialog/DialogStatus.vue +++ b/src/modules/08_KPI/components/Tab/Dialog/DialogStatus.vue @@ -13,7 +13,7 @@ const store = useKpiDataStore(); const route = useRoute(); const router = useRouter(); -const id = ref(route.params.id as string) +const id = ref(route.params.id as string); const work = ref(false); const $q = useQuasar(); const mixin = useCounterMixin(); @@ -29,35 +29,37 @@ const { } = mixin; const modal = defineModel("modal", { required: true }); +const isProbation = defineModel("isProbation", { required: true }); function close() { modal.value = false; } -function getData() { - showLoader(); - http - .get(config.API.orgPosition+`/${store.dataProfile.profileId}`) - .then((res) => { - const data = res.data.result.isProbation; - work.value = data; - }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - hideLoader(); - }); -} -watch( - () => modal.value, - (n) => { - if (n == true) { - getData(); - } - } -); +// function getData() { +// showLoader(); +// http +// .get(config.API.orgPosition+`/${store.dataProfile.profileId}`) +// .then((res) => { +// const data = res.data.result.isProbation; +// work.value = data; +// }) +// .catch((e) => { +// messageError($q, e); +// }) +// .finally(() => { +// hideLoader(); +// }); +// } +// watch( +// () => modal.value, +// (n) => { +// if (n == true) { +// getData(); +// } +// } +// ); + @@ -81,7 +86,7 @@ const splitterModel = ref(12); - + diff --git a/src/modules/08_KPI/components/Tab/Topic/01_Indicator.vue b/src/modules/08_KPI/components/Tab/Topic/01_Indicator.vue index c399fef..ff6ad24 100644 --- a/src/modules/08_KPI/components/Tab/Topic/01_Indicator.vue +++ b/src/modules/08_KPI/components/Tab/Topic/01_Indicator.vue @@ -47,7 +47,7 @@ const visibleColumns = ref( "achievement", "evaluationResults", ] - : ["includingName", "target", "weight"] + : ["includingName", "target", "point", "weight"] ); const columns = ref([ { diff --git a/src/modules/08_KPI/components/Tab/Topic/02_Competency.vue b/src/modules/08_KPI/components/Tab/Topic/02_Competency.vue index 769fc80..419dff0 100644 --- a/src/modules/08_KPI/components/Tab/Topic/02_Competency.vue +++ b/src/modules/08_KPI/components/Tab/Topic/02_Competency.vue @@ -108,7 +108,7 @@ const columns = ref([ const visibleColumns = ref( store.tabOpen === 3 && store.tabMain === "3" ? ["name", "level", "point", "weight", "summary"] - : ["name", "level", "weight"] + : ["name", "level", "point", "weight"] ); const typeCompetency = ref(""); diff --git a/src/modules/08_KPI/store.ts b/src/modules/08_KPI/store.ts index 01fc798..f599450 100644 --- a/src/modules/08_KPI/store.ts +++ b/src/modules/08_KPI/store.ts @@ -130,31 +130,37 @@ export const useKpiDataStore = defineStore("KPIDate", () => { } async function checkCompetency() { - const position = await dataEvaluation.value.position; - const executiveName = await dataEvaluation.value.posExecutiveName; + // const position = await dataEvaluation.value.position; + // const executiveName = await dataEvaluation.value.posExecutiveName; + const posTypeName = dataEvaluation.value.posTypeName; + const posLevelName = dataEvaluation.value.posLevelName; - if ( - position == "ผู้ตรวจราชการกรุงเทพมหานคร" || - position == "ผู้ตรวจราชการ" - ) { + // if ( + // position == "ผู้ตรวจราชการกรุงเทพมหานคร" || + // position == "ผู้ตรวจราชการ" + // ) { + // competencyType.value = competencyType.value.filter( + // (x: DataOptions) => x.id == "HEAD" || x.id == "INSPECTOR" + // ); + // } else if (position == "ผู้อำนวยการเขต") { + // competencyType.value = competencyType.value.filter( + // (x: DataOptions) => x.id == "HEAD" || x.id == "DIRECTOR" + // ); + // } else { + if (posTypeName == "อำนวยการ" || posTypeName == "บริหาร") { competencyType.value = competencyType.value.filter( - (x: DataOptions) => x.id == "HEAD" || x.id == "INSPECTOR" - ); - } else if (position == "ผู้อำนวยการเขต") { - competencyType.value = competencyType.value.filter( - (x: DataOptions) => x.id == "HEAD" || x.id == "DIRECTOR" + (x: DataOptions) => + x.id == "HEAD" || + x.id == "EXECUTIVE" || + x.id == "INSPECTOR" || + x.id == "DIRECTOR" ); } else { - if (executiveName == null) { - competencyType.value = competencyType.value.filter( - (x: DataOptions) => x.id == "HEAD" || x.id == "GROUP" - ); - } else { - competencyType.value = competencyType.value.filter( - (x: DataOptions) => x.id == "HEAD" || x.id == "EXECUTIVE" - ); - } + competencyType.value = competencyType.value.filter( + (x: DataOptions) => x.id == "HEAD" || x.id == "GROUP" + ); } + // } } const defaultCompetencyCoreLevel = ref(); @@ -231,18 +237,18 @@ export const useKpiDataStore = defineStore("KPIDate", () => { const rolePerson = ref("USER"); //"USER" | "EVALUATOR" | "COMMANDER", "COMMANDERHIGH" const tabOpen = ref(1); async function checkStep() { - const role = - - dataEvaluation.value.profileId == await dataProfile.value.profileId - ? "USER" - : dataEvaluation.value.evaluatorId == await dataProfile.value.profileId - ? "EVALUATOR" - : dataEvaluation.value.commanderId == await dataProfile.value.profileId - ? "COMMANDER" - : dataEvaluation.value.commanderHighId == await dataProfile.value.profileId - ? "COMMANDERHIGH" - : ""; - console.log("🚀 ~ checkStep ~ role:", role) + const role = await (dataEvaluation.value.profileId == + dataProfile.value.profileId + ? "USER" + : dataEvaluation.value.evaluatorId == (await dataProfile.value.profileId) + ? "EVALUATOR" + : dataEvaluation.value.commanderId == (await dataProfile.value.profileId) + ? "COMMANDER" + : dataEvaluation.value.commanderHighId == + (await dataProfile.value.profileId) + ? "COMMANDERHIGH" + : ""); + // console.log("🚀 ~ checkStep ~ role:", role); rolePerson.value = role; switch (dataEvaluation.value.evaluationStatus) { diff --git a/src/modules/08_KPI/views/form.vue b/src/modules/08_KPI/views/form.vue index 5622889..5e09e74 100644 --- a/src/modules/08_KPI/views/form.vue +++ b/src/modules/08_KPI/views/form.vue @@ -63,7 +63,7 @@ async function fetchEvaluation() { .get(config.API.kpiEvaluation + `/${id.value}`) .then(async (res) => { const data = res.data.result; - console.log("🚀 ~ .then ~ data:", data) + // console.log("🚀 ~ .then ~ data:", data); store.dataEvaluation = await data; formProfile.status = store.convertStatus(data.evaluationStatus); @@ -89,10 +89,10 @@ async function fetchEvaluation() { async function getProfile() { await http - .get(config.API.profilePosition()) + .get(config.API.orgPosition + `/${store.dataEvaluation.profileId}`) .then(async (res) => { - const data = res.data.result; - store.dataProfile = await data; + const data = await res.data.result; + store.dataProfile = data; }) .catch((e) => { messageError($q, e); @@ -252,8 +252,8 @@ function filterOption(val: any, update: Function, refData: string) { // } async function getAll() { - await getProfile(); await fetchEvaluation(); + await getProfile(); await getOrgOp(); await store.checkStep(); } @@ -335,7 +335,7 @@ function sendToCommander() { messageError($q, e); }) .finally(() => { - hideLoader() + hideLoader(); }); }); } @@ -418,7 +418,8 @@ onMounted(async () => { store.indicatorWeightTotal != 100) || (store.dataEvaluation.posExecutiveName != null && (store.indicatorWeight1Total != 100 || - store.indicatorWeight2Total != 20)) && store.dataEvaluation.evaluationStatus == 'NEW' + store.indicatorWeight2Total != 20) && + store.dataEvaluation.evaluationStatus == 'NEW') " class="text-red" >*น้ำหนัก(ร้อยละ) ผลสัมฤทธิ์ของงานไม่ถูกต้อง { { --> - +