From 557badce4da88d600e0616ba83d36cd83132fc0d Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Mon, 6 Jan 2025 19:19:04 +0700 Subject: [PATCH 01/15] fixing display --- .../components/Detail/step/step8.vue | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/modules/12_evaluatePersonal/components/Detail/step/step8.vue b/src/modules/12_evaluatePersonal/components/Detail/step/step8.vue index abc75000a..1c9328919 100644 --- a/src/modules/12_evaluatePersonal/components/Detail/step/step8.vue +++ b/src/modules/12_evaluatePersonal/components/Detail/step/step8.vue @@ -315,7 +315,7 @@ async function fetchDataSigner() { nameOfWork.value = data.subjectDoc2; nameOfOwner.value = data.authorDoc2; position.value = data.assignedPosition; - evaluationResult.value = data.evaluationResult + evaluationResult.value = data.evaluationResult; } }) .catch((e) => { @@ -986,7 +986,17 @@ onMounted(async () => { /> -
ผลการพิจารณา : {{ evaluationResult == 'PASS' ? 'ผ่าน':'ไม่ผ่าน' }}
+
+ ผลการประเมิน: + {{ evaluationResult == "PASS" ? "ผ่าน" : "ไม่ผ่าน" }} +
From e1bde59ecece2172e10e547f159b03f5dd6f3045 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Mon, 6 Jan 2025 19:23:38 +0700 Subject: [PATCH 02/15] fixing text --- .../detail/PersonalInformation/DialogSortEducation.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/04_registryPerson/components/detail/PersonalInformation/DialogSortEducation.vue b/src/modules/04_registryPerson/components/detail/PersonalInformation/DialogSortEducation.vue index 2640159c3..f7ebcd39d 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/DialogSortEducation.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/DialogSortEducation.vue @@ -252,7 +252,7 @@ watch(modal, async () => { From 33e521facc389500b045857457bcbbadea5e6aa1 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 7 Jan 2025 10:38:24 +0700 Subject: [PATCH 03/15] =?UTF-8?q?fix=20=E0=B8=88=E0=B8=B1=E0=B8=94?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=A3=E0=B8=AD=E0=B8=9A=E0=B8=84?= =?UTF-8?q?=E0=B8=B1=E0=B8=94=E0=B9=80=E0=B8=A5=E0=B8=B7=E0=B8=AD=E0=B8=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/02_organizational/api.organization.ts | 7 +- .../views/02_qualify/PeriodAdd.vue | 284 ++++++++++++------ 2 files changed, 198 insertions(+), 93 deletions(-) diff --git a/src/api/02_organizational/api.organization.ts b/src/api/02_organizational/api.organization.ts index 19a34b306..91bc7790d 100644 --- a/src/api/02_organizational/api.organization.ts +++ b/src/api/02_organizational/api.organization.ts @@ -35,6 +35,8 @@ export default { orgPosPositionExecutive: () => `${orgPos}/position/executive`, orgPosExecutive: `${orgPos}/executive`, orgPosType: `${orgPos}/type`, + orgPosTypeSearch: `${orgPos}/position/search`, + orgPosTypeId: (id: string) => `${orgPos}/type/${id}`, orgPosLevel: `${orgPos}/level`, orgPosMaster: `${orgPos}/master`, @@ -66,7 +68,8 @@ export default { // ค้นหาคนตามเงื่อนไข orgSearchPersonal: () => `${organization}/profile/search-personal`, - orgSearchPersonalByType: (type:string) => `${organization}/profile${type}/search-personal`, + orgSearchPersonalByType: (type: string) => + `${organization}/profile${type}/search-personal`, /** บรรจุแต่งตั้ง*/ orgPosPlacement: `${orgPos}/placement/search`, @@ -158,5 +161,5 @@ export default { keycloakLogSSO: `${organization}/keycloak/log/sso`, - reportOrgByType:(type:string)=>`${reportOrg}/registry-${type}` + reportOrgByType: (type: string) => `${reportOrg}/registry-${type}`, }; diff --git a/src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue b/src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue index 79707be3d..81466990d 100644 --- a/src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue +++ b/src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue @@ -142,12 +142,13 @@ const columnsPosition = ref([ sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, + { - name: "position", + name: "highDegree", align: "left", - label: "ตำแหน่ง", + label: "ประเภทตำแหน่ง", sortable: true, - field: "position", + field: "highDegree", headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => @@ -165,16 +166,17 @@ const columnsPosition = ref([ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { - name: "highDegree", + name: "position", align: "left", - label: "ประเภทตำแหน่ง", + label: "ตำแหน่ง", sortable: true, - field: "highDegree", + field: "position", headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, + { name: "type", align: "left", @@ -358,18 +360,32 @@ async function fetchPositionLevel() { * @param update Function #quasar * @param refData เเยก case */ -function filterSelector(val: any, update: Function, refData: string) { +function filterSelector(val: string, update: Function, refData: string) { switch (refData) { - case "positionLevel": + case "positionLevel1": update(() => { - positionLevelOptions.value = positionLevelFilters.value.filter( + optionPosLevel1.value = filterOptionPosLevel1.value.filter( (v: DataOption2) => v.name.indexOf(val) > -1 ); }); break; - case "position": + case "positionLevel2": update(() => { - positionPathOptions.value = positionPathFilters.value.filter( + optionPosLevel2.value = filterOptionPosLevel2.value.filter( + (v: DataOption2) => v.name.indexOf(val) > -1 + ); + }); + break; + case "position1": + update(() => { + optionPosType1.value = filterOptionPosType1.value.filter( + (v: DataOption2) => v.name.indexOf(val) > -1 + ); + }); + break; + case "position2": + update(() => { + optionPosType2.value = filterOptionPosType2.value.filter( (v: DataOption2) => v.name.indexOf(val) > -1 ); }); @@ -495,16 +511,16 @@ async function editData(id: string) { showLoader(); await http .put(config.API.periodExamId(id), sendData()) - .then(async (res) => { - success($q, "แก้ไขรอบคัดเลือกสำเร็จ"); + .then(async () => { await uploadImgData(); await uploadDocData(); + success($q, "แก้ไขรอบคัดเลือกสำเร็จ"); await clickBack(); }) .catch((e) => { messageError($q, e); }) - .finally(async () => { + .finally(() => { hideLoader(); }); } @@ -656,7 +672,7 @@ function clickAddPosition() { position: null, type: { id: "normol", name: "ทั่วไป" }, code: null, - highDegree: "0", + highDegree: "", }); } }); @@ -704,6 +720,86 @@ function clearDateAnnounce() { dateAnnounce.value = null; } +const mainDataPosLevel = ref([]); +const optionPosLevel1 = ref([]); +const filterOptionPosLevel1 = ref([]); + +const optionPosLevel2 = ref([]); +const filterOptionPosLevel2 = ref([]); + +async function fetchPositionType() { + http + .get(config.API.orgPosType) + .then((res) => { + mainDataPosLevel.value = res.data.result.filter( + (e: any) => e.posTypeRank <= 2 + ); + + const getDataByRank = (rank: number) => { + const data = + res.data.result.find((e: any) => e.posTypeRank === rank)?.posLevels || + []; + return data + .filter((e: any) => e.posLevelRank === 1) + .map((e: any) => ({ + id: e.id.toString(), + name: e.posLevelName.toString(), + level: e.posLevelRank, + })); + }; + + optionPosLevel1.value = getDataByRank(1); + filterOptionPosLevel1.value = getDataByRank(1); + optionPosLevel2.value = getDataByRank(2); + filterOptionPosLevel2.value = getDataByRank(2); + + fetchPosition(1); + fetchPosition(2); + }) + .catch((err) => { + messageError($q, err); + }); +} + +const optionPosType1 = ref([]); +const filterOptionPosType1 = ref([]); + +const optionPosType2 = ref([]); +const filterOptionPosType2 = ref([]); + +function fetchPosition(level: number) { + http + .post(config.API.orgPosTypeSearch, { + posType: mainDataPosLevel.value.find((e: any) => e.posTypeRank === level) + .id, + posLevel: + level === 1 ? optionPosLevel1.value[0].id : optionPosLevel2.value[0].id, + }) + .then((res) => { + const option: DataOption2[] = res.data.result.map((r: any) => ({ + id: r.id.toString(), + name: r.positionName.toString(), + })); + + if (level === 1) { + optionPosType1.value = option; + filterOptionPosType1.value = option; + } else if (level === 2) { + optionPosType2.value = option; + filterOptionPosType2.value = option; + } + }) + .catch((err) => { + messageError($q, err); + }); +} + +function onUpdateHighDegree(val: string, index: string) { + rowsPosition.value[index].position = null; + rowsPosition.value[index].level = + val === "0" ? optionPosLevel1.value[0] : optionPosLevel2.value[0]; +} + watch(fee, () => { if (fee.value <= 0) { pay.value = ""; @@ -720,6 +816,7 @@ onMounted(async () => { pay.value = ""; edit.value = false; } + await fetchPositionType(); await fetchPositionPath(); await fetchPositionLevel(); }); @@ -1093,82 +1190,7 @@ onMounted(async () => { mask="###" /> - - - - - - - - - - - - + { color="teal" :disable="checkRoutePermisson" val="0" + @update:model-value=" + onUpdateHighDegree( + props.row.highDegree, + props.rowIndex + ) + " /> { color="teal" :disable="checkRoutePermisson" val="1" + @update:model-value=" + onUpdateHighDegree( + props.row.highDegree, + props.rowIndex + ) + " /> + + + + + + + + + + + + Date: Tue, 7 Jan 2025 11:07:24 +0700 Subject: [PATCH 04/15] =?UTF-8?q?API=20=E0=B8=88=E0=B8=B1=E0=B8=94?= =?UTF-8?q?=E0=B8=A5=E0=B8=B3=E0=B8=94=E0=B8=B1=E0=B8=9A=E0=B8=81=E0=B8=B2?= =?UTF-8?q?=E0=B8=A3=E0=B9=81=E0=B8=AA=E0=B8=94=E0=B8=87=E0=B8=9C=E0=B8=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/registry/api.registry.ts | 6 +- .../DialogSortEducation.vue | 74 +++++++++++++------ 2 files changed, 55 insertions(+), 25 deletions(-) diff --git a/src/api/registry/api.registry.ts b/src/api/registry/api.registry.ts index e72bd36d6..5cfa64f12 100644 --- a/src/api/registry/api.registry.ts +++ b/src/api/registry/api.registry.ts @@ -76,6 +76,9 @@ export default { // ประวัติการศึกษา profileNewEducation: (type: string) => `${registryNew}${type}/educations`, + profileNewEducationSort: (type: string) => + `${registryNew}${type}/educations/sort`, + profileNewEducationByProfileId: (profileId: string, type: string) => `${registryNew}${type}/educations/${profileId}`, profileNewEducationByEducationId: (educationId: string, type: string) => @@ -202,5 +205,6 @@ export default { developMentPlan: `${registryNew}/development`, - requestInformationbyType:(type:string,id:string)=>`${registryNew}/request-edit/${type}/${id}` + requestInformationbyType: (type: string, id: string) => + `${registryNew}/request-edit/${type}/${id}`, }; diff --git a/src/modules/04_registryPerson/components/detail/PersonalInformation/DialogSortEducation.vue b/src/modules/04_registryPerson/components/detail/PersonalInformation/DialogSortEducation.vue index f7ebcd39d..a2f95ebca 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/DialogSortEducation.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/DialogSortEducation.vue @@ -6,6 +6,7 @@ import http from "@/plugins/http"; import config from "@/app.config"; import { useCounterMixin } from "@/stores/mixin"; import { useOrganizational } from "@/modules/02_organization/store/organizational"; +import { useRoute } from "vue-router"; /** importType*/ import type { QTableProps } from "quasar"; @@ -18,6 +19,7 @@ import DialogHeader from "@/components/DialogHeader.vue"; /** use*/ const $q = useQuasar(); +const route = useRoute(); const store = useOrganizational(); const { dialogConfirm, @@ -34,21 +36,12 @@ const modal = defineModel("modal", { required: true }); const props = defineProps({ dataSort: Array as PropType, }); +const profileId = ref(route.params.id.toString()); //id profile /** ข้อมูล Table*/ const rows = ref([]); +const selected = ref([]); const columns = ref([ - { - name: "no", - align: "left", - label: "ลำดับ", - sortable: true, - field: "no", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, { name: "educationLevel", align: "left", @@ -234,16 +227,42 @@ const columns = ref([ */ function onDrop(from: number, to: number) { rows.value.splice(to, 0, rows.value.splice(from, 1)[0]); + selected.value.push(rows.value[0]); } /** function บันทึกการจัดลำดับ*/ function onSubmit() { - dialogConfirm($q, () => {}); + dialogConfirm($q, async () => { + showLoader(); + const body = rows.value.map((e: any) => ({ + id: e.id, + isUse: selected.value.some((i: any) => i.id === e.id), + })); + + await http + .put(config.API.profileNewEducationSort("") + `/${profileId.value}`, { + data: body, + }) + .then(async () => { + await success($q, "บันทึกข้อมูลสำเร็จ"); + modal.value = false; + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + }); + }); } watch(modal, async () => { if (modal.value && props.dataSort) { rows.value = props.dataSort; + selected.value.push(rows.value[0]); + } else { + selected.value = []; + rows.value = []; } }); @@ -277,26 +296,33 @@ watch(modal, async () => { hide-bottom hide-pagination hide-header + selection="multiple" + v-model:selected="selected" > +