浏览代码

众聘岗位编辑

Xiao_123 10 月之前
父节点
当前提交
6f6ec90b7e

+ 2 - 0
src/components/CtForm/index.vue

@@ -75,6 +75,7 @@
     <slot></slot>
   </v-form>
 </template>
+
 <script setup>
 defineOptions({ name:'components-ct-form'})
 import textUI from './../FormUI/TextInput'
@@ -127,6 +128,7 @@ defineExpose({
   formRef
 })
 </script>
+
 <style lang="scss" scoped>
 .position {
   position: relative;

+ 13 - 2
src/components/FormUI/radioGroup/index.vue

@@ -23,20 +23,31 @@
     ></v-radio>
   </v-radio-group>
 </template>
+
 <script setup>
-import { ref, defineEmits } from 'vue';
-defineOptions({ name:'FormUI-v-text-field'})
+import { ref, defineEmits, watch } from 'vue';
+defineOptions({ name:'FormUI-v-radio-group'})
 
 const props = defineProps({item: Object, modelValue: [String, Number, Boolean]})
 const emit = defineEmits(['update:modelValue', 'change'])
+
 const item = props.item
 const value = ref(props.modelValue)
+
 const modelValueUpDate = (val) => {
   value.value = val
   emit('update:modelValue', value.value)
   emit('change', value.value)
 }
+
+watch(
+  () => props.modelValue,
+  (val) => {
+    value.value = val
+  }
+)
 </script>
+
 <style lang="scss" scoped>
 :deep(.v-input__control) {
   flex-direction: row !important;

+ 2 - 2
src/components/PositionLongStrip/item.vue

@@ -12,8 +12,8 @@
           <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>
           <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>
+            <v-chip v-if="item?.job?.hirePrice && item?.job?.hirePrice > 0" class="ml-3" label color="primary" size="small">赏金:{{ item.job.hirePrice }}元</v-chip>
+            <v-chip v-if="item?.job?.hirePoint && item?.job?.hirePoint > 0" class="ml-3" label color="primary" size="small">积分:{{ item.job.hirePoint }}点</v-chip>
           </div>
         </div>
         <div class="mt-2">

+ 2 - 2
src/layout/company/navBar.vue

@@ -20,8 +20,8 @@
           </div>
           <div class="line"></div>
           <div class="d-flex align-center ml-6">
-            <div>账户余额:{{ enterpriseUserAccount?.balance }}元</div>
-            <div class="ml-5">剩余积分:{{ enterpriseUserAccount?.point }}点</div>
+            <div>账户余额:{{ enterpriseUserAccount?.balance || 0 }}元</div>
+            <div class="ml-5">剩余积分:{{ enterpriseUserAccount?.point || 0 }}点</div>
           </div>
           <div class="line"></div>
           

+ 2 - 2
src/layout/personal/navBar.vue

@@ -40,8 +40,8 @@
             <a target="_blank" href="/mall/purchasePackage" class="cursor-pointer mr-5" style="color: #FB8C00;">{{ $t('vipPackage.purchasePackage') }}</a>
             <span class="cursor-pointer" @click="router.push({ path: '/recruit/personal/TaskCenter' })">{{ $t('sys.signIn') }}</span>
             <span class="cursor-pointer mx-5">{{ $t('sys.news') }}</span>
-            <span>账户余额:{{ userAccount?.balance }}元</span>
-            <span class="ml-5">剩余积分:{{ userAccount?.point }}点</span>
+            <span>账户余额:{{ userAccount?.balance || 0 }}元</span>
+            <span class="ml-5">剩余积分:{{ userAccount?.point || 0 }}点</span>
             <v-menu open-on-hover>
               <template v-slot:activator="{ props }">
                 <div class="d-flex ml-5 pl-2 align-center cursor-pointer" v-bind="props" @click="handleToPersonalCenter">

+ 1 - 1
src/views/publicRecruitment/components/table.vue

@@ -34,7 +34,7 @@ const headers = [
   { title: '应聘公司', key: 'enterpriseName', value: item => item?.enterprise?.name, sortable: false },
   { title: '应聘职位', key: 'job', value: item => item?.job?.name, sortable: false },
   { title: '岗位薪资', key: 'salary', value: item => `${item?.job?.payFrom}-${item?.job?.payTo}`, sortable: false },
-  { title: '赏金', key: 'hirePrice', value: item => item?.job.hirePrice, sortable: false },
+  { title: '赏金', key: 'hirePrice', value: item => item?.job?.hirePrice && item?.job?.hirePrice > 0 ? item.job.hirePrice : '', sortable: false },
   { title: '推荐时间', key: 'createTime', value: item => timesTampChange(item.createTime), sortable: false },
 ]
 

+ 34 - 37
src/views/recruit/enterprise/positionManagement/components/baseInfo.vue

@@ -45,7 +45,7 @@ const handleChangeHireType = () => {
   const hireType = getValue('hireType')
   let hirePrice = getValue('hirePrice')
   let hirePoint = getValue('hirePoint')
-  if (hireType.value === '0') {
+  if (hireType.value) {
     hirePrice.hide = false
     hirePoint.hide = true
     hirePoint.value = null
@@ -57,41 +57,43 @@ const handleChangeHireType = () => {
 }
 
 // 是否众聘岗位
-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 handleChangePublic = (val) => {
+  let hireType
+  items.value.options.forEach(e => {
+    if (!val && Object.prototype.hasOwnProperty.call(e, 'hide')) {
+      e.hide = true
+      e.value = null
+      return
+    }
+    if (e.key === 'hireType') {
+      e.hide = !val
+      e.value = props.itemData && props.itemData.hirePoint ? false : true
+      hireType = e
+    }
+    if (Object.prototype.hasOwnProperty.call(e, 'show')) {
+      if (hireType.value === e.show) e.hide = false
+      return
+    }
+  })
 }
 
 const formPageRef = ref()
 let query = reactive({})
+
 const items = ref({
   options: [
     {
       type: 'ifRadio',
       key: 'hire',
-      value: '0',
+      value: false,
       label: '众聘岗位 *',
       width: 90,
       hideDetails: true,
       items: [
-        { label: '是', value: '1' },
-        { label: '否', value: '0' }
+        { label: '是', value: true },
+        { label: '否', value: false }
       ],
-      change: handleChangePublic
+      change: val => handleChangePublic(val)
     },
     {
       slotName: 'explain',
@@ -101,14 +103,14 @@ const items = ref({
     {
       type: 'ifRadio',
       key: 'hireType',
-      value: '0',
+      value: null,
       label: '众聘奖励类型 *',
       width: 120,
       hide: true,
       noParam: true,
       items: [
-        { label: '赏金', value: '0' },
-        { label: '积分', value: '1' }
+        { label: '赏金', value: true },
+        { label: '积分', value: false }
       ],
       change: handleChangeHireType
     },
@@ -119,6 +121,7 @@ const items = ref({
       label: '众聘赏金 *',
       suffix: '元',
       hide: true,
+      show: true,
       rules: [
         value => {
           if (value) return true
@@ -137,6 +140,7 @@ const items = ref({
       label: '众聘奖励积分数 *',
       suffix: '点',
       hide: true,
+      show: false,
       rules: [
         value => {
           if (value) return true
@@ -216,10 +220,6 @@ const items = ref({
   ]
 })
 
-const setValue = (key, value) => {
-  items.value.options.find(e => e.key === key).value = value
-}
-
 // 编辑回显
 watch(
   () => props.itemData,
@@ -232,12 +232,9 @@ watch(
         return
       }
       if (e.noParam) return
-      if (e.key === 'hire') {
-        e.value = val[e.key] ? '1' : '0'
-      }
-      else e.value = val[e.key]
+      e.value = val[e.key]
+      e.change && e.change(e.value)
     })
-    handleChangePublic(val)
   },
   { immediate: true },
   { deep: true }
@@ -245,13 +242,14 @@ watch(
 
 // 职位类型
 const handleJobClickItem = (list, name) => {
+  const positionId = getValue('positionId')
   if (!list.length) {
     delete query.positionId
-    setValue('positionId', '')
+    positionId.value = ''
     return
   }
   query.positionId = list[0]
-  setValue('positionId', name)
+  positionId.value = name
 }
 
 const getQuery = async () => {
@@ -260,7 +258,6 @@ const getQuery = async () => {
   const obj = {}
   items.value.options.forEach(e => {
     if (e.noParam) return
-    if (e.key === 'hire') obj[e.key] = e.value === '1' ? true : false
     else obj[e.key] = e.value
   })
   query = Object.assign(query, obj)

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

@@ -32,8 +32,8 @@
             <span>{{ val.positionName }}</span>
           </div>
           <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>
+            <v-chip v-if="val?.hirePrice && val.hirePrice > 0" class="mr-3" label color="primary" size="small">赏金:{{ val.hirePrice }}元</v-chip>
+            <v-chip v-if="val?.hirePoint && val.hirePoint > 0" label color="primary" size="small">积分:{{ val.hirePoint }}点</v-chip>
           </div>
         </div>
         <div class="d-flex align-center">

+ 2 - 2
src/views/recruit/personal/position/components/details.vue

@@ -20,8 +20,8 @@
       </div>
       <div class="d-flex justify-space-between mb-5">
         <div>
-          <v-chip v-if="info.hire && info.hirePrice" label color="primary">赏金:{{ info.hirePrice }}元</v-chip>
-          <v-chip v-if="info.hire && info.hirePoint" label color="primary">积分:{{ info.hirePoint }}点</v-chip>
+          <v-chip v-if="info.hire && info.hirePrice && info.hirePrice > 0" label color="primary">赏金:{{ info.hirePrice }}元</v-chip>
+          <v-chip v-if="info.hire && info.hirePoint && info.hirePoint > 0" label color="primary">积分:{{ info.hirePoint }}点</v-chip>
         </div>
         <div class="banner-tools-btns">
           <v-btn