keycloakUserId
This commit is contained in:
parent
67a726fcdf
commit
d35045f769
2 changed files with 19 additions and 9 deletions
|
|
@ -51,7 +51,7 @@ const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const paramsId = route.params.id.toString();
|
const paramsId = route.params.id.toString();
|
||||||
const keycloakId = ref<string>("");
|
const keycloakId = ref<string>("");
|
||||||
|
const keycloakUserId = ref<string>('')
|
||||||
const workflowRef = ref<any>(null);
|
const workflowRef = ref<any>(null);
|
||||||
const modalApprove = ref(false);
|
const modalApprove = ref(false);
|
||||||
const statusCheck = ref<string>("");
|
const statusCheck = ref<string>("");
|
||||||
|
|
@ -370,6 +370,7 @@ async function fetchDetailLeave(paramsId: string) {
|
||||||
formData.leaveRange = data.leaveRange;
|
formData.leaveRange = data.leaveRange;
|
||||||
formData.commanderPosition = data.commanderPosition;
|
formData.commanderPosition = data.commanderPosition;
|
||||||
formData.leaveRangeEnd = data.leaveRangeEnd;
|
formData.leaveRangeEnd = data.leaveRangeEnd;
|
||||||
|
keycloakUserId.value = data.keycloakUserId;
|
||||||
rows.value = {
|
rows.value = {
|
||||||
commanders: data.commanders,
|
commanders: data.commanders,
|
||||||
approvers: data.approvers,
|
approvers: data.approvers,
|
||||||
|
|
@ -595,11 +596,10 @@ function onSend() {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
() => {
|
() => {
|
||||||
showLoader();
|
|
||||||
http
|
http
|
||||||
.get(config.API.sendApprove(paramsId))
|
.get(config.API.sendApprove(paramsId))
|
||||||
.then((res) => {
|
.then(async (res) => {
|
||||||
fetchDetailLeave(paramsId);
|
await fetchDetailLeave(paramsId);
|
||||||
success($q, "ส่งไปอนุมัติสำเร็จ");
|
success($q, "ส่งไปอนุมัติสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
|
|
@ -1217,7 +1217,11 @@ onMounted(async () => {
|
||||||
align="right"
|
align="right"
|
||||||
v-if="statusCheck == 'NEW' && (isOfficer || isStaff)"
|
v-if="statusCheck == 'NEW' && (isOfficer || isStaff)"
|
||||||
>
|
>
|
||||||
<q-btn label="ส่งไปอนุมัติ" color="secondary" @click="onSend"
|
<q-btn
|
||||||
|
label="ส่งไปอนุมัติ"
|
||||||
|
color="secondary"
|
||||||
|
@click="onSend"
|
||||||
|
:disable="rows?.approvers.length == 0 || rows?.commanders.length == 0"
|
||||||
><q-tooltip>ส่งไปอนุมัติ</q-tooltip></q-btn
|
><q-tooltip>ส่งไปอนุมัติ</q-tooltip></q-btn
|
||||||
>
|
>
|
||||||
</q-card-actions>
|
</q-card-actions>
|
||||||
|
|
@ -1237,5 +1241,6 @@ onMounted(async () => {
|
||||||
:profileType="formData.profileType"
|
:profileType="formData.profileType"
|
||||||
:fetchDetailLeave="fetchDetailLeave"
|
:fetchDetailLeave="fetchDetailLeave"
|
||||||
:id-check="idCheck"
|
:id-check="idCheck"
|
||||||
|
:keycloak-user-id="keycloakUserId"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ const modal = defineModel<boolean>("modal", { required: true });
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
type: String,
|
type: String,
|
||||||
profileType: String,
|
profileType: String,
|
||||||
|
keycloakUserId: String,
|
||||||
fetchDetailLeave: Function,
|
fetchDetailLeave: Function,
|
||||||
idCheck: Array,
|
idCheck: Array,
|
||||||
});
|
});
|
||||||
|
|
@ -112,6 +113,7 @@ async function getData() {
|
||||||
page: pagination.value.page,
|
page: pagination.value.page,
|
||||||
keyword: keyword.value,
|
keyword: keyword.value,
|
||||||
isAct: isAct.value,
|
isAct: isAct.value,
|
||||||
|
keycloakUserId: props.keycloakUserId,
|
||||||
})
|
})
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
@ -180,11 +182,14 @@ watch(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
watch(()=>modal.value,()=>{
|
watch(
|
||||||
if(modal.value){
|
() => modal.value,
|
||||||
getSearch()
|
() => {
|
||||||
|
if (modal.value) {
|
||||||
|
getSearch();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
);
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<q-dialog v-model="modal" persistent>
|
<q-dialog v-model="modal" persistent>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue