tijiao
This commit is contained in:
10
src/api/professional/professionalfile.ts
Normal file
10
src/api/professional/professionalfile.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import request from '/@/utils/request';
|
||||||
|
|
||||||
|
|
||||||
|
export const exportTeacherInfoBySelf = (data?: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/professional/file/exportTeacherInfoBySelf',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
};
|
||||||
@@ -1,59 +1,45 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog v-model="dialogEmptyFromVisible" title="教职工信息导出" width="80%">
|
<el-dialog v-model="dialogEmptyFromVisible" title="教职工信息导出" width="80%">
|
||||||
<el-form :inline="true" label-width="100px" style="margin-bottom: 20px;">
|
<el-form :inline="true" label-width="100px" style="margin-bottom: 20px">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-tag type="info">导出依据"职工信息"页面的检索条件</el-tag>
|
<el-tag type="info">导出依据"职工信息"页面的检索条件</el-tag>
|
||||||
<el-tag type="warning" style="margin-left: 10px;">请在搜索后再打开导出页面</el-tag>
|
<el-tag type="warning" style="margin-left: 10px">请在搜索后再打开导出页面</el-tag>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否退休">
|
<el-form-item label="是否退休">
|
||||||
<el-select
|
<el-select v-model="tiedTag" filterable reserve-keyword clearable style="width: 200px">
|
||||||
v-model="tiedTag"
|
<el-option v-for="item in YES_OR_NO" :key="item.value" :label="item.label" :value="item.value"> </el-option>
|
||||||
filterable
|
|
||||||
reserve-keyword
|
|
||||||
clearable
|
|
||||||
style="width: 200px;">
|
|
||||||
<el-option
|
|
||||||
v-for="item in YES_OR_NO"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button
|
<el-button type="primary" @click="exportTeacherInfo" :loading="exportLoading" :icon="Download">导出</el-button>
|
||||||
type="primary"
|
|
||||||
@click="exportTeacherInfo"
|
|
||||||
:loading="exportLoading"
|
|
||||||
:icon="Download">导出</el-button>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<!-- 基础信息 -->
|
<!-- 基础信息 -->
|
||||||
<el-card shadow="never" style="margin-bottom: 20px;">
|
<el-card shadow="never" style="margin-bottom: 20px">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
<div style="display: flex; justify-content: space-between; align-items: center">
|
||||||
<span>基础信息</span>
|
<span>基础信息</span>
|
||||||
<el-checkbox v-model="allCheckTeacherBaseInfo">全选</el-checkbox>
|
<el-checkbox v-model="allCheckTeacherBaseInfo">全选</el-checkbox>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<el-checkbox-group v-model="checkedTeacherBaseInfo">
|
<el-checkbox-group v-model="checkedTeacherBaseInfo">
|
||||||
<el-checkbox v-for="(item, index) in teacherBasicCheckData" :label="item.value" :key="index" style="margin-right: 20px; margin-bottom: 10px;">
|
<el-checkbox v-for="(item, index) in teacherBasicCheckData" :label="item.value" :key="index" style="margin-right: 20px; margin-bottom: 10px">
|
||||||
{{ item.label }}
|
{{ item.label }}
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<!-- 岗位信息 -->
|
<!-- 岗位信息 -->
|
||||||
<el-card shadow="never" style="margin-bottom: 20px;">
|
<el-card shadow="never" style="margin-bottom: 20px">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
<div style="display: flex; justify-content: space-between; align-items: center">
|
||||||
<span>岗位信息</span>
|
<span>岗位信息</span>
|
||||||
<el-checkbox v-model="allCheckStationInfo">全选</el-checkbox>
|
<el-checkbox v-model="allCheckStationInfo">全选</el-checkbox>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<el-checkbox-group v-model="checkedTeacherStationInfo">
|
<el-checkbox-group v-model="checkedTeacherStationInfo">
|
||||||
<el-checkbox v-for="(item, index) in teacherStationData" :key="index" :label="item.value" style="margin-right: 20px; margin-bottom: 10px;">
|
<el-checkbox v-for="(item, index) in teacherStationData" :key="index" :label="item.value" style="margin-right: 20px; margin-bottom: 10px">
|
||||||
{{ item.label }}
|
{{ item.label }}
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
@@ -62,45 +48,44 @@
|
|||||||
<!-- 其他 -->
|
<!-- 其他 -->
|
||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
<div style="display: flex; justify-content: space-between; align-items: center">
|
||||||
<span>其他</span>
|
<span>其他</span>
|
||||||
<el-checkbox v-model="allCheckedother">全选</el-checkbox>
|
<el-checkbox v-model="allCheckedother">全选</el-checkbox>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<el-checkbox-group v-model="checkedTeacherOtherInfo">
|
<el-checkbox-group v-model="checkedTeacherOtherInfo">
|
||||||
<el-checkbox v-for="(item, index) in teacherOtherData" :key="index" :label="item.value" style="margin-right: 20px; margin-bottom: 10px;">
|
<el-checkbox v-for="(item, index) in teacherOtherData" :key="index" :label="item.value" style="margin-right: 20px; margin-bottom: 10px">
|
||||||
{{ item.label }}
|
{{ item.label }}
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch } from 'vue'
|
import { ref, watch } from 'vue';
|
||||||
import { ElNotification } from 'element-plus'
|
import { ElNotification } from 'element-plus';
|
||||||
import { Download } from '@element-plus/icons-vue'
|
import { Download } from '@element-plus/icons-vue';
|
||||||
import global from '/@/components/tools/commondict.vue'
|
import global from '/@/components/tools/commondict.vue';
|
||||||
import request from '/@/utils/request'
|
import request from '/@/utils/request';
|
||||||
|
import { exportTeacherInfoBySelf } from '/@/api/professional/professionalfile';
|
||||||
|
|
||||||
// Props
|
// Props
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
search: any
|
search: any;
|
||||||
}>()
|
}>();
|
||||||
|
|
||||||
// 响应式数据
|
// 响应式数据
|
||||||
const tiedTag = ref('')
|
const tiedTag = ref('');
|
||||||
const YES_OR_NO = global.YES_OR_NO
|
const YES_OR_NO = global.YES_OR_NO;
|
||||||
const exportLoading = ref(false)
|
const exportLoading = ref(false);
|
||||||
const dialogEmptyFromVisible = ref(false)
|
const dialogEmptyFromVisible = ref(false);
|
||||||
const allCheckTeacherBaseInfo = ref(false)
|
const allCheckTeacherBaseInfo = ref(false);
|
||||||
const allCheckStationInfo = ref(false)
|
const allCheckStationInfo = ref(false);
|
||||||
const allCheckedother = ref(false)
|
const allCheckedother = ref(false);
|
||||||
const checkedTeacherBaseInfo = ref<string[]>([])
|
const checkedTeacherBaseInfo = ref<string[]>([]);
|
||||||
const checkedTeacherStationInfo = ref<string[]>([])
|
const checkedTeacherStationInfo = ref<string[]>([]);
|
||||||
const checkedTeacherOtherInfo = ref<string[]>([])
|
const checkedTeacherOtherInfo = ref<string[]>([]);
|
||||||
|
|
||||||
const teacherBasicCheckData = [
|
const teacherBasicCheckData = [
|
||||||
{ label: '姓名', value: 'realName_姓名' },
|
{ label: '姓名', value: 'realName_姓名' },
|
||||||
@@ -124,7 +109,7 @@
|
|||||||
{ label: '授课类型', value: 'teacherCate_授课类型' },
|
{ label: '授课类型', value: 'teacherCate_授课类型' },
|
||||||
{ label: '允许进出', value: 'inoutFlag_允许进出' },
|
{ label: '允许进出', value: 'inoutFlag_允许进出' },
|
||||||
{ label: '进出情况备注', value: 'inoutRemarks_进出情况备注' },
|
{ label: '进出情况备注', value: 'inoutRemarks_进出情况备注' },
|
||||||
]
|
];
|
||||||
|
|
||||||
const teacherStationData = [
|
const teacherStationData = [
|
||||||
{ label: '教师类型', value: 'teacherTypeName_教师类型' },
|
{ label: '教师类型', value: 'teacherTypeName_教师类型' },
|
||||||
@@ -142,7 +127,7 @@
|
|||||||
{ label: '任现职务时间', value: 'dutyDate_任现职务时间' },
|
{ label: '任现职务时间', value: 'dutyDate_任现职务时间' },
|
||||||
{ label: '进编时间', value: 'entryDutyDate_进编时间' },
|
{ label: '进编时间', value: 'entryDutyDate_进编时间' },
|
||||||
{ label: '进校时间', value: 'entrySchoolDate_进校时间' },
|
{ label: '进校时间', value: 'entrySchoolDate_进校时间' },
|
||||||
]
|
];
|
||||||
|
|
||||||
const teacherOtherData = [
|
const teacherOtherData = [
|
||||||
{ label: '职业资格工种', value: 'zyzg_职业资格工种' },
|
{ label: '职业资格工种', value: 'zyzg_职业资格工种' },
|
||||||
@@ -155,7 +140,7 @@
|
|||||||
{ label: '中等教师资格证', value: 'midCer_中等教师资格证' },
|
{ label: '中等教师资格证', value: 'midCer_中等教师资格证' },
|
||||||
{ label: '教师上岗证', value: 'priCer_教师上岗证' },
|
{ label: '教师上岗证', value: 'priCer_教师上岗证' },
|
||||||
// {label:'共同居住人',value:'livewith_共同居住人'},
|
// {label:'共同居住人',value:'livewith_共同居住人'},
|
||||||
]
|
];
|
||||||
|
|
||||||
// 导出文件函数
|
// 导出文件函数
|
||||||
const exportForModel = async (params: any, fileNameStr: string, url: string) => {
|
const exportForModel = async (params: any, fileNameStr: string, url: string) => {
|
||||||
@@ -166,57 +151,57 @@
|
|||||||
data: params,
|
data: params,
|
||||||
responseType: 'blob',
|
responseType: 'blob',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json',
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
const blob = new Blob([res])
|
const blob = new Blob([res]);
|
||||||
const fileName = fileNameStr
|
const fileName = fileNameStr;
|
||||||
const elink = document.createElement('a')
|
const elink = document.createElement('a');
|
||||||
elink.download = fileName
|
elink.download = fileName;
|
||||||
elink.style.display = 'none'
|
elink.style.display = 'none';
|
||||||
elink.href = URL.createObjectURL(blob)
|
elink.href = URL.createObjectURL(blob);
|
||||||
document.body.appendChild(elink)
|
document.body.appendChild(elink);
|
||||||
elink.click()
|
elink.click();
|
||||||
URL.revokeObjectURL(elink.href)
|
URL.revokeObjectURL(elink.href);
|
||||||
document.body.removeChild(elink)
|
document.body.removeChild(elink);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
ElNotification.error({
|
ElNotification.error({
|
||||||
title: '错误',
|
title: '错误',
|
||||||
message: '导出失败',
|
message: '导出失败',
|
||||||
})
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// Watch
|
// Watch
|
||||||
watch(allCheckTeacherBaseInfo, (newVal) => {
|
watch(allCheckTeacherBaseInfo, (newVal) => {
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
checkedTeacherBaseInfo.value = teacherBasicCheckData.map(item => item.value)
|
checkedTeacherBaseInfo.value = teacherBasicCheckData.map((item) => item.value);
|
||||||
} else {
|
} else {
|
||||||
checkedTeacherBaseInfo.value = []
|
checkedTeacherBaseInfo.value = [];
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
watch(allCheckStationInfo, (newVal) => {
|
watch(allCheckStationInfo, (newVal) => {
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
checkedTeacherStationInfo.value = teacherStationData.map(item => item.value)
|
checkedTeacherStationInfo.value = teacherStationData.map((item) => item.value);
|
||||||
} else {
|
} else {
|
||||||
checkedTeacherStationInfo.value = []
|
checkedTeacherStationInfo.value = [];
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
watch(allCheckedother, (newVal) => {
|
watch(allCheckedother, (newVal) => {
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
checkedTeacherOtherInfo.value = teacherOtherData.map(item => item.value)
|
checkedTeacherOtherInfo.value = teacherOtherData.map((item) => item.value);
|
||||||
} else {
|
} else {
|
||||||
checkedTeacherOtherInfo.value = []
|
checkedTeacherOtherInfo.value = [];
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
// 方法
|
// 方法
|
||||||
const init = () => {
|
const init = () => {
|
||||||
tiedTag.value = props.search.tied
|
tiedTag.value = props.search.tied;
|
||||||
dialogEmptyFromVisible.value = true
|
dialogEmptyFromVisible.value = true;
|
||||||
}
|
};
|
||||||
|
|
||||||
const exportTeacherInfo = async () => {
|
const exportTeacherInfo = async () => {
|
||||||
if (checkedTeacherBaseInfo.value.length == 0 && checkedTeacherStationInfo.value.length == 0 && checkedTeacherOtherInfo.value.length == 0) {
|
if (checkedTeacherBaseInfo.value.length == 0 && checkedTeacherStationInfo.value.length == 0 && checkedTeacherOtherInfo.value.length == 0) {
|
||||||
@@ -224,33 +209,37 @@
|
|||||||
title: '警告',
|
title: '警告',
|
||||||
message: '请选择要导出的字段',
|
message: '请选择要导出的字段',
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
duration: 3000
|
duration: 3000,
|
||||||
})
|
});
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
exportLoading.value = true
|
exportLoading.value = true;
|
||||||
|
|
||||||
const searchData = JSON.parse(JSON.stringify(props.search))
|
const searchData = JSON.parse(JSON.stringify(props.search));
|
||||||
searchData.tied = tiedTag.value
|
searchData.tied = tiedTag.value;
|
||||||
const params = {
|
const params = {
|
||||||
"checkedTeacherBaseInfo": checkedTeacherBaseInfo.value,
|
checkedTeacherBaseInfo: checkedTeacherBaseInfo.value,
|
||||||
"checkedTeacherStationInfo": checkedTeacherStationInfo.value,
|
checkedTeacherStationInfo: checkedTeacherStationInfo.value,
|
||||||
"checkedTeacherOtherInfo": checkedTeacherOtherInfo.value,
|
checkedTeacherOtherInfo: checkedTeacherOtherInfo.value,
|
||||||
"teacherBaseDTO": searchData
|
teacherBaseDTO: searchData,
|
||||||
}
|
};
|
||||||
|
|
||||||
await exportForModel(params, "教职工信息.xls", "/professional/file/exportTeacherInfoBySelf")
|
exportTeacherInfoBySelf(params).then((res:any)=>{
|
||||||
|
ElNotification.success({
|
||||||
|
title: '下载后台进行中',
|
||||||
|
message: '操作成功'
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
exportLoading.value = false
|
exportLoading.value = false;
|
||||||
}, 3000)
|
}, 3000);
|
||||||
}
|
};
|
||||||
|
|
||||||
// 暴露方法给父组件
|
// 暴露方法给父组件
|
||||||
defineExpose({
|
defineExpose({
|
||||||
init
|
init,
|
||||||
})
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped></style>
|
||||||
</style>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user