|
@@ -27,25 +27,28 @@ const ApprovalProcess = (props: any) => {
|
|
const { userList, run } = useModel('userList');
|
|
const { userList, run } = useModel('userList');
|
|
|
|
|
|
const list = useMemo(() => {
|
|
const list = useMemo(() => {
|
|
- approvalProcess?.forEach((item: any) => {
|
|
|
|
- if (item.length > 1 && item[0].type == TYPE.USER) {
|
|
|
|
- item.forEach((curUser: any) => {
|
|
|
|
- curUser.name =
|
|
|
|
- userList.find((user: any) => user.ID == curUser.value)?.CName ||
|
|
|
|
|
|
+ approvalProcess
|
|
|
|
+ ?.filter((item: any) => item)
|
|
|
|
+ .forEach((item: any) => {
|
|
|
|
+ if (item.length > 1 && item[0].type == TYPE.USER) {
|
|
|
|
+ item.forEach((curUser: any) => {
|
|
|
|
+ curUser.name =
|
|
|
|
+ userList?.find((user: any) => user.ID == curUser.value)?.CName ||
|
|
|
|
+ '-';
|
|
|
|
+ });
|
|
|
|
+ } else if (item.length == 1 && item[0].type == TYPE.USER) {
|
|
|
|
+ item[0].name =
|
|
|
|
+ userList?.find((user: any) => user.ID == item[0].value)?.CName ||
|
|
'-';
|
|
'-';
|
|
- });
|
|
|
|
- } else if (item.length == 1 && item[0].type == TYPE.USER) {
|
|
|
|
- item[0].name =
|
|
|
|
- userList.find((user: any) => user.ID == item[0].value)?.CName || '-';
|
|
|
|
- } else if (item.length == 1 && item[0].nowType == TYPE.USER) {
|
|
|
|
- item[0].name =
|
|
|
|
- userList.find((user: any) => user.ID == item[0].nowValue)?.CName ||
|
|
|
|
- '-';
|
|
|
|
- } else {
|
|
|
|
- item[0].name = null;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- return approvalProcess;
|
|
|
|
|
|
+ } else if (item.length == 1 && item[0].nowType == TYPE.USER) {
|
|
|
|
+ item[0].name =
|
|
|
|
+ userList?.find((user: any) => user.ID == item[0].nowValue)?.CName ||
|
|
|
|
+ '-';
|
|
|
|
+ } else {
|
|
|
|
+ item[0].name = null;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return approvalProcess?.filter((item: any) => item);
|
|
}, [approvalProcess]);
|
|
}, [approvalProcess]);
|
|
|
|
|
|
const onStepsChange = async (current: any, list: any) => {
|
|
const onStepsChange = async (current: any, list: any) => {
|
|
@@ -60,7 +63,7 @@ const ApprovalProcess = (props: any) => {
|
|
|
|
|
|
const selectedUserId = ({ target: { value } }: RadioChangeEvent) => {
|
|
const selectedUserId = ({ target: { value } }: RadioChangeEvent) => {
|
|
//userId
|
|
//userId
|
|
- const name = userList.find((user: any) => user.ID == value)?.CName || '-';
|
|
|
|
|
|
+ const name = userList?.find((user: any) => user.ID == value)?.CName || '-';
|
|
const data = { nowType: TYPE.USER, nowValue: Number(value), name }; //type: TYPE.USER, value: Number(value)
|
|
const data = { nowType: TYPE.USER, nowValue: Number(value), name }; //type: TYPE.USER, value: Number(value)
|
|
list[curNodeIdx][0] = { ...list[curNodeIdx][0], ...data };
|
|
list[curNodeIdx][0] = { ...list[curNodeIdx][0], ...data };
|
|
console.log([...list]);
|
|
console.log([...list]);
|