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 paramsId = route.params.id.toString();
|
||||
const keycloakId = ref<string>("");
|
||||
|
||||
const keycloakUserId = ref<string>('')
|
||||
const workflowRef = ref<any>(null);
|
||||
const modalApprove = ref(false);
|
||||
const statusCheck = ref<string>("");
|
||||
|
|
@ -370,6 +370,7 @@ async function fetchDetailLeave(paramsId: string) {
|
|||
formData.leaveRange = data.leaveRange;
|
||||
formData.commanderPosition = data.commanderPosition;
|
||||
formData.leaveRangeEnd = data.leaveRangeEnd;
|
||||
keycloakUserId.value = data.keycloakUserId;
|
||||
rows.value = {
|
||||
commanders: data.commanders,
|
||||
approvers: data.approvers,
|
||||
|
|
@ -595,11 +596,10 @@ function onSend() {
|
|||
dialogConfirm(
|
||||
$q,
|
||||
() => {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.sendApprove(paramsId))
|
||||
.then((res) => {
|
||||
fetchDetailLeave(paramsId);
|
||||
.then(async (res) => {
|
||||
await fetchDetailLeave(paramsId);
|
||||
success($q, "ส่งไปอนุมัติสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -1217,7 +1217,11 @@ onMounted(async () => {
|
|||
align="right"
|
||||
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-card-actions>
|
||||
|
|
@ -1237,5 +1241,6 @@ onMounted(async () => {
|
|||
:profileType="formData.profileType"
|
||||
:fetchDetailLeave="fetchDetailLeave"
|
||||
:id-check="idCheck"
|
||||
:keycloak-user-id="keycloakUserId"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ const modal = defineModel<boolean>("modal", { required: true });
|
|||
const props = defineProps({
|
||||
type: String,
|
||||
profileType: String,
|
||||
keycloakUserId: String,
|
||||
fetchDetailLeave: Function,
|
||||
idCheck: Array,
|
||||
});
|
||||
|
|
@ -112,6 +113,7 @@ async function getData() {
|
|||
page: pagination.value.page,
|
||||
keyword: keyword.value,
|
||||
isAct: isAct.value,
|
||||
keycloakUserId: props.keycloakUserId,
|
||||
})
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
|
|
@ -180,11 +182,14 @@ watch(
|
|||
}
|
||||
);
|
||||
|
||||
watch(()=>modal.value,()=>{
|
||||
if(modal.value){
|
||||
getSearch()
|
||||
watch(
|
||||
() => modal.value,
|
||||
() => {
|
||||
if (modal.value) {
|
||||
getSearch();
|
||||
}
|
||||
}
|
||||
})
|
||||
);
|
||||
</script>
|
||||
<template>
|
||||
<q-dialog v-model="modal" persistent>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue