diff --git a/src/components/Workflow/DialogSelectPerson.vue b/src/components/Workflow/DialogSelectPerson.vue index f3a0dd922..529e0d71e 100644 --- a/src/components/Workflow/DialogSelectPerson.vue +++ b/src/components/Workflow/DialogSelectPerson.vue @@ -36,15 +36,6 @@ const rejectName = computed(() => const selected = ref([]); const rows = ref([]); const columns = ref([ - { - name: "posNo", - align: "left", - label: "เลขที่ตำแหน่ง", - sortable: true, - field: "posNo", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, { name: "fullName", align: "left", @@ -58,11 +49,20 @@ const columns = ref([ style: "font-size: 14px", }, { - name: "posExecutiveName", + name: "posNo", align: "left", - label: "ตำแหน่งทางการบริหาร", + label: "เลขที่ตำแหน่ง", sortable: true, - field: "posExecutiveName", + field: "posNo", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "positionSign", + align: "left", + label: "ตำแหน่งใต้ลายเซ็น", + sortable: true, + field: "positionSign", headerStyle: "font-size: 14px", style: "font-size: 14px", }, diff --git a/src/modules/05_placement/components/probation/FormAppoint/FormAppoint.vue b/src/modules/05_placement/components/probation/FormAppoint/FormAppoint.vue index 08de2bb3a..7e46ae3aa 100644 --- a/src/modules/05_placement/components/probation/FormAppoint/FormAppoint.vue +++ b/src/modules/05_placement/components/probation/FormAppoint/FormAppoint.vue @@ -103,14 +103,14 @@ const visibleColumns = ref([ "positionType", "actFullName", ]); -const visibleColumnsMember = ref([ - "no", +const visibleColumnsMemberBase = ref([ + // "no", "posNo", "name", "position", "posLevel", "posType", - "actFullName", + "positionSign", ]); /** หัวตาราง */ const columns = ref([ @@ -173,24 +173,33 @@ const columns = ref([ }`; }, }, - { - name: "actFullName", - align: "left", - label: "รักษาการแทน", - sortable: true, - field: "actFullName", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, + // { + // name: "actFullName", + // align: "left", + // label: "รักษาการแทน", + // sortable: true, + // field: "actFullName", + // headerStyle: "font-size: 14px", + // style: "font-size: 14px", + // }, ]); const baseColumnsMember = ref([ + // { + // name: "no", + // align: "left", + // label: "ลำดับ", + // sortable: false, + // field: "no", + // headerStyle: "font-size: 14px", + // style: "font-size: 14px", + // }, { - name: "no", + name: "name", align: "left", - label: "ลำดับ", - sortable: false, - field: "no", + label: "ชื่อ-นามสกุล", + sortable: true, + field: "name", headerStyle: "font-size: 14px", style: "font-size: 14px", }, @@ -203,16 +212,6 @@ const baseColumnsMember = ref([ headerStyle: "font-size: 14px", style: "font-size: 14px", }, - { - name: "name", - align: "left", - label: "ชื่อ-นามสกุล", - sortable: true, - field: "name", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { name: "position", align: "left", @@ -236,6 +235,15 @@ const baseColumnsMember = ref([ }`; }, }, + { + name: "positionSign", + align: "left", + label: "ตำแหน่งใต้ลายเซ็น", + sortable: true, + field: "positionSign", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, ]); const columnsMember = computed(() => { @@ -243,13 +251,20 @@ const columnsMember = computed(() => { const actColumns = JSON.parse(JSON.stringify(baseColumnsMember.value)); const posNoCol = actColumns.find((col: any) => col.name === "posNo"); if (posNoCol) { - posNoCol.label = "เลขที่ตำแหน่ง (รักษาการแทน)"; + posNoCol.label = "เลขที่ตำแหน่งรักษาการแทน"; } return actColumns; } return baseColumnsMember.value; }); +const visibleColumnsMember = computed(() => { + if (isAct.value || isDirector.value) { + return ["name", "posNo", "positionSign"]; + } + return ["name", "posNo", "position", "posLevel", "posType"]; +}); + /** เพิ่ม คณะกรรมการ */ function onAdd() { modal.value = true; diff --git a/src/modules/05_placement/components/probation/FormEvaluation/DialogSelectAuthority.vue b/src/modules/05_placement/components/probation/FormEvaluation/DialogSelectAuthority.vue index f0d1cb636..26e35a5cd 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/DialogSelectAuthority.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/DialogSelectAuthority.vue @@ -31,15 +31,15 @@ const pageSize = ref(10); const maxPaeg = ref(1); const total = ref(0); const columns = ref([ - { - name: "citizenId", - align: "left", - label: "เลขประจำตัวประชาชน", - sortable: true, - field: "citizenId", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, + // { + // name: "citizenId", + // align: "left", + // label: "เลขประจำตัวประชาชน", + // sortable: true, + // field: "citizenId", + // headerStyle: "font-size: 14px", + // style: "font-size: 14px", + // }, { name: "posNo", align: "left", @@ -86,6 +86,39 @@ const columns = ref([ }, ]); +const columnsAct = ref([ + { + name: "fullName", + align: "left", + label: "ชื่อ-นามสกุล", + sortable: true, + field: "fullName", + format(val, row) { + return `${row.prefix}${row.firstName} ${row.lastName}`; + }, + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "posNo", + align: "left", + label: "เลขที่ตำแหน่ง", + sortable: true, + field: "posNo", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "positionSign", + align: "left", + label: "ตำแหน่งใต้ลายเซ็น", + sortable: true, + field: "positionSign", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, +]); + function onCloseDialog() { modal.value = false; isAct.value = false; @@ -197,7 +230,7 @@ watch(modal, (val) => {
{ :props="props" >
- {{ col.value ?? "-" }} + {{ col.value ? col.value : "-" }}
diff --git a/src/modules/06_retirement/components/DialogAddCommander.vue b/src/modules/06_retirement/components/DialogAddCommander.vue index f988f3345..47e0a15bb 100644 --- a/src/modules/06_retirement/components/DialogAddCommander.vue +++ b/src/modules/06_retirement/components/DialogAddCommander.vue @@ -48,15 +48,6 @@ const pagination = ref({ const rows = ref([]); const columns = ref([ - { - name: "posNo", - align: "left", - label: "เลขที่ตำแหน่ง", - sortable: true, - field: "posNo", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, { name: "fullName", align: "left", @@ -70,11 +61,20 @@ const columns = ref([ style: "font-size: 14px", }, { - name: "posExecutiveName", + name: "posNo", align: "left", - label: "ตำแหน่งทางการบริหาร", + label: "เลขที่ตำแหน่ง", sortable: true, - field: "posExecutiveName", + field: "posNo", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "positionSign", + align: "left", + label: "ตำแหน่งใต้ลายเซ็น", + sortable: true, + field: "positionSign", headerStyle: "font-size: 14px", style: "font-size: 14px", }, @@ -127,60 +127,61 @@ async function getData() { } function onSubmit() { - if (selected.value.length !== 0) { - dialogConfirm($q, async () => { - if (props.keycloakUserId) { - const body = selected.value.map((items: any, index: any) => ({ - seq: index, - prefix: items.prefix, - firstName: items.firstName, - lastName: items.lastName, - positionName: items.position, - profileId: items.id, - keycloakId: items.keycloakId, - ...(items.posExecutiveName - ? { PositionExecutiveName: items.posExecutiveName } - : {}), - })); - showLoader(); - const profileSuffix = - (props.profileType?.toLocaleLowerCase() as string) === "officer" - ? "" - : "-employee"; + // if (selected.value.length !== 0) { + dialogConfirm($q, async () => { + if (props.keycloakUserId) { + const body = selected.value.map((items: any, index: any) => ({ + seq: index, + prefix: items.prefix, + firstName: items.firstName, + lastName: items.lastName, + positionName: items.position, + profileId: items.id, + keycloakId: items.keycloakId, + PositionExecutiveName: items.positionSign, + // ...(items.positionSign + // ? { PositionExecutiveName: items.positionSign } + // : {}), + })); + showLoader(); + const profileSuffix = + (props.profileType?.toLocaleLowerCase() as string) === "officer" + ? "" + : "-employee"; - const apiEndpoint = - routeName.value === "resignReject" || - routeName.value === "resignRejectEMP" - ? config.API.addResignCancel( - profileSuffix, - props.type?.toLocaleLowerCase() as string, - pageId.value - ) - : config.API.addResign( - profileSuffix, - props.type?.toLocaleLowerCase() as string, - pageId.value - ); - await http - .post(apiEndpoint, body) - .then(async () => { - await props.getData?.(pageId.value); - closeDialog(); - success($q, "บันทึกสำเร็จ"); - }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - hideLoader(); - }); - } else { - closeDialog(); - } - }); - } else { - dialogMessageNotify($q, "กรุณาเลือกอย่างน้อย 1 คน"); - } + const apiEndpoint = + routeName.value === "resignReject" || + routeName.value === "resignRejectEMP" + ? config.API.addResignCancel( + profileSuffix, + props.type?.toLocaleLowerCase() as string, + pageId.value + ) + : config.API.addResign( + profileSuffix, + props.type?.toLocaleLowerCase() as string, + pageId.value + ); + await http + .post(apiEndpoint, body) + .then(async () => { + await props.getData?.(pageId.value); + closeDialog(); + success($q, "บันทึกสำเร็จ"); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); + } else { + closeDialog(); + } + }); + // } else { + // dialogMessageNotify($q, "กรุณาเลือกอย่างน้อย 1 คน"); + // } } function closeDialog() { diff --git a/src/modules/09_leave/components/05_Leave/Dialog/DialogAddCommander.vue b/src/modules/09_leave/components/05_Leave/Dialog/DialogAddCommander.vue index 1382174e9..c3eac2353 100644 --- a/src/modules/09_leave/components/05_Leave/Dialog/DialogAddCommander.vue +++ b/src/modules/09_leave/components/05_Leave/Dialog/DialogAddCommander.vue @@ -48,15 +48,6 @@ const pagination = ref({ const rows = ref([]); const columns = ref([ - { - name: "posNo", - align: "left", - label: "เลขที่ตำแหน่ง", - sortable: true, - field: "posNo", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, { name: "fullName", align: "left", @@ -69,6 +60,15 @@ const columns = ref([ headerStyle: "font-size: 14px", style: "font-size: 14px", }, + { + name: "posNo", + align: "left", + label: "เลขที่ตำแหน่ง", + sortable: true, + field: "posNo", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, { name: "positionSign", align: "left", @@ -136,7 +136,7 @@ function onSubmit() { firstName: items.firstName ?? "", lastName: items.lastName ?? "", positionName: items.position ?? "", - positionSign: items.positionSign ?? items.posExecutiveName ?? "", + positionSign: items.positionSign, profileId: items.id, keycloakId: items.keycloakId, positionLeaveName: @@ -243,6 +243,7 @@ watch( v-model="isAct" label="แสดงเฉพาะรักษาการแทน" color="primary" + @update:model-value="onSearchData" > แสดงเฉพาะรักษาการแทน diff --git a/src/modules/18_command/components/Step/Dialog1_AddOperetor.vue b/src/modules/18_command/components/Step/Dialog1_AddOperetor.vue index 07dda6246..3084779b3 100644 --- a/src/modules/18_command/components/Step/Dialog1_AddOperetor.vue +++ b/src/modules/18_command/components/Step/Dialog1_AddOperetor.vue @@ -31,19 +31,10 @@ const rows = ref([]); const visibleColumns = ref([ "posNo", "fullName", - "posExecutiveName", - "actFullName", + "positionSign", + // "actFullName", ]); const columns = ref([ - { - name: "posNo", - align: "left", - label: "เลขที่ตำแหน่ง", - sortable: true, - field: "posNo", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, { name: "fullName", align: "left", @@ -57,11 +48,20 @@ const columns = ref([ style: "font-size: 14px", }, { - name: "posExecutiveName", + name: "posNo", align: "left", - label: "ตำแหน่งทางการบริหาร", + label: "เลขที่ตำแหน่ง", sortable: true, - field: "posExecutiveName", + field: "posNo", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "positionSign", + align: "left", + label: "ตำแหน่งใต้ลายเซ็น", + sortable: true, + field: "positionSign", headerStyle: "font-size: 14px", style: "font-size: 14px", }, @@ -95,7 +95,7 @@ function onSubmit() { posType: data.posType ?? "", posLevel: data.posLevel ?? "", position: data.position ?? "", - positionExecutive: data.posExecutiveName ?? "", + positionExecutive: data.positionSign ?? "", roleName: roleName.value.trim(), }; showLoader(); @@ -274,7 +274,9 @@ watch(modal, (newVal) => { :key="col.name" :props="props" > - {{ getColumnLabel(col, isAct) }} + {{ + getColumnLabel(col, isAct) + }} @@ -293,7 +295,7 @@ watch(modal, (newVal) => { :key="col.name" :props="props" > - {{ col.value ?? "-" }} + {{ col.value ? col.value : "-" }} diff --git a/src/modules/18_command/components/Step/View0_Digital.vue b/src/modules/18_command/components/Step/View0_Digital.vue index 42e00356f..8cc2469f8 100644 --- a/src/modules/18_command/components/Step/View0_Digital.vue +++ b/src/modules/18_command/components/Step/View0_Digital.vue @@ -59,25 +59,15 @@ const search = ref(""); const rows = ref([]); //รายชื่อผู้บังคับบัญชา/ผู้มีอำนาจออกคำสั่ง const selected = ref([]); //เลือกผู้บังคับบัญชา/ผู้มีอำนาจออกคำสั่ง const columns = ref([ - { - name: "citizenId", - align: "left", - label: "เลขประจำตัวประชาชน", - sortable: true, - field: "citizenId", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "posNo", - align: "left", - label: "เลขที่ตำแหน่ง", - sortable: true, - field: "posNo", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - + // { + // name: "citizenId", + // align: "left", + // label: "เลขประจำตัวประชาชน", + // sortable: true, + // field: "citizenId", + // headerStyle: "font-size: 14px", + // style: "font-size: 14px", + // }, { name: "firstName", align: "left", @@ -90,25 +80,42 @@ const columns = ref([ headerStyle: "font-size: 14px", style: "font-size: 14px", }, - { - name: "position", + name: "posNo", align: "left", - label: "ตำแหน่ง", + label: "เลขที่ตำแหน่ง", sortable: true, - field: "position", + field: "posNo", headerStyle: "font-size: 14px", style: "font-size: 14px", }, + // { + // name: "position", + // align: "left", + // label: "ตำแหน่ง", + // sortable: true, + // field: "position", + // headerStyle: "font-size: 14px", + // style: "font-size: 14px", + // }, + // { + // name: "posType", + // align: "left", + // label: "ประเภทตำแหน่ง", + // sortable: true, + // field: "posType", + // format(val, row) { + // return `${row.posType} ${row.posLevel ? `(${row.posLevel})` : ""} `; + // }, + // headerStyle: "font-size: 14px", + // style: "font-size: 14px", + // }, { - name: "posType", + name: "positionSign", align: "left", - label: "ประเภทตำแหน่ง", + label: "ตำแหน่งใต้ลายเซ็น", sortable: true, - field: "posType", - format(val, row) { - return `${row.posType} ${row.posLevel ? `(${row.posLevel})` : ""} `; - }, + field: "positionSign", headerStyle: "font-size: 14px", style: "font-size: 14px", }, @@ -790,7 +797,7 @@ onMounted(async () => { :props="props" >
- {{ col.value ?? "-" }} + {{ col.value ? col.value : "-" }}
diff --git a/src/modules/18_command/interface/response/Main.ts b/src/modules/18_command/interface/response/Main.ts index 344a956d8..91cdbcd37 100644 --- a/src/modules/18_command/interface/response/Main.ts +++ b/src/modules/18_command/interface/response/Main.ts @@ -119,6 +119,7 @@ interface DataOperators { profileId: string; roleName: string; posExecutiveName?: string; + positionSign?: string; } export type { diff --git a/src/utils/function.ts b/src/utils/function.ts index fb0320f5b..43d08e0b8 100644 --- a/src/utils/function.ts +++ b/src/utils/function.ts @@ -69,7 +69,7 @@ export function calculateAge(birthDate: Date | null) { */ export function getColumnLabel(col: any, isAct: boolean) { if (col.name === "posNo" && isAct) { - return `${col.label} (รักษาการแทน)`; + return `${col.label}รักษาการแทน`; } return col.label; }