diff --git a/src/views/task/simulationTask/newDemand/components/lib.ts b/src/views/task/simulationTask/newDemand/components/lib.ts index 4c0c5ba2..e49aa019 100644 --- a/src/views/task/simulationTask/newDemand/components/lib.ts +++ b/src/views/task/simulationTask/newDemand/components/lib.ts @@ -8,8 +8,8 @@ import { ElMessage } from 'element-plus'; // 初始化 export const initDetailData = async (initData: any) => { - const { data = {}, ref, hideKeys } = initData; // hideKeys必须传递hideKeys.value,否则hideKeys无法双向绑定 + const { data = {}, ref, hideKeys } = initData; if (data.tMemberList) { data.tMemberList = getMemberListIds(data.tMemberList); } @@ -17,6 +17,7 @@ export const initDetailData = async (initData: any) => { data.aMemberList = getMemberListIds(data.aMemberList); } if (data.pMemberList) { + data.pMemberName = data.pMemberList[0].nickname || ''; data.pMemberList = getMemberListIds(data.pMemberList); } if (data.projectId) { @@ -51,19 +52,20 @@ export const initDetailData = async (initData: any) => { data.produceLine = data.extras[index]?.propertyValue; } } - if (data.projectUndertaker && data.simType) { - const params = { - deptName: data.projectUndertaker, - discipline: data.simType, - }; - const res = await queryByDeptAndDisciplineApi(params); - if (res.code === 200) { - if (res.data[0]) { - data.pMemberName = res.data[0]?.userResp?.nickname || ''; - data.pMemberList = res.data[0]?.userId || ''; - } - } - } + // 暂时废弃,用详情里的默认值 + // if (data.projectUndertaker && data.simType) { + // const params = { + // deptName: data.projectUndertaker, + // discipline: data.simType, + // }; + // const res = await queryByDeptAndDisciplineApi(params); + // if (res.code === 200) { + // if (res.data[0]) { + // data.pMemberName = res.data[0]?.userResp?.nickname || ''; + // data.pMemberList = res.data[0]?.userId || ''; + // } + // } + // } let newKeys: any = [...(hideKeys.value || [])]; data.extras?.forEach((item: any) => { // 更具需求时间,默认展示需求紧急说明