fix: getColumnLabel label posNo
This commit is contained in:
parent
87257cd1bf
commit
710e9fe7b3
3 changed files with 20 additions and 12 deletions
|
|
@ -3,6 +3,7 @@ import { reactive, ref, watch, computed } from "vue";
|
|||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { getColumnLabel } from "@/utils/functions";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
|
|
@ -29,7 +30,7 @@ const props = defineProps({
|
|||
const rejectName = computed(() =>
|
||||
props.sysName && ["SYS_RESIGN", "SYS_RESIGN_EMP"].includes(props.sysName)
|
||||
? "ยับยั้ง"
|
||||
: "ไม่อนุมัติ"
|
||||
: "ไม่อนุมัติ",
|
||||
);
|
||||
|
||||
/** table*/
|
||||
|
|
@ -66,15 +67,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 pagination = ref<PropsTable.Pagination>({
|
||||
sortBy: "",
|
||||
|
|
@ -240,7 +232,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, formDataQuery.isAct)
|
||||
}}</span>
|
||||
</q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import config from "@/app.config";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useLeaveStore } from "@/modules/05_leave/store";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import { getColumnLabel } from "@/utils/functions";
|
||||
|
||||
import type { PropsTable } from "@/interface/PropsTable";
|
||||
import type { DataCommander } from "@/modules/05_leave/interface/response/main";
|
||||
|
|
@ -401,7 +402,7 @@ function getSearch() {
|
|||
: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>
|
||||
|
|
|
|||
|
|
@ -8,3 +8,16 @@ export function calculateFiscalYear(date: Date) {
|
|||
const month = date.getMonth() + 1;
|
||||
return month >= 10 ? date.getFullYear() + 1 : date.getFullYear();
|
||||
}
|
||||
|
||||
/**
|
||||
* คืนค่าชื่อคอลัมน์ตามเงื่อนไข
|
||||
* @param col คอลัมน์
|
||||
* @param isAct สถานะรักษาการแทน
|
||||
* @returns ชื่อคอลัมน์
|
||||
*/
|
||||
export function getColumnLabel(col: any, isAct: boolean) {
|
||||
if (col.name === "posNo" && isAct) {
|
||||
return `${col.label} (รักษาการแทน)`;
|
||||
}
|
||||
return col.label;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue