3.28 开标列表刷新
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useRef, useState, } from 'react';
|
import React, { useEffect, useRef, useState, } from 'react';
|
||||||
import { Spin, message, Popconfirm, Button, Modal } from 'antd';
|
import { Spin, message, Popconfirm, Button, Modal } from 'antd';
|
||||||
import ProTable, { ActionType, ProColumns } from '@ant-design/pro-table';
|
import ProTable, { ActionType, ProColumns } from '@ant-design/pro-table';
|
||||||
import { updateState, getList, getListGys, getMan } from './service';
|
import { updateState, getList, getListGys, getMan, getListStatus } from './service';
|
||||||
import { getProId, getSessionRoleData, getProMethod } from '@/utils/session';
|
import { getProId, getSessionRoleData, getProMethod } from '@/utils/session';
|
||||||
import FileDown from '@/utils/Download';
|
import FileDown from '@/utils/Download';
|
||||||
import { getURLInformation } from '@/utils/CommonUtils'
|
import { getURLInformation } from '@/utils/CommonUtils'
|
||||||
@ -54,6 +54,8 @@ const Sing: React.FC<{}> = () => {
|
|||||||
//控制字段 角色、开标状态、唱标阶段、是否需要ipass解密
|
//控制字段 角色、开标状态、唱标阶段、是否需要ipass解密
|
||||||
const juese = getSessionRoleData().roleCode//ebtp-agency-project-manager 代理 ebtp-supplier 供应商
|
const juese = getSessionRoleData().roleCode//ebtp-agency-project-manager 代理 ebtp-supplier 供应商
|
||||||
const [data, dataSet] = useState<any>([]);
|
const [data, dataSet] = useState<any>([]);
|
||||||
|
const dataRef = useRef<any>([]);//存储ref定时器使用
|
||||||
|
dataRef.current = data;
|
||||||
const [count, countSet] = useState<any>(0);
|
const [count, countSet] = useState<any>(0);
|
||||||
const [pageData, pageDataSet] = useState<any>({
|
const [pageData, pageDataSet] = useState<any>({
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
@ -63,21 +65,26 @@ const Sing: React.FC<{}> = () => {
|
|||||||
const { confirm } = Modal;
|
const { confirm } = Modal;
|
||||||
let showNameT: any = { tbr: '', bd: '', kb: '' }//投标人供应商
|
let showNameT: any = { tbr: '', bd: '', kb: '' }//投标人供应商
|
||||||
if (method === 'procurement_mode_1' || method === 'procurement_mode_2') {//招标
|
if (method === 'procurement_mode_1' || method === 'procurement_mode_2') {//招标
|
||||||
showNameT = { tbr: '投标人', bd: '标段', kb: '开标' };
|
showNameT = { tbr: '投标人', bd: '标段', kb: '开标' };
|
||||||
} else {
|
} else {
|
||||||
showNameT = { tbr: '供应商', bd: '采购包', kb: '开启' }
|
showNameT = { tbr: '供应商', bd: '采购包', kb: '开启' }
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (juese === 'ebtp-supplier') {
|
if (juese === 'ebtp-supplier') {
|
||||||
getDataGys();
|
getDataGys();
|
||||||
}else {
|
} else {
|
||||||
getData();
|
getData();
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
}, [pageData])
|
||||||
countSet(count + 1)
|
|
||||||
}, 2000);
|
useEffect(() => {
|
||||||
}, [count, pageData])
|
if (juese === 'ebtp-supplier') {
|
||||||
|
getStatusGys();
|
||||||
|
setTimeout(() => {
|
||||||
|
countSet(count + 1)
|
||||||
|
}, 5000);
|
||||||
|
}
|
||||||
|
}, [count])
|
||||||
async function getData() {//代理获取列表
|
async function getData() {//代理获取列表
|
||||||
await getList({ projectId: getProId(), ...pageData, roomType: roomType }).then((res) => {
|
await getList({ projectId: getProId(), ...pageData, roomType: roomType }).then((res) => {
|
||||||
if (res?.code == 200) {
|
if (res?.code == 200) {
|
||||||
@ -92,6 +99,22 @@ const Sing: React.FC<{}> = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
async function getStatusGys() {//供应商获取列表状态
|
||||||
|
if (dataRef.current?.records) {
|
||||||
|
let tableData = JSON.parse(JSON.stringify(dataRef.current));
|
||||||
|
const ids: any[] = tableData.records.map((item: any) => item?.id);
|
||||||
|
await getListStatus(ids).then((res) => {
|
||||||
|
if (res?.code == 200) {
|
||||||
|
const resData = res?.data
|
||||||
|
tableData.records = tableData.records.map((item: any) => {
|
||||||
|
item.roomState = resData.filter((i: any) => i.id == item.id)[0]?.roomState;
|
||||||
|
return item;
|
||||||
|
})
|
||||||
|
dataSet(tableData);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function showConfirm(record: any) {//环节流转提示
|
async function showConfirm(record: any) {//环节流转提示
|
||||||
confirm({
|
confirm({
|
||||||
@ -133,8 +156,8 @@ const Sing: React.FC<{}> = () => {
|
|||||||
{
|
{
|
||||||
title: '操作', valueType: 'option', width: 270,
|
title: '操作', valueType: 'option', width: 270,
|
||||||
render: (_, record) => {
|
render: (_, record) => {
|
||||||
const endTime = new Date(record.docEndTime?.replace(/-/g,'/'))
|
const endTime = new Date(record.docEndTime?.replace(/-/g, '/'))
|
||||||
const currentTime = new Date(record.systemDate?.replace(/-/g,'/'))
|
const currentTime = new Date(record.systemDate?.replace(/-/g, '/'))
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{
|
{
|
||||||
@ -209,6 +232,7 @@ const Sing: React.FC<{}> = () => {
|
|||||||
if (success) {
|
if (success) {
|
||||||
window.open(`/room/index?aa=${record.assessRoomId}&bb=${record.turnSort}&roomType=${roomType}`);
|
window.open(`/room/index?aa=${record.assessRoomId}&bb=${record.turnSort}&roomType=${roomType}`);
|
||||||
}
|
}
|
||||||
|
getData();
|
||||||
actionRef.current?.reload();
|
actionRef.current?.reload();
|
||||||
setSpin(false);
|
setSpin(false);
|
||||||
}
|
}
|
||||||
|
@ -2,14 +2,14 @@ import request from '@/utils/request';
|
|||||||
|
|
||||||
//获取列表
|
//获取列表
|
||||||
export async function getList(params?: any) {
|
export async function getList(params?: any) {
|
||||||
return request(`/api/biz-service-ebtp-opening/v1/bizbidopenroom/openRoomList/${params.projectId}`,{
|
return request(`/api/biz-service-ebtp-opening/v1/bizbidopenroom/openRoomList/${params.projectId}`, {
|
||||||
params:params
|
params: params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//获取列表gys
|
//获取列表gys
|
||||||
export async function getListGys(params?: any) {
|
export async function getListGys(params?: any) {
|
||||||
return request(`/api/biz-service-ebtp-opening/v1/bizbidopenroom/payerOpenRoomList/${params.projectId}`,{
|
return request(`/api/biz-service-ebtp-opening/v1/bizbidopenroom/payerOpenRoomList/${params.projectId}`, {
|
||||||
params:params
|
params: params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//获取北京时间
|
//获取北京时间
|
||||||
@ -18,9 +18,9 @@ export async function getTime() {
|
|||||||
}
|
}
|
||||||
//修改状态
|
//修改状态
|
||||||
export async function updateState(params?: any) {
|
export async function updateState(params?: any) {
|
||||||
return request(`/api/biz-service-ebtp-opening/v1/bizbidopenroom/updateOpenRoom/`,{
|
return request(`/api/biz-service-ebtp-opening/v1/bizbidopenroom/updateOpenRoom/`, {
|
||||||
method:'PUT',
|
method: 'PUT',
|
||||||
data:{
|
data: {
|
||||||
...params
|
...params
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -28,4 +28,11 @@ export async function updateState(params?: any) {
|
|||||||
//获取报名人数
|
//获取报名人数
|
||||||
export async function getMan(reviewTurnId?: any) {
|
export async function getMan(reviewTurnId?: any) {
|
||||||
return request(`/api/biz-service-ebtp-tender/v1/supplier_register/get_register/${reviewTurnId}`);
|
return request(`/api/biz-service-ebtp-tender/v1/supplier_register/get_register/${reviewTurnId}`);
|
||||||
|
}
|
||||||
|
//供应商获取列表状态接口
|
||||||
|
export async function getListStatus(params?: any[]) {
|
||||||
|
return request(`/api/biz-service-ebtp-opening/v1/bizbidopenroom/openRoomStateByIds`, {
|
||||||
|
method: 'POST',
|
||||||
|
data: params,
|
||||||
|
});
|
||||||
}
|
}
|
Reference in New Issue
Block a user