提交 65c49b26 authored 作者: 钟是志's avatar 钟是志

优化代码

上级 6bdce8ed
......@@ -87,7 +87,6 @@ export default class DetailSplit extends Component {
userInfo: '', // 得到用户数据
setData: '', // 配置的数据
countersignModal: '', // 开启加签弹框函数
nextAuditInfo: {}, // 最新的节点的审核人信息
isAllPrint: false,
};
window.callbackSubmitInfoZhiYong = undefined;
......@@ -162,6 +161,7 @@ export default class DetailSplit extends Component {
code: code || null, // 表单值
handleUser: handleUser || null, // 处理人
taskId, // 多任务流程会使用到,后续改为必须传入
lite: true,
},
callback: val => {
if (this.props.changeData) {
......@@ -175,84 +175,59 @@ export default class DetailSplit extends Component {
label: item.taskName,
value: item.formKey,
});
// checkedConfimList.push(item.formKey);
});
}
if (val.code) {
permRequest('/UnifiedAppFormApi/getAll', {
keyWords: val.code,
pageNo: 1,
pageSize: 10,
if (val && !val.taskInfo) {
permRequest('/UnifiedAppFormApi/getTaskInfos', { // 获取每一步的审核人. TODO 2022年7月22日 钟是志 未完成.
id: queryId ? queryId : id, // 审批表Id
})
.then(res => {
if (res && res.rows && res.rows.length) {
let thisAuditData = res.rows[0];
if (thisAuditData?.nextUsers?.endsWith(',')) {
thisAuditData.nextUsers = thisAuditData.nextUsers.slice(0, -1);
}
this.setState({
nextAuditInfo: thisAuditData,
});
}
});
}
// if (val.code) {
// permRequest('UnifiedAppFormApi/getTaskInfos', { // 获取每一步的审核人. TODO 2022年7月22日 钟是志 未完成.
// id: val.code,
// })
// .then(res => {
// // if (res && res.rows && res.rows.length) {
// // let thisAuditData = res.rows[0];
// // if (thisAuditData?.nextUsers?.endsWith(',')) {
// // thisAuditData.nextUsers = thisAuditData.nextUsers.slice(0, -1);
// // }
// // this.setState({
// // nextAuditInfo: thisAuditData,
// // });
// // }
// });
// }
this.setState(
{
data: val,
stepFlow: val.taskInfo,
obj: JSON.parse(val.content),
code: val.code,
taskId: val.taskId,
isSecond: val.isSecond ? val.isSecond : false,
appId: val.appId,
code: val.code,
isHandle: val.isHandle,
id,
btns: val.btns,
taskFormKey: val.taskFormKey,
hisTaskFormKeys: val.hisTaskForm,
isLoading: true,
formColor: val.formColor,
formLevel: val.formLevel,
isEnd: val.isEnd,
checkListOptions,
checkedConfimList,
},
() => {
if (val.isSecond) {
this.props.dispatch({
type: 'urge/GetMyBtn',
payload: {},
callback: arr => {
this.setState({
btnList: arr,
radiovalue: val.formLevelId ? val.formLevelId : arr[arr.length - 1].id,
}, () => {
val.taskInfo = res.taskInfo;
this.setState(
{
data: val,
stepFlow: val.taskInfo,
obj: JSON.parse(val.content),
code: val.code,
taskId: val.taskId,
isSecond: val.isSecond ? val.isSecond : false,
appId: val.appId,
code: val.code,
isHandle: val.isHandle,
id,
btns: val.btns,
taskFormKey: val.taskFormKey,
hisTaskFormKeys: val.hisTaskForm,
isLoading: true,
formColor: val.formColor,
formLevel: val.formLevel,
isEnd: val.isEnd,
checkListOptions,
checkedConfimList,
},
() => {
if (val.isSecond) {
this.props.dispatch({
type: 'urge/GetMyBtn',
payload: {},
callback: arr => {
this.setState({
btnList: arr,
radiovalue: val.formLevelId ? val.formLevelId : arr[arr.length - 1].id,
}, () => {
// this.giveMessageTop();
});
},
});
} else {
// this.giveMessageTop();
});
}
},
});
} else {
// this.giveMessageTop();
}
},
);
);
});
}
},
});
......@@ -448,7 +423,6 @@ export default class DetailSplit extends Component {
paddingBottom,
setData,
isSign,
nextAuditInfo,
isAllPrint,
} = this.state;
const { showPrint } = this.props;
......@@ -768,8 +742,8 @@ export default class DetailSplit extends Component {
<p>审批人员: {data.nextUsers}</p>
)
}
{queryApiVersion() !== '2.0' && ['处理中', '待处理'].includes(item.status) && !!nextAuditInfo.nextUsers && (
<p>审批人员: {nextAuditInfo.nextUsers}</p>
{queryApiVersion() !== '2.0' && ['处理中', '待处理'].includes(item.status) && !!item.nextUsers && (
<p>审批人员: {item.nextUsers}</p>
)}
<p>审批流程:{item.name}</p>
<p className={styles.steps_body}>审批状态:{item.status}</p>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论