diff --git a/src/api/02_organizational/api.organization.ts b/src/api/02_organizational/api.organization.ts index 154dc1bee..b427099bc 100644 --- a/src/api/02_organizational/api.organization.ts +++ b/src/api/02_organizational/api.organization.ts @@ -80,4 +80,5 @@ export default { orgPosSortEmp: `${orgEmployeePos}/sort`, orgPosPositionEmpById: (id: string) => `${orgEmployeePos}/position/${id}`, orgPosMoveEmp: `${orgEmployeePos}/move`, + orgProfileEmp: `${orgEmployeePos}/profile`, }; diff --git a/src/modules/16_positionEmployee/components/DialogFormPosition.vue b/src/modules/16_positionEmployee/components/DialogFormPosition.vue index 6961595ca..a35c354e5 100644 --- a/src/modules/16_positionEmployee/components/DialogFormPosition.vue +++ b/src/modules/16_positionEmployee/components/DialogFormPosition.vue @@ -157,10 +157,15 @@ async function fetchPosition(id: string) { .get(config.API.orgPosPositionEmpById(id)) .then((res) => { const data = res.data.result; + formData.prefixNo = data.posMasterNoPrefix; formData.positionNo = data.posMasterNo; formData.suffixNo = data.posMasterNoSuffix; - rows.value = data.positions; + rows.value = data.positions.map((e: any) => ({ + ...e, + posDictName: e.positionName, + })); + console.log(rows.value); }) .catch((err) => { messageError($q, err); @@ -306,6 +311,8 @@ function deletePos(id: string) { function clearFormPositionSelect() { isDisValidate.value = true; + search.value = ""; + type.value = "positionName"; setTimeout(() => { isDisValidate.value = false; @@ -315,12 +322,12 @@ function clearFormPositionSelect() { function close() { props.close?.(); isPosition.value = false; + clearFormPositionSelect(); } async function emitSearch(keyword: string, typeSelect: string) { - search.value = await keyword; - type.value = await typeSelect; - + search.value = keyword; + type.value = typeSelect; await searchInput(); } diff --git a/src/modules/16_positionEmployee/components/DialogPositionDetail.vue b/src/modules/16_positionEmployee/components/DialogPositionDetail.vue index 2f4db32b4..1c2b1a596 100644 --- a/src/modules/16_positionEmployee/components/DialogPositionDetail.vue +++ b/src/modules/16_positionEmployee/components/DialogPositionDetail.vue @@ -1,28 +1,11 @@ @@ -177,146 +26,48 @@ watch( - + + + + + กลุ่มงาน + + + + {{ prosp?.dataDetailPos?.posTypeName }} + + + + + + + ตำแหน่ง + + + + {{ prosp?.dataDetailPos?.positionName }} + + + + + + + ระดับชั้นงาน + + + + {{ prosp?.dataDetailPos?.posLevelName }} + + diff --git a/src/modules/16_positionEmployee/components/DialogSelectPerson.vue b/src/modules/16_positionEmployee/components/DialogSelectPerson.vue index 99dc1566c..e50752290 100644 --- a/src/modules/16_positionEmployee/components/DialogSelectPerson.vue +++ b/src/modules/16_positionEmployee/components/DialogSelectPerson.vue @@ -99,25 +99,17 @@ const columns = ref([ { name: "positionName", align: "left", - label: "ตำแหน่งในสายงาน", + label: "ตำแหน่ง", sortable: true, field: "positionName", headerStyle: "font-size: 14px", style: "font-size: 14px", }, - { - name: "positionField", - align: "left", - label: "สายงาน", - sortable: true, - field: "positionField", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, + { name: "posTypeName", align: "left", - label: "ประเภทตำเเหน่ง", + label: "กลุ่มงาน", sortable: true, field: "posTypeName", headerStyle: "font-size: 14px", @@ -126,39 +118,12 @@ const columns = ref([ { name: "posLevelName", align: "left", - label: "ระดับตำแหน่ง", + label: "ระดับชั้นงาน", sortable: true, field: "posLevelName", headerStyle: "font-size: 14px", style: "font-size: 14px", }, - { - name: "posExecutiveName", - align: "left", - label: "ตำแหน่งทางการบริหาร", - sortable: true, - field: "posExecutiveName", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "positionExecutiveField", - align: "left", - label: "ด้านทางการบริหาร", - sortable: true, - field: "positionExecutiveField", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "positionArea", - align: "left", - label: "ด้าน/สาขา", - sortable: true, - field: "positionArea", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, ]); const columnsResult = ref([ { @@ -188,28 +153,29 @@ const columnsResult = ref([ headerStyle: "font-size: 14px", style: "font-size: 14px", }, - { - name: "posTypeName", - align: "left", - label: "ประเภทตำเเหน่ง", - sortable: true, - field: "posTypeName", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, { name: "positionName", align: "left", - label: "ตำแหน่งในสายงาน", + label: "ตำแหน่ง", sortable: true, field: "positionName", headerStyle: "font-size: 14px", style: "font-size: 14px", }, + { + name: "posTypeName", + align: "left", + label: "กลุ่มงาน", + sortable: true, + field: "posTypeName", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { name: "posLevelName", align: "left", - label: "ระดับตำแหน่ง", + label: "ระดับชั้นงาน", sortable: true, field: "posLevelName", headerStyle: "font-size: 14px", @@ -228,7 +194,7 @@ function close() { async function fetchType() { showLoader(); await http - .get(config.API.orgPosType) + .get(config.API.orgEmployeeType) .then((res) => { dataLevel.value = res.data.result; typeOpsMain.value = res.data.result.map((e: OptionType) => ({ @@ -291,7 +257,7 @@ function onSubmit() { }; showLoader(); http - .post(config.API.orgProfile, body) + .post(config.API.orgProfileEmp, body) .then(() => { props.fetchDataTable?.(store.treeId, store.level, false); props.getSummary(); @@ -543,7 +509,7 @@ watch([() => page.value, () => pageSize.value], () => { dense outlined for="#position" - label="ตำแหน่งในสายงาน" + label="ตำแหน่ง" lazy-rules hide-bottom-space /> @@ -552,7 +518,7 @@ watch([() => page.value, () => pageSize.value], () => { page.value, () => pageSize.value], () => { ("nodeTree", { default: [] }); diff --git a/src/modules/16_positionEmployee/components/TreeTable.vue b/src/modules/16_positionEmployee/components/TreeTable.vue index 9827327b7..322ab9c3f 100644 --- a/src/modules/16_positionEmployee/components/TreeTable.vue +++ b/src/modules/16_positionEmployee/components/TreeTable.vue @@ -137,7 +137,7 @@ const columns = ref([ { name: "positionName", align: "left", - label: "ตำแหน่งในสายงาน", + label: "ตำแหน่ง", field: "positionName", sortable: false, headerStyle: "font-size: 14px", @@ -146,7 +146,7 @@ const columns = ref([ { name: "posTypeName", align: "left", - label: "ประเภทตำแหน่ง", + label: "กลุ่มงาน", sortable: false, field: "posTypeName", headerStyle: "font-size: 14px", @@ -155,7 +155,7 @@ const columns = ref([ { name: "posLevelName", align: "left", - label: "ระดับตำแหน่ง", + label: "ระดับชั้นงาน", sortable: false, field: "posLevelName", headerStyle: "font-size: 14px", @@ -172,81 +172,6 @@ const columns = ref([ }, ]); -const columnsExpand = ref([ - { - name: "no", - align: "left", - label: "ลำดับ", - sortable: false, - field: "no", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "positionName", - align: "left", - label: "ตำแหน่งในสายงาน", - sortable: true, - field: "positionName", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "positionField", - align: "left", - label: "สายงาน", - sortable: true, - field: "positionField", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "posTypeName", - align: "left", - label: "ประเภทตำเเหน่ง", - sortable: true, - field: "posTypeName", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "posLevelName", - align: "left", - label: "ระดับตำแหน่ง", - sortable: true, - field: "posLevelName", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "posExecutiveName", - align: "left", - label: "ตำแหน่งทางการบริหาร", - sortable: true, - field: "posExecutiveName", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "positionExecutiveField", - align: "left", - label: "ด้านทางการบริหาร", - sortable: true, - field: "positionExecutiveField", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "positionArea", - align: "left", - label: "ด้าน/สาขา", - sortable: true, - field: "positionArea", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, -]); - const dialogPosition = ref(false); /** * function openPopup เพิ่มอัตรากำลัง @@ -462,7 +387,7 @@ async function onClickDownloadReport(val: string, name: string) { - ดาวน์โหลด - + --> @@ -544,17 +469,6 @@ async function onClickDownloadReport(val: string, name: string) { - {{ @@ -673,76 +587,6 @@ async function onClickDownloadReport(val: string, name: string) { - - { function fetchPosMaster(data: PosMaster[]) { const newPosMaster = data.map((e: PosMaster) => ({ ...e, - positionIsSelected: - typeOrganizational.value === "draft" && e.fullNameNextHolder !== null - ? e.fullNameNextHolder - : typeOrganizational.value !== "draft" && - e.fullNameCurrentHolder !== null - ? e.fullNameCurrentHolder - : "ว่าง", + positionIsSelected: e.fullNameCurrentHolder + ? e.fullNameCurrentHolder + : "ว่าง", posMasterNo: e.orgShortname + e.posMasterNoPrefix +
กลุ่มงาน
{{ prosp?.dataDetailPos?.posTypeName }}
ตำแหน่ง
{{ prosp?.dataDetailPos?.positionName }}
ระดับชั้นงาน
{{ prosp?.dataDetailPos?.posLevelName }}