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(() => {
setTimeout(() => {
hideLoader();
}, 2000);
}, 2500);
});
});
</script>

View file

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

View file

@ -62,7 +62,14 @@ const isReadonly = <boolean>(route.name === "KPIEditEvaluator" ? true : false);
const store = useKpiDataStore();
const $q = useQuasar();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, dialogConfirm, success ,findOrgName} = mixin;
const {
showLoader,
hideLoader,
messageError,
dialogConfirm,
success,
findOrgName,
} = mixin;
const evaluatorIdOp = ref<DataOption[]>([]);
const commanderIdOp = ref<DataOption[]>([]);
@ -95,25 +102,15 @@ async function fetchEvaluation() {
.then(async (res) => {
const data = res.data.result;
store.dataEvaluation = await data;
// store.dataProfile = await data;
formProfile.status = store.convertStatus(data.evaluationStatus);
formProfile.result = store.convertResults(data.evaluationResults);
store.checkCompetency();
store.checkCompetencyDefaultCompetencyLevel();
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) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
@ -173,7 +170,7 @@ function onSubmit() {
}
async function getOrgOp() {
http
.get(config.API.Kpiorg+`/${store.dataProfile.profileId}`)
.get(config.API.Kpiorg + `/${store.dataProfile.profileId}`)
.then((res) => {
const data = res.data.result;
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() {
await http
.get(config.API.profilePosition + `/${store.dataEvaluation.profileId}`)
.then(async (res) => {
const data = await res.data.result;
store.dataProfile = await data;
await store.checkStep();
await setTimeout(() => {
store.checkStep();
}, 800);
})
.catch((e) => {
messageError($q, e);
});
// .finally(() => {
// hideLoader();
// });
}
async function getAll() {
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() {
dialogConfirm(
$q,
@ -494,7 +436,6 @@ async function fetchProfileEvaluator(id: string) {
}
onMounted(async () => {
store.isUpdate = await false;
await getAll();
});
@ -526,9 +467,6 @@ onMounted(async () => {
<q-img src="@/assets/avatar_user.jpg" v-else />
</q-avatar>
</div>
<!-- <div class="row text-center">
</div> -->
<div
v-if="$q.screen.gt.xs"
@ -696,7 +634,7 @@ onMounted(async () => {
color="grey-2"
text-color="edit"
size="md"
@click="modalEdit = true,getOrgOp()"
@click="(modalEdit = true), getOrgOp()"
>
<q-tooltip>{{
store.dataEvaluation.evaluationStatus === "NEW" &&
@ -1232,7 +1170,6 @@ onMounted(async () => {
</q-dialog> -->
<DialogGovernment v-model:modal="modalGovernment" />
<!-- <DialogStatus
v-model:modal="modalStatus"
v-model:is-probation="store.dataProfile.isProbation"