Browse Source

删除bom清单相关内容

xjj 2 years ago
parent
commit
d934ce9aba
44 changed files with 53 additions and 7191 deletions
  1. 2 2
      config/config.js
  2. 1 42
      config/router.config.js
  3. 0 102
      src/pages/PurchaseAdmin/PurchaseList/Detail/ApprovalProcess.tsx
  4. 0 130
      src/pages/PurchaseAdmin/PurchaseList/Detail/AuditDetailed.js
  5. 0 271
      src/pages/PurchaseAdmin/PurchaseList/Detail/AuditFlow.js
  6. 0 34
      src/pages/PurchaseAdmin/PurchaseList/Detail/AuditModal.js
  7. 0 83
      src/pages/PurchaseAdmin/PurchaseList/Detail/CommentDrawer.js
  8. 0 561
      src/pages/PurchaseAdmin/PurchaseList/Detail/CommitAuditModal.js
  9. 0 37
      src/pages/PurchaseAdmin/PurchaseList/Detail/CommitModal.js
  10. 0 93
      src/pages/PurchaseAdmin/PurchaseList/Detail/CompareModal.js
  11. 0 97
      src/pages/PurchaseAdmin/PurchaseList/Detail/ExportModal.js
  12. 0 95
      src/pages/PurchaseAdmin/PurchaseList/Detail/FilesModal.js
  13. 0 365
      src/pages/PurchaseAdmin/PurchaseList/Detail/FlowModal.js
  14. 0 112
      src/pages/PurchaseAdmin/PurchaseList/Detail/HistoryDrawer.js
  15. 0 40
      src/pages/PurchaseAdmin/PurchaseList/Detail/HistoryModal.js
  16. 0 1175
      src/pages/PurchaseAdmin/PurchaseList/Detail/Index.js
  17. 0 59
      src/pages/PurchaseAdmin/PurchaseList/Detail/Index.less
  18. 0 517
      src/pages/PurchaseAdmin/PurchaseList/Detail/LuckySheet.js
  19. 0 84
      src/pages/PurchaseAdmin/PurchaseList/Detail/MergeModal.js
  20. 0 103
      src/pages/PurchaseAdmin/PurchaseList/Detail/RightDrawer.js
  21. 0 56
      src/pages/PurchaseAdmin/PurchaseList/Detail/TimeNode.js
  22. 0 40
      src/pages/PurchaseAdmin/PurchaseList/Detail/VersionModal.js
  23. 0 583
      src/pages/PurchaseAdmin/PurchaseList/Detail/models/detail.js
  24. 0 128
      src/pages/PurchaseAdmin/PurchaseList/Flow/Audit.js
  25. 0 16
      src/pages/PurchaseAdmin/PurchaseList/Flow/Audit.less
  26. 0 97
      src/pages/PurchaseAdmin/PurchaseList/Flow/AuditList.js
  27. 0 40
      src/pages/PurchaseAdmin/PurchaseList/Flow/AuditModal.js
  28. 0 62
      src/pages/PurchaseAdmin/PurchaseList/Flow/AuditNodeModal.js
  29. 0 100
      src/pages/PurchaseAdmin/PurchaseList/Flow/Flow.js
  30. 0 635
      src/pages/PurchaseAdmin/PurchaseList/Flow/FlowDetail.json
  31. 0 53
      src/pages/PurchaseAdmin/PurchaseList/Flow/FlowModal.js
  32. 0 93
      src/pages/PurchaseAdmin/PurchaseList/Flow/List.js
  33. 0 5
      src/pages/PurchaseAdmin/PurchaseList/Flow/index.less
  34. 0 284
      src/pages/PurchaseAdmin/PurchaseList/Flow/models/flow.js
  35. 48 8
      src/pages/PurchaseAdmin/PurchaseList/Index.js
  36. 0 52
      src/pages/PurchaseAdmin/PurchaseList/List/AddModal.js
  37. 0 172
      src/pages/PurchaseAdmin/PurchaseList/List/List.js
  38. 0 8
      src/pages/PurchaseAdmin/PurchaseList/List/List.less
  39. 0 189
      src/pages/PurchaseAdmin/PurchaseList/List/NewList.js
  40. 0 146
      src/pages/PurchaseAdmin/PurchaseList/List/NodeModal.js
  41. 0 307
      src/pages/PurchaseAdmin/PurchaseList/List/models/list.js
  42. 0 109
      src/pages/PurchaseAdmin/PurchaseList/List/models/newList.js
  43. 1 5
      src/pages/PurchaseAdmin/PurchaseList/Login/models/login.js
  44. 1 1
      src/pages/PurchaseAdmin/PurchaseList/Report/models/report.js

+ 2 - 2
config/config.js

