Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m12s

* develop:
  fix:convertDateToAPI
This commit is contained in:
Warunee Tamkoo 2025-10-22 11:01:42 +07:00
commit d8d80a01cb
8 changed files with 42 additions and 13 deletions

View file

@ -133,6 +133,20 @@ interface Position2 {
positionExecutiveField: string; // ด้านทางการบริหาร
positionArea: string; // ด้าน/สาขา
positionIsSelected: string; // เป็นตำแหน่งที่ถูกเลือกในรอบนั้นๆ หรือไม่?
orgShortname: string; // อักษรย่อตำแหน่ง
posMasterNoPrefix: string; // Prefix นำหน้าเลขที่ตำแหน่ง เป็น Optional (ไม่ใช่อักษรย่อของหน่วยงาน/ส่วนราชการ)
posMasterNo: number | string; // เลขที่ตำแหน่ง เป็นตัวเลข
posMasterNoSuffix: string | null; // Suffix หลังเลขที่ตำแหน่ง เช่น ช.
fullNameCurrentHolder: string | null;
fullNameNextHolder: string | null;
positions: Position[]; // ตำแหน่ง
isSit: boolean;
profilePosition: string;
profilePostype: string;
profilePoslevel: string;
conditionReason: string;
isCondition: boolean;
isDirector: boolean;
}
interface PosMaster2 {
@ -162,7 +176,7 @@ interface PosMaster2 {
current_holderId?: string;
next_holderId?: string;
isSit?: boolean;
ancestorDNA: string;
ancestorDNA?: string;
}
interface HistoryPos {

View file

@ -9,6 +9,7 @@ import type {
DataActive,
SumPosition,
PosMaster,
PosMaster2,
} from "@/modules/02_organization/interface/response/organizational";
export const useOrganizational = defineStore("organizationalStore", () => {
@ -88,7 +89,7 @@ export const useOrganizational = defineStore("organizationalStore", () => {
* @returns
*/
function fetchPosMaster(data: PosMaster[]) {
const newPosMaster = data.map((e: PosMaster) => ({
const newPosMaster: PosMaster2[] = data.map((e: PosMaster) => ({
...e,
positionIsSelected:
typeOrganizational.value === "draft" && e.fullNameNextHolder !== null
@ -109,7 +110,7 @@ export const useOrganizational = defineStore("organizationalStore", () => {
isSit: e.isSit,
}));
return newPosMaster;
return newPosMaster || [];
}
/**

View file

@ -20,7 +20,7 @@ const $q = useQuasar();
const router = useRouter();
const route = useRoute();
const mixin = useCounterMixin();
const { messageError, success, showLoader, hideLoader, onSearchDataTable } =
const { messageError, success, showLoader, hideLoader, onSearchDataTable,convertDateToAPI } =
mixin;
const initialPagination = ref<Pagination>({
@ -370,7 +370,7 @@ function onSubmitCandidates(date: Date) {
showLoader();
await http
.post(config.API.periodRecruitToPlacement(importId.value), {
accountStartDate: date,
accountStartDate: convertDateToAPI(date),
})
.then(() => {
success($q, "นำผู้ผ่านสอบแข่งขันเข้าสู่ระบบบรรจุ");

View file

@ -20,8 +20,14 @@ const $q = useQuasar();
const router = useRouter();
const route = useRoute();
const mixin = useCounterMixin();
const { messageError, success, showLoader, hideLoader, onSearchDataTable } =
mixin;
const {
messageError,
success,
showLoader,
hideLoader,
onSearchDataTable,
convertDateToAPI,
} = mixin;
const year = ref<string>("2566");
const round = ref<string>("1");
@ -341,7 +347,7 @@ async function onSubmitCandidates(date: Date) {
showLoader();
await http
.post(config.API.periodDisableToPlacement(importId.value), {
accountStartDate: date,
accountStartDate: convertDateToAPI(date),
})
.then(() => {
success($q, "นำผู้ผ่านคัดเลือกคนพิการเข้าสู่ระบบบรรจุ");

View file

@ -95,7 +95,7 @@ function onSubmit() {
positionNumberOld: positionNumberOld.value,
amountOld: salary.value,
organization: organization.value,
date: date.value,
date: convertDateToAPI(date.value),
dateRepatriation: convertDateToAPI(dateRepatriation.value),
reason: reason.value,
};

View file

@ -27,6 +27,7 @@ const {
success,
dialogConfirm,
onSearchDataTable,
convertDateToAPI
} = mixin;
/** คอลัมน์ */
@ -206,7 +207,7 @@ async function saveAppoint() {
if (result) {
dialogConfirm($q, async () => {
const body = {
appointDate: dateBreak.value,
appointDate: convertDateToAPI(dateBreak.value),
};
showLoader();
await http

View file

@ -27,6 +27,7 @@ const {
hideLoader,
date2Thai,
calculateDurationYmd,
convertDateToAPI,
} = useCounterMixin();
/**
@ -77,7 +78,12 @@ function onSubmit() {
dialogConfirm($q, () => {
showLoader();
http
.post(config.API.devUploadUser + projectId.value, formData)
.post(config.API.devUploadUser + projectId.value, {
...formData,
dateStart: convertDateToAPI(formData.dateStart),
dateEnd: convertDateToAPI(formData.dateEnd),
commandDate: convertDateToAPI(formData.commandDate),
})
.then(async (res) => {
await props?.fetchData();
tab.value = res.data.result ? "IN" : "OUT";

View file

@ -21,6 +21,7 @@ const {
messageError,
dialogConfirm,
success,
convertDateToAPI,
} = mixin;
const modal = defineModel<boolean>("modal", { required: true });
@ -61,8 +62,8 @@ function onSubmit() {
.put(config.API.devScholarship + `/admin/detail/${id.value}`, {
bookNumber: bookNumber.value,
bookDate: bookDate.value,
governmentDate: governmentDate.value,
governmentEndDate: governmentEndDate.value,
governmentDate: convertDateToAPI(governmentDate.value),
governmentEndDate: convertDateToAPI(governmentEndDate.value),
isGraduated: isGraduated.value,
graduatedDate:
isGraduated.value == "true" ? graduatedDate.value : null,