แก้ไขคลิก step ประเมิน

This commit is contained in:
Warunee Tamkoo 2023-12-23 10:38:02 +07:00
parent b984caaa3c
commit 3901310f3d
5 changed files with 97 additions and 32 deletions

View file

@ -2,6 +2,8 @@
import { onMounted, ref, reactive } from "vue";
import { useQuasar } from "quasar";
import { useRouter, useRoute } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
import type {
FormCommand,
@ -32,7 +34,7 @@ const router = useRouter();
const route = useRoute();
const store = useEvaluateDetailStore();
const mixin = useCounterMixin();
const { dialogConfirm } = mixin;
const { dialogConfirm, showLoader, hideLoader, messageError } = mixin;
const $q = useQuasar();
@ -185,7 +187,47 @@ function onClickPopupHistory() {
modalHistory.value = !modalHistory.value;
}
function getStep() {
showLoader();
http
.get(config.API.evaluateGetStep(id.value))
.then((res: any) => {
const data = res.data.result;
let step =
data.step === "CHECK_SPEC"
? 1
: data.step === "PREPARE_DOC_V1"
? 2
: data.step === "CHECK_DOC_V1"
? 3
: data.step === "WAIT_CHECK_DOC_V1"
? 4
: data.step === "ANNOUNCE_WEB"
? 5
: data.step === "PREPARE_DOC_V2"
? 6
: data.step === "CHECK_DOC_V2"
? 7
: data.step === "WAIT_CHECK_DOC_V2"
? 8
: data.step === "DONE"
? 9
: 1;
store.currentStep = step;
store.step = step;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
onMounted(() => {
getStep();
store.step = 1;
});
</script>
@ -194,7 +236,11 @@ onMounted(() => {
<div class="row q-col-gutter-md">
<div class="col-xs-12 col-sm-3">
<div class="toptitle">
{{ props.data && props.data?.type == 'SPECIAL_EXPERT' ? 'ประเมินชำนาญการพิเศษ' : 'ประเมินชำนาญการ' }}
{{
props.data && props.data?.type == "SPECIAL_EXPERT"
? "ประเมินชำนาญการพิเศษ"
: "ประเมินชำนาญการ"
}}
<q-btn
flat
@ -231,7 +277,7 @@ onMounted(() => {
>
<q-card flat bordered class="col-12">
<q-card-section>
<Step1 v-if="store.step === 1" :data="props.data"/>
<Step1 v-if="store.step === 1" :data="props.data" />
<Step2 v-if="store.step === 2" @update:form="updateformCommand" />
<Step3 v-if="store.step === 3" :step="store.step" />
<Step4 v-if="store.step === 4" />
@ -249,7 +295,7 @@ onMounted(() => {
>
<q-card flat bordered class="col-12">
<q-card-section>
<ViewStep1 v-if="store.step === 1" :data="data"/>
<ViewStep1 v-if="store.step === 1" :data="data" />
<ViewStep3 v-if="store.step === 3" />
<ViewStep7 v-if="store.step === 7" /> </q-card-section
></q-card>