Bladeren bron

学生-投递简历-参数添加

Xiao_123 2 maanden geleden
bovenliggende
commit
ba85a82c27

+ 72 - 31
src/views/recruit/components/message/index.vue

@@ -135,13 +135,15 @@
     @close="showUploadDialog = false"
     @submit="handleSubmitAttachment"
   >
+    <div class="color-warning mb-3" style="font-size: 13px;">* 仅支持.doc, .docx, .pdf文件且大小不能超过20MB</div>
     <CtForm ref="CtFormRef" :items="formItems">
       <template #uploadFile="{ item }">
         <TextInput v-model="item.value" :item="item" @click="openFileInput"></TextInput>
         <File ref="uploadFile" @success="handleUploadResume"></File>
       </template>
     </CtForm>
-    <div class="color-666" style="font-size: 13px;">* 仅支持.doc, .docx, .pdf文件且大小不能超过20MB</div>
+    <!-- 学生-实习到岗信息 -->
+    <studentDeliveryForm v-if="baseInfo?.type && Number(baseInfo.type) === 1" ref="studentDeliveryFormRef" />
   </CtDialog>
 
   <!-- 面试邀请 -->
@@ -159,7 +161,7 @@
 
   <!-- 选择附件简历投递 -->
   <CtDialog :visible="showResume" :widthType="2" titleClass="text-h6" title="发送简历" @close="showResume = false; selectResume = null; enRequestPositionInfo = {}" @submit="handleSubmitResume">
-    <div style="position: relative; min-height: 200px">
+    <div style="position: relative;">
       <v-radio-group v-model="selectResume">
         <div v-for="val in resumeList" :key="val.id" class="d-flex align-center radioBox">
           <v-radio :label="val.title" :value="val.id"  color="primary"></v-radio>
@@ -167,6 +169,7 @@
         </div>
       </v-radio-group>
     </div>
+    <studentDeliveryForm v-if="baseInfo?.type && Number(baseInfo?.type) === 1" ref="studentDeliveryFormRef" />
   </CtDialog>
 </template>
 
@@ -201,6 +204,7 @@ import { dealDictArrayData } from '@/utils/position'
 import { previewFile } from '@/utils'
 import { timesTampChange } from '@/utils/date'
 import { useRouter } from 'vue-router'
+import studentDeliveryForm from '@/views/recruit/personal/components/studentDeliveryForm.vue'
 
 const { t } = useI18n()
 const chatRef = ref()
@@ -217,6 +221,8 @@ const channelItem = ref(null)
 const messageItems = ref([])
 const pageSize = ref(1)
 const hasMore = ref(false)
+const studentDeliveryFormRef = ref()
+const baseInfo = ref(localStorage.getItem('baseInfo') ? JSON.parse(localStorage.getItem('baseInfo')) : {})
 
 const positionList = ref([])
 const showTip = ref(false)
@@ -546,77 +552,112 @@ const handleSubmitAttachment = async () => {
     obj[e.key] = e.truthValue || e.value
   })
   if (!obj.title || !obj.url) return
-  await savePersonResumeCv(obj)
-  const text = {
-    remark: '发送简历',
-    query: {
-      src: obj.url,
-      title: obj.title
-    },
-    type: 1
+
+  // 学生实习到岗信息
+  let practice = {}
+  if (baseInfo.value?.type && Number(baseInfo.value?.type) === 1) {
+    practice = studentDeliveryFormRef.value.getQueryParams()
+    console.log(practice, '上传简历-到岗信息')
   }
-  if (enRequestPositionInfo.value) text.query.positionInfo = enRequestPositionInfo.value
-  send (JSON.stringify(text), channelItem.value, 105)
+  if (practice && Object.keys(practice).length > 0 && !practice.practiceStartTime || !practice.practiceEndTime) return Snackbar.warning('请完善实习到岗信息')
+
+  // 保存附件
+  await savePersonResumeCv(obj)
 
   // 简历投递至简历库
   if (isEmployment.value !== '-1') {
-    await jobCvRelHireSend({
+    let params = {
       jobId: positionInfo.value.id,
       url: obj.url,
       recommendUserId: isEmployment.value
-    })
+    }
+    // 如果是学生则需要带上实习信息
+    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 type = (enRequestPositionInfo.value && Object.keys(enRequestPositionInfo.value).length ? enRequestPositionInfo.value.hire : positionInfo.value.hire) ? 1 : 0
-    await jobCvRelSend({
+    let params = {
       jobId,
       title: obj.title,
       url: obj.url,
       type
-    })
+    }
+    // 如果是学生则需要带上实习信息
+    if (practice && Object.keys(practice).length > 0) params = Object.assign(params, practice)
+    await jobCvRelSend(params)
   }
   handleChangeSendResumeStatus(true)
   showUploadDialog.value = false
-  enRequestPositionInfo.value = {}
-}
 