@@ -66,8 +66,8 @@ export default {
   hash: true,
   // add for transfer to umi
   plugins,
-  base: '/bom/',
-  publicPath: NODE_ENV == 'development' ? '/' : '/bom/',
+  base: '/purchase/',
+  publicPath: NODE_ENV == 'development' ? '/' : '/purchase/',
   // base: '/',
   // publicPath: '/',
   history: 'hash',

+ 1 - 42
config/router.config.js

@@ -11,47 +11,10 @@ export default [
         path: '/mobile/craft',
         component: './Mobile/DataMeter/Craft',
       },
-      {
-        path: '/bom',
-        component: './PurchaseAdmin/PurchaseList/Index',
-        routes: [
-          {
-            path: '/bom',
-            component: './PurchaseAdmin/PurchaseList/List/NewList',
-            // component: './PurchaseAdmin/PurchaseList/List/List',
-          },
-          {
-            path: '/bom/detail/:projectId/:templateId',
-            component: './PurchaseAdmin/PurchaseList/Detail/Index',
-          },
-          {
-            path: '/bom/flow/:flowId',
-            component: './PurchaseAdmin/PurchaseList/Flow/Flow',
-          },
-          {
-            path: '/bom/audit',
-            component: './PurchaseAdmin/PurchaseList/Flow/Audit',
-          },
-          {
-            path: '/bom/audit-list',
-            component: './PurchaseAdmin/PurchaseList/Flow/AuditList',
-          },
-          {
-            path: '/bom/flow-list',
-            component: './PurchaseAdmin/PurchaseList/Flow/List',
-          },
-        ],
-      },
       {
         path: '/home',
-        component: './PurchaseAdmin/PurchaseList/WorkloadIndex',
+        component: './PurchaseAdmin/PurchaseList/Index',
         routes: [
-          {
-            path: '/home',
-            // component: './PurchaseAdmin/PurchaseList/WorkingHours/index',
-            redirect: '/home/work-hours',
-            // component: './PurchaseAdmin/PurchaseList/List/List',
-          },
           {
             path: '/home/work-hours',
             component: './PurchaseAdmin/PurchaseList/WorkingHours/index',
@@ -86,10 +49,6 @@ export default [
           },
         ],
       },
-      {
-        path: '/dd-login/:dingUserId',
-        component: './DDLogin/index',
-      },
       {
         path: '/mobiletest/chart',
         component: './Mobile/DataMeter/Chart',

+ 0 - 102
src/pages/PurchaseAdmin/PurchaseList/Detail/ApprovalProcess.tsx

@@ -1,102 +0,0 @@
-import React, { useState } from 'react';
-
-import { queryUserListByRoleID } from '@/services/boom';
-import { connect } from 'dva';
-import { PlusOutlined } from '@ant-design/icons';
-import { Popover, Radio, RadioChangeEvent, Spin, Steps } from 'antd';
-
-const { Step } = Steps;
-
-enum TYPR {
-  ROLE = 'role',
-  USER = 'user',
-}
-
-const ApprovalProcess = props => {
-  const { id, approvalProcess, userList, onChange, roleList = [] } = props;
-  const [selectUserList, setSelectUserList] = useState([]);
-  const [curNodeIdx, setCurNodeIdx] = useState(-1);
-  const [loading, setLoading] = useState(false);
-
-  const list = approvalProcess[id];
-  list?.forEach(item => {
-    if (item.length > 1 && item[0].type == TYPR.USER) {
-      item.forEach(curUser => {
-        curUser.name = userList.find(user => user.ID == curUser.value)?.CName || '-';
-      });
-    } else if (item.length == 1 && item[0].type == TYPR.USER) {
-      item[0].name = userList.find(user => user.ID == item[0].value)?.CName || '-';
-    } else if (item.length == 1 && item[0].nowType == TYPR.USER) {
-      item[0].name = userList.find(user => user.ID == item[0].nowValue)?.CName || '-';
-    } else {
-      item[0].name = null;
-    }
-  });
-  console.log(list);
-
-  const onStepsChange = async (current, list) => {
-    setLoading(true);
-    const itemNode = list[current][0];
-    if (itemNode.type !== 'role') return;
-    const data = await queryUserListByRoleID({ role_id: itemNode.value });
-    setCurNodeIdx(current);
-    setSelectUserList(data);
-    setLoading(false);
-  };
-
-  const selectedUserId = ({ target: { value } }: RadioChangeEvent) => {
-    //userId
-    const name = userList.find(user => user.ID == value)?.CName || '-';
-    const data = { nowType: TYPR.USER, nowValue: Number(value), name }; //type: TYPR.USER, value: Number(value)
-    list[curNodeIdx][0] = { ...list[curNodeIdx][0], ...data };
-    console.log(list);
-    onChange?.({ ...approvalProcess, [id]: list });
-  };
-
-  const content = (
-    <Spin spinning={loading}>
-      <Radio.Group onChange={selectedUserId}>
-        {selectUserList.map(item => (
-          // <Button onClick={() => selectedUserId(item.user_id)}>{item.c_name}</Button>
-          <Radio.Button value={item.user_id}>{item.c_name}</Radio.Button>
-        ))}
-      </Radio.Group>
-    </Spin>
-  );
-
-  return (
-    <>
-      <Steps current={-1} direction="vertical" onChange={value => onStepsChange(value, list)}>
-        {list?.map(item => (
-          <Step
-            key={item[0]?.value}
-            icon={
-              item[0].type != TYPR.USER || item[0].nowType == TYPR.USER ? (
-                <Popover
-                  placement="bottomLeft"
-                  title={'选择审批人'}
-                  content={content}
-                  trigger="click"
-                  overlayStyle={{ width: '300px' }}
-                >
-                  <PlusOutlined />
-                </Popover>
-              ) : null
-              // <PlusOutlined />
-            }
-            title={
-              item[0]?.name || `从${roleList?.find(cur => cur.ID == item[0]?.value)?.Name}选择`
-            }
-          />
-        ))}
-      </Steps>
-      {/* {selectUserList.map(item => (
-        <Button onClick={() => selectedUserId(item.user_id)}>{item.c_name}</Button>
-      ))} */}
-    </>
-  );
-};
-export default connect(({ xflow, detail, user }) => ({
-  userList: user.list,
-  roleList: user.roleList,
-}))(ApprovalProcess);

+ 0 - 130
src/pages/PurchaseAdmin/PurchaseList/Detail/AuditDetailed.js

@@ -1,130 +0,0 @@
-import DDComponents from '@/components/DDComponents';
-import React, { useMemo, useState } from 'react';
-import { Form } from '@ant-design/compatible';
-import '@ant-design/compatible/assets/index.css';
-
-const layout = {
-  labelCol: {
-    span: 8,
-  },
-  wrapperCol: {
-    span: 16,
-  },
-};
-
-const AuditDetailed = props => {
-  // const [form] = Form.useForm();
-  const { items, form } = props;
-
-  const behavior = useMemo(() => {
-    let data = {};
-    items.forEach(d => {
-      const item = d.props;
-      if (item.behaviorLinkage) {
-        const key = item.id;
-        const options = item.options.map(o => {
-          let data;
-          try {
-            data = JSON.parse(o);
-          } catch (error) {
-            data = { key: o, value: o };
-          }
-          return data;
-        });
-        item.behaviorLinkage.forEach(b => {
-          const value = b.value;
-          b.targets.forEach(t => {
-            data[t.fieldId] = { key, value: options.find(o => o.key == value)?.value };
-          });
-        });
-      }
-    });
-
-    return data;
-  }, [items]);
-
-  const onFinish = values => {
-    console.log(values);
-  };
-
-  const GetComponent = item => {
-    const {
-      id,
-      label,
-      bizAlias,
-      required,
-      placeholder,
-      options,
-      align,
-      statField,
-      hideLabel,
-      objOptions,
-      format,
-      pushToAttendance,
-      labelEditableFreeze,
-      requiredEditableFreeze,
-      unit,
-      extract,
-      link,
-      payEnable,
-      bizType,
-      childFieldVisible,
-      notPrint,
-      verticalPrint,
-      hiddenInApprovalDetail,
-      disabled,
-      notUpper,
-      children, // 子控件
-    } = item.props;
-    // 判断是否属于关联项
-    if (behavior[id]) {
-      const { key, value } = behavior[id];
-      let currentValue = form.getFieldValue(key);
-      try {
-        currentValue = JSON.parse(currentValue);
-      } catch (error) {}
-      // 判断是否需要渲染
-      if (currentValue instanceof Array) {
-        if (currentValue?.indexOf(value) == -1) return null;
-      } else {
-        if (currentValue != value) return null;
-      }
-    }
-    let formLabel;
-    if (bizAlias) {
-      formLabel = bizAlias;
-    } else {
-      try {
-        // 判断label是否为JSON数组
-        formLabel = JSON.parse(label).join(',');
-      } catch (error) {
-        formLabel = label;
-      }
-    }
-
-    const component = DDComponents({ item });
-    if (!component) return null;
-    return (
-      <Form.Item label={formLabel}>
-        {typeof component == 'string'
-          ? component
-          : form.getFieldDecorator(id, {
-              rules: [{ required }],
-            })(component)}
-        {notUpper == 1 && <p>大写</p>}
-      </Form.Item>
-    );
-  };
-
-  return (
-    <Form
-      style={{ height: '400px', overflowY: 'scroll', paddingRight: 20 }}
-      layout="vertical"
-      autoComplete="off"
-    >
-      {items.map(item => GetComponent(item))}
-    </Form>
-  );
-};
-
-export default AuditDetailed;

+ 0 - 271
src/pages/PurchaseAdmin/PurchaseList/Detail/AuditFlow.js

@@ -1,271 +0,0 @@
-import React, { useMemo, useEffect, useState, useRef } from 'react';
-import { Steps, Popover, Alert, Button, Spin } from 'antd';
-import styles from './Index.less';
-import { queryDDProcessesForecast } from '@/services/boom';
-import { connect } from 'dva';
-
-const { Step } = Steps;
-
-function AuditFlow(props) {
-  const {
-    processCode,
-    deptId,
-    userId,
-    formComponentValues,
-    // activityId,
-    direction,
-    status,
-    tasks,
-    userList,
-    cc_userids = [],
-    canShowAudit = false,
-    onApprove,
-  } = props;
-  const [flow, setFlow] = useState({ workflowActivityRules: [] });
-  const [loading, setLoading] = useState(false);
-  const timerRef = useRef({
-    id: '',
-    status: false,
-  });
-  const current = useMemo(() => {
-    if (!tasks || tasks.length == 0) {
-      return false;
-    } else {
-      let current = 0;
-      flow.workflowActivityRules.forEach((item, index) => {
-        let task = tasks.find(task => task.activity_id == item.activityId);
-        if (task) {
-          if (task.task_status == 'COMPLETED') {
-            // 完成时节点为下一级
-            current = index + 1;
-          } else {
-            // 未完成则为当前节点
-            current = index;
-          }
-        }
-      });
-      return current;
-    }
-  }, [tasks, flow]);
-
-  const showAduit = useMemo(() => {
-    if (!canShowAudit) return false;
-    //当前处理中的审批人和登录人是一个人显示审批通过和拒绝
-    if (!tasks || tasks.length == 0) {
-      return false;
-    } else {
-      // 查询处于RUNNING的task activityId
-      const runningTask = tasks.filter(item => item.task_status == 'RUNNING');
-      // const task = tasks.find(task => task.activity_id == activityId);
-      if (runningTask.length == 0) return false;
-      // if (task.task_status == 'RUNNING' && task.userid == userId) return true;
-      return runningTask.find(task => task.userid == userId);
-    }
-  }, [tasks, userId]);
-
-  const getTaskId = () => {
-    const runningTask = tasks.find(item => item.task_status == 'RUNNING' && item.userid == userId);
-    if (runningTask) return runningTask.taskid;
-  };
-
-  const getDesc = item => {
-    const { activityId } = item;
-    if (!tasks || tasks.length == 0) return '';
-    if (item.activityName == '抄送人') {
-      let names = cc_userids
-        .map(userId => {
-          let user = userList.find(u => u.DingUserId == userId);
-          return user?.CName;
-        })
-        .filter(item => item);
-      return names.join(',');
-    } else {
-      const task = tasks.find(task => task.activity_id == activityId);
-      if (!task) return;
-      const user = userList.find(user => task.userid == user.DingUserId);
-      let result = null;
-      if (task.task_result !== 'NONE') {
-        result = (
-          <>
-            <br />
-            审批结果: {TASK_RESULT[task.task_result]}
-            <br />
-          </>
-        );
-      }
-      return (
-        <>
-          {user?.CName || '未知操作人'}({TASK_STATUS[task.task_status]}){result}
-        </>
-      );
-    }
-  };
-  const renderAlert = () => {
-    // const audit_comment = history.list[0]?.audit_comment;
-    let item = '';
-    switch (status) {
-      case -1:
-        item = <Alert message="已失效" type="error" />;
-        break;
-      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={`审批被拒绝`} type="error" />;
-        break;
-      case 3:
-        item = <Alert message="审批通过" type="success" />;
-        break;
-      case -1:
-        item = <Alert message="已失效" type="error" />;
-        break;
-    }
-
-    return <div style={{ margin: '20px auto' }}>{item}</div>;
-  };
-  const customDot = (dot, { status, index }) => {
-    let item = flow.workflowActivityRules[index];
-
-    return (
-      <Popover
-        content={
-          <div>
-            节点类型:{ACTIVITY_TYPE[item.activityType]}
-            <br />
-            操作人类型:{ACTOR_TYPE[item.workflowActor?.actorType]}
-            <br />
-            审批类型:{APPROVAL_TYPE[item.workflowActor?.approvalType]}
-            <br />
-            审批方式:{APPROVAL_METHOD[item.workflowActor?.approvalMethod]}
-          </div>
-        }
-      >
-        {dot}
-      </Popover>
-    );
-  };
-
-  const getDetail = async () => {
-    if (!deptId || !userId) {
-      console.log('depId或userId不存在!');
-      return;
-    }
-    if (!timerRef.current.status) {
-      // 上锁
-      timerRef.current.status = true;
-      setLoading(true);
-      try {
-        let flow = await queryDDProcessesForecast({
-          processCode,
-          deptId,
-          userId,
-          formComponentValues,
-        });
-        setFlow(flow);
-        console.log(flow);
-      } catch (error) {}
-      setLoading(false);
-      setTimeout(() => {
-        // 延时解锁
-        timerRef.current.status = false;
-      }, 2000);
-    } else {
-      clearTimeout(timerRef.current.id);
-      // 延迟调用
-      timerRef.current.id = setTimeout(() => {
-        getDetail();
-      }, 2000);
-    }
-  };
-
-  useEffect(() => {
-    if (!processCode || !formComponentValues) return;
-    getDetail();
-  }, [processCode, formComponentValues]);
-
-  return (
-    <Spin spinning={loading}>
-      <div className={styles.top}>
-        <Steps current={current} progressDot={customDot} direction={direction}>
-          {flow.workflowActivityRules.map(item => (
-            <Step key={item.activityId} title={item?.activityName} description={getDesc(item)} />
-          ))}
-          {/* <Step key={item.activityId} title={item?.activityName} description={renderDesc(item)} /> */}
-        </Steps>
-        {showAduit && status != -1 && (
-          <div className={styles.btns} style={{ marginLeft: 80 }}>
-            <Button type="primary" onClick={() => onApprove(true, getTaskId())}>
-              审批通过
-            </Button>
-            <Button onClick={() => onApprove(false, getTaskId())} danger>
-              审批拒绝
-            </Button>
-          </div>
-        )}
-      </div>
-      {status !== undefined && renderAlert()}
-    </Spin>
-  );
-}
-
-const ACTOR_TYPE = {
-  approver: '审批人',
-  notifier: '抄送人',
-  audit: '办理人',
-};
-const APPROVAL_TYPE = {
-  MANUAL: '人工审批',
-  AUTO_AGREE: '自动通过',
-  AUTO_REFUSE: '自动拒绝',
-};
-const APPROVAL_METHOD = {
-  ONE_BY_ONE: '依次审批',
-  AND: '会签审批',
-  OR: '或签审批',
-};
-const ACTIVITY_TYPE = {
-  target_select: '自选审批人',
-  target_approval: '指定审批人',
-};
-const OPERATION_RESULT = {
-  AGREE: '同意',
-  REFUSE: '拒绝',
-  NONE: '未处理',
-};
-const OPERATION_TYPE = {
-  EXECUTE_TASK_NORMAL: '正常执行任务',
-  EXECUTE_TASK_AGENT: '代理人执行任务',
-  APPEND_TASK_BEFORE: '前加签任务',
-  APPEND_TASK_AFTER: '后加签任务',
-  REDIRECT_TASK: '转交任务',
-  START_PROCESS_INSTANCE: '发起流程实例',
-  TERMINATE_PROCESS_INSTANCE: '终止(撤销)流程实例',
-  FINISH_PROCESS_INSTANCE: '结束流程实例',
-  ADD_REMARK: '添加评论',
-  REDIRECT_PROCESS: '审批退回',
-  PROCESS_CC: '抄送',
-};
-
-const TASK_STATUS = {
-  NEW: '未启动',
-  RUNNING: '处理中',
-  PAUSED: '暂停',
-  CANCELED: '取消',
-  COMPLETED: '完成',
-  TERMINATED: '终止',
-};
-
-const TASK_RESULT = {
-  AGREE: '同意',
-  REFUSE: '拒绝',
-  REDIRECTED: '转交',
-  NONE: '未处理',
-};
-
-export default connect(({ user }) => ({
-  userList: user.list,
-}))(AuditFlow);

+ 0 - 34
src/pages/PurchaseAdmin/PurchaseList/Detail/AuditModal.js

@@ -1,34 +0,0 @@
-import React from 'react';
-import { Form } from '@ant-design/compatible';
-import '@ant-design/compatible/assets/index.css';
-import { Modal, Input } from 'antd';
-
-
-// 审批意见
-function AuditModal(props) {
-  const { visible, onClose, onOk, form, loading } = props;
-
-  const handleOk = () => {
-    form.validateFields((err, fieldsValue) => {
-      if (err) return;
-      onOk(fieldsValue);
-    });
-  };
-
-  return (
-    <Modal
-      confirmLoading={loading}
-      destroyOnClose
-      title="审批意见"
-      visible={visible}
-      onCancel={onClose}
-      onOk={handleOk}
-    >
-      <Form.Item labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label="拒绝原因">
-        {form.getFieldDecorator('audit_comment')(<Input.TextArea />)}
-      </Form.Item>
-    </Modal>
-  );
-}
-
-export default Form.create()(AuditModal)

+ 0 - 83
src/pages/PurchaseAdmin/PurchaseList/Detail/CommentDrawer.js

@@ -1,83 +0,0 @@
-import React, { useEffect, useState, useRef } from 'react';
-import { UserOutlined } from '@ant-design/icons';
-import { Form } from '@ant-design/compatible';
-import '@ant-design/compatible/assets/index.css';
-import {
-  Steps,
-  Button,
-  Drawer,
-  Comment,
-  Tooltip,
-  Avatar,
-  List,
-  Card,
-  Modal,
-  Checkbox,
-  Row,
-  Col,
-  message,
-  Input,
-  Table,
-  Alert,
-  Spin,
-  Tabs,
-} from 'antd';
-import moment from 'moment';
-
-const { Step } = Steps;
-const { TextArea } = Input;
-const { TabPane } = Tabs;
-
-// 评论
-function CommentDrawer(props) {
-  const { visible, onClose, list, addComment, loading } = props;
-  const [value, setValue] = useState('');
-  // const [commentList, setCommentList] = useState([]);
-
-  const handleSubmit = () => {
-    if (!value) return;
-    addComment(value, () => {
-      setValue('');
-    });
-  };
-  return (
-    <Drawer title="评论列表" mask={false} placement="right" onClose={onClose} visible={visible}>
-      <List
-        className="comment-list"
-        itemLayout="horizontal"
-        dataSource={list}
-        loading={loading}
-        renderItem={item => (
-          <li>
-            <Comment
-              author={<a>{item.AuthorUser.CName}</a>}
-              avatar={<Avatar icon={<UserOutlined />} alt={item.author} />}
-              content={<p>{item.comment}</p>}
-              datetime={
-                <Tooltip title={moment(item.c_time).format('YYYY-MM-DD')}>
-                  <span>{moment(item.c_time).fromNow()}</span>
-                </Tooltip>
-              }
-            />
-          </li>
-        )}
-      />
-      <Comment
-        avatar={<Avatar icon={<UserOutlined />} alt="张三" />}
-        content={
-          <>
-            <Form.Item>
-              <TextArea rows={4} onChange={e => setValue(e.target.value)} value={value} />
-            </Form.Item>
-            <Form.Item>
-              <Button htmlType="submit" loading={loading} onClick={handleSubmit} type="primary">
-                添加评论
-              </Button>
-            </Form.Item>
-          </>
-        }
-      />
-    </Drawer>
-  );
-}
-export default CommentDrawer

+ 0 - 561
src/pages/PurchaseAdmin/PurchaseList/Detail/CommitAuditModal.js

@@ -1,561 +0,0 @@
-import React, { useEffect, useState, useRef, useMemo, useCallback } from 'react';
-import '@ant-design/compatible/assets/index.css';
-import {
-  Modal,
-  Input,
-  Select,
-  message,
-  Cascader,
-  Form,
-  Tabs,
-  Row,
-  Col,
-  Empty,
-  Button,
-  Steps,
-  Popover,
-} from 'antd';
-import { PlusOutlined } from '@ant-design/icons';
-import { connect } from 'dva';
-import { isArray, result, set } from 'lodash';
-import { useForm } from 'rc-field-form';
-import { async } from '@antv/x6/lib/registry/marker/async';
-import AuditDetailed from './AuditDetailed';
-import AuditFlow from './AuditFlow';
-import { queryDingSchema, queryProcessFlows } from '@/services/boom';
-import { Form as Form3x } from '@ant-design/compatible';
-import { getCurrentUser } from '@/utils/authority';
-import DDCode from '@/components/DDComponents/DDCode';
-import { uploadFile, queryUserListByRoleID } from '@/services/boom';
-import ApprovalProcess from './ApprovalProcess';
-
-const { TextArea } = Input;
-const { Option } = Select;
-const { TabPane } = Tabs;
-const { Step } = Steps;
-
-// 提交
-function CommitAuditModal(props) {
-  const {
-    dispatch,
-    visible,
-    onClose,
-    onOk,
-    loading,
-    version,
-    versionList,
-    flowDetail,
-    currentUser,
-    luckysheet,
-    userList,
-  } = props;
-  const [auditId, setAuditId] = useState();
-  const [data, setData] = useState([]);
-  const [length, setLength] = useState(1);
-  const [formData, setFromData] = useState({});
-  const [auditList, setAuditList] = useState([]); //用于创建Tabs表单
-  const [formComponentValues, setFormComponentValues] = useState({}); //用于创建Tabs表单
-  const [form] = Form.useForm();
-  const [approvalProcess, setApprovalProcess] = useState({});
-  const [selectUserList, setSelectUserList] = useState([]);
-  const [curNodeIdx, setCurNodeIdx] = useState(-1);
-
-  useEffect(() => {
-    if (!visible) return;
-    const { edges, nodes } = flowDetail;
-    let Id = version.template_node_id;
-    const currentId = flowDetail.nodes.find?.(item => item.Id == Id)?.node_id;
-    const data = treeData(currentId);
-    if (data.length <= 0) {
-      setAuditId(currentId)
-    }
-    else {
-      let defaultValues = {}
-      data.forEach((item, index) => {
-        let value = getDataValue(item)
-        defaultValues[`circle${index}`] = value
-      })
-      // 设置延迟,等待组件渲染
-      setTimeout(() => {
-        form.setFieldsValue(defaultValues)
-        Object.values(defaultValues).forEach(value => onChange(value))
-      }, 200)
-    }
-    setData(data);
-  }, [auditId, version.template_node_id, visible]);
-
-  useEffect(() => {
-    form.resetFields();
-    setAuditList([]);
-  }, [visible]);
-
-  const treeData = currentId => {
-    const list = getNextNodes(currentId, 'custom-circle');
-    const fun = nodes => {
-      const re = nodes?.forEach((item, idx) => {
-        const data = getNextNodes(item.Id, 'custom-circle');
-        if (data || data.length > 0) list.push(...data);
-        fun(data);
-      });
-    };
-    fun(list);
-
-    const fun2 = list => {
-      const parents = list.filter(item => list.findIndex(node => node.Id == item.parentId) == -1);
-      let translator = (parents, children) => {
-        setLength(length + 1);
-        parents.forEach(parent => {
-          children.forEach((current, index) => {
-            if (current.parentId === parent.Id) {
-              let temp = JSON.parse(JSON.stringify(children));
-              temp.splice(index, 1);
-              translator([current], temp);
-              if (!parent.children.find(item => item.Id == current.Id))
-                parent.children.push(current);
-            }
-          });
-        });
-      };
-      translator(parents, list);
-      return parents;
-    };
-    return fun2(list);
-  };
-
-  const currentNodeId = useMemo(() => {
-    let Id = version.template_node_id;
-    setAuditId(currentNodeId);
-    return flowDetail.nodes.find?.(item => item.Id == Id)?.node_id;
-  }, [flowDetail, version]);
-  /**
-   *
-   * @param {*} currentId 当前节点
-   * @param {*} type 下一个节点的类型  custom-circle: 审批节点   custom-rect: 业务节点
-   * @returns
-   */
-  const getNextNodes = (currentId, type) => {
-    const { edges, nodes } = flowDetail;
-    if (!currentId) return [];
-    //删除虚线通向的节点
-    // let targetIds = edges
-    //   .filter(edge => {
-    //     let line = edge.attrs?.line?.strokeDasharray?.split(' ');
-    //     return edge.source.cell == currentId && line && line[0] == '0';
-    //   })
-    //   .map(item => item.target.cell);
-    let targetIds = edges
-      .filter(edge => edge.source.cell == currentId)
-      .map(item => item.target.cell);
-
-    edges.filter(edge => edge.source.cell == currentId);
-    let auditNodes = nodes.filter(node => {
-      if (type && node.name != type) {
-        return false;
-      }
-      return targetIds.indexOf(node.id) != -1;
-    });
-    const result = auditNodes.map(item => {
-      return {
-        label: item.label,
-        value: item.Id,
-        Id: item.node_id,
-        parentId: currentId,
-        children: [],
-      };
-    });
-    return result || [];
-  };
-
-  const changeAudit = id => {
-    let node = flowDetail.nodes.find?.(item => item.Id == id);
-    setAuditId(node.node_id);
-  };
-
-  const onChange = value => {
-    changeAudit(value[value.length - 1]);
-    setAuditListFun();
-  };
-
-  const getReComputeAudit = (items, changedValues) => {
-    const id = Object.keys(changedValues)[0];
-    const formItem = items?.find(item => item.props.id == id);
-    if (formItem && formItem.props?.required) return true;
-    return false;
-  };
-
-  //填写表单实时计算审批流程
-  const advanceSubmit = async () => {
-    console.log('重重新计算审批流程');
-    var fieldsValue = await form.validateFields();
-    let hasFlowId = true; //是否都绑定审批节点
-
-    let result = Object.values(fieldsValue)
-      .map(item => {
-        if (item && Array.isArray(item)) return item;
-      })
-      .filter(item => item);
-    const formList = await getFromData(result);
-    let params = {
-      desc: fieldsValue.desc,
-      // 审核流程id
-      flow_id: 0,
-      node_level_id: 0,
-      id: version.id,
-      project_id: version.project_id,
-      cur_template_node_id: version.template_node_id * 1, // 当前节点
-      next_template_node_id: 0, // 审核完成后的业务节点
-      template_node_id: null, // 将要流转的节点审批节点
-      flow_path: null, //审批节点数组
-      // 模板id.一致就行
-      template_id: version.template_id,
-      cur_template_id: version.template_id,
-      next_template_id: version.template_id,
-      form_list: formList,
-    };
-    dispatch({
-      type: 'detail/advanceSubmitNextNode',
-      payload: params, //values,
-      callback: data => {
-        if (data) {
-          setApprovalProcess(data);
-        }
-        console.log('=======================================', data);
-      },
-    });
-  };
-
-  //处理tabs页
-  const setAuditListFun = async () => {
-    var fieldsValue = await form.validateFields();
-    let addAuditList = [];
-    let result = Object.values(fieldsValue)
-      .map(item => {
-        if (item && Array.isArray(item)) return item;
-      })
-      .filter(item => item)
-      .flat(Infinity);
-    let nodeList = [...new Set(result)]
-      .map(Id => {
-        return flowDetail.nodes.find?.(item => item.Id == Id);
-      })
-      .filter(item => item);
-    let flowIds = [...new Set(nodeList.map(item => item.flow_id))].join(',');
-    let data = await queryProcessFlows({ ids: flowIds });
-    if (data && data?.length > 0) {
-      let newlist = nodeList.map(node => {
-        let curData = data.find(item => item.id == node.flow_id);
-        let newItem = {
-          name: curData?.name,
-          nodeId: node.Id,
-          items: JSON.parse(curData.form_json),
-        };
-        return newItem;
-      });
-      addAuditList = [...addAuditList, ...newlist];
-    }
-    addAuditList.forEach((item, index) => {
-      let Components = Form3x.create({
-        onValuesChange: (props, changedValues, allValues) => {
-          const { items } = props;
-          formComponentValues[item.nodeId] = items
-            .map(item => {
-              const itemProps = item.props;
-              let val = allValues[itemProps.id];
-              if (!itemProps.label || val === '') return;
-              if (val instanceof Object) {
-                return {
-                  name: itemProps.label,
-                  id: itemProps.id,
-                  value: [...val],
-                };
-              } else if (allValues[itemProps.id]) {
-                return {
-                  name: itemProps.label,
-                  id: itemProps.id,
-                  value: [allValues[itemProps.id]] || undefined,
-                };
-              }
-            })
-            .filter(item => item);
-          if (getReComputeAudit(items, changedValues)) advanceSubmit();
-          // console.log('==================================', { ...formComponentValues });
-          setFormComponentValues({ ...formComponentValues });
-        },
-      })(AuditDetailed);
-      item.FormComponents = <Components items={item.items} />;
-    });
-    setAuditList(addAuditList);
-    advanceSubmit();
-  };
-
-  const getFromData = async idList => {
-    const data = formComponentValues;
-    const result = [];
-    //获取流转节点的层级关系
-    let len = 0;
-    let list = [];
-    idList.forEach(item => {
-      if (len < item.length) len = item.length;
-    });
-    for (let i = 0; i < len; i++) {
-      idList.forEach(item => {
-        if (item && item[i]) list.push(item[i]);
-      });
-    }
-    let firstList = [...new Set(list)];
-    // let attachment = await upload();
-    firstList.forEach(id => {
-      let approvalNode = flowDetail.nodes.find?.(item => item.Id == id);
-      let values = data[approvalNode.Id] || [];
-      const audit_list = approvalProcess[approvalNode.Id]?.map(item => {
-        if (item[0].type == 'role') return item[0].nowValue;
-        return item[0].value;
-      });
-      const formItem = {
-        flow_id: approvalNode.flow_id,
-        template_node_id: approvalNode.Id,
-        formComponentValues: [...values], //{ name: '附件', value: JSON.stringify(attachment) }
-        audit_list: audit_list || [],
-      };
-      result.push(JSON.stringify(formItem));
-    });
-    return result;
-  };
-
-  const getFlowPath = node => {
-    //[134, 135]
-    let itemData = {};
-    const Function = (curId, index) => {
-      if (!curId) return;
-      let data = {};
-      let approvalNode = flowDetail.nodes.find?.(item => item.Id == curId);
-      data.template_id = version.template_id;
-      data.flow_id = approvalNode?.flow_id || 0;
-      data.node_level_id = approvalNode?.flow_id ? 1 : 0;
-      data.template_node_id = approvalNode?.Id;
-      index++;
-      if (approvalNode?.Id) {
-        if (!approvalNode?.flow_id) {
-          hasFlowId = false;
-        }
-      }
-      const res = Function(node[index], index);
-      if (res) {
-        data.flow_path = [res];
-      }
-      return data;
-    };
-    itemData = Function(node[0], 0);
-    return itemData;
-  };
-
-  const onFinish = async () => {
-    console.log(approvalProcess);
-    const isOk = Object.values(approvalProcess).every(item => {
-      console.log(item);
-      return item.every(cur => {
-        if (cur[0].type == 'role') return cur[0].nowValue;
-        return true;
-      });
-    });
-    if (!isOk) {
-      message.error('请选择审批人。');
-      return;
-    }
-    var fieldsValue = await form.validateFields();
-    let hasFlowId = true; //是否都绑定审批节点
-    const getFlowPath = node => {
-      //[134, 135]
-      let itemData = {};
-      const Function = (curId, index) => {
-        if (!curId) return;
-        let data = {};
-        let approvalNode = flowDetail.nodes.find?.(item => item.Id == curId);
-        data.template_id = version.template_id;
-        data.flow_id = approvalNode?.flow_id || 0;
-        data.node_level_id = approvalNode?.flow_id ? 1 : 0;
-        data.template_node_id = approvalNode?.Id;
-        index++;
-        if (approvalNode?.Id) {
-          if (!approvalNode?.flow_id) {
-            hasFlowId = false;
-          }
-        }
-        const res = Function(node[index], index);
-        if (res) {
-          data.flow_path = [res];
-        }
-        return data;
-      };
-      itemData = Function(node[0], 0);
-      return itemData;
-    };
-    let result = Object.values(fieldsValue)
-      .map(item => {
-        if (item && Array.isArray(item)) return item;
-      })
-      .filter(item => item);
-    let serviceNode = flowDetail.nodes.find?.(item => item.Id == fieldsValue.next_template_node_id);
-
-    if (!serviceNode) {
-      message.error('请选择需要流转的业务节点。');
-      return;
-    }
-
-    const flowPath = result.map(item => getFlowPath(item));
-    const formList = await getFromData(result);
-    let params = {
-      desc: fieldsValue.desc,
-      // 审核流程id
-      // flow_id: approvalNode?.flow_id || 0,
-      // node_level_id: approvalNode?.flow_id ? 1 : 0,
-
-      id: version.id,
-      project_id: version.project_id,
-      cur_template_node_id: version.template_node_id * 1, // 当前节点
-      next_template_node_id: serviceNode.Id * 1, // 审核完成后的业务节点
-      // template_node_id: result[0][0], // 将要流转的节点审批节点
-      // flow_path:flow_path, //审批节点数组
-      // 模板id.一致就行
-      template_id: version.template_id,
-      cur_template_id: version.template_id,
-      next_template_id: version.template_id,
-    };
-    if (result.length <= 0) {
-      //直接走业务节点
-    } else if (result.length <= 1 && result[0]?.length <= 1) {
-      //单个审批节点
-      let approvalNode = flowDetail.nodes.find?.(item => item.Id == result[0][0]);
-      params.flow_id = approvalNode?.flow_id || 0;
-      params.node_level_id = approvalNode?.flow_id ? 1 : 0;
-      params.template_node_id = result[0][0]; // 将要流转的节点审批节点
-      params.form_list = formList; //创建钉钉表单所需数据
-      if (approvalNode?.Id) {
-        if (!approvalNode?.flow_id) {
-          hasFlowId = false;
-        }
-      }
-    } else {
-      //多节点审批
-      params.template_node_id = result[0][0]; // 将要流转的节点审批节点
-      params.flow_path = flowPath;
-      params.form_list = formList; //创建钉钉表单所需数据
-    }
-    if (!hasFlowId) {
-      message.error('当前存在审批节点未绑定审批流程!请联系管理员。');
-      return;
-    }
-    onOk(params);
-  };
-  const CascaderNode = index => {
-    return (
-      <Form.Item
-        labelCol={{ span: 7 }}
-        wrapperCol={{ span: 15 }}
-        label={`审批节点${index + 1}`}
-        name={`circle${index}`}
-        key={`circle${index}`}
-      >
-        <Cascader style={{ width: '100%' }} options={data} onChange={onChange} />
-      </Form.Item>
-    );
-  };
-  const upload = async () => {
-    let blob = await luckysheet.current.getExcelBolb();
-    let formData = new FormData();
-    formData.append('userid', currentUser.DingUserId);
-    formData.append('file', new File([blob], `${version.version_name}_${version.version_no}.xlsx`));
-
-    try {
-      let res = await uploadFile(formData);
-      let data = JSON.parse(res.dentry);
-      return [
-        {
-          spaceId: String(data.spaceId),
-          fileName: data.name,
-          fileSize: String(data.spaceId),
-          fileType: data.extension,
-          fileId: data.id,
-        },
-      ];
-    } catch (error) {
-      message.error('附件上传失败');
-    }
-  };
-
-  return (
-    <Modal
-      confirmLoading={loading}
-      destroyOnClose
-      title="提交流转目标"
-      width={1000}
-      visible={visible}
-      onCancel={() => {
-        setAuditId();
-        onClose();
-      }}
-      onOk={onFinish}
-    >
-      <Form form={form}>
-        {data.map((item, idx) => (data.length == 1 ? CascaderNode('') : CascaderNode(idx)))}
-        <Form.Item
-          labelCol={{ span: 7 }}
-          wrapperCol={{ span: 15 }}
-          label="业务节点"
-          name="next_template_node_id"
-          // rules={[{ required: true, message: '请选择业务节点' }]}
-        >
-          <Select style={{ width: '100%' }}>
-            {getNextNodes(data.length < 0 ? currentNodeId : auditId, 'custom-rect').map(item => (
-              <Option key={item.value}>{item.label}</Option>
-            ))}
-          </Select>
-        </Form.Item>
-        <Form.Item labelCol={{ span: 7 }} wrapperCol={{ span: 15 }} label="备注信息" name="desc">
-          <Input.TextArea />
-        </Form.Item>
-        {/* <Form.Item labelCol={{ span: 7 }} wrapperCol={{ span: 15 }} label="授权码" name="ddCode">
-          <DDCode />
-          <Button onClick={upload}>上传文件</Button>
-        </Form.Item> */}
-      </Form>
-      <Tabs defaultActiveKey="1">
-        {auditList.map((item, idx) => (
-          <TabPane tab={item.name} key={`${idx}_${item.title}`}>
-            <Row>
-              <Col span={17}>{item.FormComponents}</Col>
-              <Col offset={1} span={6}>
-                {!approvalProcess[item.nodeId] ? ( //!formComponentValues[item.nodeId] ||
-                  <Empty description="请先填写表单" />
-                ) : (
-                  <ApprovalProcess
-                    id={item.nodeId}
-                    approvalProcess={approvalProcess}
-                    onChange={setApprovalProcess}
-                  />
-                )}
-              </Col>
-            </Row>
-          </TabPane>
-        ))}
-      </Tabs>
-    </Modal>
-  );
-}
-
-function getDataValue(item) {
-  let arr = []
-  arr.push(item.value)
-  if (item.children?.length > 0) {
-    let res = getDataValue(item.children[0])
-    arr = arr.concat(res)
-  }
-  return arr
-}
-
-export default connect(({ xflow, detail, user }) => ({
-  flowDetail: xflow.flowDetail,
-  versionList: detail.versionList,
-  currentUser: user.currentUser,
-  userList: user.list,
-}))(CommitAuditModal);

+ 0 - 37
src/pages/PurchaseAdmin/PurchaseList/Detail/CommitModal.js

@@ -1,37 +0,0 @@
-import React, { useEffect, useState, useRef } from 'react';
-import { Form } from '@ant-design/compatible';
-import '@ant-design/compatible/assets/index.css';
-import { Modal, Input, Select } from 'antd';
-
-// 提交
-function CommitModal(props) {
-  const { visible, onClose, onOk, form, version, loading } = props;
-
-  const handleOk = () => {
-    form.validateFields((err, fieldsValue) => {
-      if (err) return;
-      fieldsValue.new_version = version.version_id;
-      onOk(fieldsValue);
-    });
-  };
-
-  return (
-    <Modal
-      confirmLoading={loading}
-      destroyOnClose
-      title="提交"
-      visible={visible}
-      onCancel={onClose}
-      onOk={handleOk}
-    >
-      <Form.Item labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label="标题">
-        {form.getFieldDecorator('version_name')(<Input />)}
-      </Form.Item>
-      <Form.Item labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label="详情">
-        {form.getFieldDecorator('description')(<Input.TextArea />)}
-      </Form.Item>
-    </Modal>
-  );
-}
-
-export default Form.create()(CommitModal);

+ 0 - 93
src/pages/PurchaseAdmin/PurchaseList/Detail/CompareModal.js

@@ -1,93 +0,0 @@
-import React, { useEffect, useState, useRef, useMemo } from 'react';
-import { Form } from '@ant-design/compatible';
-import '@ant-design/compatible/assets/index.css';
-import { Modal, Checkbox, Row, Col, message, Tabs } from 'antd';
-import { connect } from 'dva';
-
-const { TabPane } = Tabs;
-
-// 选择比对清单
-function CompareModal(props) {
-  const { visible, versionList, onClose, onOk, dispatch, version, flowDetail } = props;
-
-  const [checkValue, setCheckValue] = useState([]);
-
-  const onChange = check => {
-    if (check.length <= 2) {
-      setCheckValue(check);
-    } else {
-      message.error('只能比对两个文件');
-    }
-  };
-
-  const handleOk = () => {
-    if (checkValue.length != 2) {
-      message.error('请选择要比对的两个文件');
-    } else {
-      let checkSheet = [];
-
-      versionList.forEach(item => {
-        if (checkValue.indexOf(item.id) != -1) {
-          checkSheet.push(item);
-        }
-      });
-      onOk(checkSheet);
-      onClose();
-      setCheckValue([]);
-    }
-  };
-
-  const items = useMemo(() => {
-    let list = {};
-    versionList.forEach(version => {
-      let nodeId = version.template_node_id;
-      if (!nodeId || nodeId === '0' || !version.version_no) return;
-      if (!list[nodeId]) {
-        list[nodeId] = [];
-      }
-      list[nodeId].push(version);
-    });
-    let nodeIds = Object.keys(list)
-    return nodeIds.filter(nodeId => {
-      let name = flowDetail.nodes.find(node => node.Id == nodeId)?.label
-      return name
-    }).map(nodeId => ({
-      label: flowDetail.nodes.find(node => node.Id == nodeId)?.label,
-      key: nodeId + "",
-      // list: list[nodeId],
-      children: list[nodeId].map(version => (
-        <div style={{ marginBottom: 16 }} key={version.id}>
-          <Checkbox value={version.id}>{version.version_name}_{version.version_no}</Checkbox>
-        </div>
-      ))
-    }))
-  }, [versionList, flowDetail]);
-
-  return (
-    <Modal
-      title="选择比对文件"
-      visible={visible}
-      onCancel={onClose}
-      onOk={handleOk}
-      width={600}
-      bodyStyle={{ paddingTop: 0 }}
-    >
-      <Checkbox.Group value={checkValue} style={{ width: '100%' }} onChange={onChange}>
-        {/* <Row gutter={16}>
-          {versionList.map(version => (
-            <Col span={8} key={version.id}>
-              <Checkbox value={version.id}>{version.version_name}</Checkbox>
-            </Col>
-          ))}
-        </Row> */}
-        <Tabs defaultActiveKey={items[0]?.key} items={items} />
-
-      </Checkbox.Group>
-    </Modal>
-  );
-}
-
-export default connect(({ detail, xflow }) => ({
-  versionList: detail.versionList,
-  flowDetail: xflow.flowDetail,
-}))(CompareModal);

+ 0 - 97
src/pages/PurchaseAdmin/PurchaseList/Detail/ExportModal.js

@@ -1,97 +0,0 @@
-import React, { useEffect, useState, useRef } from 'react';
-import { Form } from '@ant-design/compatible';
-import '@ant-design/compatible/assets/index.css';
-import {
-  Steps,
-  Button,
-  Drawer,
-  Comment,
-  Tooltip,
-  Avatar,
-  List,
-  Card,
-  Modal,
-  Checkbox,
-  Row,
-  Col,
-  message,
-  Input,
-  Table,
-  Alert,
-  Spin,
-  Tabs,
-} from 'antd';
-import list from '../List/models/list';
-
-const { Step } = Steps;
-const { TextArea } = Input;
-const { TabPane } = Tabs;
-
-// 选择比对清单
-function CompareModal(props) {
-  const { visible, onClose, onOk, sheet } = props;
-
-  const [checkValue, setCheckValue] = useState([]);
-  const [tabList, setTabList] = useState([]);
-  const [active, setActive] = useState();
-
-  useEffect(() => {
-    const list = [];
-    if (sheet && sheet.length > 0) {
-      const sheetData = JSON.parse(JSON.stringify(sheet));
-      sheetData.forEach(item => {
-        let obj = {};
-        obj.name = item.name;
-        if (item.data && item.data[0]) {
-          obj.list = item.data[0]?.filter(cur => cur);
-          obj.list.forEach(item => {
-            if(item.ct.t == "inlineStr") {
-              item.v = item.ct.s.map(s => s.v).join("")
-            }
-          })
-        }
-        obj.id = item.index;
-        list.push(obj);
-      });
-      setCheckValue([]);
-      setTabList(list);
-      setActive(list[0]?.id);
-    }
-  }, [sheet]);
-
-  const onChange = check => {
-    setCheckValue(check);
-    console.log(check);
-  };
-
-  const handleOk = () => {
-    onOk(checkValue);
-  };
-
-  return (
-    <Modal
-      title="选择导出列"
-      visible={visible}
-      onCancel={onClose}
-      onOk={handleOk}
-      bodyStyle={{ paddingTop: 0 }}
-    >
-      <Checkbox.Group value={checkValue} style={{ width: '100%' }} onChange={onChange}>
-        <Tabs activeKey={active} onChange={setActive}>
-          {tabList.map(tab => (
-            <TabPane tab={tab.name} key={tab.id}>
-              <Row>
-                {tab.list.map(item => (
-                  <Col span={8} key={item.m}>
-                    <Checkbox value={item.cid}>{item.v}</Checkbox>
-                  </Col>
-                ))}
-              </Row>
-            </TabPane>
-          ))}
-        </Tabs>
-      </Checkbox.Group>
-    </Modal>
-  );
-}
-export default CompareModal;

+ 0 - 95
src/pages/PurchaseAdmin/PurchaseList/Detail/FilesModal.js

@@ -1,95 +0,0 @@
-import React, { useEffect, useState, useRef } from 'react';
-import { UploadOutlined } from '@ant-design/icons';
-import { Form } from '@ant-design/compatible';
-import '@ant-design/compatible/assets/index.css';
-import { Button, Modal, message, Table, Spin, Tabs, Upload } from 'antd';
-const { TabPane } = Tabs;
-const { confirm } = Modal;
-import moment from 'moment/moment';
-import PreviewFile from '@/components/PreviewFile';
-// 历史清单
-function FilesModal(props) {
-  const {
-    visible,
-    onClose,
-    onUpload,
-    data,
-    uploadProps,
-    DeleteFile,
-    downloadFile,
-    loading,
-  } = props;
-  const handleSelect = item => {
-    // onSelect(item);
-    // onClose();
-  };
-  const columns = [
-    {
-      title: '预览',
-      dataIndex: 'name',
-      render: (text, item) => {
-        return <PreviewFile name={item.name} src={item.url} />;
-      },
-    },
-    {
-      title: '上传时间',
-      dataIndex: 'c_time',
-      render: text => {
-        return text ? moment(text).format('YYYY年MM月DD日  HH:mm:ss') : null;
-      },
-    },
-    {
-      title: '上传人',
-      dataIndex: 'CreatorUser',
-      render: record => record.CName || '',
-    },
-    {
-      title: '操作',
-      render: record => (
-        <>
-          <a
-            onClick={() => {
-              downloadFile(record);
-            }}
-          >
-            查看
-          </a>
-          <a
-            onClick={() => {
-              confirm({
-                title: '提醒',
-                content: '确认删除该文件,删除后无法复原',
-                okText: '确认',
-                cancelText: '取消',
-                onOk() {
-                  DeleteFile(record.id);
-                },
-              });
-            }}
-            style={{ marginLeft: 10 }}
-          >
-            删除
-          </a>
-        </>
-      ),
-    },
-  ];
-
-  const onClick = item => {
-    // onClose();
-    // onSelect(item);
-  };
-  return (
-    <Modal title="附件列表" width="60%" onCancel={onClose} visible={visible} footer={false}>
-      <div>
-        <Upload {...uploadProps}>
-          <Button type="primary" style={{ marginBottom: 20 }} loading={loading}>
-            <UploadOutlined /> 上传文件
-          </Button>
-        </Upload>
-      </div>
-      <Table rowKey="id" columns={columns} dataSource={data} loading={loading} />
-    </Modal>
-  );
-}
-export default FilesModal;

+ 0 - 365
src/pages/PurchaseAdmin/PurchaseList/Detail/FlowModal.js

@@ -1,365 +0,0 @@
-import React, { useEffect, useState, useRef, useMemo, memo } from 'react';
-import { Modal, Input, Select, List, Row, Col, Table, message, Steps, Space, Button, Popover } from 'antd';
-import Flow from '@/components/Flow/index';
-import { connect } from 'dva';
-import { GetTokenFromUrl, getToken } from '@/utils/utils';
-import { MODELS, useXFlowApp, useModelAsync } from '@antv/xflow';
-import { CheckOutlined } from '@ant-design/icons';
-import { queryDingInstanceDetail, queryRecordSheet, queryVserionByNode } from '@/services/boom';
-import { async } from '@antv/x6/lib/registry/marker/async';
-import VersionModal from './VersionModal';
-import AuditFlow from './AuditFlow';
-
-const { Step } = Steps;
-
-const { TextArea } = Input;
-const localData = JSON.parse(localStorage.ggDetaiData || '{}');
-const PAGE_SIZE = 8;
-
-// 提交
-function FlowModal(props) {
-  const {
-    visible,
-    version,
-    onClose,
-    onChangeVersion,
-    form,
-    loading,
-    flowDetail,
-    dispatch,
-    isOut,
-    onCommit,
-    currentUser,
-  } = props;
-  const [data, setData] = useState([]);
-  const [nodeLoading, setNodeLoading] = useState(false);
-  const [pageSize, setPageSize] = useState(PAGE_SIZE);
-  const [stepsData, setStepsData] = useState([]);
-  const [versionVisible, setVersionVisible] = useState(false);
-  let token = getToken();
-
-  const graphData = useMemo(() => {
-    if (!flowDetail) return;
-    let nodes = flowDetail.nodes?.map(item => ({
-      ...item,
-      isCheck: item.Id == version.template_node_id,
-    }));
-    return {
-      nodes,
-      edges: flowDetail.edges,
-    };
-  }, [flowDetail, version.template_node_id]);
-
-  useEffect(() => {
-    if (!visible) updateSteps([]);
-  }, [visible, version]);
-
-  useEffect(() => {
-    if (stepsData.length <= 0) {
-      setPageSize(PAGE_SIZE);
-    } else {
-      setPageSize(PAGE_SIZE - stepsData.length);
-    }
-  }, [stepsData]);
-
-  const handleSelectNode = async args => {
-    let res;
-    const id = args.nodeId || args.nodeIds[0];
-    if (!id) return;
-    let node = graphData.nodes.find(item => item.id == id);
-    setNodeLoading(true);
-    try {
-      res = await queryVserionByNode({ template_node_id: node.Id });
-      let data = [];
-      if (!res.data.excel_version_tree) setData([]);
-      res.data.excel_version_tree?.map(arr => {
-        if (res.data.flow_id) {
-          data = [...data, { ...arr, flow_id: res.data.flow_id }];
-        } else {
-          data = [...data, arr];
-        }
-      });
-      data.sort((a, b) => b.id - a.id);
-      data.forEach((item, id) => {
-        //解决key报错问题
-        data[id].key = `${id}-${item.name}`;
-        item.isParent = true;
-      });
-      console.log(data);
-      setData(data);
-    } catch (error) {
-      console.log(error);
-    }
-    setNodeLoading(false);
-    updateSteps([]);
-  };
-
-  const updateSteps = (data, curNodeId) => {
-    let newData = [];
-    let set = new Set();
-    data.forEach(item => set.add(item.template_node_id));
-    let list = [...set];
-    if (set.has(curNodeId)) {
-      set.delete(curNodeId);
-      list = [curNodeId, ...set];
-    }
-    let dataList = list.map(template_node_id => {
-      let itemDataList = data.filter(item => item.template_node_id == template_node_id);
-      let curid = 3;
-      let status = 'process';
-      itemDataList.forEach(item => {
-        if (item.audit_status != 3 && item.node_id <= curid) curid = item.node_id - 1;
-        if (item.audit_status == 2) status = 'error';
-      });
-      let curNode = flowDetail.nodes.find(item => item.Id == itemDataList[0].template_node_id);
-      const seqList = itemDataList[0].FlowInfo.FlowNodes.filter(
-        item => item.template_node_id == template_node_id
-      ).sort((a, b) => a.seq - b.seq);
-      let obj = {
-        status,
-        current: curid,
-        list: seqList,
-        name: curNode?.label || itemDataList[0].FlowInfo.name,
-      };
-      // itemDataList.forEach((itemData, idx) => {
-      //   if (idx >= obj.list.length) return;
-      //   obj.list[idx].auditor = itemData.AuthorInfo.CName;
-      // });
-      return obj;
-    });
-    console.log(dataList);
-    setStepsData(dataList);
-  };
-
-  // const updateSteps = async (data, curNodeId) => {
-  //   const dataList = [];
-  //   for (let i = 0; i < data.length; i++) {
-  //     let curNode = flowDetail.nodes.find(item => item.Id == data[i].template_node_id);
-  //     console.log(curNode);
-  //     const response = await queryDingInstanceDetail({
-  //       process_instance_id: data[i].ding_instance_id, //创建表单成功返回的id
-  //     });
-  //     if (response) {
-  //       const processInstance = response.data?.process_instance;
-  //       let data = {
-  //         processCode: '',
-  //         deptId: '14169890',
-  //         tasks: [],
-  //         // userId: '16569001414345099',
-  //         // deptId: currentUser.DingDepId || getCurrentUser()?.DingDepId,
-  //         userId: currentUser.DingUserId || getCurrentUser()?.DingUserId,
-  //         formComponentValues: [],
-  //         activityId: '',
-  //         cc_userids: [],
-  //         status: 'undefined',
-  //         name: curNode?.label || '未知节点',
-  //       };
-  //       if (processInstance?.tasks && processInstance.tasks?.length > 0) {
-  //         // let item = flowDetail.nodes.find(item => item.Id == version.template_node_id);
-  //         // if (!item) return data;
-  //         const { tasks, form_component_values, cc_userids } = processInstance;
-  //         data.processCode = curNode.process_code;
-  //         data.activityId = tasks[tasks.length - 1]?.activity_id;
-  //         data.tasks = tasks || [];
-  //         data.cc_userids = cc_userids;
-  //         data.formComponentValues = form_component_values?.filter(curNode => curNode.name);
-  //       }
-  //       dataList.push(data);
-  //     }
-  //   }
-  //   console.log(dataList);
-  //   setStepsData(dataList);
-  // };
-
-  const handleChangeClick = item => {
-    let file = isOut ? 'newList' : 'detail';
-    let type = item.flow_id ? '/queryAuditRecord' : '/queryAuditExcel';
-    console.log(`${file}${type}`, item);
-    dispatch({
-      type: `${file}${type}`,
-      payload: {
-        excel_id: item.id,
-        pageSize: 100,
-      },
-      callback: res => {
-        updateSteps(res, item.template_node_id);
-      },
-    });
-  };
-
-  const columns = useMemo(() => {
-    return [
-      {
-        title: '名称',
-        // width: '33%',
-        render: item => (
-          <span style={{ color: item.audit_status != 0 ? '#9b9b9b' : '' }}>
-            {item.id == version.id && !item.isParent && (
-              <CheckOutlined style={{ marginRight: 10 }} />
-            )}
-            {item.version_no && !item.children?.length
-              ? `${item.version_name}.${item.version_no}`
-              : item.version_name}
-          </span>
-        ),
-      },
-      {
-        title: '状态',
-        width: '30%',
-        render: item => {
-          if (!item.flow_id && item.isParent) return;
-          let style = { color: getColor(item) };
-          let txt = '';
-          let dom = '';
-          switch (item.audit_status) {
-            case 0:
-              txt = '未提交';
-              break;
-            case 1:
-              txt = '待审批';
-              break;
-            case 2:
-              txt = '已拒绝';
-              break;
-            case 3:
-              txt = '已通过';
-              break;
-            case 4:
-              txt = '已提交';
-              break;
-          }
-          if (item.status == 1) txt = '已失效';
-
-          // 显示拒绝原因
-          if (item.audit_comment) {
-            dom = <Popover content={item.audit_comment} title="原因">{txt}</Popover>
-          } else {
-            dom = txt
-          }
-          return item.audit_status != 0 ? (
-            <Button onClick={() => handleChangeClick(item)}>{dom}</Button>
-          ) : (
-            <span style={style}>{dom}</span>
-          );
-        },
-      },
-      {
-        title: '操作',
-        width: '20%',
-        render: item =>
-          (item.flow_id || !item.isParent) &&
-          item.id != version.id && (
-            <a
-              onClick={() => {
-                console.log(item);
-                onChangeVersion(item);
-                onClose();
-              }}
-            >
-              加载
-            </a>
-          ),
-      },
-    ];
-  }, [version]);
-
-  const onChange = () => {
-    updateSteps([]);
-  };
-
-  return (
-    <>
-      <Modal
-        confirmLoading={loading}
-        destroyOnClose
-        title="流程图"
-        visible={visible}
-        onCancel={onClose}
-        footer={false}
-        width="98%"
-      >
-        <Row gutter={8}>
-          <Col span={16}>
-            <Flow meta={{ type: 'view' }} flowDetail={graphData} onSelectNode={handleSelectNode} />
-          </Col>
-          <Col span={8}>
-            <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
-              <div style={{ fontSize: '16px' }}>清单列表</div>
-              {isOut && (
-                <Button
-                  type="primary"
-                  style={{ float: 'right', marginBottom: '10px' }}
-                  onClick={() => setVersionVisible(true)}
-                >
-                  新建清单
-                </Button>
-              )}
-            </div>
-
-            <div style={{ width: '100%' }}>
-              <Table
-                style={{ maxHeight: '90%' }}
-                columns={columns}
-                dataSource={data}
-                loading={nodeLoading}
-                bordered={false}
-                pagination={{ pageSize: 8, onChange }}
-                scroll={{ y: 65 * pageSize }}
-              />
-            </div>
-            {stepsData.map((item, idx) => (
-              <div key={`${item.name}_${idx}`} style={{ marginBottom: '20px' }}>
-                <div style={{ marginBottom: '4px' }}>{item.name}</div>
-                <Steps size="small" current={item.current} status={item.status}>
-                  {item.list.map(node => (
-                    <Step
-                      key={`${node.id}_${node.node}`}
-                      title={node.node}
-                      description={`审批人:${node.AuditorUser?.CName || '-'}`}
-                    />
-                  ))}
-                </Steps>
-              </div>
-            ))}
-          </Col>
-        </Row>
-      </Modal>
-      <VersionModal
-        visible={versionVisible}
-        onClose={() => setVersionVisible(false)}
-        onOk={values => {
-          onCommit?.(values);
-          setVersionVisible(false);
-        }}
-      />
-    </>
-  );
-}
-
-const getColor = item => {
-  let color = '';
-  switch (item.audit_status) {
-    case 2:
-      // 审批拒绝
-      color = '#f5222d';
-      break;
-    case 3:
-      // 审批成功
-      color = '#7cb305';
-      break;
-    case 4:
-      // 历史清单
-      color = '#9b9b9b';
-      break;
-
-    default:
-      break;
-  }
-  return color;
-};
-
-export default connect(({ loading, user }) => ({
-  loading,
-  currentUser: user.currentUser,
-}))(FlowModal);
-// export default FlowModal;

+ 0 - 112
src/pages/PurchaseAdmin/PurchaseList/Detail/HistoryDrawer.js

@@ -1,112 +0,0 @@
-import React, { useEffect, useState, useRef, useMemo } from 'react';
-import { UserOutlined } from '@ant-design/icons';
-import { Form } from '@ant-design/compatible';
-import '@ant-design/compatible/assets/index.css';
-import { Drawer, Descriptions, Card, Table, Timeline, Button, Space } from 'antd';
-import moment from 'moment';
-import { connect } from 'dva';
-import CommentContent from '@/components/CommentContent';
-import TimelineItem from 'antd/lib/timeline/TimelineItem';
-
-// 评论
-function HistoryDrawer(props) {
-  const {
-    flowDetail,
-    visible,
-    onClose,
-    version,
-    loading,
-    dispatch,
-    versionTree,
-    onChangeVersion,
-  } = props;
-  const columns = useMemo(() => {
-    return [
-      {
-        title: '名称',
-        render: item => (
-          <div style={{ color: '#9b9b9b' }}>
-            {item.version_no ? `${item.version_name}.${item.version_no}` : item.version_name}
-          </div>
-        ),
-      },
-      {
-        title: '业务节点',
-        width: '20%',
-        render: item => {
-          let node = flowDetail.Nodes.find(cur => cur.Id == item.template_node_id);
-          return <span style={{ color: '#9b9b9b' }}>{node?.label ? node.label : '-'}</span>;
-        },
-      },
-      {
-        title: '提交人',
-        width: '20%',
-        render: item => {
-          return (
-            <span style={{ color: '#9b9b9b' }}>
-              {item.AuthorInfo?.UserName ? item.AuthorInfo?.UserName : '-'}
-            </span>
-          );
-        },
-      },
-      {
-        title: '操作',
-        width: '20%',
-        render: item =>
-          item.id != version.id && (
-            <a
-              onClick={() => {
-                onChangeVersion(item);
-                onClose();
-              }}
-            >
-              加载
-            </a>
-          ),
-      },
-    ];
-  }, [version]);
-
-  const TimeLineItemRender = item => {
-    let time = item.m_time ? item.m_time.split('T')[0] : '-';
-    let node = flowDetail.Nodes.find(cur => cur.Id == item.template_node_id);
-    return (
-      <TimelineItem>
-        <Space>
-          <a
-            onClick={() => {
-              onChangeVersion(item);
-              onClose();
-            }}
-          >
-            {item.version_no ? `${item.version_name}.${item.version_no}` : item.version_name}
-          </a>
-          <span>{node?.label ? node.label : '-'}</span>
-          <span>提交人: {item.AuthorInfo?.UserName ? item.AuthorInfo?.UserName : '-'}</span>
-          <span>时间: {time}</span>
-        </Space>
-      </TimelineItem>
-    );
-  };
-
-  return (
-    <Drawer
-      width={600}
-      title="历史版本"
-      mask={false}
-      placement="right"
-      onClose={onClose}
-      visible={visible}
-    >
-      {/* <Table columns={columns} dataSource={versionTree} bordered={false} /> */}
-      <Timeline>{versionTree.map(item => TimeLineItemRender(item))}</Timeline>
-    </Drawer>
-  );
-}
-export default connect(({ detail, xflow, user, loading }) => ({
-  comment: detail.comment,
-  userList: user.list,
-  bomComment: detail.bomComment,
-  flowDetail: xflow.flowDetail,
-  loading: loading,
-}))(HistoryDrawer);

+ 0 - 40
src/pages/PurchaseAdmin/PurchaseList/Detail/HistoryModal.js

@@ -1,40 +0,0 @@
-import React, { useEffect, useState, useRef } from 'react';
-import { Modal, Table } from 'antd';
-import { connect } from 'dva';
-
-// 历史清单
-function HistoryModal(props) {
-  const { visible, onClose, version, onSelect, historyList } = props;
-  const handleSelect = item => {
-    onSelect(item);
-    onClose();
-  };
-  const columns = [
-    {
-      title: '标题',
-      dataIndex: 'version_name',
-    },
-    {
-      title: '描述',
-      dataIndex: 'desc',
-    },
-    {
-      title: '操作',
-      render: record => (
-        <>
-          <a onClick={() => handleSelect(record)}>导入</a>
-        </>
-      ),
-    },
-  ];
-  
-
-  return (
-    <Modal title="清单记录" width="60%" onCancel={onClose} visible={visible} footer={false}>
-      <Table rowKey="id" columns={columns} dataSource={historyList[version.id]} />
-    </Modal>
-  );
-}
-export default connect(({ detail }) => ({
-  historyList: detail.historyList,
-}))(HistoryModal);

+ 0 - 1175
src/pages/PurchaseAdmin/PurchaseList/Detail/Index.js

@@ -1,1175 +0,0 @@
-import React, { useEffect, useState, useRef, useMemo } from 'react';
-import { UnorderedListOutlined, PlusOutlined } from '@ant-design/icons';
-import { Button, Modal, message, Alert, Avatar, Spin, Select, Menu, Dropdown } from 'antd';
-import { connect } from 'dva';
-import styles from './Index.less';
-import LuckySheet from './LuckySheet';
-import router from 'umi/router';
-import AuditModal from './AuditModal';
-// import CommentDrawer from './CommentDrawer';
-import RightDrawer from './RightDrawer';
-import CommitModal from './CommitModal';
-import CompareModal from './CompareModal';
-import ExportModal from './ExportModal';
-import FlowModal from './FlowModal';
-import HistoryModal from './HistoryModal';
-import TimeNode from './TimeNode';
-import FilesModal from './FilesModal';
-import VersionModal from './VersionModal';
-import CommitAuditModal from './CommitAuditModal';
-import CommentContent from '@/components/CommentContent';
-import MergeModal from './MergeModal';
-import { GetTokenFromUrl, getToken } from '@/utils/utils';
-import { queryDetail, queryDingInstanceExecute } from '@/services/boom';
-import HistoryDrawer from './HistoryDrawer';
-import AuditFlow from './AuditFlow';
-import { getCurrentUser } from '@/utils/authority';
-import { async } from '@antv/x6/es/registry/marker/async';
-const LocalData = localStorage.luckysheet;
-
-const { Option } = Select;
-
-function Detail(props) {
-  const {
-    dispatch,
-    comment,
-    history,
-    loading,
-    currentUser,
-    fileList,
-    roleList,
-    template,
-    versionList,
-    auditList,
-    flowDetail,
-    versionTree,
-    match: { params },
-    instanceDetail,
-  } = props;
-  const [versionTreeVisible, setVersionTreeVisible] = useState(false);
-  const [commentVisible, setCommentVisible] = useState(false);
-  const [mergeVisible, setMergeVisible] = useState(false);
-  const [compareVisible, setCompareVisible] = useState(false);
-  const [exportVisible, setExportVisible] = useState(false);
-  const [commitVisible, setCommitVisible] = useState(false);
-  const [auditVisible, setAuditVisible] = useState(false);
-  const [flowVisible, setFlowVisible] = useState(false);
-  const [versionVisible, setVersionVisible] = useState(false);
-  const [commitAuditVisible, setCommitAuditVisible] = useState(false);
-  const [sheet, setSheet] = useState({});
-  const [compareList, setCompareList] = useState([]);
-  const [edit, setEdit] = useState(false);
-  const [isMerge, setIsMerge] = useState(false);
-  const [version, setVersion] = useState({});
-  const [user, setUser] = useState([]);
-  const [updateCount, setUpdateCount] = useState({
-    diff: 0,
-    add: 0,
-  });
-  const [fileVisible, setFileVisible] = useState(false);
-  const [exportDate, setExportData] = useState([]);
-  const sheetRef = useRef();
-  const sheetRef2 = useRef();
-  const sheetRef3 = useRef();
-  const fileRef = useRef();
-  const userRef = useRef();
-  const statusRef = useRef({
-    edit: false,
-    compare: false,
-  });
-  const cellPosition = useRef({});
-
-  const projectId = parseInt(params.projectId);
-  const templateId = parseInt(params.templateId);
-
-  const auditDetail = useMemo(() => {
-    let data = {
-      processCode: '',
-      deptId: '14169890',
-      tasks: [],
-      // userId: '16569001414345099',
-      // deptId: currentUser.DingDepId || getCurrentUser()?.DingDepId,
-      userId: currentUser.DingUserId || getCurrentUser()?.DingUserId,
-      formComponentValues: [],
-      activityId: '',
-      cc_userids: [],
-      status: version.audit_status,
-    };
-    if (version?.flow_id && instanceDetail?.tasks && instanceDetail.tasks?.length > 0) {
-      let item = flowDetail.nodes.find(item => item.Id == version.template_node_id);
-      if (!item) return data;
-      const { tasks, form_component_values, cc_userids } = instanceDetail;
-      data.processCode = item.process_code;
-      data.activityId = tasks[tasks.length - 1]?.activity_id;
-      data.tasks = tasks || [];
-      data.cc_userids = cc_userids;
-      data.formComponentValues = form_component_values?.filter(item => item.name);
-      if (version.status == 1) data.status = -1;
-    }
-    return data;
-  }, [instanceDetail, version]);
-
-  const flow = useMemo(() => {
-    let data = {
-      active: 0,
-      active_id: null,
-      current: 0,
-      currentNode: {},
-      list: {
-        FlowNodes: [],
-      },
-    };
-    if (version?.flow_id && auditList?.length > 0) {
-      let item = auditList.find(item => item.list.id == version.flow_id);
-      if (!item) return data;
-      // 查询当前节点
-      let current = item.list.FlowNodes.findIndex(node => node.seq == item.active);
-      item.current = current == -1 ? 0 : current;
-      // 保存当前所处节点
-      item.currentNode = item.list.FlowNodes[item.current];
-      data = item;
-    }
-    return data;
-  }, [auditList, version]);
-  const active_audit = flow.active_audit;
-  console.log(flow);
-  const isAuditor = useMemo(() => {
-    const getUserRole = () => {
-      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();
-  }, [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 => {
-    if (checkSheets) {
-      const [sheet1, sheet2] = checkSheets;
-      sheet1.data = (
-        await queryDetail({
-          excel_id: sheet1.id,
-        })
-      ).data;
-      sheet2.data = (
-        await queryDetail({
-          excel_id: sheet2.id,
-        })
-      ).data;
-
-      setCompareList(checkSheets);
-      statusRef.current.compare = true;
-    } else {
-      let index = compareList.findIndex(item => item.id == sheet.id);
-      // 退出比对模式
-      if (index == 0) {
-        sheetRef3.current.toggleCompare(false);
-      } else if (index == 1) {
-        sheetRef2.current.toggleCompare(false);
-      }
-
-      setIsMerge(false);
-      setCompareList([]);
-      setSheet({
-        ...sheet,
-      });
-      setUpdateCount({
-        diff: 0,
-        add: 0,
-      });
-      statusRef.current.compare = false;
-    }
-    setCommentVisible(false);
-  };
-
-  const renderSheetDom = (item, index) => {
-    return (
-      <div key={item?.id || 'temp'} className={styles.sheetItem}>
-        <h3>{item.version_name || item?.name}</h3>
-        <LuckySheet
-          className={styles.sheet}
-          ref={!index ? sheetRef3 : sheetRef2}
-          data={item.data || null}
-          // onClickCell={onClickCell}
-        />
-      </div>
-    );
-  };
-
-  const onClickCell = (cell, position, s) => {
-    console.log(cell);
-    if (cell?.cid && !statusRef.current.edit) {
-      let payload = {
-        sheet_id: s.order || '0',
-        excel_id: version.id,
-        cid: cell.cid,
-      };
-      dispatch({
-        type: 'detail/queryComment',
-        payload,
-      });
-      cellPosition.current = {
-        ...payload,
-        sheet_index: (s.seq || 0) + '',
-      };
-      // setCommentVisible(true);
-    }
-    // 比对模式下双excl同步选中
-    // if (statusRef.current.compare) {
-    //   sheetRef3.current.selectCell(position.r, position.c, s.order);
-    //   sheetRef2.current.selectCell(position.r, position.c, s.order);
-    // }
-  };
-
-  const onCommit = (values, id) => {
-    let currentNode = flowDetail.nodes.find?.(item => item.Id == version.template_node_id);
-    let currentData = sheetRef.current.getSheetJson().data;
-    let sheets = JSON.parse(JSON.stringify(currentData));
-    if (!currentNode.muti_version) {
-      // audit_status=4 表示为清单推进后留存的副本.不计入多清单计算
-      let serviceVersion = versionList.find(
-        item => item.audit_status != 4 && item.template_node_id == currentNode.Id
-      );
-      if (serviceVersion) {
-        message.error(`新建清单失败!业务节点【${currentNode.label}】只能有一个清单!`);
-        return;
-      }
-    }
-
-    sheets.forEach(item => {
-      delete item.data;
-    });
-    console.log(sheets);
-    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({
-      type: 'detail/commitSheet',
-      payload: params,
-      callback: newVersion => {
-        onCompare(false);
-        setCommitVisible(false);
-        setVersionVisible(false);
-        changeVersion(newVersion);
-
-        // 更新flow流程图
-        dispatch({
-          type: 'xflow/queryBoomFlowDetail',
-          payload: {
-            id: templateId,
-          },
-        });
-      },
-    });
-  };
-
-  const onUpdate = () => {
-    if (flow.active != 0) return;
-    let currentData = sheetRef.current.getSheetJson().data;
-    let sheets = JSON.parse(JSON.stringify(currentData));
-    sheets.forEach(item => {
-      delete item.data;
-    });
-    console.log(sheets);
-    let params = {
-      ...version,
-      data: JSON.stringify(sheets),
-    };
-    dispatch({
-      type: 'detail/saveSheet',
-      payload: params,
-    });
-  };
-
-  const onAudit = ({ audit_comment }) => {
-    const flowNode = flow.currentNode;
-    dispatch({
-      type: 'detail/approve',
-      payload: {
-        id: flow.active_id,
-        project_id: projectId,
-        audit_status: 2,
-        flow_id: flowNode.flow_id,
-        node_id: flowNode.seq,
-        audit_comment,
-      },
-      callback: newVersion => {
-        setAuditVisible(false);
-        // 更新flow流程图
-        dispatch({
-          type: 'xflow/queryBoomFlowDetail',
-          payload: {
-            id: templateId,
-          },
-        });
-        localStorage.excelId = newVersion.id;
-        setVersion({
-          ...version,
-          flow_id: newVersion.flow_id,
-          id: newVersion.id,
-        });
-      },
-    });
-  };
-
-  const onApprove = flag => {
-    if (!flag) {
-      setAuditVisible(true);
-      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
-        );
-      }
-    }
-    Modal.confirm({
-      title: '提示',
-      content: isSingle
-        ? `节点【${serviceNode.label}】只能拥有一个清单,是否覆盖?`
-        : `是否通过审批。`,
-      okText: '确定',
-      cancelText: '取消',
-      onOk: () => {
-        dispatch({
-          type: 'detail/approve',
-          payload: {
-            id: flow.active_id,
-            project_id: projectId,
-            audit_status: 3,
-            flow_id: flowNode.flow_id,
-            node_id: flowNode.seq,
-          },
-          callback: newVersion => {
-            // 更新flow流程图
-            dispatch({
-              type: 'xflow/queryBoomFlowDetail',
-              payload: {
-                id: templateId,
-              },
-            });
-
-            // 更新审批流
-            dispatch({
-              type: 'detail/queryAuditList',
-              payload: {
-                template_id: version.template_id,
-                template_node_id: version.template_node_id,
-                flow_id: version.flow_id,
-                version_id: version.version_id,
-              },
-            });
-            if (flow.current == flow.list.FlowNodes.length - 1) {
-              // 最后一个审核节点通过后  需要更新version id 不更不更,留在原地
-              // localStorage.excelId = newVersion.id;
-              // setVersion({
-              //   ...version,
-              //   flow_id: newVersion.flow_id,
-              //   id: newVersion.id,
-              // });
-            }
-          },
-        });
-      },
-    });
-  };
-
-  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 [sheet1, sheet2] = checkSheets;
-    const sheet1 = version;
-    if (!sheet1.data) {
-      sheet1.data = (
-        await queryDetail({
-          excel_id: sheet1.id,
-        })
-      ).data;
-    }
-    if (!sheet2.data) {
-      sheet2.data = (
-        await queryDetail({
-          excel_id: sheet2.id,
-        })
-      ).data;
-    }
-
-    setIsMerge(true);
-    setCompareList([sheet1, sheet2]);
-    // setTimeout(() => {
-    //   sheetRef3.current.mergeExcl(sheet.data);
-    // }, 400);
-  };
-
-  const handleClickFile = () => {
-    fileRef.current.click();
-  };
-
-  const handleMenuClick = e => {
-    console.log('click', e);
-    switch (e.key) {
-      case 'back':
-        // 返回
-        router.push(`/bom`);
-        break;
-      // case 'version':
-      //   // 清单
-      //   queryHistory();
-      //   setCommentVisible(false);
-      //   setHistoryVisible(true);
-      //   break;
-      case 'bomDetail':
-        // 清单
-        setCommentVisible(true);
-        break;
-      case 'export':
-        // 导出
-        handleExportClick();
-        break;
-      case 'commitAudit':
-        // 提交流转
-        setCommitAuditVisible(true);
-        break;
-      case 'flow':
-        // 查看流程
-        setFlowVisible(true);
-        break;
-      case 'compare':
-        // 比对
-        setCompareVisible(true);
-        break;
-      case 'template':
-        // 模板
-        handleClickFile();
-        break;
-      // case 'auditSuccess':
-      //   // 审核通过
-      //   onApprove(true);
-      //   break;
-      // case 'auditFailed':
-      //   // 审核拒绝
-      //   onApprove(false);
-      //   break;
-      // case 'edit':
-      //   // 编辑
-      //   handleEdit(true);
-      case 'merge':
-        // 同步清单
-        setMergeVisible(true);
-        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 = () => {
-        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) {
-          return node.role_list
-            .split(',')
-            .some(id => currentUser.roleList?.find(role => role.ID == id));
-        }
-        return true;
-      };
-      // console.log('是否有权限提交流转   ', getIsSubmit());
-      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" />;
-        break;
-    }
-
-    return <div style={{ marginTop: 20 }}>{item}</div>;
-  };
-
-  const exportExcl = files => {
-    sheetRef.current.uploadExcel(files, () => {
-      fileRef.current.value = null;
-    });
-  };
-
-  const getRowOneList = () => {
-    const obj = sheetRef.current.getSheetJson();
-    console.log(obj);
-    const list = [];
-    obj.data.forEach(item => {
-      list.push(item.data[0]);
-    });
-    return list;
-  };
-
-  //点击导出弹出选择导出列弹框
-  const handleExportClick = () => {
-    setExportData(sheetRef.current.getSheetJson());
-    setExportVisible(true);
-  };
-
-  const downloadExcel = checkValue => {
-    sheetRef.current.downloadExcel(checkValue);
-    setExportVisible(false);
-  };
-
-  const queryHistory = id => {
-    return new Promise(reslove => {
-      dispatch({
-        type: 'detail/queryHistory',
-        payload: {
-          // excel_id: id || excelId,
-          project_id: projectId,
-        },
-        callback: reslove,
-      });
-    });
-  };
-
-  const queryFiles = () => {
-    dispatch({
-      type: 'detail/queryFiles',
-      payload: {
-        // excel_id: id || excelId,
-        excel_id: version.id,
-      },
-    });
-  };
-
-  const getUploadProps = () => {
-    const token = getToken() || GetTokenFromUrl();
-    const uploadProps = {
-      name: 'file',
-      showUploadList: false,
-      action: `/api/v1/purchase/attachment/${version.id}`,
-      headers: {
-        'JWT-TOKEN': token,
-      },
-      onChange(info) {
-        if (info.file.status !== 'uploading') {
-          console.log(info.file, info.fileList);
-        }
-        if (info.file.status === 'done') {
-          message.success(`${info.file.name} 文件上传成功`);
-          queryFiles();
-        } else if (info.file.status === 'error') {
-          message.error(`${info.file.name} 文件上传失败`);
-        }
-      },
-    };
-    return uploadProps;
-  };
-
-  const deleteFile = id => {
-    dispatch({
-      type: 'detail/deleteFiles',
-      id: id,
-      callback: () => {
-        queryFiles();
-      },
-    });
-  };
-
-  const queryHistoryDetail = async item => {
-    return new Promise(resolve => {
-      dispatch({
-        type: 'detail/queryHistoryDetail',
-        payload: {
-          excel_id: item.excel_id,
-          history_id: item.id,
-        },
-        callback: sheet => {
-          resolve(sheet);
-        },
-      });
-    });
-  };
-
-  const getLoading = () => {
-    let effects = loading.effects;
-    return !loading.effects['detail/queryComment'] && loading.models.detail;
-  };
-
-  const getFilesLoading = () => {
-    let effects = loading.effects;
-    return loading.effects['detail/queryFiles'];
-  };
-
-  const downloadFile = record => {
-    window.location.href = `${record.url}`;
-  };
-
-  const changeVersion = id => {
-    let version;
-    if (typeof id == 'object') {
-      version = id;
-      localStorage.excelId = version.id;
-      localStorage.excelItem = JSON.stringify(version);
-    } else {
-      version = versionList.find(item => item.id == id);
-      if (!version) return;
-      localStorage.excelId = id;
-    }
-    setVersion(version);
-    //请求历史版本
-    dispatch({
-      type: 'detail/queryVersionsTree',
-      payload: {
-        excel_id: version.id || localStorage.excelId,
-      },
-    });
-
-    // 判断是否审批节点
-    if (version.flow_id) {
-      dispatch({
-        type: 'detail/queryAuditList',
-        payload: {
-          template_id: version.template_id,
-          template_node_id: version.template_node_id,
-          flow_id: version.flow_id,
-          version_id: version.version_id,
-        },
-      });
-    }
-  };
-
-  const onSubmitNextNode = values => {
-    dispatch({
-      type: 'detail/submitNextNode',
-      payload: values,
-      callback: newVersion => {
-        setCommitAuditVisible(false);
-        // 更新version
-        // localStorage.excelId = newVersion.id;
-        // changeVersion({
-        //   ...version,
-        //   ...newVersion,
-        //   version_id: version.id
-        // });
-        // 更新flow流程图
-        dispatch({
-          type: 'xflow/queryBoomFlowDetail',
-          payload: {
-            id: templateId,
-          },
-        });
-      },
-    });
-  };
-
-  const getUser = newUser => {
-    try {
-      if (JSON.stringify(newUser) != JSON.stringify(userRef.current)) {
-        userRef.current = newUser;
-        setUser(newUser);
-      }
-    } 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,
-    });
-  };
-  useEffect(() => {
-    dispatch({
-      type: 'detail/queryProjectRecord',
-      payload: {
-        project_id: projectId,
-      },
-    });
-    dispatch({
-      type: 'xflow/queryBoomFlowDetail',
-      payload: {
-        id: templateId,
-      },
-    });
-    dispatch({
-      type: 'user/getRoleList',
-    });
-    dispatch({
-      type: 'user/fetch',
-    });
-    dispatch({
-      type: 'user/fetchDepV2',
-    });
-    // dispatch({
-    //   type: 'detail/queryListParentByUser',
-    //   payload: {
-    //     userid: currentUser.DingUserId || getCurrentUser()?.DingUserId,
-    //   },
-    // });
-  }, []);
-
-  useEffect(() => {
-    if (compareList.length == 2) {
-      const callback = ({ diff, add }) => {
-        setUpdateCount(updateCount => {
-          return {
-            diff: diff.length,
-            add: updateCount.add + add.length,
-          };
-        });
-      };
-      var update1 = sheetRef3.current.toggleCompare(true, compareList[1].data, callback);
-      var update2 = sheetRef2.current.toggleCompare(true, compareList[0].data, callback);
-    }
-  }, [compareList]);
-
-  useEffect(() => {
-    if (versionList.length == 0) return;
-    if (!version.id) {
-      const excelId = localStorage.excelItem
-        ? JSON.parse(localStorage.excelItem)
-        : localStorage.excelId;
-      changeVersion(excelId);
-    } else {
-      changeVersion(version.id);
-    }
-  }, [versionList]);
-
-  return (
-    <Spin spinning={false}>
-      <div className={styles.top}>
-        <div>
-          <Button type="primary" style={{ marginRight: 20 }} onClick={() => setFlowVisible(true)}>
-            查看流程
-          </Button>
-
-          {/* 非审批节点可以创建清单 */}
-          {flow?.active == 0 && (
-            <Button type="primary" onClick={() => setVersionVisible(true)}>
-              新建清单
-            </Button>
-          )}
-          {renderNode()}
-        </div>
-        <div className={styles.btns}>
-          <Button
-            type="primary"
-            style={{ marginRight: 20 }}
-            onClick={() => setVersionTreeVisible(true)}
-          >
-            历史版本
-          </Button>
-          <Avatar.Group style={{ marginRight: 20 }}>
-            {user.map((item, id) => (
-              <Avatar
-                key={`${id}-${item.name}`}
-                style={{ backgroundColor: '#008dff' }}
-                size="large"
-              >
-                {item.Name}
-              </Avatar>
-            ))}
-          </Avatar.Group>
-          {renderBtns()}
-        </div>
-        <input
-          type="file"
-          ref={fileRef}
-          style={{ display: 'none' }}
-          onChange={e => exportExcl(e.target.files)}
-        />
-      </div>
-      <TimeNode flow={flow} isAuditor={isAuditor} onApprove={onApprove}></TimeNode>
-      {/* {version.flow_id ? (
-        <AuditFlow {...auditDetail} canShowAudit={true} onApprove={onApprove} />
-      ) : null} */}
-
-      {/* {renderAlert()} */}
-      {/* 判断是否为比对模式 */}
-      {compareList.length == 2 ? (
-        <>
-          <Alert
-            message={`比对结果:${updateCount.diff}项差异。${updateCount.add}项新增`}
-            type="info"
-          />
-          <div className={styles.sheetBox}>{compareList.map(renderSheetDom)}</div>
-        </>
-      ) : (
-        <div className={styles.sheetBox}>
-          {version.id && (
-            <LuckySheet
-              className={styles.sheet}
-              ref={sheetRef}
-              onClickCell={onClickCell}
-              version={version}
-              templateId={templateId}
-              getUser={getUser}
-              onUpdate={onUpdate}
-            />
-          )}
-        </div>
-      )}
-
-      <HistoryDrawer
-        versionTree={versionTree}
-        version={version}
-        visible={versionTreeVisible}
-        onChangeVersion={version => changeVersion(version)}
-        onClose={() => setVersionTreeVisible(false)}
-      />
-
-      <CommentContent
-        title="单元格沟通记录"
-        comment={comment}
-        onSubmit={handleSubmitCell}
-        loading={loading.effects['detail/queryComment'] || loading.effects['detail/addComment']}
-      />
-
-      <RightDrawer
-        version={version}
-        visible={commentVisible}
-        onClose={() => setCommentVisible(false)}
-      />
-      <CompareModal
-        visible={compareVisible}
-        version={version}
-        onClose={() => setCompareVisible(false)}
-        onOk={onCompare}
-      />
-      <MergeModal
-        visible={mergeVisible}
-        version={version}
-        onClose={() => setMergeVisible(false)}
-        onOk={onMergeVersion}
-      />
-      <ExportModal
-        visible={exportVisible}
-        sheet={exportDate.data}
-        onClose={() => setExportVisible(false)}
-        onOk={downloadExcel}
-      />
-      <FlowModal
-        flowDetail={flowDetail}
-        visible={flowVisible}
-        onClose={() => setFlowVisible(false)}
-        version={version}
-        onChangeVersion={version => changeVersion(version)}
-      />
-      <AuditModal
-        loading={getLoading()}
-        visible={auditVisible}
-        onClose={() => setAuditVisible(false)}
-        onOk={onAudit}
-      />
-      <FilesModal
-        loading={getFilesLoading()}
-        visible={fileVisible}
-        onClose={() => setFileVisible(false)}
-        uploadProps={getUploadProps()}
-        DeleteFile={deleteFile}
-        downloadFile={downloadFile}
-        data={fileList}
-      />
-      <VersionModal
-        loading={getLoading()}
-        visible={versionVisible}
-        onClose={() => setVersionVisible(false)}
-        onOk={values => onCommit(values)}
-      />
-      <CommitAuditModal
-        loading={getLoading()}
-        visible={commitAuditVisible}
-        version={version}
-        onClose={() => setCommitAuditVisible(false)}
-        onOk={onSubmitNextNode}
-        luckysheet={sheetRef}
-      />
-    </Spin>
-  );
-}
-
-export default connect(({ detail, user, xflow, loading }) => ({
-  flowDetail: xflow.flowDetail,
-  auditList: detail.auditList,
-  fileList: detail.fileList,
-  history: detail.history,
-  comment: detail.comment,
-  instanceDetail: detail.dingInstanceDetail,
-  currentUser: user.currentUser,
-  roleList: detail.roleList,
-  versionList: detail.versionList,
-  versionTree: detail.versionTree,
-  loading,
-}))(Detail);

