Browse Source

实习情况

Xiao_123 2 months ago
parent
commit
ac87ef01c9

+ 16 - 0
src/api/school.js

@@ -62,3 +62,19 @@ export const studentList = async (data) => {
 		data
 	})
 }
+
+// 学生实习情况
+export const studentPracticeStatistics = async (data) => {
+	return await request.post({
+		url: '/app-api/flames/school/student/internship/statistics',
+		data
+	})
+}
+
+// 实习企业列表
+export const internshipCompanyList = async (data) => {
+	return await request.post({
+		url: '/app-api/flames/enterprise/school/practice/list',
+		data
+	})
+}

+ 17 - 17
src/router/modules/components/recruit/teacher.js

@@ -67,23 +67,23 @@ const teacher = [
       },
     ]
   },
-  {
-    path: '/recruit/teacher/internshipCompany',
-    component: Layout,
-    name: 'internshipCompany',
-    meta: {
-      title: '实习企业',
-      enName: 'Internship Company',
-      icon: 'mdi-home-city-outline'
-    },
-    children: [
-      {
-        path: '/recruit/teacher/internshipCompany',
-        show: true,
-        component: () => import('@/views/recruit/teacher/internshipCompany/index.vue')
-      },
-    ]
-  },
+  // {
+  //   path: '/recruit/teacher/internshipCompany',
+  //   component: Layout,
+  //   name: 'internshipCompany',
+  //   meta: {
+  //     title: '实习企业',
+  //     enName: 'Internship Company',
+  //     icon: 'mdi-home-city-outline'
+  //   },
+  //   children: [
+  //     {
+  //       path: '/recruit/teacher/internshipCompany',
+  //       show: true,
+  //       component: () => import('@/views/recruit/teacher/internshipCompany/index.vue')
+  //     },
+  //   ]
+  // },
   {
     path: '/recruit/teacher/teacherCertification',
     component: Layout,

+ 121 - 2
src/views/recruit/teacher/internshipCompany/index.vue

@@ -1,10 +1,129 @@
-<!--  -->
 <template>
-  <div>实习企业</div>
+  <v-card class="card-box pa-3">
+    <CtTable
+      :items="tableData"
+      :headers="headers"
+      :loading="loading"
+      :elevation="0"
+      :is-tools="false"
+      :showPage="true"
+      :total="total"
+      :page-info="query"
+      itemKey="id"
+      @pageHandleChange="handleChangePage"
+    >
+      <template #enterpriseName="{ item }">
+        <div class="d-flex align-center">
+          <v-avatar size="40" :image="item.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'"></v-avatar>
+          <span class="ml-3 color-primary cursor-pointer" @click="handleDetail(item.id)">{{ formatName(item.anotherName || item.name) }}</span>
+        </div>
+      </template>
+      <template #studentCount="{ item }">
+        <span class="color-primary cursor-pointer" @click="handleStudent(item.id)">{{ item.studentCount || 0 }}人</span>
+      </template>
+    </CtTable>
+  </v-card>
+
+  <CtDialog :visible="drill.show" :widthType="1" titleClass="text-h6" :footer="false" :title="title" @close="handleClose">
+    <CtTable
+      :items="drill.list"
+      :headers="drill.headers"
+      :loading="false"
+      :elevation="0"
+      :isTools="false"
+      :showPage="true"
+      :total="drill.total"
+      :page-info="drill.query"
+      itemKey="id"
+      @pageHandleChange="handleChangeDrillPage"
+    >
+    </CtTable>
+  </CtDialog>
 </template>
 
 <script setup>
 defineOptions({name: 'internship-company'})
+import { ref, onMounted } from 'vue'
+import { internshipCompanyList } from '@/api/school'
+import { formatName } from '@/utils/getText'
+
+const total = ref(0)
+const loading = ref(false)
+const query = ref({
+  size: 10,
+  current: 10,
+  schoolId: JSON.parse(localStorage.getItem('schoolInfo'))?.schoolId
+})
+const tableData = ref([
+  {
+    "id": 1,
+    "name": "门墩儿信息科技有限公司",
+    "anotherName": "门墩儿",
+    "industryId": "1829087620475494402",
+    "industryName": '互联网',
+    "scale": "0",
+    "scaleName": '0-20人',
+    "logoUrl": "https://minio.menduner.com/dev/1e6893918ef378ca280360078dfe74ade10b27101c89865261824b46de7d34a6.png",
+    studentCount: 2
+  }
+])
+const headers = [
+  { title: '企业名称', key: 'enterpriseName', sortable: false },
+  { title: '在岗实习学生', key: 'studentCount', sortable: false },
+  { title: '所在行业', key: 'industryName', sortable: false },
+  { title: '企业规模', key: 'scaleName', sortable: false }
+]
+
+const getList = async () => {
+  try {
+    const data = await internshipCompanyList(query.value)
+    console.log(data, 'data')
+  } catch {}
+}
+
+const handleChangePage = (page) => {
+  query.value.current = page
+  getList()
+}
+
+// 跳转企业详情
+const handleDetail = (id) => {
+  if (!id) return
+  window.open(`/recruit/personal/company/details/${id}?key=briefIntroduction`)
+}
+
+const drill = ref({
+  total: 0,
+  query: {
+    size: 10,
+    current: 1
+  },
+  show: false,
+  list: [],
+  headers: [
+    { title: '学生姓名', key: 'studentName', sortable: false },
+  ]
+})
+
+// 在岗实习学生列表
+const handleStudent = (id) => {
+  drill.value.query.current = 1
+  drill.value.show = true
+
+}
+
+const handleChangeDrillPage = (page) => {
+  drill.value.query.current = page
+}
+const handleClose = () => {
+  drill.value.show = false
+  drill.value.list = []
+}
+
+onMounted(async () => {
+  // await getList()
+})
 </script>
+
 <style lang="scss" scoped>
 </style>

+ 24 - 40
src/views/recruit/teacher/internshipSituation/index.vue

@@ -2,33 +2,15 @@
 <template>
 	<v-card class="card-box pa-3">
 		<div class="d-flex justify-space-between align-center">
-			<!-- 统计 -->
 			<div class="d-flex align-center statistics">
 				<div v-for="(val, index) in statistics" :key="index" class="statistics-card pa-5">
 					<div class="color-666">{{ val.label }}</div>
 					<div class="">
-						<span class="value font-weight-bold color-primary">{{ val.count }}</span>
+						<span class="value font-weight-bold color-primary">{{ val.value }}</span>
 						<span class="color-999 font-size-14">人</span>
 					</div>
 				</div>
 			</div>
-			<!-- 时间范围筛选 -->
-			<div class="d-flex align-center ml-7">
-        <span class="color-666">实习日期</span>
-        <div class="ml-5">
-          <date-picker 
-						v-model="date"
-						:item="{
-							mode: 'daterange',
-							clearable: true,
-							placeholder: '请选择要查看的时间范围',
-							format: 'YYYY/MM/DD',
-							width: 250
-						}"
-						@change="handleChangeDate"
-					/>
-        </div>
-      </div>
 		</div>
 
 		<div class="mt-5">
