Merge branch 'develop' of github.com:Frappet/hrms-mgt into develop

* 'develop' of github.com:Frappet/hrms-mgt:
  fix: getColumnLabel  posNo
This commit is contained in:
Warunee Tamkoo 2026-02-25 10:41:18 +07:00
commit 1fa8f85226
8 changed files with 65 additions and 98 deletions

View file

@ -5,6 +5,7 @@ import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
import { getColumnLabel } from "@/utils/function";
import type { QTableProps } from "quasar";
@ -65,15 +66,6 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "actFullName",
align: "left",
label: "รักษาการแทน",
field: "actFullName",
sortable: true,
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const total = ref<number>(0);
@ -258,7 +250,9 @@ watch(modal, (val) => {
<q-tr :props="props">
<q-th auto-width />
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
<span class="text-weight-medium">
{{ getColumnLabel(col, isAct) }}
</span>
</q-th>
</q-tr>
</template>

View file

@ -184,7 +184,7 @@ const columns = ref<QTableProps["columns"]>([
},
]);
const columnsMember = ref<QTableProps["columns"]>([
const baseColumnsMember = ref<QTableProps["columns"]>([
{
name: "no",
align: "left",
@ -236,17 +236,20 @@ const columnsMember = ref<QTableProps["columns"]>([
}`;
},
},
{
name: "actFullName",
align: "left",
label: "รักษาการแทน",
sortable: true,
field: "actFullName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const columnsMember = computed(() => {
if (isAct.value) {
const actColumns = JSON.parse(JSON.stringify(baseColumnsMember.value));
const posNoCol = actColumns.find((col: any) => col.name === "posNo");
if (posNoCol) {
posNoCol.label = "เลขที่ตำแหน่ง (รักษาการแทน)";
}
return actColumns;
}
return baseColumnsMember.value;
});
/** เพิ่ม คณะกรรมการ */
function onAdd() {
modal.value = true;
@ -315,11 +318,6 @@ async function getPerson() {
.then(async (res) => {
const data = await res.data.result.data;
const dataTotal = await res.data.result.total;
// rowsDirector.value = data.filter(
// (item: MemBerType, index: number, self: any[]) =>
// index === self.findIndex((t: any) => t.id === item.id)
// );
rowsDirector.value = data.filter(
(item: MemBerType) =>
!rows.value.some((i: PersonsAppointData) => i.profileId == item.id)
@ -443,6 +441,7 @@ async function onDirector() {
await getPerson();
selected.value = [];
}
async function onAct() {
pagination.value.page = 1;
isDirector.value = false;
@ -725,22 +724,8 @@ onMounted(async () => {
:rows-per-page-options="[10, 25, 50, 100]"
@update:pagination="updatePagination"
>
<template v-slot:pagination="scope">
งหมด {{ total.toLocaleString() }} รายการ
<q-pagination
v-model="pagination.page"
active-color="primary"
color="dark"
:max="Number(totalList)"
size="sm"
boundary-links
direction-links
:max-pages="5"
@update:model-value="getPerson()"
></q-pagination>
</template>
<template v-slot:header-selection="scope"> </template>
<template v-slot:body="props">
<q-tr :props="props">
<td class="text-center">
@ -780,6 +765,21 @@ onMounted(async () => {
</q-td>
</q-tr>
</template>
<template v-slot:pagination="scope">
งหมด {{ total.toLocaleString() }} รายการ
<q-pagination
v-model="pagination.page"
active-color="primary"
color="dark"
:max="Number(totalList)"
size="sm"
boundary-links
direction-links
:max-pages="5"
@update:model-value="getPerson()"
></q-pagination>
</template>
</d-table>
</div>
</div>

View file

@ -6,6 +6,7 @@ import { useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
import { getColumnLabel } from "@/utils/function";
import type { QTableProps } from "quasar";
@ -83,16 +84,6 @@ const columns = ref<QTableProps["columns"]>([
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",
},
]);
function onCloseDialog() {
@ -232,7 +223,9 @@ watch(modal, (val) => {
:key="col.name"
:props="props"
>
<span class="text-weight-medium">{{ col.label }}</span>
<span class="text-weight-medium">
{{ getColumnLabel(col, isAct) }}</span
>
</q-th>
</q-tr>
</template>

View file

@ -4,7 +4,7 @@ import { useQuasar, type QTableProps } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { getColumnLabel } from "@/utils/function";
import { useCounterMixin } from "@/stores/mixin";
import DialogHeader from "@/components/DialogHeader.vue";
@ -78,15 +78,6 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "actFullName",
align: "left",
label: "รักษาการแทน",
field: "actFullName",
sortable: true,
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
function onSearchData() {
@ -315,7 +306,9 @@ watch(
:key="col.name"
:props="props"
>
<span class="text-weight-medium">{{ col.label }}</span>
<span class="text-weight-medium">{{
getColumnLabel(col, isAct)
}}</span>
</q-th>
</q-tr>
</template>

View file

@ -4,7 +4,7 @@ import { useQuasar, type QTableProps } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { getColumnLabel } from "@/utils/function";
import { useCounterMixin } from "@/stores/mixin";
import DialogHeader from "@/components/DialogHeader.vue";
@ -81,15 +81,6 @@ const columns = ref<QTableProps["columns"]>([
},
style: "font-size: 14px",
},
{
name: "actFullName",
align: "left",
label: "รักษาการแทน",
field: "actFullName",
sortable: true,
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
function onSearchData() {
@ -107,10 +98,6 @@ function getSearch() {
}
async function getData() {
// const url =
// props.type == "COMMANDER"
// ? config.API.workflowCommanderOperate
// : config.API.workflowCommanderSign;
showLoader();
await http
.put(config.API.workflowCommanderOperate, {
@ -324,7 +311,9 @@ watch(
:key="col.name"
:props="props"
>
<span class="text-weight-medium">{{ col.label }}</span>
<span class="text-weight-medium">{{
getColumnLabel(col, isAct)
}}</span>
</q-th>
</q-tr>
</template>

View file

@ -4,6 +4,7 @@ import { useQuasar, type QTableProps } from "quasar";
import { usePagination } from "@/composables/usePagination";
import { useCounterMixin } from "@/stores/mixin";
import { getColumnLabel } from "@/utils/function";
import http from "@/plugins/http";
import config from "@/app.config";
@ -64,15 +65,6 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "actFullName",
align: "left",
label: "รักษาการแทน",
field: "actFullName",
sortable: true,
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const roleName = ref<string>("");
@ -282,7 +274,7 @@ watch(modal, (newVal) => {
:key="col.name"
:props="props"
>
<span class="text-weight-medium">{{ col.label }}</span>
<span class="text-weight-medium">{{ getColumnLabel(col, isAct) }}</span>
</q-th>
</q-tr>
</template>

View file

@ -7,6 +7,7 @@ import { useRoute, useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useCommandDetail } from "@/modules/18_command/store/DetailStore";
import { usePagination } from "@/composables/usePagination";
import { getColumnLabel } from "@/utils/function";
import http from "@/plugins/http";
import config from "@/app.config";
@ -111,16 +112,6 @@ const columns = ref<QTableProps["columns"]>([
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",
},
]);
//
@ -776,7 +767,9 @@ onMounted(async () => {
:key="col.name"
:props="props"
>
<span class="text-weight-medium">{{ col.label }}</span>
<span class="text-weight-medium">{{
getColumnLabel(col, isAct)
}}</span>
</q-th>
</q-tr>
</template>

View file

@ -60,3 +60,16 @@ export function calculateAge(birthDate: Date | null) {
return `${years} ปี ${months} เดือน ${days} วัน`;
}
/**
*
* @param col
* @param isAct
* @returns
*/
export function getColumnLabel(col: any, isAct: boolean) {
if (col.name === "posNo" && isAct) {
return "เลขที่ตำแหน่ง (รักษาการแทน)";
}
return col.label;
}