导出头像 学籍卡导出 顶岗申请
This commit is contained in:
@@ -504,11 +504,10 @@ export const exportStudentData = (data: any) => {
|
|||||||
/**
|
/**
|
||||||
* 申请顶岗
|
* 申请顶岗
|
||||||
* @param data
|
* @param data
|
||||||
* TODO: 接口文档中未找到此接口,请提供正确的接口地址
|
|
||||||
*/
|
*/
|
||||||
export const applyInternship = (data: any) => {
|
export const applyInternship = (data: any) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/basic/basicstudent/applyInternship', // TODO: 接口文档中未找到此接口
|
url: '/work/jobfairstu/batchSaveJobFairStu',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data,
|
data: data,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -277,6 +277,25 @@
|
|||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 申请顶岗弹窗 -->
|
||||||
|
<el-dialog title="申请顶岗" v-model="applyInternshipDialogVisible" :close-on-click-modal="false" draggable width="400px">
|
||||||
|
<el-form :model="applyInternshipForm" label-width="80px">
|
||||||
|
<el-form-item label="顶岗年份" required>
|
||||||
|
<el-select v-model="applyInternshipForm.year" placeholder="请选择顶岗年份" style="width: 100%">
|
||||||
|
<el-option v-for="item in workYearList" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="applyInternshipDialogVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="handleApplyInternshipConfirm" :loading="applyInternshipLoading" :disabled="!applyInternshipForm.year">
|
||||||
|
确 定
|
||||||
|
</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -361,6 +380,13 @@ const exportFieldLoading = ref(false);
|
|||||||
const selectedExportFields = ref<string[]>([]);
|
const selectedExportFields = ref<string[]>([]);
|
||||||
const exportFieldCheckAll = ref(false);
|
const exportFieldCheckAll = ref(false);
|
||||||
const exportFieldIndeterminate = ref(false);
|
const exportFieldIndeterminate = ref(false);
|
||||||
|
// 申请顶岗相关
|
||||||
|
const applyInternshipDialogVisible = ref(false);
|
||||||
|
const applyInternshipLoading = ref(false);
|
||||||
|
const workYearList = ref<any[]>([]);
|
||||||
|
const applyInternshipForm = reactive({
|
||||||
|
year: '',
|
||||||
|
});
|
||||||
|
|
||||||
// 表格列配置
|
// 表格列配置
|
||||||
const tableColumns = [
|
const tableColumns = [
|
||||||
@@ -632,12 +658,76 @@ const handleExportFieldConfirm = async () => {
|
|||||||
|
|
||||||
// 申请顶岗
|
// 申请顶岗
|
||||||
const handleApplyInternship = async () => {
|
const handleApplyInternship = async () => {
|
||||||
useMessage().warning('功能开发中');
|
if (selectedRows.value.length === 0) {
|
||||||
|
useMessage().warning('请先选择要申请顶岗的学生');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取顶岗年份字典
|
||||||
|
try {
|
||||||
|
const yearRes = await getDicts('work_year');
|
||||||
|
if (yearRes.data && Array.isArray(yearRes.data)) {
|
||||||
|
workYearList.value = yearRes.data.map((item: any) => ({
|
||||||
|
label: item.label || item.dictLabel || item.name,
|
||||||
|
value: item.value || item.dictValue || item.code,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
// 重置表单并打开弹窗
|
||||||
|
applyInternshipForm.year = '';
|
||||||
|
applyInternshipDialogVisible.value = true;
|
||||||
|
} catch (err: any) {
|
||||||
|
useMessage().error(err.msg || '获取顶岗年份失败');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 确认申请顶岗
|
||||||
|
const handleApplyInternshipConfirm = async () => {
|
||||||
|
if (!applyInternshipForm.year) {
|
||||||
|
useMessage().warning('请选择顶岗年份');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
applyInternshipLoading.value = true;
|
||||||
|
try {
|
||||||
|
// 构建请求数据
|
||||||
|
const stuList = selectedRows.value.map((row) => ({ stuNo: row.stuNo }));
|
||||||
|
await applyInternship({ stuList, year: applyInternshipForm.year });
|
||||||
|
useMessage().success('申请顶岗成功');
|
||||||
|
applyInternshipDialogVisible.value = false;
|
||||||
|
getDataList();
|
||||||
|
} catch (err: any) {
|
||||||
|
useMessage().error(err.msg || '申请顶岗失败');
|
||||||
|
} finally {
|
||||||
|
applyInternshipLoading.value = false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 导出头像
|
// 导出头像
|
||||||
const handleExportAvatar = async () => {
|
const handleExportAvatar = async () => {
|
||||||
useMessage().warning('功能开发中');
|
if (!searchForm.classCode) {
|
||||||
|
useMessage().warning('请先选择班级');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const res = await getDownPic({
|
||||||
|
classCode: searchForm.classCode,
|
||||||
|
stuStatus: searchForm.stuStatus || '1',
|
||||||
|
});
|
||||||
|
// 处理blob下载
|
||||||
|
const blob = new Blob([res], { type: 'application/zip' });
|
||||||
|
const url = window.URL.createObjectURL(blob);
|
||||||
|
const link = document.createElement('a');
|
||||||
|
link.href = url;
|
||||||
|
link.download = `学生头像_${searchForm.classCode}.zip`;
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
document.body.removeChild(link);
|
||||||
|
window.URL.revokeObjectURL(url);
|
||||||
|
useMessage().success('导出成功');
|
||||||
|
} catch (err: any) {
|
||||||
|
useMessage().error(err.msg || '导出失败');
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 批量打印
|
// 批量打印
|
||||||
@@ -692,7 +782,28 @@ const handleUploadError = (err: any) => {
|
|||||||
|
|
||||||
// 学籍卡导出
|
// 学籍卡导出
|
||||||
const handleExportStudentCard = async () => {
|
const handleExportStudentCard = async () => {
|
||||||
useMessage().warning('功能开发中');
|
if (selectedRows.value.length === 0) {
|
||||||
|
useMessage().warning('请先选择要导出学籍卡的学生');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const stuNoList = selectedRows.value.map((row) => row.stuNo);
|
||||||
|
const res = await exportStuInfoCard({ stuNoList });
|
||||||
|
// 处理blob下载
|
||||||
|
const blob = new Blob([res], { type: 'application/zip' });
|
||||||
|
const url = window.URL.createObjectURL(blob);
|
||||||
|
const link = document.createElement('a');
|
||||||
|
link.href = url;
|
||||||
|
link.download = '学籍卡.zip';
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
document.body.removeChild(link);
|
||||||
|
window.URL.revokeObjectURL(url);
|
||||||
|
useMessage().success('学籍卡导出成功');
|
||||||
|
} catch (err: any) {
|
||||||
|
useMessage().error(err.msg || '学籍卡导出失败');
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 证书导出
|
// 证书导出
|
||||||
|
|||||||
Reference in New Issue
Block a user