เพิ่ม comment ระบบลาออกและขอโอน
This commit is contained in:
parent
6621dfd7f0
commit
3f5687f0aa
15 changed files with 1529 additions and 1889 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue