fix ConverDate เงินเดือน

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-03-14 09:33:36 +07:00
parent 9aee295a3f
commit 5450a034b7
6 changed files with 32 additions and 34 deletions

View file

@ -22,6 +22,7 @@ const {
hideLoader,
messageError,
success,
convertDateToAPI,
} = useCounterMixin();
/** props*/
@ -85,7 +86,12 @@ function onSubmit() {
const url = !props.isStatusEdit
? config.API.salaryEmployeeChart
: config.API.salaryEmployeeChartByid(props.data.id);
await http[!props.isStatusEdit ? "post" : "put"](url, formData);
await http[!props.isStatusEdit ? "post" : "put"](url, {
...formData,
date: convertDateToAPI(formData.date),
startDate: convertDateToAPI(formData.startDate),
endDate: convertDateToAPI(formData.endDate),
});
await props.fetchData?.();
success($q, "บันทีกข้อมูลสำเร็จ");
closeDialog();

View file

@ -156,8 +156,8 @@ const getClass = (val: boolean) => {
v-model="formData.salaryNo"
label="ลำดับชั้น"
:rules="[
(val) => !!val || 'กรุณากรอกลำดับชั้น',
(val) =>
(val:number) => !!val || 'กรุณากรอกลำดับชั้น',
(val:number) =>
Number(val) === Math.floor(val) ||
Number(val) === Math.floor(val) + 0.5 ||
`กรุณากรอกจำนวนเต็มเท่านั้ หรือ .5`,
@ -179,7 +179,7 @@ const getClass = (val: boolean) => {
mask="###,###,###,###"
reverse-fill-mask
:rules="[
(val) =>
(val:string) =>
!!val || `${'กรุณากรอกอัตราค่าจ้าง/ขั้นวิ่ง (รายเดือน)'}`,
]"
lazy-rules
@ -201,7 +201,7 @@ const getClass = (val: boolean) => {
lazy-rules
hide-bottom-space
:rules="[
(val) =>
(val:string) =>
!!val || `${'กรุณากรอกอัตราค่าจ้าง/ขั้นวิ่ง (รายวัน)'}`,
]"
/>