diff --git a/src/modules/02_organization/components/DialogAddPosition.vue b/src/modules/02_organization/components/DialogAddPosition.vue index 4d49b690b..60af47d2b 100644 --- a/src/modules/02_organization/components/DialogAddPosition.vue +++ b/src/modules/02_organization/components/DialogAddPosition.vue @@ -48,16 +48,16 @@ const props = defineProps({ const isReadonly = ref(false); // อ่านได้อย่างเดียว -const dataLevel = ref([]); // ข้อมูลประเภทตำแหน่ง +const dataLevel = ref([]); // ข้อมูลตำแหน่งประเภท const posExecutive = ref(""); // ชื่อตำแหน่งทางการบริหาร const isSpecial = ref(false); // เฉพาะสายงานที่กำหนด const shape = ref("false"); // ตำแหน่งทางการบริหาร const isDisValidate = ref(false); -const typeOpsMain = ref([]); //ตัวเลือกประเภทตำแหน่ง +const typeOpsMain = ref([]); //ตัวเลือกตำแหน่งประเภท const levelOpsMain = ref([]); //ตัวเลือกระดับตำแหน่ง const executiveOpsMain = ref([]); //ตัวเลือกรายการตำแหน่งทางการบริหาร -const typeOps = ref([]); //ตัวเลือกประเภทตำแหน่ง +const typeOps = ref([]); //ตัวเลือกตำแหน่งประเภท const levelOps = ref([]); //ตัวเลือกระดับตำแหน่ง const executiveOps = ref([]); //ตัวเลือกรายการตำแหน่งทางการบริหาร const shapeOp = ref([ @@ -118,7 +118,7 @@ function saveSelectEdit() { ? { posDictName: formPositionSelect.positionName, posDictField: formPositionSelect.positionField, //สายงาน - posTypeId: formPositionSelect.positionType, //*ประเภทตำแหน่ง + posTypeId: formPositionSelect.positionType, //*ตำแหน่งประเภท posLevelId: formPositionSelect.positionLevel, //*ระดับตำแหน่ง posExecutiveId: dataExecutive ?? "", //ตำแหน่งทางการบริหาร posDictExecutiveField: @@ -129,7 +129,7 @@ function saveSelectEdit() { : { posDictName: formPositionSelect.positionName, posDictField: formPositionSelect.positionField, //สายงาน - posTypeId: formPositionSelect.positionType, //*ประเภทตำแหน่ง + posTypeId: formPositionSelect.positionType, //*ตำแหน่งประเภท posLevelId: formPositionSelect.positionLevel, //*ระดับตำแหน่ง posExecutive: dataExecutive ?? "", //ตำแหน่งทางการบริหาร posDictExecutiveField: formPositionSelect.positionExecutiveField, //ด้านทางการบริหาร @@ -176,7 +176,7 @@ function onSubmitSelectEdit() { ? { posDictName: formPositionSelect.positionName, posDictField: formPositionSelect.positionField, //สายงาน - posTypeId: formPositionSelect.positionType, //*ประเภทตำแหน่ง + posTypeId: formPositionSelect.positionType, //*ตำแหน่งประเภท posLevelId: formPositionSelect.positionLevel, //*ระดับตำแหน่ง posExecutiveId: dataExecutive ?? "", //ตำแหน่งทางการบริหาร posDictExecutiveField: formPositionSelect.positionExecutiveField, //ด้านทางการบริหาร @@ -186,7 +186,7 @@ function onSubmitSelectEdit() { : { posDictName: formPositionSelect.positionName, posDictField: formPositionSelect.positionField, //สายงาน - posTypeId: formPositionSelect.positionType, //*ประเภทตำแหน่ง + posTypeId: formPositionSelect.positionType, //*ตำแหน่งประเภท posLevelId: formPositionSelect.positionLevel, //*ระดับตำแหน่ง posExecutive: dataExecutive ?? "", //ตำแหน่งทางการบริหาร posDictExecutiveField: formPositionSelect.positionExecutiveField, //ด้านทางการบริหาร @@ -241,7 +241,7 @@ async function clearFormPositionSelect() { } /** - * ฟังก์เรียกข้อมูลรายการประเภทตำแหน่ง + * ฟังก์เรียกข้อมูลรายการตำแหน่งประเภท */ async function fetchType() { await http @@ -260,8 +260,8 @@ async function fetchType() { } /** - * ฟังก์ชันกำหนดตัวเลือกประเภทตำแหน่งตาม id ประเภทตำแหน่ง - * @param val id ประเภทตำแหน่ง + * ฟังก์ชันกำหนดตัวเลือกตำแหน่งประเภทตาม id ตำแหน่งประเภท + * @param val id ตำแหน่งประเภท */ async function updateSelectType(val: string) { // หาระดับตำแหน่ง @@ -320,7 +320,7 @@ function inputEdit(val: boolean) { /** * ดูการเปลี่ยนแปลงของ modal.value * - * ถ้าเป็น true ทำการเรียกข้อมูลรายการประเภทตำแหน่ง และ ข้อมูลรายการตำแหน่งทางการบริหาร + * ถ้าเป็น true ทำการเรียกข้อมูลรายการตำแหน่งประเภท และ ข้อมูลรายการตำแหน่งทางการบริหาร * และถ้ามี props.data จะกำหนด formPositionSelect เป็นตาม props.data */ watch( @@ -418,7 +418,7 @@ watch( diff --git a/src/modules/02_organization/components/DialogFormPosition.vue b/src/modules/02_organization/components/DialogFormPosition.vue index 3f410caf7..5786aed69 100644 --- a/src/modules/02_organization/components/DialogFormPosition.vue +++ b/src/modules/02_organization/components/DialogFormPosition.vue @@ -69,7 +69,7 @@ const type = ref("positionName"); //ประเภทค้นหา const optionFilter = ref([ { id: "positionName", name: "ตำแหน่งในสายงาน" }, { id: "positionField", name: "สายงาน" }, - { id: "positionType", name: "ประเภทตำแหน่ง" }, + { id: "positionType", name: "ตำแหน่งประเภท" }, { id: "positionLevel", name: "ระดับตำแหน่ง" }, { id: "positionExecutive", name: "ตำแหน่งทางการบริหาร" }, { id: "positionExecutiveField", name: "ด้านทางการบริหาร" }, @@ -252,7 +252,7 @@ function onSubmit() { const positionsData = rows.value.map((e: RowDetailPositions) => ({ posDictName: e.positionName, //ชื่อตำแหน่งในสายงาน (ชื่อตำแหน่ง) posDictField: e.positionField, //สายงาน - posTypeId: e.posTypeId, //*ประเภทตำแหน่ง + posTypeId: e.posTypeId, //*ตำแหน่งประเภท posLevelId: e.posLevelId, //*ระดับตำแหน่ง posExecutiveId: e.posExecutiveId ? e.posExecutiveId : "", //ตำแหน่งทางการบริหาร posDictExecutiveField: e.positionExecutiveField, //ด้านทางการบริหาร @@ -261,10 +261,10 @@ function onSubmit() { positionIsSelected: e.positionIsSelected, })); const body = { - posMasterNoPrefix: formData.prefixNo, //*Prefix นำหน้าตำแหน่งเลขที่ เป็น Optional (ไม่ใช่อักษรย่อของหน่วยงาน/ส่วนราชการ) - posMasterNo: Number(formData.positionNo), //*ตำแหน่งเลขที่ เป็นตัวเลข - posMasterNoSuffix: formData.suffixNo, //Suffix หลังตำแหน่งเลขที่ เช่น ช. - reason: formData.reason, //Suffix หลังตำแหน่งเลขที่ เช่น ช. + posMasterNoPrefix: formData.prefixNo, //*Prefix นำหน้าเลขที่ตำแหน่ง เป็น Optional (ไม่ใช่อักษรย่อของหน่วยงาน/ส่วนราชการ) + posMasterNo: Number(formData.positionNo), //*เลขที่ตำแหน่ง เป็นตัวเลข + posMasterNoSuffix: formData.suffixNo, //Suffix หลังเลขที่ตำแหน่ง เช่น ช. + reason: formData.reason, //Suffix หลังเลขที่ตำแหน่ง เช่น ช. isDirector: formData.isDirector, // isStaff: formData.isStaff ? formData.isStaff : false, isStaff: false, @@ -554,11 +554,11 @@ watch( dense outlined for="#positionNo" - label="ตำแหน่งเลขที่" + label="เลขที่ตำแหน่ง" lazy-rules hide-bottom-space :rules="[ - (val:string) => !!val || `${'กรุณากรอกตำแหน่งเลขที่'}`, + (val:string) => !!val || `${'กรุณากรอกเลขที่ตำแหน่ง'}`, ]" mask="########################" /> @@ -570,7 +570,7 @@ watch( dense outlined for="#suffixNo" - label="Suffix ตำแหน่งเลขที่" + label="Suffix เลขที่ตำแหน่ง" /> diff --git a/src/modules/02_organization/components/DialogHistoryPos.vue b/src/modules/02_organization/components/DialogHistoryPos.vue index b0fb0fc32..f6b5164fe 100644 --- a/src/modules/02_organization/components/DialogHistoryPos.vue +++ b/src/modules/02_organization/components/DialogHistoryPos.vue @@ -72,7 +72,7 @@ const columns = ref([ { name: "posMasterNoPrefix", align: "left", - label: " Prefix ตำแหน่งเลขที่", + label: " Prefix เลขที่ตำแหน่ง", sortable: true, field: "posMasterNoPrefix", headerStyle: "font-size: 14px", @@ -83,7 +83,7 @@ const columns = ref([ { name: "posMasterNo", align: "left", - label: "ตำแหน่งเลขที่", + label: "เลขที่ตำแหน่ง", sortable: true, field: "posMasterNo", headerStyle: "font-size: 14px", @@ -96,7 +96,7 @@ const columns = ref([ { name: "posMasterNoSuffix", align: "left", - label: "Suffix ตำแหน่งเลขที่", + label: "Suffix เลขที่ตำแหน่ง", sortable: true, field: "posMasterNoSuffix", headerStyle: "font-size: 14px", @@ -118,7 +118,7 @@ const columns = ref([ { name: "posType", align: "left", - label: "ประเภทตำแหน่ง", + label: "ตำแหน่งประเภท", sortable: true, field: "posType", format(val, row) { diff --git a/src/modules/02_organization/components/DialogPositionDetail.vue b/src/modules/02_organization/components/DialogPositionDetail.vue index 38c3e3ad5..cba05d340 100644 --- a/src/modules/02_organization/components/DialogPositionDetail.vue +++ b/src/modules/02_organization/components/DialogPositionDetail.vue @@ -30,8 +30,8 @@ const prosp = defineProps({ /** formData*/ const formData = reactive({ - positionNo: "", //*ตำแหน่งเลขที่ - positionType: "", //*ประเภทตำแหน่ง + positionNo: "", //*เลขที่ตำแหน่ง + positionType: "", //*ตำแหน่งประเภท positionPathSide: "", //*ตำแหน่งในสายงาน positionLine: "", //*สายงาน positionSide: "", //*ด้าน/สาขา @@ -49,7 +49,7 @@ function close() { } /** - * callblack function ทำเมื่อเปิด popup set ตำแหน่งเลขที่ และสถานะตำแหน่ง + * callblack function ทำเมื่อเปิด popup set เลขที่ตำแหน่ง และสถานะตำแหน่ง */ watch( () => modal.value, @@ -93,7 +93,7 @@ watch(
-

ตำแหน่งเลขที่

+

เลขที่ตำแหน่ง

@@ -103,7 +103,7 @@ watch(
-

ประเภทตำแหน่ง

+

ตำแหน่งประเภท

diff --git a/src/modules/02_organization/components/DialogSelectPerson.vue b/src/modules/02_organization/components/DialogSelectPerson.vue index a7ddaf8d1..8c08e7def 100644 --- a/src/modules/02_organization/components/DialogSelectPerson.vue +++ b/src/modules/02_organization/components/DialogSelectPerson.vue @@ -67,20 +67,20 @@ const props = defineProps({ }); const isReadonly = ref(false); // อ่านได้อย่างเดียว -const typeOpsMain = ref([]); //ข้อมูลประเภทตำแหน่ง +const typeOpsMain = ref([]); //ข้อมูลตำแหน่งประเภท const levelOpsMain = ref([]); //ข้อมูลระดับตำแหน่ง -const typeOps = ref([]); //ตัวเลือกรายการประเภทตำแหน่ง +const typeOps = ref([]); //ตัวเลือกรายการตำแหน่งประเภท const levelOps = ref([]); //ตัวเลือกรายการระดับตำแหน่ง -const dataLevel = ref([]); //ข้อมูลประเภทตำแหน่ง +const dataLevel = ref([]); //ข้อมูลตำแหน่งประเภท const selected = ref([]); //เลือกตำแหน่ง const isSit = ref(false); //นั่งทับตำแหน่ง const formData = reactive({ - positionNo: "", //*ตำแหน่งเลขที่ - positionType: "", //*ตำแหน่งเลขที่ - positionLevel: "", //*ตำแหน่งเลขที่ - personal: "", //*ตำแหน่งเลขที่ - position: "", //*ตำแหน่งเลขที่ + positionNo: "", //*เลขที่ตำแหน่ง + positionType: "", //*เลขที่ตำแหน่ง + positionLevel: "", //*เลขที่ตำแหน่ง + personal: "", //*เลขที่ตำแหน่ง + position: "", //*เลขที่ตำแหน่ง status: "", }); @@ -228,7 +228,7 @@ const columnsResult = ref([ ]); /** - * function เรียกข้อมูลประเภทตำแหน่ง + * function เรียกข้อมูลตำแหน่งประเภท */ function fetchType() { showLoader(); @@ -321,7 +321,7 @@ const selectedProfile = ref([]); function searchData() { showLoader(); const reqBody = { - posTypeId: formData.positionType, // id ประเภทตำแหน่ง + posTypeId: formData.positionType, // id ตำแหน่งประเภท posLevelId: formData.positionLevel, // id ระดับตำแหน่ง position: formData.position, // ตำแหน่ง page: page.value, //*หน้า @@ -375,7 +375,7 @@ function clearForm() { } /** - * function เคลียร์ประเภทตำแหน่งและระดับตำแหน่ง + * function เคลียร์ตำแหน่งประเภทและระดับตำแหน่ง */ function clearPosition() { formData.positionType = ""; @@ -457,7 +457,7 @@ watch(
-

ตำแหน่งเลขที่

+

เลขที่ตำแหน่ง

{{ formData.positionNo }}

@@ -582,7 +582,7 @@ watch( ([ { name: "posMasterNo", align: "left", - label: "ตำแหน่งเลขที่", + label: "เลขที่ตำแหน่ง", sortable: true, field: "posMasterNo", headerStyle: "font-size: 14px", diff --git a/src/modules/02_organization/components/TableMain.vue b/src/modules/02_organization/components/TableMain.vue index bbae3e5e8..3dc19d0e7 100644 --- a/src/modules/02_organization/components/TableMain.vue +++ b/src/modules/02_organization/components/TableMain.vue @@ -159,7 +159,7 @@ const columns = ref([ { name: "posMasterNo", align: "left", - label: "ตำแหน่งเลขที่", + label: "เลขที่ตำแหน่ง", sortable: false, field: "posMasterNo", headerStyle: "font-size: 14px", @@ -177,7 +177,7 @@ const columns = ref([ { name: "posTypeName", align: "left", - label: "ประเภทตำแหน่ง", + label: "ตำแหน่งประเภท", sortable: false, field: "posTypeName", headerStyle: "font-size: 14px", diff --git a/src/modules/02_organization/interface/response/organizational.ts b/src/modules/02_organization/interface/response/organizational.ts index a8fbe6d01..dbcfe9d8e 100644 --- a/src/modules/02_organization/interface/response/organizational.ts +++ b/src/modules/02_organization/interface/response/organizational.ts @@ -81,8 +81,8 @@ interface Position { id: string; // id ตำแหน่ง positionName: string; // ชื่อตำแหน่งในสายงาน (ชื่อตำแหน่ง) positionField: string; // สายงาน - posTypeId: string; // ประเภทตำแหน่ง - posTypeName: string; // ประเภทตำแหน่ง + posTypeId: string; // ตำแหน่งประเภท + posTypeName: string; // ตำแหน่งประเภท posLevelId: string; // ระดับตำแหน่ง posLevelName: string; // ระดับตำแหน่ง posExecutiveId: string; // ตำแหน่งทางการบริหาร @@ -95,13 +95,13 @@ interface Position { interface PosMaster { id: string; // id อัตรากำลัง posmaster orgShortname: string; // อักษรย่อตำแหน่ง - posMasterNoPrefix: string; // Prefix นำหน้าตำแหน่งเลขที่ เป็น Optional (ไม่ใช่อักษรย่อของหน่วยงาน/ส่วนราชการ) - posMasterNo: number | string; // ตำแหน่งเลขที่ เป็นตัวเลข - posMasterNoSuffix: string | null; // Suffix หลังตำแหน่งเลขที่ เช่น ช. + posMasterNoPrefix: string; // Prefix นำหน้าเลขที่ตำแหน่ง เป็น Optional (ไม่ใช่อักษรย่อของหน่วยงาน/ส่วนราชการ) + posMasterNo: number | string; // เลขที่ตำแหน่ง เป็นตัวเลข + posMasterNoSuffix: string | null; // Suffix หลังเลขที่ตำแหน่ง เช่น ช. positionName: string; // ชื่อตำแหน่งในสายงาน (ชื่อตำแหน่ง) positionField: string; // สายงาน - posTypeId: string; // ประเภทตำแหน่ง - posTypeName: string; // ประเภทตำแหน่ง + posTypeId: string; // ตำแหน่งประเภท + posTypeName: string; // ตำแหน่งประเภท posLevelId: string; // ระดับตำแหน่ง posLevelName: string; // ระดับตำแหน่ง posExecutiveId: string; // ตำแหน่งทางการบริหาร @@ -124,8 +124,8 @@ interface Position2 { id: string; // id ตำแหน่ง positionName: string; // ชื่อตำแหน่งในสายงาน (ชื่อตำแหน่ง) positionField: string; // สายงาน - posTypeId: string; // ประเภทตำแหน่ง - posTypeName: string; // ประเภทตำแหน่ง + posTypeId: string; // ตำแหน่งประเภท + posTypeName: string; // ตำแหน่งประเภท posLevelId: string; // ระดับตำแหน่ง posLevelName: string; // ระดับตำแหน่ง posExecutiveId: string; // ตำแหน่งทางการบริหาร @@ -138,13 +138,13 @@ interface Position2 { interface PosMaster2 { id: string; // id อัตรากำลัง posmaster orgShortname: string; // อักษรย่อตำแหน่ง - posMasterNoPrefix: string; // Prefix นำหน้าตำแหน่งเลขที่ เป็น Optional (ไม่ใช่อักษรย่อของหน่วยงาน/ส่วนราชการ) - posMasterNo: number | string; // ตำแหน่งเลขที่ เป็นตัวเลข - posMasterNoSuffix: string | null; // Suffix หลังตำแหน่งเลขที่ เช่น ช. + posMasterNoPrefix: string; // Prefix นำหน้าเลขที่ตำแหน่ง เป็น Optional (ไม่ใช่อักษรย่อของหน่วยงาน/ส่วนราชการ) + posMasterNo: number | string; // เลขที่ตำแหน่ง เป็นตัวเลข + posMasterNoSuffix: string | null; // Suffix หลังเลขที่ตำแหน่ง เช่น ช. positionName: string; // ชื่อตำแหน่งในสายงาน (ชื่อตำแหน่ง) positionField: string; // สายงาน - posTypeId: string; // ประเภทตำแหน่ง - posTypeName: string; // ประเภทตำแหน่ง + posTypeId: string; // ตำแหน่งประเภท + posTypeName: string; // ตำแหน่งประเภท posLevelId: string; // ระดับตำแหน่ง posLevelName: string; // ระดับตำแหน่ง posExecutiveId: string; // ตำแหน่งทางการบริหาร @@ -165,9 +165,9 @@ interface HistoryPos { id: string; //id node orgShotName: string; //ชื่อย่อส่วนราชการ lastUpdatedAt: Date; //วันที่แก้ไข - posMasterNoPrefix: string; //Prefix นำหน้าตำแหน่งเลขที่ เป็น Optional (ไม่ใช่อักษรย่อของหน่วยงาน/ส่วนราชการ) - posMasterNo: number; //ตำแหน่งเลขที่ เป็นตัวเลข - posMasterNoSuffix: string; //Suffix หลังตำแหน่งเลขที่ เช่น ช. + posMasterNoPrefix: string; //Prefix นำหน้าเลขที่ตำแหน่ง เป็น Optional (ไม่ใช่อักษรย่อของหน่วยงาน/ส่วนราชการ) + posMasterNo: number; //เลขที่ตำแหน่ง เป็นตัวเลข + posMasterNoSuffix: string; //Suffix หลังเลขที่ตำแหน่ง เช่น ช. } interface SelectPerson { 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 d6befdc8e..7c1839ffd 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_Position.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_Position.vue @@ -71,10 +71,24 @@ const baseColumns = ref([ .toString() .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: "posNo", align: "left", - label: empType.value === "" ? "เลขที่ตำแหน่ง" : "ตำแหน่งเลขที่", + label: empType.value === "-employee" ? "ตำแหน่งเลขที่" : "เลขที่ตำแหน่ง", sortable: true, field: "posNo", headerStyle: "font-size: 14px", @@ -107,7 +121,7 @@ const baseColumns = ref([ { name: "positionType", align: "left", - label: empType.value === "-employee" ? "กลุ่มงาน" : "ประเภทตำแหน่ง", + label: empType.value === "-employee" ? "กลุ่มงาน" : "ตำแหน่งประเภท", sortable: true, field: "positionType", headerStyle: "font-size: 14px", @@ -148,28 +162,6 @@ const baseColumns = ref([ 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, row) { - return row.amount - ? `${row.amount.toLocaleString()}${ - row.amountSpecial !== 0 && row.amountSpecial - ? ` (${row.amountSpecial.toLocaleString()})` - : "" - }` - : "-"; - }, - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, { name: "commandNo", align: "left", @@ -194,26 +186,9 @@ const baseColumns = ref([ field: "commandCode", headerStyle: "font-size: 14px", style: "font-size: 14px", - format(val, row) { - return store.convertCommandCodeName(val); - }, 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", @@ -234,6 +209,28 @@ const baseColumns = ref([ 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, row) { + return row.amount + ? `${row.amount.toLocaleString()}${ + row.amountSpecial !== 0 && row.amountSpecial + ? ` (${row.amountSpecial.toLocaleString()})` + : "" + }` + : "-"; + }, + sort: (a: string, b: string) => + a + .toString() + .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, { name: "remark", align: "left", @@ -243,7 +240,9 @@ const baseColumns = ref([ 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: "lastUpdateFullName", @@ -298,12 +297,23 @@ const modalCommand = ref(false); const command = ref(""); const commandId = ref(""); -const columns = ref( - baseColumns.value.filter( +const columns = computed(() => { + if (empType.value === "-employee") { + if (baseColumns.value) { + return baseColumns.value.filter( + (column) => + column.name !== "positionExecutive" && + column.name !== "lastUpdateFullName" && + column.name !== "lastUpdatedAt" + ); + } + } + return baseColumns.value.filter( (e: QTableColumn) => e.name !== "lastUpdateFullName" && e.name !== "lastUpdatedAt" - ) -); + ); +}); + const visibleColumns = ref( baseVisibleColumns.value.filter( (e: string) => e !== "lastUpdateFullName" && e !== "lastUpdatedAt" @@ -339,7 +349,16 @@ const formData = reactive({ remark: "", //หมายเหตุ }); -const columnsHistory = ref(baseColumns.value); +const columnsHistory = computed(() => { + if (empType.value === "-employee") { + if (baseColumns.value) { + return baseColumns.value.filter( + (column) => column.name !== "positionExecutive" + ); + } + } + return baseColumns.value; +}); const visibleColumnsHistory = ref(baseVisibleColumns.value); const modalDialogSalary = ref(false); //แสดง popup ตำแหน่งเงินเดือน diff --git a/src/modules/04_registryPerson/components/detail/Salary/01_PositionSalary.vue b/src/modules/04_registryPerson/components/detail/Salary/01_PositionSalary.vue index c8cd9b208..ee942abfc 100644 --- a/src/modules/04_registryPerson/components/detail/Salary/01_PositionSalary.vue +++ b/src/modules/04_registryPerson/components/detail/Salary/01_PositionSalary.vue @@ -76,10 +76,24 @@ const baseColumns = ref([ .toString() .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: "posNo", align: "left", - label: empType.value === "" ? "เลขที่ตำแหน่ง" : "ตำแหน่งเลขที่", + label: empType.value === "-employee" ? "ตำแหน่งเลขที่" : "เลขที่ตำแหน่ง", sortable: true, field: "posNo", headerStyle: "font-size: 14px", @@ -112,7 +126,7 @@ const baseColumns = ref([ { name: "positionType", align: "left", - label: empType.value === "-employee" ? "กลุ่มงาน" : "ประเภทตำแหน่ง", + label: empType.value === "-employee" ? "กลุ่มงาน" : "ตำแหน่งประเภท", sortable: true, field: "positionType", headerStyle: "font-size: 14px", @@ -153,56 +167,6 @@ const baseColumns = ref([ 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, row) { - return row.amount - ? `${row.amount.toLocaleString()}${ - row.amountSpecial !== 0 && row.amountSpecial - ? ` (${row.amountSpecial.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: "commandNo", align: "left", @@ -227,27 +191,9 @@ const baseColumns = ref([ field: "commandCode", headerStyle: "font-size: 14px", style: "font-size: 14px", - format(val, row) { - return store.convertCommandCodeName(val); - }, - 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", @@ -268,6 +214,57 @@ const baseColumns = ref([ 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, row) { + return row.amount + ? `${row.amount.toLocaleString()}${ + row.amountSpecial !== 0 && row.amountSpecial + ? ` (${row.amountSpecial.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: "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: "remark", align: "left", diff --git a/src/modules/04_registryPerson/router.ts b/src/modules/04_registryPerson/router.ts index 1e4dddb10..a509ac585 100644 --- a/src/modules/04_registryPerson/router.ts +++ b/src/modules/04_registryPerson/router.ts @@ -17,6 +17,12 @@ const Page01_Detail = () => "@/modules/04_registryPerson/components/requestEdit/Page01_Detail.vue" ); +// edit +const EditListPage = () => + import("@/modules/04_registryPerson/views/edit/list.vue"); +const EditListSalaryPage = () => + import("@/modules/04_registryPerson/views/edit/salary.vue"); + export default [ { path: "/registry-officer", @@ -120,4 +126,25 @@ export default [ Role: "STAFF", }, }, + // edit registry + { + path: "/registry/edit/list", + name: "registryEdit", + component: EditListPage, + meta: { + Auth: true, + Key: "SYS_REGISTRY_EDIT", + Role: "STAFF", + }, + }, + { + path: "/registry/edit/salary/:id", + name: "registryEditSalary", + component: EditListSalaryPage, + meta: { + Auth: true, + Key: "SYS_REGISTRY_EDIT", + Role: "STAFF", + }, + }, ]; diff --git a/src/modules/04_registryPerson/views/edit/list.vue b/src/modules/04_registryPerson/views/edit/list.vue new file mode 100644 index 000000000..e0b2d52a9 --- /dev/null +++ b/src/modules/04_registryPerson/views/edit/list.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/src/modules/04_registryPerson/views/edit/salary.vue b/src/modules/04_registryPerson/views/edit/salary.vue new file mode 100644 index 000000000..a5207b19d --- /dev/null +++ b/src/modules/04_registryPerson/views/edit/salary.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/src/modules/17_acting/views/main.vue b/src/modules/17_acting/views/main.vue index 1fca0f075..a04bac858 100644 --- a/src/modules/17_acting/views/main.vue +++ b/src/modules/17_acting/views/main.vue @@ -118,7 +118,7 @@ const columns = ref([ { name: "posNo", align: "left", - label: "ตำแหน่งเลขที่", + label: "เลขที่ตำแหน่ง", sortable: false, field: "posNo", headerStyle: "font-size: 14px", diff --git a/src/modules/19_condition/view/Main.vue b/src/modules/19_condition/view/Main.vue index 2e78af69c..097a510f5 100644 --- a/src/modules/19_condition/view/Main.vue +++ b/src/modules/19_condition/view/Main.vue @@ -83,7 +83,7 @@ const columns = ref([ { name: "profilePostype", align: "left", - label: "ประเภทตำแหน่ง", + label: "ตำแหน่งประเภท", sortable: false, field: "profilePostype", headerStyle: "font-size: 14px",