Просмотр исходного кода

Merge branch 'jobFair' of https://git.citupro.com/zhengnaiwen_citu/menduner into jobFair

Xiao_123 2 месяцев назад
Родитель
Сommit
e244c9d176

+ 1 - 1
src/store/user.js

@@ -116,7 +116,7 @@ export const useUserStore = defineStore('user',
           this.baseInfo = await this.getFieldText(data)
           localStorage.setItem('baseInfo', JSON.stringify(this.baseInfo))
           localStorage.setItem('necessaryInfoReady', checkPersonBaseInfo(this.baseInfo) ? 'ready' : 'fddeaddc47868b') // 校验是否完善人才必填信息
-          // if (option?.chooseRole) {
+          // if (option?.chooseRole && import.meta.env.VITE_NODE_ENV !== 'production') {
           //   // 刚注册时让用户选择学生用户还是求职者用户,角色不同填写的基本信息不同。
           //   localStorage.setItem('chooseRole', 'showChooseRole')
           // }

+ 90 - 10
src/views/recruit/components/message/index.vue

@@ -158,6 +158,24 @@
   <CtDialog :visible="showSelectPosition" :widthType="2" titleClass="text-h6" title="选择要求简历的职位" @close="showSelectPosition = false" @submit="handleRequestResumeSubmit">
     <CtForm v-if="showSelectPosition" ref="requestFromRef" :items="requestFormItems"></CtForm>
   </CtDialog>
+  <!-- 发送简历-选择要发送的职位 -->
+  <CtDialog :visible="openPositionSelectDialog" :widthType="2" titleClass="text-h6" title="请选择要投递的职位" @close="openPositionSelectDialog = false" @submit="selectPositionSubmit">
+    <div style="position: relative; min-height: 200px">
+      <v-radio-group v-model="selectJobId">
+        <div v-for="val in rightEntPositionList" :key="val.value" class="d-flex align-center radioBox" >
+          <v-radio :label="val.label" :value="val.value"  color="primary"></v-radio>
+          <span class="defaultLink mx-3" style="font-size: 14px;" @click.stop="positionDetail(val)">预览</span>
+        </div>
+      </v-radio-group>
+    </div>
+    <v-btn
+      variant="text"
+      color="primary"
+      @click="changePositionData"
+    >
+      {{ positionListIsEnd ? '没有更多职位了~ 再选一遍' : '换一批'}} <v-icon size="16">mdi-refresh</v-icon>
+    </v-btn>
+  </CtDialog>
 
   <!-- 选择附件简历投递 -->
   <CtDialog :visible="showResume" :widthType="2" titleClass="text-h6" title="发送简历" @close="showResume = false; selectResume = null; enRequestPositionInfo = {}" @submit="handleSubmitResume">
@@ -169,8 +187,9 @@
         </div>
       </v-radio-group>
     </div>
-    <studentDeliveryForm v-if="baseInfo?.type && Number(baseInfo?.type) === 1" ref="studentDeliveryFormRef" />
+    <studentDeliveryForm v-if="isStudent" ref="studentDeliveryFormRef" />
   </CtDialog>
+	<Loading :visible="pageLoading" />
 </template>
 
 <script setup>
@@ -183,7 +202,7 @@ import { useRoute } from 'vue-router'
 import Chatting from './components/chatting.vue'
 import { initConnect, send, initChart, getMoreMessages, checkConversation } from '@/hooks/web/useIM'
 import { useI18n } from '@/hooks/web/useI18n'
-import { getPositionDetails, jobCvRelCheckSend, jobCvRelSend, jobCvRelHireSend } from '@/api/position'
+import { getPositionDetails, jobCvRelCheckSend, jobCvRelSend, jobCvRelHireSend, getJobAdvertisedSearch } from '@/api/position'
 import { getInterviewInviteListByInviteUserId, getMessageType } from '@/api/common'
 // import { getUserInfo } from '@/api/personal/user'
 import { getBaseInfo } from '@/api/common'
@@ -223,6 +242,7 @@ const pageSize = ref(1)
 const hasMore = ref(false)
 const studentDeliveryFormRef = ref()
 const baseInfo = ref(localStorage.getItem('baseInfo') ? JSON.parse(localStorage.getItem('baseInfo')) : {})
+const isStudent = ref(baseInfo.value?.type && Number(baseInfo.value.type) === 1)
 
 const positionList = ref([])
 const showTip = ref(false)
@@ -413,6 +433,8 @@ async function getMessageTypeSync () {
     }
   })
   if (!data.records || !data.records.length) { 
+    positionInfo.value = {}
+    handleChangeSendResumeStatus(false)
     return
   }
   const _item = data.records.pop()
