From 769db85cb1c72132f5b88db9185ef26d3f68d158 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Wed, 30 Aug 2023 14:39:35 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=20api=20=E0=B9=80=E0=B9=80=E0=B8=81=E0=B9=89=E0=B8=84=E0=B8=B3?= =?UTF-8?q?=20=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1=20=E0=B8=9F?= =?UTF-8?q?=E0=B8=B4=E0=B8=A5=E0=B9=80=E0=B8=95=E0=B8=AD=E0=B8=A3=E0=B9=8C?= =?UTF-8?q?=20status?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/05_placement/api.placement.ts | 1 + src/api/reports/api.report.ts | 8 +- .../components/AppointMent/Main.vue | 4 +- .../components/Transfer/transferRegistry.vue | 84 +++++++++---------- .../components/resign/Resign.vue | 2 +- 5 files changed, 49 insertions(+), 50 deletions(-) diff --git a/src/api/05_placement/api.placement.ts b/src/api/05_placement/api.placement.ts index c8e627c3f..ac0f6788a 100644 --- a/src/api/05_placement/api.placement.ts +++ b/src/api/05_placement/api.placement.ts @@ -157,4 +157,5 @@ export default { orderCPMUpdate: (type: string, id: string) => `${order}/order/${type}/detail/${id}`, + }; diff --git a/src/api/reports/api.report.ts b/src/api/reports/api.report.ts index 7ebb240cd..fbfdffce7 100644 --- a/src/api/reports/api.report.ts +++ b/src/api/reports/api.report.ts @@ -6,6 +6,7 @@ const reportOrder = `${env.API_REPORT2_URI}/report/order`; const reportRetire = `${env.API_REPORT2_URI}/report/retire`; const reportProbation = `${env.API_REPORT2_URI}/report/probation`; const reportResign = `${env.API_REPORT2_URI}/report/resign/33`; +const reportTransfer = `${env.API_REPORT2_URI}/report/transfer`; export default { reportOrderCover: (fileType: string, id: string, commandCode: string) => @@ -30,5 +31,8 @@ export default { reportEvaluate:(type:string, id:string) => `${reportProbation}/16/${type}/${id}`, reportEvaluateChairman:(type:string, id:string) => `${reportProbation}/17/${type}/${id}`, reportEvaluateResult:(type:string, id:string) => `${reportProbation}/18/${type}/${id}`, - reportSurvey:(type:string, id:string) => `${reportProbation}/19/${type}/${id}` -}; + reportSurvey:(type:string, id:string) => `${reportProbation}/19/${type}/${id}`, + + //filetransfer + reportTransferFile:(no:number,type:string,id:string) => `${reportTransfer}/${no}/${type}/${id}` + }; diff --git a/src/modules/05_placement/components/AppointMent/Main.vue b/src/modules/05_placement/components/AppointMent/Main.vue index 13a950fdc..2c136721f 100644 --- a/src/modules/05_placement/components/AppointMent/Main.vue +++ b/src/modules/05_placement/components/AppointMent/Main.vue @@ -89,7 +89,7 @@ const fecthlistappointment = async () => { console.log(res); let response = res.data.result; listRecevice.value = response; - // console.log(response); + console.log(response); rows.value = response.map((e: any) => ({ personalId: e.id, citizenId: e.citizenId, @@ -112,7 +112,7 @@ const fecthlistappointment = async () => { birthday: e.dateOfBirth == null ? "-" : date2Thai(e.dateOfBirth), })); // console.log(rows.value); - rows2.value = rows.value.filter((e: any) => e.orgName !== null); + rows2.value = rows.value.filter((e: any) => e.orgName !== null && e.status !== 'ส่งรายชื่อไปออกคำสั่ง'&& e.status !== 'ออกคำสั่งเสร็จแล้ว'); }) .catch((e) => { console.log(typeof e); diff --git a/src/modules/05_placement/components/Transfer/transferRegistry.vue b/src/modules/05_placement/components/Transfer/transferRegistry.vue index eb459979c..36edb0b3d 100644 --- a/src/modules/05_placement/components/Transfer/transferRegistry.vue +++ b/src/modules/05_placement/components/Transfer/transferRegistry.vue @@ -167,10 +167,10 @@ {{ props.row.fileName }} - + ไฟล์ PDF - + ไฟล์ WORD @@ -423,8 +423,9 @@ const $q = useQuasar(); const route = useRoute(); const router = useRouter(); const mixin = useCounterMixin(); +const id = ref("") +const dataId = (route.params.id as string); -const dataId = route.params.id; const { date2Thai, messageError, @@ -463,41 +464,34 @@ const responseData = ref({ status: "", fullname: "", }); -const filePdf = (id:number,type:string) =>{ - -} -const fileDoc = (id:number,type:string) =>{ - -} -// const downloadFile = (response: any, filename: string) => { -// const link = document.createElement("a"); -// var fileName = filename; -// link.href = window.URL.createObjectURL(new Blob([response.data])); -// link.setAttribute("download", fileName); -// document.body.appendChild(link); -// link.click(); -// document.body.removeChild(link); -// }; - -// const FileDownload = async (type: string) => { -// showLoader(); -// await http -// .get(config.API.reportEvaluateRecord1(type, numTab.id), { -// responseType: "blob", -// }) -// .then(async (res) => { -// downloadFile( -// res, -// `แบบบันทึกผล(ผู้ดูเเล)_${fullname.value}_ครั้งที่.${type}` -// ); -// }) -// .catch((e) => { -// messageError($q, e); -// }) -// .finally(() => { -// hideLoader(); -// }); -// }; +const downloadFile = (response: any, filename: string) => { + const link = document.createElement("a"); + var fileName = filename; + link.href = window.URL.createObjectURL(new Blob([response.data])); + link.setAttribute("download", fileName); + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); +}; +const fileDownload = async (no:number,type:string) =>{ + showLoader(); + await http + .get(config.API.reportTransferFile(no,type,id.value), { + responseType: "blob", + }) + .then(async (res) => { + downloadFile( + res, + `_ครั้งที่.${type}` + ); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); +}; const rows = ref([]); const columns = ref([ { @@ -538,27 +532,27 @@ onMounted(async () => { }); const rowsFileDownload = ref([{ - id:1, + no:1, fileName: "คําร้องขอโอนไปถึงส่วนราชการอื่นนอก กรุงเทพมหานครที่ข้าราชการประสงค์ขอโอน", pathName: "" },{ - id:2, + no:2, fileName: "หนังสือแจ้งสํานักงานการเจ้าหน้าที่ สํานักปลัดกรุงเทพมหานคร ให้ทราบตําแหน่งและตําแหน่งเลขที่ที่ดําเนินการให้โอน", pathName: "" },{ - id:3, + no:3, fileName: "หนังสือยินยอมให้โอนและวันที่พร้อมจะให้โอนไปยัง หน่วยงานที่รับโอน", pathName: "" },{ - id:4, + no:4, fileName: "หนังสือแจ้งสหกรณ์ออมทรัพย์กรุงเทพมหานครเพื่อขอ ตรวจสอบภาระหนี้สินสหกรณ์ออมทรัพย์", pathName: "" },{ - id:5, + no:5, fileName: "หนังสือถึงสํานักงานการเจ้าหน้าที่ สํานักปลัดกรุงเทพมหานครเพื่อขอตรวจสอบพฤติการณ์ทางวินัย และภาระหนี้สินสวัสดิการ", pathName: "" },{ - id:6, + no:6, fileName: "หนังสือถึงสถาบันพัฒนาข้าราชการกรุงเทพมหานครเพื่อขอตรวจสอบเรื่องภาระผูกพันการรับทุนและการลา ศึกษาต่อกับทางกรุงเทพมหานคร", pathName: "" }]); @@ -569,7 +563,7 @@ const getData = async () => { .get(config.API.transferId(dataId.toString())) .then((res: any) => { const data = res.data.result; - // console.log(data); + id.value = data.id let list: TypeFile[] = []; if (data.docs.length > 0) { data.docs.map((doc: TypeFile) => { diff --git a/src/modules/06_retirement/components/resign/Resign.vue b/src/modules/06_retirement/components/resign/Resign.vue index 4c9e2d9c0..97152019b 100644 --- a/src/modules/06_retirement/components/resign/Resign.vue +++ b/src/modules/06_retirement/components/resign/Resign.vue @@ -488,7 +488,7 @@ const saveOrder = async () => { - +