Browse Source

企业-简历:效验是否有查看简历额度

Xiao_123 1 month ago
parent
commit
4efa046e03

+ 0 - 8
src/api/recruit/public/delivery/index.js

@@ -34,12 +34,4 @@ export const hireJobCvRelEliminate = async (ids) => {
   return await request.post({
   return await request.post({
     url: `/app-api/menduner/system/recruit/person-cv/eliminate?ids=${ids}`
     url: `/app-api/menduner/system/recruit/person-cv/eliminate?ids=${ids}`
   })
   })
-}
-
-// 记录查看简历附件
-export const hireJobCvRelLook = async (id) => {
-  return await request.post({
-    url: `/app-api/menduner/system/recruit/person-cv/look?id=${id}`,
-    openEncryption: true
-  })
 }
 }

+ 14 - 1
src/views/recruit/enterprise/resume/components/table.vue

@@ -133,6 +133,11 @@ const headers = ref([
   { title: '操作', value: 'actions', sortable: false }
   { title: '操作', value: 'actions', sortable: false }
 ])
 ])
 
 
+let baseInfo = ref(JSON.parse(localStorage.getItem('entBaseInfo')) || {})
+userStore.$subscribe((mutation, state) => {
+  if (Object.keys(state.entBaseInfo).length) baseInfo.value = state.entBaseInfo
+})
+
 watch(
 watch(
   () => props.tab,
   () => props.tab,
   (val) => {
   (val) => {
@@ -214,6 +219,10 @@ const handleCancelEliminate = async (item) => {
 
 
 // 查看简历
 // 查看简历
 const handlePreviewResume = async (item) => {
 const handlePreviewResume = async (item) => {
+  // 效验企业是否有查看简历次数
+  await userStore.getEnterpriseInfo(true)
+  if (baseInfo.value?.entitlement?.lookCvCount <= 0) return Snackbar.warning('您的查看简历次数已用完,请联系平台管理员!')
+
   const url = props.tab === 0 ? item.url : item.cvRel.url
   const url = props.tab === 0 ? item.url : item.cvRel.url
   const id = props.tab === 0 ? item.id : item.cvRel.id
   const id = props.tab === 0 ? item.id : item.cvRel.id
   if (!url || !id) return Snackbar.warning('简历不存在')
   if (!url || !id) return Snackbar.warning('简历不存在')
@@ -288,7 +297,11 @@ const handleToInterviewManagement = () => {
 }
 }
 
 
 // 下载附件
 // 下载附件
-const handleDownloadAttachment = (k) => {
+const handleDownloadAttachment = async (k) => {
+  // 效验企业是否有下载简历次数
+  await userStore.getEnterpriseInfo(true)
+  if (baseInfo.value?.entitlement?.lookCvCount <= 0) return Snackbar.warning('您的下载简历次数已用完,请联系平台管理员!')
+
   const url = props.tab === 0 ? k.url : k.cvRel?.url
   const url = props.tab === 0 ? k.url : k.cvRel?.url
   if (!url) return
   if (!url) return
   getBlob(url).then(blob => {
   getBlob(url).then(blob => {