fix ConverDate เงินเดือน
This commit is contained in:
parent
9aee295a3f
commit
5450a034b7
6 changed files with 32 additions and 34 deletions
|
|
@ -26,6 +26,7 @@ const {
|
|||
hideLoader,
|
||||
messageError,
|
||||
success,
|
||||
convertDateToAPI,
|
||||
} = useCounterMixin();
|
||||
|
||||
const modal = defineModel<boolean>("modal", { required: true });
|
||||
|
|
@ -77,9 +78,7 @@ const title = computed(() => {
|
|||
return name;
|
||||
});
|
||||
|
||||
/**
|
||||
* fiunction fetch ข้อมูลประเภทตำแหน่ง
|
||||
*/
|
||||
/** fiunction fetch ข้อมูลประเภทตำแหน่ง*/
|
||||
function fetchPosType() {
|
||||
http
|
||||
.get(config.API.salaryPosType)
|
||||
|
|
@ -97,9 +96,7 @@ function fetchPosType() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* fiunction fetch ข้อมูลระดับตำแหน่ง
|
||||
*/
|
||||
/** fiunction fetch ข้อมูลระดับตำแหน่ง*/
|
||||
function fetchPosLevel(id: string) {
|
||||
const filterLevel = posType.value.find((e: SalaryPosType) => e.id === id);
|
||||
const listOption =
|
||||
|
|
@ -144,9 +141,7 @@ function fetchSalaryDetail(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* callbackFunction ทำการ fetch ข้อมูลไฟล์เมื่อเปิด Dialog
|
||||
*/
|
||||
/**callbackFunction ทำการ fetch ข้อมูลไฟล์เมื่อเปิด Dialog*/
|
||||
watch(
|
||||
() => modal.value,
|
||||
async () => {
|
||||
|
|
@ -167,17 +162,13 @@ watch(
|
|||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* function ปืด Dialog
|
||||
*/
|
||||
/** function ปืด Dialog*/
|
||||
function closeDialog() {
|
||||
modal.value = !modal.value;
|
||||
clearFormData();
|
||||
}
|
||||
|
||||
/**
|
||||
* function เคลียข้อมูล form
|
||||
*/
|
||||
/** function เคลียข้อมูล form*/
|
||||
function clearFormData() {
|
||||
formData.name = "";
|
||||
formData.posTypeId = "";
|
||||
|
|
@ -191,9 +182,7 @@ function clearFormData() {
|
|||
isReadonly.value = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* function บันทึกข้อมูลผังบัญชีเงินเดือน
|
||||
*/
|
||||
/** function บันทึกข้อมูลผังบัญชีเงินเดือน*/
|
||||
function onSubmit() {
|
||||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
|
|
@ -202,7 +191,12 @@ function onSubmit() {
|
|||
props.typeAction === "add"
|
||||
? config.API.salaryChart
|
||||
: config.API.salaryChartByid(salaryId.value);
|
||||
await http[props.typeAction === "add" ? "post" : "put"](url, formData);
|
||||
await http[props.typeAction === "add" ? "post" : "put"](url, {
|
||||
...formData,
|
||||
date: convertDateToAPI(formData.date),
|
||||
startDate: convertDateToAPI(formData.startDate),
|
||||
endDate: convertDateToAPI(formData.endDate),
|
||||
});
|
||||
await props.fetchData?.();
|
||||
await success($q, "บันทีกข้อมูลสำเร็จ");
|
||||
closeDialog();
|
||||
|
|
@ -214,9 +208,7 @@ function onSubmit() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function checkEndDate
|
||||
*/
|
||||
/** function checkEndDate*/
|
||||
function checkEndDate() {
|
||||
if (formData.endDate !== null && formData.startDate !== null) {
|
||||
if (formData.endDate < formData.startDate) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue