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,
|
||||
dialogConfirm,
|
||||
dialogRemove,
|
||||
convertDateToAPI,
|
||||
} = mixin;
|
||||
|
||||
/** ตัวแปร */
|
||||
|
|
@ -353,9 +354,8 @@ function onSubmitConditions() {
|
|||
function onSubmitAttached() {
|
||||
dialogConfirm($q, () => {
|
||||
const formData = new FormData();
|
||||
const send = date.value !== null ? new Date(date.value).toUTCString() : "";
|
||||
const activeDate =
|
||||
dateLeave.value !== null ? new Date(dateLeave.value).toUTCString() : "";
|
||||
const send = convertDateToAPI(date.value) ?? "";
|
||||
const activeDate = convertDateToAPI(dateLeave.value) ?? "";
|
||||
formData.append("Location", location.value);
|
||||
formData.append("SendDate", send);
|
||||
formData.append("ActiveDate", activeDate);
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ const {
|
|||
hideLoader,
|
||||
success,
|
||||
findOrgName,
|
||||
convertDateToAPI,
|
||||
} = mixin;
|
||||
|
||||
/**
|
||||
|
|
@ -129,7 +130,7 @@ async function onSubmit() {
|
|||
amountOld: salary.value.toString().replace(/,/g, ""),
|
||||
organization: organization.value,
|
||||
reason: reason.value,
|
||||
date: date.value,
|
||||
date: convertDateToAPI(date.value),
|
||||
};
|
||||
showLoader();
|
||||
await http
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ const {
|
|||
hideLoader,
|
||||
showLoader,
|
||||
downloadRenameFileByLink,
|
||||
convertDateToAPI,
|
||||
} = mixin;
|
||||
const { filterSelector } = complainstStore; // function จาก store complainstStore
|
||||
|
||||
|
|
@ -133,7 +134,12 @@ function onSubmit() {
|
|||
if (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;
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ const {
|
|||
messageError,
|
||||
dialogRemove,
|
||||
downloadRenameFileByLink,
|
||||
convertDateToAPI,
|
||||
} = mixin;
|
||||
const investigateDis = useInvestigateDisStore();
|
||||
const countNum = ref<number>(1);
|
||||
|
|
@ -167,25 +168,18 @@ const calendarModalclose = () => (calendarModal.value = !calendarModal.value);
|
|||
function onSubmit() {
|
||||
countNum.value = 1;
|
||||
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) {
|
||||
formData.persons = mainStore.rowsAdd;
|
||||
}
|
||||
|
||||
props.onSubmit(formData);
|
||||
props.onSubmit({
|
||||
...formData,
|
||||
investigationDateStart: convertDateToAPI(
|
||||
formData.investigationDateStart as Date
|
||||
),
|
||||
investigationDateEnd: convertDateToAPI(
|
||||
formData.investigationDateEnd as Date
|
||||
),
|
||||
});
|
||||
isSave.value = false;
|
||||
investigationExtendStatus.value = false;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ const {
|
|||
dialogConfirm,
|
||||
messageError,
|
||||
success,
|
||||
convertDateToAPI,
|
||||
} = mixin;
|
||||
|
||||
const modalPersonal = ref<boolean>(false);
|
||||
|
|
@ -200,25 +201,29 @@ async function calEndDate(val: string) {
|
|||
*/
|
||||
function onSubmit() {
|
||||
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) {
|
||||
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;
|
||||
isSaveInfo.value = false;
|
||||
extendStatus.value = false;
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ const {
|
|||
showLoader,
|
||||
hideLoader,
|
||||
success,
|
||||
convertDateToAPI,
|
||||
} = mixin;
|
||||
|
||||
/**
|
||||
|
|
@ -208,8 +209,8 @@ async function saveData() {
|
|||
positionLevel: data.positionLevel,
|
||||
salary: data.salary,
|
||||
descriptionSuspend: data.descriptionSuspend,
|
||||
startDateSuspend: data.startDateSuspend,
|
||||
endDateSuspend: data.endDateSuspend,
|
||||
startDateSuspend: convertDateToAPI(data.startDateSuspend),
|
||||
endDateSuspend: convertDateToAPI(data.endDateSuspend),
|
||||
};
|
||||
showLoader();
|
||||
await http
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue