3.10 工程代码同步master
This commit is contained in:
@ -1,65 +1,263 @@
|
||||
import { Button, Table, Popconfirm} from 'antd';
|
||||
import { getRoomId} from '@/utils/session';
|
||||
import { getInfId, getInfList, upDataid } from './service';
|
||||
import { Descriptions, Popconfirm, Button, message, Modal, Spin } from 'antd';
|
||||
import { getProMethod, getRoomId, getSessionRoleData } from '@/utils/session';
|
||||
import { baseFinalSubmit, getDevidedData, getInfId, getInfList, saveLeaderId } from './service';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import ProTable, { ProColumns } from '@ant-design/pro-table';
|
||||
import ReviewDevided from '@/pages/BidEvaluation/components/ReviewDevided';
|
||||
import { getRoomDataById } from '@/services/common';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons';
|
||||
|
||||
/**
|
||||
* 评审室内页-基本信息
|
||||
* @author wuxianhui
|
||||
* 2021.9.14 zhoujianlong 评审分工和选择组长移入此页+页面改造
|
||||
* @returns
|
||||
*/
|
||||
|
||||
const Index: React.FC<{}> = () => {
|
||||
const { confirm } = Modal;
|
||||
|
||||
const [data, setData] = useState<any>([]);
|
||||
//存储评委会成员数据
|
||||
const [tableData, setTableData] = useState<any[]>([]);
|
||||
//存储基本信息数据
|
||||
const [data2, setData2] = useState<any>({});
|
||||
// const InfId2 = getSessionUserData().userId;
|
||||
const InfId = getRoomId();
|
||||
//loading
|
||||
const [loading, setLoading] = useState<boolean>(false);
|
||||
//评审分工modal visible
|
||||
const [rateVisible, setRateVisible] = useState<boolean>(false);
|
||||
//评审室开启状态 1-已确认配置分工及组长 0-未配置 null-旧数据无值
|
||||
const [juryConfigStatus, setJuryConfigStatus] = useState<number>(1);
|
||||
//评审分工 table data
|
||||
const [dividedTableData, setDividedTableData] = useState<any[]>([])
|
||||
//获取采购方式
|
||||
const MethodDict = getProMethod()
|
||||
//评审室id
|
||||
const InfId: any = getRoomId();
|
||||
//获取登录人角色
|
||||
const roleName = getSessionRoleData().roleCode
|
||||
//显示字段名称
|
||||
let sectionName = "采购包"
|
||||
//显示字段类型
|
||||
let sectionType = "评审"
|
||||
//初始化字段叫法
|
||||
if (MethodDict == "procurement_mode_1" || MethodDict == "procurement_mode_2") {
|
||||
sectionName = "标段";
|
||||
sectionType = "评标";
|
||||
} else if (MethodDict == "procurement_mode_5" || MethodDict == "procurement_mode_6") {
|
||||
if (roleName == "ebtp-agency-project-manager" || roleName == "ebtp-purchase") {
|
||||
sectionType = "谈判";
|
||||
}
|
||||
} else if (MethodDict == "procurement_mode_4") {
|
||||
sectionName = "包件";
|
||||
}
|
||||
|
||||
function resetApi () {
|
||||
getInfId( InfId ).then(res=>{
|
||||
if(res.code == 200) {
|
||||
if(res.data == undefined) {} else {
|
||||
async function resetApi() {
|
||||
//获取基本信息
|
||||
await getInfId(InfId).then(res => {
|
||||
if (res.code == 200) {
|
||||
if (res.data == undefined) { } else {
|
||||
setData2(res.data)
|
||||
}
|
||||
}
|
||||
})
|
||||
getInfList( InfId ).then(res=>{
|
||||
if(res.code == 200) {
|
||||
if(res.data == undefined) {} else {
|
||||
setData(res.data);
|
||||
console.log(res.data)
|
||||
}
|
||||
//获取评委会信息
|
||||
if (roleName == "ebtp-agency-project-manager" || roleName == "ebtp-purchase") {
|
||||
await getTableData(InfId)
|
||||
}
|
||||
//获取状态
|
||||
await getRoomDataById(InfId).then(res => {
|
||||
if (res?.code == 200) {
|
||||
setJuryConfigStatus(res?.data?.juryConfigStatus)
|
||||
}
|
||||
|
||||
})
|
||||
//获取评审分工
|
||||
await getReviewDevided();
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
resetApi();
|
||||
}, []);
|
||||
|
||||
|
||||
const columns: any[] = [
|
||||
//获取评审分工table data数据
|
||||
const getReviewDevided = async () => {
|
||||
await getDevidedData(InfId).then((response) => {
|
||||
if (response?.code == 200) {
|
||||
const data = response?.data
|
||||
const tableData = [
|
||||
{
|
||||
id: 1,
|
||||
func: '评审分工',
|
||||
status: false //状态字段 true-已编辑 false-未编辑
|
||||
}
|
||||
]
|
||||
//判断数据是否为空
|
||||
if (data[0].subCategoryList[0].divideMap != null) {
|
||||
tableData[0].status = true
|
||||
}
|
||||
setDividedTableData(tableData)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//点击设置组长按钮保存
|
||||
const saveSet = async (params: any) => {
|
||||
setLoading(true);
|
||||
await saveLeaderId(params?.id).then((res) => {
|
||||
if (res?.code == 200) {
|
||||
message.success('操作成功');
|
||||
getTableData(InfId);
|
||||
}
|
||||
}).finally(() => {
|
||||
setLoading(false);
|
||||
});
|
||||
};
|
||||
|
||||
//获取评委会成员列表数据
|
||||
const getTableData = async (id: any) => {
|
||||
setLoading(true);
|
||||
await getInfList(id).then((res) => {
|
||||
if (res?.code == 200) {
|
||||
setTableData(res?.data);
|
||||
}
|
||||
}).finally(() => {
|
||||
setLoading(false);
|
||||
});
|
||||
};
|
||||
|
||||
//右下角提交按钮触发
|
||||
const onSubmit = () => {
|
||||
confirm({
|
||||
title: `确定要开始${sectionType}吗?`,
|
||||
content: <span style={{ color: '#b30000' }}>提示:开始{sectionType}后无法修改评审分工和选择组长</span>,
|
||||
icon: <ExclamationCircleOutlined />,
|
||||
centered: true,
|
||||
okText: '确定',
|
||||
cancelText: '取消',
|
||||
async onOk() {
|
||||
setLoading(true)
|
||||
await baseFinalSubmit(InfId).then(res => {
|
||||
if (res?.code == 200 && res?.success == true) {
|
||||
message.success("操作成功");
|
||||
}
|
||||
}).finally(async () => {
|
||||
await resetApi();
|
||||
setLoading(false)
|
||||
})
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
const columns: ProColumns<any>[] = [
|
||||
{
|
||||
title: '评委会成员',
|
||||
dataIndex: 'name',
|
||||
width: '25%'
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
width: '25%',
|
||||
render: (value, record) => (record.status == 1 ? "未签到" : record.status == 2 ? "已签到" : "已申请回避"),
|
||||
},
|
||||
{
|
||||
title: '身份',
|
||||
width: '25%',
|
||||
render: (_, record) => (record.duty == 2 ? '组长' : '组员'),
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: '25%',
|
||||
render: (_, record) => {
|
||||
return record.duty == 1 ? (
|
||||
<Popconfirm
|
||||
title={`确认将${record?.name}设为组长?`}
|
||||
okText="确认"
|
||||
cancelText="返回"
|
||||
onConfirm={() => saveSet(record)}
|
||||
>
|
||||
<a type="text" key="1">
|
||||
设为组长
|
||||
</a>
|
||||
</Popconfirm>
|
||||
) : null;
|
||||
},
|
||||
hideInTable: juryConfigStatus == 1
|
||||
},
|
||||
];
|
||||
|
||||
const dividedColumns: ProColumns<any>[] = [
|
||||
{
|
||||
title: '功能',
|
||||
dataIndex: 'func',
|
||||
width: '25%',
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
width: '25%',
|
||||
render: (value: any) => (value && juryConfigStatus == 1) ? '分工完成' : value ? '已编辑' : '未编辑'
|
||||
},
|
||||
{
|
||||
title: '身份',
|
||||
dataIndex: 'duty',
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
title: '操作',
|
||||
width: '25%',
|
||||
render: () => {
|
||||
return (
|
||||
<a key='options' onClick={() => setRateVisible(true)}>评审分工</a>
|
||||
)
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
useEffect(() => {
|
||||
resetApi();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="projectsInvolved" style={{backgroundColor: '#ffffff', padding:'20px'}}>
|
||||
<h3 style={{fontSize: '16px',fontWeight: '600', color: '#980000'}}>标段信息:</h3>
|
||||
<p>标段名称:{data2.sectionName}</p>
|
||||
<p>评审次数:{data2.roomSort}</p>
|
||||
<p>评标时间:{data2.openTime}</p>
|
||||
<h3 style={{fontSize: '16px', fontWeight: '600', color: '#980000'}}>评委会信息</h3>
|
||||
<div>
|
||||
<Table pagination={false} columns={columns} dataSource={data}/>
|
||||
</div>
|
||||
<div className="projectsInvolved baseinf-top" style={{ height: window.innerHeight - 107 }}>
|
||||
<Spin spinning={loading} delay={300}>
|
||||
<h3 className="first-title">{sectionName}信息</h3>
|
||||
<Descriptions column={2}>
|
||||
<Descriptions.Item label={`${sectionName}名称`}>{data2.sectionName}</Descriptions.Item>
|
||||
<Descriptions.Item label={`${sectionType}次数`}>{data2.reviewMark == 1 ? data2.roomSort + data2.reviewSort : data2.roomSort}</Descriptions.Item>
|
||||
<Descriptions.Item label={`${sectionType}时间`}>{data2.openTime}</Descriptions.Item>
|
||||
</Descriptions>
|
||||
{roleName == "ebtp-agency-project-manager" || roleName == "ebtp-purchase" ? (
|
||||
<>
|
||||
<h3 className="first-title">评委会信息</h3>
|
||||
<div>
|
||||
<ProTable
|
||||
pagination={false}
|
||||
columns={columns}
|
||||
dataSource={tableData}
|
||||
size="small"
|
||||
options={false}
|
||||
search={false}
|
||||
rowKey="id"
|
||||
/>
|
||||
</div>
|
||||
<h3 className="first-title" style={{ marginTop: '8px' }}>评审分工信息</h3>
|
||||
<div>
|
||||
{/* <Button type="primary" onClick={() => setRateVisible(true)}>评审分工</Button> */}
|
||||
<ProTable
|
||||
pagination={false}
|
||||
columns={dividedColumns}
|
||||
dataSource={dividedTableData}
|
||||
size="small"
|
||||
options={false}
|
||||
search={false}
|
||||
rowKey="id"
|
||||
/>
|
||||
</div>
|
||||
<div className="baseinf-bottom-btn">
|
||||
<Button type="primary" size='large' disabled={juryConfigStatus == 1} onClick={() => onSubmit()}>开始{sectionType}</Button>
|
||||
</div>
|
||||
<ReviewDevided title="评审分工"
|
||||
modalVisible={rateVisible}
|
||||
onCancel={async () => {
|
||||
setRateVisible(false)
|
||||
await getReviewDevided();
|
||||
}}
|
||||
roomId={InfId}
|
||||
status={juryConfigStatus}
|
||||
/>
|
||||
</>
|
||||
) : null}
|
||||
</Spin>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
@ -1,23 +1,53 @@
|
||||
import request from "@/utils/request";
|
||||
import request from '@/utils/request';
|
||||
|
||||
/**
|
||||
* 获取基本信息数据
|
||||
* @param data
|
||||
*/
|
||||
export async function getInfId(data: any) {
|
||||
return request(`/api/biz-service-ebtp-process/v1/bizassessroom/info/${data}`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export async function getInfList(data: any) {
|
||||
return request(`/api/biz-service-ebtp-rsms/v1/jury/member/info/${data}`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
}
|
||||
return request(`/api/biz-service-ebtp-process/v1/bizassessroom/info/${data}`, {
|
||||
method: 'GET',
|
||||
params: {},
|
||||
});
|
||||
}
|
||||
|
||||
export async function upDataid(data: any) {
|
||||
return request(`/api/biz-service-ebtp-rsms/v1/jury/member/chooseLeader/?id=${data}`, {
|
||||
method: 'PUT',
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 获取评委会成员列表数据
|
||||
* @param data
|
||||
*/
|
||||
export async function getInfList(data: any) {
|
||||
return request(`/api/biz-service-ebtp-rsms/v1/jury/member/info/${data}`, {
|
||||
method: 'GET',
|
||||
params: {},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置组长
|
||||
* @param param
|
||||
*/
|
||||
export async function saveLeaderId(param: any) {
|
||||
return request(`/api/biz-service-ebtp-rsms/v1/jury/member/chooseLeader/?id=${param}`, {
|
||||
method: 'PUT',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 基本信息页最终提交
|
||||
* @param params
|
||||
*/
|
||||
export async function baseFinalSubmit(params: any) {
|
||||
return request(`/api/biz-service-ebtp-process/v1/bizassessroom/finally/openRoom/${params}`, {
|
||||
method: 'POST',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过评审室id查询评审分工
|
||||
* @param param
|
||||
*/
|
||||
export async function getDevidedData(param: any) {
|
||||
return request(`/api/biz-service-ebtp-rsms/v1/jury/divide/findListByRoomId/` + param, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user