Merge branch 'develop' into dev

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-03-24 10:01:55 +07:00
commit 8d4f7bc077
2 changed files with 61 additions and 1 deletions

View file

@ -202,6 +202,17 @@ const pagination = ref({
const columnsHistory = ref<QTableColumn[]>(baseColumns.value);
const visibleColumnsHistory = ref<string[]>(baseVisibleColumns.value);
/** รายการประเภทการลาของ ลาไปศึกษา ฝึกอบรม ปฎิบัติการวิจัย หรือดูงาน*/
const leaveSubTypeName = ref<string>("");
const optionSubTypeName = ref<string[]>([
"ศึกษาต่อ",
"ฝึกอบรม",
"ปฎิบัติการวิจัย",
"ดูงาน",
]);
const coupleDayLevelCountry = ref<string>("");
/** function fetch ข้อมูลรายการลา*/
async function getData() {
showLoader();
@ -213,6 +224,7 @@ async function getData() {
...item,
id: item.id,
typeLeave: item.leaveType.name,
codeLeave: item.leaveType.code,
code: item.leaveType.refCommandDate,
dateStartLeave: item.dateLeaveStart,
dateEndLeave: item.dateLeaveEnd,
@ -292,8 +304,10 @@ function openDialogEdit(props: DetailData) {
typeLeave.value = {
id: props.typeLeaveId,
name: props.typeLeave,
code: props.code,
code: props.codeLeave,
};
leaveSubTypeName.value = props.leaveSubTypeName;
coupleDayLevelCountry.value = props.coupleDayLevelCountry;
statLeave.value = props.status;
reason.value = props.reason;
dateRange.value = [
@ -316,6 +330,10 @@ function onSubmit() {
const body = {
leaveTypeId: typeLeave.value?.id,
leaveSubTypeName:
typeLeave.value?.code === "LV-008" ? leaveSubTypeName.value : undefined,
coupleDayLevelCountry:
typeLeave.value?.code === "LV-010" ? coupleDayLevelCountry.value : undefined,
dateLeaveStart: dateToISO(dateRange.value[0]),
dateLeaveEnd: dateToISO(dateRange.value[1]),
leaveDays: numLeave.value,
@ -451,6 +469,8 @@ function closeDialog() {
dateRange.value = [new Date(), new Date()];
numLeave.value = 1;
numUsedLeave.value = 0;
leaveSubTypeName.value = "";
coupleDayLevelCountry.value = "";
}
function statusLeave(val: string) {
@ -741,6 +761,43 @@ onMounted(() => {
) "
/>
</div>
<div
class="col-xs-6 col-sm-6 col-md-6"
v-if="
typeLeave?.code === 'LV-008' || typeLeave?.code === 'LV-010'
"
>
<q-select
v-if="typeLeave?.code === 'LV-008'"
ref="typeLeaveRef"
class="full-width inputgreen cursor-pointer"
outlined
dense
lazy-rules
:label="`${'ประเภท'}`"
:rules="[(val:string) => !!val || `${'กรุณาเลือกประเภท'}`]"
v-model="leaveSubTypeName"
:options="optionSubTypeName"
option-value="id"
option-label="name"
emit-value
map-options
hide-bottom-space
/>
<q-input
v-if="typeLeave?.code === 'LV-010'"
ref="numLeaveRef"
class="full-width inputgreen cursor-pointer"
outlined
dense
lazy-rules
v-model="coupleDayLevelCountry"
:rules="[(val:string) => !!val || `${'กรุณากรอกประเทศที่ลาติดตามคู่สมรส'}`]"
hide-bottom-space
:label="`${'ประเทศที่ลาติดตามคู่สมรส'}`"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
<datepicker
:readonly="!typeLeave"

View file

@ -8,6 +8,9 @@ interface DetailData {
reason: string;
typeLeaveId: string;
code: string;
codeLeave:string
leaveSubTypeName:string
coupleDayLevelCountry:string
}
interface FormFilter {