diff --git a/src/views/Home/qjgl/QjglCreate.vue b/src/views/Home/qjgl/QjglCreate.vue index f1f71b4..c760312 100644 --- a/src/views/Home/qjgl/QjglCreate.vue +++ b/src/views/Home/qjgl/QjglCreate.vue @@ -301,21 +301,24 @@ const submitForm = async () => { // 年假类型才判断 if (formData.value.type == 1) { - // (判断数据状态为0阻止进行) (判断申请天数大于剩余天数阻止) (判断剩余天数为0时组织) + // (判断数据状态为0阻止进行) if (njData.value.total !== 1 || njList.value?.status === 0){ - message.error("存在另一年假申请记录") + message.error("存在多条年假申请记录") return - } else if (njList.value!.remainingDays < formData.value.day) { - message.error("申请天数大于剩余天数") - return - } else if (njList.value?.remainingDays === 0) { + } + // (判断剩余天数为0时阻止) + if (njList.value?.remainingDays === 0) { message.error("无剩余年假天数") return - }else { - const nData: NjglVO = njList.value; - nData.status = 0 - await NjglApi.updateNjglNac(nData) } + // (判断申请天数大于剩余天数阻止) + if (njList.value!.remainingDays < formData.value.day) { + message.error("申请天数大于剩余天数") + return + } + const nData: NjglVO = njList.value; + nData.status = 0 + await NjglApi.updateNjglNac(nData) } const data = formData.value as unknown as QjglVO