เพิ่มวันที่สมัคร

This commit is contained in:
Kittapath 2023-10-13 04:27:51 +07:00
parent 0e0a220651
commit 2417548672
3 changed files with 625 additions and 504 deletions

View file

@ -1,14 +1,31 @@
<!-- tab ประวการทำงาน (งแตเรมปฏงานกบกรงเทพมหานคร - จจ) -->
<template>
<q-form ref="myForm">
<Table :rows="rows" :columns="columns" :filter="filter" :visible-columns="visibleColumns"
v-model:inputfilter="filter" v-model:inputvisible="visibleColumns" v-model:editvisible="edit" :add="clickAdd"
:edit="clickEdit" :addData="false" :bottom="true" :editData="status == 'checkRegister' || status == 'payment'"
name="ประวัติการทำงาน (ตั้งแต่เริ่มปฏิบัติงานกับกรุงเทพมหานคร - ปัจจุบัน)" icon="mdi-briefcase">
<Table
:rows="rows"
:columns="columns"
:filter="filter"
:visible-columns="visibleColumns"
v-model:inputfilter="filter"
v-model:inputvisible="visibleColumns"
v-model:editvisible="edit"
:add="clickAdd"
:edit="clickEdit"
:addData="false"
:bottom="true"
:editData="status == 'checkRegister' || status == 'payment'"
name="ประวัติการทำงาน (ตั้งแต่เริ่มปฏิบัติงานกับกรุงเทพมหานคร - ปัจจุบัน)"
icon="mdi-briefcase"
>
<template #columns="props">
<q-tr :props="props">
<q-td v-for="col in props.cols" :key="col.name" :props="props" @click="selectData(props)"
class="cursor-pointer">
<q-td
v-for="col in props.cols"
:key="col.name"
:props="props"
@click="selectData(props)"
class="cursor-pointer"
>
<div v-if="col.name == 'startDate' || col.name == 'endDate'">
{{ date2Thai(col.value) }}
</div>
@ -16,17 +33,36 @@
{{ col.value }}
</div>
</q-td>
<q-td style="width:5% !important;" v-if="status == 'checkRegister' || status == 'payment'">
<q-btn color="red" flat dense round size="14px" icon="mdi-trash-can-outline"
@click="checkDelete(props.row)" />
<q-td
style="width: 5% !important"
v-if="status == 'checkRegister' || status == 'payment'"
>
<q-btn
color="red"
flat
dense
round
size="14px"
icon="mdi-trash-can-outline"
@click="checkDelete(props.row)"
/>
</q-td>
</q-tr>
</template>
<template #bottom="props">
<div style="width:75% !important;" />
<div :props="props" style="width:25% !important;padding-left: 12px;">
<span class="text-weight-medium text-subtitle2 q-py-sm">รวมระยะเวลา : <span class="q-pl-sm">{{ total
}}</span></span>
<div style="width: 60% !important" />
<div
:props="props"
class="row"
style="width: 18.4% !important; padding-left: 20px"
>
<div
class="text-weight-medium text-subtitle2 q-py-sm row col-12 justify-between"
>
<div>รวมระยะเวลา :</div>
<div>{{ total }}</div>
</div>
</div>
</template>
</Table>
@ -35,22 +71,45 @@
<q-dialog v-model="modal" persistent>
<q-card style="width: 600px">
<q-form ref="myForm">
<DialogHeader tittle="ประวัติการทำงาน (ตั้งแต่เริ่มปฏิบัติงานกับกรุงเทพมหานคร - ปัจจุบัน)"
:close="checkClose" />
<DialogHeader
tittle="ประวัติการทำงาน (ตั้งแต่เริ่มปฏิบัติงานกับกรุงเทพมหานคร - ปัจจุบัน)"
:close="checkClose"
/>
<q-separator />
<q-card-section class="q-p-sm">
<div class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs">
<div
class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs"
>
<div class="col-xs-12 col-sm-6 col-md-6">
<q-input :class="getClass(edit)" :outlined="edit" dense lazy-rules :readonly="!edit"
:borderless="!edit" v-model="position"
<q-input
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:readonly="!edit"
:borderless="!edit"
v-model="position"
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่ง/ลักษณะงาน'}`]"
:label="`${'ตำแหน่ง/ลักษณะงาน'}`" @update:modelValue="clickEditRow" hide-bottom-space />
:label="`${'ตำแหน่ง/ลักษณะงาน'}`"
@update:modelValue="clickEditRow"
hide-bottom-space
/>
</div>
<div class="col-xs-12 col-sm-6 col-md-6">
<q-select :class="getClass(edit)" :outlined="edit" dense lazy-rules :readonly="!edit"
:borderless="!edit" v-model="type" :options="opType"
:rules="[(val) => !!val || `${'กรุณาเลือกประเภท'}`]" :label="`${'ประเภท'}`"
@update:modelValue="clickEditRow" hide-bottom-space />
<q-select
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:readonly="!edit"
:borderless="!edit"
v-model="type"
:options="opType"
:rules="[(val) => !!val || `${'กรุณาเลือกประเภท'}`]"
:label="`${'ประเภท'}`"
@update:modelValue="clickEditRow"
hide-bottom-space
/>
</div>
<!-- <div class="col-xs-12 col-sm-6 col-md-6">
<q-input
@ -98,8 +157,16 @@
/>
</div> -->
<div class="col-xs-12 col-sm-6 col-md-6">
<datepicker menu-class-name="modalfix" :readonly="!edit" v-model="startDate" :locale="'th'"
autoApply :enableTimePicker="false" @update:modelValue="clickEditRow" week-start="0">
<datepicker
menu-class-name="modalfix"
:readonly="!edit"
v-model="startDate"
:locale="'th'"
autoApply
:enableTimePicker="false"
@update:modelValue="clickEditRow"
week-start="0"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
@ -107,15 +174,27 @@
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input :class="getClass(edit)" :outlined="edit" dense lazy-rules :borderless="!edit"
<q-input
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:borderless="!edit"
:model-value="date2Thai(startDate)"
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่เริ่ม'}`]" hide-bottom-space
:label="`${'วันที่เริ่ม'}`">
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่เริ่ม'}`]"
hide-bottom-space
:label="`${'วันที่เริ่ม'}`"
>
<template v-slot:prepend>
<q-icon name="event" class="cursor-pointer" :style="edit
<q-icon
name="event"
class="cursor-pointer"
:style="
edit
? 'color: var(--q-primary)'
: 'color: var(--q-grey)'
">
"
>
</q-icon>
</template>
</q-input>
@ -123,8 +202,16 @@
</datepicker>
</div>
<div class="col-xs-12 col-sm-6 col-md-6">
<datepicker menu-class-name="modalfix" :readonly="!edit" v-model="endDate" :locale="'th'"
autoApply :enableTimePicker="false" @update:modelValue="clickEditRow" week-start="0">
<datepicker
menu-class-name="modalfix"
:readonly="!edit"
v-model="endDate"
:locale="'th'"
autoApply
:enableTimePicker="false"
@update:modelValue="clickEditRow"
week-start="0"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
@ -132,15 +219,30 @@
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input :class="getClass(edit)" :outlined="edit" dense lazy-rules :borderless="!edit"
<q-input
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:borderless="!edit"
:model-value="date2Thai(endDate)"
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่สิ้นสุด'}`, endDateValidation]"
hide-bottom-space :label="`${'วันที่สิ้นสุด'}`">
:rules="[
(val) => !!val || `${'กรุณาเลือกวันที่สิ้นสุด'}`,
endDateValidation,
]"
hide-bottom-space
:label="`${'วันที่สิ้นสุด'}`"
>
<template v-slot:prepend>
<q-icon name="event" class="cursor-pointer" :style="edit
<q-icon
name="event"
class="cursor-pointer"
:style="
edit
? 'color: var(--q-primary)'
: 'color: var(--q-grey)'
">
"
>
</q-icon>
</template>
</q-input>
@ -148,16 +250,33 @@
</datepicker>
</div>
<div class="col-xs-12 col-sm-12 col-md-12">
<q-input :class="getClass(false)" :outlined="false" dense lazy-rules :readonly="!false"
:borderless="!false" v-model="rangeDate" :label="`${'ระยะเวลา'}`" hide-bottom-space />
<q-input
:class="getClass(false)"
:outlined="false"
dense
lazy-rules
:readonly="!false"
:borderless="!false"
v-model="rangeDate"
:label="`${'ระยะเวลา'}`"
hide-bottom-space
/>
</div>
</div>
</q-card-section>
<q-separator />
<DialogFooter :edit="clickEdit" :save="clickSave" :validate="validateData" :clickNext="clickNext"
:clickPrevious="clickPrevious" :editData="status == 'checkRegister' || status == 'payment'"
v-model:editvisible="edit" v-model:next="next" v-model:previous="previous"
v-model:modalEdit="modalEdit" />
<DialogFooter
:edit="clickEdit"
:save="clickSave"
:validate="validateData"
:clickNext="clickNext"
:clickPrevious="clickPrevious"
:editData="status == 'checkRegister' || status == 'payment'"
v-model:editvisible="edit"
v-model:next="next"
v-model:previous="previous"
v-model:modalEdit="modalEdit"
/>
</q-form>
</q-card>
</q-dialog>
@ -379,7 +498,8 @@ const calDate = async () => {
}
dayDiff += daysInMonth[_startDate.getMonth()];
}
rangeDate.value = `${yearDiff > 0 ? yearDiff + " ปี " : ""}${monthDiff > 0 ? monthDiff + " เดือน " : ""
rangeDate.value = `${yearDiff > 0 ? yearDiff + " ปี " : ""}${
monthDiff > 0 ? monthDiff + " เดือน " : ""
}${dayDiff > 0 ? dayDiff + " วัน " : ""}`;
};
@ -453,7 +573,8 @@ const fetchData = async () => {
yearDiff = yearDiff + parseInt((monthDiff / 12).toString());
monthDiff = monthDiff % 12;
}
total.value = `${yearDiff > 0 ? yearDiff + " ปี " : ""}${monthDiff > 0 ? monthDiff + " เดือน " : ""
total.value = `${yearDiff > 0 ? yearDiff + " ปี " : ""}${
monthDiff > 0 ? monthDiff + " เดือน " : ""
}${dayDiff > 0 ? dayDiff + " วัน " : ""}`;
}
);

File diff suppressed because one or more lines are too long

View file

@ -481,7 +481,7 @@ const fetchData = async () => {
avatar: r.profileImg != null ? r.profileImg.detail : "",
citizenId: r.citizenId,
number: r.number,
registerDate: date2Thai(r.registerDate),
registerDate: date2Thai(r.registerDate, false, true),
examIdenNumber: r.examIdenNumber,
seatNumber: r.seatNumber,
resultC: r.resultC,