企业用户bug修复
This commit is contained in:
@@ -253,6 +253,9 @@ const formData = reactive({
|
||||
]
|
||||
});
|
||||
|
||||
// 是否是就业见习基地
|
||||
const isInternshipBase = ref(false);
|
||||
|
||||
// 字典存储
|
||||
const dictStore = useDictStore();
|
||||
|
||||
@@ -322,6 +325,16 @@ const getCompanyInfo = () => {
|
||||
const company = cachedUserInfo.company;
|
||||
formData.companyName = company.name || '';
|
||||
formData.companyId = company.companyId || '';
|
||||
|
||||
// 检查是否是就业见习基地:enterpriseType为0表示是,1表示否
|
||||
if (company.enterpriseType !== undefined) {
|
||||
isInternshipBase.value = company.enterpriseType === '0';
|
||||
console.log('就业见习基地状态:', isInternshipBase.value ? '是' : '否', 'enterpriseType:', company.enterpriseType);
|
||||
} else {
|
||||
console.log('未找到enterpriseType字段,默认不是就业见习基地');
|
||||
isInternshipBase.value = false;
|
||||
}
|
||||
|
||||
console.log('从缓存获取企业名称:', company.name);
|
||||
console.log('从缓存获取企业ID:', company.id);
|
||||
} else {
|
||||
@@ -336,6 +349,8 @@ const getCompanyInfo = () => {
|
||||
formData.companyId = cachedUserInfo.id;
|
||||
console.log('从用户ID获取企业ID:', cachedUserInfo.id);
|
||||
}
|
||||
// 默认不是就业见习基地
|
||||
isInternshipBase.value = false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取企业信息失败:', error);
|
||||
@@ -358,11 +373,20 @@ const initFormData = async () => {
|
||||
workDistricts.value = dictStore.state.area;
|
||||
|
||||
// 设置岗位分类选项
|
||||
jobCategories.value = [
|
||||
{ label: '普通', value: '1' },
|
||||
{ label: '零工', value: '2' },
|
||||
{ label: '实习实训', value: '3' }
|
||||
];
|
||||
// 只有就业见习基地才能选择"实习实训"选项
|
||||
if (isInternshipBase.value) {
|
||||
jobCategories.value = [
|
||||
{ label: '普通', value: '1' },
|
||||
{ label: '零工', value: '2' },
|
||||
{ label: '实习实训', value: '3' }
|
||||
];
|
||||
} else {
|
||||
jobCategories.value = [
|
||||
{ label: '普通', value: '1' },
|
||||
{ label: '零工', value: '2' }
|
||||
];
|
||||
}
|
||||
console.log('岗位分类选项:', jobCategories.value);
|
||||
|
||||
// 设置企业ID(从用户信息获取)
|
||||
if (userStore.userInfo && userStore.userInfo.id) {
|
||||
|
||||
Reference in New Issue
Block a user