|
@@ -1,5 +1,16 @@
|
|
|
import React, { useState, useEffect } from 'react';
|
|
|
-import { Table, Button, Form, Select, Divider, Modal, Popover, Input, Checkbox } from 'antd';
|
|
|
+import {
|
|
|
+ Table,
|
|
|
+ Button,
|
|
|
+ Form,
|
|
|
+ Select,
|
|
|
+ Divider,
|
|
|
+ Modal,
|
|
|
+ Popover,
|
|
|
+ Input,
|
|
|
+ Checkbox,
|
|
|
+ message,
|
|
|
+} from 'antd';
|
|
|
import moment from 'moment';
|
|
|
import router from 'umi/router';
|
|
|
import styles from './List.less';
|
|
@@ -11,6 +22,8 @@ import QualityOperateModal from './QualityOperateModal';
|
|
|
import BudgetModal from './BudgetModal';
|
|
|
import ModifyManagerModal from './ModifyManagerModal';
|
|
|
import { connect } from 'dva';
|
|
|
+import FirmModal from './ManufacturerModal';
|
|
|
+import { queryCreaterList, saveMfr } from '@/services/manufacturer';
|
|
|
|
|
|
const { Option } = Select;
|
|
|
//状态
|
|
@@ -34,6 +47,7 @@ function List(props) {
|
|
|
depUserTree,
|
|
|
member,
|
|
|
budget,
|
|
|
+ supplierList,
|
|
|
} = props;
|
|
|
const [form] = Form.useForm();
|
|
|
const [addVisible, setAddVisible] = useState(false);
|
|
@@ -46,6 +60,7 @@ function List(props) {
|
|
|
const [currentItem, setCurrentItem] = useState({});
|
|
|
const [qualityOperate, setQualityOperate] = useState(0);
|
|
|
const [modifyManagerVisible, setModifyManagerVisible] = useState(false);
|
|
|
+ const [addFirmVisible, setAddFirmVisible] = useState(false);
|
|
|
const columns = [
|
|
|
{
|
|
|
title: '项目编号',
|
|
@@ -56,10 +71,39 @@ function List(props) {
|
|
|
dataIndex: 'project_name',
|
|
|
},
|
|
|
{
|
|
|
- title: '分类',
|
|
|
- dataIndex: 'TypeInfo',
|
|
|
- render: TypeInfo => (TypeInfo ? `${TypeInfo.name}(${TypeInfo.code})` : '-'),
|
|
|
+ title: '客户',
|
|
|
+ dataIndex: 'supplier_name',
|
|
|
+ render: () => '-',
|
|
|
},
|
|
|
+ {
|
|
|
+ title: '规模',
|
|
|
+ render: () => '-',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '技术',
|
|
|
+ render: () => '-',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '项目种类(前分类)',
|
|
|
+ render: () => '-',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '项目阶段(前流程)',
|
|
|
+ render: () => '-',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '现阶段状态(前状态)',
|
|
|
+ render: () => '-',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '现阶段状态时间(月)',
|
|
|
+ render: () => '-',
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // title: '分类',
|
|
|
+ // dataIndex: 'TypeInfo',
|
|
|
+ // render: TypeInfo => (TypeInfo ? `${TypeInfo.name}(${TypeInfo.code})` : '-'),
|
|
|
+ // },
|
|
|
/*
|
|
|
{
|
|
|
title: '名称',
|
|
@@ -81,28 +125,28 @@ function List(props) {
|
|
|
render: version => `${version}期`,
|
|
|
},
|
|
|
*/
|
|
|
- {
|
|
|
- title: '流程',
|
|
|
- dataIndex: ['FlowInfo', 'name'],
|
|
|
- },
|
|
|
- {
|
|
|
- title: '状态',
|
|
|
- dataIndex: 'project_status',
|
|
|
- render: project_status => {
|
|
|
- // return project_status === 0 ? <>售前</> : <>转执行</>;
|
|
|
- //若添加其他状态则启用以下switch case:
|
|
|
- switch (project_status) {
|
|
|
- case 0:
|
|
|
- return <>售前</>;
|
|
|
- case 1:
|
|
|
- return <>转执行</>;
|
|
|
- case 2:
|
|
|
- return <>转运营</>;
|
|
|
- case 3:
|
|
|
- return <>转质保</>;
|
|
|
- }
|
|
|
- },
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // title: '流程',
|
|
|
+ // dataIndex: ['FlowInfo', 'name'],
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // title: '状态',
|
|
|
+ // dataIndex: 'project_status',
|
|
|
+ // render: project_status => {
|
|
|
+ // // return project_status === 0 ? <>售前</> : <>转执行</>;
|
|
|
+ // //若添加其他状态则启用以下switch case:
|
|
|
+ // switch (project_status) {
|
|
|
+ // case 0:
|
|
|
+ // return <>售前</>;
|
|
|
+ // case 1:
|
|
|
+ // return <>转执行</>;
|
|
|
+ // case 2:
|
|
|
+ // return <>转运营</>;
|
|
|
+ // case 3:
|
|
|
+ // return <>转质保</>;
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // },
|
|
|
{
|
|
|
title: '节点',
|
|
|
dataIndex: 'NodeInfo',
|
|
@@ -150,10 +194,31 @@ function List(props) {
|
|
|
},
|
|
|
{
|
|
|
title: '操作',
|
|
|
- render: record => renderEditBtns(record),
|
|
|
+ render: record => renderEditBtns2(record),
|
|
|
},
|
|
|
];
|
|
|
|
|
|
+ const renderEditBtns = record => {
|
|
|
+ return (
|
|
|
+ <>
|
|
|
+ <a
|
|
|
+ onClick={() => {
|
|
|
+ setCurrentItem(record);
|
|
|
+ setDetailVisible(true);
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 项目详情
|
|
|
+ </a>
|
|
|
+ <Divider type="vertical" />
|
|
|
+ <a onClick={() => {}}>项目编辑</a>
|
|
|
+ <Divider type="vertical" />
|
|
|
+ <a onClick={() => {}}>项目日志</a>
|
|
|
+ <Divider type="vertical" />
|
|
|
+ <a onClick={() => {}}>设置人日预算</a>
|
|
|
+ </>
|
|
|
+ );
|
|
|
+ };
|
|
|
+
|
|
|
const handleSearch = () => {
|
|
|
const { projectName, projectCode, projectStatus } = form.getFieldsValue();
|
|
|
let params = {};
|
|
@@ -274,7 +339,7 @@ function List(props) {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
- const renderEditBtns = record => {
|
|
|
+ const renderEditBtns2 = record => {
|
|
|
let dividerPush = (item, list) => {
|
|
|
if (list.length === 0) list.push(item);
|
|
|
else {
|
|
@@ -487,8 +552,29 @@ function List(props) {
|
|
|
dispatch({
|
|
|
type: 'approval/fetchDepV2',
|
|
|
});
|
|
|
+ dispatch({
|
|
|
+ type: 'approval/querySupplierList',
|
|
|
+ payload: { project_id: 1, is_super: true, page_size: 999 },
|
|
|
+ });
|
|
|
}, []);
|
|
|
|
|
|
+ const handlerSaveFirm = async fieldsValue => {
|
|
|
+ const res = await saveMfr({
|
|
|
+ ...fieldsValue,
|
|
|
+ project_id: 1,
|
|
|
+ created_by: currentUser?.CName,
|
|
|
+ });
|
|
|
+ if (res.code == 200) {
|
|
|
+ message.success('新增成功');
|
|
|
+ setAddFirmVisible(false);
|
|
|
+ dispatch({
|
|
|
+ type: 'approval/querySupplierList',
|
|
|
+ payload: { project_id: 1, is_super: true, page_size: 999 },
|
|
|
+ });
|
|
|
+ }
|
|
|
+ console.log(res);
|
|
|
+ };
|
|
|
+
|
|
|
return (
|
|
|
<div>
|
|
|
{renderSearch()}
|
|
@@ -514,6 +600,7 @@ function List(props) {
|
|
|
onChange={queryList}
|
|
|
/>
|
|
|
<ApprovalModal
|
|
|
+ supplierList={supplierList}
|
|
|
currentUser={currentUser}
|
|
|
depUserTree={depUserTree}
|
|
|
loading={loading}
|
|
@@ -525,6 +612,7 @@ function List(props) {
|
|
|
data={currentItem}
|
|
|
total={data.pagination.total}
|
|
|
onClose={() => setAddVisible(false)}
|
|
|
+ onAddFirm={() => setAddFirmVisible(true)}
|
|
|
/>
|
|
|
<DetailModal
|
|
|
industryList={industryList}
|
|
@@ -542,14 +630,14 @@ function List(props) {
|
|
|
onOk={() => setExecutionVisible(false)}
|
|
|
onClose={() => setExecutionVisible(false)}
|
|
|
/>
|
|
|
- <MemberModal
|
|
|
+ {/* <MemberModal
|
|
|
depUserTree={depUserTree}
|
|
|
loading={loading}
|
|
|
visible={memberVisible}
|
|
|
onClose={() => setMemberVisible(false)}
|
|
|
currentItem={currentItem}
|
|
|
dataSource={member}
|
|
|
- />
|
|
|
+ /> */}
|
|
|
<QualityOperateModal
|
|
|
depUserTree={depUserTree}
|
|
|
loading={loading}
|
|
@@ -576,6 +664,12 @@ function List(props) {
|
|
|
dataSource={member}
|
|
|
onOk={() => setModifyManagerVisible(false)}
|
|
|
/>
|
|
|
+ <FirmModal
|
|
|
+ // projectId={projectId}
|
|
|
+ visible={addFirmVisible}
|
|
|
+ onCancel={() => setAddFirmVisible(false)}
|
|
|
+ onOk={handlerSaveFirm}
|
|
|
+ />
|
|
|
</div>
|
|
|
);
|
|
|
}
|
|
@@ -591,4 +685,5 @@ export default connect(({ approval, user, loading }) => ({
|
|
|
depUserTree: approval.depUserTree,
|
|
|
member: approval.member,
|
|
|
budget: approval.budget,
|
|
|
+ supplierList: approval.supplierList,
|
|
|
}))(List);
|