Browse Source

企业-职位管理:列表可查看招聘会职位,操作按钮只有查看详情可用

Xiao_123 8 hours ago
parent
commit
8ecef9189c

+ 13 - 15
components/PositionList/index.vue

@@ -14,16 +14,16 @@
           <!-- 职位 -->
           <view class="titleBox my-5">
             <view style="display: flex;align-items: center;">
-              <image v-if="item.jobFairIds?.length" src="/static/svg/jobFair.svg" class=" ss-m-r-10" style="width: 20px; height: 20px;"></image>
+              <image v-if="item.jobFairName" src="/static/svg/jobFair.svg" class=" ss-m-r-10" style="width: 20px; height: 20px;"></image>
               <rich-text v-if="item.name?.indexOf('style') !== -1" class="job-name" :nodes="item.name"></rich-text>
               <view v-else class="job-name">{{ formatName(item.name) }}</view>
             </view>
             <image v-if="item.top && tab === 1" src="/static/svg/topUp.svg" class="TopUpSvg"></image>
           </view>
           <!-- 职位类型 -->
-          <view class="font-size-13 ellipsis ss-m-5" style="color: #808080;">
+          <!-- <view class="font-size-13 ellipsis ss-m-5" style="color: #808080;">
             <span>{{item.positionName }}</span>
-          </view>
+          </view> -->
           <!-- 薪酬、工作地、学历、工作经验 -->
           <view class="d-flex align-center justify-space-between">
             <view class="font-size-13 ellipsis" style="flex: 1;">
@@ -38,10 +38,12 @@
               </span>
             </view>
           </view>
-          <view class="d-flex font-size-13 color-666 ss-m-t-10">
-            <!-- <view class="ss-m-t-10 ss-m-r-15">到期时间:{{ item.expireTime ? timesTampChange(item.expireTime, 'Y-M-D') : '长期有效' }}</view> -->
+          <view class="d-flex font-size-13 color-666">
             <view class="ss-m-t-10" v-if="tab !== 0">刷新时间:{{ item.refreshTime ? timesTampChange(item.refreshTime, 'Y-M-D h:m') : '暂无' }}</view>
           </view>
+          <view v-if="item.jobFairName" class="font-size-13 color-primary ss-m-t-10">
+            招聘会:{{ item.jobFairName }}
+          </view>
           <view class="sub-li-bottom ss-m-t-20">
             <view 
               v-if="tab === 0 && jobNum && +jobNum > 0" 