+ 0 - 59
src/pages/PurchaseAdmin/PurchaseList/Detail/Index.less

@@ -1,59 +0,0 @@
-.logo {
-  color: white;
-  font-weight: 600;
-  font-size: 20px;
-  font-family: Avenir, 'Helvetica Neue', Arial, Helvetica, sans-serif;
-  vertical-align: middle;
-}
-.sheetBox {
-  display: flex;
-  .sheetItem {
-    padding: 10px;
-    width: 100%;
-    h3 {
-      font-size: 24px;
-      margin-bottom: 10px;
-      font-weight: bold;
-    }
-  }
-  iframe {
-    width: 100%;
-    height: 70vh;
-    border: none;
-  }
-}
-.top {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  margin-bottom: 20px;
-}
-.btns {
-  margin: 5px 0;
-  position: relative;
-  display: flex;
-  align-items: center;
-  :global {
-    .ant-btn {
-      margin-left: 10px;
-    }
-  }
-}
-.fileBtn {
-  position: absolute;
-  right: 0px;
-}
-
-.historyList {
-  padding: 0 10px;
-}
-.curTitle  {
-  margin-left: 20px;
- span {
-  color: #1890FF;
-  margin-right: 10px;
- }
-}
-.topF{
-  margin: 20px;
-}

