更新版本库
This commit is contained in:
@ -2,6 +2,7 @@ import React, {PureComponent} from 'react';
|
||||
import {Divider,Button,Form,Card,Tabs,Table,Tooltip,Input,Select,Row,Col,message,Modal,Descriptions,Checkbox } from 'antd';
|
||||
import './index.less';
|
||||
import { connect } from "dva";
|
||||
import { history } from "umi"
|
||||
// import bookt from "../../assets/bookt.doc";
|
||||
|
||||
const FormItem=Form.Item;
|
||||
@ -16,14 +17,15 @@ class Jury extends PureComponent {
|
||||
state={
|
||||
pageNo:1,
|
||||
pageSize:10,
|
||||
tpId:1111111,
|
||||
tpId:'',
|
||||
ratevisible:false,
|
||||
room:[],
|
||||
bookflag:true
|
||||
bookflag:false,
|
||||
display:false,
|
||||
}
|
||||
componentDidMount(){
|
||||
// console.log(this.props.match.params.roomType)
|
||||
this.setState({
|
||||
tpId:1111111,
|
||||
bookflag:true
|
||||
})
|
||||
const { dispatch }=this.props;
|
||||
@ -31,8 +33,8 @@ class Jury extends PureComponent {
|
||||
const params={
|
||||
pageNo:1,
|
||||
pageSize:10,
|
||||
roomType:2,
|
||||
tpId:1111111,//项目id
|
||||
// roomType:this.props.match.params.roomType,
|
||||
// tpId: getProId(),//项目id
|
||||
checked:false
|
||||
}
|
||||
dispatch({
|
||||
@ -76,13 +78,31 @@ class Jury extends PureComponent {
|
||||
const params={
|
||||
roomId:record.id
|
||||
}
|
||||
const roomId={
|
||||
assessRoomId:record.id
|
||||
}
|
||||
this.props.dispatch({
|
||||
type:"bidev/getCheckedByRoomId",
|
||||
payload: {...roomId},
|
||||
callback:(response) => {
|
||||
console.log(response)
|
||||
if(response.data == false) {
|
||||
this.setState({display: true})
|
||||
} else {
|
||||
this.setState({display: false})
|
||||
}
|
||||
}
|
||||
})
|
||||
this.props.dispatch({
|
||||
type:"bidev/fetchJuryMemInfo",
|
||||
payload:{...params},
|
||||
callback:(response,txt)=>{
|
||||
if(txt=="success"){
|
||||
sessionStorage.setItem('projectData',JSON.stringify(record))
|
||||
sessionStorage.setItem('roomId',record.id)
|
||||
this.setState({
|
||||
ratevisible:true
|
||||
ratevisible:true,
|
||||
tpId:record.tpId
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -91,13 +111,16 @@ class Jury extends PureComponent {
|
||||
// 校验验证码及修改用户信息
|
||||
onRe2ndPageOut=()=>{
|
||||
const { validateFields,getFieldValue }=formRef.current;
|
||||
const { JuryInfo,checked }=this.props;
|
||||
validateFields(['name','phone',
|
||||
// 'certificate',
|
||||
'verificationCode']).then(
|
||||
(values) => {
|
||||
console.log(values);
|
||||
const params={
|
||||
name:values.name,
|
||||
phone:values.phone
|
||||
phone:values.phone,
|
||||
id:JuryInfo.id
|
||||
}
|
||||
this.props.dispatch({
|
||||
type:"bidev/updateJuryMemInfo",
|
||||
@ -115,23 +138,43 @@ class Jury extends PureComponent {
|
||||
payload:{...paramst},
|
||||
callback:(response,txt)=>{
|
||||
if(txt=="success"){
|
||||
// message.success("完美成功!")
|
||||
const paramskt={
|
||||
// assessRoomId:room.id,
|
||||
assessRoomId:"1331563852780797952",
|
||||
// projectId:tpId,
|
||||
projectId:"4419993030303037111"
|
||||
const { display }=this.state;
|
||||
console.log(display)
|
||||
if(display == true) {
|
||||
history.push('/EvaRoom')
|
||||
this.setState({
|
||||
ratevisible:false,
|
||||
})
|
||||
} else {
|
||||
// message.success("完美成功!")
|
||||
const paramskt={
|
||||
assessRoomId:room.id,
|
||||
// assessRoomId:"1331563852780797952",
|
||||
projectId:tpId,
|
||||
// projectId:"4419993030303037111"
|
||||
}
|
||||
const params={
|
||||
roomId:room.id
|
||||
}
|
||||
this.props.dispatch({
|
||||
type:"bidev/fetchbidslist",
|
||||
payload:{...paramskt}
|
||||
})
|
||||
this.props.dispatch({
|
||||
type:"bidev/fetchJuryMemInfo",
|
||||
payload:{...params},
|
||||
callback:(response,txt)=>{
|
||||
if(txt=="success"){
|
||||
const { resetFields }=formRef.current;
|
||||
resetFields();
|
||||
this.setState({
|
||||
ratevisible:false,
|
||||
bookflag:false
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
this.props.dispatch({
|
||||
type:"bidev/fetchbidslist",
|
||||
payload:{...paramskt}
|
||||
})
|
||||
const { resetFields }=formRef.current;
|
||||
resetFields();
|
||||
this.setState({
|
||||
ratevisible:false,
|
||||
bookflag:false
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -156,11 +199,38 @@ class Jury extends PureComponent {
|
||||
windowopen=()=>{
|
||||
// window.open(response.data, '_blank')
|
||||
}
|
||||
handleRedirect=()=>{
|
||||
const { checked }=this.state;
|
||||
if(!checked){
|
||||
handleRedirect=(txt)=>{
|
||||
const { checked,room }=this.state;
|
||||
const { JuryInfo }=this.props;
|
||||
if(txt==1 && !checked){
|
||||
return message.warn("请您先阅读专家承诺书!")
|
||||
}
|
||||
const params={
|
||||
assessRoomId:room.id,
|
||||
attitude:txt,
|
||||
juryMemberId:JuryInfo.id,
|
||||
sectionId:room.sectionId,
|
||||
}
|
||||
this.props.dispatch({
|
||||
type:"bidev/pushRedirectRe",
|
||||
payload:{...params},
|
||||
callback:(response,t)=>{
|
||||
if(t=="success"){
|
||||
// 再跳转
|
||||
if(txt==1){
|
||||
// sessionStorage.setItem("roomId",record.id)
|
||||
// this.props.dispatch(routerRedux.push('/ProjectLayout/EvaRoom'))
|
||||
history.push('/EvaRoom')
|
||||
}else{
|
||||
this.setState({
|
||||
ratevisible:false
|
||||
})
|
||||
}
|
||||
}else{
|
||||
message.error(response.message)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
handleBack=()=>{
|
||||
this.setState({
|
||||
@ -169,7 +239,7 @@ class Jury extends PureComponent {
|
||||
}
|
||||
render(){
|
||||
const { JuryList,JurylistLoading,JuryInfo,bidslistLoading,bidslist}=this.props;
|
||||
const { pageNo,pageSize,tpId,ratevisible,bookflag,checked }=this.state;
|
||||
const { pageNo,pageSize,tpId,ratevisible,bookflag,checked,display }=this.state;
|
||||
const pagination = {
|
||||
current: pageNo,
|
||||
total: JuryList && JuryList.total ,
|
||||
@ -184,8 +254,8 @@ class Jury extends PureComponent {
|
||||
const params={
|
||||
pageNo:page,
|
||||
pageSize:pageSize,
|
||||
roomType:2,
|
||||
tpId:tpId//项目id
|
||||
// roomType:2,
|
||||
// tpId:tpId//项目id
|
||||
}
|
||||
this.props.dispatch({
|
||||
type:"bidev/fetchJuryList",
|
||||
@ -200,8 +270,8 @@ class Jury extends PureComponent {
|
||||
const params={
|
||||
pageNo:1,
|
||||
pageSize:pageSize,
|
||||
roomType:2,
|
||||
tpId:tpId//项目id
|
||||
// roomType:2,
|
||||
// tpId:tpId//项目id
|
||||
}
|
||||
this.props.dispatch({
|
||||
type:"bidev/fetchJuryList",
|
||||
@ -229,7 +299,7 @@ class Jury extends PureComponent {
|
||||
bordered
|
||||
/>
|
||||
<span style={{marginLeft:"39%",fontSize:"15px",fontWeight:"bold"}}><Checkbox onChange={this.onChange} checked={checked}></Checkbox><span style={{marginLeft:"10px"}}>我已读并同意了此承诺书</span><span style={{color:"#2D2DFF",fontSize:"20px",cursor:"pointer"}} onClick={()=>{this.windowopen()}}>《承诺书协议》</span></span><br/><br/>
|
||||
<span style={{marginLeft:"39%",marginTop:"10px"}}><Button type="danger" onClick={()=>{this.handleBack()}}>申请回避</Button><Button style={{marginLeft:"30px"}} type="danger" onClick={()=>{this.handleRedirect()}}>确定</Button></span>
|
||||
<span style={{marginLeft:"39%",marginTop:"10px"}}><Button type="danger" onClick={()=>{this.handleRedirect(2)}}>申请回避</Button><Button style={{marginLeft:"30px"}} type="danger" onClick={()=>{this.handleRedirect(1)}}>确定</Button></span>
|
||||
</div>
|
||||
}
|
||||
return <>
|
||||
@ -245,6 +315,7 @@ class Jury extends PureComponent {
|
||||
renderBookt()}
|
||||
<div className="zry">
|
||||
<Modal
|
||||
destroyOnClose
|
||||
cancelText="取消"
|
||||
okText="确定"
|
||||
onCancel={()=>{this.onRateOut()}}
|
||||
@ -258,6 +329,7 @@ class Jury extends PureComponent {
|
||||
ref={formRef}
|
||||
labelCol={{ span: 5 }}
|
||||
wrapperCol={{ span: 13 }}
|
||||
preserve={false}
|
||||
>
|
||||
<span className="zul">专家信息确认</span>
|
||||
<div className="divider"></div>
|
||||
@ -267,29 +339,29 @@ class Jury extends PureComponent {
|
||||
name="name"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
required: !this.state.display,
|
||||
message: '请输入姓名',
|
||||
},
|
||||
]}
|
||||
><Input placeholder="请输入姓名"/></FormItem>
|
||||
><Input placeholder="请输入姓名" disabled={this.state.display}/></FormItem>
|
||||
<FormItem
|
||||
label="电话"
|
||||
initialValue={JuryInfo!="" && JuryInfo.phone}
|
||||
name="phone"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
required: !this.state.display,
|
||||
message: '请输入电话',
|
||||
},
|
||||
]}
|
||||
><Input placeholder="请输入电话"/></FormItem>
|
||||
><Input placeholder="请输入电话" disabled={this.state.display}/></FormItem>
|
||||
<FormItem
|
||||
label="身份证号"
|
||||
initialValue={JuryInfo!="" && JuryInfo.certificate}
|
||||
name="certificate"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
required: !this.state.display,
|
||||
message: '请输入身份证号',
|
||||
},
|
||||
]}
|
||||
|
@ -11,10 +11,8 @@ import BiddingRoom from './../../components/BiddingRoom/index'
|
||||
// managerlistLoading:loading.effects['bidev/fetchManagerList'],
|
||||
// }))
|
||||
class biddingroom extends PureComponent {
|
||||
// state={
|
||||
// }
|
||||
// state={}
|
||||
// componentDidMount(){
|
||||
|
||||
// }
|
||||
|
||||
render(){
|
||||
|
331
src/pages/BidEvaluation/components/ReviewDevided.tsx
Normal file
331
src/pages/BidEvaluation/components/ReviewDevided.tsx
Normal file
@ -0,0 +1,331 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Modal, Table, Checkbox, message, Spin, Button } from 'antd';
|
||||
import { getDevidedData, getJuryData, saveDevidedData } from './service';
|
||||
|
||||
interface ReviewDivisionProps {
|
||||
modalVisible: boolean;
|
||||
onCancel: () => void;
|
||||
title: any;
|
||||
values: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存评审分工
|
||||
* @param fields
|
||||
*/
|
||||
|
||||
export const handleSave = async (fields: any) => {
|
||||
try {
|
||||
await saveDevidedData(fields);
|
||||
message.success('保存成功');
|
||||
return true;
|
||||
} catch (error) {
|
||||
message.error('保存失败');
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 评审分工
|
||||
* @param props
|
||||
*/
|
||||
|
||||
const ReviewDevided: React.FC<ReviewDivisionProps> = (props) => {
|
||||
const { modalVisible, onCancel, title, values } = props;
|
||||
//存储评委数据
|
||||
const [juryData, setJuryData] = useState<any[]>([]);
|
||||
//存储表数据
|
||||
const [totalTableData, setTotalTableData] = useState<any[]>([]);
|
||||
//存储表头
|
||||
const [totalTableColumns, setTotalTableColumns] = useState<any[]>([]);
|
||||
//表格loading
|
||||
const [tableLoading, setTableLoadings] = useState<boolean>(false);
|
||||
//modal loading
|
||||
const [modalLoading, setModalLoading] = useState<boolean>(false);
|
||||
//评审分工查看状态
|
||||
const [viewStatus, setViewStatus] = useState<boolean>(false);
|
||||
//全部参数
|
||||
// const juryParams = '1331563852445253632';
|
||||
const juryParams = values == undefined ? '' : values.id;
|
||||
useEffect(() => {
|
||||
setTableLoadings(true);
|
||||
const status = values == undefined ? false : (values.status == 1 || values.status == 0 ? false : true)
|
||||
console.log(status)
|
||||
setViewStatus(status)
|
||||
if (juryParams == '') {
|
||||
} else {
|
||||
//获取评委
|
||||
getJuryData(juryParams).then((res) => {
|
||||
if (res.code == 200) {
|
||||
setJuryData(res.data);
|
||||
//获取分工数据
|
||||
if (juryParams == null) {
|
||||
} else {
|
||||
getDevidedData(juryParams).then((response) => {
|
||||
if (response.code == 200) {
|
||||
//调用数据处理方法并初始化表格
|
||||
InitializeTable(res.data, response.data);
|
||||
setTableLoadings(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}, [modalVisible, values]);
|
||||
|
||||
//初始化表格方法
|
||||
const InitializeTable = (columns: any, data: any) => {
|
||||
//处理数据
|
||||
let totalData: any[] = [];
|
||||
let count = 0;
|
||||
data.forEach((ele: any) => {
|
||||
if (ele.hasOwnProperty('subCategoryList')) {
|
||||
ele.subCategoryList.forEach((element: any, index: any) => {
|
||||
let inner = element;
|
||||
count = count + 1;
|
||||
inner.key = count;
|
||||
inner.rvwName = ele.rvwName;
|
||||
inner.rowSpan = index == 0 ? ele.subCategoryList.length : 0;
|
||||
if (inner.divideMap == null) {
|
||||
let obj = {};
|
||||
columns.forEach((e: any) => {
|
||||
obj[e.id] = {
|
||||
checked: false,
|
||||
actType: inner.category,
|
||||
rvwType: ele.rvwType,
|
||||
juryMemberId: e.id,
|
||||
roomId: juryParams,
|
||||
};
|
||||
});
|
||||
inner.divideMap = obj;
|
||||
} else {
|
||||
let obj = { ...inner.divideMap };
|
||||
columns.forEach((e: any) => {
|
||||
if (obj.hasOwnProperty(e.id)) {
|
||||
obj[e.id].checked = true;
|
||||
} else {
|
||||
obj[e.id] = {
|
||||
checked: false,
|
||||
actType: inner.category,
|
||||
rvwType: ele.rvwType,
|
||||
juryMemberId: e.id,
|
||||
roomId: juryParams,
|
||||
};
|
||||
}
|
||||
});
|
||||
inner.divideMap = obj;
|
||||
}
|
||||
Object.assign(inner, inner.divideMap);
|
||||
totalData.push(inner);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//处理表头
|
||||
const tcolumns: any[] = [
|
||||
{
|
||||
title: '',
|
||||
dataIndex: 'rvwName',
|
||||
key: 'rvwName',
|
||||
align: 'center',
|
||||
render: (value: any, record: any, index: any) => {
|
||||
if (!record.name) {
|
||||
return {
|
||||
children: value,
|
||||
props: {
|
||||
colSpan: 2,
|
||||
style: { textAlign: 'center' },
|
||||
},
|
||||
};
|
||||
}
|
||||
return {
|
||||
children: value,
|
||||
props: {
|
||||
rowSpan: record.rowSpan,
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '评审项类别',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
align: 'center',
|
||||
render: (value: any, record: any, index: any) => {
|
||||
if (!record.name) {
|
||||
return {
|
||||
children: '',
|
||||
props: {
|
||||
colSpan: 0,
|
||||
},
|
||||
};
|
||||
}
|
||||
return value;
|
||||
},
|
||||
},
|
||||
];
|
||||
columns.forEach((ele: any) => {
|
||||
tcolumns.push({
|
||||
title: ele.name,
|
||||
dataIndex: ele.id,
|
||||
key: ele.id,
|
||||
align: 'center',
|
||||
render: (value: any, record: any, index: any) => (
|
||||
<Checkbox
|
||||
disabled={values == undefined ? false : (values.status == 1 || values.status == 0 ? false : true)}
|
||||
onChange={(event) => {
|
||||
const data = [...totalData];
|
||||
const jury = data.findIndex((item: any) => item.key == record.key);
|
||||
const isView = data.length - 1;
|
||||
|
||||
if (data[jury][value.juryMemberId].rvwType == 2 && data[jury][value.juryMemberId].actType == 0) {
|
||||
columns.forEach((ele: any) => {
|
||||
if (ele.id == value.juryMemberId) {
|
||||
if (event.target.checked == true) {
|
||||
data[jury][value.juryMemberId].checked = event.target.checked;
|
||||
data[isView][value.juryMemberId].checked = event.target.checked;
|
||||
} else {
|
||||
data[jury][value.juryMemberId].checked = event.target.checked;
|
||||
}
|
||||
} else {
|
||||
data[jury][ele.id].checked = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
data[jury][value.juryMemberId].checked = event.target.checked;
|
||||
}
|
||||
|
||||
setTotalTableData(data);
|
||||
}}
|
||||
defaultChecked={value.checked}
|
||||
checked={value.checked}
|
||||
/>
|
||||
),
|
||||
});
|
||||
});
|
||||
console.log(totalData);
|
||||
setTotalTableColumns(tcolumns);
|
||||
setTotalTableData(totalData);
|
||||
};
|
||||
|
||||
const onSubmit = async () => {
|
||||
setModalLoading(true);
|
||||
console.log(totalTableData);
|
||||
let data: any[] = [];
|
||||
let count = 0;
|
||||
let e = 0;
|
||||
let a = 0;
|
||||
let j = totalTableData.length - 1;
|
||||
|
||||
totalTableData.forEach((element: any) => {
|
||||
let num = 0;
|
||||
let b = 0;
|
||||
juryData.forEach((ele: any) => {
|
||||
if(element[ele.id].rvwType == 1) {
|
||||
b = b + 1
|
||||
}
|
||||
if (element[ele.id].checked == true) {
|
||||
data.push(element[ele.id]);
|
||||
if (
|
||||
element[ele.id].rvwType == 2 &&
|
||||
element[ele.id].actType == 0 &&
|
||||
totalTableData[j][ele.id].checked
|
||||
) {
|
||||
e = e + 1;
|
||||
}
|
||||
} else if (element[ele.id].checked == false) {
|
||||
num = num + 1;
|
||||
}
|
||||
});
|
||||
if (num == juryData.length) {
|
||||
count = count + 1;
|
||||
}
|
||||
if (b == juryData.length) {
|
||||
a = a + 1;
|
||||
}
|
||||
});
|
||||
if (count > 0) {
|
||||
message.info('存在评审项未分配评委,请重新勾选');
|
||||
setModalLoading(false);
|
||||
return;
|
||||
}
|
||||
if(a == totalTableData.length - 1) {} else {
|
||||
if (e == 0) {
|
||||
message.info('请允许报价评审专家查看报价');
|
||||
setModalLoading(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
const success = await handleSave({ divideList: data });
|
||||
if (success) {
|
||||
setModalLoading(false);
|
||||
setTotalTableData([])
|
||||
onCancel();
|
||||
}
|
||||
};
|
||||
|
||||
const onSelect = (record: any, selected: any) => {
|
||||
setTableLoadings(true);
|
||||
let select = totalTableData;
|
||||
select.forEach((ele: any) => {
|
||||
if (ele.key == record.key) {
|
||||
juryData.forEach((element) => {
|
||||
ele[element.id].checked = selected;
|
||||
});
|
||||
}
|
||||
});
|
||||
setTotalTableData(select);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Spin spinning={modalLoading} delay={300}>
|
||||
<Modal
|
||||
destroyOnClose
|
||||
title={title}
|
||||
visible={modalVisible}
|
||||
onCancel={() => {
|
||||
onCancel()
|
||||
setTotalTableData([])
|
||||
}}
|
||||
width={800}
|
||||
footer={viewStatus ? false : [
|
||||
<Button key="back" onClick={() => {
|
||||
onCancel()
|
||||
setTotalTableData([])
|
||||
}}>
|
||||
取消
|
||||
</Button>,
|
||||
<Button key="submit" type="primary" loading={modalLoading} onClick={() => onSubmit()}>
|
||||
保存
|
||||
</Button>,
|
||||
]}
|
||||
>
|
||||
<Table
|
||||
bordered
|
||||
pagination={false}
|
||||
columns={totalTableColumns}
|
||||
dataSource={totalTableData}
|
||||
size="middle"
|
||||
key="1"
|
||||
rowKey="key"
|
||||
loading={tableLoading}
|
||||
rowSelection={{
|
||||
hideSelectAll: true,
|
||||
onSelect: (record: any, selected: any) => {
|
||||
onSelect(record, selected);
|
||||
setTableLoadings(false);
|
||||
},
|
||||
getCheckboxProps: (record) => ({
|
||||
disabled: viewStatus == true ? true : record.rvwName == '详审' && record.category == 0,
|
||||
}),
|
||||
}}
|
||||
/>
|
||||
</Modal>
|
||||
</Spin>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default ReviewDevided;
|
44
src/pages/BidEvaluation/components/service.ts
Normal file
44
src/pages/BidEvaluation/components/service.ts
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
/**
|
||||
* 通过评审室id查询评审分工
|
||||
* @param param
|
||||
*/
|
||||
export async function getDevidedData(param: any) {
|
||||
return request(`/api/biz-service-ebtp-rsms/v1/jury/divide/findListByRoomId/` + param, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过评审室id查询评委会成员数据
|
||||
* @param param
|
||||
*/
|
||||
export async function getJuryData(param: any) {
|
||||
return request(`/api/biz-service-ebtp-rsms/v1/jury/member/info/` + param, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 评审分工保存
|
||||
* @param param
|
||||
*/
|
||||
export async function saveDevidedData(param: any) {
|
||||
return request(`/api/biz-service-ebtp-rsms/v1/jury/divide/save`, {
|
||||
method: 'POST',
|
||||
data:param
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置组长
|
||||
* @param param
|
||||
*/
|
||||
export async function saveLeaderId(param: any) {
|
||||
return request(`/api/biz-service-ebtp-rsms/v1/jury/member/chooseLeader/?id=${param}`, {
|
||||
method: 'PUT',
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,17 @@
|
||||
import React, {PureComponent} from 'react';
|
||||
import {Divider,Button,Form,Card,Tabs,Table,Tooltip,Input,Select,Row,Col,message,Modal} from 'antd';
|
||||
import {Divider,Button,Form,Card,Tabs,Table,Tooltip,Input,Select,Row,Col,message,Modal,Popconfirm} from 'antd';
|
||||
import { getRoomId} from '@/utils/session';
|
||||
import { saveLeaderId,getJuryData } from './components/service';
|
||||
import './index.less';
|
||||
import { connect } from "dva";
|
||||
import { routerRedux } from 'dva/router';
|
||||
import { getProId } from '@/utils/session';
|
||||
import ReviewDevided from '@/pages/BidEvaluation/components/ReviewDevided';
|
||||
//import SetLeader from '@/pages/BidEvaluation/components/SetLeader';
|
||||
|
||||
|
||||
// @Form.create()
|
||||
const InfId = getRoomId();
|
||||
@connect(({ bidev,loading }) => ({
|
||||
...bidev,
|
||||
managerlistLoading:loading.effects['bidev/fetchManagerList'],
|
||||
@ -13,20 +20,55 @@ class manager extends PureComponent {
|
||||
state={
|
||||
pageNo:1,
|
||||
pageSize:10,
|
||||
tpId:1111111,
|
||||
ratevisible:false
|
||||
tpId: getProId(),
|
||||
ratevisible:false,
|
||||
record:undefined,
|
||||
visible: false,
|
||||
data: '',
|
||||
roomStatus: 1,
|
||||
}
|
||||
componentDidMount(){
|
||||
showModal = (record) => {
|
||||
getJuryData( record.id ).then(res=>{
|
||||
if(res.code == 200) {
|
||||
if(res.data == undefined) {} else {
|
||||
this.setState({
|
||||
visible: true,
|
||||
data:res.data
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
};
|
||||
hideModal = () => {
|
||||
this.setState({
|
||||
tpId:1111111
|
||||
visible: false
|
||||
})
|
||||
};
|
||||
handleOk = e => {
|
||||
console.log(e);
|
||||
this.setState({
|
||||
visible: false,
|
||||
});
|
||||
};
|
||||
|
||||
handleCancel = e => {
|
||||
console.log(e);
|
||||
this.setState({
|
||||
visible: false,
|
||||
});
|
||||
};
|
||||
componentDidMount(){
|
||||
console.log(this.props.match.params.roomType)
|
||||
this.setState({
|
||||
tpId:getProId()
|
||||
})
|
||||
const { dispatch }=this.props;
|
||||
// const {pageNo,pageSize}=this.state;
|
||||
const params={
|
||||
pageNo:1,
|
||||
pageSize:10,
|
||||
roomType:2,
|
||||
tpId:1111111//项目id
|
||||
roomType:this.props.match.params.roomType,
|
||||
tpId: getProId(),//项目id
|
||||
}
|
||||
dispatch({
|
||||
type:"bidev/fetchManagerList",
|
||||
@ -63,24 +105,24 @@ class manager extends PureComponent {
|
||||
},
|
||||
{ title: '状态', dataIndex: 'status', width: '10%',
|
||||
render:(text, record, index)=>{
|
||||
let txt="准备评标"
|
||||
switch(text){
|
||||
case '2': txt="正在评标"
|
||||
case '3': txt="评标结束"
|
||||
}
|
||||
return txt
|
||||
let txt = record.status
|
||||
return txt == 0 || txt == 1 ? '准备评标' : (txt == 2 ? '正在评标' : (txt == 3 ? '评标结束': null))
|
||||
}},
|
||||
{ title: '操作', dataIndex: 'operation', width: '10%',
|
||||
render:(text, record, index)=>{
|
||||
let status=record.status;
|
||||
return <>
|
||||
{status==0 || status==1 ?<a className="buttont" onClick={()=>{this.onOpenBizassessroom(record)}}>开启评标</a>:<a className="buttont" onClick={()=>{this.handleRedirect()}}>进入评审室</a>}
|
||||
<a style={{marginLeft:"5px"}} className="buttont" onClick={()=>{this.onRedirectRate()}}>组建评委会</a><br/>
|
||||
<a className="buttont" onClick={()=>{this.onRateShow()}}>评审分工</a><a style={{marginLeft:"5px"}} className="buttont" onClick={()=>{this.onResetVerificationCode(record)}}>重置校验码</a></>
|
||||
{status==0 || status==1 ?<Button type="link" block><a className="buttont" onClick={()=>{this.onOpenBizassessroom(record)}}>开启评标</a></Button>:<Button type="link" block><a className="buttont" onClick={()=>{this.handleRedirect(record)}}>进入评审室</a></Button>}
|
||||
{record.reviewMark == 0 ? null : (<a style={{textAlign: 'center',width: '100%'}} className="buttont" onClick={()=>{this.onRedirectRate()}}>组建评委会</a>)}
|
||||
<Button type="link" block><a style={{textAlign: 'center',width: '100%'}} className="buttont" onClick={()=>{this.onRateShow(record)}}>评审分工</a></Button>
|
||||
<Button type="link" block><a style={{textAlign: 'center',width: '100%'}} className="buttont" onClick={()=>{this.onResetVerificationCode(record)}}>重置校验码</a></Button>
|
||||
{status==0 || status==1 ? <Button type="link" block onClick={() => this.showModal(record)}><a style={{textAlign: 'center',width: '100%'}} className="buttont" >设置组长</a></Button>: null}
|
||||
</>
|
||||
}}
|
||||
]
|
||||
handleRedirect=()=>{
|
||||
|
||||
handleRedirect=(record)=>{
|
||||
sessionStorage.setItem("roomId",record.id)
|
||||
this.props.dispatch(routerRedux.push('/ProjectLayout/EvaRoom'))
|
||||
}
|
||||
onOpenBizassessroom=(record)=>{
|
||||
const params={
|
||||
@ -109,20 +151,22 @@ class manager extends PureComponent {
|
||||
this.props.dispatch(routerRedux.push('/JudgingPanel/list'))
|
||||
}
|
||||
// 弹出评审分工页面
|
||||
onRateShow=()=>{
|
||||
onRateShow=(record)=>{
|
||||
this.setState({
|
||||
record: {...record},
|
||||
ratevisible:true
|
||||
})
|
||||
// this.props.dispatch(routerRedux.push('/JudgingPanel/list'))
|
||||
}
|
||||
onRateOut(){
|
||||
this.setState({
|
||||
ratevisible:false
|
||||
ratevisible:false,
|
||||
record:undefined
|
||||
})
|
||||
}
|
||||
render(){
|
||||
const { managerList,managerlistLoading}=this.props;
|
||||
const { pageNo,pageSize,tpId,ratevisible }=this.state;
|
||||
const { pageNo,pageSize,tpId,ratevisible, data }=this.state;
|
||||
const pagination = {
|
||||
current: pageNo,
|
||||
total: managerList && managerList.total ,
|
||||
@ -162,6 +206,40 @@ class manager extends PureComponent {
|
||||
})
|
||||
}
|
||||
}
|
||||
const confirm =(values)=> {
|
||||
this.setState({
|
||||
visible: false
|
||||
})
|
||||
saveLeaderId(values.id).then(res=>{
|
||||
})
|
||||
}
|
||||
const columns = [
|
||||
{
|
||||
title: '评委会成员',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
},
|
||||
{
|
||||
title: '身份',
|
||||
dataIndex: 'duty',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
render: (record, index) => {
|
||||
return record.duty == 1?(
|
||||
<Popconfirm title="确认设为组长?" okText="是" cancelText="否" onConfirm={()=>confirm(record)}>
|
||||
<Button type="link">设为组长</Button>
|
||||
</Popconfirm>
|
||||
):null
|
||||
}
|
||||
}
|
||||
]
|
||||
const renderSetLeader = ()=>{
|
||||
return <Table pagination={false} columns={columns} dataSource={data}/>
|
||||
}
|
||||
return <>
|
||||
<Card title="评审室">
|
||||
<Table
|
||||
@ -172,16 +250,16 @@ class manager extends PureComponent {
|
||||
bordered
|
||||
/>
|
||||
</Card>
|
||||
<Modal
|
||||
cancelText="取消"
|
||||
okText="确定"
|
||||
onCancel={()=>{this.onRateOut()}}
|
||||
onOk={()=>{this.onRateOut()}}
|
||||
title="评审分工"
|
||||
visible={ratevisible}
|
||||
>
|
||||
评审分工地页面
|
||||
</Modal>
|
||||
<ReviewDevided title="评审分工" modalVisible={ratevisible} onCancel={() => {this.onRateOut()}} values={this.state.record}/>
|
||||
<Modal
|
||||
title="设置组长"
|
||||
visible= {this.state.visible}
|
||||
footer= {null}
|
||||
onCancel={this.handleCancel}
|
||||
width={600}
|
||||
>
|
||||
{renderSetLeader()}
|
||||
</Modal>
|
||||
</>
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ import React, {PureComponent} from 'react';
|
||||
import {Divider,Button,Form,Card,Tabs,Table,Tooltip,Input,Select,Row,Col,message} from 'antd';
|
||||
import './index.less';
|
||||
import { connect } from "dva";
|
||||
|
||||
import { getProId } from '@/utils/session';
|
||||
@connect(({ bidev,loading }) => ({
|
||||
...bidev,
|
||||
supplierlistLoading:loading.effects['bidev/fetchSupplierList'],
|
||||
@ -11,19 +11,19 @@ class supplier extends PureComponent {
|
||||
state={
|
||||
pageNo:1,
|
||||
pageSize:10,
|
||||
tpId:1111111
|
||||
tpId: getProId()
|
||||
}
|
||||
componentDidMount(){
|
||||
this.setState({
|
||||
tpId:1111111
|
||||
tpId: getProId()
|
||||
})
|
||||
const { dispatch }=this.props;
|
||||
// const {pageNo,pageSize}=this.state;
|
||||
const params={
|
||||
pageNo:1,
|
||||
pageSize:10,
|
||||
roomType:2,
|
||||
tpId:1111111//项目id
|
||||
roomType:this.props.match.params.roomType,
|
||||
tpId:getProId()//项目id
|
||||
}
|
||||
dispatch({
|
||||
type:"bidev/fetchSupplierList",
|
||||
@ -57,7 +57,8 @@ class supplier extends PureComponent {
|
||||
}}
|
||||
]
|
||||
handleRedirect=()=>{
|
||||
|
||||
sessionStorage.setItem("roomId",record.id)
|
||||
this.props.dispatch(routerRedux.push('/ProjectLayout/EvaRoom'))
|
||||
}
|
||||
render(){
|
||||
const { supplierList,supplierlistLoading}=this.props;
|
||||
@ -76,7 +77,7 @@ class supplier extends PureComponent {
|
||||
const params={
|
||||
pageNo:page,
|
||||
pageSize:pageSize,
|
||||
roomType:2,
|
||||
roomType:this.props.match.params.roomType,
|
||||
tpId:tpId//项目id
|
||||
}
|
||||
this.props.dispatch({
|
||||
@ -92,7 +93,7 @@ class supplier extends PureComponent {
|
||||
const params={
|
||||
pageNo:1,
|
||||
pageSize:pageSize,
|
||||
roomType:2,
|
||||
roomType:this.props.match.params.roomType,
|
||||
tpId:tpId//项目id
|
||||
}
|
||||
this.props.dispatch({
|
||||
|
Reference in New Issue
Block a user