Parcourir la source

修改审批流节点为空时候报错

Renxy il y a 2 ans
Parent
commit
60e81f5720
2 fichiers modifiés avec 14 ajouts et 14 suppressions
  1. 1 1
      src/pages/Detail/CommitAuditModal.js
  2. 13 13
      src/pages/Detail/Index.js

+ 1 - 1
src/pages/Detail/CommitAuditModal.js

@@ -128,7 +128,6 @@ function CommitAuditModal(props) {
 
   const currentNodeId = useMemo(() => {
     let Id = version.template_node_id;
-    console.log('==============================9999=====', currentNodeId);
     setAuditId(currentNodeId);
     return flowDetail.nodes.find?.(item => item.Id == Id)?.node_id;
   }, [flowDetail, version]);
@@ -177,6 +176,7 @@ function CommitAuditModal(props) {
   };
 
   const onChange = value => {
+    if (!value) return;
     changeAudit(value[value.length - 1]);
     setAuditListFun();
   };

+ 13 - 13
src/pages/Detail/Index.js

@@ -695,19 +695,19 @@ function Detail(props) {
       //判断分类,这个清单所属分类的操作人可以提交
       const getIsSubmit = () => {
         let bool = true;
-        const nodeId = version.template_node_id;
-        if (!flowDetail?.nodes || !nodeId) return;
-        const node = flowDetail.nodes.find(item => item.Id == nodeId);
-        if (!node || node.name == 'custom-circle') return;
-        if (node?.role_list) {
-          bool = node.role_list
-            .split(',')
-            .some(id => currentUser.roleList?.find(role => role.ID == id));
-        }
-        const uidsStr = classifyList.find(item => item.classify_id == version.classify_id)?.uid;
-        if (uidsStr && uidsStr.split(',')?.findIndex(item => item == currentUser.ID) < 0) {
-          bool = false;
-        }
+        // const nodeId = version.template_node_id;
+        // if (!flowDetail?.nodes || !nodeId) return;
+        // const node = flowDetail.nodes.find(item => item.Id == nodeId);
+        // if (!node || node.name == 'custom-circle') return;
+        // if (node?.role_list) {
+        //   bool = node.role_list
+        //     .split(',')
+        //     .some(id => currentUser.roleList?.find(role => role.ID == id));
+        // }
+        // const uidsStr = classifyList.find(item => item.classify_id == version.classify_id)?.uid;
+        // if (uidsStr && uidsStr.split(',')?.findIndex(item => item == currentUser.ID) < 0) {
+        //   bool = false;
+        // }
         return bool;
       };
       console.log('是否有权限提交流转   ', getIsSubmit());