|  | @@ -1,24 +1,9 @@
 | 
											
												
													
														|  |  import React, { useEffect, useState, useRef, useMemo } from 'react';
 |  |  import React, { useEffect, useState, useRef, useMemo } from 'react';
 | 
											
												
													
														|  |  import { UnorderedListOutlined, PlusOutlined } from '@ant-design/icons';
 |  |  import { UnorderedListOutlined, PlusOutlined } from '@ant-design/icons';
 | 
											
												
													
														|  | -import {
 |  | 
 | 
											
												
													
														|  | -  Button,
 |  | 
 | 
											
												
													
														|  | -  Modal,
 |  | 
 | 
											
												
													
														|  | -  message,
 |  | 
 | 
											
												
													
														|  | -  Alert,
 |  | 
 | 
											
												
													
														|  | -  Avatar,
 |  | 
 | 
											
												
													
														|  | -  Spin,
 |  | 
 | 
											
												
													
														|  | -  Select,
 |  | 
 | 
											
												
													
														|  | -  Menu,
 |  | 
 | 
											
												
													
														|  | -  Dropdown,
 |  | 
 | 
											
												
													
														|  | -  Row,
 |  | 
 | 
											
												
													
														|  | -  Col,
 |  | 
 | 
											
												
													
														|  | -  Table,
 |  | 
 | 
											
												
													
														|  | -  Card,
 |  | 
 | 
											
												
													
														|  | -} from 'antd';
 |  | 
 | 
											
												
													
														|  | 
 |  | +import { Button, Modal, message, Alert, Avatar } from 'antd';
 | 
											
												
													
														|  |  import { connect } from 'dva';
 |  |  import { connect } from 'dva';
 | 
											
												
													
														|  |  import styles from './Index.less';
 |  |  import styles from './Index.less';
 | 
											
												
													
														|  |  import LuckySheet from './LuckySheet';
 |  |  import LuckySheet from './LuckySheet';
 | 
											
												
													
														|  | -import router from 'umi/router';
 |  | 
 | 
											
												
													
														|  |  import AuditModal from './AuditModal';
 |  |  import AuditModal from './AuditModal';
 | 
											
												
													
														|  |  // import CommentDrawer from './CommentDrawer';
 |  |  // import CommentDrawer from './CommentDrawer';
 | 
											
												
													
														|  |  import RightDrawer from './RightDrawer';
 |  |  import RightDrawer from './RightDrawer';
 | 
											
										
											
												
													
														|  | @@ -31,14 +16,14 @@ import TimeNode from './TimeNode';
 | 
											
												
													
														|  |  import FilesModal from './FilesModal';
 |  |  import FilesModal from './FilesModal';
 | 
											
												
													
														|  |  import VersionModal from './VersionModal';
 |  |  import VersionModal from './VersionModal';
 | 
											
												
													
														|  |  import CommitAuditModal from './CommitAuditModal';
 |  |  import CommitAuditModal from './CommitAuditModal';
 | 
											
												
													
														|  | -import CommentContent from '@/components/CommentContent';
 |  | 
 | 
											
												
													
														|  | 
 |  | +// import CommentContent from '@/components/CommentContent';
 | 
											
												
													
														|  |  import MergeModal from './MergeModal';
 |  |  import MergeModal from './MergeModal';
 | 
											
												
													
														|  |  import { GetTokenFromUrl, getToken } from '@/utils/utils';
 |  |  import { GetTokenFromUrl, getToken } from '@/utils/utils';
 | 
											
												
													
														|  |  import {
 |  |  import {
 | 
											
												
													
														|  | -  queryDelPurchaseExcel,
 |  | 
 | 
											
												
													
														|  |    queryDelSheetRecord,
 |  |    queryDelSheetRecord,
 | 
											
												
													
														|  |    queryDetail,
 |  |    queryDetail,
 | 
											
												
													
														|  |    queryDingInstanceExecute,
 |  |    queryDingInstanceExecute,
 | 
											
												
													
														|  | 
 |  | +  setLastVersion,
 | 
											
												
													
														|  |  } from '@/services/boom';
 |  |  } from '@/services/boom';
 | 
											
												
													
														|  |  import HistoryDrawer from './HistoryDrawer';
 |  |  import HistoryDrawer from './HistoryDrawer';
 | 
											
												
													
														|  |  import AuditFlow from './AuditFlow';
 |  |  import AuditFlow from './AuditFlow';
 | 
											
										
											
												
													
														|  | @@ -47,20 +32,15 @@ import { async } from '@antv/x6/es/registry/marker/async';
 | 
											
												
													
														|  |  import FileViewerModal from '@/components/FileViewer';
 |  |  import FileViewerModal from '@/components/FileViewer';
 | 
											
												
													
														|  |  import PreviewFile from '@/components/PreviewFile';
 |  |  import PreviewFile from '@/components/PreviewFile';
 | 
											
												
													
														|  |  import FormAndFilesNode from './FormAndFilesNode';
 |  |  import FormAndFilesNode from './FormAndFilesNode';
 | 
											
												
													
														|  | 
 |  | +import DropdownMenu from './DropdownMenu';
 | 
											
												
													
														|  | 
 |  | +import CurrentInfo from './CurrentInfo';
 | 
											
												
													
														|  |  const LocalData = localStorage.luckysheet;
 |  |  const LocalData = localStorage.luckysheet;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -const { Option } = Select;
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |  function Detail(props) {
 |  |  function Detail(props) {
 | 
											
												
													
														|  |    const {
 |  |    const {
 | 
											
												
													
														|  |      dispatch,
 |  |      dispatch,
 | 
											
												
													
														|  | -    comment,
 |  | 
 | 
											
												
													
														|  | -    history,
 |  | 
 | 
											
												
													
														|  |      loading,
 |  |      loading,
 | 
											
												
													
														|  |      currentUser,
 |  |      currentUser,
 | 
											
												
													
														|  | -    fileList,
 |  | 
 | 
											
												
													
														|  | -    roleList,
 |  | 
 | 
											
												
													
														|  | -    template,
 |  | 
 | 
											
												
													
														|  |      versionList,
 |  |      versionList,
 | 
											
												
													
														|  |      auditList,
 |  |      auditList,
 | 
											
												
													
														|  |      flowDetail,
 |  |      flowDetail,
 | 
											
										
											
												
													
														|  | @@ -69,7 +49,6 @@ function Detail(props) {
 | 
											
												
													
														|  |      instanceDetail,
 |  |      instanceDetail,
 | 
											
												
													
														|  |      typeOptions,
 |  |      typeOptions,
 | 
											
												
													
														|  |      classifyList,
 |  |      classifyList,
 | 
											
												
													
														|  | -    OSSData,
 |  | 
 | 
											
												
													
														|  |      excelFileList,
 |  |      excelFileList,
 | 
											
												
													
														|  |    } = props;
 |  |    } = props;
 | 
											
												
													
														|  |    const [versionTreeVisible, setVersionTreeVisible] = useState(false);
 |  |    const [versionTreeVisible, setVersionTreeVisible] = useState(false);
 | 
											
										
											
												
													
														|  | @@ -84,7 +63,6 @@ function Detail(props) {
 | 
											
												
													
														|  |    const [commitAuditVisible, setCommitAuditVisible] = useState(false);
 |  |    const [commitAuditVisible, setCommitAuditVisible] = useState(false);
 | 
											
												
													
														|  |    const [sheet, setSheet] = useState({});
 |  |    const [sheet, setSheet] = useState({});
 | 
											
												
													
														|  |    const [compareList, setCompareList] = useState([]);
 |  |    const [compareList, setCompareList] = useState([]);
 | 
											
												
													
														|  | -  const [edit, setEdit] = useState(false);
 |  | 
 | 
											
												
													
														|  |    const [isMerge, setIsMerge] = useState(false);
 |  |    const [isMerge, setIsMerge] = useState(false);
 | 
											
												
													
														|  |    const [version, setVersion] = useState({});
 |  |    const [version, setVersion] = useState({});
 | 
											
												
													
														|  |    const [user, setUser] = useState([]);
 |  |    const [user, setUser] = useState([]);
 | 
											
										
											
												
													
														|  | @@ -92,7 +70,7 @@ function Detail(props) {
 | 
											
												
													
														|  |      diff: 0,
 |  |      diff: 0,
 | 
											
												
													
														|  |      add: 0,
 |  |      add: 0,
 | 
											
												
													
														|  |    });
 |  |    });
 | 
											
												
													
														|  | -  const [fileVisible, setFileVisible] = useState(false);
 |  | 
 | 
											
												
													
														|  | 
 |  | +  // const [fileVisible, setFileVisible] = useState(false);
 | 
											
												
													
														|  |    const [exportDate, setExportData] = useState([]);
 |  |    const [exportDate, setExportData] = useState([]);
 | 
											
												
													
														|  |    const sheetRef = useRef();
 |  |    const sheetRef = useRef();
 | 
											
												
													
														|  |    const sheetRef2 = useRef();
 |  |    const sheetRef2 = useRef();
 | 
											
										
											
												
													
														|  | @@ -103,18 +81,16 @@ function Detail(props) {
 | 
											
												
													
														|  |      edit: false,
 |  |      edit: false,
 | 
											
												
													
														|  |      compare: false,
 |  |      compare: false,
 | 
											
												
													
														|  |    });
 |  |    });
 | 
											
												
													
														|  | -  const cellPosition = useRef({});
 |  | 
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |    useEffect(() => {
 |  |    useEffect(() => {
 | 
											
												
													
														|  |      if (!version.attachment_id) return;
 |  |      if (!version.attachment_id) return;
 | 
											
												
													
														|  |      dispatch({
 |  |      dispatch({
 | 
											
												
													
														|  |        type: 'detail/QueryExcelFiles',
 |  |        type: 'detail/QueryExcelFiles',
 | 
											
												
													
														|  |        payload: {
 |  |        payload: {
 | 
											
												
													
														|  | -        // file_type: 1,
 |  | 
 | 
											
												
													
														|  |          excel_id: version.attachment_id,
 |  |          excel_id: version.attachment_id,
 | 
											
												
													
														|  |        },
 |  |        },
 | 
											
												
													
														|  |      });
 |  |      });
 | 
											
												
													
														|  | -  }, [version.attachment_id]);
 |  | 
 | 
											
												
													
														|  | 
 |  | +  }, [version.id]);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |    const projectId = parseInt(params.projectId);
 |  |    const projectId = parseInt(params.projectId);
 | 
											
												
													
														|  |    const templateId = parseInt(params.templateId);
 |  |    const templateId = parseInt(params.templateId);
 | 
											
										
											
												
													
														|  | @@ -171,41 +147,10 @@ function Detail(props) {
 | 
											
												
													
														|  |    const isAuditor = useMemo(() => {
 |  |    const isAuditor = useMemo(() => {
 | 
											
												
													
														|  |      const getUserRole = () => {
 |  |      const getUserRole = () => {
 | 
											
												
													
														|  |        return flow.currentNode?.auditor == currentUser.ID;
 |  |        return flow.currentNode?.auditor == currentUser.ID;
 | 
											
												
													
														|  | -      // let roleID = flow.currentNode?.AuditRoleInfo?.ID;
 |  | 
 | 
											
												
													
														|  | -      // let item = currentUser.roleList.find(role => role.ID == roleID);
 |  | 
 | 
											
												
													
														|  | -      // if (item) return true;
 |  | 
 | 
											
												
													
														|  | -      // return false;
 |  | 
 | 
											
												
													
														|  |      };
 |  |      };
 | 
											
												
													
														|  |      return active_audit == 1 && getUserRole();
 |  |      return active_audit == 1 && getUserRole();
 | 
											
												
													
														|  |    }, [active_audit, flow, currentUser]);
 |  |    }, [active_audit, flow, currentUser]);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -  const onSave = () => {
 |  | 
 | 
											
												
													
														|  | -    let sheet1 = compareList[0];
 |  | 
 | 
											
												
													
														|  | -    Modal.confirm({
 |  | 
 | 
											
												
													
														|  | -      title: '提示',
 |  | 
 | 
											
												
													
														|  | -      content: `是否确认保存【${sheet1.version_name || sheet1.name}】`,
 |  | 
 | 
											
												
													
														|  | -      okText: '确定',
 |  | 
 | 
											
												
													
														|  | -      cancelText: '取消',
 |  | 
 | 
											
												
													
														|  | -      onOk() {
 |  | 
 | 
											
												
													
														|  | -        let sheetData = sheetRef3.current.getSheetJson().data;
 |  | 
 | 
											
												
													
														|  | -        sheetData.forEach(sheet => {
 |  | 
 | 
											
												
													
														|  | -          delete sheet.data;
 |  | 
 | 
											
												
													
														|  | -        });
 |  | 
 | 
											
												
													
														|  | -        let params = {
 |  | 
 | 
											
												
													
														|  | -          ...sheet1,
 |  | 
 | 
											
												
													
														|  | -          data: JSON.stringify(sheetData),
 |  | 
 | 
											
												
													
														|  | -        };
 |  | 
 | 
											
												
													
														|  | -        dispatch({
 |  | 
 | 
											
												
													
														|  | -          type: 'detail/commitSheet',
 |  | 
 | 
											
												
													
														|  | -          payload: params,
 |  | 
 | 
											
												
													
														|  | -          callback: () => {
 |  | 
 | 
											
												
													
														|  | -            onCompare(false);
 |  | 
 | 
											
												
													
														|  | -          },
 |  | 
 | 
											
												
													
														|  | -        });
 |  | 
 | 
											
												
													
														|  | -      },
 |  | 
 | 
											
												
													
														|  | -    });
 |  | 
 | 
											
												
													
														|  | -  };
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |    const onCompare = async checkSheets => {
 |  |    const onCompare = async checkSheets => {
 | 
											
												
													
														|  |      if (checkSheets) {
 |  |      if (checkSheets) {
 | 
											
												
													
														|  |        const [sheet1, sheet2] = checkSheets;
 |  |        const [sheet1, sheet2] = checkSheets;
 | 
											
										
											
												
													
														|  | @@ -265,15 +210,13 @@ function Detail(props) {
 | 
											
												
													
														|  |          sheet_id: s.order || '0',
 |  |          sheet_id: s.order || '0',
 | 
											
												
													
														|  |          excel_id: version.id,
 |  |          excel_id: version.id,
 | 
											
												
													
														|  |          cid: cell.cid,
 |  |          cid: cell.cid,
 | 
											
												
													
														|  | 
 |  | +        sheet_index: String(s.seq || 0),
 | 
											
												
													
														|  |        };
 |  |        };
 | 
											
												
													
														|  |        dispatch({
 |  |        dispatch({
 | 
											
												
													
														|  |          type: 'detail/queryComment',
 |  |          type: 'detail/queryComment',
 | 
											
												
													
														|  |          payload,
 |  |          payload,
 | 
											
												
													
														|  |        });
 |  |        });
 | 
											
												
													
														|  | -      cellPosition.current = {
 |  | 
 | 
											
												
													
														|  | -        ...payload,
 |  | 
 | 
											
												
													
														|  | -        sheet_index: (s.seq || 0) + '',
 |  | 
 | 
											
												
													
														|  | -      };
 |  | 
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |        // setCommentVisible(true);
 |  |        // setCommentVisible(true);
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |      // 比对模式下双excl同步选中
 |  |      // 比对模式下双excl同步选中
 | 
											
										
											
												
													
														|  | @@ -283,7 +226,7 @@ function Detail(props) {
 | 
											
												
													
														|  |      // }
 |  |      // }
 | 
											
												
													
														|  |    };
 |  |    };
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -  const onCommit = (values, id) => {
 |  | 
 | 
											
												
													
														|  | 
 |  | +  const onCommit = params => {
 | 
											
												
													
														|  |      let currentNode = flowDetail.nodes.find?.(item => item.Id == version.template_node_id);
 |  |      let currentNode = flowDetail.nodes.find?.(item => item.Id == version.template_node_id);
 | 
											
												
													
														|  |      let currentData = sheetRef.current.getSheetJson().data;
 |  |      let currentData = sheetRef.current.getSheetJson().data;
 | 
											
												
													
														|  |      let sheets = JSON.parse(JSON.stringify(currentData));
 |  |      let sheets = JSON.parse(JSON.stringify(currentData));
 | 
											
										
											
												
													
														|  | @@ -301,24 +244,12 @@ function Detail(props) {
 | 
											
												
													
														|  |      sheets.forEach(item => {
 |  |      sheets.forEach(item => {
 | 
											
												
													
														|  |        delete item.data;
 |  |        delete item.data;
 | 
											
												
													
														|  |      });
 |  |      });
 | 
											
												
													
														|  | -    let params = {
 |  | 
 | 
											
												
													
														|  | -      ...values,
 |  | 
 | 
											
												
													
														|  | -      id: id,
 |  | 
 | 
											
												
													
														|  | -      project_id: version.project_id,
 |  | 
 | 
											
												
													
														|  | -      name: version.name,
 |  | 
 | 
											
												
													
														|  | -      guid: version.guid,
 |  | 
 | 
											
												
													
														|  | -      template_id: version.template_id,
 |  | 
 | 
											
												
													
														|  | -      template_node_id: version.template_node_id,
 |  | 
 | 
											
												
													
														|  | -      flow_id: version.flow_id,
 |  | 
 | 
											
												
													
														|  | -      node_id: version.node_id,
 |  | 
 | 
											
												
													
														|  | -      new_version: '0',
 |  | 
 | 
											
												
													
														|  | -      audit_status: 0,
 |  | 
 | 
											
												
													
														|  | -      data: JSON.stringify(sheets),
 |  | 
 | 
											
												
													
														|  | -      base_id: version.id,
 |  | 
 | 
											
												
													
														|  | -    };
 |  | 
 | 
											
												
													
														|  |      dispatch({
 |  |      dispatch({
 | 
											
												
													
														|  |        type: 'detail/commitSheet',
 |  |        type: 'detail/commitSheet',
 | 
											
												
													
														|  | -      payload: params,
 |  | 
 | 
											
												
													
														|  | 
 |  | +      payload: {
 | 
											
												
													
														|  | 
 |  | +        ...params,
 | 
											
												
													
														|  | 
 |  | +        data: JSON.stringify(sheets),
 | 
											
												
													
														|  | 
 |  | +      },
 | 
											
												
													
														|  |        callback: newVersion => {
 |  |        callback: newVersion => {
 | 
											
												
													
														|  |          onCompare(false);
 |  |          onCompare(false);
 | 
											
												
													
														|  |          setCommitVisible(false);
 |  |          setCommitVisible(false);
 | 
											
										
											
												
													
														|  | @@ -486,115 +417,6 @@ function Detail(props) {
 | 
											
												
													
														|  |      });
 |  |      });
 | 
											
												
													
														|  |    };
 |  |    };
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -  const onApprove1 = (flag, taskId) => {
 |  | 
 | 
											
												
													
														|  | -    const callback = () => {
 |  | 
 | 
											
												
													
														|  | -      // 更新flow流程图
 |  | 
 | 
											
												
													
														|  | -      dispatch({
 |  | 
 | 
											
												
													
														|  | -        type: 'xflow/queryBoomFlowDetail',
 |  | 
 | 
											
												
													
														|  | -        payload: {
 |  | 
 | 
											
												
													
														|  | -          id: templateId,
 |  | 
 | 
											
												
													
														|  | -        },
 |  | 
 | 
											
												
													
														|  | -      });
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -      // 更新审批流
 |  | 
 | 
											
												
													
														|  | -      dispatch({
 |  | 
 | 
											
												
													
														|  | -        type: 'detail/queryDingInstanceDetail',
 |  | 
 | 
											
												
													
														|  | -        payload: {
 |  | 
 | 
											
												
													
														|  | -          process_instance_id: version.ding_instance_id, //创建表单成功返回的id
 |  | 
 | 
											
												
													
														|  | -        },
 |  | 
 | 
											
												
													
														|  | -      });
 |  | 
 | 
											
												
													
														|  | -    };
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -    const request = async () => {
 |  | 
 | 
											
												
													
														|  | -      let param = {
 |  | 
 | 
											
												
													
														|  | -        request: {
 |  | 
 | 
											
												
													
														|  | -          process_instance_id: version.ding_instance_id,
 |  | 
 | 
											
												
													
														|  | -          result: flag ? 'agree' : 'refuse',
 |  | 
 | 
											
												
													
														|  | -          actioner_userid: currentUser.DingUserId || getCurrentUser()?.DingUserId,
 |  | 
 | 
											
												
													
														|  | -          task_id: taskId,
 |  | 
 | 
											
												
													
														|  | -        },
 |  | 
 | 
											
												
													
														|  | -      };
 |  | 
 | 
											
												
													
														|  | -      let res = await queryDingInstanceExecute(param);
 |  | 
 | 
											
												
													
														|  | -      if (res?.data?.result) {
 |  | 
 | 
											
												
													
														|  | -        callback();
 |  | 
 | 
											
												
													
														|  | -      }
 |  | 
 | 
											
												
													
														|  | -    };
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -    let tipText = '是否通过审批。';
 |  | 
 | 
											
												
													
														|  | -    if (!flag) {
 |  | 
 | 
											
												
													
														|  | -      tipText = '是否拒绝审批。';
 |  | 
 | 
											
												
													
														|  | -      // request();
 |  | 
 | 
											
												
													
														|  | -      // return;
 |  | 
 | 
											
												
													
														|  | -    }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -    let isSingle = false;
 |  | 
 | 
											
												
													
														|  | -    let serviceNode;
 |  | 
 | 
											
												
													
														|  | -    const flowNode = flow.currentNode;
 |  | 
 | 
											
												
													
														|  | -    const getLastTemplateNodeId = data => {
 |  | 
 | 
											
												
													
														|  | -      let result;
 |  | 
 | 
											
												
													
														|  | -      const getFun = item => {
 |  | 
 | 
											
												
													
														|  | -        if (item.flow_path?.length > 0) {
 |  | 
 | 
											
												
													
														|  | -          getFun(item.flow_path[0]);
 |  | 
 | 
											
												
													
														|  | -        } else {
 |  | 
 | 
											
												
													
														|  | -          result = item.template_node_id;
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -      };
 |  | 
 | 
											
												
													
														|  | -      if (!data) return version.template_node_id;
 |  | 
 | 
											
												
													
														|  | -      getFun(data[0]);
 |  | 
 | 
											
												
													
														|  | -      return result;
 |  | 
 | 
											
												
													
														|  | -    };
 |  | 
 | 
											
												
													
														|  | -    let lastTemplateNodeId = version.template_node_id;
 |  | 
 | 
											
												
													
														|  | -    if (version.flow_path) {
 |  | 
 | 
											
												
													
														|  | -      //如果多节点审批  获取当前是否审批流程的最后一个审批节点
 |  | 
 | 
											
												
													
														|  | -      let flowPathList = JSON.parse(version.flow_path);
 |  | 
 | 
											
												
													
														|  | -      lastTemplateNodeId = getLastTemplateNodeId(flowPathList);
 |  | 
 | 
											
												
													
														|  | -    }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -    // 判断是否为最后一个审批节点
 |  | 
 | 
											
												
													
														|  | -    if (
 |  | 
 | 
											
												
													
														|  | -      lastTemplateNodeId == version.template_node_id &&
 |  | 
 | 
											
												
													
														|  | -      flow.current == flow.list.FlowNodes.length - 1
 |  | 
 | 
											
												
													
														|  | -    ) {
 |  | 
 | 
											
												
													
														|  | -      serviceNode = flowDetail.nodes.find?.(item => item.Id == version.next_template_node_id);
 |  | 
 | 
											
												
													
														|  | -      if (!serviceNode.muti_version) {
 |  | 
 | 
											
												
													
														|  | -        //audit_status=4 表示为清单推进后留存的副本.不计入多清单计算
 |  | 
 | 
											
												
													
														|  | -        isSingle = versionList.find(
 |  | 
 | 
											
												
													
														|  | -          item => item.audit_status != 4 && item.template_node_id == serviceNode.Id
 |  | 
 | 
											
												
													
														|  | -        );
 |  | 
 | 
											
												
													
														|  | -        if (isSingle) tipText = `节点【${serviceNode.label}】只能拥有一个清单,是否覆盖?`;
 |  | 
 | 
											
												
													
														|  | -      }
 |  | 
 | 
											
												
													
														|  | -    }
 |  | 
 | 
											
												
													
														|  | -    Modal.confirm({
 |  | 
 | 
											
												
													
														|  | -      title: '提示',
 |  | 
 | 
											
												
													
														|  | -      content: tipText,
 |  | 
 | 
											
												
													
														|  | -      okText: '确定',
 |  | 
 | 
											
												
													
														|  | -      cancelText: '取消',
 |  | 
 | 
											
												
													
														|  | -      onOk: () => {
 |  | 
 | 
											
												
													
														|  | -        request();
 |  | 
 | 
											
												
													
														|  | -      },
 |  | 
 | 
											
												
													
														|  | -    });
 |  | 
 | 
											
												
													
														|  | -  };
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -  const onMerge = () => {
 |  | 
 | 
											
												
													
														|  | -    const [sheet1, sheet2] = compareList;
 |  | 
 | 
											
												
													
														|  | -    Modal.confirm({
 |  | 
 | 
											
												
													
														|  | -      title: '提示',
 |  | 
 | 
											
												
													
														|  | -      content: `是否确认将【${sheet2.version_name}】改动的内容同步至【${sheet1.version_name ||
 |  | 
 | 
											
												
													
														|  | -        sheet1.name}】`,
 |  | 
 | 
											
												
													
														|  | -      okText: '确定',
 |  | 
 | 
											
												
													
														|  | -      cancelText: '取消',
 |  | 
 | 
											
												
													
														|  | -      onOk() {
 |  | 
 | 
											
												
													
														|  | -        // let sheet2Data = sheetRef2.current.getSheetJson()
 |  | 
 | 
											
												
													
														|  | -        sheetRef3.current.mergeExcl(sheetRef2.current.updateCell);
 |  | 
 | 
											
												
													
														|  | -        // setCompareList([...compareList]);
 |  | 
 | 
											
												
													
														|  | -        // let currentData = sheetRef3.current.getSheetJson()
 |  | 
 | 
											
												
													
														|  | -        // // 更新后重新比对
 |  | 
 | 
											
												
													
														|  | -        // sheetRef2.current.toggleCompare(false);
 |  | 
 | 
											
												
													
														|  | -        // sheetRef2.current.toggleCompare(true, currentData);
 |  | 
 | 
											
												
													
														|  | -      },
 |  | 
 | 
											
												
													
														|  | -    });
 |  | 
 | 
											
												
													
														|  | -  };
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |    const onMergeVersion = async sheet2 => {
 |  |    const onMergeVersion = async sheet2 => {
 | 
											
												
													
														|  |      // const [sheet1, sheet2] = checkSheets;
 |  |      // const [sheet1, sheet2] = checkSheets;
 | 
											
												
													
														|  |      const sheet1 = version;
 |  |      const sheet1 = version;
 | 
											
										
											
												
													
														|  | @@ -620,22 +442,8 @@ function Detail(props) {
 | 
											
												
													
														|  |      // }, 400);
 |  |      // }, 400);
 | 
											
												
													
														|  |    };
 |  |    };
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -  const handleClickFile = () => {
 |  | 
 | 
											
												
													
														|  | -    fileRef.current.click();
 |  | 
 | 
											
												
													
														|  | -  };
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |    const handleMenuClick = e => {
 |  |    const handleMenuClick = e => {
 | 
											
												
													
														|  |      switch (e.key) {
 |  |      switch (e.key) {
 | 
											
												
													
														|  | -      case 'back':
 |  | 
 | 
											
												
													
														|  | -        // 返回
 |  | 
 | 
											
												
													
														|  | -        router.push(`/bom`);
 |  | 
 | 
											
												
													
														|  | -        break;
 |  | 
 | 
											
												
													
														|  | -      // case 'version':
 |  | 
 | 
											
												
													
														|  | -      //   // 清单
 |  | 
 | 
											
												
													
														|  | -      //   queryHistory();
 |  | 
 | 
											
												
													
														|  | -      //   setCommentVisible(false);
 |  | 
 | 
											
												
													
														|  | -      //   setHistoryVisible(true);
 |  | 
 | 
											
												
													
														|  | -      //   break;
 |  | 
 | 
											
												
													
														|  |        case 'bomDetail':
 |  |        case 'bomDetail':
 | 
											
												
													
														|  |          // 清单
 |  |          // 清单
 | 
											
												
													
														|  |          setCommentVisible(true);
 |  |          setCommentVisible(true);
 | 
											
										
											
												
													
														|  | @@ -648,147 +456,19 @@ function Detail(props) {
 | 
											
												
													
														|  |          // 提交流转
 |  |          // 提交流转
 | 
											
												
													
														|  |          setCommitAuditVisible(true);
 |  |          setCommitAuditVisible(true);
 | 
											
												
													
														|  |          break;
 |  |          break;
 | 
											
												
													
														|  | -      case 'flow':
 |  | 
 | 
											
												
													
														|  | -        // 查看流程
 |  | 
 | 
											
												
													
														|  | -        setFlowVisible(true);
 |  | 
 | 
											
												
													
														|  | -        break;
 |  | 
 | 
											
												
													
														|  |        case 'compare':
 |  |        case 'compare':
 | 
											
												
													
														|  |          // 比对
 |  |          // 比对
 | 
											
												
													
														|  |          setCompareVisible(true);
 |  |          setCompareVisible(true);
 | 
											
												
													
														|  |          break;
 |  |          break;
 | 
											
												
													
														|  | -      case 'template':
 |  | 
 | 
											
												
													
														|  | -        // 模板
 |  | 
 | 
											
												
													
														|  | -        handleClickFile();
 |  | 
 | 
											
												
													
														|  | -        break;
 |  | 
 | 
											
												
													
														|  | -      // case 'auditSuccess':
 |  | 
 | 
											
												
													
														|  | -      //   // 审核通过
 |  | 
 | 
											
												
													
														|  | -      //   onApprove(true);
 |  | 
 | 
											
												
													
														|  | -      //   break;
 |  | 
 | 
											
												
													
														|  | -      // case 'auditFailed':
 |  | 
 | 
											
												
													
														|  | -      //   // 审核拒绝
 |  | 
 | 
											
												
													
														|  | -      //   onApprove(false);
 |  | 
 | 
											
												
													
														|  | -      //   break;
 |  | 
 | 
											
												
													
														|  | -      // case 'edit':
 |  | 
 | 
											
												
													
														|  | -      //   // 编辑
 |  | 
 | 
											
												
													
														|  | -      //   handleEdit(true);
 |  | 
 | 
											
												
													
														|  |        case 'merge':
 |  |        case 'merge':
 | 
											
												
													
														|  |          // 同步清单
 |  |          // 同步清单
 | 
											
												
													
														|  |          setMergeVisible(true);
 |  |          setMergeVisible(true);
 | 
											
												
													
														|  |          break;
 |  |          break;
 | 
											
												
													
														|  | -      case 'commit':
 |  | 
 | 
											
												
													
														|  | -        // 提交
 |  | 
 | 
											
												
													
														|  | -        // handleClickCommit();
 |  | 
 | 
											
												
													
														|  | -        setCommitVisible(true);
 |  | 
 | 
											
												
													
														|  | -        setCommentVisible(false);
 |  | 
 | 
											
												
													
														|  | -        break;
 |  | 
 | 
											
												
													
														|  | -      case 'attachment':
 |  | 
 | 
											
												
													
														|  | -        // 附件
 |  | 
 | 
											
												
													
														|  | -        setFileVisible(true);
 |  | 
 | 
											
												
													
														|  | -        queryFiles();
 |  | 
 | 
											
												
													
														|  | -        break;
 |  | 
 | 
											
												
													
														|  | -    }
 |  | 
 | 
											
												
													
														|  | -  };
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -  const renderBtns = () => {
 |  | 
 | 
											
												
													
														|  | -    // 判断是否为比对模式
 |  | 
 | 
											
												
													
														|  | -    if (compareList.length == 2) {
 |  | 
 | 
											
												
													
														|  | -      // 判断是否为同步最新清单的比对
 |  | 
 | 
											
												
													
														|  | -      if (isMerge) {
 |  | 
 | 
											
												
													
														|  | -        return (
 |  | 
 | 
											
												
													
														|  | -          <>
 |  | 
 | 
											
												
													
														|  | -            <Button type="primary" onClick={() => onSave()}>
 |  | 
 | 
											
												
													
														|  | -              保存
 |  | 
 | 
											
												
													
														|  | -            </Button>
 |  | 
 | 
											
												
													
														|  | -            <Button onClick={() => onMerge()}>同步新增内容</Button>
 |  | 
 | 
											
												
													
														|  | -            <Button onClick={() => onCompare(false)}>取消同步</Button>
 |  | 
 | 
											
												
													
														|  | -          </>
 |  | 
 | 
											
												
													
														|  | -        );
 |  | 
 | 
											
												
													
														|  | -      } else {
 |  | 
 | 
											
												
													
														|  | -        return <Button onClick={() => onCompare(false)}>取消比对</Button>;
 |  | 
 | 
											
												
													
														|  | -      }
 |  | 
 | 
											
												
													
														|  | -    }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -    const menuList = [
 |  | 
 | 
											
												
													
														|  | -      <Menu.Item key="back">返回</Menu.Item>,
 |  | 
 | 
											
												
													
														|  | -      <Menu.Item key="bomDetail">详情</Menu.Item>,
 |  | 
 | 
											
												
													
														|  | -      <Menu.Item key="export">导出</Menu.Item>,
 |  | 
 | 
											
												
													
														|  | -      <Menu.Item key="compare">比对</Menu.Item>,
 |  | 
 | 
											
												
													
														|  | -      // <Menu.Item key="attachment">附件</Menu.Item>,
 |  | 
 | 
											
												
													
														|  | -    ];
 |  | 
 | 
											
												
													
														|  | -    // version.audit_status:4 为副本。不可操作
 |  | 
 | 
											
												
													
														|  | -    if (version.audit_status != 4) {
 |  | 
 | 
											
												
													
														|  | -      //判断权限配置,如果配置了,就指定权限的人可提交,没配置就全部人都可提交
 |  | 
 | 
											
												
													
														|  | -      //判断分类,这个清单所属分类的操作人可以提交
 |  | 
 | 
											
												
													
														|  | -      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;
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -        return bool;
 |  | 
 | 
											
												
													
														|  | -      };
 |  | 
 | 
											
												
													
														|  | -      if (getIsSubmit() && version.audit_status != 3)
 |  | 
 | 
											
												
													
														|  | -        menuList.push(<Menu.Item key="commitAudit">提交流转</Menu.Item>);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -      if (!isAuditor && canEdit() && !version.flow_id) {
 |  | 
 | 
											
												
													
														|  | -        // menuList.push(<Menu.Item key="edit">编辑</Menu.Item>);
 |  | 
 | 
											
												
													
														|  | -        menuList.push(<Menu.Item key="merge">同步</Menu.Item>);
 |  | 
 | 
											
												
													
														|  | -        // menuList.push(<Menu.Item key="commit">提交</Menu.Item>);
 |  | 
 | 
											
												
													
														|  | -        // if (history.list.length > 0) {
 |  | 
 | 
											
												
													
														|  | -        //   menuList.push(<Menu.Item key="approval">申请审批</Menu.Item>);
 |  | 
 | 
											
												
													
														|  | -        // }
 |  | 
 | 
											
												
													
														|  | -      }
 |  | 
 | 
											
												
													
														|  | -    }
 |  | 
 | 
											
												
													
														|  | -    return (
 |  | 
 | 
											
												
													
														|  | -      <>
 |  | 
 | 
											
												
													
														|  | -        <Dropdown overlay={<Menu onClick={handleMenuClick}>{menuList}</Menu>}>
 |  | 
 | 
											
												
													
														|  | -          <UnorderedListOutlined style={{ fontSize: 30, cursor: 'pointer' }} />
 |  | 
 | 
											
												
													
														|  | -        </Dropdown>
 |  | 
 | 
											
												
													
														|  | -      </>
 |  | 
 | 
											
												
													
														|  | -    );
 |  | 
 | 
											
												
													
														|  | -  };
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -  const canEdit = () => {
 |  | 
 | 
											
												
													
														|  | -    if (flow.list.FlowNodes.length - 1 == flow.current && active_audit == 3) return false;
 |  | 
 | 
											
												
													
														|  | -    return active_audit != 1;
 |  | 
 | 
											
												
													
														|  | -  };
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -  const renderAlert = () => {
 |  | 
 | 
											
												
													
														|  | -    const audit_comment = history.list[0]?.audit_comment;
 |  | 
 | 
											
												
													
														|  | -    let item = '';
 |  | 
 | 
											
												
													
														|  | -    switch (active_audit) {
 |  | 
 | 
											
												
													
														|  | -      case 0:
 |  | 
 | 
											
												
													
														|  | -        if (!flow.list || flow.list.FlowNodes?.length == 0) return;
 |  | 
 | 
											
												
													
														|  | -        item = <Alert message="审批拒绝" type="error" />;
 |  | 
 | 
											
												
													
														|  | -        break;
 |  | 
 | 
											
												
													
														|  | -      case 1:
 |  | 
 | 
											
												
													
														|  | -        item = <Alert message="等待审核中" type="info" />;
 |  | 
 | 
											
												
													
														|  | -        break;
 |  | 
 | 
											
												
													
														|  | -      case 2:
 |  | 
 | 
											
												
													
														|  | -        item = (
 |  | 
 | 
											
												
													
														|  | -          <Alert
 |  | 
 | 
											
												
													
														|  | -            message={`审批被拒绝${
 |  | 
 | 
											
												
													
														|  | -              audit_comment ? `,拒绝原因:${audit_comment}` : ''
 |  | 
 | 
											
												
													
														|  | -            }。请修改后重新提交`}
 |  | 
 | 
											
												
													
														|  | -            type="error"
 |  | 
 | 
											
												
													
														|  | -          />
 |  | 
 | 
											
												
													
														|  | -        );
 |  | 
 | 
											
												
													
														|  | -        break;
 |  | 
 | 
											
												
													
														|  | -      case 3:
 |  | 
 | 
											
												
													
														|  | -        item = <Alert message="审批通过" type="success" />;
 |  | 
 | 
											
												
													
														|  | 
 |  | +      case 'compare':
 | 
											
												
													
														|  | 
 |  | +        // 同步
 | 
											
												
													
														|  | 
 |  | +        onCompare(e.data);
 | 
											
												
													
														|  |          break;
 |  |          break;
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -    return <div style={{ marginTop: 20 }}>{item}</div>;
 |  | 
 | 
											
												
													
														|  |    };
 |  |    };
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |    const exportExcl = files => {
 |  |    const exportExcl = files => {
 | 
											
										
											
												
													
														|  | @@ -830,16 +510,6 @@ function Detail(props) {
 | 
											
												
													
														|  |      });
 |  |      });
 | 
											
												
													
														|  |    };
 |  |    };
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -  const queryFiles = () => {
 |  | 
 | 
											
												
													
														|  | -    dispatch({
 |  | 
 | 
											
												
													
														|  | -      type: 'detail/queryFiles',
 |  | 
 | 
											
												
													
														|  | -      payload: {
 |  | 
 | 
											
												
													
														|  | -        // excel_id: id || excelId,
 |  | 
 | 
											
												
													
														|  | -        excel_id: projectId,
 |  | 
 | 
											
												
													
														|  | -      },
 |  | 
 | 
											
												
													
														|  | -    });
 |  | 
 | 
											
												
													
														|  | -  };
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |    const getUploadProps = () => {
 |  |    const getUploadProps = () => {
 | 
											
												
													
														|  |      const token = getToken() || GetTokenFromUrl();
 |  |      const token = getToken() || GetTokenFromUrl();
 | 
											
												
													
														|  |      const uploadProps = {
 |  |      const uploadProps = {
 | 
											
										
											
												
													
														|  | @@ -868,16 +538,7 @@ function Detail(props) {
 | 
											
												
													
														|  |      return uploadProps;
 |  |      return uploadProps;
 | 
											
												
													
														|  |    };
 |  |    };
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -  const deleteFile = id => {
 |  | 
 | 
											
												
													
														|  | -    dispatch({
 |  | 
 | 
											
												
													
														|  | -      type: 'detail/deleteFiles',
 |  | 
 | 
											
												
													
														|  | -      id: id,
 |  | 
 | 
											
												
													
														|  | -      callback: () => {
 |  | 
 | 
											
												
													
														|  | -        queryFiles();
 |  | 
 | 
											
												
													
														|  | -      },
 |  | 
 | 
											
												
													
														|  | -    });
 |  | 
 | 
											
												
													
														|  | -  };
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | 
 |  | + 
 | 
											
												
													
														|  |    const queryHistoryDetail = async item => {
 |  |    const queryHistoryDetail = async item => {
 | 
											
												
													
														|  |      return new Promise(resolve => {
 |  |      return new Promise(resolve => {
 | 
											
												
													
														|  |        dispatch({
 |  |        dispatch({
 | 
											
										
											
												
													
														|  | @@ -903,10 +564,6 @@ function Detail(props) {
 | 
											
												
													
														|  |      return loading.effects['detail/queryFiles'];
 |  |      return loading.effects['detail/queryFiles'];
 | 
											
												
													
														|  |    };
 |  |    };
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -  const downloadFile = record => {
 |  | 
 | 
											
												
													
														|  | -    window.location.href = `${record.url}`;
 |  | 
 | 
											
												
													
														|  | -  };
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |    const changeVersion = id => {
 |  |    const changeVersion = id => {
 | 
											
												
													
														|  |      let version;
 |  |      let version;
 | 
											
												
													
														|  |      if (typeof id == 'object') {
 |  |      if (typeof id == 'object') {
 | 
											
										
											
												
													
														|  | @@ -947,13 +604,6 @@ function Detail(props) {
 | 
											
												
													
														|  |        payload: values,
 |  |        payload: values,
 | 
											
												
													
														|  |        callback: newVersion => {
 |  |        callback: newVersion => {
 | 
											
												
													
														|  |          setCommitAuditVisible(false);
 |  |          setCommitAuditVisible(false);
 | 
											
												
													
														|  | -        // 更新version
 |  | 
 | 
											
												
													
														|  | -        // localStorage.excelId = newVersion.id;
 |  | 
 | 
											
												
													
														|  | -        // changeVersion({
 |  | 
 | 
											
												
													
														|  | -        //   ...version,
 |  | 
 | 
											
												
													
														|  | -        //   ...newVersion,
 |  | 
 | 
											
												
													
														|  | -        //   version_id: version.id
 |  | 
 | 
											
												
													
														|  | -        // });
 |  | 
 | 
											
												
													
														|  |          // 更新flow流程图
 |  |          // 更新flow流程图
 | 
											
												
													
														|  |          dispatch({
 |  |          dispatch({
 | 
											
												
													
														|  |            type: 'xflow/queryBoomFlowDetail',
 |  |            type: 'xflow/queryBoomFlowDetail',
 | 
											
										
											
												
													
														|  | @@ -974,52 +624,6 @@ function Detail(props) {
 | 
											
												
													
														|  |      } catch (error) {}
 |  |      } catch (error) {}
 | 
											
												
													
														|  |    };
 |  |    };
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -  const renderNode = () => {
 |  | 
 | 
											
												
													
														|  | -    const nodeId = version.template_node_id;
 |  | 
 | 
											
												
													
														|  | -    if (!flowDetail?.nodes || !nodeId) return;
 |  | 
 | 
											
												
													
														|  | -    const node = flowDetail.nodes.find(item => item.Id == nodeId);
 |  | 
 | 
											
												
													
														|  | -    // return `当前清单:${version.version_name || '-'};    当前节点:${node?.label || '-'}`;
 |  | 
 | 
											
												
													
														|  | -    return (
 |  | 
 | 
											
												
													
														|  | -      <span className={styles.curTitle}>
 |  | 
 | 
											
												
													
														|  | -        当前清单: <span>{version.version_name || '-'}</span>当前节点:{' '}
 |  | 
 | 
											
												
													
														|  | -        <span>{node?.label || '-'}</span>
 |  | 
 | 
											
												
													
														|  | -      </span>
 |  | 
 | 
											
												
													
														|  | -    );
 |  | 
 | 
											
												
													
														|  | -  };
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -  const handleSubmitCell = (value, callback) => {
 |  | 
 | 
											
												
													
														|  | -    if (!value) return;
 |  | 
 | 
											
												
													
														|  | -    dispatch({
 |  | 
 | 
											
												
													
														|  | -      type: 'detail/addComment',
 |  | 
 | 
											
												
													
														|  | -      payload: {
 |  | 
 | 
											
												
													
														|  | -        ...cellPosition.current,
 |  | 
 | 
											
												
													
														|  | -        comment: value,
 |  | 
 | 
											
												
													
														|  | -      },
 |  | 
 | 
											
												
													
														|  | -      callback,
 |  | 
 | 
											
												
													
														|  | -    });
 |  | 
 | 
											
												
													
														|  | -  };
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -  const onDelVersion = data => {
 |  | 
 | 
											
												
													
														|  | -    Modal.confirm({
 |  | 
 | 
											
												
													
														|  | -      title: '提示',
 |  | 
 | 
											
												
													
														|  | -      content: `是否确认删除清单?`,
 |  | 
 | 
											
												
													
														|  | -      okText: '确定',
 |  | 
 | 
											
												
													
														|  | -      cancelText: '取消',
 |  | 
 | 
											
												
													
														|  | -      onOk: async () => {
 |  | 
 | 
											
												
													
														|  | -        const res = await queryDelPurchaseExcel(data);
 |  | 
 | 
											
												
													
														|  | -        if (res.code == 200) {
 |  | 
 | 
											
												
													
														|  | -          message.success('删除成功');
 |  | 
 | 
											
												
													
														|  | -          dispatch({
 |  | 
 | 
											
												
													
														|  | -            type: 'xflow/queryBoomFlowDetail',
 |  | 
 | 
											
												
													
														|  | -            payload: {
 |  | 
 | 
											
												
													
														|  | -              id: templateId,
 |  | 
 | 
											
												
													
														|  | -            },
 |  | 
 | 
											
												
													
														|  | -          });
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -      },
 |  | 
 | 
											
												
													
														|  | -    });
 |  | 
 | 
											
												
													
														|  | -  };
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |    useEffect(() => {
 |  |    useEffect(() => {
 | 
											
												
													
														|  |      dispatch({
 |  |      dispatch({
 | 
											
												
													
														|  |        type: 'detail/queryProjectRecord',
 |  |        type: 'detail/queryProjectRecord',
 | 
											
										
											
												
													
														|  | @@ -1088,16 +692,8 @@ function Detail(props) {
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |    }, [versionList]);
 |  |    }, [versionList]);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -  const excelFileData = useMemo(() => {
 |  | 
 | 
											
												
													
														|  | -    return excelFileList?.map(item => {
 |  | 
 | 
											
												
													
														|  | -      const list = item.url.split('/');
 |  | 
 | 
											
												
													
														|  | -      const name = list[list.length - 1];
 |  | 
 | 
											
												
													
														|  | -      return { name, url: item.url };
 |  | 
 | 
											
												
													
														|  | -    });
 |  | 
 | 
											
												
													
														|  | -  }, [excelFileList]);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |    return (
 |  |    return (
 | 
											
												
													
														|  | -    <Spin spinning={false}>
 |  | 
 | 
											
												
													
														|  | 
 |  | +    <div>
 | 
											
												
													
														|  |        <div className={styles.top}>
 |  |        <div className={styles.top}>
 | 
											
												
													
														|  |          <div>
 |  |          <div>
 | 
											
												
													
														|  |            <Button type="primary" style={{ marginRight: 20 }} onClick={() => setFlowVisible(true)}>
 |  |            <Button type="primary" style={{ marginRight: 20 }} onClick={() => setFlowVisible(true)}>
 | 
											
										
											
												
													
														|  | @@ -1110,7 +706,7 @@ function Detail(props) {
 | 
											
												
													
														|  |                新建清单
 |  |                新建清单
 | 
											
												
													
														|  |              </Button>
 |  |              </Button>
 | 
											
												
													
														|  |            )}
 |  |            )}
 | 
											
												
													
														|  | -          {renderNode()}
 |  | 
 | 
											
												
													
														|  | 
 |  | +          <CurrentInfo version={version} flowDetail={flowDetail} />
 | 
											
												
													
														|  |          </div>
 |  |          </div>
 | 
											
												
													
														|  |          <div className={styles.btns}>
 |  |          <div className={styles.btns}>
 | 
											
												
													
														|  |            <Button
 |  |            <Button
 | 
											
										
											
												
													
														|  | @@ -1131,7 +727,19 @@ function Detail(props) {
 | 
											
												
													
														|  |                </Avatar>
 |  |                </Avatar>
 | 
											
												
													
														|  |              ))}
 |  |              ))}
 | 
											
												
													
														|  |            </Avatar.Group>
 |  |            </Avatar.Group>
 | 
											
												
													
														|  | -          {renderBtns()}
 |  | 
 | 
											
												
													
														|  | 
 |  | +          <DropdownMenu
 | 
											
												
													
														|  | 
 |  | +            compareList={compareList}
 | 
											
												
													
														|  | 
 |  | +            isMerge={isMerge}
 | 
											
												
													
														|  | 
 |  | +            version={version}
 | 
											
												
													
														|  | 
 |  | +            flowDetail={flowDetail}
 | 
											
												
													
														|  | 
 |  | +            classifyList={classifyList}
 | 
											
												
													
														|  | 
 |  | +            currentUser={currentUser}
 | 
											
												
													
														|  | 
 |  | +            isAuditor={isAuditor}
 | 
											
												
													
														|  | 
 |  | +            flow={flow}
 | 
											
												
													
														|  | 
 |  | +            sheetRef3={sheetRef3}
 | 
											
												
													
														|  | 
 |  | +            onClick={handleMenuClick}
 | 
											
												
													
														|  | 
 |  | +            setVersion={setVersion}
 | 
											
												
													
														|  | 
 |  | +          />
 | 
											
												
													
														|  |          </div>
 |  |          </div>
 | 
											
												
													
														|  |          <input
 |  |          <input
 | 
											
												
													
														|  |            type="file"
 |  |            type="file"
 | 
											
										
											
												
													
														|  | @@ -1141,11 +749,7 @@ function Detail(props) {
 | 
											
												
													
														|  |          />
 |  |          />
 | 
											
												
													
														|  |        </div>
 |  |        </div>
 | 
											
												
													
														|  |        <TimeNode flow={flow} isAuditor={isAuditor} onApprove={onApprove}></TimeNode>
 |  |        <TimeNode flow={flow} isAuditor={isAuditor} onApprove={onApprove}></TimeNode>
 | 
											
												
													
														|  | -      {/* {version.flow_id ? (
 |  | 
 | 
											
												
													
														|  | -        <AuditFlow {...auditDetail} canShowAudit={true} onApprove={onApprove} />
 |  | 
 | 
											
												
													
														|  | -      ) : null} */}
 |  | 
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -      {/* {renderAlert()} */}
 |  | 
 | 
											
												
													
														|  |        {/* 判断是否为比对模式 */}
 |  |        {/* 判断是否为比对模式 */}
 | 
											
												
													
														|  |        {compareList.length == 2 ? (
 |  |        {compareList.length == 2 ? (
 | 
											
												
													
														|  |          <>
 |  |          <>
 | 
											
										
											
												
													
														|  | @@ -1181,18 +785,11 @@ function Detail(props) {
 | 
											
												
													
														|  |        />
 |  |        />
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |        <FormAndFilesNode
 |  |        <FormAndFilesNode
 | 
											
												
													
														|  | -        title="表单信息及附件"
 |  | 
 | 
											
												
													
														|  |          formData={version?.ding_schema}
 |  |          formData={version?.ding_schema}
 | 
											
												
													
														|  | -        excelFileData={excelFileData}
 |  | 
 | 
											
												
													
														|  | -        loading={loading.effects['detail/QueryExcelFiles']}
 |  | 
 | 
											
												
													
														|  | -        downloadFile={downloadFile}
 |  | 
 | 
											
												
													
														|  | -      />
 |  | 
 | 
											
												
													
														|  | -      <CommentContent
 |  | 
 | 
											
												
													
														|  | -        title="单元格沟通记录"
 |  | 
 | 
											
												
													
														|  | -        comment={comment}
 |  | 
 | 
											
												
													
														|  | -        onSubmit={handleSubmitCell}
 |  | 
 | 
											
												
													
														|  | -        loading={loading.effects['detail/queryComment'] || loading.effects['detail/addComment']}
 |  | 
 | 
											
												
													
														|  | 
 |  | +        excelFileList={excelFileList}
 | 
											
												
													
														|  | 
 |  | +        version={version}
 | 
											
												
													
														|  |        />
 |  |        />
 | 
											
												
													
														|  | 
 |  | +      {/* <CommentContent title="单元格沟通记录" /> */}
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |        <RightDrawer
 |  |        <RightDrawer
 | 
											
												
													
														|  |          version={version}
 |  |          version={version}
 | 
											
										
											
												
													
														|  | @@ -1221,10 +818,10 @@ function Detail(props) {
 | 
											
												
													
														|  |          typeOptions={typeOptions}
 |  |          typeOptions={typeOptions}
 | 
											
												
													
														|  |          flowDetail={flowDetail}
 |  |          flowDetail={flowDetail}
 | 
											
												
													
														|  |          visible={flowVisible}
 |  |          visible={flowVisible}
 | 
											
												
													
														|  | 
 |  | +        templateId={templateId}
 | 
											
												
													
														|  |          onClose={() => setFlowVisible(false)}
 |  |          onClose={() => setFlowVisible(false)}
 | 
											
												
													
														|  |          version={version}
 |  |          version={version}
 | 
											
												
													
														|  |          onChangeVersion={version => changeVersion(version)}
 |  |          onChangeVersion={version => changeVersion(version)}
 | 
											
												
													
														|  | -        onDelVersion={onDelVersion}
 |  | 
 | 
											
												
													
														|  |        />
 |  |        />
 | 
											
												
													
														|  |        <AuditModal
 |  |        <AuditModal
 | 
											
												
													
														|  |          loading={getLoading()}
 |  |          loading={getLoading()}
 | 
											
										
											
												
													
														|  | @@ -1246,10 +843,14 @@ function Detail(props) {
 | 
											
												
													
														|  |        /> */}
 |  |        /> */}
 | 
											
												
													
														|  |        <VersionModal
 |  |        <VersionModal
 | 
											
												
													
														|  |          typeOptions={typeOptions}
 |  |          typeOptions={typeOptions}
 | 
											
												
													
														|  | -        loading={getLoading()}
 |  | 
 | 
											
												
													
														|  |          visible={versionVisible}
 |  |          visible={versionVisible}
 | 
											
												
													
														|  | 
 |  | +        flowDetail={flowDetail}
 | 
											
												
													
														|  | 
 |  | +        sheetRef={sheetRef}
 | 
											
												
													
														|  | 
 |  | +        versionList={versionList}
 | 
											
												
													
														|  | 
 |  | +        version={version}
 | 
											
												
													
														|  |          onClose={() => setVersionVisible(false)}
 |  |          onClose={() => setVersionVisible(false)}
 | 
											
												
													
														|  |          onOk={values => onCommit(values)}
 |  |          onOk={values => onCommit(values)}
 | 
											
												
													
														|  | 
 |  | +        loading={getLoading()}
 | 
											
												
													
														|  |        />
 |  |        />
 | 
											
												
													
														|  |        <CommitAuditModal
 |  |        <CommitAuditModal
 | 
											
												
													
														|  |          uploadProps={getUploadProps()}
 |  |          uploadProps={getUploadProps()}
 | 
											
										
											
												
													
														|  | @@ -1260,24 +861,19 @@ function Detail(props) {
 | 
											
												
													
														|  |          onOk={onSubmitNextNode}
 |  |          onOk={onSubmitNextNode}
 | 
											
												
													
														|  |          luckysheet={sheetRef}
 |  |          luckysheet={sheetRef}
 | 
											
												
													
														|  |        />
 |  |        />
 | 
											
												
													
														|  | -    </Spin>
 |  | 
 | 
											
												
													
														|  | 
 |  | +    </div>
 | 
											
												
													
														|  |    );
 |  |    );
 | 
											
												
													
														|  |  }
 |  |  }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  export default connect(({ detail, user, xflow, loading }) => ({
 |  |  export default connect(({ detail, user, xflow, loading }) => ({
 | 
											
												
													
														|  |    flowDetail: xflow.flowDetail,
 |  |    flowDetail: xflow.flowDetail,
 | 
											
												
													
														|  |    auditList: detail.auditList,
 |  |    auditList: detail.auditList,
 | 
											
												
													
														|  | -  fileList: detail.fileList,
 |  | 
 | 
											
												
													
														|  | -  history: detail.history,
 |  | 
 | 
											
												
													
														|  | -  comment: detail.comment,
 |  | 
 | 
											
												
													
														|  |    instanceDetail: detail.dingInstanceDetail,
 |  |    instanceDetail: detail.dingInstanceDetail,
 | 
											
												
													
														|  |    currentUser: user.currentUser,
 |  |    currentUser: user.currentUser,
 | 
											
												
													
														|  | -  roleList: detail.roleList,
 |  | 
 | 
											
												
													
														|  |    versionList: detail.versionList,
 |  |    versionList: detail.versionList,
 | 
											
												
													
														|  |    versionTree: detail.versionTree,
 |  |    versionTree: detail.versionTree,
 | 
											
												
													
														|  |    typeOptions: detail.typeOptions,
 |  |    typeOptions: detail.typeOptions,
 | 
											
												
													
														|  |    classifyList: detail.classifyList,
 |  |    classifyList: detail.classifyList,
 | 
											
												
													
														|  | -  OSSData: detail.OSSData,
 |  | 
 | 
											
												
													
														|  |    excelFileList: detail.excelFileList,
 |  |    excelFileList: detail.excelFileList,
 | 
											
												
													
														|  |    loading,
 |  |    loading,
 | 
											
												
													
														|  |  }))(Detail);
 |  |  }))(Detail);
 |