registy ==> ข้อมูลราชการ ตำแหน่งเงินเดือน

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-03-10 15:49:44 +07:00
parent 27a8fb4102
commit 27105c7bca
6 changed files with 926 additions and 715 deletions

View file

@ -4,16 +4,18 @@ import { useQuasar } from "quasar";
import { useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useGovernmentPosDataStore } from "@/modules/04_registryPerson/stores/Position";
import http from "@/plugins/http";
import config from "@/app.config";
import type { QTableProps } from "quasar";
import type { ResListSalary } from "@/modules/04_registryPerson/interface/response/Salary";
import type { DataPositions } from "@/modules/04_registryPerson/interface/response/Position";
import DialogHeader from "@/components/DialogHeader.vue";
const $q = useQuasar();
const route = useRoute();
const store = useGovernmentPosDataStore();
const {
date2Thai,
showLoader,
@ -30,8 +32,8 @@ const salaryId = defineModel<string>("salaryId", { required: true });
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
const rows = ref<ResListSalary[]>([]); //
const rowsMain = ref<ResListSalary[]>([]); //
const rows = ref<DataPositions[]>([]); //
const rowsMain = ref<DataPositions[]>([]); //
const keyword = ref<string>(""); //
const baseColumns = ref<QTableProps["columns"]>([
{
@ -58,7 +60,7 @@ const baseColumns = ref<QTableProps["columns"]>([
style: "font-size: 14px",
format(val, row) {
return row.posNoAbb && row.posNo
? `${row.posNoAbb}${row.posNo}`
? `${row.posNoAbb}.${row.posNo}`
: row.posNo
? row.posNo
: "-";
@ -133,46 +135,26 @@ const baseColumns = ref<QTableProps["columns"]>([
field: "amount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => Number(v).toLocaleString(),
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: "refCommandNo",
name: "commandNo",
align: "left",
label: "เลขที่คำสั่ง",
sortable: true,
field: "refCommandNo",
field: "commandNo",
format(val, row) {
return row.commandNo && row.commandYear
? `${row.commandNo}/${row.commandYear}`
@ -184,13 +166,16 @@ const baseColumns = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "commandName",
name: "commandCode",
align: "left",
label: "ประเภทคำสั่ง",
sortable: true,
field: "commandName",
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" }),
},
@ -239,22 +224,47 @@ const baseColumns = ref<QTableProps["columns"]>([
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "lastUpdateFullName",
align: "left",
label: "ผู้ดำเนินการ",
sortable: true,
field: "lastUpdateFullName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "lastUpdatedAt",
align: "left",
label: "วันที่แก้ไข",
sortable: true,
field: "lastUpdatedAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => date2Thai(v, false, true),
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
const visibleColumns = ref<string[]>([
"commandDateAffect",
"amount",
"positionSalaryAmount",
"mouthSalaryAmount",
"posNo",
"positionName",
"positionType",
"positionLevel",
"positionExecutive",
"amount",
"commandNo",
"commandCode",
"commandDateSign",
"commandName",
"refCommandNo",
"remark",
"organization",
"remark",
"lastUpdateFullName",
"lastUpdatedAt",
]);
@ -377,7 +387,10 @@ watch(
<template v-slot:body="props">
<q-tr :props="props">
<q-td v-for="col in props.cols">
<div class="table_ellipsis">
<div v-if="col.name == 'organization'" class="table_ellipsis">
{{ col.value ? col.value : "-" }}
</div>
<div v-else>
{{ col.value ? col.value : "-" }}
</div>
</q-td>