diff --git a/src/modules/03_retire/store.ts b/src/modules/03_retire/store.ts index e322d20..c5b28f5 100644 --- a/src/modules/03_retire/store.ts +++ b/src/modules/03_retire/store.ts @@ -24,7 +24,7 @@ export const useRestDataStore = defineStore("Rest", () => { case "DONEREJECT": return "ออกคำสั่งยกเลิกลาออกเสร็จแล้ว"; case "CANCELING": - return "กำลังดำเนิดการยกเลิกการ"; + return "กำลังดำเนินการยกเลิก"; default: return "-"; } diff --git a/src/modules/05_leave/components/FormLeave/Form.vue b/src/modules/05_leave/components/FormLeave/Form.vue index 36cd08d..ac50dc6 100644 --- a/src/modules/05_leave/components/FormLeave/Form.vue +++ b/src/modules/05_leave/components/FormLeave/Form.vue @@ -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()" /> { label="ค้นหา" class="full-width q-pa-sm" outline - @click.prevent="getCommander" + @click.prevent="getSearch()" > @@ -423,9 +426,14 @@ onMounted(() => { - บันทึกข้อมูล + บันทึกข้อมูล + diff --git a/src/modules/06_evaluate/components/ExpertPageDetail.vue b/src/modules/06_evaluate/components/ExpertPageDetail.vue index 070a51b..048da81 100644 --- a/src/modules/06_evaluate/components/ExpertPageDetail.vue +++ b/src/modules/06_evaluate/components/ExpertPageDetail.vue @@ -41,8 +41,14 @@ const formCommand = reactive({ commanderAboveFullname: "", //ผู้บังคับบัญชาเหนือขึ้นไป 1 ระดับ commanderAbovePosition: "", //ตำแหน่ง ผู้บังคับบัญชาเหนือขึ้นไป 1 ระดับ author: "", //เจ้าของผลงาน - subject: "", //ชื่อผลงาน + subject: [], //ชื่อผลงาน assignedPosition: "", + commanderPositionOld: "", + commanderOrgOld: "", + commanderOrg: "", + commanderAbovePositionOld: "", + commanderAboveOrgOld: "", + commanderAboveOrg: "", }); const formData = reactive({ @@ -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([ "assessments", "government", ]); +const reportData = ref(); +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();