diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_Position.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_Position.vue index 7bbc69e65..51f4051c9 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_Position.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_Position.vue @@ -26,7 +26,6 @@ import DialogHistory from "@/modules/04_registryPerson/components/detail/Governm import { useCounterMixin } from "@/stores/mixin"; import { useSalaryDataStore } from "@/modules/04_registryPerson/stores/salary"; import DialogPreviewCommand from "@/modules/18_command/components/DialogPreviewCommand.vue"; -const { findOrgName } = useCounterMixin(); const $q = useQuasar(); const route = useRoute(); @@ -50,6 +49,7 @@ const { pathRegistryEmp, onSearchDataTable, formatDatePosition, + findOrgName, } = useCounterMixin(); const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); @@ -561,13 +561,13 @@ function onSubmit() { !isStatusEdit.value && empType.value === "" ? profileId.value : undefined, - date: formDataSalary.date, // วันที่ + // date: formDataSalary.date, // วันที่ posNo: formDataSalary.posNo, //ตำแหน่งเลขที่ - position: formDataSalary.position, //ตำแหน่ง - positionLine: - empType.value === "" ? formDataSalary.positionLine : undefined, //สายงาน - positionPathSide: - empType.value === "" ? formDataSalary.positionPathSide : undefined, // ด้าน/สาขา + // position: formDataSalary.position, //ตำแหน่ง + // positionLine: + // empType.value === "" ? formDataSalary.positionLine : undefined, //สายงาน + // positionPathSide: + // empType.value === "" ? formDataSalary.positionPathSide : undefined, // ด้าน/สาขา positionExecutive: empType.value === "" ? formDataSalary.positionExecutive : undefined, //ตำแหน่งทางการบริหาร positionType: formDataSalary.positionType, // ประเภทตำแหน่ง @@ -588,8 +588,12 @@ function onSubmit() { typeof formDataSalary.amountSpecial === "number" ? formDataSalary.amountSpecial : Number(formDataSalary?.amountSpecial?.replace(/,/g, "")), //เงินค่าตอบแทนพิเศษ - refCommandNo: formDataSalary.refCommandNo, // เลขที่คำสั่ง - templateDoc: formDataSalary.doc, // เอกสารอ้างอิง + // refCommandNo: formDataSalary.refCommandNo, // เลขที่คำสั่ง + // templateDoc: formDataSalary.doc, // เอกสารอ้างอิง + posNoAbb: null, + positionName: "positionName", + remark: "remark", + commandCode: "1", }; try { diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_PositionHistory.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_PositionHistory.vue index efd42c67b..0cf7dba46 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_PositionHistory.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_PositionHistory.vue @@ -21,6 +21,7 @@ const { messageError, pathRegistryEmp, onSearchDataTable, + findOrgName, } = useCounterMixin(); /** props*/ @@ -36,7 +37,7 @@ const baseColumns = ref([ { name: "commandDateAffect", align: "left", - label: "วัน เดือน ปี", + label: "วันที่คำสั่งมีผล", sortable: true, field: "commandDateAffect", headerStyle: "font-size: 14px", @@ -47,70 +48,6 @@ const baseColumns = ref([ .toString() .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, - { - name: "amount", - align: "left", - label: empType.value === "-employee" ? "ค่าตอบแทนรายเดือน" : "เงินเดือน", - sortable: true, - field: "amount", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format: (v) => Number(v).toLocaleString(), - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "positionSalaryAmount", - align: "left", - label: "เงินประจำตำแหน่ง", - sortable: true, - field: "positionSalaryAmount", - headerStyle: "font-size: 14px", - format: (v) => Number(v).toLocaleString(), - style: "font-size: 14px", - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "mouthSalaryAmount", - align: "left", - label: "เงินค่าตอบแทนรายเดือน", - sortable: true, - field: "mouthSalaryAmount", - headerStyle: "font-size: 14px", - format: (v) => Number(v).toLocaleString(), - style: "font-size: 14px", - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "oc", - align: "left", - label: "สังกัด", - sortable: true, - field: "oc", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "positionName", - align: "left", - label: "ตำแหน่ง", - sortable: true, - field: "positionName", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, { name: "posNo", align: "left", @@ -127,45 +64,40 @@ const baseColumns = ref([ : "-"; }, sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + a + .toString() + .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { - name: "positionLine", + name: "positionName", align: "left", - label: "สายงาน", + label: empType.value === "-employee" ? "ตำแหน่ง" : "ตำแหน่งในสายงาน", sortable: true, - field: "positionLine", + field: "positionName", headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "positionPathSide", - align: "left", - label: "ด้าน/สาขา", - sortable: true, - field: "positionPathSide", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + a + .toString() + .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "positionType", align: "left", - label: "ตำแหน่งประเภท", + label: empType.value === "-employee" ? "กลุ่มงาน" : "ประเภทตำแหน่ง", sortable: true, field: "positionType", headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + a + .toString() + .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "positionLevel", align: "left", - label: "ระดับ", + label: empType.value === "-employee" ? "ระดับชั้นงาน" : "ระดับ", sortable: true, field: "positionLevel", format(val, row) { @@ -194,38 +126,47 @@ const baseColumns = ref([ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { - name: "positionExecutiveSide", + name: "amount", align: "left", - label: "ด้านทางการบริหาร", + label: empType.value === "-employee" ? "ค่าตอบแทนรายเดือน" : "เงินเดือน", sortable: true, - field: "positionExecutiveSide", + field: "amount", headerStyle: "font-size: 14px", style: "font-size: 14px", + format: (v) => Number(v).toLocaleString(), sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "salaryClass", - align: "left", - label: "ตำแหน่ง (รายละเอียด)", - sortable: true, - field: "salaryClass", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "commandName", - align: "left", - label: "เอกสารอ้างอิง", - sortable: true, - field: "commandName", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + a + .toString() + .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, + // { + // name: "positionSalaryAmount", + // align: "left", + // label: "เงินประจำตำแหน่ง", + // sortable: true, + // field: "positionSalaryAmount", + // headerStyle: "font-size: 14px", + // style: "font-size: 14px", + // format: (v) => Number(v).toLocaleString(), + // sort: (a: string, b: string) => + // a + // .toString() + // .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + // }, + // { + // name: "mouthSalaryAmount", + // align: "left", + // label: "เงินค่าตอบแทนรายเดือน", + // sortable: true, + // field: "mouthSalaryAmount", + // headerStyle: "font-size: 14px", + // style: "font-size: 14px", + // format: (v) => Number(v).toLocaleString(), + // sort: (a: string, b: string) => + // a + // .toString() + // .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + // }, { name: "refCommandNo", align: "left", @@ -242,6 +183,51 @@ const baseColumns = ref([ sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, + { + name: "commandName", + align: "left", + label: "ประเภทคำสั่ง", + sortable: true, + field: "commandName", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "commandDateSign", + align: "left", + label: "วันที่ลงนาม", + sortable: true, + field: "commandDateSign", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + format: (v) => date2Thai(v), + sort: (a: string, b: string) => + a + .toString() + .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "organization", + align: "left", + label: "สังกัด", + sortable: true, + field: "organization", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + format(val, row) { + return findOrgName({ + root: row.orgRoot, + child1: row.orgChild1, + child2: row.orgChild2, + child3: row.orgChild3, + child4: row.orgChild4, + }); + }, + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, { name: "remark", align: "left", @@ -253,48 +239,22 @@ const baseColumns = ref([ sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, - { - name: "lastUpdateFullName", - align: "left", - label: "ผู้ดำเนินการ", - sortable: true, - field: "lastUpdateFullName", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "lastUpdatedAt", - align: "left", - label: "วันที่แก้ไข", - sortable: true, - field: "lastUpdatedAt", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format: (v) => date2Thai(v, false, true), - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, ]); const visibleColumns = ref([ "commandDateAffect", "amount", "positionSalaryAmount", "mouthSalaryAmount", - "oc", - "positionName", "posNo", - "positionLine", - "positionPathSide", + "positionName", "positionType", "positionLevel", "positionExecutive", - "positionExecutiveSide", - "salaryClass", + "commandDateSign", "commandName", "refCommandNo", "remark", + "organization", "lastUpdateFullName", "lastUpdatedAt", ]); diff --git a/src/modules/04_registryPerson/views/listView.vue b/src/modules/04_registryPerson/views/listView.vue index a766b7f07..62cae82ab 100644 --- a/src/modules/04_registryPerson/views/listView.vue +++ b/src/modules/04_registryPerson/views/listView.vue @@ -1,12 +1,5 @@