更新版本库
This commit is contained in:
@ -3,9 +3,11 @@ import { Button, Tabs, Form, Input, Modal, Space, Checkbox, message, PageHeader
|
||||
import ProTable, { ActionType } from '@ant-design/pro-table';
|
||||
import { queryingPagingData } from '@/utils/PageUtils';
|
||||
import { personListItem } from './data';
|
||||
import { getSection, exitProject, changePerson } from './service';
|
||||
import { getSection, exitProject, changePerson, getProject, getOther } from './service';
|
||||
import '@/assets/ld_style.less';
|
||||
import { Link } from 'umi';
|
||||
import { getDicData } from '@/utils/session';
|
||||
import { proTableValueEnum } from '@/utils/CommonUtils';
|
||||
|
||||
const { TabPane } = Tabs;
|
||||
const { Search } = Input;
|
||||
@ -45,7 +47,7 @@ const plainOptions: any[] = [];
|
||||
const defaultCheckedList: any[] = [];
|
||||
|
||||
const Index: React.FC<{}> = () => {
|
||||
const [personList] = useState(personData); // 负责人列表
|
||||
const [personList] = useState<any>([personData]); // 负责人列表
|
||||
const [plainList, setPlainList] = useState(plainOptions); // 选择标段
|
||||
const [quitVisible, setQuitVisible] = useState<boolean>(false); // 退出项目弹窗按钮
|
||||
const [personVisible, setPersonVisible] = useState<boolean>(false); // 修改负责人弹窗按钮
|
||||
@ -55,6 +57,10 @@ const Index: React.FC<{}> = () => {
|
||||
const [sectionsVal, setSectionsVal] = useState<any>([]); // 选中数组id
|
||||
const [quitForm] = Form.useForm();
|
||||
|
||||
//获取字典
|
||||
const getDict: any = getDicData();
|
||||
const dictData = JSON.parse(getDict);
|
||||
|
||||
const actionRef = useRef<ActionType>();
|
||||
const personColumns: any[] = [ // 修改项目负责人
|
||||
{
|
||||
@ -99,7 +105,8 @@ const Index: React.FC<{}> = () => {
|
||||
{
|
||||
title: '采购方式',
|
||||
dataIndex: 'bidMethodDict',
|
||||
search: false
|
||||
search: false,
|
||||
valueEnum: proTableValueEnum(dictData['procurement_mode=entrust'])
|
||||
},
|
||||
{
|
||||
title: '项目名称',
|
||||
@ -118,12 +125,7 @@ const Index: React.FC<{}> = () => {
|
||||
{
|
||||
title: '采购类型',
|
||||
dataIndex: 'procurementType',
|
||||
valueEnum: {
|
||||
1: { text: '货物', status: 1 },
|
||||
2: { text: '工程', status: 2 },
|
||||
3: { text: '服务', status: 3 },
|
||||
4: { text: '其他', status: 4 },
|
||||
},
|
||||
valueEnum: proTableValueEnum(dictData['procurement_type=entrust'])
|
||||
},
|
||||
{
|
||||
title: '所属区域',
|
||||
@ -135,7 +137,7 @@ const Index: React.FC<{}> = () => {
|
||||
width: 100,
|
||||
render: (text: any, record: any) => (
|
||||
<Space>
|
||||
<Button type="link" danger><Link to={`/IParticipate?id=${record.id}`}>项目跟进</Link></Button>
|
||||
<Button type="link" onClick={() => saveProject(record)} danger><Link to={`/ProjectLayout/Tender/supplier/IParticipate?id=${record.id}`}>项目跟进</Link></Button>
|
||||
<Button type="link" danger onClick={() => setPersonVisible(true)} >修改负责人</Button>
|
||||
<Button type="link" danger onClick={() => quitProject(record.id)} >退出项目</Button>
|
||||
</Space>
|
||||
@ -157,22 +159,13 @@ const Index: React.FC<{}> = () => {
|
||||
title: '采购类型',
|
||||
dataIndex: 'procurementTypeDict',
|
||||
search: false,
|
||||
render: (_: any, record: any) => {
|
||||
if (record.procurementTypeDict == 'procurement_type_1') {
|
||||
return (<>货物</>)
|
||||
} else if (record.procurementTypeDict == 'procurement_type_2') {
|
||||
return (<>工程</>)
|
||||
} else if (record.procurementTypeDict == 'procurement_type_3') {
|
||||
return (<>服务</>)
|
||||
} else {
|
||||
return (<>其他</>)
|
||||
}
|
||||
}
|
||||
valueEnum: proTableValueEnum(dictData['procurement_type=entrust'])
|
||||
},
|
||||
{
|
||||
title: '采购方式',
|
||||
dataIndex: 'bidMethodDict',
|
||||
search: false
|
||||
search: false,
|
||||
valueEnum: proTableValueEnum(dictData['procurement_mode=entrust'])
|
||||
},
|
||||
{
|
||||
title: '已报名标段名称',
|
||||
@ -191,6 +184,10 @@ const Index: React.FC<{}> = () => {
|
||||
},
|
||||
];
|
||||
|
||||
const saveProject = (val: any) => { // 点击项目跟进存储项目信息
|
||||
sessionStorage.setItem('projectData', JSON.stringify(val));
|
||||
}
|
||||
|
||||
const onFinish = (val: any) => { // 校验成功确认提交
|
||||
let date = {
|
||||
packageIdList: val.checkbox,
|
||||
@ -226,7 +223,7 @@ const Index: React.FC<{}> = () => {
|
||||
const quitProject = (id: any) => { // 退出项目
|
||||
setQuitVisible(true)
|
||||
quitForm.resetFields()
|
||||
getSection({ projectId: id }).then((res: any) => {
|
||||
getSection(id).then((res: any) => {
|
||||
let secVals = [];
|
||||
if (res.success) {
|
||||
secVals = res.data.map((item: any) => { return item.id })
|
||||
@ -257,7 +254,26 @@ const Index: React.FC<{}> = () => {
|
||||
<TabPane tab="我参与的项目" key="1">
|
||||
<ProTable
|
||||
columns={columns}
|
||||
request={params => queryingPagingData('/api/biz-service-ebtp-tender/v1/supplier_register/get_register_project', 'post', params)}
|
||||
// request={params => queryingPagingData('/api/biz-service-ebtp-tender/v1/supplier_register/get_register_project', 'post', params)}
|
||||
request={async (params) =>
|
||||
await getProject(params).then((res) => {
|
||||
if (res.code == 200) {
|
||||
let data = res.data;
|
||||
return Promise.resolve({
|
||||
data: data.records,
|
||||
success: res.success,
|
||||
total: res.data.total,
|
||||
current: res.data.current,
|
||||
});
|
||||
}
|
||||
return Promise.resolve({
|
||||
data: [],
|
||||
success: false,
|
||||
total: 0,
|
||||
current: 1,
|
||||
});
|
||||
})
|
||||
}
|
||||
pagination={{ defaultPageSize: 10 }}//默认显示条数
|
||||
toolBarRender={false}
|
||||
bordered
|
||||
@ -336,7 +352,26 @@ const Index: React.FC<{}> = () => {
|
||||
<TabPane tab="公司其他项目" key="2">
|
||||
<ProTable
|
||||
columns={otherColumns}
|
||||
request={params => queryingPagingData('/api/biz-service-ebtp-tender/v1/supplier_register/company_other_project', 'post', params)}
|
||||
// request={params => queryingPagingData('/api/biz-service-ebtp-tender/v1/supplier_register/company_other_project', 'post', params)}
|
||||
request={async (params) =>
|
||||
await getOther(params).then((res) => {
|
||||
if (res.code == 200) {
|
||||
let data = res.data;
|
||||
return Promise.resolve({
|
||||
data: data.records,
|
||||
success: res.success,
|
||||
total: res.data.total,
|
||||
current: res.data.current,
|
||||
});
|
||||
}
|
||||
return Promise.resolve({
|
||||
data: [],
|
||||
success: false,
|
||||
total: 0,
|
||||
current: 1,
|
||||
});
|
||||
})
|
||||
}
|
||||
pagination={{ defaultPageSize: 10 }}//默认显示条数
|
||||
toolBarRender={false}
|
||||
bordered
|
||||
|
Reference in New Issue
Block a user