-async function handleSubmitResume () {
-  if (!selectResume.value) {
-    Snackbar.error(t('resume.selectResumeToSubmit'))
-    return
-  }
-  const _info = resumeList.value.find((item) => item.id === selectResume.value)
   const text = {
     remark: '发送简历',
     query: {
-      src: _info.url,
-      title: _info.title,
-      id: _info.id,
+      src: obj.url,
+      title: obj.title
     },
     type: 1
   }
   if (enRequestPositionInfo.value) text.query.positionInfo = enRequestPositionInfo.value
   send (JSON.stringify(text), channelItem.value, 105)
 
+  enRequestPositionInfo.value = {}
+}
+
+async function handleSubmitResume () {
+  if (!selectResume.value) {
+    Snackbar.warning(t('resume.selectResumeToSubmit'))
+    return
+  }
+  const _info = resumeList.value.find((item) => item.id === selectResume.value)
+
+  // 学生实习到岗信息
+  let practice = {}
+  if (baseInfo.value?.type && Number(baseInfo.value?.type) === 1) {
+    practice = studentDeliveryFormRef.value.getQueryParams()
+    console.log(practice, '选择简历-到岗信息')
+  }
+  if (practice && Object.keys(practice).length > 0 && !practice.practiceStartTime || !practice.practiceEndTime) return Snackbar.warning('请完善实习到岗信息')
+
   // 简历投递至简历库
   if (isEmployment.value !== '-1') {
-    await jobCvRelHireSend({
+    let params = {
       jobId: positionInfo.value.id,
       url: _info.url,
       recommendUserId: isEmployment.value
-    })
+    }
+    // 如果是学生则需要带上实习信息
+    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 type = (enRequestPositionInfo.value && Object.keys(enRequestPositionInfo.value).length ? enRequestPositionInfo.value.hire : positionInfo.value.hire) ? 1 : 0
-    await jobCvRelSend({
+    let params = {
       jobId,
       title: _info.title,
       url: _info.url,
       type
-    })
+    }
+    // 如果是学生则需要带上实习信息
+    if (practice && Object.keys(practice).length > 0) params = Object.assign(params, practice)
+    
+    await jobCvRelSend(params)
   }
   handleChangeSendResumeStatus(true)
   showResume.value = false
+
+  const text = {
+    remark: '发送简历',
+    query: {
+      src: _info.url,
+      title: _info.title,
+      id: _info.id,
+    },
+    type: 1
+  }
+  if (enRequestPositionInfo.value) text.query.positionInfo = enRequestPositionInfo.value
+  send (JSON.stringify(text), channelItem.value, 105)
+  
   enRequestPositionInfo.value = {}
 }
 

+ 2 - 2
src/views/recruit/personal/PersonalCenter/resume/attachment/index.vue

@@ -21,8 +21,8 @@
       >
         <template #actions="{ item }">
           <v-btn color="primary" @click.stop="previewFile(item.url)" variant="text">预览</v-btn>
