修复相关bug
This commit is contained in:
@@ -256,7 +256,7 @@
|
||||
<span class="block-subtitle">勾选入职时要求候选人必须或可选上传的证件材料(如身份证、毕业证、体检表等)</span>
|
||||
</div>
|
||||
|
||||
<el-table :data="materialTypes" border stripe height="240px" class="mt-2">
|
||||
<el-table :data="enabledMaterialTypes" border stripe height="240px" class="mt-2">
|
||||
<el-table-column label="选择要求" width="85" align="center">
|
||||
<template #default="scope">
|
||||
<el-checkbox :model-value="hasMaterial(scope.row.id)"
|
||||
@@ -293,7 +293,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, reactive, ref } from "vue";
|
||||
import { computed, onMounted, reactive, ref } from "vue";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import {
|
||||
OnboardingCompany,
|
||||
@@ -324,6 +324,9 @@ const departments = ref<OnboardingDepartmentOption[]>([]);
|
||||
const positions = ref<OnboardingPosition[]>([]);
|
||||
const contractTemplates = ref<OnboardingContractTemplate[]>([]);
|
||||
const materialTypes = ref<OnboardingMaterialType[]>([]);
|
||||
const enabledMaterialTypes = computed(() =>
|
||||
materialTypes.value.filter(item => item.status === "enable")
|
||||
);
|
||||
const versionOptions = reactive<Record<number, OnboardingContractVersion[]>>({});
|
||||
|
||||
const query = reactive({
|
||||
@@ -597,6 +600,17 @@ async function openEdit(row: OnboardingTemplate) {
|
||||
}))
|
||||
});
|
||||
|
||||
const enabledMaterialIds = new Set(enabledMaterialTypes.value.map(item => item.id));
|
||||
const disabledMaterials = materialTypes.value.filter(item =>
|
||||
item.status !== "enable" && form.materials.some(config => config.materialTypeId === item.id)
|
||||
);
|
||||
form.materials = form.materials.filter(item => enabledMaterialIds.has(item.materialTypeId));
|
||||
if (disabledMaterials.length > 0) {
|
||||
ElMessage.warning(
|
||||
`该模板原来关联的停用资料“${disabledMaterials.map(item => item.materialName).join("、")}”已从本次配置中移除,保存后生效`
|
||||
);
|
||||
}
|
||||
|
||||
if (form.companyId) {
|
||||
const departmentRes = await onboardingTaskApi.listDepartments(form.companyId);
|
||||
departments.value = departmentRes.data || [];
|
||||
|
||||
Reference in New Issue
Block a user