convertDate วินัย
This commit is contained in:
parent
7ed5191db1
commit
60dcf38aa2
6 changed files with 45 additions and 38 deletions
|
|
@ -36,6 +36,7 @@ const {
|
||||||
success,
|
success,
|
||||||
dialogConfirm,
|
dialogConfirm,
|
||||||
dialogRemove,
|
dialogRemove,
|
||||||
|
convertDateToAPI,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
/** ตัวแปร */
|
/** ตัวแปร */
|
||||||
|
|
@ -353,9 +354,8 @@ function onSubmitConditions() {
|
||||||
function onSubmitAttached() {
|
function onSubmitAttached() {
|
||||||
dialogConfirm($q, () => {
|
dialogConfirm($q, () => {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
const send = date.value !== null ? new Date(date.value).toUTCString() : "";
|
const send = convertDateToAPI(date.value) ?? "";
|
||||||
const activeDate =
|
const activeDate = convertDateToAPI(dateLeave.value) ?? "";
|
||||||
dateLeave.value !== null ? new Date(dateLeave.value).toUTCString() : "";
|
|
||||||
formData.append("Location", location.value);
|
formData.append("Location", location.value);
|
||||||
formData.append("SendDate", send);
|
formData.append("SendDate", send);
|
||||||
formData.append("ActiveDate", activeDate);
|
formData.append("ActiveDate", activeDate);
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ const {
|
||||||
hideLoader,
|
hideLoader,
|
||||||
success,
|
success,
|
||||||
findOrgName,
|
findOrgName,
|
||||||
|
convertDateToAPI,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -129,7 +130,7 @@ async function onSubmit() {
|
||||||
amountOld: salary.value.toString().replace(/,/g, ""),
|
amountOld: salary.value.toString().replace(/,/g, ""),
|
||||||
organization: organization.value,
|
organization: organization.value,
|
||||||
reason: reason.value,
|
reason: reason.value,
|
||||||
date: date.value,
|
date: convertDateToAPI(date.value),
|
||||||
};
|
};
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ const {
|
||||||
hideLoader,
|
hideLoader,
|
||||||
showLoader,
|
showLoader,
|
||||||
downloadRenameFileByLink,
|
downloadRenameFileByLink,
|
||||||
|
convertDateToAPI,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
const { filterSelector } = complainstStore; // function จาก store complainstStore
|
const { filterSelector } = complainstStore; // function จาก store complainstStore
|
||||||
|
|
||||||
|
|
@ -133,7 +134,12 @@ function onSubmit() {
|
||||||
if (mainStore.rowsAdd) {
|
if (mainStore.rowsAdd) {
|
||||||
formData.persons = await mainStore.rowsAdd;
|
formData.persons = await mainStore.rowsAdd;
|
||||||
}
|
}
|
||||||
await props.onSubmit(formData);
|
await props.onSubmit({
|
||||||
|
...formData,
|
||||||
|
dateConsideration: convertDateToAPI(formData.dateConsideration),
|
||||||
|
dateNotification: convertDateToAPI(formData.dateNotification),
|
||||||
|
dateReceived: convertDateToAPI(formData.dateReceived),
|
||||||
|
});
|
||||||
isSave.value = false;
|
isSave.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ const {
|
||||||
messageError,
|
messageError,
|
||||||
dialogRemove,
|
dialogRemove,
|
||||||
downloadRenameFileByLink,
|
downloadRenameFileByLink,
|
||||||
|
convertDateToAPI,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
const investigateDis = useInvestigateDisStore();
|
const investigateDis = useInvestigateDisStore();
|
||||||
const countNum = ref<number>(1);
|
const countNum = ref<number>(1);
|
||||||
|
|
@ -167,25 +168,18 @@ const calendarModalclose = () => (calendarModal.value = !calendarModal.value);
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
countNum.value = 1;
|
countNum.value = 1;
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm($q, async () => {
|
||||||
if (
|
|
||||||
formData.investigationDateStart !== null &&
|
|
||||||
formData.investigationDateEnd !== null
|
|
||||||
) {
|
|
||||||
const investigationDateStart = new Date(formData.investigationDateStart);
|
|
||||||
const investigationDateEnd = new Date(formData.investigationDateEnd);
|
|
||||||
|
|
||||||
formData.investigationDateStart = moment(investigationDateStart).format(
|
|
||||||
"YYYY-MM-DD"
|
|
||||||
);
|
|
||||||
formData.investigationDateEnd =
|
|
||||||
moment(investigationDateEnd).format("YYYY-MM-DD");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mainStore.rowsAdd) {
|
if (mainStore.rowsAdd) {
|
||||||
formData.persons = mainStore.rowsAdd;
|
formData.persons = mainStore.rowsAdd;
|
||||||
}
|
}
|
||||||
|
props.onSubmit({
|
||||||
props.onSubmit(formData);
|
...formData,
|
||||||
|
investigationDateStart: convertDateToAPI(
|
||||||
|
formData.investigationDateStart as Date
|
||||||
|
),
|
||||||
|
investigationDateEnd: convertDateToAPI(
|
||||||
|
formData.investigationDateEnd as Date
|
||||||
|
),
|
||||||
|
});
|
||||||
isSave.value = false;
|
isSave.value = false;
|
||||||
investigationExtendStatus.value = false;
|
investigationExtendStatus.value = false;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ const {
|
||||||
dialogConfirm,
|
dialogConfirm,
|
||||||
messageError,
|
messageError,
|
||||||
success,
|
success,
|
||||||
|
convertDateToAPI,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
const modalPersonal = ref<boolean>(false);
|
const modalPersonal = ref<boolean>(false);
|
||||||
|
|
@ -200,25 +201,29 @@ async function calEndDate(val: string) {
|
||||||
*/
|
*/
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm($q, async () => {
|
||||||
if (
|
|
||||||
formData.disciplinaryDateStart !== null &&
|
|
||||||
formData.disciplinaryDateEnd !== null
|
|
||||||
) {
|
|
||||||
const disciplinaryDateStart = new Date(formData.disciplinaryDateStart);
|
|
||||||
const disciplinaryDateEnd = new Date(formData.disciplinaryDateEnd);
|
|
||||||
|
|
||||||
formData.disciplinaryDateStart = moment(disciplinaryDateStart).format(
|
|
||||||
"YYYY-MM-DD"
|
|
||||||
);
|
|
||||||
formData.disciplinaryDateEnd =
|
|
||||||
moment(disciplinaryDateEnd).format("YYYY-MM-DD");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mainStore.rowsAdd) {
|
if (mainStore.rowsAdd) {
|
||||||
formData.persons = mainStore.rowsAdd as any;
|
formData.persons = mainStore.rowsAdd as any;
|
||||||
}
|
}
|
||||||
|
|
||||||
emit("submit:disciplinary", formData);
|
emit("submit:disciplinary", {
|
||||||
|
...formData,
|
||||||
|
disciplinaryDateStart: convertDateToAPI(
|
||||||
|
formData.disciplinaryDateStart as Date
|
||||||
|
),
|
||||||
|
disciplinaryDateEnd: convertDateToAPI(
|
||||||
|
formData.disciplinaryDateEnd as Date
|
||||||
|
),
|
||||||
|
disciplinaryDateAllegation: convertDateToAPI(
|
||||||
|
formData.disciplinaryDateAllegation
|
||||||
|
),
|
||||||
|
disciplinaryDateEvident: convertDateToAPI(
|
||||||
|
formData.disciplinaryDateEvident
|
||||||
|
),
|
||||||
|
disciplinaryDateInvestigation: convertDateToAPI(
|
||||||
|
formData.disciplinaryDateInvestigation
|
||||||
|
),
|
||||||
|
disciplinaryDateResult: convertDateToAPI(formData.disciplinaryDateResult),
|
||||||
|
});
|
||||||
isSave.value = false;
|
isSave.value = false;
|
||||||
isSaveInfo.value = false;
|
isSaveInfo.value = false;
|
||||||
extendStatus.value = false;
|
extendStatus.value = false;
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ const {
|
||||||
showLoader,
|
showLoader,
|
||||||
hideLoader,
|
hideLoader,
|
||||||
success,
|
success,
|
||||||
|
convertDateToAPI,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -208,8 +209,8 @@ async function saveData() {
|
||||||
positionLevel: data.positionLevel,
|
positionLevel: data.positionLevel,
|
||||||
salary: data.salary,
|
salary: data.salary,
|
||||||
descriptionSuspend: data.descriptionSuspend,
|
descriptionSuspend: data.descriptionSuspend,
|
||||||
startDateSuspend: data.startDateSuspend,
|
startDateSuspend: convertDateToAPI(data.startDateSuspend),
|
||||||
endDateSuspend: data.endDateSuspend,
|
endDateSuspend: convertDateToAPI(data.endDateSuspend),
|
||||||
};
|
};
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue