fix(leave-history):add field beginningLeaveDays beginningLeaveCount

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-02-11 13:42:19 +07:00
parent 5fb13c8cd4
commit b083bcb0ca
4 changed files with 76 additions and 7 deletions

View file

@ -85,6 +85,8 @@ const formData = reactive({
leaveDays: "", //
leaveDaysUsed: "", //
leaveCount: "", //
beginningLeaveDays: "", // ()
beginningLeaveCount: "", // ()
});
const leaveTypeOptions = ref<DataLeaveType[]>([]);
const leaveTypeOptionsMain = ref<DataLeaveType[]>([]);
@ -106,6 +108,12 @@ async function onSubmit() {
? Number(formData.leaveDaysUsed)
: 0,
leaveCount: formData.leaveCount ? Number(formData.leaveCount) : 0,
beginningLeaveDays: formData.beginningLeaveDays
? Number(formData.beginningLeaveDays)
: 0,
beginningLeaveCount: formData.beginningLeaveCount
? Number(formData.beginningLeaveCount)
: 0,
})
.then(async () => {
@ -159,6 +167,12 @@ async function defineDataLeaveBeginning(data: DataLeaveBeginning) {
? data.leaveDaysUsed.toString()
: "0";
formData.leaveCount = data.leaveCount ? data.leaveCount.toString() : "0";
formData.beginningLeaveDays = data.beginningLeaveDays
? data.beginningLeaveDays.toString()
: "0";
formData.beginningLeaveCount = data.beginningLeaveCount
? data.beginningLeaveCount.toString()
: "0";
}
/**
@ -187,6 +201,9 @@ function onClose() {
formData.leaveYear = calculateFiscalYear(new Date());
formData.leaveDays = "";
formData.leaveDaysUsed = "";
formData.leaveCount = "";
formData.beginningLeaveDays = "";
formData.beginningLeaveCount = "";
rows.value = [];
selected.value = [];
pagination.value = {
@ -248,6 +265,7 @@ watch(modal, async (val) => {
await Promise.all([
filterLeaveTypeData(),
isStatusEdit.value && defineDataLeaveBeginning(rowData.value),
console.log(rowData.value),
]);
} finally {
hideLoader();
@ -455,6 +473,8 @@ watch(modal, async (val) => {
outlined
label="ที่ใช้ไป (วัน)"
hide-bottom-space
mask="#"
reverse-fill-mask
/>
</div>
<div class="col-12">
@ -465,6 +485,34 @@ watch(modal, async (val) => {
outlined
label="ที่ใช้ไป (ครั้ง)"
hide-bottom-space
mask="#"
reverse-fill-mask
/>
</div>
<div class="col-12">
<q-input
:class="classInput(true)"
v-model="formData.beginningLeaveDays"
dense
outlined
label="ยกมา (วัน)"
hide-bottom-space
mask="#"
reverse-fill-mask
/>
</div>
<div class="col-12">
<q-input
:class="classInput(true)"
v-model="formData.beginningLeaveCount"
dense
outlined
label="ยกมา (ครั้ง)"
hide-bottom-space
mask="#"
reverse-fill-mask
/>
</div>
</div>