From 4c54ac272c227c2849a8c95e21402a4a36f825c2 Mon Sep 17 00:00:00 2001 From: waruneeta Date: Fri, 16 Feb 2024 14:05:12 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9B=E0=B8=A5=E0=B8=B5=E0=B9=88?= =?UTF-8?q?=E0=B8=A2=E0=B8=99=20api=20=E0=B8=84=E0=B9=89=E0=B8=99=E0=B8=AB?= =?UTF-8?q?=E0=B8=B2=E0=B8=84=E0=B8=99=E0=B8=88=E0=B8=B2=E0=B8=81=E0=B8=97?= =?UTF-8?q?=E0=B8=B0=E0=B9=80=E0=B8=9A=E0=B8=B5=E0=B8=A2=E0=B8=99=E0=B8=9B?= =?UTF-8?q?=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1=E0=B8=95=E0=B8=B4=E0=B9=83?= =?UTF-8?q?=E0=B8=AB=E0=B8=A1=E0=B9=88=20=E0=B8=82=E0=B8=AD=E0=B8=87?= =?UTF-8?q?=E0=B8=A7=E0=B8=B4=E0=B8=99=E0=B8=B1=E0=B8=A2=E0=B9=81=E0=B8=A5?= =?UTF-8?q?=E0=B8=B0=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B9=80=E0=B8=A1=E0=B8=B4?= =?UTF-8?q?=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/02_organizational/api.organization.ts | 3 ++ .../6_BasicInformation/Director/Form.vue | 41 +--------------- .../components/Director/Form.vue | 49 +------------------ 3 files changed, 5 insertions(+), 88 deletions(-) diff --git a/src/api/02_organizational/api.organization.ts b/src/api/02_organizational/api.organization.ts index a84de988d..cefc635b1 100644 --- a/src/api/02_organizational/api.organization.ts +++ b/src/api/02_organizational/api.organization.ts @@ -48,4 +48,7 @@ export default { /** struct-chart*/ orgStructChart: (id: string, type: string) => `${organization}/struct-chart/${id}/${type}`, + + // ค้นหาคนตามเงื่อนไข + orgSearchPersonal: () => `${organization}/profile/search-personal`, }; diff --git a/src/modules/11_discipline/components/6_BasicInformation/Director/Form.vue b/src/modules/11_discipline/components/6_BasicInformation/Director/Form.vue index 76ec60df7..71feaa911 100644 --- a/src/modules/11_discipline/components/6_BasicInformation/Director/Form.vue +++ b/src/modules/11_discipline/components/6_BasicInformation/Director/Form.vue @@ -142,45 +142,6 @@ const visibleColumnsRespondent = ref([ "organization", ]); -/** - * เพิ่มบุคลากร - */ -function addEmployee() { - if (idCard.value.length === 13) { - showLoader(); - http - .post(config.API.profileSearchPersonal(), { - fieldName: "idcard", - keyword: idCard.value, - }) - .then((res) => { - const dataApi = res.data.result; - if (dataApi.length > 0) { - const dataList = dataApi[0]; - formData.prefix = dataList.prefix; - formData.firstname = dataList.firstName; - formData.lastname = dataList.lastName; - formData.position = dataList.position; - formData.phone = dataList.phone; - formData.email = dataList.email; - } else { - dialogMessageNotify($q, "ไม่มีข้อมูลบุคคลากรที่ต้องการค้นหา"); - } - }) - .catch((e) => { - messageError($q, e); - }) - .finally(async () => { - hideLoader(); - }); - } - if (idCard.value.length !== 13) { - hideLoader(); - dialogMessageNotify($q, "กรุณากรอกเลขประจำตัวประชาชนให้ครบ 13 หลัก"); - } else { - } -} - /** ฟังชั่นตรวจสอบความถูกต้องก่อน บันทึก */ function onValidate() { const hasError = []; @@ -219,7 +180,7 @@ async function searchInput() { keyword: search.value, }; await http - .post(config.API.searchPersonal(), body) + .post(config.API.orgSearchPersonal(), body) .then((res) => { const data = res.data.result; const list = data.map((e: ResponsePreson) => ({ diff --git a/src/modules/12_evaluatePersonal/components/Director/Form.vue b/src/modules/12_evaluatePersonal/components/Director/Form.vue index a98fec562..d6b8fd09b 100644 --- a/src/modules/12_evaluatePersonal/components/Director/Form.vue +++ b/src/modules/12_evaluatePersonal/components/Director/Form.vue @@ -145,53 +145,6 @@ watch(props.data, async () => { formData.email = props.data.email; }); -/** - * เพิ่มบุคลากร - */ -function addEmployee() { - showLoader(); - const idCardNew = idCard.value.replace(/-/g, ""); - if (idCardNew.length === 13) { - http - .post(config.API.profileSearchPersonal(), { - fieldName: "idcard", - keyword: idCardNew, - }) - .then((res) => { - console.log(res); - const dataApi = res.data.result; - if (dataApi.length > 0) { - const dataList = dataApi[0]; - formData.personalId = dataList.personId; - formData.prefix = dataList.prefix; - formData.firstname = dataList.firstName; - formData.lastname = dataList.lastName; - formData.position = dataList.position; - formData.phone = dataList.phone; - formData.email = dataList.email; - } else { - dialogMessageNotify($q, "ไม่มีข้อมูลบุคคลากรที่ต้องการค้นหา"); - formData.personalId = ""; - formData.prefix = ""; - formData.firstname = ""; - formData.lastname = ""; - formData.position = ""; - formData.phone = ""; - formData.email = ""; - } - }) - .catch((e) => { - messageError($q, e); - }) - .finally(async () => { - hideLoader(); - }); - } else { - dialogMessageNotify($q, "กรุณากรอกเลขประจำตัวประชาชนให้ครบ 13 หลัก"); - hideLoader(); - } -} - /** * ตรวจสอบข้อมูลก่อนส่งไปยัง api */ @@ -250,7 +203,7 @@ async function searchInput() { keyword: search.value, }; await http - .post(config.API.searchPersonal(), body) + .post(config.API.orgSearchPersonal(), body) .then((res) => { const data = res.data.result; const list = data.map((e: ResponsePreson) => ({