+ 0 - 517
src/pages/PurchaseAdmin/PurchaseList/Detail/LuckySheet.js

@@ -1,517 +0,0 @@
-import React from 'react';
-import { message } from 'antd';
-import exportExcel, { getExcelBolob } from '@/utils/exportExcl';
-import LuckyExcel from 'luckyexcel';
-import { getToken } from '@/utils/utils';
-
-const hintText = '禁止编辑!请先点击编辑按钮。';
-const DIFF_COLOR = '#ff0000';
-const ADD_COLOR = '#00ff00';
-
-class LuckySheet extends React.Component {
-  constructor(props) {
-    super(props);
-    this.sheetRef = React.createRef();
-    this.luckysheet = null;
-    this.updateCell = {
-      add: [],
-      diff: [],
-    };
-    this.renderTimer = null;
-    this.chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
-  }
-  componentWillUnmount() {
-    this.luckysheet?.destroy();
-  }
-  componentDidUpdate(prveProps) {
-    const prevVersion = prveProps.version || {};
-    const curVersion = this.props.version || {};
-    if (prevVersion?.id != curVersion?.id || prevVersion?.flow_id != curVersion.flow_id) {
-      console.log(prevVersion, curVersion);
-      this.renderSheet();
-    }
-  }
-
-  getUUID(len = 8, radix = 16) {
-    var chars = this.chars;
-    var uuid = [],
-      i;
-    radix = radix || chars.length;
-
-    if (len) {
-      // Compact form
-      for (i = 0; i < len; i++) uuid[i] = chars[0 | (Math.random() * radix)];
-    } else {
-      // rfc4122, version 4 form
-      var r;
-
-      // rfc4122 requires these characters
-      uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
-      uuid[14] = '4';
-
-      // Fill in random data.  At i==19 set the high bits of clock sequence as
-      // per rfc4122, sec. 4.1.5
-      for (i = 0; i < 36; i++) {
-        if (!uuid[i]) {
-          r = 0 | (Math.random() * 16);
-          uuid[i] = chars[i == 19 ? (r & 0x3) | 0x8 : r];
-        }
-      }
-    }
-
-    return uuid.join('');
-  }
-  renderSheet(currentData) {
-    const { onClickCell, version, getUser, onUpdate, templateId } = this.props;
-    const data = currentData || this.props.data;
-    if (!this.luckysheet) {
-      clearTimeout(this.renderTimer);
-      this.renderTimer = setTimeout(() => {
-        this.renderSheet(currentData);
-      }, 300);
-      return;
-    }
-    let token = getToken();
-    let option = {
-      lang: 'zh',
-      showinfobar: false,
-      showstatisticBar: false,
-      // forceCalculation: true,
-      hook: {
-        cellMousedown: (cell, position, sheet) => {
-          onClickCell && onClickCell(cell, position, sheet);
-        },
-        cellPasteBefore: cell => {
-          console.log(cell);
-          if (!cell) return;
-          if (cell.cid) delete cell.cid;
-          if (cell.bg == DIFF_COLOR || cell.bg == ADD_COLOR) {
-            delete cell.bg;
-          }
-        },
-        updated(operate) {
-          console.log(operate);
-          onUpdate && onUpdate();
-        },
-      },
-    };
-    if (version) {
-      option = {
-        ...option,
-        allowUpdate: true,
-        gridKey: version.id,
-        templateId: templateId,
-        // flowId: version.flow_id,
-        loadUrl: `/api/v1/purchase/record/sheet?gridKey=${version.id}&JWT-TOKEN=${token}`,
-        updateUrl: `ws://47.96.12.136:8896/api/v1/ws?id=${version.id}&sid=${templateId}&JWT-TOKEN=${token}`,
-        authorityUrl: `/api/v1/purchase/bom/user/excel/col?depId=${localStorage.depId}&JWT-TOKEN=${token}`,
-        getUser,
-        // workbookCreateBefore(luckysheet) {
-        //   console.log('===============================', luckysheet);
-        //   let oldConfig = JSON.parse(JSON.stringify(luckysheet.getConfig()));
-        //   setTimeout(() => {
-        //     luckysheet.setConfig({
-        //       ...oldConfig,
-        //       authority: { sheet: true, hintText },
-        //     });
-        //   }, 300);
-        // },
-      };
-      console.log(version);
-      if (version.flow_id) {
-        option.authority = {
-          sheet: true,
-          hintText: '当前处于审批节点,禁止编辑!',
-        };
-      } else if (version.audit_status != 0 || version.status == 1) {
-        option.authority = {
-          sheet: true,
-          hintText: '当前清单不可编辑!',
-        };
-      }
-    } else if (data && data.length > 0) {
-      option.data = JSON.parse(JSON.stringify(data));
-
-      option.data.forEach(item => {
-        if (item.celldata) {
-          item.celldata.forEach(cell => {
-            // 生成uuid
-            if (!cell.v.cid) cell.v.cid = this.getUUID();
-          });
-        }
-        // 默认禁止编辑
-        // item.config.authority = { sheet: true, hintText };
-      });
-    } else {
-      // 默认sheet页数据
-      data.data = [
-        {
-          name: 'sheet1',
-          // config: {
-          //   authority: { sheet: true, hintText },
-          // },
-        },
-      ];
-    }
-    
-    this.luckysheet.destroy();
-    this.luckysheet.create(option);
-    setTimeout(() => {
-      this.luckysheet.setCellFormat(0, 0, 'bg', "#fff");
-    }, 1000)
-  }
-
-  // componentDidUpdate(prevProps) {
-  //   const { data } = this.props;
-  //   if (prevProps.data != data) {
-  //     this.renderSheet(data);
-  //   }
-  // }
-
-  handleLoad() {
-    const { version } = this.props;
-    let contentWindow = this.sheetRef.current.contentWindow;
-    this.luckysheet = contentWindow.luckysheet;
-    // this.luckysheet = this.luckysheet;
-    // version存在  则需调用render
-    if (version) {
-      this.renderSheet();
-    }
-    // onLoad && onLoad();
-  }
-
-  selectCell(row, col, order) {
-    this.luckysheet.setRangeShow({ row: [row, row], column: [col, col] }, { order });
-  }
-
-  toggleSheet(order) {
-    this.luckysheet.setSheetActive(order);
-  }
-
-  getSheetJson() {
-    let data = JSON.parse(JSON.stringify(this.luckysheet.toJson()));
-    data.data.forEach(sheet => {
-      let allCell = {},
-        unknowCid = [];
-      // 将cell以cid为界分别存储
-      (sheet.celldata || []).forEach(cell => {
-        if (!cell.v.cid) {
-          unknowCid.push(cell);
-        } else {
-          allCell[cell.v.cid] = cell;
-        }
-        // 清除比对样式
-        if (cell.v.bg == DIFF_COLOR || cell.v.bg == ADD_COLOR) {
-          delete cell.v.bg;
-        }
-      });
-
-      unknowCid.forEach(cell => {
-        // 根据坐标生成唯一key,重复则增加后缀直至不重复
-        let key = `${cell.r}-${cell.c}`;
-        while (allCell[key]) {
-          key += '|c';
-        }
-        cell.v.cid = key;
-        allCell[key] = cell;
-      });
-      sheet.celldata = Object.values(allCell);
-    });
-
-    return data;
-  }
-
-  // 切换编辑状态
-  toggleEdit(edit) {
-    let luckysheet = this.luckysheet;
-    if (edit) {
-      let config = luckysheet.getConfig();
-      luckysheet.setConfig({
-        ...config,
-        authority: { sheet: !edit, hintText },
-      });
-    } else {
-      luckysheet.exitEditMode();
-    }
-  }
-
-  // 切换比对状态
-  toggleCompare(isCompare, compareData, callback) {
-    let luckysheet = this.luckysheet;
-    let diff = [];
-    let add = [];
-    const { onCompareSuccess } = this.props;
-    // 判断dom是否加载完成
-    if (!luckysheet) {
-      setTimeout(() => {
-        this.toggleCompare(isCompare, compareData, callback);
-      }, 300);
-      return;
-    }
-    if (isCompare) {
-      // let currentData = this.luckysheet.toJson();
-      let currentData = JSON.parse(JSON.stringify(this.props.data));
-      currentData.forEach((sheet, index) => {
-        let celldata1 = sheet.celldata;
-        let celldata2 = compareData[index]?.celldata || [];
-
-        celldata1.forEach(item => {
-          // 不判断空字符串
-          if (this.isEmpty(item)) return;
-          var d2Item = celldata2.find(item2 => item2.v.cid == item.v.cid);
-          if (d2Item && !this.isEmpty(d2Item)) {
-            // v.ct.s相同,不做处理
-            if (item.v.ct?.s && JSON.stringify(item.v.ct?.s) == JSON.stringify(d2Item.v.ct?.s))
-              return;
-            // v.v相同,不做处理
-            if (d2Item.v.v == item.v.v) return;
-            // 内容不同,标记diff颜色
-            diff.push({
-              ...item,
-              sheetOrder: index,
-            });
-            item.v.bg = DIFF_COLOR;
-            // luckysheet.setCellFormat(item.r, item.c, 'bg', DIFF_COLOR);
-          } else {
-            // 找不到同cid的单元格,标记add颜色
-            add.push({
-              ...item,
-              sheetOrder: index,
-            });
-            item.v.bg = ADD_COLOR;
-            // luckysheet.setCellFormat(item.r, item.c, 'bg', ADD_COLOR);
-          }
-        });
-      });
-      console.log(currentData);
-      this.renderSheet(currentData);
-      // luckysheet.refresh()
-    } else {
-      this.renderSheet(this.props.data);
-    }
-    this.updateCell = {
-      diff,
-      add,
-    };
-    callback && callback(this.updateCell);
-  }
-  isEmpty(item) {
-    return (item?.v?.v ?? '') === '' && !item?.v?.ct?.s;
-  }
-  mergeExcl(updateCell = {}) {
-    const { diff = [], add = [] } = updateCell;
-    let currentData = this.luckysheet.toJson().data;
-    let luckysheet = this.luckysheet;
-    console.log(updateCell);
-    diff.forEach(item => {
-      let sheet = currentData[item.sheetOrder];
-      let d1Item = sheet.celldata.find(item2 => item2.v.cid == item.v.cid);
-      // 将差异项覆盖至当前文档
-      d1Item.v = {
-        ...item.v,
-        bg: undefined,
-      };
-    });
-    add.forEach(item => {
-      // 将新增项添加至当前文档
-      let sheet = currentData[item.sheetOrder];
-      let d1Item = sheet.celldata.find(item2 => item2.r == item.r && item2.c == item.c);
-      if (d1Item) {
-        d1Item.v = {
-          ...item.v,
-          bg: undefined,
-        };
-      } else {
-        sheet.celldata.push({
-          ...item,
-          sheetOrder: undefined,
-        });
-      }
-    });
-    currentData.forEach(sheet => {
-      delete sheet.data;
-    });
-    this.renderSheet(currentData);
-    // currentData.data.forEach((sheet, index) => {
-    //   if (!mergeData[index]) return;
-    //   let celldata1 = sheet.celldata;
-    //   let celldata2 = mergeData[index].celldata;
-    //   celldata2.forEach(item => {
-    //     let bg = item.v?.bg;
-    //     let d1Item;
-    //     if (bg == DIFF_COLOR) {
-    //       delete item.v.bg;
-    //       d1Item = celldata1.find(item2 => item2.v.cid == item.v.cid);
-    //       // 将差异项覆盖至当前文档
-    //       d1Item.v = item.v;
-    //       // luckysheet.setCellValue(d1Item.r, d1Item.c, item.v);
-    //     } else if (bg == ADD_COLOR) {
-    //       delete item.v.bg;
-    //       // 将新增项添加至当前文档
-    //       // luckysheet.setCellValue(item.r, item.c, item.v);
-    //       d1Item = celldata1.find(item2 => item2.r == item.r && item2.c == item.c);
-    //       if (d1Item) {
-    //         d1Item.v = item.v;
-    //       } else {
-    //         celldata1.push(item);
-    //       }
-    //     }
-    //   });
-    // });
-    // this.renderSheet(currentData);
-  }
-
-  /**
-   * 导入excl
-   * @param {*} files input:file的evt.target.files
-   * @returns
-   */
-  uploadExcel(files, callback) {
-    if (files == null || files.length == 0) {
-      return;
-    }
-
-    let name = files[0].name;
-    let suffixArr = name.split('.'),
-      suffix = suffixArr[suffixArr.length - 1];
-    if (suffix != 'xlsx') {
-      alert('Currently only supports the import of xlsx files');
-      message.error('只支持xlsx格式的文件!');
-      return;
-    }
-    LuckyExcel.transformExcelToLucky(files[0], (exportJson, luckysheetfile) => {
-      if (exportJson.sheets == null || exportJson.sheets.length == 0) {
-        message.error('读取xlsx文件失败!');
-        return;
-      }
-      // this.luckysheet.destroy();
-      // 同步当前文档内容
-      let data = this.props.data;
-      exportJson.sheets.forEach((sheet, index) => {
-        if (!data || !data[index]) return;
-        sheet.celldata.forEach(cell => {
-          if (this.isEmpty(cell)) return;
-          // return (item.v.v ?? '') === '' && !item.v.ct?.s;
-          let dCell = (data[index].celldata || []).find(dCell => {
-            return dCell.r == cell.r && dCell.c == cell.c;
-          });
-          if (this.isEmpty(dCell)) return;
-          // 判断v.ct是否相同
-          // if (cell?.v?.ct?.s && dCell.v.ct?.s && cell.v.ct?.s.join('') != dCell.v.ct?.s.join('')) return;
-          if (cell?.v?.ct?.s && dCell.v.ct?.s) {
-            if (cell.v.ct?.s.join('') != dCell.v.ct?.s.join('')) return;
-            let cellS = cell.v.ct.s;
-            let dCellS = dCell.v.ct.s;
-            let isEqul = cellS.every((cur, idx) => {
-              return JSON.stringify(cur) === JSON.stringify(dCellS[idx]);
-            });
-            if (!isEqul) return;
-          }
-          // 判断v.v是否相同
-          if (cell?.v?.v && dCell.v.v != cell.v.v) return;
-          // 内容相同则复制cid
-          cell.cid = dCell.cid;
-        });
-      });
-      this.renderSheet(exportJson.sheets);
-      callback && callback();
-    });
-  }
-  // 根据url导入excl
-  // selectExcel(item) {
-  //   const {value,name} = item
-
-  //   if (value == '') {
-  //     return;
-  //   }
-  //   LuckyExcel.transformExcelToLuckyByUrl(value, name, (exportJson, luckysheetfile) => {
-  //     if (exportJson.sheets == null || exportJson.sheets.length == 0) {
-  //       alert(
-  //         'Failed to read the content of the excel file, currently does not support xls files!'
-  //       );
-  //       return;
-  //     }
-
-  //     this.luckysheet.destroy();
-
-  //     this.luckysheet.create({
-  //       container: 'luckysheet', //luckysheet is the container id
-  //       showinfobar: false,
-  //       data: exportJson.sheets,
-  //       title: exportJson.info.name,
-  //       userInfo: exportJson.info.name.creator,
-  //     });
-  //   });
-  // }
-
-  getExcelData(checkValue = null) {
-    let resultList = [];
-    console.log(this.luckysheet.getAllSheets());
-
-    let currentData = this.luckysheet.getAllSheets();
-    currentData.forEach(sheet => {
-      let data = sheet.data;
-      let celldata = sheet.celldata;
-      let colList = [];
-      data[0]?.forEach((rowOneItem, colIdx) => {
-        if (rowOneItem) {
-          if (!checkValue || checkValue.indexOf(rowOneItem.cid) !== -1) {
-            colList.indexOf(colIdx) == -1 ? colList.push(colIdx) : true;
-          }
-        }
-      });
-
-      const newData = [];
-      data.forEach(item => {
-        if (item !== null) {
-          let arr = item.filter((cur, idx) => {
-            return item && colList.includes(idx);
-          });
-          newData.push(arr);
-        }
-      });
-      sheet.data = newData;
-
-      //消除空列后都列下标
-      let newColIdxList = colList.map((cur, idx) => {
-        return idx;
-      });
-      //处理celldata
-      const newCellData = [];
-      celldata.forEach(item => {
-        let idx = colList.indexOf(item.c);
-        if (idx !== -1) {
-          item.c = newColIdxList[idx];
-          newCellData.push(item);
-        }
-      });
-      sheet.celldata = newCellData;
-    });
-
-    return currentData;
-  }
-
-  getExcelBolb() {
-    let currentData = this.getExcelData();
-    return getExcelBolob(currentData);
-  }
-
-  downloadExcel(checkValue) {
-    let currentData = this.getExcelData(checkValue);
-    exportExcel(currentData, '下载');
-  }
-
-  render() {
-    return (
-      <iframe
-        onLoad={e => {
-          this.handleLoad(e);
-        }}
-        ref={this.sheetRef}
-        src="/luckysheet.html"
-      ></iframe>
-    );
-  }
-}
-
-export default LuckySheet;

