diff --git a/src/components/FormTime.vue b/src/components/FormTime.vue index c8dd34f..3ff6fd8 100644 --- a/src/components/FormTime.vue +++ b/src/components/FormTime.vue @@ -20,7 +20,6 @@ const { hideLoader, messageError, convertDateToAPI, - convertDatetimeToAPI, } = useCounterMixin() /** @@ -88,6 +87,13 @@ function onCkickSave() { } } } + + // ลงเวลาพิเศษบังคับให้แก้ทั้งเข้าและออก + if (props.action === 'special') { + checkboxIn.value = true + checkboxOut.value = true + } + if (checkboxIn.value === false && checkboxOut.value === false) { checkstatusBox.value = true } @@ -98,7 +104,7 @@ function onCkickSave() { ) { dialogConfirm($q, async () => { const data: FormTimeStemp = { - checkDate: convertDatetimeToAPI(date.value as Date), + checkDate: convertDateToAPI(date.value as Date), checkInEdit: checkboxIn.value, checkOutEdit: checkboxOut.value, description: reason.value, @@ -155,9 +161,7 @@ onMounted(() => { if (dataByIdVal.value == null) { statusAction.value = true } else { - date.value = convertDatetimeToAPI( - new Date(dataByIdVal.value.checkInDateTime) - ) + date.value = convertDateToAPI(new Date(dataByIdVal.value.checkInDateTime)) } })