Merge branch 'develop'

This commit is contained in:
Warunee Tamkoo 2025-05-30 16:37:02 +07:00
commit e1f4c58f62
3 changed files with 175 additions and 148 deletions

View file

@ -24,7 +24,7 @@ export const useRestDataStore = defineStore("Rest", () => {
case "DONEREJECT":
return "ออกคำสั่งยกเลิกลาออกเสร็จแล้ว";
case "CANCELING":
return "กำลังดำเนิดการยกเลิกการ";
return "กำลังดำเนินการยกเลิก";
default:
return "-";
}

View file

@ -87,11 +87,14 @@ function onSubmit() {
function closeDialog() {
modal.value = false;
search.value = "";
rows.value = [];
selected.value = [];
}
function getCommander() {
async function getCommander() {
showLoader();
http
await http
.put(config.API.commanderPosexe("operate"), {
isAct: isAct.value,
keyword: search.value,
@ -104,7 +107,6 @@ function getCommander() {
})
.catch((e) => {
messageError($q, e);
hideLoader();
})
.finally(() => {
hideLoader();
@ -313,6 +315,7 @@ onMounted(() => {
hide-bottom-space
dense
label="คำค้น"
@keydown.enter.prevent="getSearch()"
/>
</div>
<q-checkbox
@ -332,7 +335,7 @@ onMounted(() => {
label="ค้นหา"
class="full-width q-pa-sm"
outline
@click.prevent="getCommander"
@click.prevent="getSearch()"
>
</q-btn>
</div>
@ -423,9 +426,14 @@ onMounted(() => {
<q-separator />
<q-card-actions align="right">
<q-btn label="บันทึก" color="secondary" type="submit"
><q-tooltip>นทกขอม</q-tooltip></q-btn
<q-btn
label="บันทึก"
color="secondary"
type="submit"
:disable="selected.length === 0"
>
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
</q-card-actions>
</q-form>
</q-card>

View file

@ -41,8 +41,14 @@ const formCommand = reactive<FormCommand>({
commanderAboveFullname: "", // 1
commanderAbovePosition: "", // 1
author: "", //
subject: "", //
subject: [], //
assignedPosition: "",
commanderPositionOld: "",
commanderOrgOld: "",
commanderOrg: "",
commanderAbovePositionOld: "",
commanderAboveOrgOld: "",
commanderAboveOrg: "",
});
const formData = reactive<FormData>({
@ -181,150 +187,150 @@ async function onClickDowloadFile(
fileName: string
) {
showLoader();
let educations: any = [];
if (profile.value != null) {
profile.value.educations.map((e: any) => {
educations.push({
educationLevel: e.educationLevel ?? "",
finishYear:
e.finishDate == null
? ""
: new Date(e.finishDate).getFullYear() + 543,
institute: e.institute ?? "",
});
});
}
let certificates: any = [];
if (profile.value != null) {
profile.value.certificates.map((e: any) => {
certificates.push({
certificateNo: e.certificateNo ?? "",
certificateType: e.certificateType ?? "",
issuer: e.issuer ?? "",
});
});
}
let salaries: any = [];
if (profile.value != null) {
profile.value.salaries.map((e: any) => {
salaries.push({
date: e.date == null ? "" : date2Thai(new Date(e.date)),
position: e.position ?? "",
amount: e.amount ?? "",
});
});
}
let trainings: any = [];
if (profile.value != null) {
profile.value.trainings.map((e: any) => {
trainings.push({
yearly: e.yearly ?? "",
startDate: e.startDate == null ? "" : date2Thai(new Date(e.startDate)),
endDate: e.endDate == null ? "" : date2Thai(new Date(e.endDate)),
name: e.name ?? "",
topic: e.topic ?? "",
});
});
}
const data = Object.assign(
{ educations: educations },
{ certificates: certificates },
{ salaries: salaries },
{ trainings: trainings },
{
fullName: dataPerson.formData.firstName
? `${dataPerson.formData.prefix}${dataPerson.formData.firstName} ${dataPerson.formData.lastName}`
: "",
},
{
position: dataPerson.formData.position
? dataPerson.formData.position
: "",
},
{
positionLevel: dataPerson.formData.posLevelName
? dataPerson.formData.posLevelName
: "",
},
{ posNo: dataPerson.formData.posNo ? dataPerson.formData.posNo : "" },
{ org: dataPerson.formData ? dataPerson.formData.org : "" },
{
birthDate: dataPerson.formData.birthDate
? date2Thai(new Date(dataPerson.formData.birthDate))
: "",
},
{
govAge: profile.value.government
? `${
profile.value.government.govAge.year !== 0
? `${profile.value.government.govAge.year} ปี`
: ""
} ${
profile.value.government.govAge.month !== 0
? `${profile.value.government.govAge.month} เดือน`
: ""
} ${
profile.value.government.govAge.day !== 0
? `${profile.value.government.govAge.day} วัน`
: ""
}`
: ``,
},
{
positionLevelNew:
profile.value == null
? ""
: profile.value.type == "EXPERT"
? "ชำนาญการ"
: "ชำนาญการพิเศษ",
},
// let educations: any = [];
// if (profile.value != null) {
// profile.value.educations.map((e: any) => {
// educations.push({
// educationLevel: e.educationLevel ?? "",
// finishYear:
// e.finishDate == null
// ? ""
// : new Date(e.finishDate).getFullYear() + 543,
// institute: e.institute ?? "",
// });
// });
// }
// let certificates: any = [];
// if (profile.value != null) {
// profile.value.certificates.map((e: any) => {
// certificates.push({
// certificateNo: e.certificateNo ?? "",
// certificateType: e.certificateType ?? "",
// issuer: e.issuer ?? "",
// });
// });
// }
// let salaries: any = [];
// if (profile.value != null) {
// profile.value.salaries.map((e: any) => {
// salaries.push({
// date: e.date == null ? "" : date2Thai(new Date(e.date)),
// position: e.position ?? "",
// amount: e.amount ?? "",
// });
// });
// }
// let trainings: any = [];
// if (profile.value != null) {
// profile.value.trainings.map((e: any) => {
// trainings.push({
// yearly: e.yearly ?? "",
// startDate: e.startDate == null ? "" : date2Thai(new Date(e.startDate)),
// endDate: e.endDate == null ? "" : date2Thai(new Date(e.endDate)),
// name: e.name ?? "",
// topic: e.topic ?? "",
// });
// });
// }
// const data = Object.assign(
// { educations: educations },
// { certificates: certificates },
// { salaries: salaries },
// { trainings: trainings },
// {
// fullName: dataPerson.formData.firstName
// ? `${dataPerson.formData.prefix}${dataPerson.formData.firstName} ${dataPerson.formData.lastName}`
// : "",
// },
// {
// position: dataPerson.formData.position
// ? dataPerson.formData.position
// : "",
// },
// {
// positionLevel: dataPerson.formData.posLevelName
// ? dataPerson.formData.posLevelName
// : "",
// },
// { posNo: dataPerson.formData.posNo ? dataPerson.formData.posNo : "" },
// { org: dataPerson.formData ? dataPerson.formData.org : "" },
// {
// birthDate: dataPerson.formData.birthDate
// ? date2Thai(new Date(dataPerson.formData.birthDate))
// : "",
// },
// {
// govAge: profile.value.government
// ? `${
// profile.value.government.govAge.year !== 0
// ? `${profile.value.government.govAge.year} `
// : ""
// } ${
// profile.value.government.govAge.month !== 0
// ? `${profile.value.government.govAge.month} `
// : ""
// } ${
// profile.value.government.govAge.day !== 0
// ? `${profile.value.government.govAge.day} `
// : ""
// }`
// : ``,
// },
// {
// positionLevelNew:
// profile.value == null
// ? ""
// : profile.value.type == "EXPERT"
// ? ""
// : "",
// },
tp === "EV1_005"
? { salary: dataPerson.formData.salary ? dataPerson.formData.salary : "" }
: null,
// tp === "EV1_005"
// ? { salary: dataPerson.formData.salary ? dataPerson.formData.salary : "" }
// : null,
tp === "EV1_006"
? {
years: {
lastTwoYear: toThaiNumber(currentYear - 2 + 543),
lastOneYear: toThaiNumber(currentYear - 1 + 543),
currentYear: toThaiNumber(currentYear + 543),
},
}
: null,
tp === "EV1_006" || tp === "EV1_008"
? { commanderFullname: formData.commanderFullname }
: null,
tp === "EV1_006" || tp === "EV1_008"
? { commanderPosition: formData.commanderPosition }
: null,
tp === "EV1_006" ? { commanderOrg: "" } : null,
tp === "EV1_006" || tp === "EV1_008"
? { commanderAboveFullname: formData.commanderAboveFullname }
: null,
tp === "EV1_006" || tp === "EV1_008"
? { commanderAbovePosition: formData.commanderAbovePosition }
: null,
tp === "EV1_006" ? { commanderAboveOrg: "" } : null,
// tp === "EV1_006"
// ? {
// years: {
// lastTwoYear: toThaiNumber(currentYear - 2 + 543),
// lastOneYear: toThaiNumber(currentYear - 1 + 543),
// currentYear: toThaiNumber(currentYear + 543),
// },
// }
// : null,
// tp === "EV1_006" || tp === "EV1_008"
// ? { commanderFullname: formData.commanderFullname }
// : null,
// tp === "EV1_006" || tp === "EV1_008"
// ? { commanderPosition: formData.commanderPosition }
// : null,
// tp === "EV1_006" ? { commanderOrg: "" } : null,
// tp === "EV1_006" || tp === "EV1_008"
// ? { commanderAboveFullname: formData.commanderAboveFullname }
// : null,
// tp === "EV1_006" || tp === "EV1_008"
// ? { commanderAbovePosition: formData.commanderAbovePosition }
// : null,
// tp === "EV1_006" ? { commanderAboveOrg: "" } : null,
tp === "EV1_007" ? { positionName: "-" } : null,
tp === "EV1_007" ? { positionLeaveName: "-" } : null,
// tp === "EV1_007" ? { positionName: "-" } : null,
// tp === "EV1_007" ? { positionLeaveName: "-" } : null,
tp === "EV1_009" ? { dateStart: dataPerson.formData.dateStart } : null,
tp === "EV1_009"
? { dateRetireLaw: dataPerson.formData.dateRetireLaw }
: null,
// tp === "EV1_009" ? { dateStart: dataPerson.formData.dateStart } : null,
// tp === "EV1_009"
// ? { dateRetireLaw: dataPerson.formData.dateRetireLaw }
// : null,
tp === "EV1_010" ? { subject: formData.subject } : null,
{ typeTh: "เชี่ยวชาญ" },
{ posNoWithSym: `(${dataPerson.formData.posNo})` },
{ orgNoNewLine: dataPerson.formData.org }
);
// tp === "EV1_010" ? { subject: formData.subject } : null,
// { typeTh: "" },
// { posNoWithSym: `(${dataPerson.formData.posNo})` },
// { orgNoNewLine: dataPerson.formData.org }
// );
const body = {
template: tp,
reportName: templateName,
data: data,
data: reportData.value,
};
await genReport(body, fileName); //
}
@ -402,7 +408,7 @@ async function uploadfile(uploadUrl: string, file: any) {
});
}
function getData() {
async function getData() {
showLoader();
http
.get(config.API.evaluationExpertise + `/${evaluateId.value}`)
@ -418,10 +424,9 @@ function getData() {
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
})
.finally(() => {});
}
function getDetail(type: any) {
@ -447,9 +452,23 @@ const keyObject = ref<string[]>([
"assessments",
"government",
]);
const reportData = ref<any>();
async function getCheckSpace() {
http
.get(config.API.evaluationReportCheckspecByid(evaluateId.value))
.then((res) => {
reportData.value = res.data.result;
})
.catch((e) => {
messageError($q, e);
hideLoader();
})
.finally(() => {});
}
onMounted(() => {
showLoader();
Promise.all([getData(), ...keyObject.value.map(getDetail)])
Promise.all([getData(), getCheckSpace(), ...keyObject.value.map(getDetail)])
.then(() => {})
.catch((e) => {
hideLoader();