Xiao_123 10 months ago
parent
commit
6a38cd040a

+ 4 - 1
src/components/Position/item.vue

@@ -23,7 +23,10 @@
             </div>
             <PublicRecruitment v-if="tab === 3 && item.hire"></PublicRecruitment>
           </div>
-          <v-chip v-if="tab === 3 && item.hire && item.hirePrice" size="small" label class="mr-1" color="primary">赏金:{{ item.hirePrice }}元</v-chip>
+          <div v-if="tab === 3 && item.hire">
+            <v-chip v-if="item.hirePrice" size="small" label class="mr-1" color="primary">赏金:{{ item.hirePrice }}元</v-chip>
+            <v-chip v-if="item.hirePoint" size="small" label class="mr-1" color="primary">积分:{{ item.hirePoint }}点</v-chip>
+          </div>
         </div>
         <div class="sub-li-bottom" @click="handleEnterprise(item)">
           <div class="user-info">

+ 4 - 1
src/components/PositionLongStrip/item.vue

@@ -11,7 +11,10 @@
           <p v-if="item.job.name.indexOf('style')" v-html="item.job.name" :class="['title1', {'default-active': item.positionActive }]"></p>
           <p v-else :class="['title1', {'default-active': item.positionActive }]">{{ item.job.name }}{{ item.job.pos ? ' [' + item.job.pos + '] ' : '' }}</p>
           <p class="salary ml-1">{{ item.job.payFrom }}-{{ item.job.payTo }}/{{ item.job.payName }}</p>
-          <v-chip v-if="item?.job?.hirePrice" class="ml-3" label color="primary" size="small">赏金:{{ item.job.hirePrice }}元</v-chip>
+          <div v-if="item?.job?.hire">
+            <v-chip v-if="item?.job?.hirePrice" class="ml-3" label color="primary" size="small">赏金:{{ item.job.hirePrice }}元</v-chip>
+            <v-chip v-if="item?.job?.hirePoint" class="ml-3" label color="primary" size="small">积分:{{ item.job.hirePoint }}点</v-chip>
+          </div>
         </div>
         <div class="mt-2">
           <v-chip size="x-small" label v-for="(j, i) in desc" :key="i" class="mr-1" color="var(--color-666)" :prepend-icon="j.mdi">{{ item.job[j.value] }}</v-chip>

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

