Xiao_123 7 mesiacov pred
rodič
commit
75ed710418

+ 3 - 3
src/views/recruit/enterprise/hirePosition/components/add.vue

@@ -70,17 +70,17 @@ const handleSave = async () => {
   const baseInfo = await baseInfoRef.value[0].getQuery()
   if (baseInfo === 'failed') return
   const requirement = await jobRequirementsRef.value[0].getQuery()
-  if (!baseInfo.expireTime) {
-    Snackbar.warning('请选择职位过期时间')
+  if (!baseInfo.expireTime || !baseInfo.hirePrice) {
+    Snackbar.warning('请将必填项填写完整')
     window.scrollTo({ top: 0, behavior: 'smooth' })
     return
   }
+  if (!requirement?.areaId) return Snackbar.warning('请选择工作城市')
   if (!baseInfo || !requirement) return Snackbar.warning('请将信息填写完整')
   
   submitParams = Object.assign(baseInfo, requirement, { currency_type: 0 }) // currency_type: 写死0(人民币)
   if (route.query && route.query.id) submitParams.id = route.query.id // 有id则为编辑
 
-  if (!baseInfo.hirePrice) return Snackbar.warning('请填写点数!')
   saveEmit(submitParams) // 正常发布,到列表中发起支付(暂定解决方案)
 }
 

+ 1 - 1
src/views/recruit/enterprise/hirePosition/components/baseInfo.vue

@@ -78,7 +78,7 @@ const items = ref({
       type: 'number',
       key: 'hirePrice',
       value: null,
-      label: '请填写点数 (1赏金=10点数,点数填入不得少于10且为10的倍数)',
+      label: '请填写点数 * (1赏金=10点数,点数填入不得少于10且为10的倍数)',
       suffix: '点',
       hideDetails: true,
       change: val => hirePriceChange(val, 'hirePrice')

+ 6 - 48
src/views/recruit/enterprise/hirePosition/components/jobRequirements.vue

@@ -56,7 +56,6 @@ defineOptions({ name: 'position-add-job-requirements'})
 import CtForm from '@/components/CtForm'
 import { reactive, ref, watch } from 'vue'
 import { getDict } from '@/hooks/web/useDictionaries'
-import { cityToProvince } from '@/utils/areaDeal'
 import { getTagTreeDataApi } from '@/api/enterprise'
 
 const props = defineProps({
@@ -164,33 +163,15 @@ const items = ref({
       items: []
     },
     {
-      type: 'autocomplete',
-      key: 'workAreaProvinceId',
-      value: null,
-      label: '工作城市:省 *',
-      outlined: true,
-      itemText: 'name',
-      itemValue: 'id',
-      returnSelect: true,
-      noParam: true,
-      col: 6,
-      flexStyle: 'mr-3',
-      rules: [v => !!v || '请选择工作城市:省'],
-      items: [],
-      change: null
-    },
-    {
-      type: 'autocomplete',
+      type: 'cascade',
       key: 'areaId',
       value: null,
-      label: '工作城市:市 *',
-      outlined: true,
+      default: null,
+      label: '工作城市 *',
       itemText: 'name',
       itemValue: 'id',
-      col: 6,
-      rules: [v => !!v || '请选择工作城市:市'],
+      clearable: false,
       items: [],
-      change: null
     },
     {
       type: 'text',
@@ -225,25 +206,13 @@ const getDictData = async () => {
   })
 }
 
-const provinceChange = (value, val, obj) => {
-  const item = items.value.options.find(e => e.key === 'areaId')
-  if (!item) return
-  item.items = obj.children || []
-  item.value = null
-}
 getDict('areaTreeData', null, 'areaTreeData').then(({ data }) => {
   data = data?.length && data || []
   if (!data?.length) return console.error('areaTreeData获取失败!')
-  // const china = data.find(e => e.id === '1')
-  // const chinaTreeData = china?.children?.length ? china.children : []
   const chinaTreeData = data
-  //
   if (!chinaTreeData?.length) return console.error('chinaTreeData获取失败!')
-  const item = items.value.options.find(e => e.key === 'workAreaProvinceId')
-  if (item?.items) {
-    item.items = chinaTreeData
-    item.change = provinceChange
-  }
+  const item = items.value.options.find(e => e.key === 'areaId')
+  if (item?.items) item.items = chinaTreeData
 })
 
 const getQuery = async () => {
@@ -268,7 +237,6 @@ watch(
     await getDictData()
     if (!Object.keys(val).length) return
     // 编辑
-    let workAreaId = ''
     items.value.options.forEach(e => {
       if (e.labelKey) {
         query[e.key] = val[e.key]
@@ -277,20 +245,10 @@ watch(
       }
       if (e.noParam) return
       e.value = val[e.key]
-      if (e.key === 'areaId' && val[e.key]) workAreaId = val[e.key]
       if (e.key === 'tagList' && val[e.key] && val[e.key].length) {
         tag.value = val[e.key] && val[e.key].length ? val[e.key] : []
       }
     })
-    if (workAreaId) { // 省份回显
-      const province = items.value.options.find(pv => pv.key === 'workAreaProvinceId')
-      if (province) {
-        const dealReturnObj = await cityToProvince(workAreaId, {}, province.items || [])
-        const city = items.value.options.find(pv => pv.key === 'areaId')
-        if (city) city.items = dealReturnObj.cityList || []
-        province.value = dealReturnObj.pid || ''
-      }
-    }
   },
   { immediate: true },
   { deep: true }

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

@@ -75,6 +75,7 @@ const handleSave = async () => {
     window.scrollTo({ top: 0, behavior: 'smooth' })
     return
   }
+  if (!requirement?.areaId) return Snackbar.warning('请选择工作城市')
   if (!baseInfo || !requirement) return Snackbar.warning('请将信息填写完整')
   
   submitParams = Object.assign(baseInfo, requirement, { currency_type: 0 }) // currency_type: 写死0(人民币)

+ 6 - 48
src/views/recruit/enterprise/positionManagement/components/jobRequirements.vue

@@ -56,7 +56,6 @@ defineOptions({ name: 'position-add-job-requirements'})
 import CtForm from '@/components/CtForm'
 import { reactive, ref, watch } from 'vue'
 import { getDict } from '@/hooks/web/useDictionaries'
-import { cityToProvince } from '@/utils/areaDeal'
 import { getTagTreeDataApi } from '@/api/enterprise'
 
 const props = defineProps({
@@ -164,33 +163,15 @@ const items = ref({
       items: []
     },
     {
-      type: 'autocomplete',
-      key: 'workAreaProvinceId',
-      value: null,
-      label: '工作城市:省 *',
-      outlined: true,
-      itemText: 'name',
-      itemValue: 'id',
-      returnSelect: true,
-      noParam: true,
-      col: 6,
-      flexStyle: 'mr-3',
-      rules: [v => !!v || '请选择工作城市:省'],
-      items: [],
-      change: null
-    },
-    {
-      type: 'autocomplete',
+      type: 'cascade',
       key: 'areaId',
       value: null,
-      label: '工作城市:市 *',
-      outlined: true,
+      default: null,
+      label: '工作城市 *',
       itemText: 'name',
       itemValue: 'id',
-      col: 6,
-      rules: [v => !!v || '请选择工作城市:市'],
+      clearable: false,
       items: [],
-      change: null
     },
     {
       type: 'text',
@@ -225,25 +206,13 @@ const getDictData = async () => {
   })
 }
 
-const provinceChange = (value, val, obj) => {
-  const item = items.value.options.find(e => e.key === 'areaId')
-  if (!item) return
-  item.items = obj.children || []
-  item.value = null
-}
 getDict('areaTreeData', null, 'areaTreeData').then(({ data }) => {
   data = data?.length && data || []
   if (!data?.length) return console.error('areaTreeData获取失败!')
-  // const china = data.find(e => e.id === '1')
-  // const chinaTreeData = china?.children?.length ? china.children : []
   const chinaTreeData = data
-  //
   if (!chinaTreeData?.length) return console.error('chinaTreeData获取失败!')
-  const item = items.value.options.find(e => e.key === 'workAreaProvinceId')
-  if (item?.items) {
-    item.items = chinaTreeData
-    item.change = provinceChange
-  }
+  const item = items.value.options.find(e => e.key === 'areaId')
+  if (item?.items) item.items = chinaTreeData
 })
 
 const getQuery = async () => {
@@ -268,7 +237,6 @@ watch(
     await getDictData()
     if (!Object.keys(val).length) return
     // 编辑
-    let workAreaId = ''
     items.value.options.forEach(e => {
       if (e.labelKey) {
         query[e.key] = val[e.key]
@@ -277,20 +245,10 @@ watch(
       }
       if (e.noParam) return
       e.value = val[e.key]
-      if (e.key === 'areaId' && val[e.key]) workAreaId = val[e.key]
       if (e.key === 'tagList' && val[e.key] && val[e.key].length) {
         tag.value = val[e.key] && val[e.key].length ? val[e.key] : []
       }
     })
-    if (workAreaId) { // 省份回显
-      const province = items.value.options.find(pv => pv.key === 'workAreaProvinceId')
-      if (province) {
-        const dealReturnObj = await cityToProvince(workAreaId, {}, province.items || [])
-        const city = items.value.options.find(pv => pv.key === 'areaId')
-        if (city) city.items = dealReturnObj.cityList || []
-        province.value = dealReturnObj.pid || ''
-      }
-    }
   },
   { immediate: true },
   { deep: true }

+ 0 - 1
src/views/recruit/personal/PersonalCenter/resume/online/components/jobIntention.vue

@@ -192,7 +192,6 @@ const items = ref({
       key: 'interestedAreaIdList',
       value: '',
       placeholder: '其它感兴趣的城市'
-      // label: '其它感兴趣的城市'
     }
   ]
 })