-          <v-btn color="error" @click.stop="handleDownload(item)" variant="text">下载</v-btn>
-          <v-btn v-if="!item.defaultStatus" color="success" @click.stop="handleDelete(item)" variant="text">{{ $t('common.delete') }}</v-btn>
+          <v-btn color="#00897B" @click.stop="handleDownload(item)" variant="text">下载</v-btn>
+          <v-btn v-if="!item.defaultStatus" color="error" @click.stop="handleDelete(item)" variant="text">{{ $t('common.delete') }}</v-btn>
         </template>
       </CtTable>
       <div v-if="props.analysis" class="d-flex  flex-column align-center mt-15">

+ 100 - 0
src/views/recruit/personal/components/studentDeliveryForm.vue

@@ -0,0 +1,100 @@
+<template>
+	<div>
+    <p class="color-warning font-size-15 mb-5">请填写您的实习到岗信息</p>
+    <CtForm ref="CtFormRef" :items="formItems" />
+  </div>
+</template>
+
+<script setup>
+// 学生-实习到岗信息表单
+defineOptions({ name: 'studentDeliveryForm'})
+import { ref, nextTick } from 'vue'
+
+const CtFormRef = ref()
+
+const startTimeChange = (v) => {
+  const startTime = formItems.value.options.find(e => e.key === 'practiceStartTime')
+  const endTime = formItems.value.options.find(e => e.key === 'practiceEndTime')
+  if (startTime?.value && endTime?.value && startTime.value > endTime.value) {
+    Snackbar.warning('开始时间不能大于结束时间!')
+    nextTick(() => {
+      startTime.value = endTime.value
+    })
+  }
+}
+const endTimeChange = (v) => {
+  const startTime = formItems.value.options.find(e => e.key === 'practiceStartTime')
+  const endTime = formItems.value.options.find(e => e.key === 'practiceEndTime')
+  if (startTime?.value && endTime?.value && startTime.value > endTime.value) {
+    Snackbar.warning('结束时间不能小于开始时间')
+    nextTick(() => {
+      endTime.value = startTime.value
+    })
+  }
+}
+const formItems = ref({
+  options: [
+    {
+      type: 'datePicker',
+      key: 'practiceStartTime',
+      mode: 'date',
+      value: null,
+      labelWidth: 120,
+      label: '到岗日期 *',
+      disabledDate: true,
+      teleported: true,
+      rules: [v => !!v || '请选择到岗日期'],
+      change: startTimeChange
+    },
+    {
+      type: 'datePicker',
+      key: 'practiceEndTime',
+      mode: 'date',
+      value: null,
+      disabledDate: true,
+      labelWidth: 120,
+      label: '结束日期 *',
+      flexStyle: 'mt-5',
+      teleported: true,
+      rules: [v => !!v || '请选择结束日期'],
+      change: endTimeChange
+    },
+    // {
+    //   type: 'autocomplete',
+    //   key: 'dateType',
+    //   value: null,
+    //   default: null,
+    //   label: '每周到岗天数 *',
+    //   outlined: true,
+    //   itemText: 'label',
+    //   itemValue: 'value',
+    //   flexStyle: 'mt-5',
+    //   rules: [v => !!v || '请选择每周到岗天数'],
+    //   items: [
+    //     { label: '1天', value: 1 },
+    //     { label: '2天', value: 2 },
+    //     { label: '3天', value: 3 },
+    //     { label: '4天', value: 4 },
+    //     { label: '5天', value: 5 },
+    //     { label: '6天', value: 6 },
+    //     { label: '7天', value: 7 }
+    //   ]
+    // }
+  ]
+})
+
+const getQueryParams = () => {
+	let obj = {}
+	formItems.value.options.forEach(item => obj[item.key] = item.value)
+	return obj
+}
+
+defineExpose({
+	CtFormRef,
+	getQueryParams
+})
+</script>
+
+<style scoped lang="scss">
+
+</style>

+ 30 - 8
src/views/recruit/personal/position/components/details.vue

@@ -3,7 +3,7 @@
     <div class="banner px-6" id="share" :class="{'default-width': defaultWidth}">
       <div class="banner-title d-flex justify-space-between align-center">
         <div class="d-flex align-center justify-between">
