fix(registry-officer): add field leaveSubTypeName and coupleDayLevelCountry form leave
This commit is contained in:
parent
7471836167
commit
1d99705b65
2 changed files with 61 additions and 1 deletions
|
|
@ -202,6 +202,17 @@ const pagination = ref({
|
||||||
const columnsHistory = ref<QTableColumn[]>(baseColumns.value);
|
const columnsHistory = ref<QTableColumn[]>(baseColumns.value);
|
||||||
const visibleColumnsHistory = ref<string[]>(baseVisibleColumns.value);
|
const visibleColumnsHistory = ref<string[]>(baseVisibleColumns.value);
|
||||||
|
|
||||||
|
/** รายการประเภทการลาของ ลาไปศึกษา ฝึกอบรม ปฎิบัติการวิจัย หรือดูงาน*/
|
||||||
|
const leaveSubTypeName = ref<string>("");
|
||||||
|
const optionSubTypeName = ref<string[]>([
|
||||||
|
"ศึกษาต่อ",
|
||||||
|
"ฝึกอบรม",
|
||||||
|
"ปฎิบัติการวิจัย",
|
||||||
|
"ดูงาน",
|
||||||
|
]);
|
||||||
|
|
||||||
|
const coupleDayLevelCountry = ref<string>("");
|
||||||
|
|
||||||
/** function fetch ข้อมูลรายการลา*/
|
/** function fetch ข้อมูลรายการลา*/
|
||||||
async function getData() {
|
async function getData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -213,6 +224,7 @@ async function getData() {
|
||||||
...item,
|
...item,
|
||||||
id: item.id,
|
id: item.id,
|
||||||
typeLeave: item.leaveType.name,
|
typeLeave: item.leaveType.name,
|
||||||
|
codeLeave: item.leaveType.code,
|
||||||
code: item.leaveType.refCommandDate,
|
code: item.leaveType.refCommandDate,
|
||||||
dateStartLeave: item.dateLeaveStart,
|
dateStartLeave: item.dateLeaveStart,
|
||||||
dateEndLeave: item.dateLeaveEnd,
|
dateEndLeave: item.dateLeaveEnd,
|
||||||
|
|
@ -292,8 +304,10 @@ function openDialogEdit(props: DetailData) {
|
||||||
typeLeave.value = {
|
typeLeave.value = {
|
||||||
id: props.typeLeaveId,
|
id: props.typeLeaveId,
|
||||||
name: props.typeLeave,
|
name: props.typeLeave,
|
||||||
code: props.code,
|
code: props.codeLeave,
|
||||||
};
|
};
|
||||||
|
leaveSubTypeName.value = props.leaveSubTypeName;
|
||||||
|
coupleDayLevelCountry.value = props.coupleDayLevelCountry;
|
||||||
statLeave.value = props.status;
|
statLeave.value = props.status;
|
||||||
reason.value = props.reason;
|
reason.value = props.reason;
|
||||||
dateRange.value = [
|
dateRange.value = [
|
||||||
|
|
@ -316,6 +330,10 @@ function onSubmit() {
|
||||||
|
|
||||||
const body = {
|
const body = {
|
||||||
leaveTypeId: typeLeave.value?.id,
|
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]),
|
dateLeaveStart: dateToISO(dateRange.value[0]),
|
||||||
dateLeaveEnd: dateToISO(dateRange.value[1]),
|
dateLeaveEnd: dateToISO(dateRange.value[1]),
|
||||||
leaveDays: numLeave.value,
|
leaveDays: numLeave.value,
|
||||||
|
|
@ -451,6 +469,8 @@ function closeDialog() {
|
||||||
dateRange.value = [new Date(), new Date()];
|
dateRange.value = [new Date(), new Date()];
|
||||||
numLeave.value = 1;
|
numLeave.value = 1;
|
||||||
numUsedLeave.value = 0;
|
numUsedLeave.value = 0;
|
||||||
|
leaveSubTypeName.value = "";
|
||||||
|
coupleDayLevelCountry.value = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
function statusLeave(val: string) {
|
function statusLeave(val: string) {
|
||||||
|
|
@ -741,6 +761,43 @@ onMounted(() => {
|
||||||
) "
|
) "
|
||||||
/>
|
/>
|
||||||
</div>
|
</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">
|
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||||
<datepicker
|
<datepicker
|
||||||
:readonly="!typeLeave"
|
:readonly="!typeLeave"
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,9 @@ interface DetailData {
|
||||||
reason: string;
|
reason: string;
|
||||||
typeLeaveId: string;
|
typeLeaveId: string;
|
||||||
code: string;
|
code: string;
|
||||||
|
codeLeave:string
|
||||||
|
leaveSubTypeName:string
|
||||||
|
coupleDayLevelCountry:string
|
||||||
}
|
}
|
||||||
|
|
||||||
interface FormFilter {
|
interface FormFilter {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue