瀏覽代碼

feat:简历操作

zhengnaiwen_citu 6 月之前
父節點
當前提交
4b99b01a42
共有 2 個文件被更改,包括 324 次插入2 次删除
  1. 32 0
      src/api/recruit/enterprise/jobFair.js
  2. 292 2
      src/views/recruit/enterprise/jobFair/components/resume.vue

+ 32 - 0
src/api/recruit/enterprise/jobFair.js

@@ -43,4 +43,36 @@ export const joinJobFairPosition = async (data) => {
     url: '/app-api/menduner/system/recruit/job-fair/join',
     data
   })
+}
+
+//实习申请简历列表
+export const getResumeList = async (data) => {
+  return await request.post({
+    url: '/app-api/flames/pracice/submit/record/list',
+    data
+  })
+}
+
+// 拒绝实习申请
+export const resumeCancel = async (data) => {
+  return await request.post({
+    url: '/app-api/flames/pracice/submit/record/enterprise/cancel',
+    data
+  })
+}
+
+// 企业拒绝实习申请
+export const resumeAccept = async (data) => {
+  return await request.post({
+    url: '/app-api/flames/pracice/submit/record/enterprise/cancel',
+    data
+  })
+}
+
+// 邀请面试
+export const resumeInterview = async (data) => {
+  return await request.post({
+    url: '/app-api/flames/pracice/submit/record/student/interview',
+    data
+  })
 }

+ 292 - 2
src/views/recruit/enterprise/jobFair/components/resume.vue

@@ -1,10 +1,300 @@
 <template>
-  <div>简历{{id}}</div>
+  <div class="d-flex flex-column">
+    <v-tabs v-model="tab" align-tabs="start" color="primary" bg-color="#f7f8fa" @update:modelValue="handleChange">
+      <v-tab v-for="k in tabList" :value="k.value" :key="k.value">{{ k.label }}</v-tab>
+    </v-tabs>
+    <!-- <Screen :tab="tab" @search="handleScreen" @reset="handleScreenReset" @select="handleSelect" @change="handleChangeBounty"></Screen> -->
+    <v-tabs-window v-model="tab" class="mt-1">
+      <v-tabs-window-item v-for="k in tabList" :value="k.value" :key="k.value">
+        <CtTable
+          class="mt-3"
+          :items="items"
+          :headers="headers"
+          :loading="false"
+          :elevation="0"
+          height="60vh"
+          :disableSort="true"
+          :isTools="false"
+          :showPage="true"
+          :total="total"
+          :page-info="pageInfo"
+          itemKey="id"
+          @pageHandleChange="handleChangePage"
+        >
+          <template #studentId="{ item }">
+            <div class="d-flex align-center">
+              <v-badge
+                v-if="item.student?.studentSex"
+                bordered
+                offset-y="6"
+                :color="item.student?.studentSex === '男' ? '#1867c0' : 'error'"
+                :icon="item.student?.studentSex === '男' ? 'mdi-gender-male' : 'mdi-gender-female'"
+              >
+                <v-avatar size="40" :image="getUserAvatar(item.student.studentHeadImg, item.student.studentSex)"></v-avatar>
+              </v-badge>
+              <v-avatar v-else size="40" :image="getUserAvatar(item.student.studentHeadImg, item.student.sex)"></v-avatar>
+              <span class="ml-3">{{ item?.student?.studentName }}</span>
+            </div>
+          </template>
+          <template #major="{ item }">
+            {{ item.student?.majorName }}
+            {{ item.student?.majorName && item.student?.schoolDepartmentName ? ' - ' : '' }}
+            {{ item.student?.schoolDepartmentName }}
+          </template>
+          <template #actions="{ item }">
+            <v-btn v-if="tab === 0" color="primary" variant="text" @click="handlePreviewResume(item)">查看附件</v-btn>
+            <v-btn v-if="tab === 0" color="primary" variant="text" @click="handleInterviewInvite(item)">邀请面试</v-btn>
+            <v-btn v-if="[0, 1].includes(tab)" color="primary" variant="text" @click="handleEliminate(item)">不合适</v-btn>
+            <v-btn v-if="tab === 1 && [15,4].includes(item.status)" color="primary" variant="text" @click="handleEnterByEnterprise(item)">入职</v-btn>
+          </template>
+        </CtTable>
+      </v-tabs-window-item>
+    </v-tabs-window>
+    
+
+    <!-- 邀请面试 -->
+    <CtDialog
+      :visible="showInvite"
+      :widthType="4"
+      titleClass="text-h6"
+      title="面试信息"
+      @close="showInvite = false"
+      @submit="handleEditSubmit"
+    >
+      <CtForm ref="CtFormInviteRef" :items="formItems" style="height: 500px;"></CtForm>
+    </CtDialog>
+
+    <CtDialog
+      :visible="showReject"
+      :widthType="4"
+      titleClass="text-h6"
+      title="拒绝理由"
+      @close="showReject = false"
+      @submit="handleReject"
+    >
+      <CtForm ref="CtFormRejectRef" :items="rejectItems"></CtForm>
+    </CtDialog>
+
+    <TipDialog
+      :visible="showTip"
+      icon="mdi-check-circle-outline"
+      message="面试邀请发送成功"
+      @close="showTip = false"
+    >
+      <div
+        class="color-primary text-decoration-underline cursor-pointer"
+        @click="handleToInterviewManagement"
+      >
+        点击到面试中查看。
+      </div>
+    </TipDialog>
+  </div>
 </template>
 
 <script setup>
 defineOptions({ name: 'jobFairResume'})
