消息页面需求修改
This commit is contained in:
@@ -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 = [];
|
||||
|
||||
Reference in New Issue
Block a user