+ 0 - 84
src/pages/PurchaseAdmin/PurchaseList/Detail/MergeModal.js

@@ -1,84 +0,0 @@
-import React, { useEffect, useState, useRef, useMemo } from 'react';
-import { Form } from '@ant-design/compatible';
-import '@ant-design/compatible/assets/index.css';
-import { Modal, Radio, Row, Col, message, Tabs } from 'antd';
-import { connect } from 'dva';
-
-const { TabPane } = Tabs;
-
-// 选择比对清单
-function MergeModal(props) {
-  const { visible, versionList, onClose, onOk, dispatch, version, flowDetail } = props;
-
-  const [checkValue, setCheckValue] = useState([]);
-
-  const onChange = e => {
-    setCheckValue(e.target.value);
-  };
-
-  const handleOk = () => {
-    if (!checkValue) {
-      message.error('请选择要合并的清单');
-    } else {
-      let checkSheet = versionList.find(item => item.id == checkValue);
-      onOk(checkSheet);
-      onClose();
-      setCheckValue();
-    }
-  };
-  const items = useMemo(() => {
-    let list = {};
-    versionList.forEach(version => {
-      let nodeId = version.template_node_id;
-      if (!nodeId || nodeId === '0' || !version.version_no) return;
-      if (!list[nodeId]) {
-        list[nodeId] = [];
-      }
-      list[nodeId].push(version);
-    });
-    let nodeIds = Object.keys(list)
-    return nodeIds.filter(nodeId => {
-      let name = flowDetail.nodes.find(node => node.Id == nodeId)?.label
-      return name
-    }).map(nodeId => ({
-      label: flowDetail.nodes.find(node => node.Id == nodeId)?.label,
-      key: nodeId + "",
-      // list: list[nodeId],
-      children: list[nodeId].map(version => (
-        <div style={{ marginBottom: 16 }} key={version.id}>
-          <Radio value={version.id}>{version.version_name}_{version.version_no}</Radio>
-        </div>
-      ))
-    }))
-  }, [versionList, flowDetail]);
-
-  return (
-    <Modal
-      title="选择同步文件"
-      visible={visible}
-      onCancel={onClose}
-      onOk={handleOk}
-      width={600}
-      bodyStyle={{ paddingTop: 0 }}
-    >
-      <Radio.Group value={checkValue} style={{ width: '100%' }} onChange={onChange}>
-        {/* <Row gutter={16}>
-          {versionList.map(v => {
-            if (v.id == version.id) return null;
-            return (
-              <Col span={8} key={v.id}>
-                <Radio value={v.id}>{v.version_name}</Radio>
-              </Col>
-            );
-          })}
-        </Row> */}
-        <Tabs defaultActiveKey={items[0]?.key} items={items} />
-      </Radio.Group>
-    </Modal>
-  );
-}
-
-export default connect(({ detail, xflow }) => ({
-  versionList: detail.versionList,
-  flowDetail: xflow.flowDetail,
-}))(MergeModal);

+ 0 - 103
src/pages/PurchaseAdmin/PurchaseList/Detail/RightDrawer.js

@@ -1,103 +0,0 @@
-import React, { useEffect, useState, useRef } from 'react';
-import { UserOutlined } from '@ant-design/icons';
-import { Form } from '@ant-design/compatible';
-import '@ant-design/compatible/assets/index.css';
-import { Drawer, Descriptions, Card } from 'antd';
-import moment from 'moment';
-import { connect } from 'dva';
-import CommentContent from '@/components/CommentContent';
-
-// 评论
-function RightDrawer(props) {
-  const {
-    visible,
-    onClose,
-    comment,
-    bomComment,
-    addComment,
-    version,
-    loading,
-    dispatch,
-    userList,
-    cellPosition,
-  } = props;
-  // const [commentList, setCommentList] = useState([]);
-
-  const handleSubmitBom = (value, callback) => {
-    if (!value) return;
-    dispatch({
-      type: 'detail/addBomComment',
-      payload: {
-        excel_id: version.id,
-        comment: value,
-      },
-      callback,
-    });
-  };
-  const handleSubmitCell = (value, callback) => {
-    if (!value) return;
-    dispatch({
-      type: 'detail/addComment',
-      payload: {
-        ...cellPosition.current,
-        comment: value,
-      },
-      callback,
-    });
-  };
-
-  useEffect(() => {
-    if (!version.id || !visible) return;
-    dispatch({
-      type: 'detail/queryBomComment',
-      payload: { excel_id: version.id },
-    });
-  }, [version.id,visible]);
-
-  return (
-    <Drawer
-      width={600}
-      title="清单"
-      mask={false}
-      placement="right"
-      onClose={onClose}
-      visible={visible}
-    >
-      <BomContetn version={version} userList={userList} />
-      <CommentContent
-        title="清单沟通记录"
-        comment={bomComment}
-        onSubmit={handleSubmitBom}
-        loading={
-          loading.effects['detail/queryBomComment'] || loading.effects['detail/addBomComment']
-        }
-      />
-
-    </Drawer>
-  );
-}
-function BomContetn(props) {
-  const { version, userList } = props;
-  console.log(userList)
-  return (
-    <Card title="清单详情" type="inner">
-      <Descriptions column={2}>
-        <Descriptions.Item label="清单名称">{version.version_name}</Descriptions.Item>
-        <Descriptions.Item label="创建人">
-          {userList.find(item => item.ID == version.author)?.CName}
-        </Descriptions.Item>
-        <Descriptions.Item label="创建时间">
-          {moment(version.c_time).format('YYYY-MM-DD')}
-        </Descriptions.Item>
-        <Descriptions.Item label="概述">{version.desc}</Descriptions.Item>
-      </Descriptions>
-    </Card>
-  );
-}
-
-export default connect(({ detail, user, loading }) => ({
-  comment: detail.comment,
-  userList: user.list,
-  bomComment: detail.bomComment,
-  loading: loading,
-}))(RightDrawer);

+ 0 - 56
src/pages/PurchaseAdmin/PurchaseList/Detail/TimeNode.js

@@ -1,56 +0,0 @@
-import React, { useEffect, useState, useRef } from 'react';
-import { Form } from '@ant-design/compatible';
-import '@ant-design/compatible/assets/index.css';
-import { connect } from 'dva';
-import { Steps, Button } from 'antd';
-import styles from './Index.less';
-
-const { Step } = Steps;
-// 时间节点
-function TimeNode(props) {
-  const {
-    flow: { current, list, active },
-    isAuditor,
-    onApprove,
-  } = props;
-
-  if (!list || list.FlowNodes?.length != 0) {
-    return (
-      <div className={styles.top}>
-        <Steps current={current} status={active == 0 ? 'error' : 'process'}>
-          {list.FlowNodes.map(item => (
-            <Step
-              key={item.id}
-              title={item.node}
-              description={
-                item?.AuditRoleInfo
-                  ? `审批人:${item?.AuditRoleInfo.Name || '-'}`
-                  : `审批人:${item?.AuditorUser.CName || '-'}`
-              }
-            />
-          ))}
-        </Steps>
-        <div className={styles.btns} style={{ marginLeft: 80 }}>
-          {isAuditor && active != 0 && (
-            <>
-              <Button type="primary" onClick={() => onApprove(true)}>
-                审批通过
-              </Button>
-              <Button onClick={() => onApprove(false)} danger>
-                审批拒绝
-              </Button>
-            </>
-          )}
-        </div>
-      </div>
-    );
-  }
-  // else {
-  //   if (!flowDetail?.nodes) return;
-  //   const node = flowDetail.nodes.find(item => item.Id == nodeId);
-  //   return `当前节点:${node?.label || '-'}`;
-  // }
-  return null;
-}
-
-export default TimeNode;

+ 0 - 40
src/pages/PurchaseAdmin/PurchaseList/Detail/VersionModal.js

@@ -1,40 +0,0 @@
-import React, { useEffect } from 'react';
-import { Modal, Input, Form } from 'antd';
-
-// 新建流程
-function VersionModal(props) {
-  const { visible, onClose, onOk, userList = [], data = {}, loading } = props;
-  const [form] = Form.useForm();
-  const formLayout = { labelCol: { span: 4 }, wrapperCol: { span: 14 } };
-
-  const handleOk = async () => {
-    let fieldsValue = await form.validateFields();
-    fieldsValue.new_version = 0;
-    onOk(fieldsValue);
-  };
-
-  useEffect(() => {
-    if (visible) form.resetFields();
-  }, [visible]);
-  return (
-    <Modal
-      confirmLoading={loading}
-      destroyOnClose
-      title="新建清单"
-      visible={visible}
-      onCancel={onClose}
-      onOk={handleOk}
-    >
-      <Form {...formLayout} form={form}>
-        <Form.Item label="名称" name="version_name">
-          <Input />
-        </Form.Item>
-        <Form.Item label="详情" name="description">
-          <Input.TextArea />
-        </Form.Item>
-      </Form>
-    </Modal>
-  );
-}
-
-export default VersionModal;

+ 0 - 583
src/pages/PurchaseAdmin/PurchaseList/Detail/models/detail.js

@@ -1,583 +0,0 @@
-import {
-  queryFlowInfo,
-  // commitSheet,
-  querySheet,
-  queryHistory,
-  // queryHistoryDetail,
-  queryComment,
-  addComment,
-  createExcel,
-  queryExcel,
-  updateFlowInfo,
-  submitAudit,
-  // approve,
-  queryFiles,
-  deleteFiles,
-} from '@/services/PurchaseList';
-import {
-  queryAuditList,
-  queryVersionsList,
-  queryProjectRecord,
-  queryRecord,
-  commitSheet,
-  queryDetail,
-  queryHistoryList,
-  queryHistoryDetail,
-  submitNextNode,
-  advanceSubmitNextNode,
-  addBomComment,
-  queryBomComment,
-  approve,
-  queryAuthority,
-  queryVersionsTree,
-  queryAuditExcel,
-  queryAuditRecord,
-  queryDingSchema,
-  queryDingInstanceDetail,
-  queryListParentByUser,
-} from '@/services/boom';
-import { queryRole } from '@/services/SysAdmin';
-import { setCurrentUser } from '@/utils/authority';
-import { queryProjectMenu } from '@/services/SysAdmin';
-import { storeToken } from '@/utils/utils';
-import { routerRedux } from 'dva/router';
-import { message } from 'antd';
-
-export default {
-  namespace: 'detail',
-  state: {
-    template: {},
-    versionList: [],
-    historyList: [],
-    auditList: [],
-
-    flow: {
-      active: 0,
-      currentNode: {},
-      list: {
-        FlowNodes: [],
-      },
-    },
-    history: {
-      list: [],
-      pagination: false,
-    },
-    project: {
-      list: [],
-      pagination: false,
-    },
-    excel: {
-      list: [],
-      pagination: false,
-    },
-    comment: { list: [] },
-    bomComment: { list: [] },
-    fileList: [],
-    roleList: [],
-    authority: [],
-    versionTree: [],
-    auditExcel: [],
-    dingInstanceD: [],
-  },
-
-  effects: {
-    *queryAuthority({ payload, callback }, { call, put }) {
-      const response = yield call(queryAuthority, payload);
-      if (response) {
-        yield put({
-          type: 'save',
-          payload: { authority: response.data },
-        });
-      }
-    },
-    *queryProjectRecord({ payload, callback }, { call, put }) {
-      const response = yield call(queryProjectRecord, payload);
-      if (response) {
-        console.log(response);
-        const flow = response.data.list[0];
-        if (flow) {
-          let { template_id, template_node_id } = flow;
-          yield put({
-            type: 'save',
-            payload: { template: flow },
-          });
-          yield put({
-            type: 'queryVersionsList',
-            payload: {
-              ...payload,
-              // template_id,
-              // template_node_id,
-            },
-            callback,
-          });
-        }
-        // yield put({
-        //   type: 'save',
-        //   payload: { flow: flow },
-        // });
-      }
-    },
-    *queryVersionsList({ payload, callback }, { call, put }) {
-      const response = yield call(queryVersionsList, payload);
-      if (response) {
-        callback && callback(response.data);
-        yield put({
-          type: 'save',
-          payload: {
-            versionList: response.data,
-          },
-        });
-      }
-    },
-    *queryAuditList({ payload }, { call, put }) {
-      const response = yield call(queryAuditList, payload);
-      if (response) {
-        console.log(response);
-        yield put({
-          type: 'save',
-          payload: { auditList: response.data || [] },
-        });
-      }
-    },
-    // 查询子清单详情
-    *queryRecord({ payload, callback }, { call, put }) {
-      const response = yield call(queryRecord, payload);
-      if (response && response.data) {
-        let sheet = response.data;
-        sheet.data = JSON.parse(sheet.data || '[]');
-        sheet.data.forEach(item => {
-          item.config = JSON.parse(item.config || '{}');
-          item.celldata = JSON.parse(item.cell_data || '[]');
-          delete item.cell_data;
-        });
-        callback && callback(sheet);
-      } else {
-        yield put({
-          type: 'queryDetail',
-          payload: {
-            excel_id: payload.version_id,
-          },
-          callback,
-        });
-      }
-    },
-    *commitSheet({ payload, callback }, { call, put }) {
-      let response = yield call(commitSheet, payload);
-      if (response) {
-        message.success('提交成功');
-        yield put({
-          type: 'queryVersionsList',
-          payload: {
-            project_id: payload.project_id,
-            // template_id: payload.template_id,
-            // template_node_id: payload.template_node_id,
-          },
-          callback: versionList => {
-            let newVersion = versionList.find(item => item.id == response.data.id);
-            callback && callback(newVersion);
-          },
-        });
-      }
-    },
-    *saveSheet({ payload }, { call }) {
-      yield call(commitSheet, payload);
-    },
-    *queryBomComment({ payload }, { call, put }) {
-      const response = yield call(queryBomComment, payload);
-      if (response) {
-        yield put({
-          type: 'save',
-          payload: { bomComment: response.data },
-        });
-      }
-    },
-    *addBomComment({ payload, callback }, { call, put }) {
-      try {
-        const response = yield call(addBomComment, payload);
-        if (response) {
-          yield put({
-            type: 'queryBomComment',
-            payload: {
-              excel_id: payload.excel_id,
-            },
-          });
-          message.success('评论成功');
-          callback && callback();
-        }
-      } catch (error) {
-        console.log(error);
-      }
-    },
-    // 提交流转
-    *submitNextNode({ payload, callback }, { call, put }) {
-      let response = yield call(submitNextNode, payload);
-      if (response) {
-        message.success('提交成功');
-        yield put({
-          type: 'queryVersionsList',
-          payload: {
-            project_id: payload.project_id,
-          },
-          callback: () => {
-            callback(response.data);
-          },
-        });
-      }
-    },
-    // 实时计算审批人
-    *advanceSubmitNextNode({ payload, callback }, { call, put }) {
-      let response = yield call(advanceSubmitNextNode, payload);
-      if (response) {
-        console.log(response);
-        callback?.(response.data);
-
-        // message.success('提交成功');
-        // yield put({
-        //   type: 'queryVersionsList',
-        //   payload: {
-        //     project_id: payload.project_id,
-        //   },
-        //   callback: () => {
-        //     callback(response.data);
-        //   },
-        // });
-      }
-    },
-    *queryDetail({ payload, callback }, { call, put }) {
-      const sheet = yield call(queryDetail, payload);
-      if (sheet) {
-        callback?.(sheet);
-      }
-    },
-    *queryHistoryList({ payload, callback }, { call, put, select }) {
-      const response = yield call(queryHistoryList, {
-        ...payload,
-        pageSize: 9999,
-      });
-      if (response) {
-        console.log(response);
-        yield put({
-          type: 'saveHistory',
-          payload: {
-            [payload.version_id]: response.data.list,
-          },
-        });
-      }
-    },
-    // 审批
-    *approve({ payload, callback }, { call, put }) {
-      try {
-        const response = yield call(approve, payload);
-        if (response) {
-          message.success('操作成功');
-
-          yield put({
-            type: 'queryVersionsList',
-            payload: {
-              project_id: payload.project_id,
-            },
-            callback: () => {
-              callback(response.data);
-            },
-          });
-        }
-      } catch (error) {
-        console.error(error);
-      }
-    },
-
-    // =================================================================================================================================
-    *queryFlowInfo({ payload, callback }, { call, put }) {
-      const response = yield call(queryFlowInfo, payload);
-      if (response) {
-        var flow = response.data[0];
-        flow.current = flow.list.FlowNodes.findIndex(item => item.id == flow.active);
-        flow.currentNode = flow.list.FlowNodes[flow.current];
-        yield put({
-          type: 'save',
-          payload: { flow: flow },
-        });
-        // 查询当前节点的最新sheet信息
-        yield put({
-          type: 'querySheet',
-          payload: {
-            project_id: payload.projectId,
-            flow_id: flow.currentNode.flow_id,
-            node_id: flow.currentNode.id,
-          },
-          callback: sheets => {
-            callback && callback(flow, sheets);
-          },
-        });
-      }
-    },
-    *queryFlowInfoList({ payload, callback }, { call, put }) {
-      const response = yield call(queryFlowInfo, payload);
-      if (response) {
-        var flow = response.data[0];
-        flow.current = flow.list.FlowNodes.findIndex(item => item.id == flow.active);
-        flow.currentNode = flow.list.FlowNodes[flow.current];
-        yield put({
-          type: 'save',
-          payload: { flow: flow },
-        });
-        callback && callback();
-      }
-    },
-    *updateFlowInfo({ payload }, { call, put }) {
-      const response = yield call(updateFlowInfo, payload);
-      if (response) {
-        message.success('修改成功');
-        yield put({
-          type: 'queryFlowInfoList',
-          payload: {
-            projectId: payload.projectId,
-          },
-        });
-      }
-    },
-    // *queryHistory({ payload, callback }, { call, put }) {
-    //   payload.pageSize = '9999';
-    //   const response = yield call(queryHistory, payload);
-    //   if (response) {
-    //     yield put({
-    //       type: 'save',
-    //       payload: { history: response.data },
-    //     });
-    //     callback(response.data);
-    //   }
-    // },
-    *submitAudit({ payload, callback }, { call, put }) {
-      const response = yield call(submitAudit, payload);
-      if (response) {
-        message.success('提交审核成功');
-        yield put({
-          type: 'queryHistory',
-          payload: {
-            projectId: payload.projectId,
-            excel_id: payload.id,
-          },
-        });
-        yield put({
-          type: 'queryFlowInfo',
-          payload: {
-            projectId: payload.projectId,
-          },
-        });
-      }
-    },
-    // *approve({ payload, callback }, { call, put }) {
-    //   try {
-    //     const response = yield call(approve, payload);
-    //     if (response) {
-    //       message.success('操作成功');
-    //       yield put({
-    //         type: 'queryHistory',
-    //         payload: {
-    //           projectId: payload.projectId,
-    //           excel_id: payload.id,
-    //         },
-    //       });
-    //       yield put({
-    //         type: 'queryFlowInfo',
-    //         payload: {
-    //           projectId: payload.project_id,
-    //         },
-    //         callback,
-    //       });
-    //     }
-    //   } catch (error) {
-    //     console.error(error);
-    //   }
-    // },
-
-    *queryHistoryDetail({ payload, callback }, { call, put }) {
-      const response = yield call(queryHistoryDetail, payload);
-      if (response) {
-        let sheets = response.data;
-        sheets.forEach(item => {
-          item.config = JSON.parse(item.config) || {};
-          item.celldata = JSON.parse(item.cell_data) || [];
-          delete item.cell_data;
-        });
-        callback && callback(sheets);
-      }
-    },
-    *queryComment({ payload }, { call, put }) {
-      const response = yield call(queryComment, payload);
-      if (response) {
-        yield put({
-          type: 'save',
-          payload: { comment: response.data },
-        });
-      }
-    },
-    *addComment({ payload, callback }, { call, put }) {
-      const response = yield call(addComment, payload);
-      if (response) {
-        yield put({
-          type: 'queryComment',
-          payload,
-        });
-        message.success('评论成功');
-        callback && callback();
-      }
-    },
-    *createExcel({ payload, callback }, { call, put }) {
-      const response = yield call(createExcel, payload);
-      if (response) {
-        yield put({
-          type: 'queryExcel',
-        });
-        message.success('创建成功');
-        callback && callback();
-      }
-    },
-    *queryExcel({ payload }, { call, put }) {
-      const response = yield call(queryExcel, payload);
-      if (response) {
-        yield put({
-          type: 'save',
-          payload: { excel: response.data },
-        });
-      }
-    },
-    // *commitSheet({ payload, callback }, { call, put }) {
-    //   const response = yield call(commitSheet, payload);
-    //   if (response) {
-    //     const res = yield call(queryHistory, {
-    //       excel_id: payload.id,
-    //       project_id: payload.project_id,
-    //     });
-    //     yield put({
-    //       type: 'save',
-    //       payload: { history: res.data },
-    //     });
-    //     const lastCommit = res.data.list[0];
-    //     message.success('提交成功');
-    //     yield put({
-    //       type: 'queryHistoryDetail',
-    //       payload: {
-    //         excel_id: lastCommit.excel_id,
-    //         history_id: lastCommit.id,
-    //       },
-    //       callback: sheets => {
-    //         lastCommit.data = sheets;
-    //         lastCommit.name = lastCommit.version_name;
-    //         callback(lastCommit);
-    //       },
-    //     });
-    //   }
-    // },
-    *querySheet({ payload, callback }, { call, put }) {
-      const response = yield call(querySheet, payload);
-      if (response) {
-        let sheet = response.data;
-        sheet.data = JSON.parse(sheet.data || '[]');
-        sheet.data.forEach(item => {
-          item.config = JSON.parse(item.config || '{}');
-          item.celldata = JSON.parse(item.cell_data || '[]');
-          delete item.cell_data;
-        });
-        callback && callback(sheet);
-      }
-    },
-    *queryFiles({ payload }, { call, put }) {
-      const response = yield call(queryFiles, payload);
-      if (response) {
-        yield put({
-          type: 'save',
-          payload: { fileList: response.data.list },
-        });
-      }
-    },
-    *deleteFiles({ id, callback }, { call }) {
-      const response = yield call(deleteFiles, id);
-      if (response) {
-        callback && callback();
-      }
-    },
-    *getPermission({ payload }, { call, put }) {
-      const response = yield call(queryProjectMenu, payload);
-      if (response) {
-        console.log(response.data);
-        // yield put({
-        //   type: 'save',
-        //   payload: { fileList: response.data.list },
-        // });
-      }
-    },
-    *getRoleList({ payload }, { call, put }) {
-      const response = yield call(queryRole, payload);
-      if (response) {
-        yield put({
-          type: 'save',
-          payload: { roleList: response.data.list },
-        });
-      }
-    },
-    *queryVersionsTree({ payload }, { call, put }) {
-      const response = yield call(queryVersionsTree, payload);
-      if (response) {
-        yield put({
-          type: 'save',
-          payload: { versionTree: response.data },
-        });
-      }
-    },
-    *queryAuditExcel({ payload, callback }, { call, put }) {
-      const response = yield call(queryAuditExcel, payload);
-      if (response) {
-        callback && callback(response.data?.all);
-      }
-    },
-    *queryAuditRecord({ payload, callback }, { call, put }) {
-      const response = yield call(queryAuditRecord, payload);
-      if (response) {
-        callback && callback(response.data?.all);
-      }
-    },
-    *queryDingSchema({ payload, callback }, { call, put }) {
-      const response = yield call(queryDingSchema, payload);
-      if (response) {
-        callback && callback(response.data?.all);
-      }
-    },
-    *queryDingInstanceDetail({ payload, callback }, { call, put }) {
-      const response = yield call(queryDingInstanceDetail, payload);
-      if (response) {
-        yield put({
-          type: 'save',
-          payload: { dingInstanceDetail: response.data?.process_instance },
-        });
-      }
-    },
-    *queryListParentByUser({ payload, callback }, { call, put }) {
-      const response = yield call(queryListParentByUser, payload);
-      if (response) {
-        yield put({
-          type: 'save',
-          payload: { parentDepList: response.data?.result },
-        });
-      }
-    },
-  },
-
-  reducers: {
-    saveHistory(state, action) {
-      return {
-        ...state,
-        historyList: {
-          ...state.historyList,
-          ...action.payload,
-        },
-      };
-    },
-    save(state, action) {
-      return {
-        ...state,
-        ...action.payload,
-      };
-    },
-  },
-};

