From fa850ccc24d5396958a0b8ecc5058f61c18d0453 Mon Sep 17 00:00:00 2001 From: AnandaTon <125332905+anandaAiemvong@users.noreply.github.com> Date: Fri, 25 Aug 2023 14:48:10 +0700 Subject: [PATCH 1/3] =?UTF-8?q?api=20=E0=B8=94=E0=B8=B2=E0=B8=A7=E0=B9=8C?= =?UTF-8?q?=E0=B8=99=E0=B9=82=E0=B8=AB=E0=B8=A5=E0=B8=94=E0=B9=84=E0=B8=9F?= =?UTF-8?q?=E0=B8=A5=E0=B9=8C=20=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=8A?= =?UTF-8?q?=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=9C=E0=B8=B9=E0=B9=89=E0=B9=80?= =?UTF-8?q?=E0=B8=81=E0=B8=A9=E0=B8=B5=E0=B8=A2=E0=B8=93=E0=B8=AD=E0=B8=B2?= =?UTF-8?q?=E0=B8=A2=E0=B8=B8=E0=B8=A3=E0=B8=B2=E0=B8=8A=E0=B8=81=E0=B8=B2?= =?UTF-8?q?=E0=B8=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/reports/api.report.ts | 9 ++- .../components/ListRetirement/TableList.vue | 56 +++++++++++++++---- 2 files changed, 52 insertions(+), 13 deletions(-) diff --git a/src/api/reports/api.report.ts b/src/api/reports/api.report.ts index c025232d2..b7d868f5b 100644 --- a/src/api/reports/api.report.ts +++ b/src/api/reports/api.report.ts @@ -3,8 +3,13 @@ */ import env from "../index"; const reportOrder = `${env.API_REPORT2_URI}/report/order`; +const reportRetire = `${env.API_REPORT2_URI}/report/retire`; export default { - reportOrderCover: (fileType: string, id: string) => `${reportOrder}/cover/${fileType}/${id}`, - reportOrderAttachment: (fileType: string, id: string) => `${reportOrder}/attachment/${fileType}/${id}`, + reportOrderCover: (fileType: string, id: string) => + `${reportOrder}/cover/${fileType}/${id}`, + reportOrderAttachment: (fileType: string, id: string) => + `${reportOrder}/attachment/${fileType}/${id}`, + reportRetireList: (fileType: string, id: string) => + `${reportRetire}/${fileType}/${id}`, }; diff --git a/src/modules/06_retirement/components/ListRetirement/TableList.vue b/src/modules/06_retirement/components/ListRetirement/TableList.vue index 04910a2a1..8984d1b6c 100644 --- a/src/modules/06_retirement/components/ListRetirement/TableList.vue +++ b/src/modules/06_retirement/components/ListRetirement/TableList.vue @@ -16,7 +16,8 @@ const { showLoader, hideLoader, messageError, success } = mixin; // const type_params = route.params.type; // const year_params = route.params.year; const retireld_params = route.params.retirementId; - +const orderCoverDocs = ref(""); +const orderCoverPdf = ref(""); const modalNote = ref(false); const note = ref(""); const retireProfileId = ref(""); @@ -153,6 +154,8 @@ const fileUpload = ref(null); onMounted(() => { retireld.value = retireld_params.toString(); fecthlistprofile(retireld.value); + fetchReportCover("pdf", retireld.value); + fetchReportCover("docx", retireld.value); }); const round = ref(); const typeReport = ref(""); @@ -320,6 +323,25 @@ const uploadFile = async (event: any) => { }); }; +const fetchReportCover = async (type: string, orderId: string) => { + showLoader(); + await http + .get(config.API.reportRetireList(type, orderId)) + .then(async (res) => { + if (type == "pdf") { + orderCoverPdf.value = res.data.result; + } else { + orderCoverDocs.value = res.data.result; + } + }) + .catch((e) => { + // messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); +}; + // const classrow = (prop: any) => { // if (profileId.value !== "" && prop.profileId === profileId.value) { // return "color: #26a69a;"; @@ -374,17 +396,29 @@ const paginationLabel = (start: number, end: number, total: number) => { - - - - - ไฟล .PDF + + + ไฟล์ .PDF - - - - - ไฟล .xls + + + ไฟล์ .docx From fe051993e969dfffc63c021aa16c6218bbf0710a Mon Sep 17 00:00:00 2001 From: AnandaTon Date: Fri, 25 Aug 2023 16:37:09 +0700 Subject: [PATCH 2/3] =?UTF-8?q?addClickDownload=20=E0=B8=A3=E0=B8=B2?= =?UTF-8?q?=E0=B8=A2=E0=B8=8A=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=9C=E0=B8=B9?= =?UTF-8?q?=E0=B9=89=E0=B9=80=E0=B8=81=E0=B8=A9=E0=B8=B5=E0=B8=A2=E0=B8=93?= =?UTF-8?q?=E0=B8=AD=E0=B8=B2=E0=B8=A2=E0=B8=B8=E0=B8=A3=E0=B8=B2=E0=B8=8A?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../06_retirement/components/ListRetirement/TableList.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/06_retirement/components/ListRetirement/TableList.vue b/src/modules/06_retirement/components/ListRetirement/TableList.vue index 4007fa6a8..7b5023014 100644 --- a/src/modules/06_retirement/components/ListRetirement/TableList.vue +++ b/src/modules/06_retirement/components/ListRetirement/TableList.vue @@ -150,6 +150,8 @@ const visibleColumns = ref([ const action = ref(""); const fileUpload = ref(null); +const clickOpenDownloadPDF =() =>{window.open(orderCoverPdf.value);} +const clickOpenDownloadDoc =() =>{window.open(orderCoverDocs.value);} onMounted(() => { retireld.value = retireld_params.toString(); @@ -400,7 +402,7 @@ const paginationLabel = (start: number, end: number, total: number) => { clickable v-close-popup type="a" - :href="orderCoverPdf" + @click="clickOpenDownloadPDF" target="_blank" > { clickable v-close-popup type="a" - :href="orderCoverDocs" + @click="clickOpenDownloadDoc" target="_blank" > Date: Fri, 25 Aug 2023 17:02:18 +0700 Subject: [PATCH 3/3] =?UTF-8?q?api=20=E0=B8=AD=E0=B8=AD=E0=B8=81=E0=B8=84?= =?UTF-8?q?=E0=B8=B3=E0=B8=AA=E0=B8=B1=E0=B9=88=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/05_placement/api.placement.ts | 10 +- .../10_order/components/step/step01.vue | 1480 +++++++++++++---- 2 files changed, 1120 insertions(+), 370 deletions(-) diff --git a/src/api/05_placement/api.placement.ts b/src/api/05_placement/api.placement.ts index f83d400c7..c8e627c3f 100644 --- a/src/api/05_placement/api.placement.ts +++ b/src/api/05_placement/api.placement.ts @@ -72,7 +72,7 @@ export default { prevStep: (orderId: string) => `${order}/order/prev/${orderId}`, executeOrder: (orderId: string) => `${order}/order/execute/${orderId}`, createOrder: () => `${order}/order/detail`, - examroundOrder: () => `${order}/order/detail/exam-round`, + examroundOrder: (commandCode: string) => `${order}/order/detail/exam-round/${commandCode}`, personsOrder: (orderId: string) => `${order}/order/persons/${orderId}`, //ข้อมูลเลือกรายชื่อออกคำสั่ง, ลบรายชื่อ personsselectedOrder: (orderId: string) => `${order}/order/persons-selected/${orderId}`, @@ -150,5 +150,11 @@ export default { otherReport: (id: string) => `${placemenOther}/report/${id}`, otherByid: (id: string) => `${placemenOther}/${id}`, - userPlacement:(id:string) => `${placement}/user/${id}` + userPlacement: (id: string) => `${placement}/user/${id}`, + + // orderForm + orderCPM: (type: string) => `${order}/order/${type}/detail`, + orderCPMUpdate: (type: string, id: string) => `${order}/order/${type}/detail/${id}`, + + }; diff --git a/src/modules/10_order/components/step/step01.vue b/src/modules/10_order/components/step/step01.vue index cca81ea63..84aa15ad2 100644 --- a/src/modules/10_order/components/step/step01.vue +++ b/src/modules/10_order/components/step/step01.vue @@ -217,15 +217,9 @@ watch(byOrder, async () => { }); watch(nameCommand, async () => { - // console.log(nameCommand.value); - // console.log(positionCommand.value); - if (positionCommand.value === "" || positionCommand.value === undefined) { positionCommand.value = nameCommand.value.positionName; } - // if (nameCommand.value === "") { - // positionCommand.value = ""; - // } }); const fecthTypeOption = async (actions: string) => { showLoader(); @@ -248,7 +242,6 @@ const fecthTypeOption = async (actions: string) => { await fetchdetailOrder(); } await fecthCommand(); - await fecthExamRoundOption(); hideLoader(); }); }; @@ -278,12 +271,12 @@ const fetchdetailOrder = async () => { conclusionRegisterDate.value = data.conclusionRegisterDate; conclusionResultNo.value = data.conclusionResultNo; conclusionResultDate.value = data.conclusionResultDate; + fecthExamRoundOption(data.orderTypeCode); }) .catch((e) => { messageError($q, e); }) .finally(async () => { - await fecthExamRoundOption(); await fecthCommand(); hideLoader(); }); @@ -299,29 +292,35 @@ const fecthCommand = async () => { console.log(e); }); }; -const fecthExamRoundOption = async () => { +const selectCMP = (selectOrder: any) => { + fecthExamRoundOption(selectOrder.commandCode); +}; +const fecthExamRoundOption = async (commandCode: string) => { await http - .get(config.API.examroundOrder()) + .get(config.API.examroundOrder(commandCode)) .then((res) => { examRoundOption.value = res.data.result; - // console.log(examRoundOption.value); }) - .catch((e) => { }); + .catch((e) => { + console.log(e); + }); }; const submit = async () => { - console.log("nameCommand ===>", nameCommand.value); - let signBy = null; if (!nameCommand.value.length) { signBy = await nameCommand.value.name; } else { - const name2 = await CommandOption.value.find((x: any) => x.id == nameCommand.value.id); + const name2 = await CommandOption.value.find( + (x: any) => x.id == nameCommand.value.id + ); signBy = await name2?.name; console.log("signBy", signBy); } - const orderByOrganizationName = await byOrderOption.value.find((x:any)=>x.id == byOrder.value)?.name; + const orderByOrganizationName = await byOrderOption.value.find( + (x: any) => x.id == byOrder.value + )?.name; const formdata = { orderTypeValue: typeOrder.value.id, @@ -336,25 +335,6 @@ const submit = async () => { signatoryBy: signBy, signatoryPosition: positionCommand.value, }; - - // { - // "orderTypeValue": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - // "orderTitle": "string", - // "orderNo": "string", - // "orderYear": 0, - // "orderDate": "2023-08-21T09:46:54.354Z", - // "orderBy": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - // "orderByOrganizationName": "string", - // "signatoryBy": "string", - // "signatoryPosition": "string", - // "examRound": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - // "registerPosition": "string", - // "conclusionRegisterNo": "string", - // "conclusionRegisterDate": "2023-08-21T09:46:54.354Z", - // "conclusionResultNo": "string", - // "conclusionResultDate": "2023-08-21T09:46:54.354Z" - // } - if ( typeOrder.value.commandCode == "C-PM-01" || typeOrder.value.commandCode == "C-PM-02" || @@ -369,97 +349,96 @@ const submit = async () => { conclusionResultDate: conclusionResultDate.value, }); } else if ( - typeOrder.value.commandCode == "C-PM-04" || - typeOrder.value.commandCode == "C-PM-05" + typeOrder.value.commandCode == "C-PM-05" || + typeOrder.value.commandCode == "C-PM-06" ) { Object.assign(formdata, { - conclusionRegisterNo: conclusion1.value, - conclusionRegisterDate: conclusionDate1.value, - conclusionResultNo: conclusion2.value, - conclusionResultDate: conclusionDate2.value, - meeting: meeting.value, - dateMeeting: dateMeeting.value, - }); - } else if (typeOrder.value.commandCode == "C-PM-07") { - Object.assign(formdata, { - conclusionRelocation1: conclusionRelocation1.value, - conclusionRelocationDate1: conclusionRelocationDate1.value, - conclusionRelocation2: conclusionRelocation2.value, - conclusionRelocationDate2: conclusionRelocationDate2.value, + conclusionMeetingNo: meeting.value, + conclusionMeetingDate: dateMeeting.value, }); } else if (typeOrder.value.commandCode == "C-PM-08") { Object.assign(formdata, { - conclusion: conclusion.value, - conclusionDate: conclusionDate.value, - conclusionLeave: conclusionLeave.value, - conclusionLeaveDate: conclusionLeaveDate.value, - conclusionReceive: conclusionReceive.value, - conclusionReceiveDate: conclusionReceiveDate.value, + conclusionReturnNo: conclusionReceive.value, + conclusionReturnDate: conclusionReceiveDate.value, }); } else if (typeOrder.value.commandCode == "C-PM-09") { Object.assign(formdata, { - organizations: organizations.value, - order: order.value, - orderDate: orderDate.value, - book: book.value, - bookDate: bookDate.value, + sourceOrganizationName: organizations.value, + conclusionReturnNo: order.value, + conclusionReturnDate: orderDate.value, + militaryCommandNo: book.value, + militaryCommandDate: bookDate.value, }); } else if (typeOrder.value.commandCode == "C-PM-10") { Object.assign(formdata, { - organizationsOld: organizationsOld.value, - orderOld: orderOld.value, - orderOldDate: orderOldDate.value, - locationname: locationname.value, - experimentOc: experimentOc.value, - experimentformDate: experimentformDate.value, - experimenttoDate: experimenttoDate.value, - chairman: chairman.value, - director: director.value, - director2: director2.value, + placementCommandIssuer: organizationsOld.value, + placementCommandNo: orderOld.value, + placementCommandDate: orderOldDate.value, + placementPositionName: locationname.value, + placementOrganizationName: experimentOc.value, + probationStartDate: experimentformDate.value, + probationEndDate: experimenttoDate.value, + chairManFullName: chairman.value, + member1FullName: director.value, + member2FullName: director2.value, }); } else if ( typeOrder.value.commandCode == "C-PM-11" || typeOrder.value.commandCode == "C-PM-12" ) { Object.assign(formdata, { - committeeOc: committeeOc.value, - committeeOrder: committeeOrder.value, - committeeDate: committeeDate.value, + placementCommandIssuer: committeeOc.value, + placementCommandNo: committeeOrder.value, + placementCommandDate: committeeDate.value, }); } else if (typeOrder.value.commandCode == "C-PM-13") { Object.assign(formdata, { - receiveOc: receiveOc.value, + receiveOrganizationName: receiveOc.value, }); } else if (typeOrder.value.commandCode == "C-PM-14") { Object.assign(formdata, { - conclusionReceive: conclusionReceive.value, + transferOrganizationName: "", + conclusionReceiveNo: conclusionReceive.value, conclusionReceiveDate: conclusionReceiveDate.value, }); } else if (typeOrder.value.commandCode == "C-PM-16") { Object.assign(formdata, { - orderNumber: orderNumber.value, - orderNumberDate: orderNumberDate.value, + govAidCommandNo: orderNumber.value, + govAidCommandDate: orderNumberDate.value, + }); + } else if ( + typeOrder.value.commandCode == "C-PM-18" || + typeOrder.value.commandCode == "C-PM-19" || + typeOrder.value.commandCode == "C-PM-20" + ) { + Object.assign(formdata, { + fault: "", + guiltyBasis: "", + conclusionFireNo: "", + conclusionFireDate: new Date(), + conclusionFireResolution: "", }); } + console.log(formdata); await myForm.value!.validate().then((result: boolean) => { if (result) { dialogConfirm($q, () => { if (!orderId) { - createListOrder(formdata); + createListOrder(formdata, typeOrder.value.commandCode); } else { let orderIdString = orderId.toString(); - updateOrder(formdata, orderIdString); + updateOrder(formdata, orderIdString, typeOrder.value.commandCode); } }); } }); }; -const createListOrder = async (formData: Object) => { +const createListOrder = async (formData: Object, type: string) => { showLoader(); await http - .post(config.API.createOrder(), formData) + .post(config.API.orderCPM(type), formData) .then((res) => { const data = res.data.result; localStorage.setItem("orderId", data.id); @@ -474,10 +453,10 @@ const createListOrder = async (formData: Object) => { hideLoader(); }); }; -const updateOrder = async (formData: Object, orderId: string) => { +const updateOrder = async (formData: Object, orderId: string, type: string) => { showLoader(); await http - .put(config.API.detailOrder(orderId), formData) + .put(config.API.orderCPMUpdate(type, orderId), formData) .then((res) => { console.log(res); next(); @@ -508,38 +487,86 @@ const getClass = (val: boolean) => {
- +
- +
- +
- +
- +
- + @@ -547,10 +574,22 @@ const getClass = (val: boolean) => { {{ parseInt(value + 543) }}