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
|
|
|
|
|
|
|
|
import type { QTableProps } from "quasar";
|
2024-03-27 13:51:34 +07:00
|
|
|
import type {
|
|
|
|
|
DataOption2,
|
|
|
|
|
DataOption,
|
2024-08-01 12:12:28 +07:00
|
|
|
} from "@/modules/04_registryPerson/interface/index/Main";
|
2024-06-11 15:48:29 +07:00
|
|
|
|
2024-08-01 12:12:28 +07:00
|
|
|
import type { FormSalaryNew } from "@/modules/04_registryPerson/interface/request/Salary";
|
2024-08-16 15:35:15 +07:00
|
|
|
import type {
|
|
|
|
|
ResListSalary,
|
|
|
|
|
ResType,
|
|
|
|
|
} from "@/modules/04_registryPerson/interface/response/Salary";
|
2024-03-11 17:48:15 +07:00
|
|
|
|
|
|
|
|
import DialogHeader from "@/components/DialogHeader.vue";
|
2024-08-01 12:12:28 +07:00
|
|
|
import DialogHistory from "@/modules/04_registryPerson/components/detail/Salary/01_PositionSalaryHistory.vue";
|
2024-03-11 17:48:15 +07:00
|
|
|
|
|
|
|
|
import { useCounterMixin } from "@/stores/mixin";
|
2024-08-01 12:12:28 +07:00
|
|
|
import { useSalaryDataStore } from "@/modules/04_registryPerson/stores/salary";
|
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
|
|
|
|
|
|
|
|
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-10-21 17:56:47 +07:00
|
|
|
/**
|
|
|
|
|
* props
|
|
|
|
|
*/
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
isLeave: Boolean,
|
|
|
|
|
});
|
|
|
|
|
|
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-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[]>([]); //รายการตำแหน่งเงินเดือน
|
|
|
|
|
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>("");
|
2024-07-05 17:49:04 +07:00
|
|
|
const baseColumns = ref<QTableProps["columns"]>([
|
2024-03-11 17:48:15 +07:00
|
|
|
{
|
|
|
|
|
name: "date",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "วัน เดือน ปี",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "date",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
2024-03-27 13:51:34 +07:00
|
|
|
format: (v) => date2Thai(v),
|
2024-03-11 17:48:15 +07:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "amount",
|
|
|
|
|
align: "left",
|
2024-07-05 17:49:04 +07:00
|
|
|
label: empType.value === "-employee" ? "ค่าตอบแทนรายเดือน" : "เงินเดือน",
|
2024-03-11 17:48:15 +07:00
|
|
|
sortable: true,
|
|
|
|
|
field: "amount",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
2024-03-27 13:51:34 +07:00
|
|
|
format: (v) => Number(v).toLocaleString(),
|
2024-03-11 17:48:15 +07:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "positionSalaryAmount",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "เงินประจำตำแหน่ง",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "positionSalaryAmount",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
2024-03-27 13:51:34 +07:00
|
|
|
format: (v) => Number(v).toLocaleString(),
|
2024-03-11 17:48:15 +07:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "mouthSalaryAmount",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "เงินค่าตอบแทนรายเดือน",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "mouthSalaryAmount",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
2024-03-27 13:51:34 +07:00
|
|
|
format: (v) => Number(v).toLocaleString(),
|
2024-03-11 17:48:15 +07:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
name: "posNo",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ตำแหน่งเลขที่",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "posNo",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
2024-03-27 17:16:17 +07:00
|
|
|
name: "positionType",
|
2024-03-11 17:48:15 +07:00
|
|
|
align: "left",
|
2024-05-24 14:58:40 +07:00
|
|
|
label: "ประเภทตำแหน่ง",
|
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",
|
|
|
|
|
},
|
|
|
|
|
{
|
2024-03-27 17:16:17 +07:00
|
|
|
name: "positionLevel",
|
2024-03-11 17:48:15 +07:00
|
|
|
align: "left",
|
|
|
|
|
label: "ระดับ",
|
|
|
|
|
sortable: true,
|
2024-03-27 17:16:17 +07:00
|
|
|
field: "positionLevel",
|
2024-03-11 17:48:15 +07:00
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
2024-03-27 13:51:34 +07:00
|
|
|
name: "templateDoc",
|
2024-03-11 17:48:15 +07:00
|
|
|
align: "left",
|
|
|
|
|
label: "เอกสารอ้างอิง",
|
|
|
|
|
sortable: true,
|
2024-03-27 13:51:34 +07:00
|
|
|
field: "templateDoc",
|
2024-03-11 17:48:15 +07:00
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "refCommandNo",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "เลขที่คำสั่ง",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "refCommandNo",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
]);
|
2024-07-05 17:49:04 +07:00
|
|
|
const columns = computed(() => {
|
|
|
|
|
if (empType.value === "-employee") {
|
|
|
|
|
if (baseColumns.value) {
|
|
|
|
|
return baseColumns.value.filter(
|
|
|
|
|
(column) =>
|
|
|
|
|
column.name !== "positionSalaryAmount" &&
|
|
|
|
|
column.name !== "mouthSalaryAmount"
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return baseColumns.value;
|
|
|
|
|
});
|
2024-03-11 17:48:15 +07:00
|
|
|
const visibleColumns = ref<string[]>([
|
|
|
|
|
"date",
|
|
|
|
|
"amount",
|
|
|
|
|
"positionSalaryAmount",
|
|
|
|
|
"mouthSalaryAmount",
|
|
|
|
|
"posNo",
|
2024-03-27 17:16:17 +07:00
|
|
|
"positionType",
|
|
|
|
|
"positionLevel",
|
2024-03-27 13:51:34 +07:00
|
|
|
"templateDoc",
|
2024-03-11 17:48:15 +07:00
|
|
|
"refCommandNo",
|
|
|
|
|
]);
|
|
|
|
|
const pagination = ref({
|
|
|
|
|
page: 1,
|
|
|
|
|
rowsPerPage: 10,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const formDataSalary = reactive<FormSalaryNew>({
|
2024-09-18 17:24:21 +07:00
|
|
|
date: null, //วัน/เดือน/ปี
|
|
|
|
|
posNo: "", //ตำแหน่งเลขที่
|
|
|
|
|
templatePos: "", //ต้นแบบ (template) ตำแหน่ง
|
|
|
|
|
position: "", //ตำแหน่ง
|
|
|
|
|
positionType: "", //ประเภทตำแหน่ง, กลุ่มงาน
|
|
|
|
|
positionLevel: "", //ระดับตำแหน่ง, ระดับชั้นงาน
|
|
|
|
|
positionLine: "", // สายงาน
|
|
|
|
|
positionPathSide: "", //ด้าน/สาขา
|
|
|
|
|
positionExecutive: "", //ตำแหน่งทางการบริหาร
|
|
|
|
|
salary: null, //เงินเดือน
|
|
|
|
|
salaryPos: null, //เงินประจำตำแหน่ง
|
|
|
|
|
salaryCompensation: null, //เงินค่าตอบแทนรายเดือน
|
|
|
|
|
refCommandNo: "", //เลขที่คำสั่ง
|
|
|
|
|
templateDoc: "", //ต้นแบบ (template) เอกสารอ้างอิง
|
|
|
|
|
doc: "", //เอกสารอ้างอิง
|
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 ที่ต้องการแก้ไข
|
|
|
|
|
const dataLevel = ref<ResType[]>([]); //รายการ ตำแหน่งเงินเดือน
|
2024-03-11 17:48:15 +07:00
|
|
|
|
|
|
|
|
const posNoOptions = ref<DataOption2[]>(store.optionTemplatePos);
|
2024-05-16 17:52:44 +07:00
|
|
|
|
2024-03-27 13:51:34 +07:00
|
|
|
const posTypeOptions = ref<DataOption[]>([]);
|
|
|
|
|
const posTypeOptionsMain = ref<DataOption[]>([]);
|
|
|
|
|
const posLevelOption = ref<DataOption[]>([]);
|
|
|
|
|
const posLevelOptionMain = ref<DataOption[]>([]);
|
2024-05-16 17:52:44 +07:00
|
|
|
const positionFielOptiond = ref<DataOption[]>([]);
|
|
|
|
|
const positionFielOptiondMain = ref<DataOption[]>([]);
|
|
|
|
|
const positionAreaOptiond = ref<DataOption[]>([]);
|
|
|
|
|
const positionAreaOptiondMain = ref<DataOption[]>([]);
|
|
|
|
|
const posExecutiveOption = ref<DataOption[]>([]);
|
|
|
|
|
const posExecutiveOptionMain = ref<DataOption[]>([]);
|
2024-03-27 13:51:34 +07:00
|
|
|
|
2024-03-11 17:48:15 +07:00
|
|
|
const docOption = ref<DataOption2[]>(store.optionTemplateDoc);
|
|
|
|
|
|
2024-08-16 15:35:15 +07:00
|
|
|
/**
|
|
|
|
|
* function fetch รายการ ตำแหน่งเงินเดือน
|
|
|
|
|
*/
|
2024-03-25 11:10:53 +07:00
|
|
|
function fetchListSalary() {
|
|
|
|
|
showLoader();
|
|
|
|
|
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;
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
messageError($q, err);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
hideLoader();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-16 15:35:15 +07:00
|
|
|
/**
|
|
|
|
|
* function fetch รายการ ตำแหน่งเงินเดือน
|
|
|
|
|
*/
|
2024-03-27 13:51:34 +07:00
|
|
|
function fetchType() {
|
|
|
|
|
http
|
|
|
|
|
.get(config.API.orgPosType)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
dataLevel.value = res.data.result;
|
|
|
|
|
posTypeOptionsMain.value = res.data.result.map((e: any) => ({
|
|
|
|
|
id: e.id,
|
|
|
|
|
name: e.posTypeName,
|
|
|
|
|
}));
|
|
|
|
|
posTypeOptions.value = posTypeOptionsMain.value;
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
messageError($q, err);
|
|
|
|
|
});
|
|
|
|
|
}
|
2024-03-25 11:10:53 +07:00
|
|
|
|
2024-08-16 15:35:15 +07:00
|
|
|
/**
|
|
|
|
|
* function เลือกประเภทตำแหน่ง
|
|
|
|
|
* @param val
|
|
|
|
|
* @param status
|
|
|
|
|
*/
|
2024-03-27 13:51:34 +07:00
|
|
|
async function updateSelectType(val: string, status: boolean = false) {
|
2024-03-27 17:16:17 +07:00
|
|
|
const listLevel = await dataLevel.value.find(
|
|
|
|
|
(e: any) => e.posTypeName === val
|
|
|
|
|
);
|
2024-05-16 17:52:44 +07:00
|
|
|
|
2024-03-27 13:51:34 +07:00
|
|
|
if (listLevel) {
|
|
|
|
|
posLevelOptionMain.value = listLevel.posLevels.map((e: any) => ({
|
|
|
|
|
id: e.id,
|
2024-05-16 17:52:44 +07:00
|
|
|
name: e.posLevelName.toString(),
|
2024-03-27 13:51:34 +07:00
|
|
|
}));
|
2024-05-16 17:52:44 +07:00
|
|
|
|
2024-03-27 13:51:34 +07:00
|
|
|
formDataSalary.positionLevel = !status ? "" : formDataSalary.positionLevel;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-16 15:35:15 +07:00
|
|
|
/**
|
|
|
|
|
* function เปิด dialog ตำแหน่งเงินเดือน
|
|
|
|
|
* @param statusEdit แก้ไข,เพิ่ม
|
|
|
|
|
* @param data
|
|
|
|
|
*/
|
|
|
|
|
function onClickOpenDialog(statusEdit: boolean = false, data: any = []) {
|
2024-05-16 17:52:44 +07:00
|
|
|
if (empType.value === "") {
|
|
|
|
|
dataLevel.value.length === 0 && fetchType();
|
|
|
|
|
fetchDataOption();
|
|
|
|
|
fetchDataOptionExecutive();
|
|
|
|
|
} else {
|
|
|
|
|
fetchOptionGroup();
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-16 15:35:15 +07:00
|
|
|
// หาระดับตำแหน่ง
|
2024-03-27 13:51:34 +07:00
|
|
|
setTimeout(async () => {
|
|
|
|
|
statusEdit && (await updateSelectType(data.positionType, true));
|
|
|
|
|
isStatusEdit.value = statusEdit;
|
|
|
|
|
}, 500);
|
2024-05-21 11:17:26 +07:00
|
|
|
|
2024-03-27 13:51:34 +07:00
|
|
|
posLevelOptionMain.value = !statusEdit ? [] : posLevelOptionMain.value;
|
|
|
|
|
modalDialogSalary.value = true;
|
|
|
|
|
salaryId.value = data.id;
|
2024-03-12 11:14:52 +07:00
|
|
|
formDataSalary.date = statusEdit ? data.date : null;
|
|
|
|
|
formDataSalary.posNo = statusEdit ? data.posNo : "";
|
2024-03-27 13:51:34 +07:00
|
|
|
formDataSalary.templatePos = "";
|
|
|
|
|
formDataSalary.position = statusEdit ? data.position : "";
|
|
|
|
|
formDataSalary.positionLine = statusEdit ? data.positionLine : "";
|
|
|
|
|
formDataSalary.positionType = statusEdit ? data.positionType : "";
|
|
|
|
|
formDataSalary.positionLevel = statusEdit ? data.positionLevel : "";
|
|
|
|
|
formDataSalary.positionPathSide = statusEdit ? data.positionPathSide : "";
|
|
|
|
|
formDataSalary.positionExecutive = statusEdit ? data.positionExecutive : "";
|
2024-03-12 11:14:52 +07:00
|
|
|
formDataSalary.salaryCompensation = statusEdit ? data.mouthSalaryAmount : "";
|
2024-05-21 11:17:26 +07:00
|
|
|
formDataSalary.salary = statusEdit ? data.amount.toLocaleString() : "";
|
|
|
|
|
formDataSalary.salaryPos = statusEdit
|
|
|
|
|
? data.positionSalaryAmount.toLocaleString()
|
|
|
|
|
: "";
|
2024-03-27 13:51:34 +07:00
|
|
|
formDataSalary.refCommandNo = statusEdit ? data.refCommandNo : "";
|
|
|
|
|
formDataSalary.templateDoc = "";
|
|
|
|
|
formDataSalary.doc = statusEdit ? data.templateDoc : "";
|
2024-03-11 17:48:15 +07:00
|
|
|
}
|
2024-03-25 11:10:53 +07:00
|
|
|
|
2024-08-16 15:35:15 +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;
|
|
|
|
|
}
|
|
|
|
|
|
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) {
|
|
|
|
|
case "pos":
|
|
|
|
|
update(() => {
|
|
|
|
|
posNoOptions.value = store.optionTemplatePos.filter(
|
|
|
|
|
(v: DataOption2) => v.name.indexOf(val) > -1
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
break;
|
2024-03-27 13:51:34 +07:00
|
|
|
case "positionLine":
|
2024-03-11 17:48:15 +07:00
|
|
|
update(() => {
|
2024-05-16 17:52:44 +07:00
|
|
|
positionFielOptiond.value = positionFielOptiondMain.value.filter(
|
|
|
|
|
(v: DataOption) => v.name.indexOf(val) > -1
|
2024-03-11 17:48:15 +07:00
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
break;
|
|
|
|
|
case "posType":
|
|
|
|
|
update(() => {
|
2024-03-27 13:51:34 +07:00
|
|
|
posTypeOptions.value = posTypeOptionsMain.value.filter(
|
|
|
|
|
(v: DataOption) => v.name.indexOf(val) > -1
|
2024-03-11 17:48:15 +07:00
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
break;
|
|
|
|
|
case "posLevel":
|
|
|
|
|
update(() => {
|
2024-03-27 13:51:34 +07:00
|
|
|
posLevelOption.value = posLevelOptionMain.value.filter(
|
|
|
|
|
(v: DataOption) => v.name.indexOf(val) > -1
|
2024-03-11 17:48:15 +07:00
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
break;
|
|
|
|
|
case "doc":
|
|
|
|
|
update(() => {
|
|
|
|
|
docOption.value = store.optionTemplateDoc.filter(
|
|
|
|
|
(v: DataOption2) => v.name.indexOf(val) > -1
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
break;
|
2024-05-16 17:52:44 +07:00
|
|
|
case "positionPathSide":
|
|
|
|
|
update(() => {
|
|
|
|
|
positionAreaOptiond.value = positionAreaOptiondMain.value.filter(
|
|
|
|
|
(v: DataOption) => v.name.indexOf(val) > -1
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "positionExecutive":
|
|
|
|
|
update(() => {
|
|
|
|
|
posExecutiveOption.value = posExecutiveOptionMain.value.filter(
|
|
|
|
|
(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 เลือกต้นแบบ tamplate ตำแหน่ง
|
|
|
|
|
* @param val
|
|
|
|
|
*/
|
2024-03-11 17:48:15 +07:00
|
|
|
function updatePos(val: string) {
|
|
|
|
|
formDataSalary.position = val;
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-16 15:35:15 +07:00
|
|
|
/**
|
|
|
|
|
* function เลือกต้นแบบ tamplate เอกสาร
|
|
|
|
|
* @param val
|
|
|
|
|
*/
|
2024-03-11 17:48:15 +07:00
|
|
|
function updateDoc(val: string) {
|
|
|
|
|
formDataSalary.doc = val;
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-16 15:35:15 +07:00
|
|
|
/**
|
|
|
|
|
* function ยืนยันการบันทึกข้อมูล
|
|
|
|
|
*/
|
2024-03-11 17:48:15 +07:00
|
|
|
function onSubmit() {
|
2024-08-16 15:35:15 +07:00
|
|
|
dialogConfirm($q, async () => {
|
|
|
|
|
showLoader();
|
|
|
|
|
const formData = {
|
|
|
|
|
profileEmployeeId:
|
|
|
|
|
!isStatusEdit.value && empType.value !== ""
|
|
|
|
|
? profileId.value
|
|
|
|
|
: undefined,
|
|
|
|
|
profileId:
|
|
|
|
|
!isStatusEdit.value && empType.value === ""
|
|
|
|
|
? profileId.value
|
|
|
|
|
: undefined,
|
|
|
|
|
date: formDataSalary.date, // วันที่
|
|
|
|
|
posNo: formDataSalary.posNo, //ตำแหน่งเลขที่
|
|
|
|
|
position: formDataSalary.position, //ตำแหน่ง
|
|
|
|
|
positionLine:
|
|
|
|
|
empType.value === "" ? formDataSalary.positionLine : undefined, //สายงาน
|
|
|
|
|
positionPathSide:
|
|
|
|
|
empType.value === "" ? formDataSalary.positionPathSide : undefined, // ด้าน/สาขา
|
|
|
|
|
positionExecutive:
|
|
|
|
|
empType.value === "" ? formDataSalary.positionExecutive : undefined, //ตำแหน่งทางการบริหาร
|
|
|
|
|
positionType: formDataSalary.positionType, // ประเภทตำแหน่ง
|
|
|
|
|
positionLevel: formDataSalary.positionLevel, // ระดับตำแหน่ง
|
|
|
|
|
amount:
|
|
|
|
|
typeof formDataSalary.salary === "number"
|
|
|
|
|
? formDataSalary.salary
|
|
|
|
|
: Number(formDataSalary?.salary?.replace(/,/g, "")), //เงินเดือนฐาน
|
|
|
|
|
positionSalaryAmount:
|
|
|
|
|
typeof formDataSalary.salaryPos === "number"
|
|
|
|
|
? formDataSalary.salaryPos
|
|
|
|
|
: Number(formDataSalary?.salaryPos?.replace(/,/g, "")), // เงินประจำตำแหน่ง
|
|
|
|
|
mouthSalaryAmount:
|
|
|
|
|
typeof formDataSalary.salaryCompensation === "number"
|
|
|
|
|
? formDataSalary.salaryCompensation
|
|
|
|
|
: Number(formDataSalary?.salaryCompensation?.replace(/,/g, "")), //เงินค่าตอบแทนรายเดือน
|
|
|
|
|
refCommandNo: formDataSalary.refCommandNo, // เลขที่คำสั่ง
|
|
|
|
|
templateDoc: formDataSalary.doc, // เอกสารอ้างอิง
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
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, formData);
|
|
|
|
|
await fetchListSalary();
|
|
|
|
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
|
|
|
|
await onClickCloseDialog();
|
|
|
|
|
} catch (e) {
|
|
|
|
|
messageError($q, e);
|
|
|
|
|
} finally {
|
|
|
|
|
hideLoader();
|
|
|
|
|
}
|
2024-03-27 13:51:34 +07:00
|
|
|
});
|
2024-03-11 17:48:15 +07:00
|
|
|
}
|
|
|
|
|
|
2024-08-16 15:35:15 +07:00
|
|
|
/**
|
|
|
|
|
* function เลื่อนรายการเงินเดือนขึ้น
|
|
|
|
|
* @param id รายการเงินเดือน
|
|
|
|
|
*/
|
2024-03-28 16:00:41 +07:00
|
|
|
function onSwapUp(id: string) {
|
|
|
|
|
showLoader();
|
|
|
|
|
http
|
2024-05-14 16:05:58 +07:00
|
|
|
.get(config.API.profileSalarySwapNew("up", id, empType.value))
|
2024-08-16 15:35:15 +07:00
|
|
|
.then(async () => {
|
|
|
|
|
await fetchListSalary();
|
2024-03-28 16:00:41 +07:00
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
messageError($q, err);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
hideLoader();
|
|
|
|
|
});
|
|
|
|
|
}
|
2024-08-16 15:35:15 +07:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* function เลื่อนรายการเงินเดือนลง
|
|
|
|
|
* @param id รายการเงินเดือน
|
|
|
|
|
*/
|
2024-03-28 16:00:41 +07:00
|
|
|
function onSwapDown(id: string) {
|
|
|
|
|
showLoader();
|
|
|
|
|
http
|
2024-05-14 16:05:58 +07:00
|
|
|
.get(config.API.profileSalarySwapNew("down", id, empType.value))
|
2024-08-16 15:35:15 +07:00
|
|
|
.then(async () => {
|
|
|
|
|
await fetchListSalary();
|
2024-03-28 16:00:41 +07:00
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
messageError($q, err);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
hideLoader();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-11 17:48:15 +07:00
|
|
|
const modalHistory = ref<boolean>(false);
|
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
|
|
|
|
2024-08-16 15:35:15 +07:00
|
|
|
/**
|
|
|
|
|
* function fetch ข้อมูลสายงาน
|
|
|
|
|
*/
|
|
|
|
|
function fetchDataOption() {
|
2024-05-16 17:52:44 +07:00
|
|
|
showLoader();
|
2024-08-16 15:35:15 +07:00
|
|
|
http
|
2024-05-16 17:52:44 +07:00
|
|
|
.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: any) => {
|
|
|
|
|
if (seen.has(item.positionField)) {
|
|
|
|
|
return false;
|
|
|
|
|
} else {
|
|
|
|
|
seen.add(item.positionField);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
positionFielOptiondMain.value = listPositionField.map((e: any) => ({
|
|
|
|
|
id: e.positionField,
|
|
|
|
|
name: e.positionField,
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
const listPositionArea = data.filter((item: any) => {
|
|
|
|
|
if (
|
|
|
|
|
item.positionArea === null ||
|
|
|
|
|
item.positionArea === "" ||
|
|
|
|
|
item.positionArea === "-" ||
|
|
|
|
|
seen2.has(item.positionArea)
|
|
|
|
|
) {
|
|
|
|
|
return false;
|
|
|
|
|
} else {
|
|
|
|
|
seen2.add(item.positionArea);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
positionAreaOptiondMain.value = listPositionArea.map((e: any) => ({
|
|
|
|
|
id: e.positionArea,
|
|
|
|
|
name: e.positionArea,
|
|
|
|
|
}));
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
messageError($q, err);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
hideLoader();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-16 15:35:15 +07:00
|
|
|
/**
|
|
|
|
|
* function fetch ข้อมูลตำแหน่งข้อมูลทางการบริหาร
|
|
|
|
|
*/
|
2024-05-16 17:52:44 +07:00
|
|
|
function fetchDataOptionExecutive() {
|
|
|
|
|
showLoader();
|
|
|
|
|
http
|
|
|
|
|
.get(config.API.orgPosExecutive)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
const data = res.data.result;
|
|
|
|
|
posExecutiveOptionMain.value = data.map((e: any) => ({
|
|
|
|
|
id: e.posExecutiveName,
|
|
|
|
|
name: e.posExecutiveName,
|
|
|
|
|
}));
|
|
|
|
|
})
|
|
|
|
|
.catch((e) => {
|
|
|
|
|
messageError($q, e);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
hideLoader();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-16 15:35:15 +07:00
|
|
|
/**
|
|
|
|
|
* function fetch ข้อมูลปรเภทตำแหน่ง
|
|
|
|
|
*/
|
|
|
|
|
function fetchOptionGroup() {
|
2024-05-16 17:52:44 +07:00
|
|
|
showLoader();
|
2024-08-16 15:35:15 +07:00
|
|
|
http
|
2024-05-16 17:52:44 +07:00
|
|
|
.get(config.API.orgEmployeeType)
|
2024-08-16 15:35:15 +07:00
|
|
|
.then((res) => {
|
2024-05-16 17:52:44 +07:00
|
|
|
dataLevel.value = res.data.result;
|
|
|
|
|
posTypeOptionsMain.value = res.data.result.map((e: any) => ({
|
|
|
|
|
id: e.id,
|
|
|
|
|
name: e.posTypeName,
|
|
|
|
|
}));
|
|
|
|
|
posTypeOptions.value = posTypeOptionsMain.value;
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
messageError($q, err);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
hideLoader();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-05 12:58:48 +07:00
|
|
|
const classInput = (val: boolean) => {
|
|
|
|
|
return {
|
|
|
|
|
"full-width inputgreen cursor-pointer": val,
|
|
|
|
|
"full-width cursor-pointer": !val,
|
|
|
|
|
};
|
|
|
|
|
};
|
2024-09-18 17:24:21 +07:00
|
|
|
|
2024-10-22 16:16:54 +07:00
|
|
|
function onRefCommand(data: ResListSalary) {
|
|
|
|
|
modalCommand.value = true;
|
|
|
|
|
command.value = data.refCommandNo;
|
|
|
|
|
commandId.value = data.commandId;
|
|
|
|
|
// commandId.value = 'bdf9da91-ba45-497a-a2b7-cc49e2446d97'; //จำลอง
|
|
|
|
|
}
|
2024-09-18 17:24:21 +07:00
|
|
|
/**
|
|
|
|
|
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
|
|
|
|
*/
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
fetchListSalary();
|
|
|
|
|
});
|
2024-03-11 17:48:15 +07:00
|
|
|
</script>
|
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-10-21 17:56:47 +07:00
|
|
|
v-if="!props.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-08-16 15:35:15 +07:00
|
|
|
<q-input dense outlined v-model="keyword" label="ค้นหา" class="q-mr-sm">
|
2024-03-11 17:48:15 +07:00
|
|
|
<template v-slot:append>
|
2024-08-16 15:35:15 +07:00
|
|
|
<q-icon v-if="keyword == ''" name="search" />
|
2024-03-27 13:51:34 +07:00
|
|
|
<q-icon
|
|
|
|
|
v-else
|
|
|
|
|
name="clear"
|
|
|
|
|
class="cursor-pointer"
|
2024-08-16 15:35:15 +07:00
|
|
|
@click="keyword = ''"
|
2024-03-27 13:51:34 +07:00
|
|
|
/>
|
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"
|
|
|
|
|
options-cover
|
|
|
|
|
style="min-width: 150px"
|
|
|
|
|
/>
|
2024-04-24 17:26:12 +07:00
|
|
|
</div>
|
2024-03-11 17:48:15 +07:00
|
|
|
<d-table
|
|
|
|
|
ref="table"
|
|
|
|
|
row-key="id"
|
|
|
|
|
flat
|
|
|
|
|
bordered
|
|
|
|
|
dense
|
2024-08-16 15:35:15 +07:00
|
|
|
:filter="keyword"
|
2024-03-11 17:48:15 +07:00
|
|
|
:columns="columns"
|
|
|
|
|
:rows="rows"
|
|
|
|
|
:paging="true"
|
|
|
|
|
v-model:pagination="pagination"
|
|
|
|
|
:rows-per-page-options="[20, 50, 100]"
|
|
|
|
|
: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">
|
2024-08-05 12:58:48 +07:00
|
|
|
<q-tr :props="props">
|
2024-08-13 11:22:48 +07:00
|
|
|
<q-td>
|
2024-03-29 11:31:43 +07:00
|
|
|
<q-btn
|
|
|
|
|
flat
|
|
|
|
|
dense
|
|
|
|
|
round
|
2024-08-05 12:58:48 +07:00
|
|
|
color="deep-purple"
|
|
|
|
|
icon="mdi-history"
|
|
|
|
|
@click="onClikcHistory(props.row.id)"
|
2024-03-29 11:31:43 +07:00
|
|
|
>
|
2024-08-05 12:58:48 +07:00
|
|
|
<q-tooltip>ประวัติแก้ไขตำแหน่ง/เงินเดือน</q-tooltip>
|
2024-03-29 11:31:43 +07:00
|
|
|
</q-btn>
|
2024-08-05 12:58:48 +07:00
|
|
|
|
2024-03-11 17:48:15 +07:00
|
|
|
<q-btn
|
2024-10-22 16:16:54 +07:00
|
|
|
v-if="
|
|
|
|
|
props.isLeave == false && checkPermission($route)?.attrIsUpdate
|
|
|
|
|
"
|
2024-03-11 17:48:15 +07:00
|
|
|
flat
|
|
|
|
|
dense
|
|
|
|
|
round
|
2024-08-05 12:58:48 +07:00
|
|
|
color="edit"
|
|
|
|
|
icon="edit"
|
|
|
|
|
clickable
|
|
|
|
|
@click="onClickOpenDialog(true, props.row)"
|
2024-03-11 17:48:15 +07:00
|
|
|
>
|
2024-08-05 12:58:48 +07:00
|
|
|
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
2024-03-11 17:48:15 +07:00
|
|
|
</q-btn>
|
2024-08-13 11:22:48 +07:00
|
|
|
<q-btn
|
2024-10-22 16:16:54 +07:00
|
|
|
v-if="
|
|
|
|
|
props.isLeave == false && checkPermission($route)?.attrIsUpdate
|
|
|
|
|
"
|
2024-08-13 11:22:48 +07:00
|
|
|
dense
|
|
|
|
|
flat
|
|
|
|
|
round
|
|
|
|
|
:color="props.rowIndex + 1 == 1 ? 'grey' : 'green'"
|
|
|
|
|
:disable="props.rowIndex + 1 == 1"
|
|
|
|
|
icon="mdi-arrow-up-bold"
|
|
|
|
|
@click="onSwapUp(props.row.id)"
|
|
|
|
|
>
|
|
|
|
|
</q-btn>
|
|
|
|
|
|
|
|
|
|
<q-btn
|
2024-10-22 16:16:54 +07:00
|
|
|
v-if="
|
|
|
|
|
props.isLeave == false && checkPermission($route)?.attrIsUpdate
|
|
|
|
|
"
|
2024-08-13 11:22:48 +07:00
|
|
|
dense
|
|
|
|
|
flat
|
|
|
|
|
round
|
|
|
|
|
:color="rows.length == props.rowIndex + 1 ? 'grey' : 'red'"
|
|
|
|
|
:disable="rows.length == props.rowIndex + 1"
|
|
|
|
|
icon="mdi-arrow-down-bold"
|
|
|
|
|
@click="onSwapDown(props.row.id)"
|
|
|
|
|
>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</q-td>
|
2024-10-21 17:56:47 +07:00
|
|
|
|
2024-07-24 16:37:04 +07:00
|
|
|
<q-td v-for="col in props.cols" :key="col.id">
|
2024-10-22 16:16:54 +07:00
|
|
|
<div
|
2024-10-28 18:09:33 +07:00
|
|
|
v-if="col.name == 'refCommandNo' && props.row.commandId"
|
2024-10-22 16:16:54 +07:00
|
|
|
@click="col.value ? onRefCommand(props.row) : null"
|
|
|
|
|
:class="
|
|
|
|
|
col.value
|
|
|
|
|
? 'table_ellipsis text-blue cursor-pointer'
|
|
|
|
|
: 'table_ellipsis'
|
|
|
|
|
"
|
|
|
|
|
>
|
|
|
|
|
{{ col.value ? col.value : "-" }}
|
2024-10-28 18:09:33 +07:00
|
|
|
<q-tooltip v-if="col.value">ดูคำสั่ง</q-tooltip>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else-if="col.name == 'refCommandNo' && !props.row.commandId">
|
|
|
|
|
-
|
2024-10-22 16:16:54 +07:00
|
|
|
</div>
|
|
|
|
|
<div v-else class="table_ellipsis">
|
2024-07-24 16:37:04 +07:00
|
|
|
{{ col.value ? col.value : "-" }}
|
|
|
|
|
</div>
|
|
|
|
|
</q-td>
|
2024-03-11 17:48:15 +07:00
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
</d-table>
|
|
|
|
|
|
2024-04-02 12:03:53 +07:00
|
|
|
<q-dialog v-model="modalDialogSalary" persistent>
|
2024-05-16 17:52:44 +07:00
|
|
|
<q-card style="width: 900px; max-width: 80vw">
|
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
|
|
|
|
|
:tittle="
|
|
|
|
|
isStatusEdit ? 'แก้ไขตำแหน่งเงินเดือน' : 'เพิ่มตำแหน่งเงินเดือน'
|
|
|
|
|
"
|
|
|
|
|
: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">
|
2024-05-14 16:05:58 +07:00
|
|
|
<div class="col-xs-6 col-sm-6 col-md-6">
|
|
|
|
|
<datepicker
|
|
|
|
|
v-model="formDataSalary.date"
|
|
|
|
|
:locale="'th'"
|
|
|
|
|
autoApply
|
|
|
|
|
:enableTimePicker="false"
|
|
|
|
|
week-start="0"
|
2024-08-05 12:58:48 +07:00
|
|
|
:class="classInput(true)"
|
2024-05-14 16:05:58 +07:00
|
|
|
>
|
|
|
|
|
<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(formDataSalary.date)"
|
|
|
|
|
:rules="[
|
2024-04-24 17:26:12 +07:00
|
|
|
(val: string) =>
|
|
|
|
|
!!val ||
|
|
|
|
|
`${'กรุณาเลือก วัน/เดือน/ปี'}`,
|
|
|
|
|
]"
|
2024-05-14 16:05:58 +07:00
|
|
|
: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-6 col-md-6">
|
|
|
|
|
<q-input
|
|
|
|
|
ref="posNoRef"
|
2024-08-05 12:58:48 +07:00
|
|
|
:class="classInput(true)"
|
2024-05-14 16:05:58 +07:00
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
lazy-rules
|
|
|
|
|
borderless
|
|
|
|
|
v-model="formDataSalary.posNo"
|
|
|
|
|
hide-bottom-space
|
2024-06-26 14:15:54 +07:00
|
|
|
:label="`${'ตำแหน่งเลขที่'}`"
|
|
|
|
|
:rules="[(val: string) => !!val || `${'กรุณากรอกตำแหน่งเลขที่'}`]"
|
2024-05-14 16:05:58 +07:00
|
|
|
>
|
|
|
|
|
</q-input>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-xs-12 col-sm-12 col-md-12">
|
|
|
|
|
<q-select
|
|
|
|
|
ref="templatePosRef"
|
2024-08-05 12:58:48 +07:00
|
|
|
:class="classInput(true)"
|
2024-05-14 16:05:58 +07:00
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
lazy-rules
|
|
|
|
|
borderless
|
|
|
|
|
clearable
|
|
|
|
|
v-model="formDataSalary.templatePos"
|
|
|
|
|
:label="`${'ต้นแบบ (template) ตำแหน่ง'}`"
|
|
|
|
|
option-label="name"
|
|
|
|
|
:options="posNoOptions"
|
|
|
|
|
option-value="name"
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
emit-value
|
|
|
|
|
use-input
|
|
|
|
|
input-debounce="0"
|
|
|
|
|
@update:modelValue="updatePos"
|
2024-09-18 17:24:21 +07:00
|
|
|
@filter="(inputValue: string,
|
2024-04-24 17:26:12 +07:00
|
|
|
doneFn: Function) => filterSelector(inputValue, doneFn, 'pos'
|
|
|
|
|
)"
|
2024-05-14 16:05:58 +07:00
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-xs-12 col-sm-12 col-md-12">
|
|
|
|
|
<q-input
|
|
|
|
|
ref="positionRef"
|
2024-08-05 12:58:48 +07:00
|
|
|
:class="classInput(true)"
|
2024-05-14 16:05:58 +07:00
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
lazy-rules
|
|
|
|
|
borderless
|
|
|
|
|
v-model="formDataSalary.position"
|
|
|
|
|
:label="`${'ตำแหน่ง'}`"
|
|
|
|
|
type="textarea"
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
:rules="[(val: string) => !!val || `${'กรุณากรอกตำแหน่ง'}`]"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-xs-6 col-sm-6 col-md-4">
|
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
|
2024-05-16 17:52:44 +07:00
|
|
|
v-model="formDataSalary.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
|
|
|
|
|
input-debounce="0"
|
2024-05-16 17:52:44 +07:00
|
|
|
@update:model-value="updateSelectType"
|
2024-05-24 14:58:40 +07:00
|
|
|
:rules="empType == '' ? [(val: string) => !!val || 'กรุณาเลือกประเภทตำแหน่ง' ]:[(val: string) => !!val || 'กรุณาเลือกกลุ่มงาน' ]"
|
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-05-16 17:52:44 +07:00
|
|
|
/>
|
2024-05-14 16:05:58 +07:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-xs-6 col-sm-6 col-md-4">
|
2024-05-16 17:52:44 +07:00
|
|
|
<q-select
|
2024-08-05 12:58:48 +07:00
|
|
|
:class="classInput(true)"
|
2024-05-16 17:52:44 +07:00
|
|
|
ref="positionLevel Ref"
|
2024-05-14 16:05:58 +07:00
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
lazy-rules
|
2024-05-16 17:52:44 +07:00
|
|
|
borderless
|
|
|
|
|
v-model="formDataSalary.positionLevel"
|
|
|
|
|
:rules="empType == '' ? [(val: string) => !!val || 'กรุณาเลือกระดับตำแหน่ง' ] : [(val: string) => !!val || 'กรุณาเลือกระดับชั้นงาน']"
|
|
|
|
|
:label="empType == '' ? 'ระดับตำแหน่ง' : 'ระดับชั้นงาน'"
|
|
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
option-label="name"
|
|
|
|
|
:options="posLevelOption"
|
|
|
|
|
option-value="name"
|
2024-05-14 16:05:58 +07:00
|
|
|
hide-bottom-space
|
2024-05-16 17:52:44 +07:00
|
|
|
use-input
|
|
|
|
|
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-05-14 16:05:58 +07:00
|
|
|
/>
|
|
|
|
|
</div>
|
2024-05-16 17:52:44 +07:00
|
|
|
<div class="col-md-4"></div>
|
|
|
|
|
|
|
|
|
|
<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
|
2024-05-16 17:52:44 +07:00
|
|
|
v-model="formDataSalary.positionLine"
|
|
|
|
|
:label="`${'สายงาน'}`"
|
|
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
option-label="name"
|
|
|
|
|
:options="positionFielOptiond"
|
|
|
|
|
option-value="id"
|
2024-05-14 16:05:58 +07:00
|
|
|
hide-bottom-space
|
2024-05-16 17:52:44 +07:00
|
|
|
use-input
|
|
|
|
|
clearable
|
|
|
|
|
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, 'positionLine'
|
|
|
|
|
)"
|
|
|
|
|
/>
|
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
|
2024-05-16 17:52:44 +07:00
|
|
|
v-model="formDataSalary.positionPathSide"
|
|
|
|
|
:label="`${'ด้าน/สาขา'}`"
|
2024-05-14 16:05:58 +07:00
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
option-label="name"
|
2024-05-16 17:52:44 +07:00
|
|
|
:options="positionAreaOptiond"
|
|
|
|
|
option-value="id"
|
2024-05-14 16:05:58 +07:00
|
|
|
hide-bottom-space
|
|
|
|
|
use-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,
|
2024-05-16 17:52:44 +07:00
|
|
|
doneFn: Function) => filterSelector(inputValue, doneFn, 'positionPathSide'
|
2024-04-24 17:26:12 +07:00
|
|
|
)"
|
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
|
2024-05-16 17:52:44 +07:00
|
|
|
v-model="formDataSalary.positionExecutive"
|
|
|
|
|
:label="`${'ตำแหน่งทางการบริหาร'}`"
|
2024-05-14 16:05:58 +07:00
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
option-label="name"
|
2024-05-16 17:52:44 +07:00
|
|
|
:options="posExecutiveOption"
|
|
|
|
|
option-value="id"
|
2024-05-14 16:05:58 +07:00
|
|
|
hide-bottom-space
|
|
|
|
|
use-input
|
|
|
|
|
input-debounce="0"
|
2024-05-16 17:52:44 +07:00
|
|
|
clearable
|
2024-09-18 17:24:21 +07:00
|
|
|
@filter="(inputValue: string,
|
2024-05-16 17:52:44 +07:00
|
|
|
doneFn: Function) => filterSelector(inputValue, doneFn, 'positionExecutive'
|
|
|
|
|
)"
|
2024-05-14 16:05:58 +07:00
|
|
|
/>
|
|
|
|
|
</div>
|
2024-05-16 17:52:44 +07:00
|
|
|
|
2024-05-14 16:05:58 +07:00
|
|
|
<div class="col-xs-6 col-sm-6 col-md-4">
|
|
|
|
|
<q-input
|
2024-08-05 12:58:48 +07:00
|
|
|
:class="classInput(true)"
|
2024-05-14 16:05:58 +07:00
|
|
|
ref="salaryRef"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
v-model="formDataSalary.salary"
|
|
|
|
|
label="เงินเดือน"
|
|
|
|
|
mask="###,###,###,###"
|
|
|
|
|
reverse-fill-mask
|
2024-09-26 13:45:30 +07:00
|
|
|
:rules="[(val:string) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
|
2024-05-14 16:05:58 +07:00
|
|
|
lazy-rules
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-xs-6 col-sm-6 col-md-4">
|
|
|
|
|
<q-input
|
2024-08-05 12:58:48 +07:00
|
|
|
:class="classInput(true)"
|
2024-05-14 16:05:58 +07:00
|
|
|
ref="amountRef"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
v-model="formDataSalary.salaryPos"
|
2024-09-26 13:45:30 +07:00
|
|
|
:rules="[(val:string) => !!val || `${'กรุณากรอกเงินประจำตำแหน่ง'}`]"
|
2024-05-14 16:05:58 +07:00
|
|
|
label="เงินประจำตำแหน่ง"
|
|
|
|
|
mask="###,###,###,###"
|
|
|
|
|
reverse-fill-mask
|
|
|
|
|
lazy-rules
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2024-05-16 17:52:44 +07:00
|
|
|
|
2024-05-14 16:05:58 +07:00
|
|
|
<div class="col-xs-6 col-sm-6 col-md-4">
|
|
|
|
|
<q-input
|
2024-08-05 12:58:48 +07:00
|
|
|
:class="classInput(true)"
|
2024-05-14 16:05:58 +07:00
|
|
|
ref="amountRef"
|
|
|
|
|
dense
|
|
|
|
|
outlined
|
|
|
|
|
v-model="formDataSalary.salaryCompensation"
|
|
|
|
|
label="เงินค่าตอบแทนรายเดือน"
|
|
|
|
|
mask="###,###,###,###"
|
|
|
|
|
reverse-fill-mask
|
|
|
|
|
lazy-rules
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-xs-6 col-sm-6 col-md-12">
|
|
|
|
|
<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
|
|
|
|
|
v-model="formDataSalary.refCommandNo"
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
:label="`${'เลขที่คำสั่ง'}`"
|
|
|
|
|
mask="#####################"
|
|
|
|
|
>
|
|
|
|
|
<!-- :rules="[(val: string) => !!val || `${'กรุณากรอกเลขที่คำสั่ง'}`]" -->
|
|
|
|
|
</q-input>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-xs-12 col-sm-12 col-md-12">
|
|
|
|
|
<q-select
|
2024-08-05 12:58:48 +07:00
|
|
|
:class="classInput(true)"
|
2024-05-14 16:05:58 +07:00
|
|
|
ref="templateDocRef"
|
|
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
lazy-rules
|
|
|
|
|
borderless
|
|
|
|
|
clearable
|
|
|
|
|
v-model="formDataSalary.templateDoc"
|
|
|
|
|
:label="`${'ต้นแบบ (template) เอกสารอ้างอิง'}`"
|
|
|
|
|
option-label="name"
|
|
|
|
|
:options="docOption"
|
|
|
|
|
option-value="name"
|
|
|
|
|
emit-value
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
use-input
|
|
|
|
|
input-debounce="0"
|
|
|
|
|
@update:modelValue="updateDoc"
|
2024-09-18 17:24:21 +07:00
|
|
|
@filter="(inputValue: string,
|
2024-04-24 17:26:12 +07:00
|
|
|
doneFn: Function) => filterSelector(inputValue, doneFn, 'doc'
|
2024-03-11 17:48:15 +07:00
|
|
|
)"
|
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
|
|
|
|
|
lazy-rules
|
|
|
|
|
borderless
|
|
|
|
|
v-model="formDataSalary.doc"
|
|
|
|
|
:label="`${'เอกสารอ้างอิง'}`"
|
|
|
|
|
type="textarea"
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
:rules="[(val: number) => !!val || `${'กรุณากรอกเอกสารอ้างอิง'}`]"
|
|
|
|
|
/>
|
|
|
|
|
</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>
|
|
|
|
|
|
2024-03-27 13:51:34 +07:00
|
|
|
<DialogHistory v-model:modal="modalHistory" v-model:salaryId="salaryId" />
|
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>
|