Browse Source

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

Xiao_123 1 month ago
parent
commit
941c279693

File diff suppressed because it is too large
+ 0 - 11
src/plugins/dialogExtend/components/analyzeTestData.js


+ 37 - 13
src/views/mall/components/prizeDraw.vue

@@ -1,15 +1,17 @@
 <template>
   <div class="prizeDrawBox">
     <div class="d-flex flex-column align-center">
-      <CtDialog :visible="showDialog" :widthType="3" :footer="false" titleClass="text-h6" title="房券抽奖" @close="showDialog = false">
+      <CtDialog :visible="showDialog" :widthType="3" :footer="false" titleClass="text-h6" title="房券抽奖" :closeable="false">
         <div class="d-flex flex-column align-center">
           <div class="numberBox mb-5">房券抽奖</div>
-          <gridPage v-if="props.type === '1'" :lotteryId="props.lotteryId" :disabled="disabled" @start="disabled = true" @end="endCallback"></gridPage>
-          <slotMachinePage v-if="props.type === '2'" :lotteryId="props.lotteryId" height="120" :class="{'mb-3': disabled}" :disabled="disabled" @start="disabled = true" @end="endCallback"></slotMachinePage>
+          <gridPage v-if="props.type === '1'" :lotteryId="props.lotteryId" @end="endCallback"></gridPage>
+          <slotMachinePage v-if="props.type === '2'" :lotteryId="props.lotteryId" height="120" :class="{'mb-3': disabled}" @end="endCallback"></slotMachinePage>
         </div>
       </CtDialog>
 
       <v-card min-height="300" width="700" class="pa-5" :class="{'mt-3': !disabled}" style="position: relative;">
+        <div v-if="disabled" class="color-warning text-center" style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">活动获取失败,<span class="defaultLink" @click="contactUs">请联系管理员</span>。</div>
+        <div v-if="isReceive" class="color-warning text-center" style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">奖品领取成功,请前往<span class="defaultLink" @click="toMyPrize">我的奖品</span>查看。</div>
         <div v-if="showPrize">
           <p v-for="(k, i) in prizeData" :key="i" class="color-primary">
             {{ k.prize.prompt }}
@@ -54,7 +56,7 @@
             </div>
           </div>
         </div>
-        <div v-else class="color-warning text-center" style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">请先进行抽奖</div>
+        <!-- <div v-else class="color-warning text-center" style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">请先进行抽奖</div> -->
       </v-card>
     </div>
   </div>
@@ -64,7 +66,7 @@
 defineOptions({ name: 'prizeDraw'})
 import gridPage from './prizeDraw/grid.vue'
 import slotMachinePage from './prizeDraw/slotMachine.vue'
-import { onMounted, ref } from 'vue'
+import { ref } from 'vue'
 import { getLuckLotteryRecordByOrderId } from '@/api/mall/prize'
 import { getMallUserAddressList } from '@/api/mall/address'
 import Snackbar from '@/plugins/snackbar'
@@ -83,10 +85,6 @@ const props = defineProps({
 })
 
 const showDialog = ref(false)