@@ -493,10 +515,68 @@ const handleUploadResume = async (url, title, filename) => {
   obj.truthValue = url
 }
 
+const changePositionData = () => {
+  positionListParams.value.pageNo = positionListIsEnd.value ? 1 : positionListParams.value.pageNo + 1
+  getRecruitPositionList()
+}
+
+const positionDetail = (val) => {
+  const id = val.value
+  if (!id) return
+  window.open(`/recruit/personal/position/details/${id}`)
+}
+
+// 选中职位并投递
+const selectJobId = ref('')
+const selectPositionSubmit = async () => {
+  // 投递
+  openPositionSelectDialog.value = false
+  handleSendResume(handleSendResumeItem)
+}
+
+const rightEntPositionTotal = ref(0)
+const rightEntPositionList = ref([])
+const positionListParams = ref({ pageNo: 1, pageSize: 5 })
+const openPositionSelectDialog = ref(false)
+const pageLoading = ref(false)
+const positionListIsEnd = computed(() => positionListParams.value.pageNo * positionListParams.value.pageSize >=  rightEntPositionTotal.value)
+// 职位列表
+const getRecruitPositionList = async () => {
+  const enterpriseId = info.value?.enterpriseId || null
+  if (!enterpriseId) return Snackbar.warning('访问企业错误!')
+
+  pageLoading.value = true
+  const { list, total: number } = await getJobAdvertisedSearch({ ...positionListParams.value, enterpriseId })
+  if (!list.length) return Snackbar.warning('企业暂无招聘中的职位,无法进行投递!')
+
+  rightEntPositionTotal.value = number
+  rightEntPositionList.value = list.map(j => {
+    const e = j?.job || null
+    if (!e) return e
+    const salary = e.payFrom && e.payTo ? `${e.payFrom ? e.payFrom + '-' : ''}${e.payTo}${e.payName ? '/' + e.payName : ''}` : '面议'
+    return {
+      label: `${formatName(e.name)}_${e.areaName ? e.area?.str : '全国'} ${salary}`,
+      value: e.id,
+      data: e
+    }
+  }).filter(Boolean)
+  
+  setTimeout(() => { pageLoading.value = false }, 300)
+}
+
 // 获取简历
 const showUploadDialog = ref(false)
 const enRequestPositionInfo = ref({}) // 企业求简历时选中的职位信息
