更新版本库
This commit is contained in:
@ -1,13 +1,13 @@
|
||||
import ProTable, { ActionType, ProColumns } from "@ant-design/pro-table";
|
||||
import ProTable, { ActionType, } from "@ant-design/pro-table";
|
||||
import { Button, Col, Descriptions, Form, Input, message, Modal, Progress, Row, Spin } from "antd";
|
||||
import React, { useEffect, useRef, useState } from "react";
|
||||
import styles from './index.less';
|
||||
import './index.less';
|
||||
import { getList, jieMi, jmRate, singBid, endTimeUp, updatePrice, queryFx } from './service';
|
||||
import { getList, jieMi, jmRate, singBid, endTimeUp, updatePrice, queryFx, confirmOffer } from './service';
|
||||
import { getSessionUserData, } from '@/utils/session';
|
||||
|
||||
const Room: React.FC<{}> = () => {
|
||||
const [spin, spinSet] = useState<any>(false);
|
||||
const [form] = Form.useForm();
|
||||
const FormItem = Form.Item;
|
||||
const { TextArea } = Input;
|
||||
const formLayout = {
|
||||
@ -16,8 +16,10 @@ const Room: React.FC<{}> = () => {
|
||||
};
|
||||
//控制字段 角色、开标状态、唱标阶段、是否需要ipass解密
|
||||
// const proId = 1111111;
|
||||
const juese = 1//1代理 2供应商
|
||||
const juese = getSessionUserData().roleIds//daili 代理 gys 供应商
|
||||
const actionRef = useRef<ActionType>();
|
||||
const [count, countSet] = useState<number>(0); //开标室启动器
|
||||
// const [turnSort, turnSortSet] = useState<number>(1); //开标室启动器
|
||||
const [projectName, projectNameSet] = useState<any>(''); //项目名称
|
||||
const [projectNo, projectNoSet] = useState<any>(''); //项目编号
|
||||
const [sectionName, sectionNameSet] = useState<any>(''); //标包名称
|
||||
@ -44,6 +46,9 @@ const Room: React.FC<{}> = () => {
|
||||
const [jmWait, jmWaitSet] = useState<number>(0);//未解密
|
||||
const [jmFail, jmFailSet] = useState<number>(0);//解密失败
|
||||
|
||||
|
||||
const [dis, disSet] = useState<boolean>(false);//解密失败
|
||||
|
||||
//开标室表格
|
||||
const [columnsKb, columnsKbSet] = useState<any>([]);
|
||||
const [columnsKbData, columnsKbDataSet] = useState<any>([]);
|
||||
@ -79,25 +84,51 @@ const Room: React.FC<{}> = () => {
|
||||
};
|
||||
//开标室表格按钮
|
||||
const tools = [
|
||||
juese == 1 && !important && !range ? <Button key='jm' type="primary" onClick={() => { jmTimeVisSet(true) }}>设置投标人解密时限</Button> : null,
|
||||
juese == 1 && !range ? <Button key='jm' type="primary"
|
||||
onClick={async () => {
|
||||
spinSet(true);
|
||||
const success = await jieMi({ turnId: turnId });
|
||||
if (success) {
|
||||
juese === 'daili' && !important && !range ? <Button key='jm' type="primary" onClick={() => { jmTimeVisSet(true) }}>设置投标人解密时限</Button> : null,
|
||||
juese === 'daili' && !range && jmComplete != jmFileCount ?
|
||||
<Button key='jm' type="primary" disabled={dis}
|
||||
onClick={async () => {
|
||||
spinSet(true); disSet(true);
|
||||
const success = await jieMi({ tdocId: tdocId });
|
||||
if (success) {
|
||||
handleRateVis(true);
|
||||
rateCountSet(rateCount + 1);
|
||||
}
|
||||
spinSet(false); disSet(false);
|
||||
}}>解密</Button> : null,
|
||||
juese === 'daili' && !range && jmComplete != jmFileCount?
|
||||
<Button key='ckjd' type="primary" disabled={dis}
|
||||
onClick={() => {
|
||||
disSet(true);
|
||||
handleRateVis(true);
|
||||
rateCountSet(rateCount + 1);
|
||||
}
|
||||
spinSet(false);
|
||||
}}>解密</Button> : null,
|
||||
juese == 1 && !range ? <Button key='ckjd' type="primary"
|
||||
onClick={() => {
|
||||
handleRateVis(true);
|
||||
rateCountSet(rateCount + 1);
|
||||
}}>查看解密进度</Button> : null,
|
||||
juese == 1 && (jmComplete + jmFail) > 0 && !rangeOver && !range ? <Button key='cb' type="primary" onClick={() => { sing({ id: configId, whetherRange: 1 }); }}>唱标</Button> : null,
|
||||
juese == 1 && range && !rangeOver ? <Button key='cbjs' type="primary" onClick={() => { sing({ id: configId, whetherRangeOver: 1 }); }}>唱标结束</Button> : null,
|
||||
juese == 1 ? <Button key='dy' type="primary" onClick={() => { }}>打印</Button> : null,
|
||||
disSet(false);
|
||||
}}>查看解密进度</Button> : null,
|
||||
juese === 'daili' && (jmComplete + jmFail) > 0 && !rangeOver && !range ?
|
||||
<Button disabled={dis} key='cb' type="primary" onClick={async () => {
|
||||
disSet(true);
|
||||
await sing({ id: configId, whetherRange: 1 });
|
||||
disSet(false);
|
||||
}}>唱标</Button> : null,
|
||||
juese === 'daili' && range && !rangeOver ?
|
||||
<Button disabled={dis} key='cbjs' type="primary" onClick={async () => {
|
||||
disSet(true);
|
||||
await sing({ id: configId, whetherRangeOver: 1 });
|
||||
disSet(false);
|
||||
}}>唱标结束</Button> : null,
|
||||
juese === 'gys' && range && !rangeOver ?
|
||||
<Button key='qrbj' type="primary" disabled={dis}
|
||||
onClick={async () => {
|
||||
disSet(true);
|
||||
await confirmOffer(turnId).then((res) => {
|
||||
console.log(res);
|
||||
if (res.message === 'success') {
|
||||
message.success('确认成功')
|
||||
}
|
||||
})
|
||||
disSet(false);
|
||||
}}>确认报价</Button> : null,
|
||||
juese === 'daili' ? <Button key='dy' type="primary" onClick={() => { }}>打印</Button> : null,
|
||||
];
|
||||
//取参数
|
||||
function getQueryString(name: any) {
|
||||
@ -108,37 +139,40 @@ const Room: React.FC<{}> = () => {
|
||||
//进页面执行
|
||||
useEffect(() => {
|
||||
getTableData();
|
||||
}, []);
|
||||
}, [count]);
|
||||
//查询进度
|
||||
useEffect(() => {
|
||||
if (rateVis) {
|
||||
console.log(123423);
|
||||
|
||||
let all: number, comp: number, fail: number, wait: number = 0;
|
||||
jmRate({ turnId: turnId }).then((res) => {
|
||||
console.log(res);
|
||||
let data = res.data;
|
||||
if (data != undefined) {
|
||||
all = data['-1'] != undefined ? data['-1'] : 0;
|
||||
comp = data['1'] != undefined ? data['1'] : 0;
|
||||
fail = data['2'] != undefined ? data['2'] : 0;
|
||||
wait = data['0'] != undefined ? data['0'] : 0;
|
||||
}
|
||||
jmCompleteSet(comp);
|
||||
jmFailSet(fail);
|
||||
jmFileCountSet(all);
|
||||
jmWaitSet(wait);
|
||||
});
|
||||
queryRate();
|
||||
setTimeout(async () => {
|
||||
rateCountSet(rateCount + 1);
|
||||
}, 2000);
|
||||
}
|
||||
}, [rateCount]);
|
||||
async function queryRate() {//查询解密进度
|
||||
let all: number, comp: number, fail: number, wait: number = 0;
|
||||
await jmRate({ tdocId: tdocId }).then((res) => {
|
||||
// console.log(res);
|
||||
let data = res.data;
|
||||
if (data != undefined) {
|
||||
all = data['-1'] != undefined ? data['-1'] : 0;
|
||||
comp = data['1'] != undefined ? data['1'] : 0;
|
||||
fail = data['2'] != undefined ? data['2'] : 0;
|
||||
wait = data['0'] != undefined ? data['0'] : 0;
|
||||
}
|
||||
jmCompleteSet(comp);
|
||||
jmFailSet(fail);
|
||||
jmFileCountSet(all);
|
||||
jmWaitSet(wait);
|
||||
});
|
||||
}
|
||||
//取表格数据
|
||||
const getTableData = async () => {
|
||||
spinSet(true);
|
||||
|
||||
let assessRoomId: any = "";
|
||||
let turnSort: any = '';
|
||||
let commpanyId = getSessionUserData().organizationId;
|
||||
juese == 'daili' ? commpanyId = '' : null;
|
||||
if (getQueryString("aa") != null) {
|
||||
assessRoomId = getQueryString("aa")
|
||||
}
|
||||
@ -150,9 +184,10 @@ const Room: React.FC<{}> = () => {
|
||||
let data: any = [];
|
||||
let category: any[] = [];
|
||||
let projectName: any, projectNo: any, sectionName: any, sectionNo: any, openTime: any, turnId: any, configId: any, openRoomId: any, tdocId: any = '';
|
||||
let openState: any, rangeT: any, rangeOverT: any, decryptStatus: any, important: any = false;
|
||||
await getList({ assessRoomId: assessRoomId, turnSort: turnSort }).then((res) => {
|
||||
console.log(res);
|
||||
let openState: any, decryptStatus: any, important: any = false;
|
||||
let rangeT: any, rangeOverT: any = true;
|
||||
await getList({ assessRoomId: assessRoomId, turnSort: turnSort, commpanyId: commpanyId }).then((res) => {
|
||||
// console.log(res);
|
||||
//拼记录表信息
|
||||
if (res.data != undefined) {
|
||||
projectName = res.data.singConfig.projectName;
|
||||
@ -160,7 +195,7 @@ const Room: React.FC<{}> = () => {
|
||||
sectionName = res.data.singConfig.sectionName;
|
||||
sectionNo = res.data.singConfig.sectionNo;
|
||||
openTime = res.data.singConfig.openTime;
|
||||
openState = res.data.singConfig.openState == 1 ? true : false;
|
||||
openState = res.data.singConfig.openState == 1 || res.data.singConfig.openState == 3 ? true : false;
|
||||
|
||||
rangeT = res.data.singConfig.whetherRange == 1 ? true : false;
|
||||
rangeOverT = res.data.singConfig.whetherRangeOver == 1 ? true : false;
|
||||
@ -184,15 +219,17 @@ const Room: React.FC<{}> = () => {
|
||||
title: '操作', dataIndex: 'option', width: 250,
|
||||
valueType: 'option',
|
||||
render: (_: any, record: any) => {
|
||||
// console.log(record);
|
||||
|
||||
return (
|
||||
<>
|
||||
{
|
||||
juese == 1 && rangeT ?<>
|
||||
<Button key='ckfxbj' onClick={() => { queryFxbj(record); handleSubentryVis(true); }}>查看分项报价</Button> </>
|
||||
juese === 'daili' && rangeT && record.quoteId != null ?
|
||||
<><Button key='ckfxbj' onClick={() => { queryFxbj(record,tdocId); handleSubentryVis(true); }}>查看分项报价</Button> </>
|
||||
: null
|
||||
}
|
||||
{
|
||||
juese == 1 && rangeT && !rangeOverT && record.quoteDecryptStatus != 2 ? <>
|
||||
juese === 'daili' && rangeT && !rangeOverT && record.quoteDecryptStatus == 2 && record.quoteId != null ? <>
|
||||
<Button key='blbj' type="primary" onClick={() => {
|
||||
repairVisSet(true);
|
||||
formBlbj.setFieldsValue({
|
||||
@ -212,6 +249,7 @@ const Room: React.FC<{}> = () => {
|
||||
//拼data
|
||||
res.data.suppliers != undefined ? res.data.suppliers.map((item1: any, index: any) => {
|
||||
let oneGys = {};
|
||||
item1.signTime == null ? item1.signTime = '未签名' : null;
|
||||
oneGys["key"] = index;
|
||||
oneGys["companyName"] = item1.companyName;
|
||||
oneGys["bidUserName"] = item1.bidUserName + "(" + item1.signTime + ")";
|
||||
@ -219,6 +257,7 @@ const Room: React.FC<{}> = () => {
|
||||
oneGys["tendererId"] = item1.id;//投标人id,补录报价用
|
||||
oneGys["contentDataId"] = item1.quoteId;//数据表id,补录报价用
|
||||
oneGys["quoteDecryptStatus"] = item1.quoteDecryptStatus;
|
||||
oneGys["quoteId"] = item1.quoteId;
|
||||
category.map((item2: any, index: any) => {
|
||||
oneGys[item2] = item1.dataMap[item2];
|
||||
});
|
||||
@ -248,8 +287,8 @@ const Room: React.FC<{}> = () => {
|
||||
});
|
||||
//查询进度
|
||||
let all: number, comp: number, fail: number, wait: number = 0;
|
||||
await jmRate({ turnId: turnId }).then((res) => {
|
||||
console.log(res);
|
||||
await jmRate({ tdocId: tdocId }).then((res) => {
|
||||
// console.log(res);
|
||||
let data = res.data;
|
||||
if (data != undefined) {
|
||||
all = data['-1'] != undefined ? data['-1'] : 0;
|
||||
@ -262,8 +301,14 @@ const Room: React.FC<{}> = () => {
|
||||
jmFileCountSet(all);
|
||||
jmWaitSet(wait);
|
||||
});
|
||||
|
||||
spinSet(false);
|
||||
console.log(tdocId);
|
||||
|
||||
//供应商未唱标结束就轮询 代理唱标后到唱标结束之前轮询
|
||||
if ((juese === 'gys' && !rangeOverT) || (juese === 'daili' && !rangeOverT && rangeT)) {
|
||||
setTimeout(() => {
|
||||
countSet(count + 1);
|
||||
}, 3000);
|
||||
}
|
||||
}
|
||||
//开标记录表
|
||||
const kbjl = () => {
|
||||
@ -307,7 +352,8 @@ const Room: React.FC<{}> = () => {
|
||||
visible={repairVis}
|
||||
onCancel={() => repairVisSet(false)}
|
||||
onOk={async () => {
|
||||
console.log(formBlbj.getFieldsValue());
|
||||
// console.log(formBlbj.getFieldsValue());
|
||||
spinSet(true);
|
||||
let verify = false;
|
||||
await formBlbj.validateFields().then(() => {
|
||||
verify = true;
|
||||
@ -316,7 +362,7 @@ const Room: React.FC<{}> = () => {
|
||||
});
|
||||
if (verify) {
|
||||
const { newPrice, contentDataId, tendererId } = formBlbj.getFieldsValue();
|
||||
const success = await updatePrice({ newPrice: newPrice, contentDataId: contentDataId, tendererId: tendererId });
|
||||
const success = await updatePrice({ newPrice: newPrice, contentDataId: contentDataId, tendererId: tendererId, tdocId: tdocId });
|
||||
if (success) {
|
||||
message.success('补录成功!');
|
||||
repairVisSet(false);
|
||||
@ -325,6 +371,7 @@ const Room: React.FC<{}> = () => {
|
||||
}
|
||||
getTableData();
|
||||
}
|
||||
spinSet(false);
|
||||
}}
|
||||
>
|
||||
<Form
|
||||
@ -403,7 +450,7 @@ const Room: React.FC<{}> = () => {
|
||||
onCancel={() => { getTableData(); handleRateVis(false); }}
|
||||
>
|
||||
{/* <img src={timg} alt="" width='100%' height="75%" /> */}
|
||||
<Progress percent={(jmComplete + jmFail) * 100 / jmFileCount} status="active" />
|
||||
<Progress percent={Math.floor(jmComplete / jmFileCount) * 100} status="active" />
|
||||
|
||||
<div style={{ textAlign: "center" }}>
|
||||
文件总数:<span style={{ fontSize: 30, color: 'rgb(0,144,255)' }}>{jmFileCount}</span> 个
|
||||
@ -420,12 +467,14 @@ const Room: React.FC<{}> = () => {
|
||||
//分项报价表
|
||||
const [fxData, fxDataSet] = useState<any>([{}]);
|
||||
const [columnsFx, columnsFxSet] = useState<any>([]);
|
||||
async function queryFxbj(record: any) {
|
||||
async function queryFxbj(record: any,id:any) {
|
||||
// const [tendererId] = record;
|
||||
// queryFx({tendererId:tendererId,tdocId:tdocId,tdocCatalogId:'1319439263309234001'}).then(()=>{
|
||||
console.log(id);
|
||||
|
||||
let columnfx: any = [];
|
||||
let fxData: any = [];
|
||||
await queryFx({ tendererId: '1333952419993747456', tdocId: '1319439263309234176', tdocCatalogId: '1319439263309234001' }).then((res) => {
|
||||
await queryFx({ tendererId: record.tendererId, tdocId: id, tdocCatalogId: record.tdocCatalogId }).then((res) => {
|
||||
console.log(res);
|
||||
|
||||
if (res.data != undefined) {
|
||||
@ -441,10 +490,11 @@ const Room: React.FC<{}> = () => {
|
||||
for (const key in priD) {
|
||||
let one = {};
|
||||
one["key"] = fxIndex;
|
||||
console.log(priD[key]);
|
||||
// console.log(priD[key]);
|
||||
for (const key2 in priD[key]) {
|
||||
one[`${key2}`] = priD[key][key2]['evaluatingContent'];
|
||||
}
|
||||
fxIndex = fxIndex + 1;
|
||||
fxData.push(one);
|
||||
}
|
||||
// console.log(fxData);
|
||||
@ -461,10 +511,10 @@ const Room: React.FC<{}> = () => {
|
||||
title="分项报价表"
|
||||
width={'60%'}
|
||||
destroyOnClose
|
||||
bodyStyle={{ padding: '32px 40px 48px', overflowY: 'auto' }}
|
||||
bodyStyle={{ padding: '32px 40px 48px', overflowY: 'auto', height: '500px' }}
|
||||
visible={subentryVis}
|
||||
footer={false}
|
||||
onCancel={() => handleSubentryVis(false)}
|
||||
onCancel={() => {handleSubentryVis(false);fxDataSet([])}}
|
||||
>
|
||||
<ProTable
|
||||
columns={columnsFx}//表格
|
||||
|
@ -40,8 +40,6 @@ export async function jieMi(params?: any) {
|
||||
}
|
||||
//解密进度
|
||||
export async function jmRate(params?: any) {
|
||||
console.log(params);
|
||||
|
||||
return request(`/api/biz-service-ebtp-resps/v1/tfile/getDecryptProgress`,{
|
||||
method:'POST',
|
||||
data:{
|
||||
@ -75,4 +73,8 @@ export async function queryFx(params?: any) {
|
||||
...params
|
||||
}
|
||||
});
|
||||
}
|
||||
//查看分项报价
|
||||
export async function confirmOffer(reviewTurnId?: any) {
|
||||
return request(`/api/biz-service-ebtp-tender/v1/supplier_register/update/sign/${reviewTurnId}`);
|
||||
}
|
Reference in New Issue
Block a user