|  | @@ -1,6 +1,6 @@
 | 
	
		
			
				|  |  | -import React, {useState, useEffect, useRef} from 'react';
 | 
	
		
			
				|  |  | -import {Button, Divider, Form, Input, message, Modal, Select, Table} from 'antd';
 | 
	
		
			
				|  |  | -import {connect} from 'dva';
 | 
	
		
			
				|  |  | +import React, { useState, useEffect, useRef } from 'react';
 | 
	
		
			
				|  |  | +import { Button, Divider, Form, Input, message, Modal, Select, Table } from 'antd';
 | 
	
		
			
				|  |  | +import { connect } from 'dva';
 | 
	
		
			
				|  |  |  import router from 'umi/router';
 | 
	
		
			
				|  |  |  import FlowModal from '../Detail/FlowModal';
 | 
	
		
			
				|  |  |  import {
 | 
	
	
		
			
				|  | @@ -10,14 +10,14 @@ import {
 | 
	
		
			
				|  |  |    queryDelPurchaseExcel,
 | 
	
		
			
				|  |  |    queryRecordSheet,
 | 
	
		
			
				|  |  |  } from '@/services/boom';
 | 
	
		
			
				|  |  | -import {getToken} from '@/utils/utils';
 | 
	
		
			
				|  |  | +import { getToken } from '@/utils/utils';
 | 
	
		
			
				|  |  |  import ClassifyModal from './ClassifyModal';
 | 
	
		
			
				|  |  |  import VersionModal from './VersionModal';
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  let token = getToken();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  function List(props) {
 | 
	
		
			
				|  |  | -  const {excel, loading, project, dispatch, typeOptions, userList, versionList} = props;
 | 
	
		
			
				|  |  | +  const { excel, loading, project, dispatch, typeOptions, userList, versionList } = props;
 | 
	
		
			
				|  |  |    const [flowVisible, setFlowVisible] = useState(false);
 | 
	
		
			
				|  |  |    const [version, setVersion] = useState({});
 | 
	
		
			
				|  |  |    const [versionVisible, setVersionVisible] = useState(false);
 | 
	
	
		
			
				|  | @@ -49,7 +49,7 @@ function List(props) {
 | 
	
		
			
				|  |  |          if (p) {
 | 
	
		
			
				|  |  |            return `${p.project_name}(${p.project_full_code})`;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        return ''
 | 
	
		
			
				|  |  | +        return '';
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      {
 | 
	
	
		
			
				|  | @@ -61,12 +61,11 @@ function List(props) {
 | 
	
		
			
				|  |  |              onClick={async () => {
 | 
	
		
			
				|  |  |                try {
 | 
	
		
			
				|  |  |                  setClassifyLoading(true);
 | 
	
		
			
				|  |  | -                const data = await queryBindClassify({project_id: record.project_id}); //record.project_id
 | 
	
		
			
				|  |  | +                const data = await queryBindClassify({ project_id: record.project_id }); //record.project_id
 | 
	
		
			
				|  |  |                  setClassifyLoading(false);
 | 
	
		
			
				|  |  | -                setData({project_id: record.project_id, classify: data});
 | 
	
		
			
				|  |  | +                setData({ project_id: record.project_id, classify: data });
 | 
	
		
			
				|  |  |                  setVisible(true);
 | 
	
		
			
				|  |  | -              } catch (error) {
 | 
	
		
			
				|  |  | -              }
 | 
	
		
			
				|  |  | +              } catch (error) {}
 | 
	
		
			
				|  |  |              }}
 | 
	
		
			
				|  |  |            >
 | 
	
		
			
				|  |  |              分类权限
 | 
	
	
		
			
				|  | @@ -77,7 +76,7 @@ function List(props) {
 | 
	
		
			
				|  |  |                localStorage.excelId = record.id;
 | 
	
		
			
				|  |  |                setLoading2(true);
 | 
	
		
			
				|  |  |                try {
 | 
	
		
			
				|  |  | -                const data = await queryBoomFlowDetail({id: record.template_id});
 | 
	
		
			
				|  |  | +                const data = await queryBoomFlowDetail({ id: record.template_id });
 | 
	
		
			
				|  |  |                  setFlowDetail(data);
 | 
	
		
			
				|  |  |                  setVersion(record);
 | 
	
		
			
				|  |  |                  setFlowVisible(true);
 | 
	
	
		
			
				|  | @@ -87,8 +86,7 @@ function List(props) {
 | 
	
		
			
				|  |  |                      project_id: record.project_id,
 | 
	
		
			
				|  |  |                    },
 | 
	
		
			
				|  |  |                  });
 | 
	
		
			
				|  |  | -              } catch (error) {
 | 
	
		
			
				|  |  | -              }
 | 
	
		
			
				|  |  | +              } catch (error) {}
 | 
	
		
			
				|  |  |                setLoading2(false);
 | 
	
		
			
				|  |  |                // router.push(`/home/detail/${record.project_id}/${record.template_id}`);
 | 
	
		
			
				|  |  |              }}
 | 
	
	
		
			
				|  | @@ -110,7 +108,7 @@ function List(props) {
 | 
	
		
			
				|  |  |    ];
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    const queryList = filter => {
 | 
	
		
			
				|  |  | -    filter = {...filterRes.current, ...filter};
 | 
	
		
			
				|  |  | +    filter = { ...filterRes.current, ...filter };
 | 
	
		
			
				|  |  |      dispatch({
 | 
	
		
			
				|  |  |        type: 'list/queryProjectRecord',
 | 
	
		
			
				|  |  |        payload: {
 | 
	
	
		
			
				|  | @@ -149,7 +147,7 @@ function List(props) {
 | 
	
		
			
				|  |  |      if (typeof item === 'object') {
 | 
	
		
			
				|  |  |        localStorage.excelItem = JSON.stringify(item);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | -    router.push(`/home/detail/${item.project_id}/${item.template_id}?version_id=${item.version_id}`);
 | 
	
		
			
				|  |  | +    router.push(`/home/detail/${item.project_id}/${item.template_id}?excel_id=${item.id}`);
 | 
	
		
			
				|  |  |    };
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    // const getLoading = () => {
 | 
	
	
		
			
				|  | @@ -159,7 +157,7 @@ function List(props) {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    const onCommit = async (values, callback) => {
 | 
	
		
			
				|  |  |      setCommitLoading(true);
 | 
	
		
			
				|  |  | -    let sheets = await queryRecordSheet({gridKey: version.id, 'JWT-TOKEN': token});
 | 
	
		
			
				|  |  | +    let sheets = await queryRecordSheet({ gridKey: version.id, 'JWT-TOKEN': token });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      let params = {
 | 
	
		
			
				|  |  |        ...values,
 | 
	
	
		
			
				|  | @@ -170,7 +168,7 @@ function List(props) {
 | 
	
		
			
				|  |  |        payload: params,
 | 
	
		
			
				|  |  |        callback: async newVersion => {
 | 
	
		
			
				|  |  |          // 更新flow流程图
 | 
	
		
			
				|  |  | -        const data = await queryBoomFlowDetail({id: newVersion.template_id});
 | 
	
		
			
				|  |  | +        const data = await queryBoomFlowDetail({ id: newVersion.template_id });
 | 
	
		
			
				|  |  |          // console.log(data);
 | 
	
		
			
				|  |  |          setFlowDetail(data);
 | 
	
		
			
				|  |  |          setCommitLoading(false);
 | 
	
	
		
			
				|  | @@ -193,7 +191,7 @@ function List(props) {
 | 
	
		
			
				|  |  |          const res = await queryDelPurchaseExcel(data);
 | 
	
		
			
				|  |  |          if (res.code == 200) {
 | 
	
		
			
				|  |  |            message.success('删除成功');
 | 
	
		
			
				|  |  | -          const data = await queryBoomFlowDetail({id: version.template_id});
 | 
	
		
			
				|  |  | +          const data = await queryBoomFlowDetail({ id: version.template_id });
 | 
	
		
			
				|  |  |            console.log(data);
 | 
	
		
			
				|  |  |            setFlowDetail(data);
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -206,18 +204,18 @@ function List(props) {
 | 
	
		
			
				|  |  |        <Form
 | 
	
		
			
				|  |  |          form={form}
 | 
	
		
			
				|  |  |          layout="inline"
 | 
	
		
			
				|  |  | -        style={{marginBottom: 20}}
 | 
	
		
			
				|  |  | -        onFinish={filter => queryList({...filter, currentPage: 1})}
 | 
	
		
			
				|  |  | +        style={{ marginBottom: 20 }}
 | 
	
		
			
				|  |  | +        onFinish={filter => queryList({ ...filter, currentPage: 1 })}
 | 
	
		
			
				|  |  |        >
 | 
	
		
			
				|  |  |          <Form.Item label="流程名称" name="name">
 | 
	
		
			
				|  |  | -          <Input/>
 | 
	
		
			
				|  |  | +          <Input />
 | 
	
		
			
				|  |  |          </Form.Item>
 | 
	
		
			
				|  |  |          <Form.Item label="项目编号" name="project_full_code">
 | 
	
		
			
				|  |  | -          <Input/>
 | 
	
		
			
				|  |  | +          <Input />
 | 
	
		
			
				|  |  |          </Form.Item>
 | 
	
		
			
				|  |  |          <Form.Item label="所属项目" name="project_id">
 | 
	
		
			
				|  |  |            <Select
 | 
	
		
			
				|  |  | -            style={{width: 200}}
 | 
	
		
			
				|  |  | +            style={{ width: 200 }}
 | 
	
		
			
				|  |  |              showSearch
 | 
	
		
			
				|  |  |              allowClear
 | 
	
		
			
				|  |  |              options={project.list.map(item => ({
 | 
	
	
		
			
				|  | @@ -292,7 +290,7 @@ function List(props) {
 | 
	
		
			
				|  |  |    );
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -export default connect(({list, loading, user}) => ({
 | 
	
		
			
				|  |  | +export default connect(({ list, loading, user }) => ({
 | 
	
		
			
				|  |  |    excel: list.excel,
 | 
	
		
			
				|  |  |    versionList: list.versionList,
 | 
	
		
			
				|  |  |    project: list.project,
 |