-          <svg-icon v-if="info?.hire" class="ml-5" name="pin" size="50"></svg-icon>
+          <svg-icon v-if="info?.hire" class="mr-5" name="pin" size="50"></svg-icon>
           <svg-icon v-if="jobFairId" name="jobFair" class="mr-1" size="35"></svg-icon>
           <h1>{{ formatName(info.name) }}</h1>
         </div>
@@ -116,17 +116,19 @@
       @close="showUploadDialog = false"
       @submit="handleUploadSubmit"
     >
+      <div class="color-warning mb-3" style="font-size: 13px;">* 仅支持.doc, .docx, .pdf文件且大小不能超过20MB</div>
       <CtForm ref="CtFormRef" :items="formItems">
         <template #uploadFile="{ item }">
           <TextInput v-model="item.value" :item="item" @click="openFileInput"></TextInput>
           <File ref="uploadFile" @success="handleUploadResume"></File>
         </template>
       </CtForm>
-      <div class="color-666" style="font-size: 13px;">* 仅支持.doc, .docx, .pdf文件且大小不能超过20MB</div>
+      <!-- 学生-实习到岗信息 -->
+      <studentDeliveryForm v-if="baseInfo?.type && Number(baseInfo.type) === 1" ref="studentDeliveryFormRef" />
     </CtDialog>
 
     <!-- 选择简历 -->
-    <selectResumeDialog v-model="showResume" :list="resumeList" @submit="handleSubmit" @close="handleClose"></selectResumeDialog>
+    <selectResumeDialog v-model="showResume" :isStudent="baseInfo?.type && Number(baseInfo.type) === 1" :list="resumeList" @submit="handleSubmit" @close="handleClose"></selectResumeDialog>
 
     <!-- 图片预览 -->
     <PreviewImage v-if="showPreview" :urlList="[previewSrc]" :fileName="fileName" @close="showPreview = !showPreview" />
@@ -174,6 +176,7 @@ import { checkPersonBaseInfo } from '@/utils/check'
 import dialogExtend from '@/plugins/dialogExtend'
 import { formatName } from '@/utils/getText'
 import { jobFairPositionDeliveryCheck } from '@/api/recruit/personal/jobFair'