@@ -73,19 +55,22 @@
 defineOptions({name: 'studentList-internship-situation'})
 import { ref, onMounted } from 'vue'
 import { getUserAvatar } from '@/utils/avatar'
-import DatePicker from '@/components/FormUI/datePicker'
 import UploadRecommendationLetterForm from './RecommendationLetterForm'
 import IssueCertificateForm from './CertificateForm'
 import { getStudentPage, getRecordStatusCount, saveRecommend, saveCertificate } from '@/api/recruit/enterprise/student'
-import { getDict } from '@/hooks/web/useDictionaries'
 import { dealDictObjData } from '@/utils/position'
 import { formatName } from '@/utils/getText'
 import { timesTampChange } from '@/utils/date'
 import { convertTimestampsToDayRange } from '@/utils/date'
 import Snackbar from '@/plugins/snackbar'
+import { studentPracticeStatistics } from '@/api/school'
 
 const date = ref(null)
-const statistics = ref([])
+const statistics = ref([
+	{ label: '等待实习', value: 0, key: 'waitInternshipNumber' },
+	{ label: '实习中', value: 1, key: 'internshipNumber' },
+	{ label: '实习结束', value: 0, key: 'internshipSuccessNumber' }
+])
 
 const loading = ref(false)
 const total = ref(0)
@@ -94,18 +79,16 @@ const query = ref({
 	pageSize: 10,
 	startTime: null
 })
-const tableData = ref([])
+const tableData = ref([
+	{ workProvinceName: '辞图科技', internshipNumber: 1, internshipSuccessNumber: 0, waitInternshipNumber: 0 },
+])
+const schoolInfo = ref(localStorage.getItem('schoolInfo') ? JSON.parse(localStorage.getItem('schoolInfo')) : {})
 
 const headers = [
-  { title: '学生姓名', key: 'studentName', sortable: false },
-  { title: '就读学校', key: 'student.schoolName', sortable: false },
-  { title: '所属院系', key: 'student.schoolDepartmentName', sortable: false },
-  { title: '所属专业', key: 'student.majorName', sortable: false },
-  { title: '应聘职位', key: 'job.name', sortable: false, value: item => formatName(item.job.name) },
-  { title: '到岗日期', key: 'startTime', sortable: false, value: item => timesTampChange(item.startTime, 'Y-M-D') },
-  { title: '结束日期', key: 'endTime', sortable: false, value: item => timesTampChange(item.endTime, 'Y-M-D') },
-  { title: '创建日期', key: 'createTime', sortable: false, value: item => timesTampChange(item.createTime) },
-  { title: '操作', key: 'actions', sortable: false }
+	{ title: '实习企业', key: 'workProvinceName', sortable: false },
+	{ title: '实习中', key: 'internshipNumber', sortable: false },
+	{ title: '实习结束', key: 'internshipSuccessNumber', sortable: false },
+	{ title: '等待实习', key: 'waitInternshipNumber', sortable: false },
 ]
 
 // 学生列表
@@ -127,18 +110,19 @@ const getList = async () => {
 // 数值统计
 const getStatistics = async () => {
 	try {
-		const data = await getRecordStatusCount({ type: '-1' })
-		statistics.value.forEach(e => {
-			const obj = data.find(val => val.key === e.value)
-			e.count = obj ? obj.value : 0
-		})
+		const data = await studentPracticeStatistics({ schoolId: schoolInfo.value?.school?.schoolId })
+		console.log(data, 'data')
+		// statistics.value.forEach(e => {
+		// 	const obj = data.find(val => val.key === e.value)
+		// 	e.count = obj ? obj.value : 0
+		// })
 	} catch {}
 }
 
 onMounted(async () => {
-	const { data } = await getDict('student_practice_status')
-	statistics.value = data
-	// getStatistics()
+	// const { data } = await getDict('student_practice_status')
+	// statistics.value = data
+	getStatistics()
 	// getList()
 })