+ 0 - 128
src/pages/PurchaseAdmin/PurchaseList/Flow/Audit.js

@@ -1,128 +0,0 @@
-import React, { useState, useEffect, useRef, useMemo } from 'react';
-import { Form, Select, Button, Table, Input, Checkbox, Divider, Tabs } from 'antd';
-import { connect } from 'dva';
-import AuditNodeModal from './AuditNodeModal';
-import AuditModal from './AuditModal';
-import styles from './Audit.less';
-import router from 'umi/router';
-import Flow, { FLOW_TYPE } from '@/components/Flow';
-import AuditForm from '@/components/AuditForm';
-import { async } from '@antv/x6/lib/registry/marker/async';
-const { Option } = Select;
-const { TabPane } = Tabs;
-
-const FLOWID = 2;
-
-function Audit(props) {
-  const {
-    roleList,
-    currentItem,
-    dispatch,
-    formItems,
-    formData,
-    flowDetail,
-    simpleFlowDteail,
-    currentUser
-  } = props;
-  const ref = useRef();
-  const permission = currentUser.Permission
-
-  const curItem = useMemo(() => {
-    let item = localStorage.getItem('currentAudit');
-    return JSON.stringify(currentItem) == '{}' ? JSON.parse(item) : currentItem;
-  }, [currentItem, localStorage.getItem('currentAudit')]);
-
-  const editMode = useMemo(() => {
-    // 判断是否有权限
-    if(permission['func-01-point-bom-flow']) {
-      return 1
-    }
-    // 判断是否为创建者
-    if(flowDetail.Creator == currentUser.ID) {
-      return 1
-    }
-
-    return 2
-  },[permission,flowDetail])
-
-  useEffect(() => {
-    dispatch({
-      type: 'flow/queryProcessFlows',
-      payload: { ids: Number(curItem.id) },
-    });
-    dispatch({
-      type: 'user/getRoleList',
-    });
-    dispatch({
-      type: 'user/fetch',
-    });
-
-    dispatch({
-      type: 'user/fetchDepV2',
-    });
-  }, []);
-  
-  const onChange = values => {
-    dispatch({
-      type: 'xflow/save',
-      payload: {
-        formData: values,
-      },
-    });
-  };
-
-  const handleSaveClick = async () => {
-    //只修改表单不渲染xflow getGraphData方法找不到,保存接口返回的flowDetail数据
-    if (!ref.current?.getGraphData) {
-      let param = {
-        // name: curItem.name,
-        id: Number(curItem.id),
-        form_json: JSON.stringify(formItems),
-        process_json: JSON.stringify(flowDetail),
-        process_simple_json: simpleFlowDteail,
-      };
-      dispatch({ type: 'flow/saveAuditFlowInfo', payload: param });
-      return;
-    }
-    await ref.current?.getGraphData?.((data, simpleNodes) => {
-      let param = {
-        // name: curItem.name,
-        id: Number(curItem.id),
-        form_json: JSON.stringify(formItems),
-        process_json: data,
-        process_simple_json: simpleNodes,
-      };
-      dispatch({ type: 'flow/saveAuditFlowInfo', payload: param });
-    });
-  };
-  return (
-    <div style={{ position: 'relative' }}>
-      <p>{curItem.name}</p>
-      <Tabs defaultActiveKey="1">
-        <TabPane tab="表单设计" key="1">
-          <AuditForm value={formData} onChange={values => onChange(values)} />
-        </TabPane>
-        <TabPane tab="流程控制" key="2">
-          <Flow meta={{ type: 'edit', editMode, flowId: curItem.id }} flowDetail={flowDetail} ref={ref} />
-        </TabPane>
-      </Tabs>
-      <Button
-        type="primary"
-        onClick={handleSaveClick}
-        style={{ position: 'absolute', right: 0, top: 0 }}
-      >
-        保存
-      </Button>
-    </div>
-  );
-}
-export default connect(({ flow, loading, user, xflow }) => ({
-  roleList: flow.roleList,
-  currentItem: flow.current,
-  loading: loading.models.purchaseList2,
-  formItems: xflow.formData,
-  flowDetail: flow.flowDetail,
-  formData: flow.formData,
-  currentUser: user.currentUser,
-  simpleFlowDteail: flow.simpleFlowDteail,
-}))(Audit);

+ 0 - 16
src/pages/PurchaseAdmin/PurchaseList/Flow/Audit.less

@@ -1,16 +0,0 @@
-.box {
-  margin-bottom: 20px;
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-}
-.btns {
-  display: flex;
-  align-items: center;
-  margin-bottom: 20px;
-  :global {
-    .ant-btn {
-      margin-right: 20px;
-    }
-  }
-}

+ 0 - 97
src/pages/PurchaseAdmin/PurchaseList/Flow/AuditList.js

@@ -1,97 +0,0 @@
-import React, { useState, useEffect } from 'react';
-import { Form, Select, Button, Table, Input, Checkbox, Divider } from 'antd';
-import { connect } from 'dva';
-import AuditNodeModal from './AuditNodeModal';
-import AuditModal from './AuditModal';
-import styles from './Audit.less';
-import router from 'umi/router';
-
-const { Option } = Select;
-
-function Audit(props) {
-  const { userList, list = [], dispatch } = props;
-  const [form] = Form.useForm();
-  const [visible, setVisible] = useState({
-    audit: false,
-    auditNode: false,
-  });
-  const columns = [
-    {
-      title: '审批流名称',
-      dataIndex: ['list', 'name'],
-    },
-    {
-      title: '操作',
-      render: (item, index) => (
-        <>
-          <a
-            onClick={() => {
-              setCurrentNode(item);
-            }}
-          >
-            编辑
-          </a>
-        </>
-      ),
-    },
-  ];
-  const handleAuditOk = values => {
-    console.log(values);
-    dispatch({
-      type: 'flow/addAudit',
-      payload: values,
-      callback: () => {
-        changeVisible('audit', false);
-      },
-    });
-  };
-  const changeVisible = (type, visible) => {
-    setVisible({
-      ...visible,
-      [type]: visible,
-    });
-  };
-  const setCurrentNode = item => {
-    if (item?.list) localStorage.setItem('currentAudit', JSON.stringify(item.list));
-    dispatch({
-      type: 'flow/save',
-      payload: {
-        current: item.list,
-      },
-    });
-    router.push('/bom/audit');
-  };
-
-  useEffect(() => {
-    dispatch({
-      type: 'flow/queryAuditList',
-    });
-  }, []);
-
-  return (
-    <div>
-      <div className={styles.box}>
-        <Button onClick={() => router.go(-1)}>返回</Button>
-        <Form layout="inline" name="basic" autoComplete="off" form={form}>
-          <Form.Item>
-            <Button onClick={() => changeVisible('audit', true)} type="primary">
-              新建流程
-            </Button>
-          </Form.Item>
-        </Form>
-      </div>
-
-      <Table rowKey="id" dataSource={list} columns={columns} />
-      <AuditModal
-        visible={visible.audit}
-        onOk={handleAuditOk}
-        onCancel={() => changeVisible('audit', false)}
-      />
-    </div>
-  );
-}
-export default connect(({ user, flow, loading }) => ({
-  userList: user.list,
-  list: flow.auditList,
-  loading: loading.models.purchaseList2,
-}))(Audit);

+ 0 - 40
src/pages/PurchaseAdmin/PurchaseList/Flow/AuditModal.js

@@ -1,40 +0,0 @@
-import React, { useEffect } from 'react';
-import { Modal, Input, Table, Select, Form, Radio } from 'antd';
-const { Option } = Select;
-
-// 审批意见
-function AuditModal(props) {
-  const { visible, onCancel, onOk, userList = [], data = {}, loading } = props;
-  const [form] = Form.useForm();
-  const formLayout = { labelCol: { span: 4 }, wrapperCol: { span: 14 } };
-
-  const handleOk = async () => {
-    let fieldsValue = await form.validateFields();
-    onOk(fieldsValue);
-  };
-
-  useEffect(() => {
-    if (visible) form.resetFields();
-  }, [visible]);
-  return (
-    <Modal
-      confirmLoading={loading}
-      destroyOnClose
-      title="流程"
-      visible={visible}
-      onCancel={onCancel}
-      onOk={handleOk}
-    >
-      <Form {...formLayout} form={form}>
-        <Form.Item label="流程名称" name="name">
-          <Input />
-        </Form.Item>
-        <Form.Item label="详情" name="desc">
-          <Input.TextArea />
-        </Form.Item>
-      </Form>
-    </Modal>
-  );
-}
-
-export default AuditModal;

+ 0 - 62
src/pages/PurchaseAdmin/PurchaseList/Flow/AuditNodeModal.js

@@ -1,62 +0,0 @@
-import React, { useEffect } from 'react';
-import { InputNumber, Modal, Input, Table, Select, Form, Radio } from 'antd';
-const { Option } = Select;
-
-// 审批意见
-function AuditModal(props) {
-  const { visible, onCancel, onOk, roleList = [], data = {}, loading } = props;
-  const [form] = Form.useForm();
-  const formLayout = { labelCol: { span: 4 }, wrapperCol: { span: 14 } };
-
-  const handleOk = async () => {
-    let fieldsValue = await form.validateFields();
-    // 如果id不存在则使用时间戳作为id
-    fieldsValue.id = data?.id || new Date() * 1;
-    onOk(fieldsValue);
-  };
-
-  useEffect(() => {
-    if (visible) form.resetFields();
-  }, [visible]);
-
-  return (
-    <Modal
-      confirmLoading={loading}
-      title="审批节点"
-      visible={visible}
-      onCancel={onCancel}
-      onOk={handleOk}
-    >
-      <Form {...formLayout} form={form} initialValues={data}>
-        <Form.Item label="节点名" name="node">
-          <Input />
-        </Form.Item>
-        {/* <Form.Item label="审批级别" name="seq">
-          <InputNumber style={{ width: '100%' }} step={1} min={1} />
-        </Form.Item> */}
-        <Form.Item label="审批角色" name="audit_role">
-          <Select
-            showSearch
-            style={{ width: '100%' }}
-            filterOption={(input, option) => option.props.children.indexOf(input) >= 0}
-          >
-            {roleList &&
-              roleList.filter(item => item.RoleType == 4).map(item => (
-                <Option key={item.ID} value={item.ID + ''}>
-                  {item.Name}
-                </Option>
-              ))}
-          </Select>
-        </Form.Item>
-        {/* <Form.Item initialValue={data?.seq_relate || 1} label="审批关系" name="seq_relate">
-          <Radio.Group>
-            <Radio value={1}>或</Radio>
-            <Radio value={2}>并</Radio>
-          </Radio.Group>
-        </Form.Item> */}
-      </Form>
-    </Modal>
-  );
-}
-
-export default AuditModal;

+ 0 - 100
src/pages/PurchaseAdmin/PurchaseList/Flow/Flow.js

@@ -1,100 +0,0 @@
-import Flow, { FLOW_TYPE } from '@/components/Flow';
-import { connect } from 'dva';
-import React, { useEffect } from 'react';
-import { UnityAction } from '@/utils/utils';
-import { Button } from 'antd';
-import router from 'umi/router';
-
-@connect(({ xflow, user }) => ({
-  flowDetail: xflow.flowDetail,
-  currentUser: user.currentUser,
-  permission: user.currentUser.Permission,
-}))
-class FlowPage extends React.PureComponent {
-  onUpdate(node) {
-    const { dispatch, flowDetail } = this.props;
-    let params = {
-      ...node,
-      id: node.Id,
-      node_type: node.name == 'custom-circle' ? 1 : 0,
-
-      data: JSON.stringify(node.data),
-      project_id: flowDetail.ProjectId,
-      template_id: flowDetail.Id,
-      template_name: flowDetail.Name,
-    };
-    delete params.node_id;
-    dispatch({
-      type: 'flow/updateNode',
-      payload: {
-        templateId: flowDetail.Id,
-        nodeId: node.Id,
-        body: params,
-      },
-    });
-  }
-
-  componentDidMount() {
-    const {
-      dispatch,
-      match: {
-        params: { flowId },
-      },
-    } = this.props;
-    dispatch({
-      type: 'xflow/queryOSSData',
-    });
-    dispatch({
-      type: 'xflow/queryBoomFlowDetail',
-      payload: {
-        id: flowId,
-      },
-    });
-    dispatch({
-      type: 'xflow/queryAuditList',
-    });
-    dispatch({
-      type: 'xflow/fetchDepV2',
-    });
-
-    UnityAction.on('NODE_SAVE', nodeConfig => {
-      this.onUpdate(nodeConfig);
-    });
-  }
-  componentWillUnmount() {
-    UnityAction.off('NODE_SAVE');
-  }
-  getEditMode() {
-    const { flowDetail, permission } = this.props;
-
-    return 2
-  }
-  render() {
-    const { flowDetail, permission, currentUser } = this.props;
-    let editMode = 2;
-
-    if (
-      // 判断是否有权限
-      permission['func-01-point-bom-flow'] ||
-      // 判断是否为创建者
-      flowDetail.Creator == currentUser.ID) {
-      editMode = 1
-    }
-
-    return (
-      <div>
-        {/* <Form></Form> */}
-        <Button style={{ marginBottom: 20 }} onClick={() => router.go(-1)}>
-          返回
-        </Button>
-        <Flow
-          meta={{ type: 'edit', editMode, flowId: 1 }}
-          flowDetail={flowDetail}
-        // onUpdate={node => this.onUpdate(node)}
-        />
-      </div>
-    );
-  }
-}
-
-export default FlowPage;

+ 0 - 635
src/pages/PurchaseAdmin/PurchaseList/Flow/FlowDetail.json

