修改相关bug

This commit is contained in:
fuenmao
2026-09-17 11:37:32 +08:00
parent a0a181af57
commit 04c621961c
6 changed files with 255 additions and 82 deletions
+50 -34
View File
@@ -76,33 +76,32 @@
<!-- 步骤导航条:PC端展示完整步骤,移动端展示紧凑自适应导航 -->
<div class="steps-wrapper desktop-only">
<el-steps :active="currentStep" finish-status="success" align-center>
<el-step title="入职登记表" icon="User" />
<el-step title="材料补充项" icon="Document" />
<el-step title="证件材料" icon="FolderChecked" />
<el-step title="材料确认" icon="Tickets" />
<el-step v-for="step in visibleSteps" :key="step.key" :title="step.title" :icon="step.icon" />
</el-steps>
</div>
<div class="mobile-steps-wrapper mobile-only">
<div class="mobile-steps-track">
<div v-for="(stepName, index) in ['1. 登记表', '2. 补充项', '3. 证件材料', '4. 材料确认']" :key="index"
<div v-for="(step, index) in visibleSteps" :key="step.key"
class="mobile-step-item" :class="{
'is-active': currentStep === index,
'is-finished': currentStep > index,
'is-pending': currentStep < index
}">
<div class="step-indicator-bar" />
<span class="step-label">{{ stepName }}</span>
<span class="step-label">{{ (index + 1) + '. ' + step.shortTitle }}</span>
</div>
</div>
<div class="mobile-current-indicator">
当前进行:<span class="highlight-step">第 {{ currentStep + 1 }}/4 步 · {{ ['入职登记表填写', '签署材料补充项', '证件材料上传',
'签署材料查阅与确认'][currentStep] }}</span>
当前进行:<span class="highlight-step">第 {{ currentStep + 1 }}/{{ visibleSteps.length }} 步 · {{ currentStepDefinition.description }}</span>
</div>
</div>
<!-- 步骤 1: 入职登记表 -->
<div v-show="currentStep === 0" class="step-content">
<div v-show="currentStepKey === 'registration'" class="step-content">
<div class="registration-header">
<h2 class="reg-title">入 职 登 记 表</h2>
<p class="reg-subtitle">请如实填写个人基础档案、教育经历及家庭相关信息,标注 * 为必填项,信息将用于建立人事档案,请务必保证资料真实准确。</p>
@@ -458,23 +457,13 @@
</div>
<!-- 步骤 2: 合同专属增量补充项 (自适应差集) -->
<div v-show="currentStep === 1" class="step-content">
<div v-if="extraVariables.length" v-show="currentStepKey === 'extra'" class="step-content">
<div class="section-header">
<h3 class="section-title">签署材料专属补充信息</h3>
<p class="section-desc">以下是本次签署材料中特殊约定的增量字段,登记表未涵盖的项需在此补充确认</p>
</div>
<div v-if="!extraVariables.length" class="all-covered-card">
<div class="covered-status-mark">
<el-icon :size="28"><Check /></el-icon>
</div>
<h4 class="covered-status-title">个人信息已完整覆盖</h4>
<p class="covered-status-desc">
您在《入职登记表》中填写的姓名、身份证、电话、银行卡等信息已完整满足本次签署材料所需,无需额外补充!
</p>
</div>
<el-form v-else label-position="top" class="extra-form">
<el-form label-position="top" class="extra-form">
<el-alert title="请补充填写以下签署材料专有信息:" type="info" show-icon :closable="false" class="mb-3" />
<el-row :gutter="16">
<el-col v-for="(v, index) in extraVariables" :id="`extra-variable-${index}`" :key="v.variableCode"
@@ -503,7 +492,7 @@
</div>
<!-- 步骤 3: 证件材料上传 -->
<div v-show="currentStep === 2" class="step-content">
<div v-show="currentStepKey === 'materials'" class="step-content">
<div class="section-header">
<h3 class="section-title">证件与材料上传</h3>
<p class="section-desc">请上传清晰真实有效的证件扫描件或照片(支持 PNG、JPG、PDF)</p>
@@ -588,7 +577,7 @@
</div>
<!-- 步骤 4: 合同查阅与签署 -->
<div v-show="currentStep === 3" class="step-content">
<div v-show="currentStepKey === 'confirmation'" class="step-content">
<div v-if="canEdit" id="identity-confirmation-card" class="identity-confirmation-card">
<div class="identity-confirmation-heading">
<div>
@@ -678,13 +667,13 @@
<!-- 底部向导操作栏 -->
<div class="wizard-footer">
<el-button v-if="currentStep > 0" size="large" :disabled="savingStep || isAnyMaterialUploading" @click="currentStep--">上一步</el-button>
<el-button v-if="currentStep < 3" type="primary" size="large"
:loading="savingStep || (currentStep === 2 && isAnyMaterialUploading)"
<el-button v-if="currentStep < visibleSteps.length - 1" type="primary" size="large"
:loading="savingStep || (currentStepKey === 'materials' && isAnyMaterialUploading)"
:disabled="savingStep || isAnyMaterialUploading"
@click="nextStep">
{{ (currentStep === 2 && isAnyMaterialUploading) ? "材料上传中..." : (savingStep ? "保存中..." : "下一步") }}
{{ (currentStepKey === 'materials' && isAnyMaterialUploading) ? "材料上传中..." : (savingStep ? "保存中..." : "下一步") }}
</el-button>
<el-button v-if="currentStep === 3 && canEdit" type="success" size="large" icon="Check"
<el-button v-if="currentStepKey === 'confirmation' && canEdit" type="success" size="large" icon="Check"
:loading="submitting" :disabled="savingStep || isAnyMaterialUploading" @click="submitAll">
确认无误并提交入职资料
</el-button>
@@ -1159,6 +1148,23 @@ const extraVariables = computed(() => {
return result;
});
type OnboardingStepKey = "registration" | "extra" | "materials" | "confirmation";
const visibleSteps = computed(() => {
const steps = [
{ key: "registration" as OnboardingStepKey, title: "入职登记表", shortTitle: "登记表", description: "入职登记表填写", icon: "User" }
];
if (extraVariables.value.length) {
steps.push({ key: "extra", title: "材料补充项", shortTitle: "补充项", description: "签署材料补充项", icon: "Document" });
}
steps.push(
{ key: "materials", title: "证件材料", shortTitle: "证件材料", description: "证件材料上传", icon: "FolderChecked" },
{ key: "confirmation", title: "材料确认", shortTitle: "材料确认", description: "签署材料查阅与确认", icon: "Tickets" }
);
return steps;
});
const currentStepDefinition = computed(() => visibleSteps.value[currentStep.value] || visibleSteps.value[0]);
const currentStepKey = computed<OnboardingStepKey>(() => currentStepDefinition.value.key);
function addEducation() {
educationHistory.value.push({ timeRange: "", location: "", content: "", result: "" });
}
@@ -1459,7 +1465,8 @@ async function load(silent = false) {
uploadedMaterials.value = data.materials || [];
contractVariables.value = data.contractVariables || [];
formFieldRequirements.value = data.formFields || [];
contractVariables.value.forEach((variable: any) => {
Object.keys(customVariables).forEach(key => delete customVariables[key]);
extraVariables.value.forEach((variable: any) => {
if (!(variable.variableCode in customVariables) && variable.defaultValue != null) {
customVariables[variable.variableCode] = String(variable.defaultValue);
}
@@ -1478,7 +1485,14 @@ async function load(silent = false) {
try { familyMembers.value = JSON.parse(data.employeeInfo.familyMembersJson); } catch { }
}
if (data.employeeInfo.customVariablesJson) {
try { Object.assign(customVariables, JSON.parse(data.employeeInfo.customVariablesJson)); } catch { }
try {
const savedVariables = JSON.parse(data.employeeInfo.customVariablesJson);
extraVariables.value.forEach((variable: any) => {
if (Object.prototype.hasOwnProperty.call(savedVariables, variable.variableCode)) {
customVariables[variable.variableCode] = savedVariables[variable.variableCode];
}
});
} catch { }
}
}
await refreshMaterialPreviews();
@@ -1505,7 +1519,9 @@ async function saveCurrentEmployeeInfo() {
educationHistoryJson: JSON.stringify(educationHistory.value),
workHistoryJson: JSON.stringify(workHistory.value),
familyMembersJson: JSON.stringify(familyMembers.value),
customVariablesJson: JSON.stringify(customVariables)
customVariablesJson: JSON.stringify(Object.fromEntries(
extraVariables.value.map((variable: any) => [variable.variableCode, customVariables[variable.variableCode] ?? ""])
))
};
await onboardingPublicApi.saveEmployeeInfo(payload);
}
@@ -1546,7 +1562,7 @@ async function nextStep() {
}
savingStep.value = true;
try {
if (currentStep.value === 0) {
if (currentStepKey.value === "registration") {
if (!await validateRegistrationForm()) {
return;
}
@@ -1558,14 +1574,14 @@ async function nextStep() {
ElMessage.closeAll();
ElMessage.success("入职登记表已临时保存");
}
} else if (currentStep.value === 1) {
} else if (currentStepKey.value === "extra") {
if (!validateExtraVariables()) {
return;
}
if (canEdit.value) {
await saveCurrentEmployeeInfo();
}
} else if (currentStep.value === 2) {
} else if (currentStepKey.value === "materials") {
if (isAnyMaterialUploading.value) {
ElMessage.closeAll();
ElMessage.warning("材料正在上传中,请稍候再点击下一步");
@@ -1581,7 +1597,7 @@ async function nextStep() {
}
currentStep.value++;
window.scrollTo({ top: 0, behavior: "smooth" });
if (currentStep.value === 3) {
if (currentStepKey.value === "confirmation") {
await prepareContracts();
}
} catch (error: any) {