|
@@ -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 router from 'umi/router';
|
|
import FlowModal from '../Detail/FlowModal';
|
|
import FlowModal from '../Detail/FlowModal';
|
|
import {
|
|
import {
|
|
@@ -10,13 +10,14 @@ import {
|
|
queryDelPurchaseExcel,
|
|
queryDelPurchaseExcel,
|
|
queryRecordSheet,
|
|
queryRecordSheet,
|
|
} from '@/services/boom';
|
|
} from '@/services/boom';
|
|
-import { getToken } from '@/utils/utils';
|
|
|
|
|
|
+import {getToken} from '@/utils/utils';
|
|
import ClassifyModal from './ClassifyModal';
|
|
import ClassifyModal from './ClassifyModal';
|
|
import VersionModal from './VersionModal';
|
|
import VersionModal from './VersionModal';
|
|
|
|
+
|
|
let token = getToken();
|
|
let token = getToken();
|
|
|
|
|
|
function List(props) {
|
|
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 [flowVisible, setFlowVisible] = useState(false);
|
|
const [version, setVersion] = useState({});
|
|
const [version, setVersion] = useState({});
|
|
const [versionVisible, setVersionVisible] = useState(false);
|
|
const [versionVisible, setVersionVisible] = useState(false);
|
|
@@ -57,11 +58,12 @@ function List(props) {
|
|
onClick={async () => {
|
|
onClick={async () => {
|
|
try {
|
|
try {
|
|
setClassifyLoading(true);
|
|
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);
|
|
setClassifyLoading(false);
|
|
- setData({ project_id: record.project_id, classify: data });
|
|
|
|
|
|
+ setData({project_id: record.project_id, classify: data});
|
|
setVisible(true);
|
|
setVisible(true);
|
|
- } catch (error) {}
|
|
|
|
|
|
+ } catch (error) {
|
|
|
|
+ }
|
|
}}
|
|
}}
|
|
>
|
|
>
|
|
分类权限
|
|
分类权限
|
|
@@ -72,7 +74,7 @@ function List(props) {
|
|
localStorage.excelId = record.id;
|
|
localStorage.excelId = record.id;
|
|
setLoading2(true);
|
|
setLoading2(true);
|
|
try {
|
|
try {
|
|
- const data = await queryBoomFlowDetail({ id: record.template_id });
|
|
|
|
|
|
+ const data = await queryBoomFlowDetail({id: record.template_id});
|
|
setFlowDetail(data);
|
|
setFlowDetail(data);
|
|
setVersion(record);
|
|
setVersion(record);
|
|
setFlowVisible(true);
|
|
setFlowVisible(true);
|
|
@@ -82,7 +84,8 @@ function List(props) {
|
|
project_id: record.project_id,
|
|
project_id: record.project_id,
|
|
},
|
|
},
|
|
});
|
|
});
|
|
- } catch (error) {}
|
|
|
|
|
|
+ } catch (error) {
|
|
|
|
+ }
|
|
setLoading2(false);
|
|
setLoading2(false);
|
|
// router.push(`/home/detail/${record.project_id}/${record.template_id}`);
|
|
// router.push(`/home/detail/${record.project_id}/${record.template_id}`);
|
|
}}
|
|
}}
|
|
@@ -103,7 +106,7 @@ function List(props) {
|
|
},
|
|
},
|
|
];
|
|
];
|
|
const queryList = filter => {
|
|
const queryList = filter => {
|
|
- filter = { ...filterRes.current, ...filter };
|
|
|
|
|
|
+ filter = {...filterRes.current, ...filter};
|
|
dispatch({
|
|
dispatch({
|
|
type: 'list/queryProjectRecord',
|
|
type: 'list/queryProjectRecord',
|
|
payload: {
|
|
payload: {
|
|
@@ -139,6 +142,7 @@ function List(props) {
|
|
}, []);
|
|
}, []);
|
|
|
|
|
|
const changeVersion = item => {
|
|
const changeVersion = item => {
|
|
|
|
+ console.log('***', item)
|
|
if (typeof item == 'object') {
|
|
if (typeof item == 'object') {
|
|
localStorage.excelItem = JSON.stringify(item);
|
|
localStorage.excelItem = JSON.stringify(item);
|
|
}
|
|
}
|
|
@@ -152,7 +156,7 @@ function List(props) {
|
|
|
|
|
|
const onCommit = async (values, callback) => {
|
|
const onCommit = async (values, callback) => {
|
|
setCommitLoading(true);
|
|
setCommitLoading(true);
|
|
- let sheets = await queryRecordSheet({ gridKey: version.id, 'JWT-TOKEN': token });
|
|
|
|
|
|
+ let sheets = await queryRecordSheet({gridKey: version.id, 'JWT-TOKEN': token});
|
|
|
|
|
|
let params = {
|
|
let params = {
|
|
...values,
|
|
...values,
|
|
@@ -163,7 +167,7 @@ function List(props) {
|
|
payload: params,
|
|
payload: params,
|
|
callback: async newVersion => {
|
|
callback: async newVersion => {
|
|
// 更新flow流程图
|
|
// 更新flow流程图
|
|
- const data = await queryBoomFlowDetail({ id: newVersion.template_id });
|
|
|
|
|
|
+ const data = await queryBoomFlowDetail({id: newVersion.template_id});
|
|
console.log(data);
|
|
console.log(data);
|
|
setFlowDetail(data);
|
|
setFlowDetail(data);
|
|
setCommitLoading(false);
|
|
setCommitLoading(false);
|
|
@@ -186,7 +190,7 @@ function List(props) {
|
|
const res = await queryDelPurchaseExcel(data);
|
|
const res = await queryDelPurchaseExcel(data);
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
message.success('删除成功');
|
|
message.success('删除成功');
|
|
- const data = await queryBoomFlowDetail({ id: version.template_id });
|
|
|
|
|
|
+ const data = await queryBoomFlowDetail({id: version.template_id});
|
|
console.log(data);
|
|
console.log(data);
|
|
setFlowDetail(data);
|
|
setFlowDetail(data);
|
|
}
|
|
}
|
|
@@ -199,15 +203,18 @@ function List(props) {
|
|
<Form
|
|
<Form
|
|
form={form}
|
|
form={form}
|
|
layout="inline"
|
|
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">
|
|
<Form.Item label="流程名称" name="name">
|
|
- <Input />
|
|
|
|
|
|
+ <Input/>
|
|
|
|
+ </Form.Item>
|
|
|
|
+ <Form.Item label="项目编号" name="project_full_code">
|
|
|
|
+ <Input/>
|
|
</Form.Item>
|
|
</Form.Item>
|
|
<Form.Item label="所属项目" name="project_id">
|
|
<Form.Item label="所属项目" name="project_id">
|
|
<Select
|
|
<Select
|
|
- style={{ width: 200 }}
|
|
|
|
|
|
+ style={{width: 200}}
|
|
showSearch
|
|
showSearch
|
|
allowClear
|
|
allowClear
|
|
options={project.list.map(item => ({
|
|
options={project.list.map(item => ({
|
|
@@ -219,6 +226,21 @@ function List(props) {
|
|
}
|
|
}
|
|
></Select>
|
|
></Select>
|
|
</Form.Item>
|
|
</Form.Item>
|
|
|
|
+ {/* 字段确定后展开 */}
|
|
|
|
+ {/* <Form.Item label="项目经理" name="project_id"> */}
|
|
|
|
+ {/* <Select */}
|
|
|
|
+ {/* style={{width: 200}} */}
|
|
|
|
+ {/* showSearch */}
|
|
|
|
+ {/* allowClear */}
|
|
|
|
+ {/* options={project.list.map(item => ({ */}
|
|
|
|
+ {/* label: item.project_name, */}
|
|
|
|
+ {/* value: item.id, */}
|
|
|
|
+ {/* }))} */}
|
|
|
|
+ {/* filterOption={(input, option) => */}
|
|
|
|
+ {/* (option?.label ?? '').toLowerCase().includes(input.toLowerCase()) */}
|
|
|
|
+ {/* } */}
|
|
|
|
+ {/* ></Select> */}
|
|
|
|
+ {/* </Form.Item> */}
|
|
<Form.Item>
|
|
<Form.Item>
|
|
<Button htmlType="submit" type="primary">
|
|
<Button htmlType="submit" type="primary">
|
|
查询
|
|
查询
|
|
@@ -267,7 +289,7 @@ function List(props) {
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
-export default connect(({ list, loading, user }) => ({
|
|
|
|
|
|
+export default connect(({list, loading, user}) => ({
|
|
excel: list.excel,
|
|
excel: list.excel,
|
|
versionList: list.versionList,
|
|
versionList: list.versionList,
|
|
project: list.project,
|
|
project: list.project,
|