Refactoring code module 06_retirement
This commit is contained in:
parent
1225254062
commit
ea921b39b0
29 changed files with 730 additions and 823 deletions
|
|
@ -9,6 +9,8 @@ import config from "@/app.config";
|
|||
import genReport from "@/plugins/genreport";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import type { RetirementList } from "@/modules/06_retirement/interface/index/Main";
|
||||
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import DialogPopupReason from "@/components/Dialogs/PopupReason.vue";
|
||||
import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
|
||||
|
|
@ -55,7 +57,7 @@ const dataProfile = ref<Object>([]);
|
|||
|
||||
/** คอลัมน์ที่แสดง */
|
||||
const columns = ref<any["columns"]>([]);
|
||||
const rows = ref<any[]>([]);
|
||||
const rows = ref<RetirementList[]>([]);
|
||||
const visibleColumns = ref<string[]>([
|
||||
"order",
|
||||
"name",
|
||||
|
|
@ -71,13 +73,13 @@ const visibleColumns = ref<string[]>([
|
|||
/**
|
||||
* ฟังก์ชั่นปิด Dialog
|
||||
*/
|
||||
const closeDialog = () => {
|
||||
function closeDialog() {
|
||||
modalNote.value = false;
|
||||
modalUpload.value = false;
|
||||
};
|
||||
}
|
||||
|
||||
// fecthlist
|
||||
const fecthlistprofile = async (id: string) => {
|
||||
async function fecthlistprofile(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.listRetire(id))
|
||||
|
|
@ -191,10 +193,10 @@ const fecthlistprofile = async (id: string) => {
|
|||
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
// เช็คสถานะการอัพโหลด
|
||||
const fecthCheck = async (id: string) => {
|
||||
async function fecthCheck(id: string) {
|
||||
await http
|
||||
.get(config.API.checkfileupload(id))
|
||||
.then((res) => {
|
||||
|
|
@ -203,10 +205,10 @@ const fecthCheck = async (id: string) => {
|
|||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
// DelProfile
|
||||
const clickDelete = () => {
|
||||
function clickDelete() {
|
||||
dialogRemove(
|
||||
$q,
|
||||
async () => {
|
||||
|
|
@ -230,10 +232,10 @@ const clickDelete = () => {
|
|||
"ยืนยันการลบข้อมูล",
|
||||
"ต้องการลบข้อมูลนี้ใช่หรือไม่ ?"
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
// แก้ไข้ข้อมูล
|
||||
const saveNote = () => {
|
||||
function saveNote() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
|
|
@ -257,18 +259,18 @@ const saveNote = () => {
|
|||
"ยืนยันการบันทึกข้อมูล",
|
||||
"ต้องการบันทึกข้อมูลนี้ใช่หรือไม่ ?"
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
//อัพเดท ListId
|
||||
const UpdateListId = (retireld: string, pId: string) => {
|
||||
function UpdateListId(retireld: string, pId: string) {
|
||||
profileId.value = pId;
|
||||
fecthlistprofile(retireld);
|
||||
};
|
||||
}
|
||||
|
||||
// กลับหน้าเดิม
|
||||
const backHistory = () => {
|
||||
function backHistory() {
|
||||
window.history.back();
|
||||
};
|
||||
}
|
||||
|
||||
const visibleNote = computed(() => {
|
||||
if (note.value === "" || note.value === undefined) {
|
||||
|
|
@ -279,7 +281,7 @@ const visibleNote = computed(() => {
|
|||
// อัปโหลดไฟล์
|
||||
const modalUpload = ref<boolean>(false);
|
||||
const signDate = ref<Date | null>(null);
|
||||
const uploadFile = async (event: any, signDate: any) => {
|
||||
async function uploadFile(event: any, signDate: any) {
|
||||
if (myForm.value !== null) {
|
||||
myForm.value.validate().then((successmyForm) => {
|
||||
if (successmyForm) {
|
||||
|
|
@ -317,7 +319,7 @@ const uploadFile = async (event: any, signDate: any) => {
|
|||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* ดาวห์โหลด ไฟล์
|
||||
|
|
@ -341,7 +343,7 @@ async function downloadAttachment(type: string, id: string) {
|
|||
}
|
||||
|
||||
// ยืนยันการแก้ไขข้อมูล
|
||||
const saveEdiitReport = (reason: string) => {
|
||||
function saveEdiitReport(reason: string) {
|
||||
const formdata = new FormData();
|
||||
formdata.append("Detail", reason);
|
||||
dialogConfirm(
|
||||
|
|
@ -363,12 +365,12 @@ const saveEdiitReport = (reason: string) => {
|
|||
"ยืนยันการแก้ไขข้อมูล",
|
||||
"ต้องการยืนยันการแก้ไขข้อมูลนี้หรือไม่ ?"
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
// เปิด popup เหตุผล
|
||||
const openmodalEditReport = () => {
|
||||
function openmodalEditReport() {
|
||||
modalEdit.value = true;
|
||||
};
|
||||
}
|
||||
|
||||
/** Setting Pagination */
|
||||
const paging = ref<boolean>(true);
|
||||
|
|
@ -378,16 +380,21 @@ const pagination = ref({
|
|||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
});
|
||||
const paginationLabel = (start: number, end: number, total: number) => {
|
||||
function paginationLabel(start: number, end: number, total: number) {
|
||||
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
|
||||
else return start + "-" + end + " ใน " + total;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* ดูข้อมูลในทะเบียนประวัติ
|
||||
* @param id บุคคล
|
||||
*/
|
||||
function onclickViewinfo(id: string) {
|
||||
modalPersonal.value = true;
|
||||
personId.value = id;
|
||||
}
|
||||
|
||||
/** ทะเบียนประวัติ */
|
||||
function updatemodalPersonal(modal: boolean) {
|
||||
modalPersonal.value = modal;
|
||||
}
|
||||
|
|
@ -489,22 +496,6 @@ onMounted(() => {
|
|||
</q-menu>
|
||||
<q-tooltip>ดาวน์โหลดไฟล์</q-tooltip>
|
||||
</q-btn>
|
||||
<!-- <q-file
|
||||
bg-color="white"
|
||||
clearable
|
||||
outlined
|
||||
dense
|
||||
v-model="fileUpload"
|
||||
accept=".pdf"
|
||||
:style="fileUpload === null ? 'width: 150px' : 'width: auto'"
|
||||
label="อัปโหลดไฟล์"
|
||||
v-if="statusUpload !== true"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon color="light-blue" name="attach_file" />
|
||||
<q-tooltip>อัปโหลดไฟล์</q-tooltip>
|
||||
</template>
|
||||
</q-file> -->
|
||||
</div>
|
||||
<q-space />
|
||||
<div class="row">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue