updated position

This commit is contained in:
Warunee Tamkoo 2025-03-11 18:07:37 +07:00
parent 83f7df51d8
commit fadeecf43f
5 changed files with 177 additions and 145 deletions

View file

@ -51,7 +51,7 @@ const {
onSearchDataTable, onSearchDataTable,
formatDatePosition, formatDatePosition,
findOrgName, findOrgName,
convertDateToAPI convertDateToAPI,
} = useCounterMixin(); } = useCounterMixin();
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? "")); const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
@ -296,6 +296,7 @@ const formData = reactive<FormPostition>({
positionType: "", // | positionType: "", // |
positionLevel: "", // | positionLevel: "", // |
positionLine: "", // positionLine: "", //
positionCee: "", //
positionPathSide: "", /// positionPathSide: "", ///
positionExecutive: "", // positionExecutive: "", //
amount: null, // amount: null, //
@ -529,9 +530,9 @@ async function fetchDataTenure() {
* @param status แกไข , เพ * @param status แกไข , เพ
*/ */
async function updateSelectType(val: string, status: boolean = false) { async function updateSelectType(val: string, status: boolean = false) {
const listLevel = dataLevel.value.find( const listLevel = val
(e: DataPosType) => e.posTypeName === val ? dataLevel.value.find((e: DataPosType) => e.posTypeName === val)
); : null;
if (listLevel) { if (listLevel) {
store.posLevelData = listLevel.posLevels.map((e: DataPosLevel) => ({ store.posLevelData = listLevel.posLevels.map((e: DataPosLevel) => ({
@ -543,6 +544,9 @@ async function updateSelectType(val: string, status: boolean = false) {
})); }));
formData.positionLevel = !status ? "" : formData.positionLevel; formData.positionLevel = !status ? "" : formData.positionLevel;
} else {
store.posLevelData = [];
formData.positionLevel = "";
} }
} }
@ -588,6 +592,7 @@ async function onClickOpenDialog(
formData.positionName = statusEdit ? data.positionName : ""; formData.positionName = statusEdit ? data.positionName : "";
formData.positionType = statusEdit ? data.positionType : ""; formData.positionType = statusEdit ? data.positionType : "";
formData.positionLevel = statusEdit ? data.positionLevel : ""; formData.positionLevel = statusEdit ? data.positionLevel : "";
formData.positionCee = statusEdit ? data.positionCee : "";
formData.positionLine = statusEdit ? data.positionLine : ""; formData.positionLine = statusEdit ? data.positionLine : "";
formData.positionPathSide = statusEdit ? data.positionPathSide : ""; formData.positionPathSide = statusEdit ? data.positionPathSide : "";
formData.positionExecutive = statusEdit ? data.positionExecutive : ""; formData.positionExecutive = statusEdit ? data.positionExecutive : "";
@ -913,7 +918,8 @@ onMounted(async () => {
<q-card-section style="max-height: 100%" class="scroll"> <q-card-section style="max-height: 100%" class="scroll">
<div class="row col-12 q-col-gutter-sm"> <div class="row col-12 q-col-gutter-sm">
<div class="col-xs-12 col-sm-12 col-md-12"> <div class="col-xs-12 col-sm-12 col-md-8">
<!-- :rules="[(val: string) => !!val || 'กรุณาเลือกประเภทคำสั่ง']" -->
<q-select <q-select
outlined outlined
:class="classInput(true)" :class="classInput(true)"
@ -933,7 +939,6 @@ onMounted(async () => {
fill-input fill-input
input-debounce="0" input-debounce="0"
@update:model-value="updateSelectType" @update:model-value="updateSelectType"
:rules="[(val: string) => !!val || 'กรุณาเลือกประเภทคำสั่ง']"
@filter="(inputValue: string, @filter="(inputValue: string,
doneFn: Function) => filterSelector(inputValue, doneFn, 'commandCode' doneFn: Function) => filterSelector(inputValue, doneFn, 'commandCode'
)" )"
@ -948,7 +953,43 @@ onMounted(async () => {
</q-select> </q-select>
</div> </div>
<div class="col-xs-6 col-sm-12 col-md-6"> <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">
<div class="row q-col-gutter-sm"> <div class="row q-col-gutter-sm">
<div class="col-6"> <div class="col-6">
<q-input <q-input
@ -962,10 +1003,9 @@ onMounted(async () => {
:label="`${'เลขที่คำสั่ง'}`" :label="`${'เลขที่คำสั่ง'}`"
/> />
</div> </div>
<label class="col-1 flex justify-center items-center text-bold" <label class="col-1 flex justify-center items-center">/</label>
>/</label
>
<div class="col-5"> <div class="col-5">
<!-- :rules="[(val:string) => !!val || `${'กรุณากรอก พ.ศ.'}`]" -->
<datepicker <datepicker
menu-class-name="modalfix" menu-class-name="modalfix"
v-model="formData.commandYear" v-model="formData.commandYear"
@ -990,7 +1030,6 @@ onMounted(async () => {
: formData.commandYear + 543 : formData.commandYear + 543
" "
:label="`${'พ.ศ.'}`" :label="`${'พ.ศ.'}`"
:rules="[(val:string) => !!val || `${'กรุณากรอก พ.ศ.'}`]"
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon
@ -1007,47 +1046,8 @@ onMounted(async () => {
</div> </div>
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-3"> <div class="col-xs-6 col-sm-6 col-md-4">
<datepicker <!-- :rules="[ (val: string) => !!val || `${'กรุณาเลือก วันที่ลงนาม'}`,]" -->
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)"
:rules="[
(val: string) =>
!!val ||
`${'กรุณาเลือกวันที่คำสั่งมีผล'}`,
]"
: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-3">
<datepicker <datepicker
v-model="formData.commandDateSign" v-model="formData.commandDateSign"
:locale="'th'" :locale="'th'"
@ -1066,11 +1066,6 @@ onMounted(async () => {
dense dense
borderless borderless
:model-value="date2Thai(formData.commandDateSign)" :model-value="date2Thai(formData.commandDateSign)"
:rules="[
(val: string) =>
!!val ||
`${'กรุณาเลือก วันที่ลงนาม'}`,
]"
:label="`${'วันที่ลงนาม'}`" :label="`${'วันที่ลงนาม'}`"
hide-bottom-space hide-bottom-space
> >
@ -1087,6 +1082,10 @@ onMounted(async () => {
</datepicker> </datepicker>
</div> </div>
<div class="col-12">
<q-separator />
</div>
<div class="col-xs-6 col-sm-6 col-md-4"> <div class="col-xs-6 col-sm-6 col-md-4">
<q-input <q-input
:class="classInput(true)" :class="classInput(true)"
@ -1102,6 +1101,7 @@ onMounted(async () => {
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-4"> <div class="col-xs-6 col-sm-6 col-md-4">
<!-- :rules="[(val: string) => !!val || `${'กรุณากรอกตำแหน่งเลขที่'}`]" -->
<q-input <q-input
:class="classInput(true)" :class="classInput(true)"
outlined outlined
@ -1111,12 +1111,12 @@ onMounted(async () => {
v-model="formData.posNo" v-model="formData.posNo"
hide-bottom-space hide-bottom-space
:label="`${'ตำแหน่งเลขที่'}`" :label="`${'ตำแหน่งเลขที่'}`"
:rules="[(val: string) => !!val || `${'กรุณากรอกตำแหน่งเลขที่'}`]"
> >
</q-input> </q-input>
</div> </div>
<div class="col-xs-12 col-sm-6 col-md-4"> <div class="col-xs-12 col-sm-6 col-md-4">
<!-- :rules="empType == '' ? [(val: string) => !!val || 'กรุณากรอกตำแหน่งในสายงาน' ] : [(val: string) => !!val || 'กรุณากรอกตำแหน่ง']" -->
<q-input <q-input
:class="classInput(true)" :class="classInput(true)"
outlined outlined
@ -1126,11 +1126,11 @@ onMounted(async () => {
v-model="formData.positionName" v-model="formData.positionName"
:label="empType == '' ? 'ตำแหน่งในสายงาน' : 'ตำแหน่ง'" :label="empType == '' ? 'ตำแหน่งในสายงาน' : 'ตำแหน่ง'"
hide-bottom-space hide-bottom-space
:rules="empType == '' ? [(val: string) => !!val || 'กรุณากรอกตำแหน่งในสายงาน' ] : [(val: string) => !!val || 'กรุณากรอกตำแหน่ง']"
/> />
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-4"> <div class="col-xs-6 col-sm-6 col-md-4">
<!-- :rules="empType == '' ? [(val: string) => !!val || 'กรุณาเลือกประเภทตำแหน่ง' ]:[(val: string) => !!val || 'กรุณาเลือกกลุ่มงาน' ]" -->
<q-select <q-select
ref="positionType Ref" ref="positionType Ref"
outlined outlined
@ -1150,8 +1150,8 @@ onMounted(async () => {
hide-selected hide-selected
fill-input fill-input
input-debounce="0" input-debounce="0"
clearable
@update:model-value="updateSelectType" @update:model-value="updateSelectType"
:rules="empType == '' ? [(val: string) => !!val || 'กรุณาเลือกประเภทตำแหน่ง' ]:[(val: string) => !!val || 'กรุณาเลือกกลุ่มงาน' ]"
@filter="(inputValue: string, @filter="(inputValue: string,
doneFn: Function) => filterSelector(inputValue, doneFn, 'posType' doneFn: Function) => filterSelector(inputValue, doneFn, 'posType'
)" )"
@ -1167,6 +1167,7 @@ onMounted(async () => {
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-4"> <div class="col-xs-6 col-sm-6 col-md-4">
<!-- :rules="empType == '' ? [(val: string) => !!val || 'กรุณาเลือกระดับตำแหน่ง' ] : [(val: string) => !!val || 'กรุณาเลือกระดับชั้นงาน']" -->
<q-select <q-select
:class="classInput(true)" :class="classInput(true)"
:disable="!formData.positionType" :disable="!formData.positionType"
@ -1175,7 +1176,6 @@ onMounted(async () => {
lazy-rules lazy-rules
borderless borderless
v-model="formData.positionLevel" v-model="formData.positionLevel"
:rules="empType == '' ? [(val: string) => !!val || 'กรุณาเลือกระดับตำแหน่ง' ] : [(val: string) => !!val || 'กรุณาเลือกระดับชั้นงาน']"
:label="empType == '' ? 'ระดับตำแหน่ง' : 'ระดับชั้นงาน'" :label="empType == '' ? 'ระดับตำแหน่ง' : 'ระดับชั้นงาน'"
emit-value emit-value
map-options map-options
@ -1200,6 +1200,20 @@ onMounted(async () => {
</q-select> </q-select>
</div> </div>
<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>
<div class="col-xs-6 col-sm-6 col-md-4" v-if="empType == ''"> <div class="col-xs-6 col-sm-6 col-md-4" v-if="empType == ''">
<q-select <q-select
outlined outlined
@ -1303,6 +1317,7 @@ onMounted(async () => {
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-4"> <div class="col-xs-6 col-sm-6 col-md-4">
<!-- :rules="[(val:string) => !!val || `${'กรุณากรอกเงินเดือน'}`]" -->
<q-input <q-input
:class="classInput(true)" :class="classInput(true)"
ref="salaryRef" ref="salaryRef"
@ -1312,7 +1327,6 @@ onMounted(async () => {
label="เงินเดือน" label="เงินเดือน"
mask="###,###,###,###" mask="###,###,###,###"
reverse-fill-mask reverse-fill-mask
:rules="[(val:string) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
lazy-rules lazy-rules
hide-bottom-space hide-bottom-space
/> />

View file

@ -49,7 +49,7 @@ const {
success, success,
pathRegistryEmp, pathRegistryEmp,
onSearchDataTable, onSearchDataTable,
convertDateToAPI convertDateToAPI,
} = useCounterMixin(); } = useCounterMixin();
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? "")); const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
@ -325,6 +325,7 @@ const formData = reactive<FormSalary>({
positionName: "", // positionName: "", //
positionType: "", // | positionType: "", // |
positionLevel: "", // | positionLevel: "", // |
positionCee: "", //
positionLine: "", // positionLine: "", //
positionPathSide: "", /// positionPathSide: "", ///
positionExecutive: "", // positionExecutive: "", //
@ -498,9 +499,9 @@ async function fetchDataOptionExecutive() {
* @param status แกไข , เพ * @param status แกไข , เพ
*/ */
async function updateSelectType(val: string, status: boolean = false) { async function updateSelectType(val: string, status: boolean = false) {
const listLevel = dataLevel.value.find( const listLevel = val
(e: DataPosType) => e.posTypeName === val ? dataLevel.value.find((e: DataPosType) => e.posTypeName === val)
); : null;
if (listLevel) { if (listLevel) {
store.posLevelData = listLevel.posLevels.map((e: DataPosLevel) => ({ store.posLevelData = listLevel.posLevels.map((e: DataPosLevel) => ({
@ -512,6 +513,9 @@ async function updateSelectType(val: string, status: boolean = false) {
})); }));
formData.positionLevel = !status ? "" : formData.positionLevel; formData.positionLevel = !status ? "" : formData.positionLevel;
} else {
store.posLevelData = [];
formData.positionLevel = "";
} }
} }
@ -558,6 +562,7 @@ async function onClickOpenDialog(
formData.positionName = statusEdit ? data.positionName : ""; formData.positionName = statusEdit ? data.positionName : "";
formData.positionType = statusEdit ? data.positionType : ""; formData.positionType = statusEdit ? data.positionType : "";
formData.positionLevel = statusEdit ? data.positionLevel : ""; formData.positionLevel = statusEdit ? data.positionLevel : "";
formData.positionCee = statusEdit ? data.positionCee : "";
formData.positionLine = statusEdit ? data.positionLine : ""; formData.positionLine = statusEdit ? data.positionLine : "";
formData.positionPathSide = statusEdit ? data.positionPathSide : ""; formData.positionPathSide = statusEdit ? data.positionPathSide : "";
formData.positionExecutive = statusEdit ? data.positionExecutive : ""; formData.positionExecutive = statusEdit ? data.positionExecutive : "";
@ -724,6 +729,7 @@ onMounted(async () => {
} }
}); });
</script> </script>
<template> <template>
<div class="row items-center q-gutter-x-sm q-pb-sm"> <div class="row items-center q-gutter-x-sm q-pb-sm">
<q-btn <q-btn
@ -860,7 +866,8 @@ onMounted(async () => {
<q-card-section style="max-height: 100%" class="scroll"> <q-card-section style="max-height: 100%" class="scroll">
<div class="row col-12 q-col-gutter-sm"> <div class="row col-12 q-col-gutter-sm">
<div class="col-xs-12 col-sm-12 col-md-12"> <div class="col-xs-12 col-sm-12 col-md-8">
<!-- :rules="[(val: string) => !!val || 'กรุณาเลือกประเภทคำสั่ง']" -->
<q-select <q-select
outlined outlined
:class="classInput(true)" :class="classInput(true)"
@ -880,7 +887,6 @@ onMounted(async () => {
fill-input fill-input
input-debounce="0" input-debounce="0"
@update:model-value="updateSelectType" @update:model-value="updateSelectType"
:rules="[(val: string) => !!val || 'กรุณาเลือกประเภทคำสั่ง']"
@filter="(inputValue: string, @filter="(inputValue: string,
doneFn: Function) => filterSelector(inputValue, doneFn, 'commandCode' doneFn: Function) => filterSelector(inputValue, doneFn, 'commandCode'
)" )"
@ -895,7 +901,43 @@ onMounted(async () => {
</q-select> </q-select>
</div> </div>
<div class="col-xs-6 col-sm-12 col-md-6"> <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">
<div class="row q-col-gutter-sm"> <div class="row q-col-gutter-sm">
<div class="col-6"> <div class="col-6">
<q-input <q-input
@ -909,10 +951,9 @@ onMounted(async () => {
:label="`${'เลขที่คำสั่ง'}`" :label="`${'เลขที่คำสั่ง'}`"
/> />
</div> </div>
<label class="col-1 flex justify-center items-center text-bold" <label class="col-1 flex justify-center items-center">/</label>
>/</label
>
<div class="col-5"> <div class="col-5">
<!-- :rules="[(val:string) => !!val || `${'กรุณากรอก พ.ศ.'}`]" -->
<datepicker <datepicker
menu-class-name="modalfix" menu-class-name="modalfix"
v-model="formData.commandYear" v-model="formData.commandYear"
@ -937,7 +978,6 @@ onMounted(async () => {
: formData.commandYear + 543 : formData.commandYear + 543
" "
:label="`${'พ.ศ.'}`" :label="`${'พ.ศ.'}`"
:rules="[(val:string) => !!val || `${'กรุณากรอก พ.ศ.'}`]"
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon
@ -954,47 +994,8 @@ onMounted(async () => {
</div> </div>
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-3"> <div class="col-xs-6 col-sm-6 col-md-4">
<datepicker <!-- :rules="[ (val: string) => !!val || `${'กรุณาเลือก วันที่ลงนาม'}`,]" -->
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)"
:rules="[
(val: string) =>
!!val ||
`${'กรุณาเลือกวันที่คำสั่งมีผล'}`,
]"
: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-3">
<datepicker <datepicker
v-model="formData.commandDateSign" v-model="formData.commandDateSign"
:locale="'th'" :locale="'th'"
@ -1013,11 +1014,6 @@ onMounted(async () => {
dense dense
borderless borderless
:model-value="date2Thai(formData.commandDateSign)" :model-value="date2Thai(formData.commandDateSign)"
:rules="[
(val: string) =>
!!val ||
`${'กรุณาเลือก วันที่ลงนาม'}`,
]"
:label="`${'วันที่ลงนาม'}`" :label="`${'วันที่ลงนาม'}`"
hide-bottom-space hide-bottom-space
> >
@ -1034,6 +1030,10 @@ onMounted(async () => {
</datepicker> </datepicker>
</div> </div>
<div class="col-12">
<q-separator />
</div>
<div class="col-xs-6 col-sm-6 col-md-4"> <div class="col-xs-6 col-sm-6 col-md-4">
<q-input <q-input
:class="classInput(true)" :class="classInput(true)"
@ -1049,6 +1049,7 @@ onMounted(async () => {
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-4"> <div class="col-xs-6 col-sm-6 col-md-4">
<!-- :rules="[(val: string) => !!val || `${'กรุณากรอกตำแหน่งเลขที่'}`]" -->
<q-input <q-input
:class="classInput(true)" :class="classInput(true)"
outlined outlined
@ -1058,12 +1059,12 @@ onMounted(async () => {
v-model="formData.posNo" v-model="formData.posNo"
hide-bottom-space hide-bottom-space
:label="`${'ตำแหน่งเลขที่'}`" :label="`${'ตำแหน่งเลขที่'}`"
:rules="[(val: string) => !!val || `${'กรุณากรอกตำแหน่งเลขที่'}`]"
> >
</q-input> </q-input>
</div> </div>
<div class="col-xs-12 col-sm-6 col-md-4"> <div class="col-xs-12 col-sm-6 col-md-4">
<!-- :rules="empType == '' ? [(val: string) => !!val || 'กรุณากรอกตำแหน่งในสายงาน' ] : [(val: string) => !!val || 'กรุณากรอกตำแหน่ง']" -->
<q-input <q-input
:class="classInput(true)" :class="classInput(true)"
outlined outlined
@ -1073,11 +1074,11 @@ onMounted(async () => {
v-model="formData.positionName" v-model="formData.positionName"
:label="empType == '' ? 'ตำแหน่งในสายงาน' : 'ตำแหน่ง'" :label="empType == '' ? 'ตำแหน่งในสายงาน' : 'ตำแหน่ง'"
hide-bottom-space hide-bottom-space
:rules="empType == '' ? [(val: string) => !!val || 'กรุณากรอกตำแหน่งในสายงาน' ] : [(val: string) => !!val || 'กรุณากรอกตำแหน่ง']"
/> />
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-4"> <div class="col-xs-6 col-sm-6 col-md-4">
<!-- :rules="empType == '' ? [(val: string) => !!val || 'กรุณาเลือกประเภทตำแหน่ง' ]:[(val: string) => !!val || 'กรุณาเลือกกลุ่มงาน' ]" -->
<q-select <q-select
ref="positionType Ref" ref="positionType Ref"
outlined outlined
@ -1096,9 +1097,9 @@ onMounted(async () => {
use-input use-input
hide-selected hide-selected
fill-input fill-input
clearable
input-debounce="0" input-debounce="0"
@update:model-value="updateSelectType" @update:model-value="updateSelectType"
:rules="empType == '' ? [(val: string) => !!val || 'กรุณาเลือกประเภทตำแหน่ง' ]:[(val: string) => !!val || 'กรุณาเลือกกลุ่มงาน' ]"
@filter="(inputValue: string, @filter="(inputValue: string,
doneFn: Function) => filterSelector(inputValue, doneFn, 'posType' doneFn: Function) => filterSelector(inputValue, doneFn, 'posType'
)" )"
@ -1114,6 +1115,7 @@ onMounted(async () => {
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-4"> <div class="col-xs-6 col-sm-6 col-md-4">
<!-- :rules="empType == '' ? [(val: string) => !!val || 'กรุณาเลือกระดับตำแหน่ง' ] : [(val: string) => !!val || 'กรุณาเลือกระดับชั้นงาน']" -->
<q-select <q-select
:class="classInput(true)" :class="classInput(true)"
:disable="!formData.positionType" :disable="!formData.positionType"
@ -1122,7 +1124,6 @@ onMounted(async () => {
lazy-rules lazy-rules
borderless borderless
v-model="formData.positionLevel" v-model="formData.positionLevel"
:rules="empType == '' ? [(val: string) => !!val || 'กรุณาเลือกระดับตำแหน่ง' ] : [(val: string) => !!val || 'กรุณาเลือกระดับชั้นงาน']"
:label="empType == '' ? 'ระดับตำแหน่ง' : 'ระดับชั้นงาน'" :label="empType == '' ? 'ระดับตำแหน่ง' : 'ระดับชั้นงาน'"
emit-value emit-value
map-options map-options
@ -1147,6 +1148,20 @@ onMounted(async () => {
</q-select> </q-select>
</div> </div>
<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>
<div class="col-xs-6 col-sm-6 col-md-4" v-if="empType == ''"> <div class="col-xs-6 col-sm-6 col-md-4" v-if="empType == ''">
<q-select <q-select
outlined outlined

View file

@ -72,6 +72,7 @@ interface FormPostition {
positionLine: string; // สายงาน positionLine: string; // สายงาน
positionPathSide: string; //ด้าน/สาขา positionPathSide: string; //ด้าน/สาขา
positionExecutive: string; //ตำแหน่งทางการบริหาร positionExecutive: string; //ตำแหน่งทางการบริหาร
positionCee: string; //ระดับซี
amount: number | null; //เงินเดือน amount: number | null; //เงินเดือน
amountSpecial: number | null; //เงินค่าตอบแทนพิเศษ amountSpecial: number | null; //เงินค่าตอบแทนพิเศษ
orgRoot: string; //หน่วยงาน orgRoot: string; //หน่วยงาน

View file

@ -9,6 +9,7 @@ interface FormSalary {
positionName: string; //ตำแหน่ง positionName: string; //ตำแหน่ง
positionType: string; //ประเภทตำแหน่ง, กลุ่มงาน positionType: string; //ประเภทตำแหน่ง, กลุ่มงาน
positionLevel: string; //ระดับตำแหน่ง, ระดับชั้นงาน positionLevel: string; //ระดับตำแหน่ง, ระดับชั้นงาน
positionCee: string; //ระดับซี
positionLine: string; // สายงาน positionLine: string; // สายงาน
positionPathSide: string; //ด้าน/สาขา positionPathSide: string; //ด้าน/สาขา
positionExecutive: string; //ตำแหน่งทางการบริหาร positionExecutive: string; //ตำแหน่งทางการบริหาร

View file

@ -1169,6 +1169,28 @@ watch(
</q-select> </q-select>
</div> </div>
<div class="col-12"><q-separator /></div> <div class="col-12"><q-separator /></div>
<div
class="col-12 q-px-sm"
v-if="employeeClass === 'officer'"
>
<q-input
dense
v-model="positionArea"
borderless
label=" ด้าน/สาขา"
class="bg-white full-width"
>
<template v-if="positionArea" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="positionArea = ''"
class="cursor-pointer"
style="opacity: 0.6"
/>
</template>
</q-input>
</div>
<div class="col-12"><q-separator /></div>
<div class="col-12 q-px-sm"> <div class="col-12 q-px-sm">
<q-select <q-select
label="เพศ" label="เพศ"
@ -1301,28 +1323,7 @@ watch(
<div class="col-12" v-if="employeeClass === 'officer'"> <div class="col-12" v-if="employeeClass === 'officer'">
<q-separator /> <q-separator />
</div> </div>
<div
class="col-12 q-px-sm"
v-if="employeeClass === 'officer'"
>
<q-input
dense
v-model="positionArea"
borderless
label=" ด้าน/สาขา"
class="bg-white full-width"
>
<template v-if="positionArea" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="positionArea = ''"
class="cursor-pointer"
style="opacity: 0.6"
/>
</template>
</q-input>
</div>
<div class="col-12"><q-separator /></div>
<div class="col-12 q-pa-sm"> <div class="col-12 q-pa-sm">
<div class="text-grey-8 text-caption">วงเวลาบรรจ</div> <div class="text-grey-8 text-caption">วงเวลาบรรจ</div>
<div class="col-12"> <div class="col-12">