|
@@ -1,6 +1,13 @@
|
|
<template>
|
|
<template>
|
|
<view class="f-straight wrapper">
|
|
<view class="f-straight wrapper">
|
|
<uni-forms ref="form" :modelValue="formData" :rules="rules" validateTrigger="bind" label-width="90px" label-align="right">
|
|
<uni-forms ref="form" :modelValue="formData" :rules="rules" validateTrigger="bind" label-width="90px" label-align="right">
|
|
|
|
+ <template v-if="!props.isFair && jobFairLIst?.length">
|
|
|
|
+ <!-- 设置为招聘会职位 -->
|
|
|
|
+ <uni-forms-item label="招聘会" name="bizId" >
|
|
|
|
+ <uni-data-picker class="picker" popup-title="请选择招聘会" v-model="formData.bizId" :localdata="jobFairLIst" :clear-icon="false" :map="{ text: 'title', value: 'id'}"></uni-data-picker>
|
|
|
|
+ <view style="color: #777; font-size: 12px;" class="ss-m-t-8 ss-m-l-10">职位会在对应的招聘会显示</view>
|
|
|
|
+ </uni-forms-item>
|
|
|
|
+ </template>
|
|
<uni-forms-item label="职位类型" name="positionId" required>
|
|
<uni-forms-item label="职位类型" name="positionId" required>
|
|
<view class="positionTemplate">
|
|
<view class="positionTemplate">
|
|
<uni-data-picker class="picker" popup-title="请选择职位类型" v-model="formData.positionId" :localdata="dictObj?.positionTreeData || []" :clear-icon="false" :map="{ text: 'nameCn', value: 'id'}"></uni-data-picker>
|
|
<uni-data-picker class="picker" popup-title="请选择职位类型" v-model="formData.positionId" :localdata="dictObj?.positionTreeData || []" :clear-icon="false" :map="{ text: 'nameCn', value: 'id'}"></uni-data-picker>
|
|
@@ -19,10 +26,10 @@
|
|
</view>
|
|
</view>
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
<uni-forms-item label="岗位职责" name="content" required>
|
|
<uni-forms-item label="岗位职责" name="content" required>
|
|
- <RichEditor ref="contentRef" :richValue="formData.content" @blur="val => editorBlur('content', val)" :max="1500" />
|
|
|
|
|
|
+ <RichEditor ref="contentRef" :richValue="formData.content" @blur="val => editorBlur('content', val)" :max="5000" />
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
<uni-forms-item label="岗位要求 " name="requirement" required>
|
|
<uni-forms-item label="岗位要求 " name="requirement" required>
|
|
- <RichEditor ref="requirementRef" :richValue="formData.requirement" @blur="val => editorBlur('requirement', val)" :max="1500" />
|
|
|
|
|
|
+ <RichEditor ref="requirementRef" :richValue="formData.requirement" @blur="val => editorBlur('requirement', val)" :max="5000" />
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
</uni-forms>
|
|
</uni-forms>
|
|
<!-- 确认框 -->
|
|
<!-- 确认框 -->
|
|
@@ -45,15 +52,21 @@ import { dictObj } from '@/utils/position.js'
|
|
import { getNextDate } from '@/utils/date'
|
|
import { getNextDate } from '@/utils/date'
|
|
import { getRecruitPositionDetails } from '@/api/new/position'
|
|
import { getRecruitPositionDetails } from '@/api/new/position'
|
|
import { dateToTimestamp } from '@/utils/date.js'
|
|
import { dateToTimestamp } from '@/utils/date.js'
|
|
|
|
+import { getJobFairWhiteList } from '@/api/jobFair'
|
|
import RichEditor from '@/components/RichEditor'
|
|
import RichEditor from '@/components/RichEditor'
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
data: {
|
|
data: {
|
|
type: Object,
|
|
type: Object,
|
|
default: () => {}
|
|
default: () => {}
|
|
|
|
+ },
|
|
|
|
+ isFair: {
|
|
|
|
+ type: Boolean,
|
|
|
|
+ default: false
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
const formData = ref({
|
|
const formData = ref({
|
|
|
|
+ bizId: props.data?.bizId || '',
|
|
positionId: props.data?.positionId || '',
|
|
positionId: props.data?.positionId || '',
|
|
name: props.data?.name || '', // + new Date().getTime().toString()
|
|
name: props.data?.name || '', // + new Date().getTime().toString()
|
|
expireTime: props.data?.expireTime || getNextDate(15, 'YYYY-MM-DD', 'day'),
|
|
expireTime: props.data?.expireTime || getNextDate(15, 'YYYY-MM-DD', 'day'),
|
|
@@ -73,6 +86,9 @@ const expireTimeChange = (e) => {
|
|
}
|
|
}
|
|
|
|
|
|
const rules = {
|
|
const rules = {
|
|
|
|
+ positionId:{
|
|
|
|
+ rules: [{required: true, errorMessage: '请选择职位类型' }]
|
|
|
|
+ },
|
|
positionId:{
|
|
positionId:{
|
|
rules: [{required: true, errorMessage: '请选择职位类型' }]
|
|
rules: [{required: true, errorMessage: '请选择职位类型' }]
|
|
},
|
|
},
|
|
@@ -94,6 +110,15 @@ const editorBlur = (key, val) => {
|
|
formData.value[key] = val || ''
|
|
formData.value[key] = val || ''
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// 获取企业已加入的招聘会列表
|
|
|
|
+const jobFairLIst = ref(false)
|
|
|
|
+const getJobFairData = async () => {
|
|
|
|
+ if (props.isFair) return
|
|
|
|
+ const res = await getJobFairWhiteList()
|
|
|
|
+ jobFairLIst.value = res?.data || []
|
|
|
|
+}
|
|
|
|
+getJobFairData()
|
|
|
|
+
|
|
const pushTemplate = () => {
|
|
const pushTemplate = () => {
|
|
formData.value.content = jobTemplateRes.value.content
|
|
formData.value.content = jobTemplateRes.value.content
|
|
formData.value.requirement = jobTemplateRes.value.requirement
|
|
formData.value.requirement = jobTemplateRes.value.requirement
|
|
@@ -121,7 +146,7 @@ const useJobTemplate = async () => {
|
|
if (!formData.value.positionId) return Snackbar.warning('请先选择职位类型')
|
|
if (!formData.value.positionId) return Snackbar.warning('请先选择职位类型')
|
|
// 获取职位模板内容-赋值
|
|
// 获取职位模板内容-赋值
|
|
const res = await getRecruitPositionDetails(formData.value.positionId)
|
|
const res = await getRecruitPositionDetails(formData.value.positionId)
|
|
- if (!res?.data || !res.data .content || !res.data .requirement) {
|
|
|
|
|
|
+ if (!res?.data || !res.data .content || !res.data.requirement) {
|
|
uni.showToast({ title: '此职位类型没有可使用的模板!', icon: 'none', duration: 2000 })
|
|
uni.showToast({ title: '此职位类型没有可使用的模板!', icon: 'none', duration: 2000 })
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -150,9 +175,7 @@ const getQuery = async () => {
|
|
...formData.value
|
|
...formData.value
|
|
}
|
|
}
|
|
|
|
|
|
- // obj.contentLength = contentRef.value?.currentWordCount || 0
|
|
|
|
- // obj.requirementLength = requirementValid.value?.currentWordCount || 0
|
|
|
|
-
|
|
|
|
|
|
+ obj.source = obj.bizId ? '2' : '0' // 职位来源(0职位管理|1众聘职位|2招聘会)
|
|
obj.expireTime = obj.soFar ? null : dateToTimestamp(obj.expireTime)
|
|
obj.expireTime = obj.soFar ? null : dateToTimestamp(obj.expireTime)
|
|
obj && Object.keys(obj).length && Object.keys(obj).forEach(key => { if (['areaId', 'eduType', 'expType'].includes(key) && obj[key] === -1) obj[key] = null })
|
|
obj && Object.keys(obj).length && Object.keys(obj).forEach(key => { if (['areaId', 'eduType', 'expType'].includes(key) && obj[key] === -1) obj[key] = null })
|
|
return obj
|
|
return obj
|
|
@@ -174,7 +197,8 @@ defineExpose({
|
|
}
|
|
}
|
|
|
|
|
|
:deep(.uni-forms-item__content) {
|
|
:deep(.uni-forms-item__content) {
|
|
- max-width: 100%;
|
|
|
|
- overflow: hidden;
|
|
|
|
|
|
+ width: 100% !important;
|
|
|
|
+ overflow: hidden !important;
|
|
}
|
|
}
|
|
|
|
+
|
|
</style>
|
|
</style>
|