พัฒนาบุคลากร convertDate
This commit is contained in:
parent
d97241a199
commit
ebb5d0e65f
2 changed files with 19 additions and 2 deletions
|
|
@ -23,7 +23,7 @@ const $q = useQuasar();
|
|||
const store = useDevelopmentDataStore();
|
||||
const route = useRoute();
|
||||
const itemsDevelopment = uselistDevelopmentDataStore();
|
||||
const { showLoader, hideLoader, messageError, date2Thai, diffDay, success } =
|
||||
const { showLoader, hideLoader, messageError, date2Thai, diffDay, success,convertDateToAPI } =
|
||||
useCounterMixin();
|
||||
|
||||
const isChangeData = defineModel<boolean>("isChangeData", { required: true });
|
||||
|
|
@ -247,6 +247,8 @@ async function onSubmit() {
|
|||
await http
|
||||
.put(config.API.developmentMainTab("tab3", projectId.value), {
|
||||
...formData,
|
||||
dateEnd:convertDateToAPI(formData.dateEnd),
|
||||
dateStart:convertDateToAPI(formData.dateStart),
|
||||
totalDate: formData.totalDate === "" ? null : formData.totalDate,
|
||||
projectDayBackPlanned:
|
||||
formData.projectDayBackPlanned === ""
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ const {
|
|||
success,
|
||||
date2Thai,
|
||||
calculateDurationYmd,
|
||||
convertDateToAPI,
|
||||
} = useCounterMixin();
|
||||
|
||||
const checkRouteDetail = ref<boolean>(
|
||||
|
|
@ -298,12 +299,26 @@ function onSubmit() {
|
|||
formBody.reportBackDate = null;
|
||||
formBody.changeDetail = "";
|
||||
}
|
||||
|
||||
try {
|
||||
const url = scholarshipId.value
|
||||
? config.API.devScholarshipByid(scholarshipId.value)
|
||||
: config.API.devScholarship;
|
||||
const method = scholarshipId.value ? "put" : "post";
|
||||
await http[method](url, formBody);
|
||||
await http[method](url, {
|
||||
...formBody,
|
||||
bookApproveDate: convertDateToAPI(formBody.bookApproveDate),
|
||||
bookNoDate: convertDateToAPI(formBody.bookNoDate),
|
||||
contractDate: convertDateToAPI(formBody.contractDate),
|
||||
endDate: convertDateToAPI(formBody.endDate),
|
||||
reportBackDate: convertDateToAPI(formBody.reportBackDate),
|
||||
reportBackNoDate: convertDateToAPI(formBody.reportBackNoDate),
|
||||
startDate: convertDateToAPI(formBody.startDate),
|
||||
studyAbroadEndDate: convertDateToAPI(formBody.studyAbroadEndDate),
|
||||
studyAbroadStartDate: convertDateToAPI(formBody.studyAbroadStartDate),
|
||||
studyEndDate: convertDateToAPI(formBody.studyEndDate),
|
||||
studyStartDate: convertDateToAPI(formBody.studyStartDate),
|
||||
});
|
||||
|
||||
scholarshipId.value
|
||||
? await fetchDataDetail(scholarshipId.value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue