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 6d4aebb50..228fcc9f3 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_Position.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_Position.vue @@ -25,6 +25,7 @@ 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(); @@ -63,7 +64,7 @@ const baseColumns = ref([ { name: "commandDateAffect", align: "left", - label: "วัน เดือน ปี", + label: "วันที่คำสั่งมีผล", sortable: true, field: "commandDateAffect", headerStyle: "font-size: 14px", @@ -74,49 +75,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", - 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: "posNo", align: "left", @@ -140,7 +98,7 @@ const baseColumns = ref([ { name: "positionName", align: "left", - label: "ตำแหน่ง", + label: empType.value === "-employee" ? "ตำแหน่ง" : "ตำแหน่งในสายงาน", sortable: true, field: "positionName", headerStyle: "font-size: 14px", @@ -153,7 +111,7 @@ const baseColumns = ref([ { name: "positionType", align: "left", - label: "ประเภทตำแหน่ง", + label: empType.value === "-employee" ? "กลุ่มงาน" : "ประเภทตำแหน่ง", sortable: true, field: "positionType", headerStyle: "font-size: 14px", @@ -166,7 +124,7 @@ const baseColumns = ref([ { name: "positionLevel", align: "left", - label: "ระดับ", + label: empType.value === "-employee" ? "ระดับชั้นงาน" : "ระดับ", sortable: true, field: "positionLevel", format(val, row) { @@ -184,16 +142,58 @@ const baseColumns = ref([ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { - name: "commandName", + name: "positionExecutive", align: "left", - label: "เอกสารอ้างอิง", + label: "ตำแหน่งทางการบริหาร", sortable: true, - field: "commandName", + field: "positionExecutive", headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => a.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", + // 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", @@ -210,6 +210,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", @@ -243,9 +288,12 @@ const visibleColumns = ref([ "positionName", "positionType", "positionLevel", + "positionExecutive", + "commandDateSign", "commandName", "refCommandNo", "remark", + "organization", ]); const pagination = ref({ sortBy: "", @@ -875,7 +923,7 @@ onMounted(async () => { > แก้ไขข้อมูล - { icon="mdi-arrow-up-bold" @click="onSwapUp(props.row.id)" > - + --> - { icon="mdi-arrow-down-bold" @click="onSwapDown(props.row.id)" > - + --> @@ -1124,7 +1172,7 @@ onMounted(async () => { -
+
( @@ -62,7 +63,7 @@ const baseColumns = ref([ { name: "commandDateAffect", align: "left", - label: "วัน เดือน ปี", + label: "วันที่คำสั่งมีผล", sortable: true, field: "commandDateAffect", headerStyle: "font-size: 14px", @@ -73,6 +74,83 @@ const baseColumns = ref([ .toString() .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, + { + name: "posNo", + align: "left", + label: "ตำแหน่งเลขที่", + sortable: true, + field: "posNo", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + format(val, row) { + return row.posNoAbb && row.posNo + ? `${row.posNoAbb}${row.posNo}` + : row.posNo + ? row.posNo + : "-"; + }, + sort: (a: string, b: string) => + a + .toString() + .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "positionName", + align: "left", + label: empType.value === "-employee" ? "ตำแหน่ง" : "ตำแหน่งในสายงาน", + sortable: true, + field: "positionName", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a + .toString() + .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "positionType", + align: "left", + label: empType.value === "-employee" ? "กลุ่มงาน" : "ประเภทตำแหน่ง", + sortable: true, + field: "positionType", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a + .toString() + .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "positionLevel", + align: "left", + label: empType.value === "-employee" ? "ระดับชั้นงาน" : "ระดับ", + sortable: true, + field: "positionLevel", + format(val, row) { + return `${ + row.positionLevel + ? row.positionLevel + : row.positionCee + ? row.positionCee + : "-" + }`; + }, + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "positionExecutive", + align: "left", + label: "ตำแหน่งทางการบริหาร", + sortable: true, + field: "positionExecutive", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, { name: "amount", align: "left", @@ -115,88 +193,6 @@ const baseColumns = ref([ .toString() .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, - - { - name: "posNo", - align: "left", - label: "ตำแหน่งเลขที่", - sortable: true, - field: "posNo", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format(val, row) { - return row.posNoAbb && row.posNo - ? `${row.posNoAbb}${row.posNo}` - : row.posNo - ? row.posNo - : "-"; - }, - sort: (a: string, b: string) => - a - .toString() - .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 - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "positionType", - align: "left", - label: "ประเภทตำแหน่ง", - sortable: true, - field: "positionType", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "positionLevel", - align: "left", - label: "ระดับ", - sortable: true, - field: "positionLevel", - format(val, row) { - return `${ - row.positionLevel - ? row.positionLevel - : row.positionCee - ? row.positionCee - : "-" - }`; - }, - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a - .toString() - .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 - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, { name: "refCommandNo", align: "left", @@ -210,11 +206,54 @@ const baseColumns = ref([ }, 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" }), + }, + { + 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", @@ -250,9 +289,12 @@ const visibleColumns = ref([ "positionName", "positionType", "positionLevel", + "positionExecutive", + "commandDateSign", "commandName", "refCommandNo", "remark", + "organization", ]); const pagination = ref({ sortBy: "", @@ -810,7 +852,7 @@ onMounted(() => { > แก้ไขข้อมูล - { icon="mdi-arrow-down-bold" @click="onSwapDown(props.row.id)" > - + --> @@ -1059,7 +1101,7 @@ onMounted(() => {
-
+