+import studentDeliveryForm from '@/views/recruit/personal/components/studentDeliveryForm.vue'
 
 const emit = defineEmits(['preview'])
 const props = defineProps({
@@ -210,8 +213,11 @@ const loading = ref(false)
 const showLogin = ref(false)
 const previewSrc = ref('')
 const showPreview = ref(false)
+const baseInfo = ref(localStorage.getItem('baseInfo') ? JSON.parse(localStorage.getItem('baseInfo')) : {})
+
 // 附件简历上传
 const CtFormRef = ref()
+const studentDeliveryFormRef = ref()
 const showUploadDialog = ref(false)
 const formItems = ref({
   options: [
@@ -407,17 +413,28 @@ const handleUploadSubmit = async () => {
     obj[e.key] = e.truthValue || e.value
   })
   if (!obj.title || !obj.url) return
-  loading.value = true
-  await savePersonResumeCv(obj)
 
-  const params = {
+  let params = {
     jobId: id,
     title: obj.title,
     url: obj.url,
     type: info.value.hire ? 1 : 0
   }
+
+  // 如果是学生则需要带上实习信息
+  let practice = {}
+  if (baseInfo.value?.type && Number(baseInfo.value?.type) === 1) {
+    practice = studentDeliveryFormRef.value.getQueryParams()
+    if (!practice.practiceStartTime || !practice.practiceEndTime) return Snackbar.warning('请完善实习到岗信息')
+    params = Object.assign(params, practice)
+    console.log(practice, '上传简历-到岗信息', params)
+  }
+  loading.value = true
+  await savePersonResumeCv(obj)
+  
   // 如果是参与招聘会的职位,则传招聘会id
   if (jobFairId.value) params.jobFairId = jobFairId.value
+
   await jobCvRelSend(params)
 
   showUploadDialog.value = false
@@ -465,7 +482,7 @@ const handleClose = () => {
   showResume.value = false
   selectResume.value = null
 }
-const handleSubmit = async (val) =>{
+const handleSubmit = async (val, practice) =>{
   selectResume.value = val
   if (!selectResume.value) return Snackbar.warning(t('resume.selectResumeToSubmit'))
   const obj = resumeList.value.find(e => e.id === selectResume.value)
@@ -473,7 +490,7 @@ const handleSubmit = async (val) =>{
   handleClose()
   loading.value = true
 
-  const params = {
+  let params = {
     jobId: id,
     title: obj.title,
     url: obj.url,
@@ -481,6 +498,11 @@ const handleSubmit = async (val) =>{
   }
   // 如果是参与招聘会的职位,则传招聘会id
   if (jobFairId.value) params.jobFairId = jobFairId.value
+
+  // 如果是学生则需要带上实习信息
+  if (baseInfo.value?.type && Number(baseInfo.value?.type) === 1 && practice) params = Object.assign(params, practice)
+  console.log(val, practice, '简历投递-实习到岗信息', params)
+
   await jobCvRelSend(params)
 
   setTimeout(async () => {

+ 30 - 8
src/views/recruit/personal/position/components/jobDetails/selectResumeDialog.vue

@@ -1,31 +1,33 @@
 <!-- 选择简历 -->
 <template>
-  <Dialog
+  <CtDialog
     :visible="show"
     :widthType="2"
     titleClass="text-h6"
     :title="title"
     @close="emit('close')"
-    @submit="emit('submit', selectResume)"
+    @submit="handleSubmit"
   >
     <div v-if="selectLocalFile" class="defaultLink ml-3 mb-3" style="font-size: 15px;" @click="emit('handleLocalFileClick')">{{ $t('resume.selectLocalFile') }}</div>
-    <!-- <v-radio-group v-model="selectResume">
-      <v-radio v-for="val in list" :key="val.id" :value="val.id" :label="val.title" color="primary"></v-radio>
-    </v-radio-group> -->
     <v-radio-group v-model="selectResume">
       <div v-for="val in list" :key="val.id" class="d-flex align-center radioBox">
         <v-radio :label="val.title" :value="val.id"  color="primary"></v-radio>
         <span class="defaultLink mx-3" style="font-size: 14px;" @click.stop="previewFile(val.url)">预览</span>
       </div>
     </v-radio-group>
-  </Dialog>
+
+    <div class="mt-10" v-if="isStudent">
+      <studentDeliveryForm ref="studentDeliveryFormRef" />
+    </div>
+  </CtDialog>
 </template>
 
 <script setup>
-import Dialog from '@/components/CtDialog'
+defineOptions({name: 'position-details-selectResumeDialog'})
 import { watch, computed, ref } from 'vue'
 import { previewFile } from '@/utils'
-defineOptions({name: 'position-details-selectResumeDialog'})
+import studentDeliveryForm from '@/views/recruit/personal/components/studentDeliveryForm.vue'
+import Snackbar from '@/plugins/snackbar'
 
 const props = defineProps({
   selectLocalFile: {
@@ -40,9 +42,16 @@ const props = defineProps({
   title: {
     type: String,
     default: '请选择要投递的简历'
+  },
+  isStudent: {
+    type: Boolean,
+    default: false
   }
 })
 const emit = defineEmits(['update:modelValue', 'handleToUpload', 'submit', 'close', 'handleLocalFileClick'])
+
+const studentDeliveryFormRef = ref()
+
 const show = computed(() => {
   return props.modelValue
 })
@@ -52,7 +61,20 @@ watch(() => show.value, (newVal) => {
 })
 
 const selectResume = ref()
+
+// 提交
+const handleSubmit = async () => {
+  // 实习到岗信息
+  let query = {}
+  if (props.isStudent) {
+    query = studentDeliveryFormRef.value.getQueryParams()
+    if (!query.practiceStartTime || !query.practiceEndTime) return Snackbar.warning('请完善实习到岗信息')
+  }
+
+  emit('submit', selectResume.value, query)
+}
 </script>
+
 <style lang="scss" scoped>
 .radioBox {
   &:hover {