Refactoring code module 04_registryPerson

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-09-18 17:24:21 +07:00
parent 1164d79122
commit eeb92dfb5d
46 changed files with 1935 additions and 2230 deletions

View file

@ -44,6 +44,9 @@ const {
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
//Table
const rows = ref<ResListSalary[]>([]); //
const keyword = ref<string>(""); //
const baseColumns = ref<QTableProps["columns"]>([
{
name: "date",
@ -161,31 +164,29 @@ const pagination = ref({
page: 1,
rowsPerPage: 10,
});
const rows = ref<ResListSalary[]>([]);
const keyword = ref<string>("");
const formDataSalary = reactive<FormSalaryNew>({
date: null,
posNo: "",
templatePos: "",
position: "",
positionLine: "",
positionPathSide: "",
positionType: "",
positionLevel: "",
positionExecutive: "",
salaryCompensation: null,
salary: null,
salaryPos: null,
refCommandNo: "",
templateDoc: "",
doc: "",
date: null, ////
posNo: "", //
templatePos: "", // (template)
position: "", //
positionType: "", //,
positionLevel: "", //,
positionLine: "", //
positionPathSide: "", ///
positionExecutive: "", //
salary: null, //
salaryPos: null, //
salaryCompensation: null, //
refCommandNo: "", //
templateDoc: "", // (template)
doc: "", //
});
const modalDialogSalary = ref<boolean>(false);
const isStatusEdit = ref<boolean>(false);
const salaryId = ref<string>("");
const dataLevel = ref<ResType[]>([]);
const modalDialogSalary = ref<boolean>(false); // popup
const isStatusEdit = ref<boolean>(false); //
const salaryId = ref<string>(""); //id
const dataLevel = ref<ResType[]>([]); //
const posNoOptions = ref<DataOption2[]>(store.optionTemplatePos);
@ -314,7 +315,7 @@ function onClickCloseDialog() {
* @param update function จาก quasar
* @param filtername type กำหนด ของ input นๆ
*/
function filterSelector(val: any, update: Function, filtername: string) {
function filterSelector(val: string, update: Function, filtername: string) {
switch (filtername) {
case "pos":
update(() => {
@ -593,16 +594,19 @@ function fetchOptionGroup() {
});
}
onMounted(() => {
fetchListSalary();
});
const classInput = (val: boolean) => {
return {
"full-width inputgreen cursor-pointer": val,
"full-width cursor-pointer": !val,
};
};
/**
* ทำงานเม Components กเรยกใชงาน
*/
onMounted(() => {
fetchListSalary();
});
</script>
<template>
<div class="row items-center q-gutter-x-sm q-pb-sm">
@ -815,7 +819,7 @@ const classInput = (val: boolean) => {
use-input
input-debounce="0"
@update:modelValue="updatePos"
@filter="(inputValue: any,
@filter="(inputValue: string,
doneFn: Function) => filterSelector(inputValue, doneFn, 'pos'
)"
/>
@ -857,7 +861,7 @@ const classInput = (val: boolean) => {
input-debounce="0"
@update:model-value="updateSelectType"
:rules="empType == '' ? [(val: string) => !!val || 'กรุณาเลือกประเภทตำแหน่ง' ]:[(val: string) => !!val || 'กรุณาเลือกกลุ่มงาน' ]"
@filter="(inputValue: any,
@filter="(inputValue: string,
doneFn: Function) => filterSelector(inputValue, doneFn, 'posType'
)"
/>
@ -882,7 +886,7 @@ const classInput = (val: boolean) => {
hide-bottom-space
use-input
input-debounce="0"
@filter="(inputValue: any,
@filter="(inputValue: string,
doneFn: Function) => filterSelector(inputValue, doneFn, 'posLevel'
)"
/>
@ -907,7 +911,7 @@ const classInput = (val: boolean) => {
use-input
clearable
input-debounce="0"
@filter="(inputValue: any,
@filter="(inputValue: string,
doneFn: Function) => filterSelector(inputValue, doneFn, 'positionLine'
)"
/>
@ -931,7 +935,7 @@ const classInput = (val: boolean) => {
use-input
clearable
input-debounce="0"
@filter="(inputValue: any,
@filter="(inputValue: string,
doneFn: Function) => filterSelector(inputValue, doneFn, 'positionPathSide'
)"
/>
@ -955,7 +959,7 @@ const classInput = (val: boolean) => {
use-input
input-debounce="0"
clearable
@filter="(inputValue: any,
@filter="(inputValue: string,
doneFn: Function) => filterSelector(inputValue, doneFn, 'positionExecutive'
)"
/>
@ -1043,7 +1047,7 @@ const classInput = (val: boolean) => {
use-input
input-debounce="0"
@update:modelValue="updateDoc"
@filter="(inputValue: any,
@filter="(inputValue: string,
doneFn: Function) => filterSelector(inputValue, doneFn, 'doc'
)"
/>