瀏覽代碼

冲突合并

Xiao_123 10 月之前
父節點
當前提交
d8d07a1a0b

+ 87 - 0
src/views/recruit/personal/shareJob/components/baseInfoCompleteForm.vue

@@ -0,0 +1,87 @@
+<template>
+  <div style="width: 100%;">
+    <CtForm ref="formPageRef" :items="items"></CtForm>
+  </div>
+</template>
+
+<script setup>
+defineOptions({ name: 'shareJob-baseInfoCompleteForm'})
+import { reactive, ref, defineExpose } from 'vue'
+import { useI18n } from '@/hooks/web/useI18n'
+import { uploadFile } from '@/api/common'
+import Snackbar from '@/plugins/snackbar'
+
+const { t }  = useI18n()
+const formPageRef = ref()
+let query = reactive({})
+
+// 上传简历
+const typeList = ['pdf', 'doc', 'docx']
+const handleUpload = async (e) => {
+  const file = e
+  const size = file.size
+  if (size / (1024*1024) > 10) {
+    Snackbar.warning(t('common.fileSizeExceed'))
+    return
+  }
+  const arr = file.name.split('.')
+  if (typeList.indexOf(arr[arr.length - 1]) < 0) {
+    Snackbar.warning(t('common.fileFormatIncorrect'))
+    return
+  }
+  const formData = new FormData()
+  formData.append('file', file)
+  const { data } = await uploadFile(formData)
+  if (!data) return
+  items.value.options.find(e => e.key === 'url').data = data
+}
+
+const items = ref({
+  options: [
+    // {
+    //   type: 'text',
+    //   key: 'name',
+    //   value: '',
+    //   clearable: true,
+    //   label: '姓名 *',
+    //   rules: [v => !!v || '请填写姓名']
+    // },
+    // {
+    //   type: 'text',
+    //   key: 'phone',
+    //   value: '',
+    //   clearable: true,
+    //   label: '手机号码 *',
+    //   rules: [v => !!v || '请填写手机号码']
+    // },
+    {
+      type: 'upload',
+      key: 'url',
+      value: null,
+      data: '',
+      label: '简历 *',
+      accept: '.doc, .docx, .pdf',
+      placeholder: '请上传简历',
+      rules: [v => !!v || '请上传简历'],
+      change: handleUpload
+    }
+  ]
+})
+
+
+const getQuery = async () => {
+  const { valid } = await formPageRef.value.formRef.validate()
+  if (!valid) return
+  const obj = {}
+  items.value.options.forEach(e => {
+    if (Object.prototype.hasOwnProperty.call(e, 'data')) return obj[e.key] = e.data
+    obj[e.key] = e.value
+  })
+  query = Object.assign(query, obj)
+  return query
+}
+
+defineExpose({
+  getQuery
+})
+</script>

+ 25 - 1
src/views/recruit/personal/shareJob/components/handleDeliveryCom.vue

@@ -5,12 +5,22 @@
     :visible="showUploadFile"
     :widthType="2"
     titleClass="text-h6"
-    title="简历投递"
     @close="showUploadFile = false"
+    title="简历上传"
     @submit="null"
   >
     <DeliveryForm ref="deliveryForm"></DeliveryForm>
   </CtDialog>
+  <CtDialog
+    :visible="baseInfoCompleteDialog"
+    :widthType="2"
+    titleClass="text-h6"
+    title="快速填写"
+    @close="baseInfoCompleteDialog = false"
+    @submit="baseInfoSubmit"
+  >
+    <DeliveryForm ref="deliveryForm"></DeliveryForm>
+  </CtDialog>
 </template>
 
 <script setup>
@@ -40,18 +50,32 @@ const props = defineProps({
   userId: {
     type: String,
     default: ''
+  },
+  baseInfo: {
+    type: Object,
+    default: () => {}
   }
 })
 const showResume = ref(false)
 const showUploadFile = ref(false)
+const baseInfoCompleteDialog = ref(false)
 const resumeList = ref([])
 
