|
@@ -5,7 +5,8 @@
|
|
|
<div class="d-flex justify-space-between mt-8 mb-10">
|
|
|
<div class="d-flex align-center">
|
|
|
<!-- <span class="mx-3 color-666 font-size-14">院系</span> -->
|
|
|
- <Autocomplete class="mr-3" v-model="query.schoolDepartmentName" :item="yuanXi"></Autocomplete>
|
|
|
+ <Autocomplete class="mr-3" v-model="query.schoolDepartmentName" :item="schoolDepartmentItem"></Autocomplete>
|
|
|
+ <TextInput class="mr-3" v-model="query.studentName" :item="studentNameItem" @enter="handleSearch()"></TextInput>
|
|
|
<v-btn color="primary" class="half-button ml-3" @click="handleSearch()">查 询</v-btn>
|
|
|
<v-btn class="half-button ml-3" prepend-icon="mdi-refresh" variant="outlined" color="primary" @click="handleSearch(true)">刷 新</v-btn>
|
|
|
</div>
|
|
@@ -27,14 +28,14 @@
|
|
|
@pageHandleChange="handleChangePage"
|
|
|
>
|
|
|
<template #studentName="{ item }">
|
|
|
- <div class="d-flex align-center cursor-pointer" @click="studentDetails(item.id)">
|
|
|
+ <div class="d-flex align-center defaultLink" @click="studentDetails(item.id)">
|
|
|
<v-avatar size="40" :image="getUserAvatar(item?.person?.avatar, item?.person?.sex)"></v-avatar>
|
|
|
<span class="ml-3">{{ item?.person?.name }}</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #actions="{ item }">
|
|
|
- <v-btn v-if="!item?.recommendationLetter" color="primary" variant="text" @click="handleUploadLetter(item.id)">上传推荐信</v-btn>
|
|
|
- <v-btn v-if="!item?.evaluate" color="#00897B" variant="text" @click="handleIssueCertificate(item.id)">颁发实习证书</v-btn>
|
|
|
+ <v-btn v-if="!item?.recommendationLetter" color="primary" variant="text" @click="previewFile(item.recommendationLetter)">推荐信</v-btn>
|
|
|
+ <v-btn v-if="!item?.evaluate" color="#00897B" variant="text" @click="previewFile(item.evaluate)">实习证书</v-btn>
|
|
|
</template>
|
|
|
</CtTable>
|
|
|
<!-- <Loading :visible="loading"></Loading> -->
|
|
@@ -49,13 +50,24 @@ import Snackbar from '@/plugins/snackbar'
|
|
|
import { formatName } from '@/utils/getText'
|
|
|
import { getUserAvatar } from '@/utils/avatar'
|
|
|
import { schoolOrganization, studentList } from '@/api/school'
|
|
|
-import { useRouter } from 'vue-router'; const router = useRouter()
|
|
|
+// import { useRouter } from 'vue-router'; const router = useRouter()
|
|
|
+import { previewFile } from '@/utils'
|
|
|
|
|
|
const loading = ref(false)
|
|
|
const query = ref({
|
|
|
pageSize: 20,
|
|
|
pageNo: 1,
|
|
|
schoolDepartmentName: null,
|
|
|
+ studentName: null,
|
|
|
+})
|
|
|
+
|
|
|
+const studentNameItem = ref({
|
|
|
+ type: 'text',
|
|
|
+ width: 300,
|
|
|
+ label: '请输入学生姓名搜索',
|
|
|
+ clearable: true,
|
|
|
+ hideDetails: true,
|
|
|
+ // appendInnerIcon: 'mdi-magnify'
|
|
|
})
|
|
|
|
|
|
const headers = [
|
|
@@ -67,37 +79,34 @@ const headers = [
|
|
|
{ title: '录用岗位', key: 'test', sortable: false, value: item => formatName(item.test) },
|
|
|
{ title: '操作', key: 'actions', sortable: false }
|
|
|
]
|
|
|
-
|
|
|
-const tableData = ref([])
|
|
|
-tableData.value = [{ test: 'ces', person: { name: '123' }, id: '1'}]
|
|
|
-const total = ref(0)
|
|
|
-// 列表
|
|
|
+// 数据列表
|
|
|
+const tableData = ref([]); const total = ref(0)
|
|
|
const getData = async (isRefresh = false) => {
|
|
|
- query.value.schoolDepartmentName = '中文系'
|
|
|
- const { data, total: number } = await studentList(query.value)
|
|
|
+ if (!query.value?.schoolDepartmentName) return
|
|
|
|
|
|
+ const { data, total: number } = await studentList(query.value)
|
|
|
tableData.value = data?.records?.length && data.records.map(item=>{
|
|
|
const { enterpeiseName, enterpriseRecruitJobName, jobDept } = item
|
|
|
return { ...item.student, enterpeiseName, enterpriseRecruitJobName, jobDept }
|
|
|
})
|
|
|
-
|
|
|
total.value = number
|
|
|
if (isRefresh) Snackbar.success('刷新成功')
|
|
|
}
|
|
|
|
|
|
+// 分页
|
|
|
const handleChangePage = (val) => {
|
|
|
query.value.pageNo = val
|
|
|
getData()
|
|
|
}
|
|
|
|
|
|
+// 查询
|
|
|
const handleSearch = (refresh = false) => {
|
|
|
query.value.pageNo = 1
|
|
|
getData(refresh)
|
|
|
}
|
|
|
|
|
|
const schoolInfo = ref(localStorage.getItem('schoolInfo') ? JSON.parse(localStorage.getItem('schoolInfo')) : {})
|
|
|
-
|
|
|
-const yuanXi = ref({ width: 300, items: [], clearable: false, hideDetails: true, label: '请选择院系' })
|
|
|
+const schoolDepartmentItem = ref({ width: 300, items: [], clearable: false, hideDetails: true, label: '请选择院系' })
|
|
|
|
|
|
// 列表
|
|
|
const getYuanXiItem = async () => {
|
|
@@ -105,22 +114,24 @@ const getYuanXiItem = async () => {
|
|
|
if (!schoolId) return Snackbar.warning('获取学校信息失败!')
|
|
|
|
|
|
const { data } = await schoolOrganization({ schoolId })
|
|
|
- yuanXi.value.items = data?.length && data.map(item=> {
|
|
|
+ schoolDepartmentItem.value.items = data?.length && data.map(item=> {
|
|
|
return item?.title ? { label: item.title, value: item.title } : null
|
|
|
}).filter(Boolean)
|
|
|
|
|
|
- if (yuanXi.value.items?.length) {
|
|
|
- query.value.schoolDepartmentName = yuanXi.value.items[0].value
|
|
|
+ if (schoolDepartmentItem.value.items?.length) {
|
|
|
+ query.value.schoolDepartmentName = schoolDepartmentItem.value.items[0].value
|
|
|
getData()
|
|
|
}
|
|
|
}
|
|
|
-getYuanXiItem()
|
|
|
+getSchoolDepartmentItemItem()
|
|
|
|
|
|
const studentDetails = (id) => {
|
|
|
- if (id) router.push(`/recruit/teacher/studentList/detail/${id}`)
|
|
|
+ if (id) window.open(`/recruit/teacher/studentList/detail/${id}`)
|
|
|
}
|
|
|
|
|
|
+// 导出
|
|
|
const exportLoading = ref(false)
|
|
|
+
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
.title {
|