Merge branch 'nice' into develop

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-07-16 14:46:04 +07:00
commit dba2d43484
3 changed files with 21 additions and 80 deletions

View file

@ -216,7 +216,7 @@ onMounted(() => {
]).finally(() => { ]).finally(() => {
setTimeout(() => { setTimeout(() => {
hideLoader(); hideLoader();
}, 2000); }, 2500);
}); });
}); });
</script> </script>

View file

@ -198,8 +198,12 @@ function getData() {
} }
onMounted(() => { onMounted(() => {
getData(); showLoader();
fetchEvaluation(); Promise.all([fetchEvaluation(), getData()]).finally(() => {
setTimeout(() => {
hideLoader();
}, 3000);
});
}); });
</script> </script>

View file

@ -62,7 +62,14 @@ const isReadonly = <boolean>(route.name === "KPIEditEvaluator" ? true : false);
const store = useKpiDataStore(); const store = useKpiDataStore();
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, dialogConfirm, success ,findOrgName} = mixin; const {
showLoader,
hideLoader,
messageError,
dialogConfirm,
success,
findOrgName,
} = mixin;
const evaluatorIdOp = ref<DataOption[]>([]); const evaluatorIdOp = ref<DataOption[]>([]);
const commanderIdOp = ref<DataOption[]>([]); const commanderIdOp = ref<DataOption[]>([]);
@ -95,25 +102,15 @@ async function fetchEvaluation() {
.then(async (res) => { .then(async (res) => {
const data = res.data.result; const data = res.data.result;
store.dataEvaluation = await data; store.dataEvaluation = await data;
// store.dataProfile = await data;
formProfile.status = store.convertStatus(data.evaluationStatus); formProfile.status = store.convertStatus(data.evaluationStatus);
formProfile.result = store.convertResults(data.evaluationResults); formProfile.result = store.convertResults(data.evaluationResults);
store.checkCompetency(); store.checkCompetency();
store.checkCompetencyDefaultCompetencyLevel(); store.checkCompetencyDefaultCompetencyLevel();
fetchProfile(data.profileId); fetchProfile(data.profileId);
// plannedPoint.value = data.plannedPoint == null ? "" : data.plannedPoint;
// rolePoint.value = data.rolePoint == null ? "" : data.rolePoint;
// specialPoint.value = data.specialPoint == null ? "" : data.specialPoint;
// capacityPoint.value =
// data.capacityPoint == null ? "" : data.capacityPoint;
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
})
.finally(() => {
hideLoader();
}); });
} }
@ -173,7 +170,7 @@ function onSubmit() {
} }
async function getOrgOp() { async function getOrgOp() {
http http
.get(config.API.Kpiorg+`/${store.dataProfile.profileId}`) .get(config.API.Kpiorg + `/${store.dataProfile.profileId}`)
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
evaluatorIdMainOp.value = data.caregiver.map((i: any) => ({ evaluatorIdMainOp.value = data.caregiver.map((i: any) => ({
@ -242,50 +239,19 @@ function filterOption(val: any, update: Function, refData: string) {
} }
} }
// function onSubmitScore() {
// showLoader();
// http
// .put(config.API.kpiScoreTotal() + `/${id.value}`, {
// plannedPoint: plannedPoint.value,
// rolePoint: rolePoint.value,
// specialPoint: specialPoint.value,
// capacityPoint: capacityPoint.value,
// })
// .then(async (res) => {
// await fetchEvaluation();
// success($q, "");
// modalScore.value = false;
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(() => {
// hideLoader();
// });
// }
// async function clearScore() {
// modalScore.value = false;
// plannedPoint.value = "";
// rolePoint.value = "";
// specialPoint.value = "";
// capacityPoint.value = "";
// getAll();
// }
async function getProfile() { async function getProfile() {
await http await http
.get(config.API.profilePosition + `/${store.dataEvaluation.profileId}`) .get(config.API.profilePosition + `/${store.dataEvaluation.profileId}`)
.then(async (res) => { .then(async (res) => {
const data = await res.data.result; const data = await res.data.result;
store.dataProfile = await data; store.dataProfile = await data;
await store.checkStep(); await setTimeout(() => {
store.checkStep();
}, 800);
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
}); });
// .finally(() => {
// hideLoader();
// });
} }
async function getAll() { async function getAll() {
await fetchEvaluation(); await fetchEvaluation();
@ -345,31 +311,7 @@ function sendToEvaluateEvaluatore() {
"ต้องการยืนยันส่งให้ผู้ประเมินรายงานผลสำเร็จของงานใช่หรือไม่?" "ต้องการยืนยันส่งให้ผู้ประเมินรายงานผลสำเร็จของงานใช่หรือไม่?"
); );
} }
// function sendToSummary(status: string) {
// dialogConfirm(
// $q,
// () => {
// if (id.value) {
// showLoader();
// http
// .get(config.API.kpiSendToSummary(id.value))
// .then((res) => {
// success($q, "");
// getAll();
// store.tabMain = "4";
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(() => {
// hideLoader();
// });
// }
// },
// "",
// "?"
// );
// }
function requireEdit() { function requireEdit() {
dialogConfirm( dialogConfirm(
$q, $q,
@ -494,7 +436,6 @@ async function fetchProfileEvaluator(id: string) {
} }
onMounted(async () => { onMounted(async () => {
store.isUpdate = await false; store.isUpdate = await false;
await getAll(); await getAll();
}); });
@ -526,9 +467,6 @@ onMounted(async () => {
<q-img src="@/assets/avatar_user.jpg" v-else /> <q-img src="@/assets/avatar_user.jpg" v-else />
</q-avatar> </q-avatar>
</div> </div>
<!-- <div class="row text-center">
</div> -->
<div <div
v-if="$q.screen.gt.xs" v-if="$q.screen.gt.xs"
@ -696,7 +634,7 @@ onMounted(async () => {
color="grey-2" color="grey-2"
text-color="edit" text-color="edit"
size="md" size="md"
@click="modalEdit = true,getOrgOp()" @click="(modalEdit = true), getOrgOp()"
> >
<q-tooltip>{{ <q-tooltip>{{
store.dataEvaluation.evaluationStatus === "NEW" && store.dataEvaluation.evaluationStatus === "NEW" &&
@ -1232,7 +1170,6 @@ onMounted(async () => {
</q-dialog> --> </q-dialog> -->
<DialogGovernment v-model:modal="modalGovernment" /> <DialogGovernment v-model:modal="modalGovernment" />
<!-- <DialogStatus <!-- <DialogStatus
v-model:modal="modalStatus" v-model:modal="modalStatus"
v-model:is-probation="store.dataProfile.isProbation" v-model:is-probation="store.dataProfile.isProbation"