refactor code ส่วนของเครื่องราชฯ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-09-21 14:21:26 +07:00
parent 33c2b338a2
commit 1ed9faebf2
11 changed files with 326 additions and 149 deletions

View file

@ -93,6 +93,7 @@ const fecthlistRetire = async () => {
messageError($q, e);
});
};
//
const findlist = async (id: string) => {
let data = [{}];
if (type.value === "officer") {
@ -122,7 +123,7 @@ const findlist = async (id: string) => {
});
};
// putlist
//
const clickAdd = (props: any) => {
if (retireld.value == undefined) {
retireld.value = retireld_params;

View file

@ -172,6 +172,7 @@ const fecthlistprofile = async (id: string) => {
statusReport.value = res.data.result.json;
typeReport.value = res.data.result.typeReport;
textReport.value = res.data.result.detail;
//
rows.value = res.data.result.profile.map((e: any) => ({
id: e.id,
profileId: e.profileId,
@ -266,6 +267,7 @@ const UpdateListId = (retireld: string, pId: string) => {
profileId.value = pId;
fecthlistprofile(retireld);
};
//
const backHistory = () => {
window.history.back();
};
@ -274,6 +276,7 @@ const visibleNote = computed(() => {
return true;
}
});
//
const uploadFile = async (event: any) => {
showLoader();
const selectedFile = event;
@ -294,7 +297,7 @@ const uploadFile = async (event: any) => {
hideLoader();
});
};
// downloadAttachment
const downloadAttachment = async (type: string, id: string) => {
showLoader();
await http
@ -311,6 +314,7 @@ const downloadAttachment = async (type: string, id: string) => {
hideLoader();
});
};
// downloadFile
const downloadFile = (response: any, filename: string) => {
const link = document.createElement("a");
var fileName = filename;
@ -320,7 +324,7 @@ const downloadFile = (response: any, filename: string) => {
link.click();
document.body.removeChild(link);
};
//
const saveEdiitReport = (reason: string) => {
const formdata = new FormData();
formdata.append("Detail", reason);
@ -344,9 +348,11 @@ const saveEdiitReport = (reason: string) => {
"ต้องการยืนยันการแก้ไขข้อมูลนี้หรือไม่ ?"
);
};
// popup
const openmodalEditReport = () => {
modalEdit.value = true;
};
// popup
const closemodalEditReport = () => {
modalEdit.value = false;
};
@ -587,7 +593,7 @@ const paginationLabel = (start: number, end: number, total: number) => {
<q-td class="table_ellipsis" key="bureau" :props="props">{{
props.row.bureau
}}</q-td>
<q-td auto-width></q-td>
<q-td
auto-width
v-if="