发布岗位新增字段
This commit is contained in:
@@ -76,6 +76,18 @@
|
||||
<view class="picker-text" data-placeholder="请选择学历要求">{{ selectedEducation || '请选择学历要求' }}</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="form-group">
|
||||
<view class="label">人员类型</view>
|
||||
<picker
|
||||
mode="selector"
|
||||
:range="staffTypes"
|
||||
range-key="label"
|
||||
@change="onStaffTypeChange"
|
||||
class="picker"
|
||||
>
|
||||
<view class="picker-text" data-placeholder="请选择人员类型">{{ selectedStaffType || '请选择人员类型' }}</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="form-group">
|
||||
<view class="label">工作经验</view>
|
||||
<picker
|
||||
@@ -302,6 +314,7 @@ const formData = reactive({
|
||||
jobLocationAreaCode: '', // 新增:工作地点区县字典代码
|
||||
education: '', // 新增:学历要求字典值
|
||||
experience: '', // 新增:工作经验字典值
|
||||
staffType: '', // 新增:人员类型
|
||||
images: [], // 新增:岗位图片
|
||||
contacts: [
|
||||
{
|
||||
@@ -324,6 +337,7 @@ const experienceLevels = ref([]);
|
||||
const workDistricts = ref([]);
|
||||
const workLocations = ref([]);
|
||||
const jobCategories = ref([]); // 新增:岗位分类选项
|
||||
const staffTypes = ref([]); // 新增:人员类型选项
|
||||
|
||||
// 选中的值
|
||||
const selectedEducation = ref('');
|
||||
@@ -333,6 +347,7 @@ const selectedWorkLocation = ref('');
|
||||
const selectedJobCategory = ref('');
|
||||
const selectedJobTypeLabel = ref(''); // 新增:岗位类型显示文本
|
||||
const selectedJobTypeIds = ref(''); // 新增:岗位类型ID(多个用逗号分隔)
|
||||
const selectedStaffType = ref(''); // 新增:人员类型显示文本
|
||||
|
||||
// 滚动视图高度
|
||||
const scrollViewHeight = ref('calc(100vh - 200rpx)');
|
||||
@@ -451,6 +466,11 @@ const initFormData = async () => {
|
||||
}
|
||||
console.log('岗位分类选项:', jobCategories.value);
|
||||
|
||||
// 设置人员类型选项 - 从字典获取 staffType
|
||||
const staffTypeDict = await dictStore.getDictSelectOption('staff_type');
|
||||
console.log('从字典获取的人员类型数据:', staffTypeDict);
|
||||
staffTypes.value = staffTypeDict;
|
||||
|
||||
// 设置企业ID(从用户信息获取)
|
||||
if (userStore.userInfo && userStore.userInfo.id) {
|
||||
formData.companyId = userStore.userInfo.id;
|
||||
@@ -512,6 +532,14 @@ const onJobCategoryChange = (e) => {
|
||||
formData.type = selectedItem.value; // 岗位分类保存到type字段
|
||||
};
|
||||
|
||||
// 新增:人员类型选择器change事件
|
||||
const onStaffTypeChange = (e) => {
|
||||
const index = e.detail.value;
|
||||
const selectedItem = staffTypes.value[index];
|
||||
selectedStaffType.value = selectedItem.label;
|
||||
formData.staffType = selectedItem.value; // 人员类型保存到staffType字段
|
||||
};
|
||||
|
||||
// 打开岗位类型选择器
|
||||
const openJobTypeSelector = () => {
|
||||
if (!jobTypeSelector.value) return;
|
||||
@@ -706,6 +734,7 @@ const publishJob = async () => {
|
||||
jobCategory: formData.jobCategory, // 岗位类型
|
||||
companyId: formData.companyId,
|
||||
companyName: formData.companyName,
|
||||
staffType: formData.staffType, // 新增:人员类型
|
||||
jobContactList: formData.contacts.filter(contact => contact.name.trim() && contact.phone.trim()).map(contact => ({
|
||||
contactPerson: contact.name,
|
||||
contactPersonPhone: contact.phone,
|
||||
@@ -760,6 +789,7 @@ const validateForm = () => {
|
||||
{ field: 'minSalary', message: '请输入最小薪资' },
|
||||
{ field: 'maxSalary', message: '请输入最大薪资' },
|
||||
{ field: 'education', message: '请选择学历要求' },
|
||||
{ field: 'staffType', message: '请选择人员类型' },
|
||||
{ field: 'experience', message: '请选择工作经验' },
|
||||
{ field: 'jobLocation', message: '请选择工作地点' },
|
||||
{ field: 'jobLocationAreaCode', message: '请选择工作区县' },
|
||||
|
||||
Reference in New Issue
Block a user