+//   if (baseInfoReady) {
+//     // 必填人才信息已存在 -> 符合快速投递,进入查看是否存在简历
+//   } else {
+//     // 必填人才信息不完全 -> 不符合快速投递,进入完善人才信息流程
+//   }
 const inspectionProcess = async () => {
   try {
     // 已登录情况下: 1.是否投递过简历 2.是否有上传简历 3.已登录但未上传过简历->快速投递
     // const res = await jobCvRelCheckSend({ jobId: props.jobId }) //是否投递过简历
     // if (res) return Snackbar.warning(t('resume.alreadyResume'))
     //
+    if (!props.baseInfo?.baseInfoReady) {
+      baseInfoCompleteDialog.value = true
+      return
+    }
     const data = await getPersonResumeCv()// 简历列表
     resumeList.value = data
     //

+ 5 - 5
src/views/recruit/personal/shareJob/components/login.vue

@@ -43,14 +43,14 @@ const handleLogin = async () => {
 // 查询用户基本信息失败 
 const getUserInfoVerify = () => {
   if (baseInfo.value) {
+    console.log(1, 'baseInfo.value', baseInfo.value)
     clearInterval(timer.value)
     timer.value = null
     loginLoading.value = false
-    const info = baseInfo.value
-    const keyArr = ['name', 'phone', 'jobStatus', 'expType', 'eduType']
-    // type = true, 符合快速投递,进入查看是否存在简历 // type = false, 不符合快速投递,进入填写基本信息
-    const type = keyArr.every(e => baseInfo.value[e] && baseInfo.value[e] !== 0)
-    emit('loginSuccess', { type, info, keyArr })
+    const keyArr = ['name', 'phone', 'jobStatus', 'expType', 'eduType'] // 必填人才信息
+    const baseInfoReady = keyArr.every(e => baseInfo.value[e] && baseInfo.value[e] !== 0) // 校验必填人才信息
+    const obj = { baseInfoReady, baseInfo: baseInfo.value, keyArr }
+    emit('loginSuccess', obj)
   }
   baseInfo.value = JSON.parse(localStorage.getItem('baseInfo'))
 }

+ 16 - 11
src/views/recruit/personal/shareJob/index.vue

@@ -66,7 +66,16 @@
         </div>
       </div>
     </v-card>
-    <handleDeliveryCom v-if="showHandleDelivery" :jobId="jobId" :hire="info?.hire" :userId="sharedById" @refresh="handleCheckJobDelivery"></handleDeliveryCom>
+    <!-- 简历投递 -->
+    <handleDeliveryCom
+      v-if="showHandleDelivery"
+      :jobId="jobId"
+      :hire="info?.hire"
+      :userId="sharedById"
+      :baseInfo="baseInfo"
+      @refresh="handleCheckJobDelivery"
+    ></handleDeliveryCom>
+    <!-- 快速登录 -->
     <CtDialog
       :visible="showQuickResumeDialog"
       :widthType="2"
@@ -74,7 +83,6 @@
       titleClass="text-h6"
       title="快速登录"
       @close="showQuickResumeDialog = false"
-      @submit="null"
     >
       <login :jobId="jobId" @loginSuccess="loginSuccess"></login>
     </CtDialog>
@@ -178,22 +186,19 @@ const handleDelivery = () => {
 }
 
 // 快速登录成功
-const loginSuccess = async ({ type = false, info = {}, keyArr = [] }) => {
-  const bool = await handleCheckJobDelivery()
-  showQuickResumeDialog.value = false
+const baseInfo = ref({ baseInfoReady: false, baseInfo: {}, keyArr: [] })
+const loginSuccess = async (info) => {
+  showQuickResumeDialog.value = false // 关闭快速登录弹窗
   // actions为true则是收藏时的登录,不需要弹窗选择简历
   if (actions.value) {
     actions.value = false
     Snackbar.success('登录成功')
     return 
   }
+  const bool = await handleCheckJobDelivery()
   if (bool) return Snackbar.warning(t('resume.alreadyResume'))
-  showHandleDelivery.value = !showQuickResumeDialog.value
-  if (type) {
-    // type = true, 符合快速投递,进入查看是否存在简历
-  } else {
-    // type = false, 不符合快速投递,进入填写基本信息
-  }
+  baseInfo.value = info
+  showHandleDelivery.value = true
 }
 </script>