+let handleSendResumeItem = null
 async function handleSendResume (item) {
+  const jobId = enRequestPositionInfo.value && enRequestPositionInfo.value?.id ? enRequestPositionInfo.value?.id : positionInfo.value.id
+  if (!jobId && !selectJobId.value && import.meta.env.VITE_NODE_ENV !== 'production') {
+    // 没有基于职位接收到的沟通,弹出职位列表让求职者选择。否则无法投递简历。
+    handleSendResumeItem = item
+    await getRecruitPositionList()
+    if (rightEntPositionTotal.value) openPositionSelectDialog.value = true
+    return
+  }
   try {
     item.loading = true
     // 获取简历列表
@@ -555,11 +635,11 @@ const handleSubmitAttachment = async () => {
 
   // 学生实习到岗信息
   let practice = {}
-  if (baseInfo.value?.type && Number(baseInfo.value?.type) === 1) {
+  if (isStudent.value) {
     practice = studentDeliveryFormRef.value.getQueryParams()
     console.log(practice, '上传简历-到岗信息')
   }
-  if (practice && Object.keys(practice).length > 0 && !practice.practiceStartTime || !practice.practiceEndTime) return Snackbar.warning('请完善实习到岗信息')
+  if (isStudent.value && (!practice?.practiceStartTime || !practice?.practiceEndTime)) return Snackbar.warning('请完善实习到岗信息')
 
   // 保存附件
   await savePersonResumeCv(obj)
@@ -567,7 +647,7 @@ const handleSubmitAttachment = async () => {
   // 简历投递至简历库
   if (isEmployment.value !== '-1') {
     let params = {
-      jobId: positionInfo.value.id,
+      jobId: positionInfo.value.id || selectJobId.value,
       url: obj.url,
       recommendUserId: isEmployment.value
     }
@@ -575,7 +655,7 @@ const handleSubmitAttachment = async () => {
     if (practice && Object.keys(practice).length > 0) params = Object.assign(params, practice)
     await jobCvRelHireSend(params)
   } else {
-    const jobId = enRequestPositionInfo.value && enRequestPositionInfo.value?.id ? enRequestPositionInfo.value?.id : positionInfo.value.id
+    const jobId = enRequestPositionInfo.value && enRequestPositionInfo.value?.id ? enRequestPositionInfo.value?.id : positionInfo.value.id || selectJobId.value
     const type = (enRequestPositionInfo.value && Object.keys(enRequestPositionInfo.value).length ? enRequestPositionInfo.value.hire : positionInfo.value.hire) ? 1 : 0
     let params = {
       jobId,
@@ -613,16 +693,16 @@ async function handleSubmitResume () {
 
   // 学生实习到岗信息
   let practice = {}
-  if (baseInfo.value?.type && Number(baseInfo.value?.type) === 1) {
+  if (isStudent.value) {
     practice = studentDeliveryFormRef.value.getQueryParams()
     console.log(practice, '选择简历-到岗信息')
   }
-  if (practice && Object.keys(practice).length > 0 && !practice.practiceStartTime || !practice.practiceEndTime) return Snackbar.warning('请完善实习到岗信息')
+  if (isStudent.value && (!practice?.practiceStartTime || !practice?.practiceEndTime)) return Snackbar.warning('请完善实习到岗信息')
 
   // 简历投递至简历库
   if (isEmployment.value !== '-1') {
     let params = {
-      jobId: positionInfo.value.id,
+      jobId: positionInfo.value.id || selectJobId.value,
       url: _info.url,
       recommendUserId: isEmployment.value
     }
@@ -630,7 +710,7 @@ async function handleSubmitResume () {
     if (practice && Object.keys(practice).length > 0) params = Object.assign(params, practice)
     await jobCvRelHireSend(params)
   } else {
-    const jobId = enRequestPositionInfo.value && enRequestPositionInfo.value?.id ? enRequestPositionInfo.value?.id : positionInfo.value.id
+    const jobId = enRequestPositionInfo.value && enRequestPositionInfo.value?.id ? enRequestPositionInfo.value?.id : positionInfo.value.id || selectJobId.value
     const type = (enRequestPositionInfo.value && Object.keys(enRequestPositionInfo.value).length ? enRequestPositionInfo.value.hire : positionInfo.value.hire) ? 1 : 0
     let params = {
       jobId,

+ 2 - 0
src/views/recruit/enterprise/resume/components/table.vue

@@ -243,6 +243,8 @@ const handleEditSubmit = async () => {
   if (!valid) return
   const query = inviteRef.value.getQuery()
   if (!query?.time) return Snackbar.warning('请选择面试时间')
+  if (itemData.value?.practiceStartTime) query.practiceStartTime = itemData.value.practiceStartTime
+  if (itemData.value?.practiceEndTime) query.practiceEndTime = itemData.value.practiceEndTime
   await saveInterviewInvite(query)
   showTip.value = true
   handleEditClose()