-onMounted(() =>{
-  showDialog.value = true
-})
-
 const router = useRouter()
 const newAddress = ref({
   name: '',
@@ -124,12 +122,30 @@ const handleChangeArea = () => {
 }
 
 // 获取中奖记录、收货地址
+const isReceive = ref(false) // 是否已领取
 const address = ref([])
 const prizeData = ref({})
 const getRecord = async () => {
   const data = await getLuckLotteryRecordByOrderId(props.orderId)
   prizeData.value = data || []
-  if (!data || !data.length) disabled.value = true
+  if (!data || !data.length) {
+    disabled.value = true
+    return
+  }
+  
+  if (data[0].record?.isReceive) {
+    isReceive.value = true
+    return
+  }
+
+  const orderIds = localStorage.getItem('handleLotteryOrderIds')
+  if (orderIds?.length && orderIds.includes(props.orderId)) {
+    // 已经点击过抽奖按钮,直接展示奖品。例如刷新支付完成页面
+    showPrize.value = true
+  } else {
+    // 刚进入支付完成页面
+    showDialog.value = true
+  }
 
   const addressData = await getMallUserAddressList()
   address.value = [...addressData, { id: 9999, label: '使用新地址' }] || []
@@ -139,10 +155,10 @@ if (props.orderId) getRecord()
 
 const showPrize = ref(false)
 const endCallback = () => {
-  // if (!prizeData.value.length) return Snackbar.warning('您已经抽过奖了哦')
+  const orderIds = JSON.parse(localStorage.getItem('handleLotteryOrderIds') || '[]')
+  localStorage.setItem('handleLotteryOrderIds', JSON.stringify([...orderIds, props.orderId])) // 标记已抽奖
   showDialog.value = false
   showPrize.value = true
-  // disabled.value = true
 }
 
 function checkValue(obj) {
@@ -163,8 +179,16 @@ const handleSubmit = async () => {
   } else query = address.value.find(item => item.id === addressSelect.value)
   await luckyLotteryRecordReceive({ id: prizeData.value[0].record.id, receiveInfo: JSON.stringify(query) })
   Snackbar.success('奖品领取成功,待商家发货')
-  router.push('/recruit/personal/personalCenter/tradeOrder?key=1')
+  router.replace('/recruit/personal/personalCenter/tradeOrder?key=1')
+}
+
+const toMyPrize = () => {
+  router.replace('/recruit/personal/personalCenter/tradeOrder?key=1')
 }
+const contactUs = () => {
+  router.replace('/contactUs')
+}
+
 </script>
 
 <style scoped lang="scss">

+ 18 - 4
src/views/recruit/enterprise/jobFair/details.vue

@@ -1,5 +1,6 @@
 <template>
   <v-card class="card-box pa-4" :style="`background-color: ${jobFairInfo?.backgroundColour}`">
+    <Loading :visible="jobListLoading" :contained="true"></Loading>
     <div class="position-relative">
       <div class="text-center my-6 mx-10 px-15 font-weight-bold font-size-20" style="color: #fff">{{ jobFairInfo?.title?.replace(/<\/?p[^>]*>/gi, '') }}</div>
       <div class="d-flex justify-space-between mb-3 align-center">
@@ -13,7 +14,8 @@
           <v-btn color="#fff" v-if="jobFairInfo?.contentImg" :style="`color: ${jobFairInfo?.backgroundColour || 'var(--v-primary-base)'}`" prepend-icon="mdi-share" @click="handleShare">我的分享海报</v-btn>
         </div>
       </div>
-      <JobItem :items="jobList" @refresh="getJobList(), getJobNum()"></JobItem>
+      <div v-if="jobListLoading" class="centerText color-777">加载中...</div>
+      <JobItem v-else :items="jobList" @refresh="getJobList(), getJobNum()"></JobItem>
 
       <v-navigation-drawer v-model="showDrawer" location="right" temporary width="600">
         <Loading :visible="positionLoading" :contained="true"></Loading>
@@ -140,10 +142,15 @@ const previewSrc  = ref('')
 const positionList = ref([])
 
 // 职位列表
+const jobListLoading = ref(true)
 const getJobList = async () => {
-  const data = await getJobFairPosition(id)
-  if (!data || !data.length) return jobList.value = []
-  jobList.value = dealDictArrayData([], data)
+  try {
+    const data = await getJobFairPosition(id)
+    if (!data || !data.length) return jobList.value = []
+    jobList.value = dealDictArrayData([], data)
+  } finally {
+    jobListLoading.value = false
+  }
 }
 
 // const handleAdd = async () => {
@@ -282,4 +289,11 @@ const handleShare = () => {
 .actions:hover {
   color: var(--v-primary-base);
 }
+
+.centerText {
+  height: 50vh;
+  line-height: 50vh;
+  text-align: center;
+  color: #fff;
+}
 </style>

+ 7 - 7
src/views/recruit/enterprise/positionManagement/components/add.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <v-card class="pa-5">
+    <v-card class="pa-5" v-if="show">
       <v-timeline align="start" side="end">
         <v-timeline-item
           v-for="(val, i) in list"
@@ -233,6 +233,8 @@ const saveEmit = async (retry) => {
   loading.value = true
   try {
     const res = await saveJobAdvertised({ ...submitParams, fair: props.isFair ? true : false }) // fair:是否为招聘会职位编辑-必填
+    if (showExtend.value) await handleSaveExtend(res) // 保存扩展信息
+
     // status:99为待支付职位,弹窗支付
     if (submitParams?.status && submitParams?.status === '99') {
       loading.value = true
@@ -245,9 +247,6 @@ const saveEmit = async (retry) => {
       return
     }
 
-    // 保存扩展信息
-    if (showExtend.value) await handleSaveExtend(res)
-
     Snackbar.success(submitParams.id ? t('common.editSuccessMsg') : '发布成功')
     handleCancel()
   } catch (error) {
@@ -281,20 +280,21 @@ const handlePayClose = () => {
   router.push({ path: '/recruit/enterprise/position/index', query: { key: 0 }})
 }
 
+const show = ref(false)
 // 获取编辑的职位详情
 const getPositionDetail = async (id) => {
   const data = await getJobDetails({ id })
   if (!data && !Object.keys(data).length) return
   itemData.value = {...data, ...dealDictObjData({}, data)}
+  show.value = true
 
   // 招聘类型为实习则获取扩展信息
   if (data.type === '3') initPosition(id)
 }
 
 // 有id为编辑
-if (route.query && route.query.id) {
-  if (route.query.id) getPositionDetail(route.query.id)
-}
+if (route.query?.id) getPositionDetail(route.query.id)
+else show.value = true
 
 // 取消
 const handleCancel = () => {

+ 57 - 49
src/views/recruit/enterprise/positionManagement/components/baseInfo.vue

@@ -64,7 +64,10 @@ import { getJobFairWhiteList } from '@/api/recruit/enterprise/jobFair'
 const { t } = useI18n()
 const props = defineProps({
   itemData: Object,
-  isFair: Boolean
+  isFair: {
+    type: Boolean,
+    default: false
+  }
 })
 
 const getValue = (key) => {
@@ -136,6 +139,56 @@ const items = ref({
   ]
 })
 
+// 获取企业已加入的招聘会列表
+const jobFairLoaded = ref(false)
+const jobFairWhiteList = ref([])
+const getJobFairData = async () => {
+  const data = await getJobFairWhiteList()
+  jobFairWhiteList.value = data?.length ? data : []
+  jobFairLoaded.value = true
+  // 没有加入任何招聘会则不展示招聘会
+  if (!jobFairWhiteList.value?.length) items.value.options = items.value.options.filter(e => e.key !== 'bizId')
+}
+getJobFairData()
+
+const jobFairValid = async () => {
+  if (props.isFair) {
+    // 招聘会内编辑职位,不需要展示选择招聘会
+    items.value.options = items.value.options.filter(e => e.key !== 'bizId')
+    return
+  }
+  // 加载招聘会白名单列表
+  if (!jobFairLoaded.value) await getJobFairData()
+  const bizIdObj = items.value.options.find(e => e.key === 'bizId') // 招聘会下拉框
+  if (!bizIdObj) return
+  bizIdObj.items = jobFairWhiteList.value // 下拉框内容赋值
+  if (bizIdObj.value) {
+    const index = jobFairWhiteList.value.findIndex(e => e.id === props.itemData.bizId)
+    if (index === -1) bizIdObj.value = null // 招聘会已经关闭 或者已被移除招聘会白名单
+    jobFairCheckboxChange(Boolean(bizIdObj.value), bizIdObj) // 招聘会回显
+  }
+}
+jobFairValid()
+
+// 设置为招聘会职位
+// 现有逻辑:设置为招聘会职位后,职位管理编辑再修改为去掉选中招聘会不会改变数据的jobFairIds字段(用于职位列表判断是否展示招聘会标识),只有去招聘会移除才会改变jobFairIds字段。
+const jobFairCheckbox = ref(false)
+const jobFairCheckboxChange = (bool, item) => {
+  item.value = bool ? (item?.value || null) : null
+  jobFairCheckbox.value = bool
+  item.disabled = bool ? false : true
+  item.label = bool ? '招聘会 *' : '招聘会'
+}
+
+// 长期有效
+const soFar = ref(false)
+const handleSoFarChange = (bool, item) => {
+  soFar.value = bool
+  item.value = null
+  item.disabled = bool ? true : false
+  item.label = bool ? '到期时间' : '到期时间 *'
+}
+
 // 编辑回显
 watch(
   () => props.itemData,
@@ -149,32 +202,15 @@ watch(
       }
       if (e.noParam) return
       if (e.key === 'expireTime' && !val[e.key]) return handleSoFarChange(true, e)
-      if (e.key === 'bizId' && val.source === '2') jobFairCheckboxChange(true, e, false) // 招聘会回显
-      if (e.key === 'bizId' && (val.source === '0' || hideJobFairCheckbox.value)) return // 非招聘会职位
+      if (e.key === 'bizId' && val.source === '0') return // 非招聘会职位
       e.value = val[e.key]
     })
-    if (props.isFair) items.value.options = items.value.options.filter(e => e.key !== 'bizId') // 如果为招聘会编辑则不显示
+    // jobFairValid()  // 招聘会回显
   },
   { immediate: true },
   { deep: true }
 )
 
-// 获取企业已加入的招聘会列表
-const hideJobFairCheckbox = ref(false)
-const getJobFairData = async () => {
-  if (props.isFair) return
-  const data = await getJobFairWhiteList()
-  const bizId = items.value.options.find(e => e.key === 'bizId') || {}
-  if (!data?.length) {
-    hideJobFairCheckbox.value = true
-    bizId.value = null
-    return
-  } else{
-    bizId.items = data
-  }
-}
-getJobFairData()
-
 // 职位类型
 const handleJobClickItem = (list, name) => {
   const positionId = getValue('positionId')
@@ -214,32 +250,6 @@ const useJobTemplate = async () => {
   }
 }
 
-const soFar = ref(false)
-// 长期有效
-const handleSoFarChange = (bool, item) => {
-  soFar.value = bool
-  item.value = null
-  item.disabled = bool ? true : false
-  item.label = bool ? '到期时间' : '到期时间 *'
-}
-
-// 设置为招聘会职位
-const jobFairCheckbox = ref(false)
-const jobFairCheckboxChange = (bool, item, isSnackbar = true) => {
-  if (props.isFair) { // 招聘会内职位编辑
-    jobFairCheckbox.value = false
-    return
-  }
-  if (hideJobFairCheckbox.value) {
-    bool = false
-    if (isSnackbar) Snackbar.warning('没有加入任何招聘会')
-  }
-  jobFairCheckbox.value = bool
-  item.value = null
-  item.disabled = bool ? false : true
-  item.label = bool ? '招聘会 *' : '招聘会'
-}
-
 const getQuery = async () => {
   const { valid } = await formPageRef.value.formRef.validate()
   if (!valid) return
@@ -253,7 +263,7 @@ const getQuery = async () => {
     else obj[e.key] = e.value
   })
   
-  if (jobFairCheckbox.value && !obj.bizId) {
+  if (jobFairCheckbox.value && !obj.bizId && jobFairWhiteList.value?.length) {
     Snackbar.warning('请选择招聘会')
     return 'failed'
   }
@@ -277,8 +287,6 @@ const getQuery = async () => {
   if (obj.source === '0')  obj.bizId = null
 
   Object.assign(query, obj)
-  // console.log('obj:', obj)
-  console.log('query:', query)
   return query
 }
 

File diff suppressed because it is too large
+ 0 - 11
src/views/recruit/personal/PersonalCenter/resume/analysis/analyzeTestData.js


File diff suppressed because it is too large
+ 0 - 9
src/views/recruit/personal/PersonalCenter/resume/online/test.js


Some files were not shown because too many files changed in this diff