Merge pull request #1488 from Frappet/fix/formatDate
fix:convertDateToAPI
This commit is contained in:
commit
8f53521403
8 changed files with 42 additions and 13 deletions
|
|
@ -133,6 +133,20 @@ interface Position2 {
|
||||||
positionExecutiveField: string; // ด้านทางการบริหาร
|
positionExecutiveField: string; // ด้านทางการบริหาร
|
||||||
positionArea: string; // ด้าน/สาขา
|
positionArea: string; // ด้าน/สาขา
|
||||||
positionIsSelected: 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 {
|
interface PosMaster2 {
|
||||||
|
|
@ -162,7 +176,7 @@ interface PosMaster2 {
|
||||||
current_holderId?: string;
|
current_holderId?: string;
|
||||||
next_holderId?: string;
|
next_holderId?: string;
|
||||||
isSit?: boolean;
|
isSit?: boolean;
|
||||||
ancestorDNA: string;
|
ancestorDNA?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface HistoryPos {
|
interface HistoryPos {
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import type {
|
||||||
DataActive,
|
DataActive,
|
||||||
SumPosition,
|
SumPosition,
|
||||||
PosMaster,
|
PosMaster,
|
||||||
|
PosMaster2,
|
||||||
} from "@/modules/02_organization/interface/response/organizational";
|
} from "@/modules/02_organization/interface/response/organizational";
|
||||||
|
|
||||||
export const useOrganizational = defineStore("organizationalStore", () => {
|
export const useOrganizational = defineStore("organizationalStore", () => {
|
||||||
|
|
@ -88,7 +89,7 @@ export const useOrganizational = defineStore("organizationalStore", () => {
|
||||||
* @returns ข้อมูลตำแหน่งที่ผ่านการประมวลผลแล้ว
|
* @returns ข้อมูลตำแหน่งที่ผ่านการประมวลผลแล้ว
|
||||||
*/
|
*/
|
||||||
function fetchPosMaster(data: PosMaster[]) {
|
function fetchPosMaster(data: PosMaster[]) {
|
||||||
const newPosMaster = data.map((e: PosMaster) => ({
|
const newPosMaster: PosMaster2[] = data.map((e: PosMaster) => ({
|
||||||
...e,
|
...e,
|
||||||
positionIsSelected:
|
positionIsSelected:
|
||||||
typeOrganizational.value === "draft" && e.fullNameNextHolder !== null
|
typeOrganizational.value === "draft" && e.fullNameNextHolder !== null
|
||||||
|
|
@ -109,7 +110,7 @@ export const useOrganizational = defineStore("organizationalStore", () => {
|
||||||
isSit: e.isSit,
|
isSit: e.isSit,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
return newPosMaster;
|
return newPosMaster || [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ const $q = useQuasar();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { messageError, success, showLoader, hideLoader, onSearchDataTable } =
|
const { messageError, success, showLoader, hideLoader, onSearchDataTable,convertDateToAPI } =
|
||||||
mixin;
|
mixin;
|
||||||
|
|
||||||
const initialPagination = ref<Pagination>({
|
const initialPagination = ref<Pagination>({
|
||||||
|
|
@ -370,7 +370,7 @@ function onSubmitCandidates(date: Date) {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.post(config.API.periodRecruitToPlacement(importId.value), {
|
.post(config.API.periodRecruitToPlacement(importId.value), {
|
||||||
accountStartDate: date,
|
accountStartDate: convertDateToAPI(date),
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
success($q, "นำผู้ผ่านสอบแข่งขันเข้าสู่ระบบบรรจุ");
|
success($q, "นำผู้ผ่านสอบแข่งขันเข้าสู่ระบบบรรจุ");
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,14 @@ const $q = useQuasar();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { messageError, success, showLoader, hideLoader, onSearchDataTable } =
|
const {
|
||||||
mixin;
|
messageError,
|
||||||
|
success,
|
||||||
|
showLoader,
|
||||||
|
hideLoader,
|
||||||
|
onSearchDataTable,
|
||||||
|
convertDateToAPI,
|
||||||
|
} = mixin;
|
||||||
|
|
||||||
const year = ref<string>("2566");
|
const year = ref<string>("2566");
|
||||||
const round = ref<string>("1");
|
const round = ref<string>("1");
|
||||||
|
|
@ -341,7 +347,7 @@ async function onSubmitCandidates(date: Date) {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.post(config.API.periodDisableToPlacement(importId.value), {
|
.post(config.API.periodDisableToPlacement(importId.value), {
|
||||||
accountStartDate: date,
|
accountStartDate: convertDateToAPI(date),
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
success($q, "นำผู้ผ่านคัดเลือกคนพิการเข้าสู่ระบบบรรจุ");
|
success($q, "นำผู้ผ่านคัดเลือกคนพิการเข้าสู่ระบบบรรจุ");
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ function onSubmit() {
|
||||||
positionNumberOld: positionNumberOld.value,
|
positionNumberOld: positionNumberOld.value,
|
||||||
amountOld: salary.value,
|
amountOld: salary.value,
|
||||||
organization: organization.value,
|
organization: organization.value,
|
||||||
date: date.value,
|
date: convertDateToAPI(date.value),
|
||||||
dateRepatriation: convertDateToAPI(dateRepatriation.value),
|
dateRepatriation: convertDateToAPI(dateRepatriation.value),
|
||||||
reason: reason.value,
|
reason: reason.value,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ const {
|
||||||
success,
|
success,
|
||||||
dialogConfirm,
|
dialogConfirm,
|
||||||
onSearchDataTable,
|
onSearchDataTable,
|
||||||
|
convertDateToAPI
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
/** คอลัมน์ */
|
/** คอลัมน์ */
|
||||||
|
|
@ -206,7 +207,7 @@ async function saveAppoint() {
|
||||||
if (result) {
|
if (result) {
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm($q, async () => {
|
||||||
const body = {
|
const body = {
|
||||||
appointDate: dateBreak.value,
|
appointDate: convertDateToAPI(dateBreak.value),
|
||||||
};
|
};
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ const {
|
||||||
hideLoader,
|
hideLoader,
|
||||||
date2Thai,
|
date2Thai,
|
||||||
calculateDurationYmd,
|
calculateDurationYmd,
|
||||||
|
convertDateToAPI,
|
||||||
} = useCounterMixin();
|
} = useCounterMixin();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -77,7 +78,12 @@ function onSubmit() {
|
||||||
dialogConfirm($q, () => {
|
dialogConfirm($q, () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
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) => {
|
.then(async (res) => {
|
||||||
await props?.fetchData();
|
await props?.fetchData();
|
||||||
tab.value = res.data.result ? "IN" : "OUT";
|
tab.value = res.data.result ? "IN" : "OUT";
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ const {
|
||||||
messageError,
|
messageError,
|
||||||
dialogConfirm,
|
dialogConfirm,
|
||||||
success,
|
success,
|
||||||
|
convertDateToAPI,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
const modal = defineModel<boolean>("modal", { required: true });
|
const modal = defineModel<boolean>("modal", { required: true });
|
||||||
|
|
||||||
|
|
@ -61,8 +62,8 @@ function onSubmit() {
|
||||||
.put(config.API.devScholarship + `/admin/detail/${id.value}`, {
|
.put(config.API.devScholarship + `/admin/detail/${id.value}`, {
|
||||||
bookNumber: bookNumber.value,
|
bookNumber: bookNumber.value,
|
||||||
bookDate: bookDate.value,
|
bookDate: bookDate.value,
|
||||||
governmentDate: governmentDate.value,
|
governmentDate: convertDateToAPI(governmentDate.value),
|
||||||
governmentEndDate: governmentEndDate.value,
|
governmentEndDate: convertDateToAPI(governmentEndDate.value),
|
||||||
isGraduated: isGraduated.value,
|
isGraduated: isGraduated.value,
|
||||||
graduatedDate:
|
graduatedDate:
|
||||||
isGraduated.value == "true" ? graduatedDate.value : null,
|
isGraduated.value == "true" ? graduatedDate.value : null,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue