Sfoglia il codice sorgente

学生-实习企业列表对接

Xiao_123 2 mesi fa
parent
commit
9edee18fc5

+ 0 - 9
src/api/recruit/personal/personalCenter/student.js

@@ -1,9 +0,0 @@
-import request from '@/config/axios'
-
-// 学生实习企业列表
-export const practiceProcess = async (data) => {
-  return await request.post({
-		url: '/app-api/flames/student/practice/process',
-		data
-	})
-}

+ 16 - 0
src/api/recruit/personal/student.js

@@ -14,4 +14,20 @@ export const getCertificatePage = async (data) => {
 		url: '/app-api/flames/student/internship/certificate/list',
 		data
 	})
+}
+
+// 获取实习生记录分页
+export const getInternshipPage = async (params) => {
+	return await request.get({
+		url: '/app-api/menduner/system/recruit/student/page',
+		params
+	})
+}
+
+// 学生实习企业列表
+export const practiceProcess = async (data) => {
+	return await request.post({
+		url: '/app-api/flames/student/practice/process',
+		data
+	})
 }

+ 49 - 49
src/views/recruit/personal/PersonalCenter/student/intershipCompany/index.vue

@@ -1,67 +1,67 @@
 <template>
-	<v-tabs v-model="tab" align-tabs="start" color="primary" bg-color="#f7f8fa">
+	<v-tabs v-model="tab" align-tabs="start" color="primary" bg-color="#f7f8fa" @update:modelValue="handleChangeTab">
     <v-tab v-for="(k, index) in tabList" :key="index" :value="k.value">{{ k.label }}</v-tab>
   </v-tabs>
 
-	<ItemPage v-if="data[tabList[tab].key]?.length" :tab="tab" class="mt-3" :items="data[tabList[tab].key]" />
+	<div v-if="items?.length">
+		<ItemPage class="mt-3" :items="items" />
+		<CtPagination
+      v-if="total > 0"
+      :total="total"
+      :page="query.pageNo"
+      :limit="query.pageSize"
+      @handleChange="handleChangePage"
+    ></CtPagination>
+	</div>
 	<Empty v-else :elevation="false" />
 </template>
 
 <script setup>
+// 实习企业
 defineOptions({ name: 'PersonalCenterStudentInternshipCompany'})
-import { ref } from 'vue'
-import { practiceProcess } from '@/api/recruit/personal/personalCenter/student.js'
+import { ref, onMounted } from 'vue'
+import { getInternshipPage } from '@/api/recruit/personal/student.js'
 import ItemPage from './item.vue'
+import { getDict } from '@/hooks/web/useDictionaries'
+import { dealDictObjData } from '@/utils/position'
 
 const tab = ref(0)
-const tabList = ref([
-	{ label: '等待中', value: 0, key: 'waitProcess' },
-	{ label: '进行中', value: 1, key: 'process' },
-	{ label: '已结束', value: 2, key: 'endProcess' },
-])
-const studentInfo = ref(localStorage.getItem('studentInfo') ? JSON.parse(localStorage.getItem('studentInfo')) : {})
-
-const data = ref({
-	waitProcess: [
-		{
-			job: {
-				name: '前端开发',
-				payFrom: 10000,
-				payTo: 20000,
-				payUnit: '月',
-				area: {
-					"str": "呼和浩特市-和林格尔县"
-				},
-				id: '1864521193404727297',
-				areaId: 150123,
-				eduType: null,
-				expType: null,
-				status: '0',
-				updateTime: 1740972578585
-			},
-			enterprise: {
-				id: '1',
-				anotherName: '门墩儿',
-				name: '门墩儿科技有限公司',
-				logoUrl: 'https://minio.citupro.com/dev/menduner/company-avatar.png',
-				industryName: '互联网',
-				scaleName: '10000-50000人',
-			},
-			entity: {
-				jobJoinDate: 1740972578585,
-				internshipEndDate: 1740972578585,
-				percentage: '50',
-			}
-		}
-	],
-	process: [],
-	endProcess: []
+const tabList = ref([])
+const items = ref([])
+const total = ref(0)
+const query = ref({
+	pageNo: 1,
+	pageSize: 10,
+	status: ''
 })
+
 const getList = async () => {
-	data = await practiceProcess({ studentId: studentInfo.value.userId })
-	// console.log(data, 'list')
+	query.value.status = tabList.value[tab.value]?.value
+	const result = await getInternshipPage(query.value)
+	items.value = result?.list.map(e => {
+		e.enterprise = dealDictObjData({}, e.enterprise)
+		e.job = dealDictObjData({}, e.job)
+		return e
+	})
+	total.value = result?.total || 0
+}
+
+onMounted(async () => {
+	const { data } = await getDict('student_practice_status')
+	tabList.value = data || []
+
+	await getList()
+})
+
+const handleChangeTab = () => {
+	query.value.pageNo = 1
+	getList()
+}
+
+const handleChangePage = (page) => {
+  query.value.pageNo = page
+	getList()
 }
-// getList()
 </script>
 
 <style scoped lang="scss">

+ 8 - 8
src/views/recruit/personal/PersonalCenter/student/intershipCompany/item.vue

@@ -8,13 +8,14 @@
         <div class="job-info">
           <div class="job-name ellipsis" :class="{'cursor-pointer': val.job.status === '0'}" v-ellipse-tooltip>
             <span class="mr-3" :class="{'info-name': val.job.status === '0'}" @click.stop="handleToPositionDetails(val)">{{ formatName(val.job.name) }}</span>
-            <span>
-              [{{ !val.job.areaId ? '全国' : val.job.area?.str }}]
+            <span v-if="val.job.status === '1'" class="font-size-14 color-error">[职位已关闭]</span>
+            <span v-else>
+              <span v-if="!val.job?.areaId || val.job.areaName">[{{ !val.job.areaId ? '全国' : val.job.areaName }}]</span>
             </span>
           </div>
           <div class="job-other">
             <span v-if="!val.job.payFrom && !val.job.payTo" class="salary color-primary">面议</span>
-            <span v-else class="salary color-primary">{{ val.job.payFrom ? val.job.payFrom + '-' : ''}}{{ val.job.payTo }}{{ val.job.payUnit ? '/' + val.job.payUnit : '' }}</span>
+            <span v-else class="salary color-primary">{{ val.job.payFrom ? val.job.payFrom + '-' : ''}}{{ val.job.payTo }}{{ val.job.payName ? '/' + val.job.payName : '' }}</span>
             <v-chip v-if="val.job?.expName" class="mx-3" color="primary" label size="small">{{ val.job.expName }}</v-chip>
             <v-chip v-if="val.job?.eduName" color="primary" label size="small">{{ val.job.eduName }}</v-chip>
           </div>
@@ -35,12 +36,13 @@
         </div>
       </div>
 			<div class="mx-5" style="border-bottom: 1px dashed #e0e0e0"></div>
+
 			<!-- 实习范围 -->
 			<div class="d-flex justify-space-between px-5 py-3">
 				<div class="color-666 font-size-15">
-					<p>实习时间:{{ timesTampChange(val.entity.jobJoinDate, 'Y-M-D') }} 至 {{ timesTampChange(val.entity.internshipEndDate, 'Y-M-D') }}</p>
+					<p>实习时间:{{ timesTampChange(val.startTime, 'Y-M-D') }} 至 {{ timesTampChange(val.endTime, 'Y-M-D') }}</p>
 				</div>
-				<div class="text-end" v-if="tab === 0">
+				<div class="text-end" v-if="val.status === '1'">
 					<v-btn size="small" color="primary" @click="handleToReport(val)">实习报告</v-btn>
 				</div>
 			</div>
@@ -59,8 +61,7 @@ const props = defineProps({
   items: {
     type: Array,
     default: () => []
-  },
-	tab: Number
+  }
 })
 
 const router = useRouter()
@@ -84,7 +85,6 @@ const handleToReport = (val) => {
 
 <style scoped lang="scss">
 .position-item {
-  height: 144px;
   background-color: #fff;
   border-radius: 12px;
   &:hover {