@@ -1,635 +0,0 @@
-{
-  "start_node": "41561012",
-  "nodes": [
-    {
-      "id": "41561012",
-      "renderKey": "custom-rect",
-      "name": "custom-rect",
-      "label": "BOM-1",
-      "width": 120,
-      "height": 50,
-      "ports": {
-        "items": [
-          { "group": "top", "id": "293a90b5" },
-          { "group": "right", "id": "92334433" },
-          { "group": "bottom", "id": "c2ab5849" },
-          { "group": "left", "id": "6079a903" }
-        ]
-      },
-      "isCustom": true,
-      "parentKey": "1",
-      "x": -580,
-      "y": -150,
-      "zIndex": 10,
-      "flow_id": 0,
-      "node_type": 0,
-      "count": 0,
-      "role_list": "139"
-    },
-    {
-      "id": "975bf288",
-      "renderKey": "custom-circle",
-      "name": "custom-circle",
-      "label": "方案总审",
-      "width": 90,
-      "height": 90,
-      "ports": {
-        "items": [
-          { "group": "top", "id": "a61170c3" },
-          { "group": "right", "id": "821f59c0" },
-          { "group": "bottom", "id": "17360bc4" },
-          { "group": "left", "id": "15d1b217" }
-        ]
-      },
-      "isCustom": true,
-      "parentKey": "1",
-      "x": -290,
-      "y": -170,
-      "zIndex": 10,
-      "flow_id": 5,
-      "node_type": 1,
-      "count": 0,
-      "role_list": ""
-    },
-    {
-      "id": "5764f3ce",
-      "renderKey": "custom-rect",
-      "name": "custom-rect",
-      "label": "投标清单",
-      "width": 120,
-      "height": 50,
-      "ports": {
-        "items": [
-          { "group": "top", "id": "4b4d9fa6" },
-          { "group": "right", "id": "ce88d7e2" },
-          { "group": "bottom", "id": "e69d8709" },
-          { "group": "left", "id": "c29d7b43" }
-        ]
-      },
-      "isCustom": true,
-      "parentKey": "1",
-      "x": -138,
-      "y": -150,
-      "zIndex": 10,
-      "flow_id": 0,
-      "node_type": 0,
-      "count": 0,
-      "role_list": "139"
-    },
-    {
-      "id": "5359e23c",
-      "renderKey": "custom-circle",
-      "name": "custom-circle",
-      "label": "三级审批2",
-      "width": 90,
-      "height": 90,
-      "ports": {
-        "items": [
-          { "group": "top", "id": "331cd291" },
-          { "group": "right", "id": "ff6724ee" },
-          { "group": "bottom", "id": "16b4df46" },
-          { "group": "left", "id": "34c9dbc6" }
-        ]
-      },
-      "isCustom": true,
-      "parentKey": "1",
-      "x": -369,
-      "y": 6,
-      "zIndex": 10,
-      "flow_id": 9,
-      "node_type": 1,
-      "count": 0,
-      "role_list": ""
-    },
-    {
-      "id": "c28a18d3",
-      "renderKey": "custom-rect",
-      "name": "custom-rect",
-      "label": "采购执行",
-      "width": 120,
-      "height": 50,
-      "ports": {
-        "items": [
-          { "group": "top", "id": "f71ce55b" },
-          { "group": "right", "id": "e67dc19c" },
-          { "group": "bottom", "id": "a06aba2c" },
-          { "group": "left", "id": "b578cc26" }
-        ]
-      },
-      "isCustom": true,
-      "parentKey": "1",
-      "x": -162,
-      "y": 26,
-      "zIndex": 10,
-      "flow_id": 0,
-      "node_type": 0,
-      "count": 0,
-      "role_list": "147"
-    },
-    {
-      "id": "5216c5dc",
-      "renderKey": "custom-rect",
-      "name": "custom-rect",
-      "label": "采购合同",
-      "width": 120,
-      "height": 50,
-      "ports": {
-        "items": [
-          { "group": "top", "id": "0fc44196" },
-          { "group": "right", "id": "d2030f1b" },
-          { "group": "bottom", "id": "188c9b68" },
-          { "group": "left", "id": "4e9ce7ad" }
-        ]
-      },
-      "isCustom": true,
-      "parentKey": "1",
-      "x": -580,
-      "y": 26,
-      "zIndex": 10,
-      "flow_id": 0,
-      "node_type": 0,
-      "count": 0,
-      "role_list": "147"
-    },
-    {
-      "id": "8c1f18d0",
-      "renderKey": "custom-rect",
-      "name": "custom-rect",
-      "label": "预算",
-      "width": 120,
-      "height": 50,
-      "ports": {
-        "items": [
-          { "group": "top", "id": "b58731c5" },
-          { "group": "right", "id": "b3dfbc16" },
-          { "group": "bottom", "id": "89c0bc16" },
-          { "group": "left", "id": "a3adcac9" }
-        ]
-      },
-      "isCustom": true,
-      "parentKey": "1",
-      "x": -305,
-      "y": -304,
-      "zIndex": 10,
-      "flow_id": 0,
-      "node_type": 0,
-      "count": 0,
-      "role_list": "148"
-    },
-    {
-      "id": "1aed14d1",
-      "renderKey": "custom-rect",
-      "name": "custom-rect",
-      "label": "初版PSR",
-      "width": 120,
-      "height": 50,
-      "ports": {
-        "items": [
-          { "group": "top", "id": "7f8dc65b" },
-          { "group": "right", "id": "9a699e3f" },
-          { "group": "bottom", "id": "d348b56a" },
-          { "group": "left", "id": "47317157" }
-        ]
-      },
-      "isCustom": true,
-      "parentKey": "1",
-      "x": -138,
-      "y": -304,
-      "zIndex": 10,
-      "flow_id": 0,
-      "node_type": 0,
-      "count": 0,
-      "role_list": ""
-    },
-    {
-      "id": "4651130e",
-      "renderKey": "custom-circle",
-      "name": "custom-circle",
-      "label": "PSR审批",
-      "width": 90,
-      "height": 90,
-      "ports": {
-        "items": [
-          { "group": "top", "id": "cf1c4df0" },
-          { "group": "right", "id": "1eb352b0" },
-          { "group": "bottom", "id": "83b59198" },
-          { "group": "left", "id": "94f485b5" }
-        ]
-      },
-      "isCustom": true,
-      "parentKey": "1",
-      "x": 356,
-      "y": -324,
-      "zIndex": 10,
-      "flow_id": 2,
-      "node_type": 1,
-      "count": 0,
-      "role_list": ""
-    },
-    {
-      "id": "a48131e0",
-      "renderKey": "custom-rect",
-      "name": "custom-rect",
-      "label": "合同清单",
-      "width": 120,
-      "height": 50,
-      "ports": {
-        "items": [
-          { "group": "top", "id": "3ca1320c" },
-          { "group": "right", "id": "4dee75d9" },
-          { "group": "bottom", "id": "0f72f2ba" },
-          { "group": "left", "id": "bac7962b" }
-        ]
-      },
-      "isCustom": true,
-      "parentKey": "1",
-      "x": 446,
-      "y": -150,
-      "zIndex": 10,
-      "flow_id": 0,
-      "node_type": 0,
-      "count": 0,
-      "role_list": "139"
-    },
-    {
-      "id": "b57b57c8",
-      "renderKey": "custom-rect",
-      "name": "custom-rect",
-      "label": "终版PSR",
-      "width": 120,
-      "height": 50,
-      "ports": {
-        "items": [
-          { "group": "top", "id": "04c81e99" },
-          { "group": "right", "id": "0d594eef" },
-          { "group": "bottom", "id": "17ff5fe6" },
-          { "group": "left", "id": "73307680" }
-        ]
-      },
-      "isCustom": true,
-      "parentKey": "1",
-      "x": 621,
-      "y": -150,
-      "zIndex": 10,
-      "flow_id": 0,
-      "node_type": 0,
-      "count": 0,
-      "role_list": ""
-    },
-    {
-      "id": "3631eae9",
-      "renderKey": "custom-rect",
-      "name": "custom-rect",
-      "label": "采购清单",
-      "width": 120,
-      "height": 50,
-      "ports": {
-        "items": [
-          { "group": "top", "id": "2aae2a71" },
-          { "group": "right", "id": "e3a42bda" },
-          { "group": "bottom", "id": "0f06668a" },
-          { "group": "left", "id": "8e0bff55" }
-        ]
-      },
-      "isCustom": true,
-      "parentKey": "1",
-      "x": 446,
-      "y": 26,
-      "zIndex": 10,
-      "flow_id": 0,
-      "node_type": 0,
-      "count": 0,
-      "role_list": "139"
-    },
-    {
-      "id": "3fb8d302",
-      "renderKey": "custom-circle",
-      "name": "custom-circle",
-      "label": "事业部",
-      "width": 90,
-      "height": 90,
-      "ports": {
-        "items": [
-          { "group": "top", "id": "8ab6c3f6" },
-          { "group": "right", "id": "205f1437" },
-          { "group": "bottom", "id": "761ad2b5" },
-          { "group": "left", "id": "22d16375" }
-        ]
-      },
-      "isCustom": true,
-      "parentKey": "1",
-      "x": 308,
-      "y": -170,
-      "zIndex": 10,
-      "flow_id": 7,
-      "node_type": 1,
-      "count": 0,
-      "role_list": ""
-    },
-    {
-      "id": "399bddb7",
-      "renderKey": "custom-circle",
-      "name": "custom-circle",
-      "label": "三级审批1",
-      "width": 90,
-      "height": 90,
-      "ports": {
-        "items": [
-          { "group": "top", "id": "99f69f24" },
-          { "group": "right", "id": "0bccd839" },
-          { "group": "bottom", "id": "42c0d925" },
-          { "group": "left", "id": "58f52f2c" }
-        ]
-      },
-      "isCustom": true,
-      "parentKey": "1",
-      "x": 42,
-      "y": 6,
-      "zIndex": 10,
-      "flow_id": 8,
-      "node_type": 1,
-      "count": 0,
-      "role_list": ""
-    },
-    {
-      "id": "2427bf29",
-      "renderKey": "custom-circle",
-      "name": "custom-circle",
-      "label": "工艺分部经理",
-      "width": 90,
-      "height": 90,
-      "ports": {
-        "items": [
-          { "group": "top", "id": "e5a149c4" },
-          { "group": "right", "id": "e1a1ecea" },
-          { "group": "bottom", "id": "6e131e6a" },
-          { "group": "left", "id": "6bbf9ae4" }
-        ]
-      },
-      "isCustom": true,
-      "parentKey": "1",
-      "x": -425,
-      "y": -224,
-      "zIndex": 10,
-      "flow_id": 3,
-      "node_type": 1,
-      "count": 0,
-      "role_list": ""
-    },
-    {
-      "id": "be25fe75",
-      "renderKey": "custom-circle",
-      "name": "custom-circle",
-      "label": "电气分部经理",
-      "width": 90,
-      "height": 90,
-      "ports": {
-        "items": [
-          { "group": "top", "id": "13e4b9ea" },
-          { "group": "right", "id": "ce651308" },
-          { "group": "bottom", "id": "9a0b8942" },
-          { "group": "left", "id": "a705e7ed" }
-        ]
-      },
-      "isCustom": true,
-      "parentKey": "1",
-      "x": -425,
-      "y": -115,
-      "zIndex": 10,
-      "flow_id": 4,
-      "node_type": 1,
-      "count": 0,
-      "role_list": ""
-    },
-    {
-      "id": "node-186a9d31-0bd3-4b36-b61f-6b5380c824db",
-      "renderKey": "custom-circle",
-      "name": "custom-circle",
-      "label": "工艺分部经理",
-      "width": 90,
-      "height": 90,
-      "ports": {
-        "items": [
-          { "group": "top", "id": "c6ec15a8-2db4-4ca8-ad81-fd1783b4ca0f" },
-          { "group": "right", "id": "e134d65d-a197-4116-ad74-f47dbbb727d1" },
-          { "group": "bottom", "id": "2c633cdf-7bb5-49ea-a4dc-e3d8c837e513" },
-          { "group": "left", "id": "6d880b9d-7d7e-4357-94dd-caf7d73b5f80" }
-        ]
-      },
-      "isCustom": true,
-      "parentKey": "1",
-      "x": 27,
-      "y": -224,
-      "zIndex": 10,
-      "flow_id": 3,
-      "node_type": 1,
-      "count": 0,
-      "role_list": ""
-    },
-    {
-      "id": "node-c5171e2d-1cd8-4019-83dc-9f2ed0cab6e8",
-      "renderKey": "custom-circle",
-      "name": "custom-circle",
-      "label": "电气分部经理",
-      "width": 90,
-      "height": 90,
-      "ports": {
-        "items": [
-          { "group": "top", "id": "7b9fcd52-4fca-47c7-aaae-e3b117c0c234" },
-          { "group": "right", "id": "6316d87e-2eb3-4ff6-bd8e-0cfd11bff4ce" },
-          { "group": "bottom", "id": "38113945-040f-4374-aca8-38e2e81d71a8" },
-          { "group": "left", "id": "8637b869-7924-416a-b938-30a7ca932901" }
-        ]
-      },
-      "isCustom": true,
-      "parentKey": "1",
-      "x": 27,
-      "y": -115,
-      "zIndex": 10,
-      "flow_id": 4,
-      "node_type": 1,
-      "count": 0,
-      "role_list": ""
-    },
-    {
-      "id": "node-2b3fc359-de49-4f9d-adb5-4eb70b6ba862",
-      "renderKey": "custom-circle",
-      "name": "custom-circle",
-      "label": "方案总审",
-      "width": 90,
-      "height": 90,
-      "ports": {
-        "items": [
-          { "group": "top", "id": "d9b27b16-08ab-4e0d-84dc-fdec64c0a129" },
-          { "group": "right", "id": "1ab6b2a4-dccd-41e9-83c6-d1642c9ad844" },
-          { "group": "bottom", "id": "b763caac-37c1-4659-ae0e-c7b7c760fec1" },
-          { "group": "left", "id": "2408c946-a670-48b5-a676-d882946b8e36" }
-        ]
-      },
-      "isCustom": true,
-      "parentKey": "1",
-      "x": 173,
-      "y": -170,
-      "zIndex": 10,
-      "flow_id": 5,
-      "node_type": 1,
-      "count": 0,
-      "role_list": ""
-    }
-  ],
-  "edges": [
-    {
-      "id": "975bf288:a61170c3-8c1f18d0:89c0bc16",
-      "source": { "cell": "975bf288", "port": "a61170c3" },
-      "target": { "cell": "8c1f18d0", "port": "89c0bc16" },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
-    },
-    {
-      "id": "8c1f18d0:a3adcac9-41561012:293a90b5",
-      "source": { "cell": "8c1f18d0", "port": "a3adcac9" },
-      "target": { "cell": "41561012", "port": "293a90b5" },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
-    },
-    {
-      "id": "5764f3ce:4b4d9fa6-1aed14d1:d348b56a",
-      "source": { "cell": "5764f3ce", "port": "4b4d9fa6" },
-      "target": { "cell": "1aed14d1", "port": "d348b56a" },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":\"5 5\",\"strokeWidth\":1}}"
-    },
-    {
-      "id": "1aed14d1:9a699e3f-4651130e:94f485b5",
-      "source": { "cell": "1aed14d1", "port": "9a699e3f" },
-      "target": { "cell": "4651130e", "port": "94f485b5" },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
-    },
-    {
-      "id": "3fb8d302:205f1437-a48131e0:bac7962b",
-      "source": { "cell": "3fb8d302", "port": "205f1437" },
-      "target": { "cell": "a48131e0", "port": "bac7962b" },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
-    },
-    {
-      "id": "a48131e0:4dee75d9-b57b57c8:73307680",
-      "source": { "cell": "a48131e0", "port": "4dee75d9" },
-      "target": { "cell": "b57b57c8", "port": "73307680" },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":\"5 5\",\"strokeWidth\":1}}"
-    },
-    {
-      "id": "a48131e0:0f72f2ba-3631eae9:2aae2a71",
-      "source": { "cell": "a48131e0", "port": "0f72f2ba" },
-      "target": { "cell": "3631eae9", "port": "2aae2a71" },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
-    },
-    {
-      "id": "3631eae9:8e0bff55-399bddb7:0bccd839",
-      "source": { "cell": "3631eae9", "port": "8e0bff55" },
-      "target": { "cell": "399bddb7", "port": "0bccd839" },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
-    },
-    {
-      "id": "399bddb7:58f52f2c-c28a18d3:e67dc19c",
-      "source": { "cell": "399bddb7", "port": "58f52f2c" },
-      "target": { "cell": "c28a18d3", "port": "e67dc19c" },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
-    },
-    {
-      "id": "c28a18d3:b578cc26-5359e23c:ff6724ee",
-      "source": { "cell": "c28a18d3", "port": "b578cc26" },
-      "target": { "cell": "5359e23c", "port": "ff6724ee" },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
-    },
-    {
-      "id": "5359e23c:34c9dbc6-5216c5dc:d2030f1b",
-      "source": { "cell": "5359e23c", "port": "34c9dbc6" },
-      "target": { "cell": "5216c5dc", "port": "d2030f1b" },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
-    },
-    {
-      "id": "b57b57c8:04c81e99-4651130e:1eb352b0",
-      "source": { "cell": "b57b57c8", "port": "04c81e99" },
-      "target": { "cell": "4651130e", "port": "1eb352b0" },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
-    },
-    {
-      "id": "41561012:92334433-2427bf29:6bbf9ae4",
-      "source": { "cell": "41561012", "port": "92334433" },
-      "target": { "cell": "2427bf29", "port": "6bbf9ae4" },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
-    },
-    {
-      "id": "41561012:92334433-be25fe75:a705e7ed",
-      "source": { "cell": "41561012", "port": "92334433" },
-      "target": { "cell": "be25fe75", "port": "a705e7ed" },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
-    },
-    {
-      "id": "2427bf29:e1a1ecea-975bf288:15d1b217",
-      "source": { "cell": "2427bf29", "port": "e1a1ecea" },
-      "target": { "cell": "975bf288", "port": "15d1b217" },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
-    },
-    {
-      "id": "be25fe75:ce651308-975bf288:15d1b217",
-      "source": { "cell": "be25fe75", "port": "ce651308" },
-      "target": { "cell": "975bf288", "port": "15d1b217" },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
-    },
-    {
-      "id": "975bf288:821f59c0-5764f3ce:c29d7b43",
-      "source": { "cell": "975bf288", "port": "821f59c0" },
-      "target": { "cell": "5764f3ce", "port": "c29d7b43" },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
-    },
-    {
-      "id": "5764f3ce:ce88d7e2-node-186a9d31-0bd3-4b36-b61f-6b5380c824db:6d880b9d-7d7e-4357-94dd-caf7d73b5f80",
-      "source": { "cell": "5764f3ce", "port": "ce88d7e2" },
-      "target": {
-        "cell": "node-186a9d31-0bd3-4b36-b61f-6b5380c824db",
-        "port": "6d880b9d-7d7e-4357-94dd-caf7d73b5f80"
-      },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
-    },
-    {
-      "id": "5764f3ce:ce88d7e2-node-c5171e2d-1cd8-4019-83dc-9f2ed0cab6e8:8637b869-7924-416a-b938-30a7ca932901",
-      "source": { "cell": "5764f3ce", "port": "ce88d7e2" },
-      "target": {
-        "cell": "node-c5171e2d-1cd8-4019-83dc-9f2ed0cab6e8",
-        "port": "8637b869-7924-416a-b938-30a7ca932901"
-      },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
-    },
-    {
-      "id": "node-186a9d31-0bd3-4b36-b61f-6b5380c824db:e134d65d-a197-4116-ad74-f47dbbb727d1-node-2b3fc359-de49-4f9d-adb5-4eb70b6ba862:2408c946-a670-48b5-a676-d882946b8e36",
-      "source": {
-        "cell": "node-186a9d31-0bd3-4b36-b61f-6b5380c824db",
-        "port": "e134d65d-a197-4116-ad74-f47dbbb727d1"
-      },
-      "target": {
-        "cell": "node-2b3fc359-de49-4f9d-adb5-4eb70b6ba862",
-        "port": "2408c946-a670-48b5-a676-d882946b8e36"
-      },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
-    },
-    {
-      "id": "node-c5171e2d-1cd8-4019-83dc-9f2ed0cab6e8:6316d87e-2eb3-4ff6-bd8e-0cfd11bff4ce-node-2b3fc359-de49-4f9d-adb5-4eb70b6ba862:2408c946-a670-48b5-a676-d882946b8e36",
-      "source": {
-        "cell": "node-c5171e2d-1cd8-4019-83dc-9f2ed0cab6e8",
-        "port": "6316d87e-2eb3-4ff6-bd8e-0cfd11bff4ce"
-      },
-      "target": {
-        "cell": "node-2b3fc359-de49-4f9d-adb5-4eb70b6ba862",
-        "port": "2408c946-a670-48b5-a676-d882946b8e36"
-      },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
-    },
-    {
-      "id": "node-2b3fc359-de49-4f9d-adb5-4eb70b6ba862:1ab6b2a4-dccd-41e9-83c6-d1642c9ad844-3fb8d302:22d16375",
-      "source": {
-        "cell": "node-2b3fc359-de49-4f9d-adb5-4eb70b6ba862",
-        "port": "1ab6b2a4-dccd-41e9-83c6-d1642c9ad844"
-      },
-      "target": { "cell": "3fb8d302", "port": "22d16375" },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
-    }
-  ]
-}

+ 0 - 53
src/pages/PurchaseAdmin/PurchaseList/Flow/FlowModal.js

@@ -1,53 +0,0 @@
-import React, { useEffect } from 'react';
-import { Modal, Input, Table, Select, Form, Radio } from 'antd';
-import FlowDetail from './FlowDetail.json';
-
-const { Option } = Select;
-
-function FlowModal(props) {
-  const { visible, onCancel, onOk, projectList, loading } = props;
-  const [form] = Form.useForm();
-  const formLayout = { labelCol: { span: 4 }, wrapperCol: { span: 14 } };
-
-  const handleOk = async () => {
-    let fieldsValue = await form.validateFields();
-    onOk({
-      ...fieldsValue,
-      ...FlowDetail,
-      project_id: Number(fieldsValue.project_id)
-    });
-  };
-
-  useEffect(() => {
-    if (visible) form.resetFields();
-  }, [visible]);
-
-  return (
-    <Modal
-      confirmLoading={loading}
-      destroyOnClose
-      title="流程"
-      visible={visible}
-      onCancel={onCancel}
-      onOk={handleOk}
-    >
-      <Form {...formLayout} form={form}>
-        <Form.Item label="流程名称" name="name">
-          <Input />
-        </Form.Item>
-        <Form.Item label="所属项目" name="project_id">
-          <Select
-            showSearch
-            filterOption={(input, option) => option.children.join("").toLowerCase().includes(input.toLowerCase())}
-          >
-            {projectList.map(item => (
-              <Option key={item.id}>{item.project_full_code}({item.project_name})</Option>
-            ))}
-          </Select>
-        </Form.Item>
-      </Form>
-    </Modal>
-  );
-}
-
-export default FlowModal;

+ 0 - 93
src/pages/PurchaseAdmin/PurchaseList/Flow/List.js

@@ -1,93 +0,0 @@
-import React, { useState, useEffect } from 'react';
-import { Form, Select, Button, Table, Input, Checkbox, Divider } from 'antd';
-import { connect } from 'dva';
-import FlowModal from './FlowModal';
-import router from 'umi/router';
-import Link from 'umi/link';
-
-const { Option } = Select;
-
-function List(props) {
-  const { userList, list, dispatch, projectList, permission } = props;
-  const [visible, setVisible] = useState(false);
-  const columns = [
-    {
-      title: '流程名称',
-      dataIndex: 'Name',
-    },
-    {
-      title: '所属项目',
-      dataIndex: 'ProjectId',
-      render: projectId => {
-        let project = projectList.find(item => item.id == projectId)
-        if(project) return `${project.project_name}(${project.project_full_code})`
-      }
-    },
-    {
-      title: '操作',
-      render: (item, index) => (
-        <>
-          <a onClick={() => router.push(`/bom/flow/${item.Id}`)}>查看</a>
-        </>
-      ),
-    },
-  ];
-
-  const onOk = values => {
-    console.log(values);
-    dispatch({
-      type: 'flow/addFlow',
-      payload: values,
-      callback: () => {
-        setVisible(false);
-      },
-    });
-  };
-
-  useEffect(() => {
-    dispatch({
-      type: 'flow/queryFlowList',
-    });
-    dispatch({
-      type: 'flow/queryProject',
-    });
-    // dispatch({
-    //   type: 'flow/getRoleList',
-    // });
-
-    // dispatch({
-    //   type: 'flow/queryDingTemplateList',
-    // });
-  }, []);
-
-  return (
-    <div>
-      <div style={{ marginBottom: 20 }}>
-        <Button type="primary" style={{ marginRight: 20 }} onClick={() => setVisible(true)}>
-          新增工作流
-        </Button>
-        {permission['func-01-point-bom-flow'] && (
-          <Link to="/bom/audit-list">
-            <Button type="primary">审批流管理</Button>
-          </Link>
-        )}
-      </div>
-
-      <Table rowKey="Id" dataSource={list} columns={columns} />
-
-      <FlowModal
-        visible={visible}
-        projectList={projectList}
-        onCancel={() => setVisible(false)}
-        onOk={onOk}
-      />
-    </div>
-  );
-}
-export default connect(({ user, flow, loading }) => ({
-  userList: user.list,
-  permission: user.currentUser.Permission,
-  list: flow.flowList,
-  projectList: flow.projectList,
-  loading: loading.models.purchaseList2,
-}))(List);

+ 0 - 5
src/pages/PurchaseAdmin/PurchaseList/Flow/index.less

@@ -1,5 +0,0 @@
-body {
-  width: 100%;
-  height: 100%;
-  overflow: hidden;
-}

+ 0 - 284
src/pages/PurchaseAdmin/PurchaseList/Flow/models/flow.js

@@ -1,284 +0,0 @@
-import {
-  queryAuditList,
-  addAudit,
-  addAuditNode,
-  addFlow,
-  queryBoomFlowDetail,
-  updateNode,
-  queryFlowList,
-  queryDingTemplateList,
-  saveAuditFlowInfo,
-  queryDepV2,
-  queryProcessFlows,
-} from '@/services/boom';
-import {
-  queryApproval,
-} from '@/services/approval';
-import { queryRole } from '@/services/SysAdmin';
-import { queryProject } from '@/services/PurchaseList';
-import { message } from 'antd';
-
-function getDepUserTree(data) {
-  data.title = `${data.Name}`;
-  data.id = data.ID;
-  data.value = data.ID;
-  // data.selectable = false;
-  if (!data.children) data.children = new Array();
-
-  if (data.children) {
-    data.children.forEach(item => {
-      getDepUserTree(item);
-    });
-  }
-
-  if (data.Users && data.Users.length !== 0) {
-    data.Users.forEach(item => {
-      item.title = item.CName;
-      item.id = item.ID + '||' + data.ID;
-      item.value = item.ID + '||' + data.ID;
-      // item.selectable = true;
-      item.DepId = data.ID;
-      data.children.push(item);
-    });
-  }
-  return data;
-}
-
-const getFlowDetail = data => {
-  const groups = {
-    top: {
-      position: { name: 'top' },
-      attrs: {
-        circle: {
-          r: 4,
-          magnet: true,
-          stroke: '#31d0c6',
-          strokeWidth: 2,
-          fill: '#fff',
-          style: { visibility: 'hidden' },
-        },
-      },
-      zIndex: 10,
-    },
-    right: {
-      position: { name: 'right' },
-      attrs: {
-        circle: {
-          r: 4,
-          magnet: true,
-          stroke: '#31d0c6',
-          strokeWidth: 2,
-          fill: '#fff',
-          style: { visibility: 'hidden' },
-        },
-      },
-      zIndex: 10,
-    },
-    bottom: {
-      position: { name: 'bottom' },
-      attrs: {
-        circle: {
-          r: 4,
-          magnet: true,
-          stroke: '#31d0c6',
-          strokeWidth: 2,
-          fill: '#fff',
-          style: { visibility: 'hidden' },
-        },
-      },
-      zIndex: 10,
-    },
-    left: {
-      position: { name: 'left' },
-      attrs: {
-        circle: {
-          r: 4,
-          magnet: true,
-          stroke: '#31d0c6',
-          strokeWidth: 2,
-          fill: '#fff',
-          style: { visibility: 'hidden' },
-        },
-      },
-      zIndex: 10,
-    },
-  };
-  const attrs = {
-    line: {
-      stroke: '#A2B1C3',
-      targetMarker: { name: 'block', width: 12, height: 8 },
-      strokeDasharray: '5 5',
-      strokeWidth: 1,
-    },
-  };
-  let nodes = data.nodes.map(item => {
-    let node = { ...item };
-    node.ports.groups = groups;
-    node.parentKey = '1';
-
-    return node;
-  });
-  let edges = data.edges.map(item => {
-    let edge = { ...item };
-    try {
-      edge.attrs = item.attr ? JSON.parse(item.attr) : attrs;
-    } catch (error) {
-      edge.attrs = attrs;
-    }
-    return edge;
-  });
-  return {
-    ...data,
-    nodes,
-    edges,
-  };
-};
-
-export default {
-  namespace: 'flow',
-  state: {
-    flowDetail: { nodes: [], edges: [] },
-    formData: {},
-    auditList: [],
-    flowList: [],
-    projectList: [],
-    current: {},
-    roleList: [],
-    templateList: [],
-    depUserTree: [],
-    simpleFlowDteail: '',
-  },
-
-  effects: {
-    *addFlow({ payload, callback }, { call, put }) {
-      const res = yield call(addFlow, payload);
-      if (res) {
-        message.success('添加成功');
-        callback && callback();
-        yield put({
-          type: 'queryFlowList',
-        });
-      }
-    },
-    *getRoleList({ payload }, { call, put }) {
-      const response = yield call(queryRole, payload);
-      if (response) {
-        yield put({
-          type: 'save',
-          payload: { roleList: response.data.list },
-        });
-      }
-    },
-    *queryBoomFlowDetail({ payload }, { call, put }) {
-      const data = yield call(queryBoomFlowDetail, payload);
-      console.log(data);
-      yield put({
-        type: 'save',
-        payload: { flowDetail: data },
-      });
-    },
-    *queryProject({ callback }, { call, put }) {
-      const response = yield call(queryApproval,{pageSize: 99999});
-      if (response) {
-        yield put({
-          type: 'save',
-          payload: {
-            projectList: response.data.list,
-          },
-        });
-      }
-    },
-    *queryFlowList({ payload }, { call, put }) {
-      const res = yield call(queryFlowList, payload);
-      yield put({
-        type: 'save',
-        payload: { flowList: res.data },
-      });
-    },
-    *updateNode({ payload }, { call, put }) {
-      const data = yield call(updateNode, payload);
-      console.log(data);
-      message.success('修改成功');
-    },
-    *queryAuditList({ payload }, { call, put }) {
-      const response = yield call(queryAuditList, payload);
-      if (response) {
-        yield put({
-          type: 'save',
-          payload: { auditList: response.data },
-        });
-      }
-    },
-    *addAudit({ payload, callback }, { call, put }) {
-      const response = yield call(addAudit, payload);
-      if (response) {
-        message.success('新增成功');
-        callback && callback();
-        yield put({
-          type: 'queryAuditList',
-          payload: {},
-        });
-      }
-    },
-    *addAuditNode({ payload, callback }, { call, put }) {
-      const response = yield call(addAuditNode, payload);
-      if (response) {
-        message.success('操作成功');
-        callback && callback();
-      }
-    },
-    *queryDingTemplateList({ payload }, { call, put }) {
-      const response = yield call(queryDingTemplateList, payload);
-      if (response) {
-        yield put({
-          type: 'save',
-          payload: { templateList: response.data.result },
-        });
-      }
-    },
-    *saveAuditFlowInfo({ payload, callback }, { call, put }) {
-      const response = yield call(saveAuditFlowInfo, payload);
-      if (response) {
-        message.success('保存成功');
-        callback && callback();
-      }
-    },
-    *fetchDepV2({ payload, callback }, { call, put }) {
-      const response = yield call(queryDepV2, { pageSize: 999999 });
-      if (response) {
-        // const depUserTree = response.data?.list;
-        const depUserTree = response.data.list.map(item => {
-          return getDepUserTree(item);
-        });
-        yield put({
-          type: 'save',
-          payload: { depUserTree },
-        });
-      }
-    },
-    *queryProcessFlows({ payload }, { call, put }) {
-      const data = yield call(queryProcessFlows, payload);
-      if (data && data.length > 0) {
-        yield put({
-          type: 'save',
-          payload: {
-            flowDetail: data[0].process_json
-              ? getFlowDetail(JSON.parse(data[0].process_json))
-              : { nodes: [], edges: [] },
-            formData: data[0].form_json ? JSON.parse(data[0].form_json) : [],
-            simpleFlowDteail: data[0].process_simple_json,
-          },
-        });
-      }
-    },
-  },
-
-  reducers: {
-    save(state, action) {
-      return {
-        ...state,
-        ...action.payload,
-      };
-    },
-  },
-};

+ 48 - 8
src/pages/PurchaseAdmin/PurchaseList/Index.js