@@ -143,25 +145,20 @@ const handleDelete = async (val) => {
 const payRef = ref()
 // 支付
 const toPay = async (val) => {
-  // 待发布且有额度的激活职位即可
-  // if (userInfo.value.entitlement?.publishJobCount > 0) {
-  //   await enableJobAdvertised([val.id])
-  //   emit('refresh', { reset: true, updatePublishJobCount: true })
-  //   setTimeout(() => { uni.showToast({ title: '发布成功', icon: 'success' }) }, 1000)
-  //   return
-  // }
   payRef.value && payRef.value.handleOpen({ spuId: val?.id||'', spuName: val?.name||'', price: 1, type: 1 })
 }
 
-// setTimeout(() => { toPay(props.list[0]) }, 2000)
-
 const confirm = ref()
 const confirmType = ref('closeJob') // 确认框类型
 const dialogContent = ref('')
 let handleActionInfo = {}
 const apiList = [closeJobAdvertised, enableJobAdvertised, refreshJobAdvertised, topJobAdvertised, topJobAdvertisedCancel]
 // 职位关闭、激活、刷新、置顶
-const handleAction = async (index, type, { id }, item) => {
+const handleAction = async (index, type, { id, jobFairName }, item) => {
+  if (jobFairName) {
+    uni.showToast({ title: '该职位属于招聘会,请前往招聘会内进行操作', icon: 'none', duration: 2000 })
+    return
+  }
   const ids = type ? [] : [id]
   if (!ids?.length && !index) return
   try {
@@ -244,6 +241,7 @@ const closeJob = async () => {
 const handleDetail = (item) => {
   if (!item.id) return
   let url = `/pagesB/positionDetail/index?jobId=${item.id}&isEdit=${item.edit}`
+  if (item.jobFairName) url += `&jobFairId=${item.jobFairId}&fairNoEdit=true`
   uni.navigateTo({ url })
 }
 

+ 2 - 0
pages/index/jobFair.vue

@@ -8,6 +8,7 @@
           <scroll-view class="scrollBox" :scroll-y="true" @scrolltolower="loadingMore" style="position:relative;">
             <view v-for="val in items" :key="val.id" @tap="handleToJobFairEnterprises(val)" class="list-item default-border">
               <image v-if="val?.previewImg" class="ss-m-t-10" :src="val.previewImg" mode="widthFix" style="width: 100%; height: auto; border-radius: 6px;"></image>
+			        <view class="ss-m-t-20">活动主题:{{ val.title }}</view>
               <view class="ss-m-t-20 ss-m-b-10">
                 活动状态:
                 <span class="font-weight-bold" :style="{'color': val.status === '0' ? '#00b760' : '#ff5252'}">
@@ -164,6 +165,7 @@ const paySuccess = () => {
 .scrollBox {
 	height: 100vh;
 	box-sizing: border-box;
+	padding-bottom: 100px;
 }
 .list-item {
   margin: 0 30rpx 30rpx 30rpx;

+ 3 - 10
pages/index/position.vue

@@ -72,8 +72,7 @@ onLoad((options) => {
 const tabList = [
   { label: '待发布', value: 0, status: 99 },
   { label: '招聘中', value: 1, status: 0 },
-  { label: '已关闭', value: 2, status: 1 },
-  // { label: '到期职位', value: 3 }
+  { label: '已关闭', value: 2, status: 1 }
 ]
 const controlList = tabList.map(e => e.label)
 
@@ -86,10 +85,10 @@ const tabChange = (e) => {
 const total = ref(0)
 const positionListData = ref([])
 const query = ref({
-  pageSize: 5, 
+  pageSize: 10, 
   pageNo: 1,
   hire: false,
-  jobFairId: 0,
+  // jobFairId: 0,
   name: '',
 })
 const more = ref('more')
@@ -99,13 +98,7 @@ const getData = async () => {
   if (query.value.pageNo === 1) positionListData.value = []
   try {
     more.value = 'loading'
-    // if (tab.value !== 3) {
     query.value.status = tabList[tab.value].status
-      // query.value.hasExpiredData = false
-    // } else {
-    //   query.value.hasExpiredData = true
-    //   delete query.value.status
-    // }
     const res = await getJobAdvertisedList(query.value)
     const list = res?.data?.list?.length ? res.data.list : []
     total.value = res.data.total-0

+ 22 - 5
pagesB/positionDetail/index.vue

@@ -12,7 +12,10 @@
             </view>
             <image v-if="isJobFair" src="/static/svg/jobFair.svg" class="ss-m-r-10" style="width: 30px; height: 30px;"></image>
             <!-- 职位名称 -->
-            <h2 class="JobName" style="flex: 1;">{{ formatName(info.name) }}</h2>
+            <h2 class="JobName" style="flex: 1;">
+              {{ formatName(info.name) }}
+              <span v-if="info?.status === '1'" class="color-error">(职位已关闭)</span>
+            </h2>
           </view>
           <!-- 职位地区 -->
           <view class="d-flex justify-space-between mt-5 align-center">
@@ -77,7 +80,12 @@
     </scroll-view>
     <view class="bottom-sticky" v-if="!loading && jobId">
       <view class="bottom-content">
-        <button class="buttons btnStyle ss-m-l-15" type="primary" @click="handleEdit">编辑职位</button>
+        <button
+          v-if="info?.status === '0'"
+          class="buttons btnStyle ss-m-l-15"
+          type="primary"
+          @click="handleEdit"
+        >编辑职位</button>
       </view>
     </view>
   </layout-page>
@@ -113,6 +121,7 @@ let jobId = ''
 const isJobFair = ref(false)
 let obj = {}
 const isEdit = ref(false)
+const fairNoEdit = ref(false)
 onLoad(async (options) => {
   jobId = options?.id || options?.jobId || obj?.jobId || ''
   
@@ -120,6 +129,9 @@ onLoad(async (options) => {
   if (options?.jobFairId) isJobFair.value = true
   // 职位是否可编辑
   if (options?.isEdit && options?.isEdit === 'true') isEdit.value = true
+  
+  // 发布中的招聘会是否可编辑
+  if (options?.fairNoEdit) fairNoEdit.value = true
 
   if (jobId) {
     loading.value = true
@@ -161,9 +173,14 @@ const handleEdit = async () => {
     return
   }
   // 已关闭的招聘会职位不支持编辑
-  if (isJobFair.value && info.value.status === '1') {
-    uni.showToast({ title: '职位已关闭', icon: 'none', duration: 2000 })
-    return
+  // if (isJobFair.value && info.value.status === '1') {
+  //   uni.showToast({ title: '职位已关闭', icon: 'none', duration: 2000 })
+  //   return
+  // }
+  // 发布中的招聘会职位需进入招聘会中进行编辑
+  if (fairNoEdit.value) {
+	uni.showToast({ title: '该职位属于招聘会职位,请前往招聘会中进行编辑', icon: 'none', duration: 2000 })
+	return
   }
   uni.showLoading({ title: '加载中 . . . ' })
   try {