ปรับรายการผังบัญชีเงินเดือนข้าราชการ

This commit is contained in:
setthawutttty 2024-03-07 13:31:58 +07:00
parent c3ff2a270e
commit c9dfcc755f
3 changed files with 43 additions and 63 deletions

View file

@ -49,7 +49,7 @@ const props = defineProps({
const salaryId = ref<string>("");
const formData = reactive<FormData>({
salaryType: "", //* (OFFICER->"",EMPLOYEE->"")
name: "", //*
posTypeId: "", //*
posLevelId: "", //*
isActive: false, //*
@ -61,21 +61,16 @@ const formData = reactive<FormData>({
});
/** ตัวแปร ref สำหรับแสดง validate */
const salaryTypeRef = ref<Object | null>(null);
const nameRef = ref<Object | null>(null);
const posTypeRef = ref<Object | null>(null);
const posLevelRef = ref<Object | null>(null);
const ObjectRef: ObjectSalaryRef = {
salaryType: salaryTypeRef,
name: nameRef,
posTypId: posTypeRef,
posLevelId: posLevelRef,
};
const salaryTypeOption = ref<DataOption[]>([
{ id: "OFFICER", name: "ข้าราชการกรุงเทพมหานครสามัญ" },
{ id: "EMPLOYEE", name: "ลูกจ้างประจำกรุงเทพมหานคร" },
]);
const posType = ref<SalaryPosType[]>([]);
const salaryPosTypeOption = ref<DataOption[]>([]);
const salaryPosLevelOption = ref<DataOption[]>([]);
@ -130,7 +125,7 @@ async function fetchSalaryDetail(id: string) {
.get(config.API.salaryChartByid(id))
.then((res) => {
const data = res.data.result;
formData.salaryType = data.salaryType;
formData.name = data.name;
formData.posTypeId = data.posTypeId;
formData.posLevelId = data.posLevelId;
formData.isActive = data.isActive;
@ -191,7 +186,7 @@ function closeDialog() {
}
function clearFormData() {
formData.salaryType = "";
formData.name = "";
formData.posTypeId = "";
formData.posLevelId = "";
formData.isSpecial = false;
@ -263,21 +258,17 @@ function checkEndDate() {
<div class="col-md-12">
<div class="row col-12 q-col-gutter-sm">
<div class="col-xs-12 col-md-3">
<q-select
<q-input
:readonly="isReadonly"
ref="salaryTypeRef"
ref="nameRef"
dense
hide-bottom-space
outlined
option-label="name"
option-value="id"
emit-value
map-options
v-model="formData.salaryType"
:options="salaryTypeOption"
label="ประเภทผังบัญชีเงินเดือน"
v-model="formData.name"
label="ชื่อผังบัญชีอัตราเงินเดือน"
la
:rules="[
(val) => !!val || 'กรุณาเลือกประเภทผังบัญชีเงินเดือน',
(val) => !!val || 'กรุณากรอกชื่อผังบัญชีอัตราเงินเดือน',
]"
lazy-rules
/>