ปรับ KPI ส่วนของระบบบริการเจ้าของข้อมูล

This commit is contained in:
STW_TTTY\stwtt 2024-06-13 10:34:06 +07:00
parent 6147e3eee0
commit 87952fd5b9
6 changed files with 478 additions and 19 deletions

View file

@ -12,7 +12,11 @@ import { useKpiDataStore } from "@/modules/08_KPI/store";
import DialogHeader from "@/components/DialogHeader.vue";
import type { FormProfile } from "@/modules/08_KPI/interface/request/index";
import type { DataOptions } from "@/modules/08_KPI/interface/index/Main";
import DialogGovernment from "@/modules/08_KPI/components/Tab/Dialog/DialogGovernment.vue";
import DialogStatus from "@/modules/08_KPI/components/Tab/Dialog/DialogStatus.vue";
const modalGovernment = ref<boolean>(false);
const modalStatus = ref<boolean>(false);
// const modalScore = ref<boolean>(false);
const modalEdit = ref<boolean>(false);
const route = useRoute();
@ -58,7 +62,8 @@ async function fetchEvaluation() {
await http
.get(config.API.kpiEvaluation + `/${id.value}`)
.then(async (res) => {
const data = await res.data.result;
const data = res.data.result;
console.log("🚀 ~ .then ~ data:", data)
store.dataEvaluation = await data;
formProfile.status = store.convertStatus(data.evaluationStatus);
@ -82,11 +87,11 @@ async function fetchEvaluation() {
// });
}
function getProfile() {
http
async function getProfile() {
await http
.get(config.API.profilePosition())
.then(async (res) => {
const data = await res.data.result;
const data = res.data.result;
store.dataProfile = await data;
})
.catch((e) => {
@ -144,7 +149,7 @@ function onSubmit() {
});
}
function getOrgOp() {
async function getOrgOp() {
http
.get(config.API.Kpiorg)
.then((res) => {
@ -249,10 +254,8 @@ function filterOption(val: any, update: Function, refData: string) {
async function getAll() {
await getProfile();
await fetchEvaluation();
await store.checkStep();
await getOrgOp();
await store.checkStep();
}
function sendToEvaluatore(status: string) {
@ -309,10 +312,37 @@ function requireEdit() {
);
}
function openGovernment() {
modalGovernment.value = true;
}
function openStatus() {
modalStatus.value = true;
}
function sendToCommander() {
dialogConfirm($q, () => {
showLoader();
http
.post(config.API.sendToCommander, {
status: "EVALUATING",
id: [store.dataEvaluation.id],
})
.then(async (res) => {
await getAll();
store.tabMain = "3";
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader()
});
});
}
onMounted(async () => {
showLoader();
await getAll();
console.log(store.dataEvaluation.avartar);
});
</script>
@ -388,7 +418,7 @@ onMounted(async () => {
store.indicatorWeightTotal != 100) ||
(store.dataEvaluation.posExecutiveName != null &&
(store.indicatorWeight1Total != 100 ||
store.indicatorWeight2Total != 20))
store.indicatorWeight2Total != 20)) && store.dataEvaluation.evaluationStatus == 'NEW'
"
class="text-red"
>*ำหน(อยละ) ผลสมฤทธของงานไมกตอง</span
@ -417,11 +447,25 @@ onMounted(async () => {
>
<q-tooltip>งใหประเมนอน</q-tooltip>
</q-btn>
<q-btn
v-if="
store.tabMain == '2' &&
store.dataEvaluation.evaluationStatus == 'APPROVE'
"
unelevated
round
icon="mdi-send"
color="grey-2"
text-color="blue-6"
size="md"
@click="sendToCommander"
>
<q-tooltip>ทำการประเม</q-tooltip>
</q-btn>
<q-btn
v-if="
store.rolePerson == 'USER' &&
store.dataEvaluation.evaluationStatus == 'EVALUATING'
store.dataEvaluation.evaluationStatus == 'EVALUATING' && store.tabMain == '3'
"
unelevated
round
@ -477,6 +521,7 @@ onMounted(async () => {
color="grey-2"
text-color="primary"
size="md"
@click="openGovernment"
>
<q-tooltip>อมลการชวยราชการ</q-tooltip>
</q-btn>
@ -487,6 +532,7 @@ onMounted(async () => {
text-color="blue-5"
icon="mdi-file-eye-outline"
size="md"
@click="openStatus"
>
<q-tooltip>อมลการทดลองงาน</q-tooltip>
</q-btn>
@ -783,6 +829,9 @@ onMounted(async () => {
</q-form>
</q-card>
</q-dialog> -->
<DialogGovernment v-model:modal="modalGovernment" />
<DialogStatus v-model:modal="modalStatus" />
</template>
<style>
.bg-toolbar {