no message

This commit is contained in:
Kittapath 2024-02-03 13:54:45 +07:00
parent 8d1901e2b8
commit 9e44a1a7a8
2 changed files with 60 additions and 40 deletions

View file

@ -82,9 +82,7 @@
<DialogHeader tittle="การลา" :close="clickCloseLeave" />
<q-separator />
<q-card-section class="q-p-sm">
<div
class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs"
>
<div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs">
<div class="col-xs-6 col-sm-6 col-md-6">
<selector
:class="getClass(edit)"
@ -748,7 +746,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
store.isLoad++
store.isLoad++;
});
}
};
@ -916,18 +914,18 @@ const clickAddLeave = async () => {
numLeave.value = 0;
numUsedLeave.value = 0;
await clickTotal();
if (rowsTotal.value.length > 0) {
let data: DataOptionLeave[] = [];
rowsTotal.value.map((e: ResponseTotalObject) => {
data.push({
id: e.typeLeaveId,
name: e.typeLeave,
totalLeave: e.totalLeave,
});
});
typeLeaveOption.value = data;
typeLeaveOptionFilter.value = data;
}
// if (rowsTotal.value.length > 0) {
// let data: DataOptionLeave[] = [];
// rowsTotal.value.map((e: ResponseTotalObject) => {
// data.push({
// id: e.typeLeaveId,
// name: e.typeLeave,
// totalLeave: e.totalLeave,
// });
// });
// typeLeaveOption.value = data;
// typeLeaveOptionFilter.value = data;
// }
// await addData();
};
@ -1137,18 +1135,18 @@ const selectData = async (props: DataProps) => {
numLeave.value = props.row.numLeave;
numUsedLeave.value = props.row.sumLeave;
await clickTotal();
if (rowsTotal.value.length > 0) {
let data: DataOptionLeave[] = [];
rowsTotal.value.map((e: ResponseTotalObject) => {
data.push({
id: e.typeLeaveId,
name: e.typeLeave,
totalLeave: e.totalLeave,
});
});
typeLeaveOption.value = data;
typeLeaveOptionFilter.value = data;
}
// if (rowsTotal.value.length > 0) {
// let data: DataOptionLeave[] = [];
// rowsTotal.value.map((e: ResponseTotalObject) => {
// data.push({
// id: e.typeLeaveId,
// name: e.typeLeave,
// totalLeave: e.totalLeave,
// });
// });
// typeLeaveOption.value = data;
// typeLeaveOptionFilter.value = data;
// }
await checkRowPage();
};
@ -1203,6 +1201,8 @@ const clickTotal = async () => {
.get(config.API.profileLeaveTotalId(profileId.value))
.then((res) => {
let data = res.data.result;
typeLeaveOption.value = data;
typeLeaveOptionFilter.value = data;
data.map((e: ResponseTotalObject) => {
rowsTotal.value.push({
typeLeaveId: e.typeLeaveId,

View file

@ -190,7 +190,7 @@
</datepicker>
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
<selector
<!-- <selector
:class="getClass(edit)"
:outlined="edit"
dense
@ -214,7 +214,21 @@
@filter="(inputValue: any,
doneFn: Function) => filterSelector(inputValue, doneFn, '1'
)"
/>
/> -->
<q-input
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:readonly="!edit"
:borderless="!edit"
v-model="posNo"
hide-bottom-space
:label="`${'เลขที่คำสั่ง'}`"
:rules="[(val: string) => !!val || `${'กรุณากรอกเลขที่คำสั่ง'}`]"
@update:modelValue="clickEditRow"
>
</q-input>
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
<selector
@ -403,8 +417,8 @@
currency: 'THB',
}"
:label="`${'เงินประจำตำแหน่ง'}`"
:rules="[(val: number) => !!val || `${'กรุณากรอกเงินประจำตำแหน่ง'}`]"
/>
<!-- :rules="[(val: number) => !!val || `${'กรุณากรอกเงินประจำตำแหน่ง'}`]" -->
<!-- <q-input
:class="getClass(edit)"
:outlined="edit"
@ -441,8 +455,8 @@
currency: 'THB',
}"
:label="`${'เงินค่าตอบแทนรายเดือน'}`"
:rules="[(val: number) => !!val || `${'กรุณากรอกเงินค่าตอบแทนรายเดือน'}`]"
/>
<!-- :rules="[(val: number) => !!val || `${'กรุณากรอกเงินค่าตอบแทนรายเดือน'}`]" -->
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
<q-input
@ -455,9 +469,9 @@
v-model="refCommandNo"
hide-bottom-space
:label="`${'เลขที่คำสั่ง'}`"
:rules="[(val: string) => !!val || `${'กรุณากรอกเลขที่คำสั่ง'}`]"
@update:modelValue="clickEditRow"
>
<!-- :rules="[(val: string) => !!val || `${'กรุณากรอกเลขที่คำสั่ง'}`]" -->
<template v-slot:append>
<q-icon
name="mdi-file"
@ -659,6 +673,7 @@ const positionLevelId = ref<string>();
const positionExecutiveId = ref<string>();
const positionExecutiveSideId = ref<string>();
const posNoId = ref<string>();
const posNo = ref<string>();
const refCommandNo = ref<string>();
const refCommandDate = ref<Date>(new Date());
const ocOptions = ref<DataOption[]>([]);
@ -1706,6 +1721,7 @@ const getData = async () => {
selected.value = row.ocId;
positionId.value = row.positionId;
posNoId.value = row.posNoId;
posNo.value = row.posNo;
positionLineId.value = row.positionLineId;
positionPathSideId.value = row.positionPathSideId;
positionTypeId.value = row.positionTypeId;
@ -1768,12 +1784,12 @@ const templateDetail = async () => {
salaryClass.value = salaryClass.value + `ตำแหน่ง${positionF[0].name} `;
}
const posNoF = posNoOptions.value.filter(
(r: DataOption) => r.id == posNoId.value
);
if (posNoF.length > 0) {
salaryClass.value = salaryClass.value + `ตำแหน่งเลขที่${posNoF[0].name} `;
}
// const posNoF = posNoOptions.value.filter(
// (r: DataOption) => r.id == posNoId.value
// );
// if (posNoF.length > 0) {
// salaryClass.value = salaryClass.value + `${posNoF[0].name} `;
// }
const positionLineF = positionLineOptions.value.filter(
(r: DataOption) => r.id == positionLineId.value
@ -1866,6 +1882,7 @@ const saveData = async () => {
ocId: selected.value,
positionId: positionId.value,
posNoId: posNoId.value,
posNo: posNo.value,
positionLineId: positionLineId.value,
positionPathSideId: positionPathSideId.value,
positionTypeId: positionTypeId.value,
@ -1903,6 +1920,7 @@ const editData = async () => {
ocId: selected.value,
positionId: positionId.value,
posNoId: posNoId.value,
posNo: posNo.value,
positionLineId: positionLineId.value,
positionPathSideId: positionPathSideId.value,
positionTypeId: positionTypeId.value,
@ -1993,10 +2011,11 @@ const selectData = async (props: DataProps) => {
amount.value = props.row.amount;
positionSalaryAmount.value = props.row.positionSalaryAmount;
mouthSalaryAmount.value = props.row.mouthSalaryAmount;
await onSelected(props.row.ocId);
// await onSelected(props.row.ocId);
selected.value = props.row.ocId;
positionId.value = props.row.positionId;
posNoId.value = props.row.posNoId;
posNo.value = props.row.posNo;
positionLineId.value = props.row.positionLineId;
positionPathSideId.value = props.row.positionPathSideId;
positionTypeId.value = props.row.positionTypeId;
@ -2026,6 +2045,7 @@ const addData = () => {
ocId.value = "";
positionId.value = "";
posNoId.value = "";
posNo.value = "";
positionLineId.value = "";
positionPathSideId.value = "";
positionTypeId.value = "";