@@ -24,7 +24,6 @@ function LayoutDetail(props) {
     props.dispatch({
       type: 'user/fetchCurrent',
     });
-    localStorage.type = 'bom'
   }, []);
   const checkReport = state => {
     if (isAdmin) return true;
@@ -38,8 +37,6 @@ function LayoutDetail(props) {
         return permission['func-01-point-works-report-d'];
       case 3:
         return currentUser.is_accountant || permission['func-01-point-works-report-p-s'];
-      case 4:
-        return permission['func-01-point-bom-flow'];
     }
   };
   return (
@@ -54,12 +51,55 @@ function LayoutDetail(props) {
               defaultSelectedKeys={[props.location.pathname]}
               style={{ lineHeight: '64px', width: '100%' }}
             >
-              <Menu.Item key="/bom">
-                <Link to="/bom">采购清单</Link>
-              </Menu.Item>
-              <Menu.Item key="/bom/flow-list">
-                <Link to="/bom/flow-list">流程管理</Link>
+              <SubMenu key="/home/work-hours" title="工时管理">
+                <Menu.Item key="/home/work-hours">
+                  <Link to="/home/work-hours">上报工时</Link>
+                </Menu.Item>
+                <Menu.Item key="/home/work-hours-auth">
+                  <Link to="/home/work-hours-auth">审批工时</Link>
+                </Menu.Item>
+              </SubMenu>
+
+              <SubMenu key="/home/approval" title="项目立项">
+                <Menu.Item key="/home/approval/list">
+                  <Link to="/home/approval/list">项目列表</Link>
+                </Menu.Item>
+                <Menu.Item key="/home/approval/auth">
+                  <Link to="/home/approval/auth">审核列表</Link>
+                </Menu.Item>
+              </SubMenu>
+
+              {checkReport(0) && (
+                <SubMenu key="/home/report" title="工时报表">
+                  {/* <Menu.Item key="/home/report/resource">
+                  <Link to="/home/report/resource">资源报表</Link>
+                </Menu.Item> */}
+                  {checkReport(1) && (
+                    <Menu.Item key="/home/report/project">
+                      <Link to="/home/report/project">项目报表</Link>
+                    </Menu.Item>
+                  )}
+                  {checkReport(2) && (
+                    <Menu.Item key="/home/report/department">
+                      <Link to="/home/report/department">部门报表</Link>
+                    </Menu.Item>
+                  )}
+                  {checkReport(3) && (
+                    <Menu.Item key="/home/report/finance">
+                      <Link to="/home/report/finance">财务报表</Link>
+                    </Menu.Item>
+                  )}
+                </SubMenu>
+              )}
+
+              {/* {isAdmin && (
+              <Menu.Item key="/home">
+                <Link to="/home">采购清单</Link>
               </Menu.Item>
+              )} */}
+              {/* <Menu.Item key="/home/flow-list">
+                <Link to="/home/flow-list">流程图</Link>
+              </Menu.Item> */}
             </Menu>
           </div>
           <RightContent />

+ 0 - 52
src/pages/PurchaseAdmin/PurchaseList/List/AddModal.js

@@ -1,52 +0,0 @@
-import React, { useState } from 'react';
-import { Form } from '@ant-design/compatible';
-import '@ant-design/compatible/assets/index.css';
-import { Select, Modal, Input } from 'antd';
-
-const { Option } = Select;
-// 新建
-function AddModal(props) {
-  const { visible, onClose, onOk, form, list, loading } = props;
-  const [checkValue, setCheckValue] = useState([]);
-
-  const handleOk = () => {
-    form.validateFields((err, fieldsValue) => {
-      if (err) return;
-      onOk(fieldsValue);
-    });
-  };
-
-  return (
-    <Modal
-      confirmLoading={loading}
-      maskClosable={false}
-      destroyOnClose
-      title="新增"
-      visible={visible}
-      onCancel={onClose}
-      onOk={handleOk}
-    >
-      <Form.Item labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label="所属项目">
-        {form.getFieldDecorator('project_id')(
-          <Select style={{ width: '100%' }}>
-            {list.map(item => (
-              <Option key={item.ID} value={item.ID}>
-                {item.Name}
-              </Option>
-            ))}
-          </Select>
-        )}
-      </Form.Item>
-      <Form.Item labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label="文档名称">
-        {form.getFieldDecorator('name')(<Input />)}
-      </Form.Item>
-      {/* <Form.Item labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label="流程名称">
-        {form.getFieldDecorator('flow_name')(<Input />)}
-      </Form.Item>
-      <Form.Item labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label="流程描述">
-        {form.getFieldDecorator('flow_desc')(<Input.TextArea />)}
-      </Form.Item> */}
-    </Modal>
-  );
-}
-export default Form.create()(AddModal);

+ 0 - 172
src/pages/PurchaseAdmin/PurchaseList/List/List.js

@@ -1,172 +0,0 @@
-import React, { useState, useEffect } from 'react';
-import { Form } from '@ant-design/compatible';
-import '@ant-design/compatible/assets/index.css';
-import { Table, Button, Select, Divider } from 'antd';
-import router from 'umi/router';
-import { connect } from 'dva';
-import AddModal from './AddModal';
-import NodeModal from './NodeModal';
-import styles from './List.less';
-
-const { Option } = Select;
-let PROJECT_ID;
-
-function List(props) {
-  const { project, excel, flow, user, dispatch, loading, currentUser, roleList } = props;
-  const [addVisible, setAddVisible] = useState(false);
-  const [nodeVisible, setNodeVisible] = useState(false);
-  const columns = [
-    {
-      title: '流程名称',
-      dataIndex: 'name',
-    },
-    {
-      title: '所属项目',
-      dataIndex: 'project_id',
-      render: id => {
-        return project.list.find(item => item.ID == id)?.Name;
-      },
-    },
-    // {
-    //   title: '流程名称',
-    //   dataIndex: 'FlowInfo.name',
-    // },
-    {
-      title: '当前节点',
-      dataIndex: 'NodeInfo.node',
-    },
-    // {
-    //   title: '节点审核状态',
-    //   dataIndex: 'audit_status',
-    //   render: status => {
-    //     return {
-    //       0: '未提审',
-    //       1: '待审核',
-    //       2: '审核不通过',
-    //     }[status];
-    //   },
-    // },
-    {
-      title: '操作',
-      render: record => (
-        <>
-          <a onClick={() => router.push(`/bom/detail/${record.id}/${record.project_id}`)}>查看</a>
-          {currentUser.IsSuper && (
-            <>
-              <Divider type="vertical" />
-              <a onClick={() => onShowNode(record.project_id)}>修改审批人</a>
-            </>
-          )}
-        </>
-      ),
-    },
-  ];
-  const onAdd = values => {
-    dispatch({
-      type: 'purchaseList2/createExcel',
-      payload: values,
-      callback: () => {
-        setAddVisible(false);
-      },
-    });
-  };
-  const onNodeChange = value => {
-    dispatch({
-      type: 'purchaseList2/updateFlowInfo',
-      payload: {
-        ...value,
-        projectId: PROJECT_ID,
-      },
-    });
-  };
-
-  const onShowNode = projectId => {
-    PROJECT_ID = projectId;
-    dispatch({
-      type: 'purchaseList2/queryFlowInfoList',
-      payload: {
-        projectId,
-      },
-      callback: () => {
-        setNodeVisible(true);
-      },
-    });
-  };
-  const queryList = page => {
-    console.log(page);
-    dispatch({
-      type: 'purchaseList2/queryExcel',
-      payload: {
-        currentPage: page.current,
-      },
-    });
-  };
-
-  const getData = () => {
-    return excel.list.filter(item => {
-      let index = project.list.findIndex(p => p.ID == item.project_id);
-      return index != -1;
-    });
-  };
-
-  useEffect(() => {
-    dispatch({
-      type: 'purchaseList2/queryProject',
-    });
-    dispatch({
-      type: 'purchaseList2/queryExcel',
-      payload: {
-        pageSize: 9999
-      },
-    });
-    dispatch({
-      type: 'user/fetch',
-    });
-
-    dispatch({
-      type: 'purchaseList2/getRoleList',
-    });
-  }, []);
-
-  return (
-    <div>
-      <div className={styles.btns}>
-        <Button onClick={() => setAddVisible(true)}>新增项目</Button>
-      </div>
-      <Table
-        loading={loading}
-        rowKey="id"
-        dataSource={getData()}
-        // pagination={excel.pagination}
-        columns={columns}
-      // onChange={queryList}
-      />
-      <AddModal
-        loading={loading}
-        list={project.list}
-        visible={addVisible}
-        onOk={onAdd}
-        onClose={() => setAddVisible(false)}
-      />
-      <NodeModal
-        loading={loading}
-        flow={flow}
-        visible={nodeVisible}
-        onOk={onNodeChange}
-        user={user}
-        roleList={roleList}
-        onClose={() => setNodeVisible(false)}
-      />
-    </div>
-  );
-}
-
-export default connect(({ purchaseList2, user, loading }) => ({
-  project: purchaseList2.project,
-  roleList: purchaseList2.roleList,
-  excel: purchaseList2.excel,
-  flow: purchaseList2.flow,
-  user: user.list,
-  currentUser: user.currentUser,
-  loading: loading.models.purchaseList2,
-}))(List);

+ 0 - 8
src/pages/PurchaseAdmin/PurchaseList/List/List.less

@@ -1,8 +0,0 @@
-.btns {
-  margin: 20px 0;
-  :global {
-    .ant-btn {
-      margin-right: 10px;
-    }
-  }
-}

+ 0 - 189
src/pages/PurchaseAdmin/PurchaseList/List/NewList.js

@@ -1,189 +0,0 @@
-import React, { useState, useEffect } from 'react';
-import { Table, Divider, message } from 'antd';
-import { connect } from 'dva';
-import router from 'umi/router';
-import FlowModal from '../Detail/FlowModal';
-import { queryBoomFlowDetail, queryRecordSheet } from '@/services/boom';
-import { async } from '@antv/x6/es/registry/marker/async';
-import { getToken } from '@/utils/utils';
-import AuditForm from '@/components/AuditForm';
-
-function List(props) {
-  const { excel, loading, project, dispatch, versionList } = props;
-  const [flowVisible, setFlowVisible] = useState(false);
-  const [version, setVersion] = useState({});
-  const [versionVisible, setVersionVisible] = useState(false);
-  const [flowDetail, setFlowDetail] = useState();
-  const [loading2, setLoading2] = useState(false);
-
-  let token = getToken();
-
-  const columns = [
-    {
-      title: '流程名称',
-      width: '35%',
-      render: item => item.version_name || item.name,
-    },
-    // {
-    //   title: '所属项目',
-    //   width: '35%',
-    //   render: item => {
-    //     if (!item.is_parent) return '';
-    //     return project.list.find(p => p.ID == item.project_id)?.Name;
-    //   },
-    // },
-    {
-      title: '所属项目',
-      width: '35%',
-      render: item => {
-        if (!item.is_parent) return '';
-        let p = project.list.find(p => p.id == item.project_id)
-        if(p) return `${p.project_name}(${p.project_full_code})`
-      }
-    },
-    {
-      title: '操作',
-      render: record => {
-        if (record.is_parent) return null;
-        return (
-          <a
-            onClick={async () => {
-              localStorage.excelId = record.id;
-
-              setLoading2(true);
-              try {
-                const data = await queryBoomFlowDetail({ id: record.template_id });
-                setFlowDetail(data);
-                setVersion(record);
-                setFlowVisible(true);
-              } catch (error) {}
-              setLoading2(false);
-              // router.push(`/bom/detail/${record.project_id}/${record.template_id}`);
-            }}
-          >
-            查看
-          </a>
-        );
-      },
-    },
-  ];
-  console.log(project)
-  const queryList = page => {
-    console.log(page);
-    dispatch({
-      type: 'newList/queryProjectRecord',
-      payload: {
-        ...page,
-        currentPage: page.current,
-      },
-    });
-  };
-
-  useEffect(() => {
-    dispatch({
-      type: 'newList/queryProjectRecord',
-      payload: {
-        pageSize: 20,
-      },
-    });
-    dispatch({
-      type: 'newList/queryProject',
-    });
-    dispatch({
-      type: 'newList/queryVersionsList',
-    });
-
-    dispatch({
-      type: 'user/queryDepV2',
-    });
-  }, []);
-
-  const changeVersion = item => {
-    if (typeof item == 'object') {
-      localStorage.excelItem = JSON.stringify(item);
-    }
-    router.push(`/bom/detail/${item.project_id}/${item.template_id}`);
-  };
-
-  const getLoading = () => {
-    let effects = loadingVersion.effects;
-    return !loadingVersion.effects['detail/queryComment'] && loadingVersion.models.detail;
-  };
-
-  const onCommit = async (values, id) => {
-    let currentNode = flowDetail.nodes.find?.(item => item.Id == version.template_node_id);
-    let sheets = await queryRecordSheet({ gridKey: version.id, 'JWT-TOKEN': token });
-    // if (!currentNode.muti_version) {
-    //   // audit_status=4 表示为清单推进后留存的副本.不计入多清单计算
-    //   let serviceVersion = versionList?.find(
-    //     item => item.audit_status != 4 && item.template_node_id == currentNode.Id
-    //   );
-    //   if (serviceVersion) {
-    //     message.error(`新建清单失败!业务节点【${currentNode.label}】只能有一个清单!`);
-    //     return;
-    //   }
-    // }
-    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: sheets,
-      base_id: version.id,
-    };
-    dispatch({
-      type: 'newList/commitSheet',
-      payload: params,
-      callback: async newVersion => {
-        // 更新flow流程图
-        const data = await queryBoomFlowDetail({ id: newVersion.template_id });
-        console.log(data);
-        setFlowDetail(data);
-      },
-    });
-  };
-
-  return (
-    <div>
-      {/* <AuditForm onChange={values => console.log(values)} /> */}
-      <Table
-        loading={loading || loading2}
-        rowKey="id"
-        dataSource={excel.list}
-        pagination={excel.pagination}
-        columns={columns}
-        onChange={queryList}
-      />
-      <FlowModal
-        isOut={true}
-        flowDetail={flowDetail}
-        visible={flowVisible}
-        onClose={() => setFlowVisible(false)}
-        version={version}
-        onCommit={onCommit}
-        onChangeVersion={version => changeVersion(version)}
-      />
-      {/* <VersionModal
-        loading={getLoading()}
-        visible={versionVisible}
-        onClose={() => setVersionVisible(false)}
-        onOk={values => onCommit(values)}
-      /> */}
-    </div>
-  );
-}
-
-export default connect(({ newList, loading, detail }) => ({
-  excel: newList.excel,
-  project: newList.project,
-  loading: loading.models.newList,
-  loadingVersion: loading,
-  versionList: newList.versionList,
-}))(List);

+ 0 - 146
src/pages/PurchaseAdmin/PurchaseList/List/NodeModal.js

@@ -1,146 +0,0 @@
-import React, { useState, useEffect, useRef } from 'react';
-import { Form } from '@ant-design/compatible';
-import '@ant-design/compatible/assets/index.css';
-import { Button, Select, Modal, Input, Steps } from 'antd';
-
-const { Option } = Select;
-const { Step } = Steps;
-
-// 设置节点审核人
-function NodeModal(props) {
-  const { flow, user, visible, onClose, onOk, form, loading, roleList } = props;
-  const [auditor, setAuditor] = useState();
-  const [current, setCurrent] = useState(0);
-  const list = flow.list.FlowNodes;
-  const handleOk = () => {
-    form.validateFields((err, fieldsValue) => {
-      if (err) return;
-      let auditor = fieldsValue.auditor;
-      if (!auditor)
-        fieldsValue.auditor = 0;
-      onOk({
-        ...fieldsValue,
-        id: list[current].id, //node_id
-        flow_id: list[current].flow_id, //流程id
-      });
-    });
-  };
-
-  const onSelectNode = current => {
-    let node = list[current] || {};
-    setCurrent(current);
-  };
-
-  const onRoleSelectChange = value => {
-    form.setFieldsValue({ auditor: '' });
-  };
-
-  const filterUser = () => {
-    let tempUser = [];
-    let res = roleList.find(item => item.ID + '' === form.getFieldValue('audit_role'));
-    if (res)
-      tempUser = res.User;
-    else {
-      tempUser = user;
-    }
-    return (tempUser && tempUser.map(item => (
-      <Option key={item.ID} value={item.ID}>
-        {item.CName}
-      </Option>
-    )))
-  }
-
-  useEffect(() => {
-    // 默认选中第0项
-    onSelectNode(0);
-  }, [visible]);
-
-  useEffect(() => {
-    form.resetFields();
-  }, [current]);
-
-  return (
-    <Modal
-      maskClosable={false}
-      destroyOnClose
-      title="编辑节点"
-      width={800}
-      visible={visible}
-      footer={false}
-      onCancel={onClose}
-    >
-      <Steps current={current} onChange={onSelectNode}>
-        {list.map(item => (
-          <Step
-            status={list[current]?.id == item.id ? 'process' : 'wait'}
-            key={item.id}
-            title={item.node}
-          />
-        ))}
-      </Steps>
-
-      <Form style={{ margin: '20px 0' }} labelCol={{ span: 5 }} wrapperCol={{ span: 15 }}>
-        <Form.Item label="节点名称">
-          {form.getFieldDecorator('node', {
-            initialValue: list[current]?.node,
-          })(<Input />)}
-        </Form.Item>
-        <Form.Item label="节点描述">
-          {form.getFieldDecorator('desc', {
-            initialValue: list[current]?.desc,
-          })(<Input.TextArea />)}
-        </Form.Item>
-
-        <Form.Item
-          labelCol={{ span: 5 }}
-          wrapperCol={{ span: 15 }}
-          label="审批角色"
-
-        >
-          {form.getFieldDecorator('audit_role', {
-            initialValue: list[current]?.audit_role,
-            rules: [{ required: true, message: '请选择审批角色' }],
-          })(
-            <Select
-              showSearch
-              style={{ width: '100%' }}
-              filterOption={(input, option) => option.props.children.indexOf(input) >= 0}
-              onChange={onRoleSelectChange}
-            >
-              {roleList && roleList.map(item => (
-                <Option key={item.ID} value={item.ID + ''}>
-                  {item.Name}
-                </Option>
-              ))}
-            </Select>
-          )}
-        </Form.Item>
-
-        <Form.Item
-          label="审批人"
-        >
-          {form.getFieldDecorator('auditor', {
-            initialValue: list[current]?.auditor == 0 ? '' : list[current]?.auditor,
-          })(
-            <Select
-              showSearch
-              style={{ width: '100%' }}
-              filterOption={(input, option) => option.props.children.indexOf(input) >= 0}
-            >
-              {
-                filterUser()
-              }
-            </Select>
-          )}
-        </Form.Item>
-      </Form>
-      <div style={{ display: 'flex', flexDirection: 'row-reverse' }}>
-        <Button loading={loading} style={{ marginTop: 20 }} type="primary" onClick={handleOk}>
-          保存
-        </Button>
-      </div>
-    </Modal>
-  );
-}
-
-export default Form.create()(NodeModal);

+ 0 - 307
src/pages/PurchaseAdmin/PurchaseList/List/models/list.js

@@ -1,307 +0,0 @@
-import {
-  queryFlowInfo,
-  commitSheet,
-  querySheet,
-  queryHistory,
-  queryHistoryDetail,
-  queryComment,
-  addComment,
-  createExcel,
-  queryExcel,
-  updateFlowInfo,
-  submitAudit,
-  approve,
-  Login,
-  Logout,
-  queryProject,
-} from '@/services/PurchaseList';
-import { queryVersionsList } from '@/services/boom';
-import { queryRole } from '@/services/SysAdmin';
-import { setCurrentUser } from '@/utils/authority';
-import { storeToken } from '@/utils/utils';
-import { routerRedux } from 'dva/router';
-import { message } from 'antd';
-
-export default {
-  namespace: 'purchaseList2',
-  state: {
-    flow: {
-      active: 0,
-      currentNode: {},
-      list: {
-        FlowNodes: [],
-      },
-    },
-    history: {
-      list: [],
-      pagination: false,
-    },
-    project: {
-      list: [],
-      pagination: false,
-    },
-    excel: {
-      list: [],
-      pagination: false,
-    },
-    comment: { list: [] },
-    roleList: [],
-    versionList: [],
-  },
-
-  effects: {
-    *login({ payload }, { call, put }) {
-      let response = null;
-      response = yield call(Login, payload);
-      const { user, token } = response.data;
-      setCurrentUser(user);
-      storeToken(token);
-
-      yield put(routerRedux.replace('/home'));
-    },
-    *logout(_, { call, put }) {
-      yield call(Logout);
-      yield put(
-        routerRedux.push({
-          pathname: '/login',
-        })
-      );
-    },
-    *queryFlowInfo({ payload, callback }, { call, put }) {
-      const response = yield call(queryFlowInfo, payload);
-      if (response) {
-        var flow = response.data[0];
-        flow.current = flow.list.FlowNodes.findIndex(item => item.id == flow.active);
-        flow.currentNode = flow.list.FlowNodes[flow.current];
-        yield put({
-          type: 'save',
-          payload: { flow: flow },
-        });
-        // 查询当前节点的最新sheet信息
-        yield put({
-          type: 'querySheet',
-          payload: {
-            project_id: payload.projectId,
-            flow_id: flow.currentNode.flow_id,
-            node_id: flow.currentNode.id,
-          },
-          callback: sheets => {
-            callback && callback(flow, sheets);
-          },
-        });
-      }
-    },
-    *queryFlowInfoList({ payload, callback }, { call, put }) {
-      const response = yield call(queryFlowInfo, payload);
-      if (response) {
-        var flow = response.data[0];
-        flow.current = flow.list.FlowNodes.findIndex(item => item.id == flow.active);
-        flow.currentNode = flow.list.FlowNodes[flow.current];
-        yield put({
-          type: 'save',
-          payload: { flow: flow },
-        });
-        callback && callback();
-      }
-    },
-    *updateFlowInfo({ payload }, { call, put }) {
-      const response = yield call(updateFlowInfo, payload);
-      if (response) {
-        message.success('修改成功');
-        yield put({
-          type: 'queryFlowInfoList',
-          payload: {
-            projectId: payload.projectId,
-          },
-        });
-      }
-    },
-    *queryHistory({ payload, callback }, { call, put }) {
-      payload.pageSize = '9999';
-      const response = yield call(queryHistory, payload);
-      if (response) {
-        yield put({
-          type: 'save',
-          payload: { history: response.data },
-        });
-        callback(response.data);
-      }
-    },
-    *submitAudit({ payload, callback }, { call, put }) {
-      const response = yield call(submitAudit, payload);
-      if (response) {
-        message.success('提交审核成功');
-        yield put({
-          type: 'queryHistory',
-          payload: {
-            projectId: payload.projectId,
-            excel_id: payload.id,
-          },
-        });
-        yield put({
-          type: 'queryFlowInfo',
-          payload: {
-            projectId: payload.projectId,
-          },
-        });
-      }
-    },
-    *approve({ payload, callback }, { call, put }) {
-      try {
-        const response = yield call(approve, payload);
-        if (response) {
-          message.success('操作成功');
-          yield put({
-            type: 'queryHistory',
-            payload: {
-              projectId: payload.projectId,
-              excel_id: payload.id,
-            },
-          });
-          yield put({
-            type: 'queryFlowInfo',
-            payload: {
-              projectId: payload.project_id,
-            },
-            callback,
-          });
-        }
-      } catch (error) {
-        console.error(error);
-      }
-    },
-
-    *queryHistoryDetail({ payload, callback }, { call, put }) {
-      const response = yield call(queryHistoryDetail, payload);
-      if (response) {
-        let sheets = response.data;
-        sheets.forEach(item => {
-          item.config = JSON.parse(item.config) || {};
-          item.celldata = JSON.parse(item.cell_data) || [];
-          delete item.cell_data;
-        });
-        callback && callback(sheets);
-      }
-    },
-    *queryComment({ payload }, { call, put }) {
-      const response = yield call(queryComment, payload);
-      if (response) {
-        yield put({
-          type: 'save',
-          payload: { comment: response.data },
-        });
-      }
-    },
-    *addComment({ payload, callback }, { call, put }) {
-      const response = yield call(addComment, payload);
-      if (response) {
-        yield put({
-          type: 'queryComment',
-          payload,
-        });
-        message.success('评论成功');
-        callback && callback();
-      }
-    },
-    *createExcel({ payload, callback }, { call, put }) {
-      const response = yield call(createExcel, payload);
-      if (response) {
-        yield put({
-          type: 'queryExcel',
-        });
-        message.success('创建成功');
-        callback && callback();
-      }
-    },
-    *queryExcel({ payload }, { call, put }) {
-      const response = yield call(queryExcel, payload);
-      if (response) {
-        yield put({
-          type: 'save',
-          payload: { excel: response.data },
-        });
-      }
-    },
-    *commitSheet({ payload, callback }, { call, put }) {
-      const response = yield call(commitSheet, payload);
-      if (response) {
-        const res = yield call(queryHistory, {
-          excel_id: payload.id,
-          project_id: payload.project_id,
-        });
-        yield put({
-          type: 'save',
-          payload: { history: res.data },
-        });
-        const lastCommit = res.data.list[0];
-        message.success('提交成功');
-        yield put({
-          type: 'queryHistoryDetail',
-          payload: {
-            excel_id: lastCommit.excel_id,
-            history_id: lastCommit.id,
-          },
-          callback: sheets => {
-            lastCommit.data = sheets;
-            lastCommit.name = lastCommit.version_name;
-            callback(lastCommit);
-          },
-        });
-      }
-    },
-    *querySheet({ payload, callback }, { call, put }) {
-      const response = yield call(querySheet, payload);
-      if (response) {
-        let sheet = response.data;
-        sheet.data = JSON.parse(sheet.data || '[]');
-        sheet.data.forEach(item => {
-          item.config = JSON.parse(item.config || '{}');
-          item.celldata = JSON.parse(item.cell_data || '[]');
-          delete item.cell_data;
-        });
-        callback && callback(sheet);
-      }
-    },
-    *queryProject({ callback }, { call, put }) {
-      const response = yield call(queryProject);
-      if (response) {
-        yield put({
-          type: 'save',
-          payload: {
-            project: response.data,
-          },
-        });
-      }
-    },
-    *getRoleList({ payload }, { call, put }) {
-      const response = yield call(queryRole, payload);
-      if (response) {
-        yield put({
-          type: 'save',
-          payload: { roleList: response.data.list },
-        });
-      }
-    },
-    *queryVersionsList({ payload, callback }, { call, put }) {
-      const response = yield call(queryVersionsList, payload);
-      if (response) {
-        callback && callback(response.data);
-        yield put({
-          type: 'save',
-          payload: {
-            versionList: response.data,
-          },
-        });
-      }
-    },
-  },
-
-  reducers: {
-    save(state, action) {
-      return {
-        ...state,
-        ...action.payload,
-      };
-    },
-  },
-};

+ 0 - 109
src/pages/PurchaseAdmin/PurchaseList/List/models/newList.js

@@ -1,109 +0,0 @@
-import { queryProjectRecord } from '@/services/boom';
-import { queryProject } from '@/services/PurchaseList';
-import {
-  queryApproval,
-} from '@/services/approval';
-import { message } from 'antd';
-import { commitSheet, queryVersionsList, queryAuditExcel, queryAuditRecord } from '@/services/boom';
-
-export default {
-  namespace: 'newList',
-  state: {
-    excel: {
-      list: [],
-      pagination: {},
-    },
-    project: {
-      list: [],
-      pagination: false,
-    },
-    versionList: [],
-  },
-
-  effects: {
-    *queryProjectRecord({ payload = {}, callback }, { call, put }) {
-      const { data } = yield call(queryProjectRecord, payload);
-      let temp = {};
-      data.list.forEach(item => {
-        if (!temp[item.template_id]) {
-          temp[item.template_id] = {
-            id: `template-${item.template_id}`,
-            name: item.name,
-            project_id: item.project_id,
-            is_parent: true,
-            children: [],
-          };
-        }
-        temp[item.template_id].children.push(item);
-      });
-      data.list = Object.values(temp);
-      yield put({
-        type: 'save',
-        payload: { excel: data },
-      });
-    },
-    *queryProject({ callback }, { call, put }) {
-      const response = yield call(queryApproval,{pageSize: 99999});
-      if (response) {
-        yield put({
-          type: 'save',
-          payload: {
-            project: response.data,
-          },
-        });
-      }
-    },
-    *queryVersionsList({ payload, callback }, { call, put }) {
-      const response = yield call(queryVersionsList, payload);
-      if (response) {
-        callback && callback(response.data);
-        yield put({
-          type: 'save',
-          payload: {
-            versionList: response.data,
-          },
-        });
-      }
-    },
-    *commitSheet({ payload, callback }, { call, put }) {
-      let response = yield call(commitSheet, payload);
-      if (response) {
-        message.success('提交成功');
-        yield put({
-          type: 'queryVersionsList',
-          payload: {
-            project_id: payload.project_id,
-            // template_id: payload.template_id,
-            // template_node_id: payload.template_node_id,
-          },
-          callback: versionList => {
-            let newVersion = versionList.find(item => item.id == response.data.id);
-            callback && callback(newVersion);
-          },
-        });
-      }
-    },
-
-    *queryAuditExcel({ payload, callback }, { call, put }) {
-      const response = yield call(queryAuditExcel, payload);
-      if (response) {
-        callback && callback(response.data?.all);
-      }
-    },
-    *queryAuditRecord({ payload, callback }, { call, put }) {
-      const response = yield call(queryAuditRecord, payload);
-      if (response) {
-        callback && callback(response.data?.all);
-      }
-    },
-  },
-
-  reducers: {
-    save(state, action) {
-      return {
-        ...state,
-        ...action.payload,
-      };
-    },
-  },
-};

+ 1 - 5
src/pages/PurchaseAdmin/PurchaseList/Login/models/login.js

@@ -25,11 +25,7 @@ export default {
         type: 'changeLoginStatus',
         payload: response,
       });
-      if(localStorage.type == 'bom') {
-        yield put(routerRedux.replace('/bom'));
-      } else {
-        yield put(routerRedux.replace('/home'));
-      }
+      yield put(routerRedux.replace('/home/work-hours'));
     },
     *logout(_, { call, put }) {
       yield call(Logout);

+ 1 - 1
src/pages/PurchaseAdmin/PurchaseList/Report/models/report.js

@@ -15,7 +15,7 @@ import { queryRole } from '@/services/SysAdmin';
 import { message } from 'antd';
 import moment from 'moment';
 import { filter, times } from 'lodash';
-import list from '../../List/models/list';
+// import list from '../../List/models/list';
 
 export default {
   namespace: 'report',