-defineProps({ id: [String, Number]})
+import { ref } from 'vue'
+import { useRouter, useRoute } from 'vue-router'
+import { useI18n } from '@/hooks/web/useI18n'
+import Snackbar from '@/plugins/snackbar'
+import { getResumeList, resumeAccept, resumeInterview } from '@/api/recruit/enterprise/jobFair'
+import { useUserStore } from '@/store/user'
+import { getDict } from '@/hooks/web/useDictionaries'
+import { previewFile } from '@/utils'
+import { getUserAvatar } from '@/utils/avatar'
+const userStore = useUserStore() 
+const router = useRouter()
+const route = useRoute()
+const { t } = useI18n()
+
+const tab = ref(0)
+const tabList = ref([
+  { label: '投递简历', value: 0, status: 0 },
+  { label: '已邀约', value: 1, status: 21 },
+  { label: '已入职', value: 2, status: 4 },
+  { label: '不合适', value: 3, status: 15 },
+])
+
+const headers = ref([
+  { title: '姓名', value: 'studentId', sortable: false },
+  { title: '学校', value: 'student.schoolName', sortable: false },
+  { title: '专业', value: 'major', sortable: false },
+  { title: '应聘职位', value: 'enterpriseRecruit.enterpriseRecruitJobName', sortable: false },
+  { title: '岗位薪资',
+    key: 'pay',
+    value: ({ enterpriseRecruit }) => {
+      if (!enterpriseRecruit) {
+        return '面议'
+      }
+      const { payFrom, payTo, payUnit } = enterpriseRecruit
+      return `${payFrom}${payFrom && payTo ? '-' : ''}${payTo}${payUnit ? '/' : ''}${payUnit}`
+    },
+    sortable: false
+  },
+  { title: '联系电话', value: 'student.phone', sortable: false },
+  { title: '操作', value: 'actions', sortable: false }
+])
+
+const CtFormInviteRef = ref()
+const CtFormRejectRef = ref()
+
+const formItems = ref({
+  options: [
+    {
+      type: 'datePicker',
+      mode: 'datetime',
+      labelWidth: 78,
+      value: '',
+      key: 'interviewDate',
+      label: '面试时间 *',
+      format: "YYYY/MM/DD HH:mm",
+      flexStyle: 'mb-7',
+      disabledDate: true,
+      rules: [v => !!v || '请选择面试时间']
+    },
+    {
+      type: 'text',
+      key: 'name',
+      value: '',
+      noParam: true,
+      disabled: true,
+      label: '面试者'
+    },
+    {
+      type: 'text',
+      key: 'position',
+      value: '',
+      noParam: true,
+      disabled: true,
+      label: '面试岗位'
+    }
+  ]
+})
+
+const rejectItems = ref({
+  options: [
+    {
+      type: 'textarea',
+      key: 'refuseMsg',
+      label: '拒绝理由 *',
+      rules: [v => !!v || '请填写拒绝理由']
+    }
+  ]
+})
+
+const items = ref([])
+const loading = ref(false)
+const total = ref(0)
+const pageInfo = ref({
+  pageNo: 1,
+  pageSize: 10
+})
+
+const itemData = ref({})
+const showInvite = ref(false)
+
+const showReject = ref(false)
+
+// 状态字典
+const statusList = ref([])
+
+getDict('menduner_interview_invite_status').then(({data}) => {
+  if (data && data.length) statusList.value = data
+})
+
+const handleChangePage = (index) => {
+  pageInfo.value.pageNo = index
+  getList()
+}
+
+const handleChange = () => {
+  pageInfo.value.pageNo = 1
+  getList()
+}
+
+
+// 查看简历
+const handlePreviewResume = async (item) => {
+  const url = item.studentInfoVo?.studentBiographicalNotes?.fileUrl
+  if (!url) return
+  previewFile(url)
+}
+// 邀请面试
+const handleInterviewInvite = (item) => {
+  formItems.value.options.forEach(e => {
+    if (e.key === 'name') {
+      e.value = item.student?.studentName
+    }
+    if (e.key === 'position') {
+      e.value = item.enterpriseRecruit.enterpriseRecruitJobName
+    }
+  })
+  itemData.value = item
+  showInvite.value = true
+}
+// 提交邀请
+const handleEditSubmit = async () => {
+  const { valid } = await CtFormInviteRef.value.formRef.validate()
+  if (!valid) return
+  const query = formItems.value.options.reduce((acc, cur) => {
+    if (cur.noParam) {
+      return acc
+    }
+    acc[cur.key] = cur.value
+    return acc
+  }, {
+    practiceSubmitRecordId: itemData.value.practiceSubmitRecordId,
+    studentId: itemData.value.studentId
+  })
+
+  await resumeInterview(query)
+  
+  Snackbar.success(t('common.operationSuccessful'))
+  showInvite.value = false
+  getList()
+}
+
+const handleEliminate = (item) => {
+  itemData.value = item
+  showReject.value = true
+}
+// 不合适
+const handleReject = async () => {
+  const { valid } = await CtFormRejectRef.value.formRef.validate()
+  if (!valid) return
+  const query = rejectItems.value.options.reduce((acc, cur) => {
+    acc[cur.key] = cur.value
+    return acc
+  }, {
+    practiceSubmitRecordId: itemData.value.practiceSubmitRecordId,
+    enterpriseId: itemData.value.enterpriseId
+  })
+  await resumeAccept(query)
+  
+  Snackbar.success(t('common.operationSuccessful'))
+  showReject.value = false
+  getList()
+}
+
+
+
+const getList = async () => {
+  loading.value = true
+  try {
+    const res = await getResumeList({
+      ...pageInfo.value,
+      jobFairId: route.params.id,
+      enterpriseId: userStore.entBaseInfo.enterpriseId,
+      status: tabList.value[tab.value].status
+    })
+    total.value = res.total
+    items.value = res.records
+  } finally {
+    loading.value = false
+  }
+}
+
+getList()
 </script>
 
 <style scoped lang="scss">