Browse Source

修复拒绝审批时报错

xjj 2 years ago
parent
commit
2fda3375db
1 changed files with 10 additions and 8 deletions
  1. 10 8
      src/pages/Detail/AuditModal.js

+ 10 - 8
src/pages/Detail/AuditModal.js

@@ -15,14 +15,16 @@ function AuditModal(props) {
   };
   useEffect(() => {
     if (visible) {
-      const comment = sheetRef.current.getComment();
-      console.log(comment);
-      let str = '';
-      comment.forEach(item => {
-        let col = String.fromCharCode(item.c + 65);
-        str += `单元格${col}${item.r}:${item.value}\n`;
-      });
-      form.setFieldsValue({ audit_comment: str });
+      try {
+        const comment = sheetRef.current.getComment();
+        console.log(comment);
+        let str = '';
+        comment.forEach(item => {
+          let col = String.fromCharCode(item.c + 65);
+          str += `单元格${col}${item.r}:${item.value}\n`;
+        });
+        form.setFieldsValue({ audit_comment: str });
+      } catch (error) {}
     }
   }, [visible]);