1.1.11 项目验收确认删除无用代码

dev
yinq 2 weeks ago
parent 6ebcd59df2
commit b49a4bc13d

@ -181,19 +181,6 @@ const getUserSelectList = async () => {
userList.value = res.data || []; userList.value = res.data || [];
}; };
/** 根据当前 ID 从 userList 同步流程变量用的姓名字段;下拉未包含该用户时保留表单已有姓名 */
const syncPersonNamesFromIds = () => {
const nick = (id: string | number | undefined, fallback: string | undefined) => {
if (id === undefined || id === null || id === '') return '';
const u = userList.value.find((x) => String(x.userId) === String(id));
if (u) return String(u.nickName || u.userName || '').trim();
return String(fallback ?? '').trim();
};
form.value.projectManagerName = nick(form.value.managerId, form.value.projectManagerName) as any;
form.value.chargeName = nick(form.value.chargeId, form.value.chargeName) as any;
form.value.deputyName = nick(form.value.deputyId, form.value.deputyName) as any;
};
const rules = { const rules = {
projectName: [{ required: true, message: '项目名称不能为空', trigger: 'blur' }], projectName: [{ required: true, message: '项目名称不能为空', trigger: 'blur' }],
projectCode: [{ required: true, message: '项目号不能为空', trigger: 'blur' }], projectCode: [{ required: true, message: '项目号不能为空', trigger: 'blur' }],
@ -253,14 +240,12 @@ const onProjectChange = async (val: any) => {
const { data } = await prepareProjectAcceptanceByProjectId(val); const { data } = await prepareProjectAcceptanceByProjectId(val);
Object.assign(form.value, data); Object.assign(form.value, data);
form.value.projectId = val; form.value.projectId = val;
syncPersonNamesFromIds();
}; };
const loadDetail = async () => { const loadDetail = async () => {
if (!routeParams.value.id) return; if (!routeParams.value.id) return;
const res = await getProjectAcceptance(routeParams.value.id); const res = await getProjectAcceptance(routeParams.value.id);
Object.assign(form.value, res.data); Object.assign(form.value, res.data);
syncPersonNamesFromIds();
}; };
const submitForm = (status: string, mode: boolean) => { const submitForm = (status: string, mode: boolean) => {
@ -386,11 +371,3 @@ onMounted(async () => {
} }
}); });
</script> </script>
<style scoped lang="scss">
.card-title {
font-weight: bold;
font-size: 16px;
color: #303133;
}
</style>

Loading…
Cancel
Save