เพิ่ม comment ระบบลาออกและขอโอน

This commit is contained in:
AnandaTon 2023-11-13 17:05:29 +07:00
parent 6621dfd7f0
commit 3f5687f0aa
15 changed files with 1529 additions and 1889 deletions

View file

@ -11,18 +11,20 @@ const mixin = useCounterMixin()
const { date2Thai, dateToISO, success, messageError, showLoader, hideLoader, fails } = mixin
const router = useRouter()
const route = useRoute()
const myform = ref<QForm | null>(null)
const $q = useQuasar()
const routeName = router.currentRoute.value.name
/**
* วแปรทใชงาน
*/
const id = ref<string>("")
const fileDocDataUpload = ref<File[]>([])
const files = ref<any>()
const myform = ref<QForm | null>(null)
const tranferOrg = ref("")
const dateCommand = ref<Date>(new Date())
const dateLeave = ref<Date>(new Date())
const noteReason = ref("")
const nameFile = ref<string>("")
/** ข้อมูล v-model ของฟอร์ม */
const dataDetail = ref<any>({
datetext: "",
activeDate: new Date(),
@ -46,10 +48,17 @@ const dataDetail = ref<any>({
fullname: "",
})
/**
* งกนยอนกลบไปยงหนารายการลาออก
*/
const clickBack = () => {
router.push(`/retire`)
}
/**
* งกนเปลยนเป string ของ status
* @param val value ของ status true/false
*/
const statusOrder = (val: boolean) => {
switch (val) {
case true:
@ -59,10 +68,9 @@ const statusOrder = (val: boolean) => {
}
}
const filesNull = () => {
files.value = null
}
/**
* เรยกฟงกนทงหมดตอนเรยกใชไฟล
*/
onMounted(() => {
if (route.params.id !== undefined) {
id.value = route.params.id.toString()
@ -70,6 +78,9 @@ onMounted(() => {
}
})
/**
* นทกขอมลการลาออก
*/
const saveData = async () => {
if (myform.value != null) {
await myform.value.validate().then(async (saveDataTest: Boolean) => {
@ -80,12 +91,25 @@ const saveData = async () => {
}
}
/**
* งกนดาวโหลดอพโหลดไฟล
*/
const filesNull = () => {
files.value = null
}
const nameFile = ref<string>("")
const fileDocDataUpload = ref<File[]>([])
const files = ref<any>()
//
const fileUploadDoc = async (file: any) => {
fileDocDataUpload.value.push(file)
nameFile.value = file[0].name
files.value = file
}
/**
* งกนเซฟขอมลลาออกเเลวเรยกใชงานApi
*/
const saveResing = () => {
$q.dialog({
title: "ยืนยันการยื่นข้อมูลลาออก",
@ -124,6 +148,10 @@ const cancelResing = () => {
.onDismiss(() => {})
}
/**
* งกนลบ
* @param id ไอดของขอมลการลาออก
*/
const deleteResting = async (id: string) => {
showLoader()
await http
@ -167,6 +195,11 @@ const createFormresign = async () => {
messageError($q, e)
})
}
/**
* งกนเรยกขอมลจาก Api
* @param id ไอดของขอม
*/
const fectDataresign = async (id: string) => {
showLoader()
await http