消息页面需求修改

This commit is contained in:
FengHui
2026-05-19 13:21:35 +08:00
parent 57994d1b2c
commit a070976c0c
5 changed files with 141 additions and 8 deletions

View File

@@ -106,6 +106,11 @@
<view class="input-titile">学历</view>
<input class="input-con" v-model="state.educationText" disabled placeholder="请选择学历" />
</view>
<view class="content-input" :class="{ 'input-error': userTypeError }" @click="changeUserType">
<view class="input-titile">人员类型</view>
<input class="input-con" v-model="state.userTypeText" disabled placeholder="请选择人员类型(可多选)" />
<view v-if="userTypeError" class="error-message">{{ userTypeError }}</view>
</view>
<view class="content-input" :class="{ 'input-error': idCardError }">
<view class="input-titile">身份证</view>
<input
@@ -280,6 +285,8 @@ const state = reactive({
workExperience: '',
salayText: '',
jobsText: [],
userTypeText: '',
userTypeValues: [],
skills: [], // 技能数据结构 { name, level }
currentEditingSkillIndex: -1 // 当前正在编辑的技能索引
});
@@ -295,6 +302,7 @@ const fromValue = reactive({
name: '',
age: '',
ytjPassword: '',
userType: '',
});
// 输入校验相关
@@ -303,6 +311,7 @@ const nameError = ref('');
const ageError = ref('');
const sexError = ref('');
const experienceError = ref('');
const userTypeError = ref('');
const passwordError = ref('');
onLoad((parmas) => {
@@ -597,6 +606,37 @@ async function changeEducation() {
});
}
async function changeUserType() {
let userTypeData = oneDictData('user_type');
if (!userTypeData || userTypeData.length === 0) {
try {
userTypeData = await getDictSelectOption('user_type');
if (!userTypeData || userTypeData.length === 0) {
$api.msg('人员类型数据加载中,请稍后再试');
return;
}
} catch (error) {
console.error('加载人员类型字典数据失败:', error);
$api.msg('加载人员类型数据失败');
return;
}
}
openSelectPopup({
title: '人员类型',
maskClick: true,
data: [userTypeData],
multiSelect: true,
defaultValues: state.userTypeValues,
success: (selectedValues, selectedItems) => {
state.userTypeValues = selectedValues;
fromValue.userType = selectedValues.join(',');
state.userTypeText = selectedItems.map(item => item.label).join('、');
},
});
}
function changeArea() {
openSelectPopup({
title: '区域',
@@ -662,6 +702,13 @@ function nextStep() {
experienceError.value = '';
}
// 人员类型校验
if (!state.userTypeText) {
userTypeError.value = '请选择人员类型';
} else {
userTypeError.value = '';
}
// 学历校验
if (!state.educationText) {
$api.msg('请选择您的学历');
@@ -673,6 +720,7 @@ function nextStep() {
if (sexError.value) return;
if (ageError.value) return;
if (experienceError.value) return;
if (userTypeError.value) return;
if (idCardError.value || !fromValue.idCard) {
if (!fromValue.idCard) $api.msg('请输入身份证号码');
return;
@@ -787,7 +835,8 @@ function complete() {
jobTitleId: fromValue.jobTitleId,
salaryMin: fromValue.salaryMin,
salaryMax: fromValue.salaryMax,
ytjPassword: fromValue.ytjPassword
ytjPassword: fromValue.ytjPassword,
userType: fromValue.userType
},
appSkillsList: appSkillsList
};

View File

@@ -64,6 +64,10 @@
placeholder="请选择您的政治面貌"
/>
</view>
<view class="content-input" @click="changeUserType">
<view class="input-titile">人员类型</view>
<input class="input-con triangle" v-model="state.userTypeText" disabled placeholder="请选择人员类型(可多选)" />
</view>
<view class="content-input">
<view class="input-titile">身份证</view>
<input class="input-con" v-model="fromValue.idCard" placeholder="请输入身份证号码" />
@@ -169,8 +173,10 @@ const needGoBackTwoStep = ref(false);
const state = reactive({
educationText: '',
politicalAffiliationText: '',
skills: [], // 新的技能数据结构包含id字段
currentEditingSkillIndex: -1 // 当前正在编辑的技能索引
userTypeText: '',
userTypeValues: [],
skills: [],
currentEditingSkillIndex: -1
});
const fromValue = reactive({
name: '',
@@ -180,7 +186,8 @@ const fromValue = reactive({
education: '',
politicalAffiliation: '',
idCard: '',
phone: ''
phone: '',
userType: ''
});
// 输入校验相关
@@ -271,6 +278,15 @@ function initLoad() {
if (currentUserInfo.politicalAffiliation) {
state.politicalAffiliationText = dictLabel('affiliation', currentUserInfo.politicalAffiliation);
}
// 回显人员类型
if (currentUserInfo.userType) {
fromValue.userType = currentUserInfo.userType;
const userTypeValues = currentUserInfo.userType.split(',');
state.userTypeValues = userTypeValues;
initUserTypeText(userTypeValues);
}
const result = getFormCompletionPercent(fromValue);
percent.value = result;
}
@@ -319,6 +335,33 @@ function initEducationText() {
checkDict();
}
function initUserTypeText(userTypeValues) {
const trySetText = (data) => {
if (data && data.length > 0) {
const labels = userTypeValues.map(v => {
const item = data.find(d => String(d.value) === String(v));
return item ? item.label : '';
}).filter(Boolean);
if (labels.length > 0) {
state.userTypeText = labels.join('、');
return true;
}
}
return false;
};
if (trySetText(dictStore.state.user_type)) return;
getDictSelectOption('user_type').then(data => {
if (!trySetText(data)) {
state.userTypeText = fromValue.userType;
}
}).catch(() => {
state.userTypeText = fromValue.userType;
});
}
const confirm = () => {
if (!fromValue.name) {
return $api.msg('请输入姓名');
@@ -332,6 +375,9 @@ const confirm = () => {
if (!fromValue.politicalAffiliation) {
return $api.msg('请选择政治面貌');
}
if (!fromValue.userType) {
return $api.msg('请选择人员类型');
}
if (!checkingPhoneRegExp(fromValue.phone)) {
return $api.msg('请输入正确手机号');
}
@@ -653,6 +699,37 @@ const changePoliticalAffiliation = () => {
});
};
async function changeUserType() {
let userTypeData = oneDictData('user_type');
if (!userTypeData || userTypeData.length === 0) {
try {
userTypeData = await getDictSelectOption('user_type');
if (!userTypeData || userTypeData.length === 0) {
$api.msg('人员类型数据加载中,请稍后再试');
return;
}
} catch (error) {
console.error('加载人员类型字典数据失败:', error);
$api.msg('加载人员类型数据失败');
return;
}
}
openSelectPopup({
title: '人员类型',
maskClick: true,
data: [userTypeData],
multiSelect: true,
defaultValues: state.userTypeValues,
success: (selectedValues, selectedItems) => {
state.userTypeValues = selectedValues;
fromValue.userType = selectedValues.join(',');
state.userTypeText = selectedItems.map(item => item.label).join('、');
},
});
}
function generateDatePickerArrays(startYear = 1950, endYear = new Date().getFullYear()) {
const years = [];