휴가선물 마이너스일 때 불가능
This commit is contained in:
parent
04391cc9d9
commit
c8662e72bf
@ -13,7 +13,7 @@
|
||||
<button @click="increaseCount" :disabled="grantCount >= availableQuota" class="count-btn">+</button>
|
||||
</div>
|
||||
<div class="custom-button-container">
|
||||
<button class="custom-button" @click="saveVacationGrant" :disabled="grantCount === 0">
|
||||
<button class="custom-button" @click="saveVacationGrant" :disabled="grantCount === 0 || isGiftButtonDisabled">
|
||||
<i class="bx bx-gift"></i>
|
||||
</button>
|
||||
</div>
|
||||
@ -23,14 +23,16 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, defineProps, defineEmits, watch, onMounted } from "vue";
|
||||
import { ref, defineProps, defineEmits, watch, onMounted, computed } from "vue";
|
||||
import axios from "@api";
|
||||
import { useToastStore } from '@s/toastStore';
|
||||
|
||||
import { useUserInfoStore } from "@s/useUserInfoStore";
|
||||
const userStore = useUserInfoStore();
|
||||
const toastStore = useToastStore();
|
||||
const props = defineProps({
|
||||
isOpen: Boolean,
|
||||
targetUser: Object,
|
||||
remainingVacationData: Object,
|
||||
});
|
||||
|
||||
const emit = defineEmits(["close", "updateVacation"]);
|
||||
@ -39,6 +41,14 @@ const maxQuota = 2;
|
||||
const sentCount = ref(0);
|
||||
const availableQuota = ref(2);
|
||||
|
||||
const myUserId = computed(() => userStore.user.id);
|
||||
const myRemainingQuota = computed(() => {
|
||||
return props.remainingVacationData?.[myUserId.value] ?? 0;
|
||||
});
|
||||
const isGiftButtonDisabled = computed(() => {
|
||||
return myRemainingQuota.value <= 0;
|
||||
});
|
||||
console.log(myRemainingQuota.value)
|
||||
// 사원 별 남은 보내기 개수
|
||||
const fetchSentVacationCount = async () => {
|
||||
try {
|
||||
|
||||
@ -32,6 +32,7 @@
|
||||
:isOpen="isGrantModalOpen"
|
||||
:targetUser="selectedUser"
|
||||
:remainingQuota="remainingVacationData[selectedUser?.MEMBERSEQ] || 0"
|
||||
:remainingVacationData="remainingVacationData"
|
||||
@close="isGrantModalOpen = false"
|
||||
@updateVacation="fetchRemainingVacation"
|
||||
/>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user