From e183754ccf04074ea410a3c0f9de5304483000ba Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 23 Aug 2023 13:55:11 +0700 Subject: [PATCH] =?UTF-8?q?check=20statusjson=20=E0=B8=9B=E0=B8=A3?= =?UTF-8?q?=E0=B8=B0=E0=B8=81=E0=B8=B2=E0=B8=A8=E0=B9=80=E0=B8=81=E0=B8=A9?= =?UTF-8?q?=E0=B8=B5=E0=B8=A2=E0=B8=93=E0=B8=AD=E0=B8=B2=E0=B8=A2=E0=B8=B8?= =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=8A=E0=B8=81=E0=B8=B2=E0=B8=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/06_retirement/api.retirement.ts | 3 + .../components/ListRetirement/TableList.vue | 258 ++++++++++-------- src/modules/06_retirement/views/Main.vue | 25 +- .../07_insignia/components/2_Manage/Tab1.vue | 14 +- src/modules/07_insignia/store.ts | 6 - 5 files changed, 169 insertions(+), 137 deletions(-) diff --git a/src/api/06_retirement/api.retirement.ts b/src/api/06_retirement/api.retirement.ts index 483541ec0..06a549647 100644 --- a/src/api/06_retirement/api.retirement.ts +++ b/src/api/06_retirement/api.retirement.ts @@ -46,4 +46,7 @@ export default { listOut: () => `${retirement}/out`, outByid: (id: string) => `${retirement}/out/${id}`, outReport: `${retirement}/out/report`, + + fileRetirement: (id: string) => `${retirement}/upload/${id}`, + checkfileupload: (id: string) => `${retirement}/upload/check/${id}` }; diff --git a/src/modules/06_retirement/components/ListRetirement/TableList.vue b/src/modules/06_retirement/components/ListRetirement/TableList.vue index 122d388ce..cb95fe3bd 100644 --- a/src/modules/06_retirement/components/ListRetirement/TableList.vue +++ b/src/modules/06_retirement/components/ListRetirement/TableList.vue @@ -20,9 +20,10 @@ const retireld_params = route.params.retirementId; const modalNote = ref(false); const note = ref(""); const retireProfileId = ref(""); -const retireld = ref(); +const retireld = ref(retireld_params.toString()); const profileId = ref(""); const filter = ref(""); +const statusUpload = ref(); const columns = ref([ { @@ -131,20 +132,7 @@ const columns = ref([ style: "font-size: 14px", }, ]); -const rows = ref([ - // { - // fixname: "นางสาว", - // name: "รัชภรณ์ ภัคดี", - // brand: "ฝ่ายบริหารทั่วไป", - // positionType: "บริหาร", - // positionManager: "จัดการทั่วไป", - // positionLavel: "ชำนาญการ", - // positionNumber: "กบห.2", - // govGroup: "ฝ่ายบริหารทั่วไป", - // govOffice: "ฝ่ายบริหารทั่วไป", - // bureau: "บริหาร", - // }, -]); +const rows = ref([]); const visibleColumns = ref([ "order", "fixname", @@ -160,11 +148,14 @@ const visibleColumns = ref([ ]); const action = ref(""); +const fileUpload = ref(null); +const fileInputRef = ref(null); onMounted(() => { retireld.value = retireld_params.toString(); console.log(retireld_params); fecthlistprofile(retireld.value); + fecthCheck(retireld.value); }); const round = ref(); const typeReport = ref(""); @@ -205,6 +196,17 @@ const fecthlistprofile = async (id: string) => { hideLoader(); }); }; +const fecthCheck = async (id: string) => { + await http + .get(config.API.checkfileupload(id)) + .then((res) => { + console.log(res); + statusUpload.value = res.data.result; + }) + .catch((err) => { + console.log(err); + }); +}; // DelProfile const clickDelete = () => { $q.dialog({ @@ -297,38 +299,33 @@ const visibleNote = computed(() => { return true; } }); -// const saveList = () => { -// $q.dialog({ -// title: "ยืนยันการบันทึกข้อมูล", -// message: "ต้องการบันทึกข้อมูลนี้ใช่หรือไม่?", -// cancel: { -// flat: true, -// color: "negative", -// }, -// persistent: true, -// }) -// .onOk(async () => { -// const retireld = "1233444"; -// await http -// .post(config.API.listRetire("123"), { retireld: retireld }) -// .then(() => { -// success($q, "บันทึกข้อมูลสำเร็จ"); -// }) -// .catch((e) => { -// messageError($q, e); -// }) -// .finally(() => { -// fecthlist(); -// }); -// }) -// .onCancel(() => {}) -// .onDismiss(() => {}); -// }; -const classrow = (prop: any) => { - if (profileId.value !== "" && prop.profileId === profileId.value) { - return "color: #26a69a;"; - } else return ""; +const uploadFile = async (event: any) => { + showLoader(); + const selectedFile = event; + console.log(selectedFile); + const formdata = new FormData(); + formdata.append("file", selectedFile); + await http + .put(config.API.fileRetirement(retireld.value.toString()), formdata) + .then((res) => { + success($q, "เพิ่มไฟล์สำเร็จ"); + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + fileUpload.value = null; + fecthlistprofile(retireld.value); + fecthCheck(retireld.value); + hideLoader(); + }); }; + +// const classrow = (prop: any) => { +// if (profileId.value !== "" && prop.profileId === profileId.value) { +// return "color: #26a69a;"; +// } else return ""; +// }; const paging = ref(true); const pagination = ref({ sortBy: "order", @@ -359,80 +356,103 @@ const paginationLabel = (start: number, end: number, total: number) => {
- +
+ - - - - - - - - - ไฟล .PDF - - - - - - ไฟล .xls - - - - ดาวน์โหลดไฟล์ - - - อัพโหลดไฟล์ - - - - - + + + + + + + ไฟล .PDF + + + + + + ไฟล .xls + + + + ดาวน์โหลดไฟล์ + + -