@@ -71,7 +71,7 @@ const handleSave = async () => {
   const requirement = await jobRequirementsRef.value[0].getQuery()
   if (!baseInfo || !requirement) return Snackbar.warning('请将信息填写完整')
   const query = Object.assign(baseInfo, requirement)
-// 有id则为编辑
+  // 有id则为编辑
   if (route.query && route.query.id) query.id = route.query.id
   await saveJobAdvertised(query)
   Snackbar.success(route.query.id ? t('common.editSuccessMsg') : t('common.publishSuccessMsg'))

+ 81 - 6
src/views/recruit/enterprise/positionManagement/components/baseInfo.vue

@@ -35,10 +35,44 @@ const props = defineProps({
   itemData: Object
 })
 
-const handleChangePublic = () => {
-  const value = items.value.options.find(e => e.key === 'hire').value
-  const obj = items.value.options.find(e => e.key === 'hirePrice')
-  obj.hide = value === '1' ? false : true
+const getValue = (key) => {
+  return items.value.options.find(e => e.key === key)
+}
+
+// 众聘奖励类型
+const handleChangeHireType = () => {
+  const hireType = getValue('hireType')
+  let hirePrice = getValue('hirePrice')
+  let hirePoint = getValue('hirePoint')
+  if (hireType.value === '0') {
+    hirePrice.hide = false
+    hirePoint.hide = true
+    hirePoint.value = null
+  } else {
+    hirePoint.hide = false
+    hirePrice.hide = true
+    hirePrice.value = null
+  }
+}
+
+// 是否众聘岗位
+const handleChangePublic = (editHire) => {
+  const hire = getValue('hire').value
+  const hireType = getValue('hireType')
+  const hirePrice = getValue('hirePrice')
+  const hirePoint = getValue('hirePoint')
+  if (editHire && editHire.hire) {
+    hireType.hide = false
+    hireType.value = editHire.hirePoint ? '1' : '0'
+    handleChangeHireType()
+  } else hireType.hide = hire === '1' ? false : true
+  if (hire === '0') {
+    hireType.value = '0'
+    hirePoint.value = null
+    hirePrice.value = null
+    hirePoint.hide = true
+    hirePrice.hide = true
+  }
 }
 
 const formPageRef = ref()
@@ -57,6 +91,20 @@ const items = ref({
       ],
       change: handleChangePublic
     },
+    {
+      type: 'ifRadio',
+      key: 'hireType',
+      value: '0',
+      label: '众聘奖励类型 *',
+      width: 120,
+      hide: true,
+      noParam: true,
+      items: [
+        { label: '赏金', value: '0' },
+        { label: '积分', value: '1' }
+      ],
+      change: handleChangeHireType
+    },
     {
       type: 'number',
       key: 'hirePrice',
@@ -64,7 +112,34 @@ const items = ref({
       label: '众聘赏金 *',
       suffix: '元',
       hide: true,
-      rules: [v => !!v || '请填写众聘赏金']
+      rules: [
+        value => {
+          if (value) return true
+          return '请填写众聘赏金'
+        },
+        value => {
+          if (value >= 1) return true
+          return '赏金金额不得小于1'
+        }
+      ]
+    },
+    {
+      type: 'number',
+      key: 'hirePoint',
+      value: null,
+      label: '众聘奖励积分数 *',
+      suffix: '点',
+      hide: true,
+      rules: [
+        value => {
+          if (value) return true
+          return '请填写众聘众聘奖励积分数'
+        },
+        value => {
+          if (value >= 1) return true
+          return '积分数不得小于1'
+        }
+      ]
     },
     {
       type: 'text',
@@ -152,10 +227,10 @@ watch(
       if (e.noParam) return
       if (e.key === 'hire') {
         e.value = val[e.key] ? '1' : '0'
-        handleChangePublic()
       }
       else e.value = val[e.key]
     })
+    handleChangePublic(val)
   },
   { immediate: true },
   { deep: true }

+ 4 - 3
src/views/recruit/enterprise/positionManagement/components/item.vue

@@ -9,7 +9,7 @@
       </div>
       <v-btn v-if="tab === 2" class="ml-8" :disabled="!selectAll" color="primary" variant="tonal" size="small" @click="handleAction(1, 'activation', {})">{{ $t('common.activation') }}</v-btn>
     </div>
-    <div v-for="val in items" :key="val.id" class="itemBox mb-3" :style="{'height': (val?.hire && val?.hirePrice) ? '162px' : '134px'}">
+    <div v-for="val in items" :key="val.id" class="itemBox mb-3" :style="{'height': val?.hire ? '162px' : '134px'}">
       <div class="d-flex justify-space-between" style="padding: 10px 20px;">
         <div class="position">
           <div class="item-select">
@@ -31,8 +31,9 @@
             <span class="lines"></span>
             <span>{{ val.positionName }}</span>
           </div>
-          <div v-if="val?.hire && val?.hirePrice" class="ml-10 mt-2">
-            <v-chip label color="primary" size="small">赏金:{{ val.hirePrice }}</v-chip>
+          <div v-if="val?.hire" class="ml-10 mt-2">
+            <v-chip v-if="val?.hirePrice" label color="primary" size="small">赏金:{{ val.hirePrice }}元</v-chip>
+            <v-chip v-if="val?.hirePoint" label color="primary" size="small">积分:{{ val.hirePoint }}点</v-chip>
           </div>
         </div>
         <div class="d-flex align-center">

+ 20 - 2
src/views/recruit/enterprise/positionManagement/components/jobRequirements.vue

@@ -77,7 +77,16 @@ const items = ref({
       col: 4,
       label: '最低薪资 *',
       suffix: '元',
-      rules: [v => !!v || '请填写最低薪资'],
+      rules: [
+        value => {
+          if (value) return true
+          return '请填写最低薪资'
+        },
+        value => {
+          if (value >= 1) return true
+          return '数额不得小于1'
+        }
+      ]
     },
     {
       type: 'text',
@@ -87,7 +96,16 @@ const items = ref({
       label: '最高薪资 *',
       flexStyle: 'mx-3',
       suffix: '元',
-      rules: [v => !!v || '请填写最高薪资'],
+      rules: [
+        value => {
+          if (value) return true
+          return '请填写最高薪资'
+        },
+        value => {
+          if (value >= 1) return true
+          return '数额不得小于1'
+        }
+      ]
     },
     {
       type: 'autocomplete',