This commit is contained in:
Warunee Tamkoo 2024-06-18 09:03:04 +07:00
parent a58016fb9d
commit 6d7547d14f
2 changed files with 43 additions and 34 deletions

View file

@ -13,7 +13,7 @@ const store = useKpiDataStore();
const route = useRoute();
const router = useRouter();
const id = ref<string>(route.params.id as string)
const id = ref<string>(route.params.id as string);
const work = ref<boolean>(false);
const $q = useQuasar();
const mixin = useCounterMixin();
@ -29,35 +29,37 @@ const {
} = mixin;
const modal = defineModel<boolean>("modal", { required: true });
const isProbation = defineModel<boolean>("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();
// }
// }
// );
</script>
<template>
<q-dialog persistent v-model="modal">
<q-card bordered style="min-width: 20vw">
@ -66,7 +68,9 @@ watch(
<q-card-section class="q-pa-sm">
<div class="row">
<div class="col-12 text-center bg-grey-1 q-pa-md rounded-borders">
<span class="text-weight-bold text-teal">{{work ? `อยู่ระหว่างทดลองงาน`:'พ้นจากการทดลองงาน'}}</span>
<span class="text-weight-bold text-teal">{{
isProbation ? `อยู่ระหว่างทดลองงาน` : "-"
}}</span>
</div>
</div>
</q-card-section>