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();