import React, { useState, useEffect, useMemo } from 'react';
import { Table, Button, Form, Divider, Modal, Popover, Input, Select } from 'antd';
import moment from 'moment';
import router from 'umi/router';
import styles from './List.less';
import AuthModal from './AuthModal';
import DetailModal from './DetailModal';
import RejectModal from '../WorkingHours/RejectModal';
import { connect } from 'dva';
const { Option } = Select;
//状态
const STATUS = [
{
value: 0,
label: '售前',
},
{
value: 1,
label: '转执行',
},
{
value: 2,
label: '转运营',
},
{
value: 3,
label: '转质保',
},
];
function Auth(props) {
const { industryList, typeList, data, flowList, currentUser, depRole, dispatch, loading } = props;
const [form] = Form.useForm();
const [visible, setVisible] = useState(false);
const [detailVisible, setDetailVisible] = useState(false);
const [rejectVisible, setRejectVisible] = useState(false);
const [currentItem, setCurrentItem] = useState({});
const columns = [
{
title: '项目编号',
dataIndex: 'project_full_code',
},
{
title: '项目名称',
dataIndex: 'project_name',
},
{
title: '分类',
dataIndex: 'TypeInfo',
render: TypeInfo => (TypeInfo ? `${TypeInfo.name}(${TypeInfo.code})` : '-'),
},
/*
{
title: '名称',
dataIndex: 'name',
},
{
title: '行业',
dataIndex: 'IndustryInfo',
render: IndustryInfo => `${IndustryInfo.name}(${IndustryInfo.code})`,
},
{
title: '所在地',
dataIndex: 'location',
render: (location, record) => `${location}(${record.location_code})`,
},
{
title: '期数',
dataIndex: 'version',
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: 'NodeInfo',
render: (nodeInfo, item) => {
let statusDom;
switch (item.audit_status) {
case 0:
statusDom = '待提交';
break;
case 1:
statusDom = 审核中;
break;
case 2:
statusDom = (