瀏覽代碼

简历管理:参数与pc端保持统一

Xiao_123 1 月之前
父節點
當前提交
8138d8d438
共有 2 個文件被更改,包括 42 次插入12 次删除
  1. 40 12
      pagesA/resume/item.vue
  2. 2 0
      pagesB/InviteInterview/index.vue

+ 40 - 12
pagesA/resume/item.vue

@@ -40,7 +40,11 @@
 			</view>
 
 			<view class="sub-li-bottom ss-m-t-20">
-				<view class="sub-li-bottom-item color-primary" @tap.stop="handlePreview(val)">查看/下载附件</view>
+				<view
+					class="sub-li-bottom-item color-primary"
+					v-if="(props.current === 0 && val.url) || (props.current !== 0 && val?.cvRel && val?.cvRel?.url)"
+					@tap.stop="handlePreview(val)"
+				>查看/下载附件</view>
 				<view 
 					class="sub-li-bottom-item d-flex align-center justify-center" 
 					@tap.stop="handleLoadMore(val)" 
@@ -60,6 +64,7 @@
 					class="action-item"
 					v-for="(val, index) in actionItems(itemData)" 
 					:key="index"
+					:style="{'color': val?.disabled ? '#ccc' : '#00B760'}"
 					@tap.stop="val.click(itemData)"
 				>{{ val.title }}</view>
 			</view>
@@ -94,12 +99,14 @@ const itemData = ref({})
 
 // 查看在线简历
 const handleDetail = async (val) => {
-	if (!val.userId || !val.id) {
+	const id = props.current === 0 ? val.id : val?.cvRel?.id
+	if (!val.userId || !id) {
 		uni.showToast({ title: '用户ID不存在', icon: 'none' })
 		return
 	}
+	
 	try {
-		const {data } = await personJobCvLook(val.id)
+		const {data } = await personJobCvLook(id)
 		if (data) emit('refresh')
 	} catch {}
 	uni.navigateTo({
@@ -109,19 +116,21 @@ const handleDetail = async (val) => {
 
 // 查看附件
 const handlePreview = async (val) => {
-	if (!val.userId || !val.id) {
+	const id = props.current === 0 ? val.id : val?.cvRel?.id
+	const url = props.current === 0 ? val.url : val?.cvRel?.url
+	if (!val.userId || !id) {
 		uni.showToast({ title: '用户ID不存在', icon: 'none' })
 		return
 	}
-	try {
-		const {data } = await personJobCvLook(val.id)
-		if (data) emit('refresh')
-	} catch {}
-	if (!val.url) {
+	if (!url) {
 		uni.showToast({ title: '附件地址不存在', icon: 'none' })
 		return
 	}
-	preview(val.url)
+	try {
+		const {data } = await personJobCvLook(id)
+		if (data) emit('refresh')
+	} catch {}
+	preview(url)
 }
 
 // 更多操作
@@ -163,8 +172,12 @@ const handleInterviewInvite = (item) => {
 		uni.showToast({ title: '职位已关闭', icon: 'none' })
 		return
 	}
+	if (item.handleStatus) {
+		uni.showToast({ title: '已邀面试', icon: 'none' })
+		return
+	}
 	uni.navigateTo({
-	  url: `/pagesB/InviteInterview/index?id=${item.userId}&jobId=${item.job.id}`
+	  url: `/pagesB/InviteInterview/index?id=${item.userId}&jobId=${item.job.id}&jobCvRelId=${item.id}`
 	})
 	handleClosePopup()
 }
@@ -179,6 +192,7 @@ const handleEliminate = async (item) => {
     bizId: item.id,
     jobId: item.job.id,
     userId: item.userId,
+		jobCvRelId: props.current === 0 ? item.id : item?.cvRel?.id,
     type: props.current === 0 ? '0' : '1' // 投递简历0 已邀约1
   }
 	// 招聘会职位则带id
@@ -280,8 +294,22 @@ const handleEnterByEnterprise = async (item) => {
 }
 
 const actionItems = (item) => {
+	const jobClosed = item.job.status === '1' || false
   const arr = []
-  if (props.current === 0) arr.push({ title: '邀请面试', click: handleInterviewInvite }, { title: '立即沟通', click: handleToCommunicate })
+  if (props.current === 0) {
+		arr.push(
+			{
+				title: jobClosed ? '邀请面试(职位已关闭)' : item.handleStatus ? '邀请面试(已邀面试)' : '邀请面试',
+				disabled: jobClosed || item.handleStatus,
+				click: handleInterviewInvite
+			},
+			{
+				title: jobClosed ? '立即沟通(职位已关闭)' : '立即沟通',
+				disabled: jobClosed,
+				click: handleToCommunicate
+			},
+		)
+  }
   if ([0, 1].includes(props.current)) arr.push({ title: '不合适', click: handleEliminate })
   if (props.current === 4) arr.push({ title: '取消不合适', click: handleCancelEliminate })
   if (props.current === 2 && item?.job?.hire) arr.push({ title: '结算', click: handleSettlement })

+ 2 - 0
pagesB/InviteInterview/index.vue

@@ -133,6 +133,8 @@ onLoad(async (options) => {
 		await getJobList()
 		return
 	}
+	
+	if (options?.jobCvRelId) formData.value.jobCvRelId = options.jobCvRelId
 
 	const { id, jobId } = options
 	if (!id) {