กำหนดเงื่อนไขยกเลิกลาออก

This commit is contained in:
Warunee Tamkoo 2024-07-18 18:29:58 +07:00
parent 97efaf4712
commit f464dedc5f

View file

@ -128,6 +128,7 @@ const cancelResing = () => {
modal.value = true;
};
const checkCancleLeave = ref<boolean>(false);
/**
* งกนเรยกขอมลจาก Api
* @param id ไอดของขอม
@ -141,6 +142,12 @@ const fectDataresign = async (id: string) => {
tranferOrg.value = data.location;
dateCommand.value = data.sendDate;
dateLeave.value = data.activeDate;
const currentDate = new Date();
let dueDateMinusOne = new Date(data.activeDate);
dueDateMinusOne.setDate(dueDateMinusOne.getDate() - 1);
checkCancleLeave.value = currentDate < dueDateMinusOne;
noteReason.value = data.reason;
files.value = data.docs;
dataDetail.value = data;
@ -561,6 +568,7 @@ function downloadFile(data: string) {
</div>
</div>
</div>
<q-separator v-if="routeName !== 'AddRetire'" />
<q-card-actions
align="right"
@ -570,8 +578,8 @@ function downloadFile(data: string) {
<q-btn
v-if="
dataDetail.status !== 'DELETE' &&
dataDetail.status !== 'DONE' &&
dataDetail.status !== 'CANCEL'
dataDetail.status !== 'CANCEL' &&
checkCancleLeave
"
unelevated
class="q-px-md items-center"