fix(leave-history):add field beginningLeaveDays beginningLeaveCount
This commit is contained in:
parent
5fb13c8cd4
commit
b083bcb0ca
4 changed files with 76 additions and 7 deletions
|
|
@ -92,12 +92,12 @@ const listAdd = ref<ListMenu[]>([
|
||||||
type: "DETAIL",
|
type: "DETAIL",
|
||||||
color: "blue-9",
|
color: "blue-9",
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// label: "เผยแพร่",
|
label: "เผยแพร่",
|
||||||
// icon: "mdi-publish",
|
icon: "mdi-publish",
|
||||||
// type: "PUBLISH",
|
type: "PUBLISH",
|
||||||
// color: "indigo-9",
|
color: "indigo-9",
|
||||||
// },
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const getMenuItems = computed(() => {
|
const getMenuItems = computed(() => {
|
||||||
|
|
@ -416,7 +416,6 @@ function onPublicOrganization(data: OrgTree) {
|
||||||
showLoader();
|
showLoader();
|
||||||
try {
|
try {
|
||||||
await http.post(config.API.moveDraftToCurrent(orgDnaId));
|
await http.post(config.API.moveDraftToCurrent(orgDnaId));
|
||||||
await props.fetchDataTree?.();
|
|
||||||
await success($q, "เผยแพร่โครงสร้างสำเร็จ");
|
await success($q, "เผยแพร่โครงสร้างสำเร็จ");
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,8 @@ const formData = reactive({
|
||||||
leaveDays: "", //วันลาที่ยกมา
|
leaveDays: "", //วันลาที่ยกมา
|
||||||
leaveDaysUsed: "", //วันลาที่ใช้ไป
|
leaveDaysUsed: "", //วันลาที่ใช้ไป
|
||||||
leaveCount: "", //ครั้งที่ใช้ไป
|
leaveCount: "", //ครั้งที่ใช้ไป
|
||||||
|
beginningLeaveDays: "", //ยักมา (วัน)
|
||||||
|
beginningLeaveCount: "", // ยกมา (ครั่ง)
|
||||||
});
|
});
|
||||||
const leaveTypeOptions = ref<DataLeaveType[]>([]);
|
const leaveTypeOptions = ref<DataLeaveType[]>([]);
|
||||||
const leaveTypeOptionsMain = ref<DataLeaveType[]>([]);
|
const leaveTypeOptionsMain = ref<DataLeaveType[]>([]);
|
||||||
|
|
@ -106,6 +108,12 @@ async function onSubmit() {
|
||||||
? Number(formData.leaveDaysUsed)
|
? Number(formData.leaveDaysUsed)
|
||||||
: 0,
|
: 0,
|
||||||
leaveCount: formData.leaveCount ? Number(formData.leaveCount) : 0,
|
leaveCount: formData.leaveCount ? Number(formData.leaveCount) : 0,
|
||||||
|
beginningLeaveDays: formData.beginningLeaveDays
|
||||||
|
? Number(formData.beginningLeaveDays)
|
||||||
|
: 0,
|
||||||
|
beginningLeaveCount: formData.beginningLeaveCount
|
||||||
|
? Number(formData.beginningLeaveCount)
|
||||||
|
: 0,
|
||||||
})
|
})
|
||||||
|
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
|
|
@ -159,6 +167,12 @@ async function defineDataLeaveBeginning(data: DataLeaveBeginning) {
|
||||||
? data.leaveDaysUsed.toString()
|
? data.leaveDaysUsed.toString()
|
||||||
: "0";
|
: "0";
|
||||||
formData.leaveCount = data.leaveCount ? data.leaveCount.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.leaveYear = calculateFiscalYear(new Date());
|
||||||
formData.leaveDays = "";
|
formData.leaveDays = "";
|
||||||
formData.leaveDaysUsed = "";
|
formData.leaveDaysUsed = "";
|
||||||
|
formData.leaveCount = "";
|
||||||
|
formData.beginningLeaveDays = "";
|
||||||
|
formData.beginningLeaveCount = "";
|
||||||
rows.value = [];
|
rows.value = [];
|
||||||
selected.value = [];
|
selected.value = [];
|
||||||
pagination.value = {
|
pagination.value = {
|
||||||
|
|
@ -248,6 +265,7 @@ watch(modal, async (val) => {
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
filterLeaveTypeData(),
|
filterLeaveTypeData(),
|
||||||
isStatusEdit.value && defineDataLeaveBeginning(rowData.value),
|
isStatusEdit.value && defineDataLeaveBeginning(rowData.value),
|
||||||
|
console.log(rowData.value),
|
||||||
]);
|
]);
|
||||||
} finally {
|
} finally {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
|
|
@ -455,6 +473,8 @@ watch(modal, async (val) => {
|
||||||
outlined
|
outlined
|
||||||
label="ที่ใช้ไป (วัน)"
|
label="ที่ใช้ไป (วัน)"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
|
mask="#"
|
||||||
|
reverse-fill-mask
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
|
|
@ -465,6 +485,34 @@ watch(modal, async (val) => {
|
||||||
outlined
|
outlined
|
||||||
label="ที่ใช้ไป (ครั้ง)"
|
label="ที่ใช้ไป (ครั้ง)"
|
||||||
hide-bottom-space
|
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>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@ interface DataLeaveBeginning {
|
||||||
prefix: string;
|
prefix: string;
|
||||||
profileId: string;
|
profileId: string;
|
||||||
leaveCount: number;
|
leaveCount: number;
|
||||||
|
beginningLeaveDays: number;
|
||||||
|
beginningLeaveCount: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type { DataLeaveType, DataLeaveBeginning };
|
export type { DataLeaveType, DataLeaveBeginning };
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,24 @@ const columns = ref<QTableColumn[]>([
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "beginningLeaveDays",
|
||||||
|
align: "left",
|
||||||
|
label: "ยกมา (วัน)",
|
||||||
|
sortable: true,
|
||||||
|
field: "beginningLeaveDays",
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "beginningLeaveCount",
|
||||||
|
align: "left",
|
||||||
|
label: "ยกมา (ครั้ง)",
|
||||||
|
sortable: true,
|
||||||
|
field: "beginningLeaveCount",
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
const visibleColumns = ref<string[]>([
|
const visibleColumns = ref<string[]>([
|
||||||
"fullName",
|
"fullName",
|
||||||
|
|
@ -106,6 +124,8 @@ const visibleColumns = ref<string[]>([
|
||||||
"leaveDays",
|
"leaveDays",
|
||||||
"leaveDaysUsed",
|
"leaveDaysUsed",
|
||||||
"leaveCount",
|
"leaveCount",
|
||||||
|
"beginningLeaveDays",
|
||||||
|
"beginningLeaveCount",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const modalDialogForm = ref<boolean>(false); //modal Dialog บันทึกข้อมูลการลาย้อนหลัง
|
const modalDialogForm = ref<boolean>(false); //modal Dialog บันทึกข้อมูลการลาย้อนหลัง
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue