From 6fbc73300c5d597560d548c50f616745c63689de Mon Sep 17 00:00:00 2001 From: Thanit Konmek Date: Thu, 10 Aug 2023 17:02:08 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=82=E0=B8=AD=E0=B9=82=E0=B8=AD=E0=B8=99?= =?UTF-8?q?=20api=20=20=E0=B8=95=E0=B9=88=E0=B8=AD=E0=B9=81=E0=B8=A5?= =?UTF-8?q?=E0=B9=89=E0=B8=A7,=E0=B8=94=E0=B8=B2=E0=B8=95=E0=B9=89?= =?UTF-8?q?=E0=B8=B2=E0=B8=A2=E0=B8=B1=E0=B8=87=E0=B9=84=E0=B8=A1=E0=B9=88?= =?UTF-8?q?=E0=B8=84=E0=B8=A3=E0=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/05_placement/api.placement.ts | 45 ++-- .../components/OrderPlacement/step/step02.vue | 41 +-- .../components/Transfer/transferMain.vue | 237 ++++++------------ .../components/Transfer/transferRegistry.vue | 223 ++++++++++------ .../interface/response/Transfer.ts | 38 +++ 5 files changed, 307 insertions(+), 277 deletions(-) create mode 100644 src/modules/05_placement/interface/response/Transfer.ts diff --git a/src/api/05_placement/api.placement.ts b/src/api/05_placement/api.placement.ts index b9cc81f9b..b29f33155 100644 --- a/src/api/05_placement/api.placement.ts +++ b/src/api/05_placement/api.placement.ts @@ -3,6 +3,7 @@ const placement = `${env.API_PLACEMENT_URI}/placement`; const orgTree = `${env.API_URI_ORG_TREE}`; const order = `${env.API_PLACEMENT_URI}`; const receive = `${env.API_PLACEMENT_URI}/placement/Receive`; +const transfer = `${placement}/transfer`; export default { MainDetail: (year: number) => `${placement}/exam/${year}`, @@ -63,47 +64,37 @@ export default { nextStep: (orderId: string) => `${order}/order/next/${orderId}`, prevStep: (orderId: string) => `${order}/order/prev/${orderId}`, executeOrder: (orderId: string) => `${order}/order/execute/${orderId}`, - createOrder: () => `${order}/order/detail`, - examroundOrder: () => `${order}/order/detail/exam-round`, - - //ข้อมูลเลือกรายชื่อออกคำสั่ง, ลบรายชื่อ - personsOrder: (orderId: string) => `${order}/order/persons/${orderId}`, - personsselectedOrder: (orderId: string) => `${order}/order/persons-selected/${orderId}`, - - //เปลี่ยน status ของคำสั่งไปขั้นตอนถัดไป - nextOrder: (orderId: string) => `${order}/order/next/${orderId}`, - //เปลี่ยน status ของคำสั่งไปขั้นตอนถัดไป - preventOrder: (orderId: string) => `${order}/order/prev/${orderId}`, - - //สลับลำดับข้อมูลในบัญชีแนบท้ายขึ้น - swapUpOrder: (personalId: string) => `${order}/order/swap/up/${personalId}`, - //สลับลำดับข้อมูลในบัญชีแนบท้ายลง + personsOrder: (orderId: string) => `${order}/order/persons/${orderId}`, //ข้อมูลเลือกรายชื่อออกคำสั่ง, ลบรายชื่อ + personsselectedOrder: (orderId: string) => + `${order}/order/persons-selected/${orderId}`, + nextOrder: (orderId: string) => `${order}/order/next/${orderId}`, //เปลี่ยน status ของคำสั่งไปขั้นตอนถัดไป + preventOrder: (orderId: string) => `${order}/order/prev/${orderId}`, //เปลี่ยน status ของคำสั่งไปขั้นตอนถัดไป + swapUpOrder: (personalId: string) => `${order}/order/swap/up/${personalId}`, //สลับลำดับข้อมูลในบัญชีแนบท้ายขึ้น swapDownOrder: (personalId: string) => - `${order}/order/swap/down/${personalId}`, - - //บันทึกข้อมูลเงินเดือนสำหรับผู้บรรจุ - salaryOrder: (id: string) => `${order}/order/salary/${id}`, - - // popup แสดงรายชื่อตามหน่วยงานที่เลือก , popup เลือกรายชื่อส่งสำเนา - copyOrderPersonsId: (id: string) => `${order}/order/copy-order/persons/${id}`, - + `${order}/order/swap/down/${personalId}`, //สลับลำดับข้อมูลในบัญชีแนบท้ายลง + salaryOrder: (id: string) => `${order}/order/salary/${id}`, //บันทึกข้อมูลเงินเดือนสำหรับผู้บรรจุ + copyOrderPersonsId: (id: string) => `${order}/order/copy-order/persons/${id}`, // popup แสดงรายชื่อตามหน่วยงานที่เลือก , popup เลือกรายชื่อส่งสำเนา copyOrder: `${order}/order/copy-order`, - copyOrderId: (id: string) => `${order}/order/copy-order/${id}`, - attachmentId: (id: string) => `${order}/order/attachment/${id}`, - attachmentOrderId: (orderId: string) => `${order}/order/attachment/order-file/${orderId}`, attachmentFileId: (orderId: string) => `${order}/order/attachment/file/${orderId}`, - orderReady: (id: string) => `${order}/order/ready/${id}`, attachmentOrder: (orderId: string) => `${order}/order/attachment/${orderId}`, + //receive ระบบรับโอน receiveData: () => `${receive}`, receiveDataId: (id: string) => `${receive}/${id}`, receivePosition: (id: string) => `${receive}/position/${id}`, + + //tranfer ระบบคำขอโอน + transfer, + transferId: (id: string) => `${transfer}/${id}`, + transferUser: `${transfer}/user`, + transferUserId: (id: string) => `${transfer}/user/${id}`, + transferConfirmId: (id: string) => `${transfer}/confirm/${id}`, }; diff --git a/src/modules/05_placement/components/OrderPlacement/step/step02.vue b/src/modules/05_placement/components/OrderPlacement/step/step02.vue index a64b88f85..34b0634df 100644 --- a/src/modules/05_placement/components/OrderPlacement/step/step02.vue +++ b/src/modules/05_placement/components/OrderPlacement/step/step02.vue @@ -372,7 +372,6 @@ const columns = ref([ const rows = ref([]); const rows2 = ref([]); const selected = ref([]); -const orderId = ref(route.params.orderid.toString()); onMounted(async () => { await conditionData(); @@ -602,7 +601,14 @@ const putSalary = async (salary: any) => { const modalAddChange = async () => { modalAdd.value = !modalAdd.value; if (modalAdd.value == true) { - await fetchaddlist(orderId.value); + const id = route.params.orderid + ? route.params.orderid.toString() + : localStorage.getItem("orderId") + ? localStorage.getItem("orderId") + : null; + if (id !== null) { + await fetchaddlist(id); + } } else await conditionData(); }; const fetchaddlist = async (id: string) => { @@ -656,18 +662,25 @@ const saveModalAdd = () => { } }; const addlist = async (data: Object) => { - await http - .post(config.API.personsOrder(orderId.value), data) - .then(() => { - success($q, "บันทึกสำเร็จ"); - }) - .catch((e: any) => { - console.log(e); - messageError($q, e); - }) - .finally(() => { - modalAddChange(); - }); + const id = route.params.orderid + ? route.params.orderid.toString() + : localStorage.getItem("orderId") + ? localStorage.getItem("orderId") + : null; + if (id !== null) { + await http + .post(config.API.personsOrder(id), data) + .then(() => { + success($q, "บันทึกสำเร็จ"); + }) + .catch((e: any) => { + console.log(e); + messageError($q, e); + }) + .finally(() => { + modalAddChange(); + }); + } }; const click = (e: any) => { diff --git a/src/modules/05_placement/components/Transfer/transferMain.vue b/src/modules/05_placement/components/Transfer/transferMain.vue index 78bd3f03a..fb15a19aa 100644 --- a/src/modules/05_placement/components/Transfer/transferMain.vue +++ b/src/modules/05_placement/components/Transfer/transferMain.vue @@ -1,38 +1,32 @@ - + diff --git a/src/modules/05_placement/interface/response/Transfer.ts b/src/modules/05_placement/interface/response/Transfer.ts new file mode 100644 index 000000000..19a1523a9 --- /dev/null +++ b/src/modules/05_placement/interface/response/Transfer.ts @@ -0,0 +1,38 @@ +interface ResponseData { + createdAt: Date; + date: Date; + id: string; + isActive: boolean; + organization: string; + organizationPositionOld: string; + posNo: string; + position: string; + positionLevel: string; + positionLevelOld: string; + positionNumberOld: string; + positionTypeOld: string; + reason: string; + salary: number; + status: string; +} + +interface TypeFile { + fileName: string; + pathName: string; +} + +interface ResponseDataDetail { + createdAt: Date; + date: Date; + id: string; + organization: string; + organizationPositionOld: string; + positionLevelOld: string; + positionNumberOld: string; + positionTypeOld: string; + reason: string; + salary: number; + status: string; +} + +export type { ResponseData, ResponseDataDetail, TypeFile };