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

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