2024-03-11 17:48:15 +07:00
|
|
|
<script setup lang="ts">
|
2024-07-05 17:49:04 +07:00
|
|
|
import { ref, reactive, onMounted, computed } from "vue";
|
2024-08-01 18:03:39 +07:00
|
|
|
import { checkPermission } from "@/utils/permissions";
|
|
|
|
|
|
2024-03-11 17:48:15 +07:00
|
|
|
import { useQuasar } from "quasar";
|
2024-03-25 11:10:53 +07:00
|
|
|
import { useRoute } from "vue-router";
|
|
|
|
|
import http from "@/plugins/http";
|
|
|
|
|
import config from "@/app.config";
|
2024-03-11 17:48:15 +07:00
|
|
|
|
2025-03-13 10:18:43 +07:00
|
|
|
import { useCounterMixin } from "@/stores/mixin";
|
|
|
|
|
import { useSalaryDataStore } from "@/modules/04_registryPerson/stores/salary";
|
|
|
|
|
|
2025-03-13 09:22:25 +07:00
|
|
|
import type { QTableColumn } from "quasar";
|
2024-03-27 13:51:34 +07:00
|
|
|
import type {
|
2025-03-11 11:11:31 +07:00
|
|
|
DataPositions,
|
|
|
|
|
DataCommandCode,
|
|
|
|
|
DataPosType,
|
|
|
|
|
DataPosLevel,
|
|
|
|
|
DataPosPosition,
|
|
|
|
|
DataPosExecutive,
|
|
|
|
|
} from "@/modules/04_registryPerson/interface/response/Position";
|
|
|
|
|
import type { DataOption } from "@/modules/04_registryPerson/interface/index/Main";
|
|
|
|
|
import type { FormSalary } from "@/modules/04_registryPerson/interface/request/Salary";
|
|
|
|
|
import type { ResListSalary } from "@/modules/04_registryPerson/interface/response/Salary";
|
2024-03-11 17:48:15 +07:00
|
|
|
|
|
|
|
|
import DialogHeader from "@/components/DialogHeader.vue";
|
2025-03-13 09:22:25 +07:00
|
|
|
import DialogHistory from "@/modules/04_registryPerson/components/detail/DialogHistory.vue";
|
2024-10-22 16:16:54 +07:00
|
|
|
import DialogPreviewCommand from "@/modules/18_command/components/DialogPreviewCommand.vue";
|
2024-03-11 17:48:15 +07:00
|
|
|
|
2025-03-04 14:32:02 +07:00
|
|
|
const { findOrgName } = useCounterMixin();
|
2024-03-11 17:48:15 +07:00
|
|
|
const $q = useQuasar();
|
2024-03-25 11:10:53 +07:00
|
|
|
const route = useRoute();
|
|
|
|
|
const profileId = ref<string>(
|
|
|
|
|
route.params.id ? route.params.id.toString() : ""
|
|
|
|
|
);
|
2024-08-13 11:22:48 +07:00
|
|
|
|
2024-12-04 15:15:36 +07:00
|
|
|
/** props*/
|
2024-11-04 15:21:23 +07:00
|
|
|
const isLeave = defineModel<boolean>("isLeave", {
|
|
|
|
|
required: true,
|
2024-10-21 17:56:47 +07:00
|
|
|
});
|
|
|
|
|
|
2024-03-11 17:48:15 +07:00
|
|
|
const store = useSalaryDataStore();
|
2024-03-25 11:10:53 +07:00
|
|
|
const {
|
|
|
|
|
date2Thai,
|
|
|
|
|
dialogConfirm,
|
|
|
|
|
showLoader,
|
|
|
|
|
hideLoader,
|
|
|
|
|
messageError,
|
|
|
|
|
success,
|
2024-08-13 11:22:48 +07:00
|
|
|
pathRegistryEmp,
|
2024-12-04 15:15:36 +07:00
|
|
|
onSearchDataTable,
|
2025-03-11 18:07:37 +07:00
|
|
|
convertDateToAPI,
|
2024-03-25 11:10:53 +07:00
|
|
|
} = useCounterMixin();
|
|
|
|
|
|
2024-08-13 11:22:48 +07:00
|
|
|
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
|
|
|
|
|
2024-09-18 17:24:21 +07:00
|
|
|
//Table
|
|
|
|
|
const rows = ref<ResListSalary[]>([]); //รายการตำแหน่งเงินเดือน
|
2024-12-04 15:15:36 +07:00
|
|
|
const rowsMain = ref<ResListSalary[]>([]); //รายการตำแหน่งเงินเดือน
|
2024-09-18 17:24:21 +07:00
|
|
|
const keyword = ref<string>(""); //คำค้นหา
|
2024-10-22 16:16:54 +07:00
|
|
|
const modalCommand = ref<boolean>(false);
|
|
|
|
|
const command = ref<string>("");
|
|
|
|
|
const commandId = ref<string>("");
|
2025-03-13 09:22:25 +07:00
|
|
|
const baseColumns = ref<QTableColumn[]>([
|
2024-03-11 17:48:15 +07:00
|
|
|
{
|
2025-02-24 11:52:58 +07:00
|
|
|
name: "commandDateAffect",
|
2024-03-11 17:48:15 +07:00
|
|
|
align: "left",
|
2025-03-04 14:32:02 +07:00
|
|
|
label: "วันที่คำสั่งมีผล",
|
2024-03-11 17:48:15 +07:00
|
|
|
sortable: true,
|
2025-02-24 11:52:58 +07:00
|
|
|
field: "commandDateAffect",
|
2024-03-11 17:48:15 +07:00
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
2024-03-27 13:51:34 +07:00
|
|
|
format: (v) => date2Thai(v),
|
2025-02-25 15:27:01 +07:00
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a
|
|
|
|
|
.toString()
|
|
|
|
|
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
2024-03-11 17:48:15 +07:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "posNo",
|
|
|
|
|
align: "left",
|
2025-03-17 16:01:02 +07:00
|
|
|
label: empType.value === "" ? "เลขที่ตำแหน่ง" : "ตำแหน่งเลขที่",
|
2024-03-11 17:48:15 +07:00
|
|
|
sortable: true,
|
|
|
|
|
field: "posNo",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
2025-02-24 14:11:50 +07:00
|
|
|
format(val, row) {
|
2025-02-24 16:12:25 +07:00
|
|
|
return row.posNoAbb && row.posNo
|
2025-03-11 23:41:41 +07:00
|
|
|
? `${row.posNoAbb}${row.posNo}`
|
2025-02-24 16:12:25 +07:00
|
|
|
: row.posNo
|
|
|
|
|
? row.posNo
|
|
|
|
|
: "-";
|
2025-02-24 14:11:50 +07:00
|
|
|
},
|
2025-02-25 15:27:01 +07:00
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a
|
|
|
|
|
.toString()
|
|
|
|
|
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
2024-03-11 17:48:15 +07:00
|
|
|
},
|
2025-01-24 14:38:21 +07:00
|
|
|
{
|
2025-02-24 11:52:58 +07:00
|
|
|
name: "positionName",
|
2025-01-24 14:38:21 +07:00
|
|
|
align: "left",
|
2025-03-04 14:32:02 +07:00
|
|
|
label: empType.value === "-employee" ? "ตำแหน่ง" : "ตำแหน่งในสายงาน",
|
2025-01-24 14:38:21 +07:00
|
|
|
sortable: true,
|
2025-02-24 11:52:58 +07:00
|
|
|
field: "positionName",
|
2025-01-24 14:38:21 +07:00
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
2025-02-25 15:27:01 +07:00
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a
|
|
|
|
|
.toString()
|
|
|
|
|
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
2025-01-24 14:38:21 +07:00
|
|
|
},
|
2024-03-11 17:48:15 +07:00
|
|
|
{
|
2024-03-27 17:16:17 +07:00
|
|
|
name: "positionType",
|
2024-03-11 17:48:15 +07:00
|
|
|
align: "left",
|
2025-03-04 14:32:02 +07:00
|
|
|
label: empType.value === "-employee" ? "กลุ่มงาน" : "ประเภทตำแหน่ง",
|
2024-03-11 17:48:15 +07:00
|
|
|
sortable: true,
|
2024-03-27 17:16:17 +07:00
|
|
|
field: "positionType",
|
2024-03-11 17:48:15 +07:00
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
2025-02-25 15:27:01 +07:00
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a
|
|
|
|
|
.toString()
|
|
|
|
|
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
2024-03-11 17:48:15 +07:00
|
|
|
},
|
|
|
|
|
{
|
2024-03-27 17:16:17 +07:00
|
|
|
name: "positionLevel",
|
2024-03-11 17:48:15 +07:00
|
|
|
align: "left",
|
2025-03-04 14:32:02 +07:00
|
|
|
label: empType.value === "-employee" ? "ระดับชั้นงาน" : "ระดับ",
|
2024-03-11 17:48:15 +07:00
|
|
|
sortable: true,
|
2024-03-27 17:16:17 +07:00
|
|
|
field: "positionLevel",
|
2025-02-24 11:52:58 +07:00
|
|
|
format(val, row) {
|
|
|
|
|
return `${
|
|
|
|
|
row.positionLevel
|
|
|
|
|
? row.positionLevel
|
|
|
|
|
: row.positionCee
|
|
|
|
|
? row.positionCee
|
|
|
|
|
: "-"
|
|
|
|
|
}`;
|
|
|
|
|
},
|
2024-03-11 17:48:15 +07:00
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
2025-03-04 14:32:02 +07:00
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "positionExecutive",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ตำแหน่งทางการบริหาร",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "positionExecutive",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "amount",
|
|
|
|
|
align: "left",
|
2025-03-19 09:45:48 +07:00
|
|
|
label: empType.value === "-employee" ? "ค่าจ้าง" : "เงินเดือน",
|
2025-03-04 14:32:02 +07:00
|
|
|
sortable: true,
|
|
|
|
|
field: "amount",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
2025-03-11 11:11:31 +07:00
|
|
|
format(v, row) {
|
|
|
|
|
return row.amount
|
|
|
|
|
? `${row.amount.toLocaleString()}${
|
|
|
|
|
row.amountSpecial !== 0 && row.amountSpecial
|
|
|
|
|
? ` (${row.amountSpecial.toLocaleString()})`
|
|
|
|
|
: ""
|
|
|
|
|
}`
|
|
|
|
|
: "-";
|
|
|
|
|
},
|
2025-02-25 15:27:01 +07:00
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a
|
|
|
|
|
.toString()
|
|
|
|
|
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
2024-03-11 17:48:15 +07:00
|
|
|
},
|
|
|
|
|
{
|
2025-03-04 14:32:02 +07:00
|
|
|
name: "positionSalaryAmount",
|
2024-03-11 17:48:15 +07:00
|
|
|
align: "left",
|
2025-03-04 14:32:02 +07:00
|
|
|
label: "เงินประจำตำแหน่ง",
|
2024-03-11 17:48:15 +07:00
|
|
|
sortable: true,
|
2025-03-04 14:32:02 +07:00
|
|
|
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",
|
2024-03-11 17:48:15 +07:00
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
2025-03-04 14:32:02 +07:00
|
|
|
format: (v) => Number(v).toLocaleString(),
|
2025-02-25 15:27:01 +07:00
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a
|
|
|
|
|
.toString()
|
|
|
|
|
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
2024-03-11 17:48:15 +07:00
|
|
|
},
|
|
|
|
|
{
|
2025-03-11 11:11:31 +07:00
|
|
|
name: "commandNo",
|
2024-03-11 17:48:15 +07:00
|
|
|
align: "left",
|
|
|
|
|
label: "เลขที่คำสั่ง",
|
|
|
|
|
sortable: true,
|
2025-03-11 11:11:31 +07:00
|
|
|
field: "commandNo",
|
2025-02-24 11:52:58 +07:00
|
|
|
format(val, row) {
|
|
|
|
|
return row.commandNo && row.commandYear
|
|
|
|
|
? `${row.commandNo}/${row.commandYear}`
|
|
|
|
|
: "";
|
|
|
|
|
},
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
2025-03-04 14:32:02 +07:00
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
|
|
|
},
|
|
|
|
|
{
|
2025-03-11 11:11:31 +07:00
|
|
|
name: "commandCode",
|
2025-03-04 14:32:02 +07:00
|
|
|
align: "left",
|
|
|
|
|
label: "ประเภทคำสั่ง",
|
|
|
|
|
sortable: true,
|
2025-03-11 11:11:31 +07:00
|
|
|
field: "commandCode",
|
2025-03-04 14:32:02 +07:00
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
2025-03-11 11:11:31 +07:00
|
|
|
format(val, row) {
|
|
|
|
|
return store.convertCommandCodeName(val);
|
|
|
|
|
},
|
|
|
|
|
|
2025-03-04 14:32:02 +07:00
|
|
|
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),
|
2025-02-25 15:27:01 +07:00
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a
|
|
|
|
|
.toString()
|
|
|
|
|
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
2025-02-24 11:52:58 +07:00
|
|
|
},
|
2025-03-04 14:32:02 +07:00
|
|
|
{
|
|
|
|
|
name: "organization",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "สังกัด",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "organization",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
format(val, row) {
|
|
|
|
|
return findOrgName({
|
|
|
|
|
root: row.orgRoot,
|
|
|
|
|
child1: row.orgChild1,
|
|
|
|
|
child2: row.orgChild2,
|
|
|
|
|
child3: row.orgChild3,
|
|
|
|
|
child4: row.orgChild4,
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
|
|
|
},
|
2025-02-24 11:52:58 +07:00
|
|
|
{
|
|
|
|
|
name: "remark",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "หมายเหตุ",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "remark",
|
2024-03-11 17:48:15 +07:00
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
2025-02-25 15:27:01 +07:00
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a
|
|
|
|
|
.toString()
|
|
|
|
|
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
2024-03-11 17:48:15 +07:00
|
|
|
},
|
2025-03-13 09:22:25 +07:00
|
|
|
{
|
|
|
|
|
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" }),
|
|
|
|
|
},
|
2024-03-11 17:48:15 +07:00
|
|
|
]);
|
2025-03-13 09:22:25 +07:00
|
|
|
const baseVisibleColumns = ref<string[]>([
|
2025-02-24 11:52:58 +07:00
|
|
|
"commandDateAffect",
|
2024-03-11 17:48:15 +07:00
|
|
|
"posNo",
|
2025-02-24 11:52:58 +07:00
|
|
|
"positionName",
|
2024-03-27 17:16:17 +07:00
|
|
|
"positionType",
|
|
|
|
|
"positionLevel",
|
2025-03-04 14:32:02 +07:00
|
|
|
"positionExecutive",
|
2025-03-11 11:11:31 +07:00
|
|
|
"amount",
|
|
|
|
|
"positionSalaryAmount",
|
|
|
|
|
"mouthSalaryAmount",
|
|
|
|
|
"commandNo",
|
|
|
|
|
"commandCode",
|
2025-03-04 14:32:02 +07:00
|
|
|
"commandDateSign",
|
|
|
|
|
"organization",
|
2025-03-11 11:11:31 +07:00
|
|
|
"remark",
|
2025-03-13 09:22:25 +07:00
|
|
|
"lastUpdateFullName",
|
|
|
|
|
"lastUpdatedAt",
|
2024-03-11 17:48:15 +07:00
|
|
|
]);
|
2025-03-13 09:22:25 +07:00
|
|
|
|
|
|
|
|
const columns = computed<QTableColumn[]>(() => {
|
|
|
|
|
if (empType.value === "-employee") {
|
|
|
|
|
if (baseColumns.value) {
|
|
|
|
|
return baseColumns.value.filter(
|
|
|
|
|
(column) =>
|
|
|
|
|
column.name !== "positionSalaryAmount" &&
|
|
|
|
|
column.name !== "mouthSalaryAmount"
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return baseColumns.value.filter(
|
2025-03-13 10:18:43 +07:00
|
|
|
(e: QTableColumn) =>
|
|
|
|
|
e.name !== "lastUpdateFullName" && e.name !== "lastUpdatedAd"
|
2025-03-13 09:22:25 +07:00
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
const visibleColumns = ref<string[]>(
|
|
|
|
|
baseVisibleColumns.value.filter(
|
|
|
|
|
(e: string) => e !== "lastUpdateFullName" && e !== "lastUpdatedAd"
|
|
|
|
|
)
|
|
|
|
|
);
|
2024-03-11 17:48:15 +07:00
|
|
|
const pagination = ref({
|
2025-02-25 15:27:01 +07:00
|
|
|
sortBy: "",
|
2024-03-11 17:48:15 +07:00
|
|
|
});
|
|
|
|
|
|
2025-03-13 09:22:25 +07:00
|
|
|
const columnsHistory = computed<QTableColumn[]>(() => {
|
|
|
|
|
if (empType.value === "-employee") {
|
|
|
|
|
if (baseColumns.value) {
|
|
|
|
|
return baseColumns.value.filter(
|
|
|
|
|
(column) =>
|
|
|
|
|
column.name !== "positionSalaryAmount" &&
|
|
|
|
|
column.name !== "mouthSalaryAmount"
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return baseColumns.value;
|
|
|
|
|
});
|
|
|
|
|
const visibleColumnsHistory = ref<string[]>(baseVisibleColumns.value);
|
|
|
|
|
|
2025-03-11 11:11:31 +07:00
|
|
|
const formData = reactive<FormSalary>({
|
|
|
|
|
commandCode: "", //ประเภทคำสั่ง
|
|
|
|
|
commandNo: "", //เลขที่คำสั่ง
|
|
|
|
|
commandYear: null, //ปี
|
|
|
|
|
commandDateAffect: null, //วันที่มีผล
|
|
|
|
|
commandDateSign: null, //วันที่ลงนาม
|
|
|
|
|
posNoAbb: "", //ตัวย่อเลขที่ตำแหน่ง
|
|
|
|
|
posNo: "", //เลขที่ตำแหน่ง
|
|
|
|
|
positionName: "", //ตำแหน่ง
|
|
|
|
|
positionType: "", //ประเภทตำแหน่ง | กลุ่มงาน
|
|
|
|
|
positionLevel: "", //ระดับตำแหน่ง | ระดับชั้นงาน
|
2025-03-11 18:07:37 +07:00
|
|
|
positionCee: "", //ตำแหน่งซี
|
2024-09-18 17:24:21 +07:00
|
|
|
positionLine: "", // สายงาน
|
|
|
|
|
positionPathSide: "", //ด้าน/สาขา
|
|
|
|
|
positionExecutive: "", //ตำแหน่งทางการบริหาร
|
2025-03-11 11:11:31 +07:00
|
|
|
amount: null, //เงินเดือน
|
2024-12-06 17:15:02 +07:00
|
|
|
amountSpecial: null, //เงินค่าตอบแทนพิเศษ
|
2025-03-11 11:11:31 +07:00
|
|
|
positionSalaryAmount: null, //เงินประจำตำแหน่ง
|
|
|
|
|
mouthSalaryAmount: null, //เงินค่าตอบแทนรายเดือน
|
|
|
|
|
orgRoot: "", //หน่วยงาน
|
|
|
|
|
orgChild1: "", //ส่วนราชการระดับ 1
|
|
|
|
|
orgChild2: "", //ส่วนราชการระดับ 2
|
|
|
|
|
orgChild3: "", //ส่วนราชการระดับ 3
|
|
|
|
|
orgChild4: "", //ส่วนราชการระดับ 4
|
|
|
|
|
remark: "", //หมายเหตุ
|
2024-03-11 17:48:15 +07:00
|
|
|
});
|
|
|
|
|
|
2024-09-18 17:24:21 +07:00
|
|
|
const modalDialogSalary = ref<boolean>(false); //แสดง popup ตำแหน่งเงินเดือน
|
|
|
|
|
const isStatusEdit = ref<boolean>(false); //สถานะแก้ไขข้อมูลตำแหน่งเงินเดือน
|
|
|
|
|
const salaryId = ref<string>(""); //id ที่ต้องการแก้ไข
|
2025-03-11 11:11:31 +07:00
|
|
|
const dataLevel = ref<DataPosType[]>([]); //รายการ ตำแหน่งเงินเดือน
|
2024-03-11 17:48:15 +07:00
|
|
|
|
2025-03-11 11:11:31 +07:00
|
|
|
const commandCodeOptions = ref<DataOption[]>(store.commandCodeData); //รายการปรเภทคำสั่ง
|
|
|
|
|
const posTypeOptions = ref<DataOption[]>(store.posTypeData); //รายการประเภทตำแหน่ง | กลุ่มงาน
|
|
|
|
|
const posLevelOptions = ref<DataOption[]>(store.posLevelData); //รายการระดับตำแหน่ง | ระดับชั้นงาน
|
|
|
|
|
const posLineOptions = ref<DataOption[]>(store.posLineData); //รายการสายงาน
|
|
|
|
|
const posPathSideOptions = ref<DataOption[]>(store.posPathSideData); //รายการด้าน/สาขา
|
|
|
|
|
const posExecutiveOptions = ref<DataOption[]>(store.posExecutiveData); //รายการตำแหน่งทางการบริหาร
|
2024-03-11 17:48:15 +07:00
|
|
|
|
2024-12-04 15:15:36 +07:00
|
|
|
/** function fetch รายการ ตำแหน่งเงินเดือน*/
|
2024-11-12 14:04:38 +07:00
|
|
|
async function fetchListSalary() {
|
2024-03-25 11:10:53 +07:00
|
|
|
showLoader();
|
2024-11-12 14:04:38 +07:00
|
|
|
await http
|
2024-05-14 16:05:58 +07:00
|
|
|
.get(config.API.profileListSalaryNew(profileId.value, empType.value))
|
2024-03-25 11:10:53 +07:00
|
|
|
.then((res) => {
|
|
|
|
|
rows.value = res.data.result;
|
2024-12-04 15:15:36 +07:00
|
|
|
rowsMain.value = res.data.result;
|
2024-03-25 11:10:53 +07:00
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
messageError($q, err);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
hideLoader();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-11 11:11:31 +07:00
|
|
|
/** function fetch ข้อมูลประเภทคำสั่ง*/
|
|
|
|
|
async function fetchDataCommandCode() {
|
|
|
|
|
if (store.commandCodeData.length > 0) return false;
|
|
|
|
|
await http
|
|
|
|
|
.get(config.API.orgCommandCode)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
const data = res.data.result;
|
|
|
|
|
const DataCommandCode = data.filter((e: DataCommandCode) =>
|
|
|
|
|
store.salaryCode.includes(e.code)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const options = DataCommandCode.map((e: DataCommandCode) => ({
|
|
|
|
|
id: e.code.toString(),
|
|
|
|
|
name: e.name,
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
store.commandCodeData = options;
|
|
|
|
|
commandCodeOptions.value = options;
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
messageError($q, err);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** function fetch ข้อมูลปรเภทตำแหน่งข้าราชการ */
|
|
|
|
|
async function fetchType() {
|
|
|
|
|
await http
|
2024-03-27 13:51:34 +07:00
|
|
|
.get(config.API.orgPosType)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
dataLevel.value = res.data.result;
|
2025-03-11 11:11:31 +07:00
|
|
|
store.posTypeData = res.data.result.map((e: DataPosType) => ({
|
|
|
|
|
id: e.id,
|
|
|
|
|
name: e.posTypeName,
|
|
|
|
|
}));
|
|
|
|
|
posTypeOptions.value = store.posTypeData;
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
messageError($q, err);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** function fetch ข้อมูลปรเภทตำแหน่งลูกจ้าง*/
|
|
|
|
|
async function fetchOptionGroup() {
|
|
|
|
|
await http
|
|
|
|
|
.get(config.API.orgEmployeeType)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
dataLevel.value = res.data.result;
|
|
|
|
|
store.posTypeData = res.data.result.map((e: DataPosType) => ({
|
2024-03-27 13:51:34 +07:00
|
|
|
id: e.id,
|
|
|
|
|
name: e.posTypeName,
|
|
|
|
|
}));
|
2025-03-11 11:11:31 +07:00
|
|
|
posTypeOptions.value = store.posTypeData;
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
messageError($q, err);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** function fetch ข้อมูลสายงาน*/
|
|
|
|
|
async function fetchDataOption() {
|
|
|
|
|
if (store.posLineData.length > 0 && store.posPathSideData.length > 0)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
await http
|
|
|
|
|
.get(config.API.orgPosPosition + `?keyword=&type=ALL`)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
const data = res.data.result;
|
|
|
|
|
|
|
|
|
|
const seen = new Set();
|
|
|
|
|
const seen2 = new Set();
|
|
|
|
|
|
|
|
|
|
const listPositionField = data.filter((item: DataPosPosition) => {
|
|
|
|
|
if (seen.has(item.positionField)) {
|
|
|
|
|
return false;
|
|
|
|
|
} else {
|
|
|
|
|
seen.add(item.positionField);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
store.posLineData = listPositionField.map((e: DataPosPosition) => ({
|
|
|
|
|
id: e.positionField,
|
|
|
|
|
name: e.positionField,
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
const listPositionArea = data.filter((item: DataPosPosition) => {
|
|
|
|
|
if (
|
|
|
|
|
item.positionArea === null ||
|
|
|
|
|
item.positionArea === "" ||
|
|
|
|
|
item.positionArea === "-" ||
|
|
|
|
|
seen2.has(item.positionArea)
|
|
|
|
|
) {
|
|
|
|
|
return false;
|
|
|
|
|
} else {
|
|
|
|
|
seen2.add(item.positionArea);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
store.posPathSideData = listPositionArea.map((e: DataPosPosition) => ({
|
|
|
|
|
id: e.positionArea,
|
|
|
|
|
name: e.positionArea,
|
|
|
|
|
}));
|
2024-03-27 13:51:34 +07:00
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
messageError($q, err);
|
|
|
|
|
});
|
|
|
|
|
}
|
2024-03-25 11:10:53 +07:00
|
|
|
|
2025-03-11 11:11:31 +07:00
|
|
|
/** function fetch ข้อมูลตำแหน่งข้อมูลทางการบริหาร*/
|
|
|
|
|
async function fetchDataOptionExecutive() {
|
|
|
|
|
await http
|
|
|
|
|
.get(config.API.orgPosExecutive)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
const data = res.data.result;
|
|
|
|
|
store.posExecutiveData = data.map((e: DataPosExecutive) => ({
|
|
|
|
|
id: e.posExecutiveName,
|
|
|
|
|
name: e.posExecutiveName,
|
|
|
|
|
}));
|
|
|
|
|
})
|
|
|
|
|
.catch((e) => {
|
|
|
|
|
messageError($q, e);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-16 15:35:15 +07:00
|
|
|
/**
|
|
|
|
|
* function เลือกประเภทตำแหน่ง
|
2025-03-11 11:11:31 +07:00
|
|
|
* @param val id ประเภทตำแหน่ง
|
|
|
|
|
* @param status แก่ไข , เพิ่ม
|
2024-08-16 15:35:15 +07:00
|
|
|
*/
|
2024-03-27 13:51:34 +07:00
|
|
|
async function updateSelectType(val: string, status: boolean = false) {
|
2025-03-11 18:07:37 +07:00
|
|
|
const listLevel = val
|
|
|
|
|
? dataLevel.value.find((e: DataPosType) => e.posTypeName === val)
|
|
|
|
|
: null;
|
2024-05-16 17:52:44 +07:00
|
|
|
|
2024-03-27 13:51:34 +07:00
|
|
|
if (listLevel) {
|
2025-03-11 11:11:31 +07:00
|
|
|
store.posLevelData = listLevel.posLevels.map((e: DataPosLevel) => ({
|
2024-03-27 13:51:34 +07:00
|
|
|
id: e.id,
|
2024-11-29 15:20:16 +07:00
|
|
|
name:
|
|
|
|
|
empType.value === ""
|
|
|
|
|
? e.posLevelName
|
|
|
|
|
: `${listLevel.posTypeShortName} ${e.posLevelName}`,
|
2024-03-27 13:51:34 +07:00
|
|
|
}));
|
2024-05-16 17:52:44 +07:00
|
|
|
|
2025-03-11 11:11:31 +07:00
|
|
|
formData.positionLevel = !status ? "" : formData.positionLevel;
|
2025-03-11 18:07:37 +07:00
|
|
|
} else {
|
|
|
|
|
store.posLevelData = [];
|
|
|
|
|
formData.positionLevel = "";
|
2024-03-27 13:51:34 +07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-16 15:35:15 +07:00
|
|
|
/**
|
|
|
|
|
* function เปิด dialog ตำแหน่งเงินเดือน
|
|
|
|
|
* @param statusEdit แก้ไข,เพิ่ม
|
|
|
|
|
* @param data
|
|
|
|
|
*/
|
2025-03-11 11:11:31 +07:00
|
|
|
async function onClickOpenDialog(
|
|
|
|
|
statusEdit: boolean = false,
|
|
|
|
|
data: DataPositions = {} as DataPositions
|
|
|
|
|
) {
|
|
|
|
|
showLoader();
|
2024-05-16 17:52:44 +07:00
|
|
|
if (empType.value === "") {
|
2025-03-11 11:11:31 +07:00
|
|
|
await Promise.all([
|
|
|
|
|
fetchType(),
|
|
|
|
|
fetchDataOption(),
|
|
|
|
|
fetchDataOptionExecutive(),
|
|
|
|
|
]);
|
2024-05-16 17:52:44 +07:00
|
|
|
} else {
|
2025-03-11 11:11:31 +07:00
|
|
|
await fetchOptionGroup();
|
2024-05-16 17:52:44 +07:00
|
|
|
}
|
2025-03-11 11:11:31 +07:00
|
|
|
commandCodeOptions.value = store.commandCodeData;
|
|
|
|
|
posTypeOptions.value = store.posTypeData;
|
|
|
|
|
posLevelOptions.value = store.posLevelData;
|
|
|
|
|
posLineOptions.value = store.posLineData;
|
|
|
|
|
posPathSideOptions.value = store.posPathSideData;
|
|
|
|
|
posExecutiveOptions.value = store.posExecutiveData;
|
2024-05-16 17:52:44 +07:00
|
|
|
|
2024-08-16 15:35:15 +07:00
|
|
|
// หาระดับตำแหน่ง
|
2025-03-11 11:11:31 +07:00
|
|
|
statusEdit && (await updateSelectType(data.positionType, true));
|
|
|
|
|
isStatusEdit.value = statusEdit;
|
2024-05-21 11:17:26 +07:00
|
|
|
|
2025-03-11 11:11:31 +07:00
|
|
|
store.posLevelData = !statusEdit ? [] : store.posLevelData;
|
2024-03-27 13:51:34 +07:00
|
|
|
modalDialogSalary.value = true;
|
|
|
|
|
salaryId.value = data.id;
|
2025-03-11 11:11:31 +07:00
|
|
|
formData.commandCode = statusEdit ? data.commandCode : "";
|
|
|
|
|
formData.commandNo = statusEdit ? data.commandNo : "";
|
|
|
|
|
formData.commandYear = statusEdit ? data.commandYear : null;
|
|
|
|
|
formData.commandDateAffect = statusEdit ? data.commandDateAffect : null;
|
|
|
|
|
formData.commandDateSign = statusEdit ? data.commandDateSign : null;
|
|
|
|
|
formData.posNoAbb = statusEdit ? data.posNoAbb : "";
|
|
|
|
|
formData.posNo = statusEdit ? data.posNo : "";
|
|
|
|
|
formData.positionName = statusEdit ? data.positionName : "";
|
|
|
|
|
formData.positionType = statusEdit ? data.positionType : "";
|
|
|
|
|
formData.positionLevel = statusEdit ? data.positionLevel : "";
|
2025-03-11 18:07:37 +07:00
|
|
|
formData.positionCee = statusEdit ? data.positionCee : "";
|
2025-03-11 11:11:31 +07:00
|
|
|
formData.positionLine = statusEdit ? data.positionLine : "";
|
|
|
|
|
formData.positionPathSide = statusEdit ? data.positionPathSide : "";
|
|
|
|
|
formData.positionExecutive = statusEdit ? data.positionExecutive : "";
|
|
|
|
|
formData.amount = statusEdit ? data.amount : null;
|
|
|
|
|
formData.amountSpecial = statusEdit ? data.amountSpecial : null;
|
|
|
|
|
formData.positionSalaryAmount = statusEdit ? data.positionSalaryAmount : null;
|
|
|
|
|
formData.mouthSalaryAmount = statusEdit ? data.mouthSalaryAmount : null;
|
|
|
|
|
formData.orgRoot = statusEdit ? data.orgRoot : "";
|
|
|
|
|
formData.orgChild1 = statusEdit ? data.orgChild1 : "";
|
|
|
|
|
formData.orgChild2 = statusEdit ? data.orgChild2 : "";
|
|
|
|
|
formData.orgChild3 = statusEdit ? data.orgChild3 : "";
|
|
|
|
|
formData.orgChild4 = statusEdit ? data.orgChild4 : "";
|
|
|
|
|
formData.remark = statusEdit ? data.remark : "";
|
|
|
|
|
hideLoader();
|
2024-03-11 17:48:15 +07:00
|
|
|
}
|
2024-03-25 11:10:53 +07:00
|
|
|
|
2024-12-04 15:15:36 +07:00
|
|
|
/** function ปิด dialog ตำแหน่งเงินเดือน*/
|
2024-03-12 11:14:52 +07:00
|
|
|
function onClickCloseDialog() {
|
2024-03-11 17:48:15 +07:00
|
|
|
modalDialogSalary.value = false;
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-11 11:11:31 +07:00
|
|
|
/** function ยืนยันการบันทึกข้อมูล */
|
|
|
|
|
function onSubmit() {
|
|
|
|
|
dialogConfirm($q, async () => {
|
|
|
|
|
showLoader();
|
|
|
|
|
try {
|
|
|
|
|
const url = isStatusEdit.value
|
|
|
|
|
? config.API.profileListSalaryNew(salaryId.value, empType.value)
|
|
|
|
|
: config.API.profileSalaryNew(empType.value);
|
|
|
|
|
const method = isStatusEdit.value ? "patch" : "post";
|
|
|
|
|
await http[method](url, {
|
|
|
|
|
profileEmployeeId:
|
|
|
|
|
!isStatusEdit.value && empType.value !== ""
|
|
|
|
|
? profileId.value
|
|
|
|
|
: undefined,
|
|
|
|
|
profileId:
|
|
|
|
|
!isStatusEdit.value && empType.value === ""
|
|
|
|
|
? profileId.value
|
|
|
|
|
: undefined,
|
|
|
|
|
...formData,
|
|
|
|
|
commandDateAffect: convertDateToAPI(formData.commandDateAffect),
|
|
|
|
|
commandDateSign: convertDateToAPI(formData.commandDateSign),
|
|
|
|
|
amount: Number(String(formData.amount)?.replace(/,/g, "")),
|
|
|
|
|
amountSpecial: Number(
|
|
|
|
|
String(formData.amountSpecial)?.replace(/,/g, "")
|
|
|
|
|
),
|
|
|
|
|
positionSalaryAmount: Number(
|
|
|
|
|
String(formData.positionSalaryAmount)?.replace(/,/g, "")
|
|
|
|
|
),
|
|
|
|
|
mouthSalaryAmount: Number(
|
|
|
|
|
String(formData.mouthSalaryAmount)?.replace(/,/g, "")
|
|
|
|
|
),
|
|
|
|
|
});
|
|
|
|
|
await fetchListSalary();
|
|
|
|
|
onClickCloseDialog();
|
|
|
|
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
|
|
|
|
} catch (e) {
|
|
|
|
|
messageError($q, e);
|
|
|
|
|
} finally {
|
|
|
|
|
hideLoader();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const modalHistory = ref<boolean>(false);
|
|
|
|
|
|
2024-08-16 15:35:15 +07:00
|
|
|
/**
|
|
|
|
|
* ฟิลเตอร์ข้อมูลจาก input
|
|
|
|
|
* @param val ค่าที่ป้อนให้ input
|
|
|
|
|
* @param update function จาก quasar
|
|
|
|
|
* @param filtername type ที่กำหนด ของ input นั้นๆ
|
|
|
|
|
*/
|
2024-09-18 17:24:21 +07:00
|
|
|
function filterSelector(val: string, update: Function, filtername: string) {
|
2024-03-11 17:48:15 +07:00
|
|
|
switch (filtername) {
|
2025-03-11 11:11:31 +07:00
|
|
|
case "commandCode":
|
2024-03-11 17:48:15 +07:00
|
|
|
update(() => {
|
2025-03-11 11:11:31 +07:00
|
|
|
commandCodeOptions.value = store.commandCodeData.filter(
|
2024-05-16 17:52:44 +07:00
|
|
|
(v: DataOption) => v.name.indexOf(val) > -1
|
2024-03-11 17:48:15 +07:00
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
break;
|
2025-03-11 11:11:31 +07:00
|
|
|
|
2024-03-11 17:48:15 +07:00
|
|
|
case "posType":
|
|
|
|
|
update(() => {
|
2025-03-11 11:11:31 +07:00
|
|
|
posTypeOptions.value = store.posTypeData.filter(
|
2024-03-27 13:51:34 +07:00
|
|
|
(v: DataOption) => v.name.indexOf(val) > -1
|
2024-03-11 17:48:15 +07:00
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
break;
|
2025-03-11 11:11:31 +07:00
|
|
|
|
2024-03-11 17:48:15 +07:00
|
|
|
case "posLevel":
|
|
|
|
|
update(() => {
|
2025-03-11 11:11:31 +07:00
|
|
|
posLevelOptions.value = store.posLevelData.filter(
|
2024-03-27 13:51:34 +07:00
|
|
|
(v: DataOption) => v.name.indexOf(val) > -1
|
2024-03-11 17:48:15 +07:00
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
break;
|
2025-03-11 11:11:31 +07:00
|
|
|
|
|
|
|
|
case "posLine":
|
2024-03-11 17:48:15 +07:00
|
|
|
update(() => {
|
2025-03-11 11:11:31 +07:00
|
|
|
posLineOptions.value = store.posLineData.filter(
|
|
|
|
|
(v: DataOption) => v.name.indexOf(val) > -1
|
2024-03-11 17:48:15 +07:00
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
break;
|
2025-03-11 11:11:31 +07:00
|
|
|
|
|
|
|
|
case "posPathSide":
|
2024-05-16 17:52:44 +07:00
|
|
|
update(() => {
|
2025-03-11 11:11:31 +07:00
|
|
|
posPathSideOptions.value = store.posPathSideData.filter(
|
2024-05-16 17:52:44 +07:00
|
|
|
(v: DataOption) => v.name.indexOf(val) > -1
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
break;
|
|
|
|
|
|
2025-03-11 11:11:31 +07:00
|
|
|
case "posExecutive":
|
2024-05-16 17:52:44 +07:00
|
|
|
update(() => {
|
2025-03-11 11:11:31 +07:00
|
|
|
posExecutiveOptions.value = store.posExecutiveData.filter(
|
2024-05-16 17:52:44 +07:00
|
|
|
(v: DataOption) => v.name.indexOf(val) > -1
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
break;
|
2024-03-11 17:48:15 +07:00
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
2024-03-25 11:10:53 +07:00
|
|
|
}
|
2024-08-16 15:35:15 +07:00
|
|
|
/**
|
|
|
|
|
* function ดูข้อมูลประวัติการแก้ไขรายการเงินเดือน
|
|
|
|
|
* @param id รายการเงินเดือน
|
|
|
|
|
*/
|
2024-03-27 13:51:34 +07:00
|
|
|
function onClikcHistory(id: string) {
|
|
|
|
|
salaryId.value = id;
|
2024-03-11 17:48:15 +07:00
|
|
|
modalHistory.value = true;
|
|
|
|
|
}
|
2024-03-25 11:10:53 +07:00
|
|
|
|
2025-03-13 09:22:25 +07:00
|
|
|
/** function fetch ข้อมูลประวัติการแก้ไข*/
|
|
|
|
|
async function fetchDataHistory() {
|
|
|
|
|
showLoader();
|
|
|
|
|
try {
|
|
|
|
|
const res = await http.get(
|
|
|
|
|
config.API.profileListSalaryHistoryNew(salaryId.value, empType.value)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return res.data.result;
|
|
|
|
|
} catch (err) {
|
|
|
|
|
messageError($q, err);
|
|
|
|
|
} finally {
|
|
|
|
|
hideLoader();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-11 11:11:31 +07:00
|
|
|
const classInput = (val: boolean) => {
|
|
|
|
|
return {
|
|
|
|
|
"full-width inputgreen cursor-pointer": val,
|
|
|
|
|
"full-width cursor-pointer": !val,
|
|
|
|
|
};
|
|
|
|
|
};
|
2024-05-16 17:52:44 +07:00
|
|
|
|
2025-03-11 11:11:31 +07:00
|
|
|
function onRefCommand(data: ResListSalary) {
|
|
|
|
|
modalCommand.value = true;
|
|
|
|
|
command.value = data.refCommandNo;
|
|
|
|
|
commandId.value = data.commandId;
|
|
|
|
|
}
|
2024-05-16 17:52:44 +07:00
|
|
|
|
2025-03-11 11:11:31 +07:00
|
|
|
function serchDataTable() {
|
|
|
|
|
rows.value = onSearchDataTable(
|
|
|
|
|
keyword.value,
|
|
|
|
|
rowsMain.value,
|
|
|
|
|
columns.value ? columns.value : []
|
|
|
|
|
);
|
2024-05-16 17:52:44 +07:00
|
|
|
}
|
|
|
|
|
|
2025-03-11 11:11:31 +07:00
|
|
|
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
|
|
|
|
|
onMounted(async () => {
|
2024-05-16 17:52:44 +07:00
|
|
|
showLoader();
|
2025-03-11 11:11:31 +07:00
|
|
|
try {
|
|
|
|
|
await Promise.all([fetchListSalary(), fetchDataCommandCode()]);
|
|
|
|
|
} finally {
|
|
|
|
|
hideLoader();
|
|
|
|
|
}
|
2024-09-18 17:24:21 +07:00
|
|
|
});
|
2024-03-11 17:48:15 +07:00
|
|
|
</script>
|
2025-03-11 18:07:37 +07:00
|
|
|
|
2024-03-08 16:46:36 +07:00
|
|
|
<template>
|
2024-04-24 17:26:12 +07:00
|
|
|
<div class="row items-center q-gutter-x-sm q-pb-sm">
|
2024-05-14 16:05:58 +07:00
|
|
|
<q-btn
|
2024-11-04 15:21:23 +07:00
|
|
|
v-if="!isLeave && checkPermission($route)?.attrIsUpdate"
|
2024-05-14 16:05:58 +07:00
|
|
|
flat
|
|
|
|
|
color="primary"
|
|
|
|
|
round
|
|
|
|
|
dense
|
|
|
|
|
icon="add"
|
|
|
|
|
@click="onClickOpenDialog()"
|
|
|
|
|
>
|
2024-03-29 12:32:19 +07:00
|
|
|
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
2024-03-11 17:48:15 +07:00
|
|
|
</q-btn>
|
|
|
|
|
<q-space />
|
2024-12-04 15:15:36 +07:00
|
|
|
<q-input
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
v-model="keyword"
|
|
|
|
|
label="ค้นหา"
|
|
|
|
|
class="q-mr-sm"
|
|
|
|
|
@keydown.enter.pervent="serchDataTable"
|
|
|
|
|
>
|
2024-03-11 17:48:15 +07:00
|
|
|
<template v-slot:append>
|
2024-12-03 10:49:23 +07:00
|
|
|
<q-icon name="search" />
|
2024-03-11 17:48:15 +07:00
|
|
|
</template>
|
|
|
|
|
</q-input>
|
|
|
|
|
|
|
|
|
|
<q-select
|
|
|
|
|
v-model="visibleColumns"
|
|
|
|
|
multiple
|
|
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
options-dense
|
|
|
|
|
:display-value="$q.lang.table.columns"
|
|
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
:options="columns"
|
|
|
|
|
option-value="name"
|
2024-11-05 16:33:46 +07:00
|
|
|
style="min-width: 140px"
|
2024-03-11 17:48:15 +07:00
|
|
|
/>
|
2024-04-24 17:26:12 +07:00
|
|
|
</div>
|
2024-08-13 11:22:48 +07:00
|
|
|
|
2025-03-11 11:11:31 +07:00
|
|
|
<div class="col-12">
|
|
|
|
|
<d-table
|
|
|
|
|
ref="table"
|
|
|
|
|
row-key="id"
|
|
|
|
|
flat
|
|
|
|
|
bordered
|
|
|
|
|
dense
|
|
|
|
|
:columns="columns"
|
|
|
|
|
:rows="rows"
|
|
|
|
|
v-model:pagination="pagination"
|
|
|
|
|
:visible-columns="visibleColumns"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:header="props">
|
|
|
|
|
<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>
|
|
|
|
|
</q-th>
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:body="props">
|
|
|
|
|
<q-tr :props="props">
|
|
|
|
|
<q-td>
|
|
|
|
|
<q-btn
|
|
|
|
|
flat
|
|
|
|
|
dense
|
|
|
|
|
round
|
|
|
|
|
color="deep-purple"
|
|
|
|
|
icon="mdi-history"
|
|
|
|
|
@click="onClikcHistory(props.row.id)"
|
|
|
|
|
>
|
|
|
|
|
<q-tooltip>ประวัติแก้ไขตำแหน่ง/เงินเดือน</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
|
|
|
|
|
<q-btn
|
|
|
|
|
v-if="isLeave == false && checkPermission($route)?.attrIsUpdate"
|
|
|
|
|
flat
|
|
|
|
|
:disable="
|
|
|
|
|
props.row.commandId !== null && props.row.commandId !== ''
|
|
|
|
|
"
|
|
|
|
|
:color="props.row.commandId ? 'grey' : 'edit'"
|
|
|
|
|
dense
|
|
|
|
|
round
|
|
|
|
|
icon="edit"
|
|
|
|
|
clickable
|
|
|
|
|
@click="onClickOpenDialog(true, props.row)"
|
|
|
|
|
>
|
|
|
|
|
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</q-td>
|
|
|
|
|
|
|
|
|
|
<q-td
|
|
|
|
|
v-for="col in props.cols"
|
|
|
|
|
:key="col.id"
|
|
|
|
|
:class="props.row.isEntry ? 'text-red' : ''"
|
2024-10-22 16:16:54 +07:00
|
|
|
>
|
2025-03-11 11:11:31 +07:00
|
|
|
<div
|
|
|
|
|
v-if="col.name == 'refCommandNo' && props.row.commandId"
|
|
|
|
|
@click="col.value ? onRefCommand(props.row) : null"
|
|
|
|
|
:class="
|
|
|
|
|
col.value
|
|
|
|
|
? 'table_ellipsis text-blue cursor-pointer'
|
|
|
|
|
: 'table_ellipsis'
|
|
|
|
|
"
|
|
|
|
|
>
|
|
|
|
|
{{ col.value ? col.value : "-" }}
|
|
|
|
|
<q-tooltip v-if="col.value">ดูคำสั่ง</q-tooltip>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else-if="col.name == 'refCommandNo' && !props.row.commandId">
|
|
|
|
|
-
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else-if="col.name == 'organization'" class="table_ellipsis">
|
|
|
|
|
{{ col.value ? col.value : "-" }}
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else>
|
|
|
|
|
{{ col.value ? col.value : "-" }}
|
|
|
|
|
</div>
|
|
|
|
|
</q-td>
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
</d-table>
|
|
|
|
|
</div>
|
2024-03-11 17:48:15 +07:00
|
|
|
|
2024-04-02 12:03:53 +07:00
|
|
|
<q-dialog v-model="modalDialogSalary" persistent>
|
2025-03-11 11:11:31 +07:00
|
|
|
<q-card style="min-width: 40vw">
|
2024-03-27 13:51:34 +07:00
|
|
|
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
2024-04-24 17:26:12 +07:00
|
|
|
<DialogHeader
|
2025-03-11 11:11:31 +07:00
|
|
|
:tittle="isStatusEdit ? 'แก้ไขเงินเดือน' : 'เพิ่มเงินเดือน'"
|
2024-04-24 17:26:12 +07:00
|
|
|
:close="onClickCloseDialog"
|
|
|
|
|
/>
|
|
|
|
|
<q-separator color="grey-4" />
|
|
|
|
|
|
2024-06-11 15:48:29 +07:00
|
|
|
<q-card-section style="max-height: 100%" class="scroll">
|
2024-04-24 17:26:12 +07:00
|
|
|
<div class="row col-12 q-col-gutter-sm">
|
2025-03-11 18:07:37 +07:00
|
|
|
<div class="col-xs-12 col-sm-12 col-md-8">
|
|
|
|
|
<!-- :rules="[(val: string) => !!val || 'กรุณาเลือกประเภทคำสั่ง']" -->
|
2025-03-11 11:11:31 +07:00
|
|
|
<q-select
|
|
|
|
|
outlined
|
|
|
|
|
:class="classInput(true)"
|
|
|
|
|
dense
|
|
|
|
|
lazy-rules
|
|
|
|
|
borderless
|
|
|
|
|
v-model="formData.commandCode"
|
|
|
|
|
:label="`${'ประเภทคำสั่ง'}`"
|
|
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
option-label="name"
|
|
|
|
|
:options="commandCodeOptions"
|
|
|
|
|
option-value="id"
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
use-input
|
|
|
|
|
hide-selected
|
|
|
|
|
fill-input
|
|
|
|
|
input-debounce="0"
|
|
|
|
|
@update:model-value="updateSelectType"
|
|
|
|
|
@filter="(inputValue: string,
|
|
|
|
|
doneFn: Function) => filterSelector(inputValue, doneFn, 'commandCode'
|
|
|
|
|
)"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:no-option>
|
|
|
|
|
<q-item>
|
|
|
|
|
<q-item-section class="text-grey">
|
|
|
|
|
ไม่มีข้อมูล
|
|
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</template>
|
|
|
|
|
</q-select>
|
|
|
|
|
</div>
|
|
|
|
|
|
2025-03-11 18:07:37 +07:00
|
|
|
<div class="col-xs-6 col-sm-6 col-md-4">
|
|
|
|
|
<!-- :rules="[ (val: string) => !!val || `${'กรุณาเลือกวันที่คำสั่งมีผล'}`, ]" -->
|
|
|
|
|
<datepicker
|
|
|
|
|
v-model="formData.commandDateAffect"
|
|
|
|
|
:locale="'th'"
|
|
|
|
|
autoApply
|
|
|
|
|
:enableTimePicker="false"
|
|
|
|
|
week-start="0"
|
|
|
|
|
:class="classInput(true)"
|
|
|
|
|
>
|
|
|
|
|
<template #year="{ year }">{{ year + 543 }}</template>
|
|
|
|
|
<template #year-overlay-value="{ value }">{{
|
|
|
|
|
parseInt(value + 543)
|
|
|
|
|
}}</template>
|
|
|
|
|
<template #trigger>
|
|
|
|
|
<q-input
|
|
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
borderless
|
|
|
|
|
:model-value="date2Thai(formData.commandDateAffect)"
|
|
|
|
|
:label="`${'วันที่คำสั่งมีผล'}`"
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:prepend>
|
|
|
|
|
<q-icon
|
|
|
|
|
name="event"
|
|
|
|
|
color="primary"
|
|
|
|
|
class="cursor-pointer"
|
|
|
|
|
>
|
|
|
|
|
</q-icon>
|
|
|
|
|
</template>
|
|
|
|
|
</q-input>
|
|
|
|
|
</template>
|
|
|
|
|
</datepicker>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-xs-6 col-sm-12 col-md-8">
|
2025-03-11 11:11:31 +07:00
|
|
|
<div class="row q-col-gutter-sm">
|
|
|
|
|
<div class="col-6">
|
|
|
|
|
<q-input
|
|
|
|
|
:class="classInput(true)"
|
|
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
lazy-rules
|
|
|
|
|
borderless
|
|
|
|
|
v-model="formData.commandNo"
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
:label="`${'เลขที่คำสั่ง'}`"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2025-03-11 18:07:37 +07:00
|
|
|
<label class="col-1 flex justify-center items-center">/</label>
|
2025-03-11 11:11:31 +07:00
|
|
|
<div class="col-5">
|
2025-03-11 18:07:37 +07:00
|
|
|
<!-- :rules="[(val:string) => !!val || `${'กรุณากรอก พ.ศ.'}`]" -->
|
2025-03-11 11:11:31 +07:00
|
|
|
<datepicker
|
|
|
|
|
menu-class-name="modalfix"
|
|
|
|
|
v-model="formData.commandYear"
|
|
|
|
|
:locale="'th'"
|
|
|
|
|
autoApply
|
|
|
|
|
year-picker
|
|
|
|
|
:enableTimePicker="false"
|
|
|
|
|
class="inputgreen"
|
|
|
|
|
>
|
|
|
|
|
<template #year="{ year }">{{ year + 543 }}</template>
|
|
|
|
|
<template #year-overlay-value="{ value }">{{
|
|
|
|
|
parseInt(value + 543)
|
|
|
|
|
}}</template>
|
|
|
|
|
<template #trigger>
|
|
|
|
|
<q-input
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
:model-value="
|
|
|
|
|
formData.commandYear == null
|
|
|
|
|
? null
|
|
|
|
|
: formData.commandYear + 543
|
|
|
|
|
"
|
|
|
|
|
:label="`${'พ.ศ.'}`"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:prepend>
|
|
|
|
|
<q-icon
|
|
|
|
|
name="event"
|
|
|
|
|
class="cursor-pointer"
|
|
|
|
|
style="color: var(--q-primary)"
|
|
|
|
|
>
|
|
|
|
|
</q-icon>
|
|
|
|
|
</template>
|
|
|
|
|
</q-input>
|
|
|
|
|
</template>
|
|
|
|
|
</datepicker>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2025-03-11 18:07:37 +07:00
|
|
|
<div class="col-xs-6 col-sm-6 col-md-4">
|
|
|
|
|
<!-- :rules="[ (val: string) => !!val || `${'กรุณาเลือก วันที่ลงนาม'}`,]" -->
|
2025-03-11 11:11:31 +07:00
|
|
|
<datepicker
|
|
|
|
|
v-model="formData.commandDateSign"
|
|
|
|
|
:locale="'th'"
|
|
|
|
|
autoApply
|
|
|
|
|
:enableTimePicker="false"
|
|
|
|
|
week-start="0"
|
|
|
|
|
:class="classInput(true)"
|
|
|
|
|
>
|
|
|
|
|
<template #year="{ year }">{{ year + 543 }}</template>
|
|
|
|
|
<template #year-overlay-value="{ value }">{{
|
|
|
|
|
parseInt(value + 543)
|
|
|
|
|
}}</template>
|
|
|
|
|
<template #trigger>
|
|
|
|
|
<q-input
|
|
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
borderless
|
|
|
|
|
:model-value="date2Thai(formData.commandDateSign)"
|
|
|
|
|
:label="`${'วันที่ลงนาม'}`"
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:prepend>
|
|
|
|
|
<q-icon
|
|
|
|
|
name="event"
|
|
|
|
|
color="primary"
|
|
|
|
|
class="cursor-pointer"
|
|
|
|
|
>
|
|
|
|
|
</q-icon>
|
|
|
|
|
</template>
|
|
|
|
|
</q-input>
|
|
|
|
|
</template>
|
|
|
|
|
</datepicker>
|
|
|
|
|
</div>
|
|
|
|
|
|
2025-03-11 18:07:37 +07:00
|
|
|
<div class="col-12">
|
|
|
|
|
<q-separator />
|
|
|
|
|
</div>
|
|
|
|
|
|
2025-03-11 11:11:31 +07:00
|
|
|
<div class="col-xs-6 col-sm-6 col-md-4">
|
2024-05-14 16:05:58 +07:00
|
|
|
<q-input
|
2024-08-05 12:58:48 +07:00
|
|
|
:class="classInput(true)"
|
2024-05-14 16:05:58 +07:00
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
lazy-rules
|
|
|
|
|
borderless
|
2025-03-11 11:11:31 +07:00
|
|
|
v-model="formData.posNoAbb"
|
2024-05-14 16:05:58 +07:00
|
|
|
hide-bottom-space
|
2025-03-11 11:11:31 +07:00
|
|
|
:label="`${'ตัวย่อ'}`"
|
2024-05-14 16:05:58 +07:00
|
|
|
>
|
|
|
|
|
</q-input>
|
|
|
|
|
</div>
|
|
|
|
|
|
2025-03-11 11:11:31 +07:00
|
|
|
<div class="col-xs-6 col-sm-6 col-md-4">
|
2025-03-11 18:07:37 +07:00
|
|
|
<!-- :rules="[(val: string) => !!val || `${'กรุณากรอกตำแหน่งเลขที่'}`]" -->
|
2025-03-11 11:11:31 +07:00
|
|
|
<q-input
|
2024-08-05 12:58:48 +07:00
|
|
|
:class="classInput(true)"
|
2024-05-14 16:05:58 +07:00
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
lazy-rules
|
|
|
|
|
borderless
|
2025-03-11 11:11:31 +07:00
|
|
|
v-model="formData.posNo"
|
2024-05-14 16:05:58 +07:00
|
|
|
hide-bottom-space
|
2025-03-17 16:01:02 +07:00
|
|
|
:label="empType === '' ? 'เลขที่ตำแหน่ง' : 'ตำแหน่งเลขที่'"
|
2024-12-03 10:49:23 +07:00
|
|
|
>
|
2025-03-11 11:11:31 +07:00
|
|
|
</q-input>
|
2024-05-14 16:05:58 +07:00
|
|
|
</div>
|
|
|
|
|
|
2025-03-11 11:11:31 +07:00
|
|
|
<div class="col-xs-12 col-sm-6 col-md-4">
|
2025-03-11 18:07:37 +07:00
|
|
|
<!-- :rules="empType == '' ? [(val: string) => !!val || 'กรุณากรอกตำแหน่งในสายงาน' ] : [(val: string) => !!val || 'กรุณากรอกตำแหน่ง']" -->
|
2024-05-14 16:05:58 +07:00
|
|
|
<q-input
|
2024-08-05 12:58:48 +07:00
|
|
|
:class="classInput(true)"
|
2024-05-14 16:05:58 +07:00
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
lazy-rules
|
|
|
|
|
borderless
|
2025-03-11 11:11:31 +07:00
|
|
|
v-model="formData.positionName"
|
|
|
|
|
:label="empType == '' ? 'ตำแหน่งในสายงาน' : 'ตำแหน่ง'"
|
2024-05-14 16:05:58 +07:00
|
|
|
hide-bottom-space
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-xs-6 col-sm-6 col-md-4">
|
2025-03-11 18:07:37 +07:00
|
|
|
<!-- :rules="empType == '' ? [(val: string) => !!val || 'กรุณาเลือกประเภทตำแหน่ง' ]:[(val: string) => !!val || 'กรุณาเลือกกลุ่มงาน' ]" -->
|
2024-05-16 17:52:44 +07:00
|
|
|
<q-select
|
|
|
|
|
ref="positionType Ref"
|
2024-04-24 17:26:12 +07:00
|
|
|
outlined
|
2024-08-05 12:58:48 +07:00
|
|
|
:class="classInput(true)"
|
2024-04-24 17:26:12 +07:00
|
|
|
dense
|
|
|
|
|
lazy-rules
|
|
|
|
|
borderless
|
2025-03-11 11:11:31 +07:00
|
|
|
v-model="formData.positionType"
|
2024-05-24 14:58:40 +07:00
|
|
|
:label="empType == '' ? 'ประเภทตำแหน่ง' : 'กลุ่มงาน'"
|
2024-04-24 17:26:12 +07:00
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
option-label="name"
|
2024-05-16 17:52:44 +07:00
|
|
|
:options="posTypeOptions"
|
|
|
|
|
option-value="name"
|
2024-04-24 17:26:12 +07:00
|
|
|
hide-bottom-space
|
|
|
|
|
use-input
|
2024-12-03 10:49:23 +07:00
|
|
|
hide-selected
|
|
|
|
|
fill-input
|
2025-03-11 18:07:37 +07:00
|
|
|
clearable
|
2024-04-24 17:26:12 +07:00
|
|
|
input-debounce="0"
|
2024-05-16 17:52:44 +07:00
|
|
|
@update:model-value="updateSelectType"
|
2024-09-18 17:24:21 +07:00
|
|
|
@filter="(inputValue: string,
|
2024-05-16 17:52:44 +07:00
|
|
|
doneFn: Function) => filterSelector(inputValue, doneFn, 'posType'
|
2024-04-24 17:26:12 +07:00
|
|
|
)"
|
2024-12-03 10:49:23 +07:00
|
|
|
>
|
|
|
|
|
<template v-slot:no-option>
|
|
|
|
|
<q-item>
|
|
|
|
|
<q-item-section class="text-grey">
|
|
|
|
|
ไม่มีข้อมูล
|
|
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</template>
|
|
|
|
|
</q-select>
|
2024-05-14 16:05:58 +07:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-xs-6 col-sm-6 col-md-4">
|
2025-03-11 18:07:37 +07:00
|
|
|
<!-- :rules="empType == '' ? [(val: string) => !!val || 'กรุณาเลือกระดับตำแหน่ง' ] : [(val: string) => !!val || 'กรุณาเลือกระดับชั้นงาน']" -->
|
2024-05-16 17:52:44 +07:00
|
|
|
<q-select
|
2024-08-05 12:58:48 +07:00
|
|
|
:class="classInput(true)"
|
2025-03-11 11:11:31 +07:00
|
|
|
:disable="!formData.positionType"
|
2024-05-14 16:05:58 +07:00
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
lazy-rules
|
2024-05-16 17:52:44 +07:00
|
|
|
borderless
|
2025-03-11 11:11:31 +07:00
|
|
|
v-model="formData.positionLevel"
|
2024-05-16 17:52:44 +07:00
|
|
|
:label="empType == '' ? 'ระดับตำแหน่ง' : 'ระดับชั้นงาน'"
|
|
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
option-label="name"
|
2025-03-11 11:11:31 +07:00
|
|
|
:options="posLevelOptions"
|
2024-05-16 17:52:44 +07:00
|
|
|
option-value="name"
|
2024-05-14 16:05:58 +07:00
|
|
|
hide-bottom-space
|
2024-05-16 17:52:44 +07:00
|
|
|
use-input
|
2024-12-03 10:49:23 +07:00
|
|
|
hide-selected
|
|
|
|
|
fill-input
|
2024-05-16 17:52:44 +07:00
|
|
|
input-debounce="0"
|
2024-09-18 17:24:21 +07:00
|
|
|
@filter="(inputValue: string,
|
2024-05-16 17:52:44 +07:00
|
|
|
doneFn: Function) => filterSelector(inputValue, doneFn, 'posLevel'
|
|
|
|
|
)"
|
2024-12-03 10:49:23 +07:00
|
|
|
><template v-slot:no-option>
|
|
|
|
|
<q-item>
|
|
|
|
|
<q-item-section class="text-grey">
|
|
|
|
|
ไม่มีข้อมูล
|
|
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</template>
|
|
|
|
|
</q-select>
|
2024-05-14 16:05:58 +07:00
|
|
|
</div>
|
2024-05-16 17:52:44 +07:00
|
|
|
|
2025-03-11 18:07:37 +07:00
|
|
|
<div class="col-xs-6 col-sm-6 col-md-4" v-if="empType == ''">
|
|
|
|
|
<q-input
|
|
|
|
|
:class="classInput(true)"
|
|
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
lazy-rules
|
|
|
|
|
borderless
|
|
|
|
|
v-model="formData.positionCee"
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
:label="`${'ระดับซี'}`"
|
|
|
|
|
>
|
|
|
|
|
</q-input>
|
|
|
|
|
</div>
|
|
|
|
|
|
2024-05-16 17:52:44 +07:00
|
|
|
<div class="col-xs-6 col-sm-6 col-md-4" v-if="empType == ''">
|
|
|
|
|
<q-select
|
2024-05-14 16:05:58 +07:00
|
|
|
outlined
|
2024-08-05 12:58:48 +07:00
|
|
|
:class="classInput(true)"
|
2024-05-14 16:05:58 +07:00
|
|
|
dense
|
|
|
|
|
lazy-rules
|
|
|
|
|
borderless
|
2025-03-11 11:11:31 +07:00
|
|
|
v-model="formData.positionLine"
|
2024-05-16 17:52:44 +07:00
|
|
|
:label="`${'สายงาน'}`"
|
|
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
option-label="name"
|
2025-03-11 11:11:31 +07:00
|
|
|
:options="posLineOptions"
|
2024-05-16 17:52:44 +07:00
|
|
|
option-value="id"
|
2024-05-14 16:05:58 +07:00
|
|
|
hide-bottom-space
|
2024-05-16 17:52:44 +07:00
|
|
|
use-input
|
2024-12-03 10:49:23 +07:00
|
|
|
hide-selected
|
|
|
|
|
fill-input
|
2024-05-16 17:52:44 +07:00
|
|
|
clearable
|
|
|
|
|
input-debounce="0"
|
2024-09-18 17:24:21 +07:00
|
|
|
@filter="(inputValue: string,
|
2025-03-11 11:11:31 +07:00
|
|
|
doneFn: Function) => filterSelector(inputValue, doneFn, 'posLine'
|
2024-05-16 17:52:44 +07:00
|
|
|
)"
|
2024-12-03 10:49:23 +07:00
|
|
|
>
|
|
|
|
|
<template v-slot:no-option>
|
|
|
|
|
<q-item>
|
|
|
|
|
<q-item-section class="text-grey">
|
|
|
|
|
ไม่มีข้อมูล
|
|
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</template></q-select
|
|
|
|
|
>
|
2024-05-14 16:05:58 +07:00
|
|
|
</div>
|
|
|
|
|
|
2024-05-16 17:52:44 +07:00
|
|
|
<div class="col-xs-6 col-sm-6 col-md-4" v-if="empType == ''">
|
2024-05-14 16:05:58 +07:00
|
|
|
<q-select
|
2024-08-05 12:58:48 +07:00
|
|
|
:class="classInput(true)"
|
2024-05-14 16:05:58 +07:00
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
lazy-rules
|
|
|
|
|
borderless
|
2025-03-11 11:11:31 +07:00
|
|
|
v-model="formData.positionPathSide"
|
2024-05-16 17:52:44 +07:00
|
|
|
:label="`${'ด้าน/สาขา'}`"
|
2024-05-14 16:05:58 +07:00
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
option-label="name"
|
2025-03-11 11:11:31 +07:00
|
|
|
:options="posPathSideOptions"
|
2024-05-16 17:52:44 +07:00
|
|
|
option-value="id"
|
2024-05-14 16:05:58 +07:00
|
|
|
hide-bottom-space
|
|
|
|
|
use-input
|
2024-12-03 10:49:23 +07:00
|
|
|
hide-selected
|
|
|
|
|
fill-input
|
2024-05-16 17:52:44 +07:00
|
|
|
clearable
|
2024-05-14 16:05:58 +07:00
|
|
|
input-debounce="0"
|
2024-09-18 17:24:21 +07:00
|
|
|
@filter="(inputValue: string,
|
2025-03-11 11:11:31 +07:00
|
|
|
doneFn: Function) => filterSelector(inputValue, doneFn, 'posPathSide'
|
2024-04-24 17:26:12 +07:00
|
|
|
)"
|
2024-12-03 10:49:23 +07:00
|
|
|
>
|
|
|
|
|
<template v-slot:no-option>
|
|
|
|
|
<q-item>
|
|
|
|
|
<q-item-section class="text-grey">
|
|
|
|
|
ไม่มีข้อมูล
|
|
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</template>
|
|
|
|
|
</q-select>
|
2024-05-14 16:05:58 +07:00
|
|
|
</div>
|
|
|
|
|
|
2024-05-16 17:52:44 +07:00
|
|
|
<div class="col-xs-6 col-sm-6 col-md-4" v-if="empType == ''">
|
2024-05-14 16:05:58 +07:00
|
|
|
<q-select
|
2024-08-05 12:58:48 +07:00
|
|
|
:class="classInput(true)"
|
2024-05-14 16:05:58 +07:00
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
lazy-rules
|
|
|
|
|
borderless
|
2025-03-11 11:11:31 +07:00
|
|
|
v-model="formData.positionExecutive"
|
2024-05-16 17:52:44 +07:00
|
|
|
:label="`${'ตำแหน่งทางการบริหาร'}`"
|
2024-05-14 16:05:58 +07:00
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
option-label="name"
|
2025-03-11 11:11:31 +07:00
|
|
|
:options="posExecutiveOptions"
|
2024-05-16 17:52:44 +07:00
|
|
|
option-value="id"
|
2024-05-14 16:05:58 +07:00
|
|
|
hide-bottom-space
|
|
|
|
|
use-input
|
2024-12-03 10:49:23 +07:00
|
|
|
hide-selected
|
|
|
|
|
fill-input
|
2024-05-14 16:05:58 +07:00
|
|
|
input-debounce="0"
|
2024-05-16 17:52:44 +07:00
|
|
|
clearable
|
2024-09-18 17:24:21 +07:00
|
|
|
@filter="(inputValue: string,
|
2025-03-11 11:11:31 +07:00
|
|
|
doneFn: Function) => filterSelector(inputValue, doneFn, 'posExecutive'
|
2024-05-16 17:52:44 +07:00
|
|
|
)"
|
2024-12-03 10:49:23 +07:00
|
|
|
>
|
|
|
|
|
<template v-slot:no-option>
|
|
|
|
|
<q-item>
|
|
|
|
|
<q-item-section class="text-grey">
|
|
|
|
|
ไม่มีข้อมูล
|
|
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</template>
|
|
|
|
|
</q-select>
|
2024-05-14 16:05:58 +07:00
|
|
|
</div>
|
2024-05-16 17:52:44 +07:00
|
|
|
|
2025-03-11 11:11:31 +07:00
|
|
|
<div class="col-12">
|
|
|
|
|
<div class="row q-col-gutter-sm">
|
|
|
|
|
<div class="col-xs-6 col-sm-6 col-md-4">
|
|
|
|
|
<q-input
|
|
|
|
|
:class="classInput(true)"
|
|
|
|
|
ref="salaryRef"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
v-model="formData.amount"
|
|
|
|
|
label="เงินเดือน"
|
|
|
|
|
mask="###,###,###,###"
|
|
|
|
|
reverse-fill-mask
|
|
|
|
|
:rules="[(val:string) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
|
|
|
|
|
lazy-rules
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2024-05-14 16:05:58 +07:00
|
|
|
|
2025-03-11 11:11:31 +07:00
|
|
|
<div class="col-xs-6 col-sm-6 col-md-4">
|
|
|
|
|
<q-input
|
|
|
|
|
:class="classInput(true)"
|
|
|
|
|
ref="amountSpecialRef"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
v-model="formData.amountSpecial"
|
|
|
|
|
label="เงินค่าตอบแทนพิเศษ"
|
|
|
|
|
mask="###,###,###,###"
|
|
|
|
|
reverse-fill-mask
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2024-05-16 17:52:44 +07:00
|
|
|
|
2025-03-11 11:11:31 +07:00
|
|
|
<div class="col-xs-6 col-sm-6 col-md-4">
|
|
|
|
|
<q-input
|
|
|
|
|
:class="classInput(true)"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
v-model="formData.positionSalaryAmount"
|
|
|
|
|
label="เงินประจำตำแหน่ง"
|
|
|
|
|
mask="###,###,###,###"
|
|
|
|
|
reverse-fill-mask
|
|
|
|
|
lazy-rules
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-xs-6 col-sm-6 col-md-4">
|
|
|
|
|
<q-input
|
|
|
|
|
:class="classInput(true)"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
v-model="formData.mouthSalaryAmount"
|
|
|
|
|
label="เงินค่าตอบแทนรายเดือน"
|
|
|
|
|
mask="###,###,###,###"
|
|
|
|
|
reverse-fill-mask
|
|
|
|
|
lazy-rules
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-05-14 16:05:58 +07:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-xs-12 col-sm-12 col-md-12">
|
2025-03-11 11:11:31 +07:00
|
|
|
<div class="row q-col-gutter-sm">
|
|
|
|
|
<div class="col-xs-12 col-sm-4 col-md-4">
|
|
|
|
|
<q-input
|
|
|
|
|
:class="classInput(true)"
|
|
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
lazy-rules
|
|
|
|
|
borderless
|
|
|
|
|
v-model="formData.orgRoot"
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
:label="`${'หน่วยงาน'}`"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-xs-12 col-sm-4 col-md-4">
|
|
|
|
|
<q-input
|
|
|
|
|
:class="classInput(true)"
|
|
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
lazy-rules
|
|
|
|
|
borderless
|
|
|
|
|
v-model="formData.orgChild1"
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
:label="`${'ส่วนราชการระดับ 1'}`"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-xs-12 col-sm-4 col-md-4">
|
|
|
|
|
<q-input
|
|
|
|
|
:class="classInput(true)"
|
|
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
lazy-rules
|
|
|
|
|
borderless
|
|
|
|
|
v-model="formData.orgChild2"
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
:label="`${'ส่วนราชการระดับ 2'}`"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-xs-12 col-sm-4 col-md-4">
|
|
|
|
|
<q-input
|
|
|
|
|
:class="classInput(true)"
|
|
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
lazy-rules
|
|
|
|
|
borderless
|
|
|
|
|
v-model="formData.orgChild3"
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
:label="`${'ส่วนราชการระดับ 3'}`"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-xs-12 col-sm-4 col-md-4">
|
|
|
|
|
<q-input
|
|
|
|
|
:class="classInput(true)"
|
|
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
lazy-rules
|
|
|
|
|
borderless
|
|
|
|
|
v-model="formData.orgChild4"
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
:label="`${'ส่วนราชการระดับ 4'}`"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-05-14 16:05:58 +07:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-xs-12 col-sm-12 col-md-12">
|
|
|
|
|
<q-input
|
2024-08-05 12:58:48 +07:00
|
|
|
:class="classInput(true)"
|
2024-05-14 16:05:58 +07:00
|
|
|
ref="docRef"
|
|
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
borderless
|
2025-03-11 11:11:31 +07:00
|
|
|
v-model="formData.remark"
|
|
|
|
|
:label="`${'หมายเหตุ'}`"
|
2024-05-14 16:05:58 +07:00
|
|
|
type="textarea"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2024-04-24 17:26:12 +07:00
|
|
|
</div>
|
|
|
|
|
</q-card-section>
|
2024-03-11 17:48:15 +07:00
|
|
|
<q-separator />
|
2024-04-24 17:26:12 +07:00
|
|
|
<q-card-actions align="right">
|
2024-06-11 15:48:29 +07:00
|
|
|
<q-btn label="บันทึก" id="onSubmit" type="submit" color="public">
|
2024-04-24 17:26:12 +07:00
|
|
|
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</q-card-actions>
|
2024-03-27 13:51:34 +07:00
|
|
|
</q-form>
|
2024-04-24 17:26:12 +07:00
|
|
|
</q-card>
|
2024-03-11 17:48:15 +07:00
|
|
|
</q-dialog>
|
|
|
|
|
|
2025-03-13 09:22:25 +07:00
|
|
|
<!-- <DialogHistory v-model:modal="modalHistory" v-model:salaryId="salaryId" /> -->
|
|
|
|
|
|
|
|
|
|
<DialogHistory
|
|
|
|
|
v-model:modal="modalHistory"
|
|
|
|
|
:visible-columns="visibleColumnsHistory"
|
|
|
|
|
:title="`ประวัติแก้ไขเงินเดือน`"
|
|
|
|
|
:columns="columnsHistory"
|
|
|
|
|
:fetch-data="fetchDataHistory"
|
|
|
|
|
/>
|
|
|
|
|
|
2024-10-22 16:16:54 +07:00
|
|
|
<DialogPreviewCommand
|
|
|
|
|
v-model:modal="modalCommand"
|
|
|
|
|
v-model:command="command"
|
|
|
|
|
v-model:commandId="commandId"
|
|
|
|
|
/>
|
2024-03-08 16:46:36 +07:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style scoped></style>
|