diff --git a/src/modules/05_leave/componenst/Forms/11_WorkInternationalForm.vue b/src/modules/05_leave/componenst/Forms/11_WorkInternationalForm.vue index d7ebd63..d53feff 100644 --- a/src/modules/05_leave/componenst/Forms/11_WorkInternationalForm.vue +++ b/src/modules/05_leave/componenst/Forms/11_WorkInternationalForm.vue @@ -2,11 +2,15 @@ import { ref, reactive, watch } from "vue" import type { FormData, FormRef } from "@/modules/05_leave/interface/request/WorkInternationalForm" import { useCounterMixin } from "@/stores/mixin" +import { useQuasar } from "quasar" +const $q = useQuasar() const mixin = useCounterMixin() -const { date2Thai } = mixin +const { date2Thai, dialogConfirm } = mixin const edit = ref(true) +const filesUpload = ref(null) const halfDay = ref("day") +const isSave = ref(true) const props = defineProps({ data: { type: Object, @@ -71,6 +75,23 @@ function onValidate() { props.onSubmit() } } + +function onSubmit() { + dialogConfirm( + $q, + async () => { + if (isSave.value === false) { + props.onSubmit() + console.log(formData) + isSave.value = true + } else { + console.log("savefile อัปโหลด", filesUpload.value) + } + }, + !isSave.value ? "ยืนยันการบันทึกข้อมูล" : "ยืนยันการอัพโหลดไฟล์", + !isSave.value ? "ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?" : "ต้องการยืนยันการอัพโหลดไฟล์นี้หรือไม่ ?" + ) +}