Merge branch 'develop' of github.com:Frappet/hrms-mgt into develop
This commit is contained in:
commit
fd0b78ecbc
5 changed files with 40 additions and 17 deletions
|
|
@ -47,6 +47,7 @@ export default {
|
||||||
|
|
||||||
|
|
||||||
exportCandidateListNew: (id: string) => `${recruit_report}candidate-new/${id}`,
|
exportCandidateListNew: (id: string) => `${recruit_report}candidate-new/${id}`,
|
||||||
|
reportCandidateListNew: (id: string) => `${recruit}report/candidate-new/${id}`,
|
||||||
examReport: (id: string,no:string) => `${recruit}report/exam/${id}/${no}`,
|
examReport: (id: string,no:string) => `${recruit}report/exam/${id}/${no}`,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ const baseColumns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "position",
|
name: "position",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ตำแแหน่ง",
|
label: "ตำแหน่งในสายงาน",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "position",
|
field: "position",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
|
|
@ -119,11 +119,11 @@ const baseColumns = ref<QTableProps["columns"]>([
|
||||||
format(val, row) {
|
format(val, row) {
|
||||||
let name = "";
|
let name = "";
|
||||||
if (row.posType && row.position) {
|
if (row.posType && row.position) {
|
||||||
name = `${row.posType} (${row.position})`;
|
name = `${row.posType} (${row.posLevel})`;
|
||||||
} else if (row.posType) {
|
} else if (row.posType) {
|
||||||
name = `${row.posType}`;
|
name = `${row.posType}`;
|
||||||
} else if (row.position) {
|
} else if (row.posLevel) {
|
||||||
name = `(${row.position})`;
|
name = `(${row.posLevel})`;
|
||||||
} else name = "-";
|
} else name = "-";
|
||||||
return name;
|
return name;
|
||||||
},
|
},
|
||||||
|
|
@ -213,9 +213,9 @@ function formatHistoryOwnerData(data: HistoryPos[]) {
|
||||||
return data.map((item) => ({
|
return data.map((item) => ({
|
||||||
...item,
|
...item,
|
||||||
fullname:
|
fullname:
|
||||||
item.prefix && item.firstName && item.lastName
|
item.firstName
|
||||||
? `${item.prefix} ${item.firstName} ${item.lastName}`.trim()
|
? `${item.prefix}${item.firstName} ${item.lastName}`.trim()
|
||||||
: "-",
|
: "ว่าง",
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -248,11 +248,34 @@ async function clickPassExam(id: string) {
|
||||||
async function clickCandidateList(id: string) {
|
async function clickCandidateList(id: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.exportCandidateListNew(id))
|
.get(config.API.reportCandidateListNew(id), {
|
||||||
|
headers: {
|
||||||
|
accept:
|
||||||
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||||||
|
"content-Type": "application/json",
|
||||||
|
},
|
||||||
|
|
||||||
|
responseType: "blob",
|
||||||
|
})
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
const data = res.data.result;
|
const data = res.data;
|
||||||
data.reportName = `CandidateList`;
|
if (data) {
|
||||||
await genReport(data, "รายชื่อผู้มีสิทธิ์สอบ", "pdf");
|
// สร้าง Blob จาก array buffer
|
||||||
|
const blob = new Blob([data]);
|
||||||
|
|
||||||
|
// สร้าง URL สำหรับไฟล์ Blob
|
||||||
|
const url = URL.createObjectURL(blob);
|
||||||
|
|
||||||
|
// สร้างลิงก์เพื่อดาวน์โหลดไฟล์
|
||||||
|
const link = document.createElement("a");
|
||||||
|
link.href = url;
|
||||||
|
link.download = `CandidateList.xlsx`; // กำหนดชื่อไฟล์ที่จะดาวน์โหลด
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
|
||||||
|
// ลบ URL ที่สร้างขึ้นหลังจากใช้งาน
|
||||||
|
URL.revokeObjectURL(url);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(async (e) => {
|
.catch(async (e) => {
|
||||||
messageError($q, JSON.parse(await e.response.data.text()));
|
messageError($q, JSON.parse(await e.response.data.text()));
|
||||||
|
|
@ -705,9 +728,7 @@ onMounted(async () => {
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<q-icon name="mdi-file-excel-outline" size="20px" />
|
<q-icon name="mdi-file-excel-outline" size="20px" />
|
||||||
<q-tooltip
|
<q-tooltip>นำเข้าไฟล์ผลการสอบ (บัญชีรายชื่อ)</q-tooltip>
|
||||||
>นำเข้าไฟล์ผลการสอบ (บัญชีรายชื่อ)</q-tooltip
|
|
||||||
>
|
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
{{ props.row.score.resultCount }}
|
{{ props.row.score.resultCount }}
|
||||||
|
|
@ -722,8 +743,7 @@ onMounted(async () => {
|
||||||
icon="mdi-file-excel-outline"
|
icon="mdi-file-excel-outline"
|
||||||
>
|
>
|
||||||
<q-tooltip
|
<q-tooltip
|
||||||
>นำเข้าไฟล์ผลการสอบ (บัญชีรายชื่อ)
|
>นำเข้าไฟล์ผลการสอบ (บัญชีรายชื่อ) อีกครั้ง</q-tooltip
|
||||||
อีกครั้ง</q-tooltip
|
|
||||||
>
|
>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ interface listMain {
|
||||||
positionDate: Date;
|
positionDate: Date;
|
||||||
leaveDate: Date;
|
leaveDate: Date;
|
||||||
id: string;
|
id: string;
|
||||||
|
nodeId: string;
|
||||||
}
|
}
|
||||||
//ข้อมูลจาก api
|
//ข้อมูลจาก api
|
||||||
interface listMainAPI {
|
interface listMainAPI {
|
||||||
|
|
|
||||||
|
|
@ -195,7 +195,8 @@ async function fecthlistOthet() {
|
||||||
e.positionLevelOld &&
|
e.positionLevelOld &&
|
||||||
e.positionNumberOld &&
|
e.positionNumberOld &&
|
||||||
e.positionDate &&
|
e.positionDate &&
|
||||||
e.leaveDate !== null
|
e.leaveDate !== null &&
|
||||||
|
e.nodeId !== null
|
||||||
);
|
);
|
||||||
rows2.value = listData;
|
rows2.value = listData;
|
||||||
rows2Data.value = listData;
|
rows2Data.value = listData;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue