diff --git a/src/api/05_placement/api.placement.ts b/src/api/05_placement/api.placement.ts index ac0f6788a..7ea4e0ae7 100644 --- a/src/api/05_placement/api.placement.ts +++ b/src/api/05_placement/api.placement.ts @@ -72,7 +72,8 @@ export default { prevStep: (orderId: string) => `${order}/order/prev/${orderId}`, executeOrder: (orderId: string) => `${order}/order/execute/${orderId}`, createOrder: () => `${order}/order/detail`, - examroundOrder: (commandCode: string) => `${order}/order/detail/exam-round/${commandCode}`, + examroundOrder: (commandCode: string) => + `${order}/order/detail/exam-round/${commandCode}`, personsOrder: (orderId: string) => `${order}/order/persons/${orderId}`, //ข้อมูลเลือกรายชื่อออกคำสั่ง, ลบรายชื่อ personsselectedOrder: (orderId: string) => `${order}/order/persons-selected/${orderId}`, @@ -99,6 +100,7 @@ export default { receiveDataId: (id: string) => `${receive}/${id}`, receivePosition: (id: string) => `${receive}/position/${id}`, receiveDataPosition: () => `${receive}/use`, + receiveFile: (id: string) => `${receive}/upload/${id}`, //tranfer ระบบคำขอโอน transfer, @@ -108,13 +110,13 @@ export default { transferUserId: (id: string) => `${transfer}/user/${id}`, transferConfirmId: (id: string) => `${transfer}/confirm/${id}`, - // แต่งตั้ง-เลื่อน placemenAppointment, appointmentMain: () => `${placement}/appointment`, appointmentByid: (id: string) => `${placement}/appointment/${id}`, appointmentDelete: (id: string) => `${placement}/appointment/${id}`, - appointmentPosition: (id: string) => `${placement}/appointment/position/${id}`, + appointmentPosition: (id: string) => + `${placement}/appointment/position/${id}`, apppointmentReport: (id: string) => `${placement}/appointment/report/${id}`, apppointmentPosition: () => `${placement}/appointment/use`, @@ -152,10 +154,8 @@ export default { userPlacement: (id: string) => `${placement}/user/${id}`, - // orderForm + // orderForm orderCPM: (type: string) => `${order}/order/${type}/detail`, - orderCPMUpdate: (type: string, id: string) => `${order}/order/${type}/detail/${id}`, - - - + orderCPMUpdate: (type: string, id: string) => + `${order}/order/${type}/detail/${id}`, }; diff --git a/src/api/registry/api.profile.ts b/src/api/registry/api.profile.ts index 6c76e5f1f..009c483fb 100644 --- a/src/api/registry/api.profile.ts +++ b/src/api/registry/api.profile.ts @@ -45,7 +45,7 @@ export default { `${profile}search/new-employee/oc/${id}`, profileSearchNewEmOcLeaveId: (id: string) => `${profile}search/new-employee/oc/leave/${id}`, - profileEmployeeTempId: (id: string) => `${profile}/employee/temp/${id}`, + profileEmployeeTempId: (id: string) => `${profile}employee/temp/${id}`, profileCoupleId: (profileId: string) => `${profile}couple/${profileId}`, diff --git a/src/modules/05_placement/components/Receive/receiveMain.vue b/src/modules/05_placement/components/Receive/receiveMain.vue index 951b165ff..f921eecec 100644 --- a/src/modules/05_placement/components/Receive/receiveMain.vue +++ b/src/modules/05_placement/components/Receive/receiveMain.vue @@ -18,6 +18,7 @@ import type { ResponseRow, } from "@/modules/05_placement/interface/response/Receive"; +const id = ref(""); const $q = useQuasar(); const router = useRouter(); const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง @@ -39,7 +40,10 @@ const modal = ref(false); const popup = () => { const row = filters.value.filter( (r: ResponseRow) => - (r.status == "WAITTING" || r.status == "PENDING" || r.status == "APPROVE") && r.positionNumber != null + (r.status == "WAITTING" || + r.status == "PENDING" || + r.status == "APPROVE") && + r.positionNumber != null ); rows2.value = row; modal.value = true; @@ -73,6 +77,8 @@ const filterKeyword = ref(""); const filterKeyword2 = ref(""); const filterRef = ref(null); const files = ref(); +const nameFile = ref(""); +const fileUpload = ref([]); const fileDocDataUpload = ref([]); const listRecevice = ref([]); const filters = ref([]); @@ -267,6 +273,11 @@ onMounted(() => { fecthlistRecevice(); }); +const SaveData = async () => { + await addUpload(); + await clickCloseUpload(); +}; + const fecthlistRecevice = async () => { showLoader(); await http @@ -312,30 +323,32 @@ const fecthlistRecevice = async () => { }); }; -const fileUploadDoc = async (files: any) => { - files.forEach((file: any) => { - fileDocDataUpload.value.push(file); - }); +const fileUploadDoc = async (val: any) => { + nameFile.value = val[0].name; + fileUpload.value = val; }; const addUpload = async () => { - // showLoader(); - // await http - // .post(config.API.listRoundInsignia()) - // .then(() => { - // success($q, "บันทึกข้อมูลสำเร็จ"); - // }) - // .catch((e) => { - // messageError($q, e); - // }) - // .finally(async () => { - // hideLoader(); - // }); -}; - -const SaveData = async () => { - await addUpload(); - await clickCloseUpload(); + if (fileUpload.value.length > 0) { + const blob = fileUpload.value.slice(0, fileUpload.value[0].size); + const newFile = new File(blob, nameFile.value, { + type: fileUpload.value[0].type, + }); + const formData = new FormData(); + formData.append("", newFile); + showLoader(); + await http + .put(config.API.receiveFile(personalId.value), formData) + .then(() => { + success($q, "บันทึกข้อมูลสำเร็จ"); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(async () => { + hideLoader(); + }); + } }; const resetFilter = () => { @@ -372,6 +385,7 @@ const openModalTree = (id: string) => { const openUpload = (id: string) => { personalId.value = id; modalupload.value = true; + console.log(personalId.value); }; const openDelete = (id: string) => { @@ -440,27 +454,64 @@ const saveOrder = async () => { เพิ่มข้อมูล - + ส่งไปออกคำสั่งรับโอน - + - +
- + diff --git a/src/modules/08_registryEmployee/views/Information/Tempinformation.vue b/src/modules/08_registryEmployee/views/Information/Tempinformation.vue index 95adffade..c8772c095 100644 --- a/src/modules/08_registryEmployee/views/Information/Tempinformation.vue +++ b/src/modules/08_registryEmployee/views/Information/Tempinformation.vue @@ -3,7 +3,7 @@ -
- +
-
+
-
-
([]); const positionEmployeePositionId = ref(""); const positionEmployeePositionOptions = ref([]); - const employeeWage = ref(""); + const employeeWage = ref(0); const employeeTypeIndividual = ref(""); const employeeMoneyIncrease = ref(0); const employeeMoneyAllowance = ref(0); @@ -404,7 +401,7 @@ ]); onMounted(async () => { - // await fetchData(); + await fetchData(); await fetchDataSelector(); }); @@ -420,6 +417,7 @@ showLoader(); await fetchEmployeeGroup(); await fetchpositionEmployeeLine(); + await fetchPositionEmployeePosition(); hideLoader(); }; @@ -469,41 +467,41 @@ // await fetchData(); }; -// const fetchData = async () => { -// if (route.params.id) { -// showLoader(); -// await http -// .get(config.API.profileEmployeeTempId(route.params.id.toString())) -// .then((res) => { -// const data: any = res.data.result; -// rows.value = []; -// data.map((e: any) => { -// rows.value.push({ -// id: e.id, -// employeeMoneyIncrease: e.employeeMoneyIncrease, -// employeeMoneyAllowance: e.employeeMoneyAllowance, -// employeeMoneyEmployee: e.employeeMoneyEmployee, -// employeeMoneyEmployer: e.employeeMoneyEmployer, -// positionEmployeeGroupId: e.positionEmployeeGroupId, -// positionEmployeePositionId: e.positionEmployeePositionId, -// positionEmployeeLineId: e.positionEmployeeLineId, -// employeeTypeIndividual: e.employeeTypeIndividual, -// employeeOc: e.employeeOc, -// employeeWage: e.employeeWage, -// createdFullName: e.createdFullName, -// createdAt: new Date(e.createdAt), -// }); -// }); + const fetchData = async () => { + if (route.params.id) { + showLoader(); + await http + .get(config.API.profileEmployeeTempId(route.params.id.toString())) + .then((res) => { + const data: any = res.data.result; + rows.value = []; + data.map((e: any) => { + rows.value.push({ + id: e.id, + employeeMoneyIncrease: e.employeeMoneyIncrease, + employeeMoneyAllowance: e.employeeMoneyAllowance, + employeeMoneyEmployee: e.employeeMoneyEmployee, + employeeMoneyEmployer: e.employeeMoneyEmployer, + positionEmployeeGroupId: e.positionEmployeeGroupId, + positionEmployeePositionId: e.positionEmployeePositionId, + positionEmployeeLineId: e.positionEmployeeLineId, + employeeTypeIndividual: e.employeeTypeIndividual, + employeeOc: e.employeeOc, + employeeWage: e.employeeWage, + createdFullName: e.createdFullName, + createdAt: new Date(e.createdAt), + }); + }); -// }) -// .catch((e) => { -// messageError($q, e); -// }) -// .finally(() => { -// hideLoader(); -// }); -// } -// }; + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); + } + }; // กลุ่มงาน const fetchEmployeeGroup = async () => { @@ -539,6 +537,26 @@ const fetchpositionEmployeeLine = async () => { messageError($q, e); }); }; + +//ชื่อตำแหน่ง + +const fetchPositionEmployeePosition = async () => { + await http + .get(config.API.positionEmployeePosition) + .then((res) => { + const data = res.data.result; + let option: DataOption[] = []; + data.map((r: DataOption) => { + option.push({ id: r.id.toString(), name: r.name.toString() }); + }); + + positionEmployeePositionOptions.value = option; + }) + .catch((e) => { + messageError($q, e); + }); +}; + // const editData = async () => { // const body: any = {