更新版本库
This commit is contained in:
@ -0,0 +1,415 @@
|
||||
import {BarsOutlined, UploadOutlined} from "@ant-design/icons"
|
||||
import {
|
||||
Button,
|
||||
Card, Carousel,
|
||||
Checkbox,
|
||||
Col,
|
||||
Collapse,
|
||||
DatePicker, Drawer,
|
||||
Form, Image,
|
||||
Input, List,
|
||||
message,
|
||||
Modal, Popover,
|
||||
Radio,
|
||||
Row,
|
||||
Spin,
|
||||
Upload
|
||||
} from "antd"
|
||||
import React, {useEffect, useRef, useState} from "react"
|
||||
import style from './style.less'
|
||||
import {GetNoticeMsg, GetNoticeUsablePackage, creatNotice, getChooseRoom, GetPublicityUsablePackage} from '../service'
|
||||
import moment from "moment";
|
||||
import Weboffice from "@/pages/webOffice/weboffice";
|
||||
import {deleteFileObjId, getFileBidList, SnowflakeID} from "@/services/untilService";
|
||||
|
||||
|
||||
interface BiddingAnnouncementProps {
|
||||
modalVisible: boolean;
|
||||
titleName: string;
|
||||
onCancel: () => void;
|
||||
type: string;
|
||||
tpId: "4419993030303037111";
|
||||
pkId: string;
|
||||
SX:()=>void;
|
||||
}
|
||||
|
||||
const layout = {
|
||||
labelCol: {span: 7},
|
||||
wrapperCol: {span: 10},
|
||||
};
|
||||
|
||||
|
||||
const BidPublicityResults: React.FC<BiddingAnnouncementProps> = (props) => {
|
||||
const {Panel} = Collapse;
|
||||
const {titleName, modalVisible, onCancel, type, tpId, pkId,SX} = props;
|
||||
const [form] = Form.useForm();
|
||||
const [spinning, setSping] = useState<boolean>(true);//加载遮罩
|
||||
const [TpPackageId, setTpPackageId] = useState<any[]>([]); //标包信息
|
||||
const [editInformation, setEditInformation] = useState<boolean>(false);//是否可编
|
||||
const [editInformation4Change, setEditInformation4Change] = useState<boolean>(false);//是否可编
|
||||
const [TpPackageName, setTpPackageName] = useState<string>("招标");
|
||||
|
||||
const [UploadList, setUploadList] = useState<any>(); //存upload列表
|
||||
const [UploadID, setUploadID] = useState<any>(); //upload 业务id
|
||||
|
||||
const [docFileCode, setDocFileCode] = useState<string>("");//文档id
|
||||
const [docBtnName, setDocBtnName] = useState<any>("");//文档按钮文字
|
||||
const [docReadOnly, setDocReadOnly] = useState<string>("false");//是否可编辑
|
||||
const [docSaveBtn, setDocSaveBtn] = useState<string>("compact");//保存按钮是否展示
|
||||
|
||||
/*20210112 新增 发布媒体限制*/
|
||||
const [mediaType, setmediaType] = useState<any>();
|
||||
|
||||
/*weboffice 相关*/
|
||||
const WebofficeRef = useRef<Weboffice>(null);
|
||||
const onRef = (ref) => {
|
||||
/* this.child= ref;*/
|
||||
}
|
||||
|
||||
|
||||
/*拉取数据 beg*/
|
||||
useEffect(() => {
|
||||
Int();
|
||||
form.resetFields();//清除form中数据
|
||||
}, [pkId, type]);
|
||||
useEffect(() => {
|
||||
UploadMethod();
|
||||
}, [UploadID]);
|
||||
const Int = () => {
|
||||
setSping(true);
|
||||
if (type == "cease") {
|
||||
return;
|
||||
} else if (type == "new") {//==========================================================新建
|
||||
GetPublicityUsablePackage(tpId).then(res => {
|
||||
if (res != null && res.message == "success") {
|
||||
let value = [];
|
||||
for (const item of res.data) {
|
||||
value.push({"label": item.bsName, "value": item.bsId})
|
||||
}
|
||||
SnowflakeID().then(res => {
|
||||
setUploadID(res.id);
|
||||
});
|
||||
setTpPackageId(value);
|
||||
setDocReadOnly("false");
|
||||
setDocSaveBtn("compact");
|
||||
setDocBtnName("新建")
|
||||
setSping(false);
|
||||
} else {
|
||||
message.error('数据拉取失败:'+res.message);
|
||||
onCancel();
|
||||
}
|
||||
});
|
||||
|
||||
setEditInformation(false);//可编辑
|
||||
} else if (type == "edit" || type == "change") {//==========================================================编辑
|
||||
GetPublicityUsablePackage(tpId).then(res => {
|
||||
if (res != null && res.message == "success") {
|
||||
let thisData1 = [];
|
||||
for (const item of res.data) {
|
||||
thisData1.push({"label": item.bsName, "value": item.bsId})
|
||||
}
|
||||
|
||||
GetNoticeMsg(pkId).then(res => {
|
||||
if (res != null && res.message == "success") {
|
||||
const data = res.data
|
||||
for (const item of data.sections) {
|
||||
thisData1.push({"label": item.bsName, "value": item.bsId})
|
||||
}
|
||||
setTpPackageId(thisData1);
|
||||
form.setFieldsValue({
|
||||
"docStartTime": moment(data.docStartTime, 'yyyy-MM-DD HH:mm:ss'),
|
||||
"docEndTime": moment(data.docEndTime, 'yyyy-MM-DD HH:mm:ss'),
|
||||
"annoTitle": data.annoTitle,
|
||||
"medias": data.medias,
|
||||
"sectionIds": data.sectionIds
|
||||
});
|
||||
setUploadID(data.attDatasetId)
|
||||
setDocFileCode(data.contentFileId);
|
||||
setDocReadOnly("false");
|
||||
setDocSaveBtn("compact");
|
||||
setDocBtnName("编辑");
|
||||
setSping(false);
|
||||
} else {
|
||||
onCancel();
|
||||
message.error('数据拉取失败:'+res.message);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
onCancel();
|
||||
message.error('数据拉取失败:'+res.message);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
setEditInformation(false);//可编辑
|
||||
} else if (type == "read") {//==========================================================查看
|
||||
GetNoticeMsg(pkId).then(res => {
|
||||
if (res != null && res.message == "success") {
|
||||
const data = res.data
|
||||
let value = [];
|
||||
for (const item of data.sections) {
|
||||
value.push({"label": item.bsName, "value": item.bsId})
|
||||
}
|
||||
setTpPackageId(value);
|
||||
form.setFieldsValue({
|
||||
"docStartTime": moment(data.docStartTime, 'yyyy-MM-DD HH:mm:ss'),
|
||||
"docEndTime": moment(data.docEndTime, 'yyyy-MM-DD HH:mm:ss'),
|
||||
"annoTitle": data.annoTitle,
|
||||
"medias": data.medias,
|
||||
"sectionIds": data.sectionIds
|
||||
});
|
||||
setUploadID(data.attDatasetId)
|
||||
setDocFileCode(data.contentFileId);
|
||||
setDocReadOnly("true");
|
||||
setDocSaveBtn("none");
|
||||
setDocBtnName("查看");
|
||||
setSping(false);
|
||||
} else {
|
||||
message.error('数据拉取失败:'+res.message);
|
||||
onCancel();
|
||||
}
|
||||
});
|
||||
setEditInformation(true);//只读
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
/*拉取数据 end*/
|
||||
|
||||
|
||||
/*提交数据*/
|
||||
const onFinish = (data: any) => {
|
||||
if (check("") == "true") {
|
||||
const packageMsg = [];
|
||||
for (const item of TpPackageId) {//包数据
|
||||
for (const item1 of form.getFieldValue("sectionIds")) {
|
||||
if (item.value == item1) {
|
||||
packageMsg.push({"bsId": item.value, "bsName": item.label})
|
||||
}
|
||||
}
|
||||
}
|
||||
const fromData = {
|
||||
"id":pkId,
|
||||
"annoNature": 201,
|
||||
"tpId": tpId,
|
||||
"attDatasetId": UploadID,
|
||||
"source": 12,//来源(1:预审公示;2:预审公示;11:资审公示;12资审公示;21:邀请函)
|
||||
"annoTitle": form.getFieldValue("annoTitle"),
|
||||
"docStartTime": form.getFieldValue("docStartTime").format("yyyy-MM-DD HH:mm:ss").toString(),
|
||||
"docEndTime": form.getFieldValue("docEndTime").format("yyyy-MM-DD HH:mm:ss").toString(),
|
||||
"medias": form.getFieldValue("medias").toString(),
|
||||
"sections": packageMsg,
|
||||
"contentFileId":WebofficeRef.current!.DocfileCode,
|
||||
}
|
||||
creatNotice(type, fromData).then(res => {
|
||||
if (res != null && res.message == "success") {
|
||||
message.success("成功");
|
||||
onCancel();
|
||||
SX();
|
||||
} else {
|
||||
message.error("保存失败:"+res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
/*提交数据 end*/
|
||||
|
||||
/*提交数据校验 beg*/
|
||||
const check = (data: any) => {
|
||||
let msg = "false";
|
||||
if (form.getFieldValue("docStartTime") < moment().format('YYYY-MM-DD')) {
|
||||
message.warn('公示开始时间需大于当前时间');
|
||||
} else if (moment(form.getFieldValue("docEndTime")).diff(form.getFieldValue("docStartTime"), "days") < 3) {
|
||||
message.warn('公示结束时间与公示开始时间需大于3天');
|
||||
} else {
|
||||
msg = "true"
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
/*提交数据校验 end*/
|
||||
|
||||
|
||||
const renderFooter = () => {
|
||||
if (type == "read") {
|
||||
return (
|
||||
<>
|
||||
<Button onClick={onCancel}>确认</Button>
|
||||
</>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<>
|
||||
<Button onClick={onFinish}>确认</Button>
|
||||
<Button onClick={onCancel}>取消</Button>
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/*upload*/
|
||||
const UploadMethod = async () => {
|
||||
await getFileBidList(UploadID).then(res => {
|
||||
setUploadList(res)
|
||||
})
|
||||
}
|
||||
const UploadOnchange = async (file) => {
|
||||
let fileMsg = file.file;
|
||||
if (fileMsg.status === 'removed') {
|
||||
await deleteFileObjId(fileMsg.uid)
|
||||
setUploadList(file.fileList)
|
||||
}
|
||||
if (fileMsg.status === 'done') {
|
||||
message.success("上传成功");
|
||||
await UploadMethod();
|
||||
} else if (fileMsg.status === 'error') {
|
||||
message.error("上传失败");
|
||||
}
|
||||
}
|
||||
const testCheck = (checkedParam: any) => {
|
||||
if (checkedParam.indexOf("9") > -1) {
|
||||
form.setFieldsValue({
|
||||
"medias":"9",
|
||||
});
|
||||
setmediaType(true);
|
||||
} else{
|
||||
setmediaType(false);
|
||||
}
|
||||
|
||||
}
|
||||
return (
|
||||
<Modal forceRender
|
||||
destroyOnClose
|
||||
title={titleName}
|
||||
visible={modalVisible}
|
||||
className="返回"
|
||||
onCancel={() => onCancel()}
|
||||
width={1000}
|
||||
bodyStyle={{padding: '32px 40px 48px', height: "600px", overflowY: 'auto'}}
|
||||
footer={renderFooter()}
|
||||
><Spin spinning={spinning}>
|
||||
<Card>
|
||||
<Form
|
||||
{...layout}
|
||||
name="basic"
|
||||
form={form}
|
||||
>
|
||||
|
||||
<Form.Item
|
||||
label="公示名称"
|
||||
name="annoTitle"
|
||||
validateStatus="error"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '当前项不可为空',
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input readOnly={editInformation || editInformation4Change}/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={"公示开始时间"}
|
||||
name="docStartTime"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '当前项不可为空',
|
||||
},
|
||||
]}
|
||||
>
|
||||
<DatePicker disabled={editInformation || editInformation4Change} format={"yyyy-MM-DD HH:mm:ss"} showTime
|
||||
style={{width: "100%"}}/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={"公示结束时间"}
|
||||
name="docEndTime"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '当前项不可为空',
|
||||
},
|
||||
]}
|
||||
>
|
||||
<DatePicker disabled={editInformation} showTime style={{width: "100%"}}/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="关联标段"
|
||||
name="sectionIds"
|
||||
>
|
||||
{/*标包信息*/}
|
||||
<Checkbox.Group
|
||||
options={TpPackageId}
|
||||
disabled={editInformation || editInformation4Change}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="附件文件"
|
||||
name="attDatasetId"
|
||||
>
|
||||
<div className={style.bidding}>
|
||||
<div className="uploadTotal">
|
||||
<Upload
|
||||
action={'/api/core-service-ebtp-updownload/v1/attachment/upload'}
|
||||
data={{"businessId": UploadID}}
|
||||
fileList={UploadList}
|
||||
onChange={UploadOnchange}
|
||||
>
|
||||
<Button type="primary" disabled={editInformation || editInformation4Change}
|
||||
className="upload"><UploadOutlined/>上传附件</Button>
|
||||
</Upload>
|
||||
<p className="uploadLabel">最大能上传10M文件!</p>
|
||||
</div>
|
||||
</div>
|
||||
</Form.Item>
|
||||
|
||||
<Collapse defaultActiveKey={['1', '2']} ghost expandIcon={() => <BarsOutlined/>}>
|
||||
<Panel header="公示发布媒体" key="1">
|
||||
<Form.Item
|
||||
name="medias"
|
||||
>
|
||||
<Checkbox.Group style={{width: '100%'}} className={style.bidding}
|
||||
onChange={testCheck}
|
||||
disabled={editInformation || editInformation4Change}>
|
||||
|
||||
<Row>
|
||||
<Col span={24}>
|
||||
<Checkbox disabled={mediaType} key={"1"} value="1">中国联通采购与招标网</Checkbox>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<Checkbox disabled={mediaType} key={"2"} value="2">中国采购与招标网</Checkbox>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<Checkbox disabled={mediaType} key={"3"} value="3">合作方门户网站</Checkbox>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<Checkbox disabled={mediaType} key={"5"} value="5">中国联通电子商城外网接入平台</Checkbox>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<Checkbox disabled={mediaType} key={"6"} value="6">中国招标投标公共服务平台</Checkbox>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<Checkbox key={"9"} value="9">无需推送至外网媒体</Checkbox>
|
||||
</Col>
|
||||
</Row>
|
||||
</Checkbox.Group>
|
||||
</Form.Item>
|
||||
</Panel>
|
||||
<Panel header="公示发布内容" key="2">
|
||||
<Card style={{textAlign: "center"}}>
|
||||
{docBtnName != "" ? (
|
||||
<Weboffice key={""} memberBtnName={docBtnName} readonly={docReadOnly} btnStyle={docSaveBtn}
|
||||
btnName={"保存"}
|
||||
DocfileCode={docFileCode} PDFfileCode={""} ref={WebofficeRef} onRef={onRef}/>) : null}
|
||||
</Card>
|
||||
</Panel>
|
||||
</Collapse>
|
||||
</Form>
|
||||
</Card>
|
||||
</Spin>
|
||||
</Modal>
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
export default BidPublicityResults
|
@ -0,0 +1,69 @@
|
||||
//新增招标公告
|
||||
.bidding {
|
||||
margin-bottom: 8px;
|
||||
:global {
|
||||
.biddingLabel {
|
||||
width: 30%;
|
||||
display: inline-block;
|
||||
text-align: right;
|
||||
// padding-left: 20px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
.biddingIndex {
|
||||
width: 40%;
|
||||
display: inline-block;
|
||||
justify-content: right;
|
||||
}
|
||||
.biddingDatePicker {
|
||||
width: 40%;
|
||||
}
|
||||
.biddingRadio {
|
||||
// display: inline-block;
|
||||
width: 40%;
|
||||
margin-top:24px;
|
||||
}
|
||||
.ant-row .ant-col {
|
||||
margin: 6px 0px;
|
||||
}
|
||||
.uploadTotal {
|
||||
display: inline-block;
|
||||
width: 40%;
|
||||
.upload {
|
||||
--antd-wave-shadow-color:#1c84c6;
|
||||
background: #1c84c6;
|
||||
color:#fff;
|
||||
border-color: #1c84c6;
|
||||
}
|
||||
.uploadLabel {
|
||||
// display: inline;
|
||||
font-size: 13px;
|
||||
color: #c8ced1;
|
||||
margin-top: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.announcementFootButton {
|
||||
:global{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 15px;
|
||||
.save{
|
||||
--antd-wave-shadow-color:#f7ab59;
|
||||
background: #f7ab59;
|
||||
color:#fff;
|
||||
border-color: #f7ab59;
|
||||
}
|
||||
}
|
||||
}
|
||||
//招标公告
|
||||
.label {
|
||||
:global {
|
||||
color:#f62a2b;
|
||||
}
|
||||
}
|
||||
.ant-pro-table-toolbar {
|
||||
:global {
|
||||
margin: -12px 0px;
|
||||
}
|
||||
}
|
35
src/pages/Calibration/BidPublicityResult/data.d.ts
vendored
Normal file
35
src/pages/Calibration/BidPublicityResult/data.d.ts
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
export interface NoticeData {
|
||||
key?: number;
|
||||
annoEndTime?:string;//结束日期
|
||||
annoNature?:string;//性质(“1”表示“正常公告”;“4”表示“失败公告”;“7”表示“变更公告”;“8”表示“再次发布的公告;“101”表示邀请函;“201”表示公示。)
|
||||
annoProjType?:string;//项目类型(项目类型分为三类,货物,工程和服务。可以修改。)
|
||||
annoStartTime?:string;//发布时间
|
||||
annoTitle?:string;//标题
|
||||
annoType?:string;//类型(跟随项目cgfs)
|
||||
attDatasetId?:string;//附件集id
|
||||
contentText?:string;// 内容文本
|
||||
contentTextWithStyle?:string;//正文(带格式)
|
||||
csAnnoId?:string;//初始公告id(变更公告存储该字段,其它公告不存储)
|
||||
docEndTime?:string;//招标文件获取截止时间(购标结束时间)
|
||||
docStartTime?:string;//招标文件获取开始时间(购标开始时间)
|
||||
docSubmitMethod?:string;//招标文件递交方式//去掉
|
||||
id?:number;//主键id
|
||||
medias?:string;//选择的媒体,以英文,分隔
|
||||
openhallId?:number;//开标大厅
|
||||
openhallTitle?:string;//开标大厅名称
|
||||
openingPlace?:string;//开标地点
|
||||
openingTime?:string;//开标时间
|
||||
openingWay?:string;//开标方式
|
||||
replyEndTime?:string;//应答截至时间
|
||||
sectionIds?:string;//关联的包id,以英文,分隔
|
||||
sectionNames?:string;//关联的包名称,以英文,分隔
|
||||
sections?:[{
|
||||
bsId?:number;//包id
|
||||
bsName?:string;//包名称
|
||||
}];
|
||||
source?:number;//来源(1:预审公告;2:预审公示;11:资审公告;12资审公示;21:邀请函)
|
||||
status?:number;//业务状态(1:起草,2:已提交,3已审批,4:已拒绝,5已发布,6:发布失败,9:异常)
|
||||
tpId?:number;//招标项目表主键
|
||||
|
||||
}
|
||||
|
353
src/pages/Calibration/BidPublicityResult/index.tsx
Normal file
353
src/pages/Calibration/BidPublicityResult/index.tsx
Normal file
@ -0,0 +1,353 @@
|
||||
import { UnorderedListOutlined } from "@ant-design/icons"
|
||||
import ProTable, {ActionType, ProColumns} from "@ant-design/pro-table"
|
||||
import {Button, Card, Divider, Drawer, message, Modal, Spin, Table} from "antd"
|
||||
import React, {useEffect, useRef, useState} from "react"
|
||||
import {
|
||||
GetfileList,
|
||||
GetNoticeList,
|
||||
removeNotice,
|
||||
releaseNotice,
|
||||
releaseNoticeAgain,
|
||||
ApprovalNotice,
|
||||
GetNoticeUsablePackage, GetPublicityUsablePackage
|
||||
} from "./service"
|
||||
import style from "./components/style.less"
|
||||
import BidPublicityResults from "@/pages/Calibration/BidPublicityResult/components/BidPublicityResults";
|
||||
import {getProId} from "@/utils/session";
|
||||
|
||||
/*
|
||||
* 招标公示开始
|
||||
*/
|
||||
interface DataItem {
|
||||
key:number,
|
||||
announcementName: string,
|
||||
associatedPackage: string,
|
||||
writeTime: Date,
|
||||
announcementState: string,
|
||||
onSubmit: (values: any) => void;//点击保存的回调
|
||||
}
|
||||
|
||||
|
||||
const BidPublicityResult: React.FC<{}> = (props) => {
|
||||
const [Refresh, setRefresh] = useState<any>(Math.random);
|
||||
const [selectedRowsState, setSelectedRows] = useState<DataItem[]>([]);
|
||||
const [updateVisible, setUpdateVisible] = useState<boolean>(false)
|
||||
const [updateChange, setUpdateChange] = useState<string>('');//弹窗名
|
||||
const [type, setType] = useState<any>('cease');//弹窗类型
|
||||
const [pkId,setPkId] =useState<string>();//公示/邀请函id
|
||||
const [tpId,setTpId] = useState<any>(getProId);//项目id
|
||||
const [dataSource,setdataSource]= useState<any[]>([]); //公示列表数据
|
||||
const [dataSourcePage,setDataSourcePage] = useState<any>(1);//当前页数
|
||||
const [dataSourceAllNum,setDataSourceAllNum] = useState<any>();//总行数
|
||||
const [dataSourceNum,setDataSourceNum] = useState<any>(20);//当前每页行数
|
||||
const [ChangeNoticeListVisible,setChangeNoticeListVisible] =useState<boolean>(false); //变更公示列表窗状态
|
||||
const [ChangeNoticeListdataSource,setChangeNoticeListdataSource]= useState<any[]>([]); //变更公示列表数据
|
||||
|
||||
const [pageloading,setPageloading]=useState<boolean>(false);//加载遮罩
|
||||
|
||||
|
||||
|
||||
const columns: ProColumns<DataItem>[] = [
|
||||
{
|
||||
title: '公示名称',
|
||||
dataIndex: 'annoTitle',
|
||||
key:'annoTitle',
|
||||
align:'center',
|
||||
|
||||
},
|
||||
{
|
||||
title: '关联标段',
|
||||
dataIndex: 'sectionNames',
|
||||
key:'sectionNames',
|
||||
align:'center',
|
||||
},
|
||||
{
|
||||
title: '起草时间',
|
||||
dataIndex: 'annoStartTime',
|
||||
key:"annoStartTime",
|
||||
align:'center',
|
||||
valueType: 'dateTime',
|
||||
},
|
||||
{
|
||||
title: '公示状态',
|
||||
dataIndex: 'status',
|
||||
key:"status",
|
||||
align:'center',
|
||||
valueEnum: {
|
||||
1: { text: '起草', status: '' },
|
||||
2: { text: '已提交', status: '' },
|
||||
3: { text: '已审批', status: '' },
|
||||
4: { text: '已拒绝', status: '' },
|
||||
5: { text: '已发布', status: '' },
|
||||
6: { text: '发布失败', status: '' },
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'status',
|
||||
key:"",
|
||||
align:'center',
|
||||
render: (_:any, record: any) => {
|
||||
let btn1= (
|
||||
<>
|
||||
<a onClick={() => toEdit(record)}>编辑</a><Divider type="vertical"/>
|
||||
<a onClick={() => handleApproval(record)}>提交审批</a><Divider type="vertical"/>
|
||||
<a onClick={() => handleRemove(record)}>删除</a>
|
||||
</>
|
||||
);
|
||||
let btn2= (
|
||||
<>
|
||||
<a onClick={() => toRead(record)}>查看</a><Divider type="vertical"/>
|
||||
</>
|
||||
);
|
||||
let btn3= (
|
||||
<>
|
||||
<a onClick={() => handleRelease(record)}>发布</a><Divider type="vertical"/>
|
||||
<a onClick={() => toRead(record)}>查看</a>
|
||||
</>
|
||||
);
|
||||
let btn4= (
|
||||
<>
|
||||
<a onClick={() => toEdit(record)}>编辑</a><Divider type="vertical"/>
|
||||
<a onClick={() => handleApproval(record)}>提交审批</a><Divider type="vertical"/>
|
||||
<a onClick={() => handleRemove(record)}>删除</a>
|
||||
</>
|
||||
);
|
||||
let btn5= (
|
||||
<>
|
||||
<a onClick={() => toRead(record)}>查看</a><Divider type="vertical"/>
|
||||
<a onClick={() => handleReleaseAgain(record)}>再次发布</a><Divider type="vertical"/>
|
||||
</>
|
||||
);
|
||||
let btn6= (
|
||||
<>
|
||||
<a onClick={() => handleRelease(record)}>发布</a><Divider type="vertical"/>
|
||||
<a onClick={() => toRead(record)}>查看</a>
|
||||
</>
|
||||
);
|
||||
|
||||
/*if(true){
|
||||
return btn3;
|
||||
}else*/ if(record.status==1){
|
||||
return btn1;
|
||||
}else if(record.status==2){
|
||||
return btn2;
|
||||
}else if(record.status==3){
|
||||
return btn3;
|
||||
}else if(record.status==4){
|
||||
return btn4;
|
||||
}else if(record.status==5){
|
||||
return btn5;
|
||||
}else if(record.status==6){
|
||||
return btn6;
|
||||
} else {
|
||||
return (<></>)
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
];
|
||||
|
||||
/*拉取数据 beg*/
|
||||
useEffect(()=>{
|
||||
GetList("page")
|
||||
},[tpId,dataSourceNum,dataSourcePage,Refresh])
|
||||
|
||||
const GetList = (props: any)=>{
|
||||
setPageloading(true);
|
||||
if(props=="page"){//初始化页面
|
||||
GetNoticeList({
|
||||
"annoNature": 201,
|
||||
"annoTitle": "",
|
||||
"csAnnoId": "",
|
||||
"pageNo": dataSourcePage,
|
||||
"pageSize":dataSourceNum,
|
||||
"source": 12,
|
||||
"tpId": tpId
|
||||
}).then(res => {
|
||||
if(res!=null&&res.message=="success"){
|
||||
setdataSource(res.data.records)
|
||||
setDataSourceAllNum(res.total)
|
||||
} else{
|
||||
message.error('程序出错,亲您稍后在世');
|
||||
}
|
||||
setPageloading(false);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/*拉取数据 end*/
|
||||
|
||||
/*新增招标公示*/
|
||||
const toEditAdd = (props: any) => {
|
||||
GetPublicityUsablePackage(tpId).then(res=>{
|
||||
if (res != null && res.message == "success") {
|
||||
if (res.data.length == 0) {
|
||||
message.warn("没有可关联的标段!")
|
||||
}else{
|
||||
setUpdateVisible(true);
|
||||
setUpdateChange('新建中标候选人公示')
|
||||
setType("new");
|
||||
}
|
||||
}else {
|
||||
message.error("查询标段信息失败:"+res.message)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
}
|
||||
/*编辑招标公示*/
|
||||
const toEdit = (props: any) => {
|
||||
setUpdateVisible(true);
|
||||
setUpdateChange('编辑招标公示')
|
||||
setPkId(props.id);
|
||||
setType("edit");
|
||||
}
|
||||
/*查看招标公示*/
|
||||
const toRead = (props: any) => {
|
||||
setUpdateVisible(true);
|
||||
setUpdateChange('查看招标公示')
|
||||
setType("read");
|
||||
setPkId(props.id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 删除节点
|
||||
* @param selectedRows
|
||||
*/
|
||||
const handleRemove = async (record: any) => {
|
||||
setPageloading(true);
|
||||
removeNotice(record.id).then(res=>{
|
||||
if(res!=null&&res.message=="success"){
|
||||
message.success('删除成功');
|
||||
setRefresh(Math.random()+1);
|
||||
}else {
|
||||
message.error("删除失败:"+res.message);
|
||||
}
|
||||
setPageloading(false);
|
||||
});
|
||||
|
||||
};
|
||||
/**
|
||||
* 批量删除
|
||||
* */
|
||||
const handleRemoveMore = async () => {
|
||||
if(selectedRowsState.length!=0){
|
||||
setPageloading(true);
|
||||
let param=[]
|
||||
for(const item of selectedRowsState){
|
||||
param.push(item.id);
|
||||
}
|
||||
removeNotice(param).then(res=>{
|
||||
if(res!=null&&res.data){
|
||||
message.success('删除成功');
|
||||
setRefresh(Math.random()+1);
|
||||
}else {
|
||||
message.error("删除失败:"+res.message);
|
||||
}
|
||||
setPageloading(false);
|
||||
|
||||
});
|
||||
}
|
||||
};
|
||||
/**
|
||||
* 发布
|
||||
* */
|
||||
const handleRelease = async (record:any) => {
|
||||
setPageloading(true);
|
||||
releaseNotice(record.id).then(res=>{
|
||||
if(res!=null&&res.data){
|
||||
message.success('发布成功');
|
||||
setRefresh(Math.random()+1);
|
||||
}else {
|
||||
message.error('发布失败:'+res.message);
|
||||
}
|
||||
setPageloading(false);
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 再次发布
|
||||
* */
|
||||
const handleReleaseAgain = async (record:any) => {
|
||||
|
||||
setPageloading(true);
|
||||
releaseNoticeAgain(record.id).then(res=>{
|
||||
if(res!=null&&res.data){
|
||||
message.success('发布成功');
|
||||
setRefresh(Math.random()+1);
|
||||
}else {
|
||||
message.error('发布失败:'+res.message);
|
||||
}
|
||||
setPageloading(false);
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 发起审批
|
||||
* */
|
||||
const handleApproval = async (record:any) => {
|
||||
setPageloading(true);
|
||||
ApprovalNotice(record.id).then(res=>{
|
||||
if(res!=null&&res.data){
|
||||
message.success('发起审批成功');
|
||||
setRefresh(Math.random()+1);
|
||||
}else {
|
||||
message.error('发起审批失败:'+res.message);
|
||||
}
|
||||
setPageloading(false);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
<Card>
|
||||
<Divider style={{margin: "8px 0px"}}/>
|
||||
<div className={style.label}>
|
||||
<UnorderedListOutlined style={{marginRight: "8px"}}/>招标公示信息
|
||||
</div>
|
||||
<ProTable
|
||||
loading={pageloading}
|
||||
toolBarRender={() => [
|
||||
<Button key={"1"} type="primary" onClick={() => toEditAdd([])}>新建中选候选人公示</Button>,
|
||||
<Button key={"2"} onClick={()=>{handleRemoveMore()}}>批量删除</Button>,
|
||||
]}
|
||||
search={false}
|
||||
options={false}
|
||||
columns={columns}
|
||||
dataSource={dataSource}
|
||||
rowKey={"id"}
|
||||
rowSelection={{
|
||||
onChange: (_, selectedRows) => setSelectedRows(selectedRows),
|
||||
}}
|
||||
|
||||
pagination={{
|
||||
pageSize:dataSourceNum,
|
||||
current:dataSourcePage,
|
||||
total: dataSourceAllNum,
|
||||
pageSizeOptions:['10','20','50'],
|
||||
onShowSizeChange:((current, size)=>setDataSourceNum(size)),
|
||||
onChange:((page, pageSize)=>setDataSourcePage(page))
|
||||
}}
|
||||
|
||||
/>
|
||||
|
||||
</Card>
|
||||
{updateVisible?(
|
||||
<BidPublicityResults SX={()=>setRefresh(Math.random()+1)} titleName={updateChange} pkId={pkId} type={type} tpId={tpId} onCancel={() => setUpdateVisible(false)} modalVisible={updateVisible} />
|
||||
):null}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
export default BidPublicityResult
|
113
src/pages/Calibration/BidPublicityResult/service.ts
Normal file
113
src/pages/Calibration/BidPublicityResult/service.ts
Normal file
@ -0,0 +1,113 @@
|
||||
import request from '@/utils/request';
|
||||
// import {demo} from './data.d';
|
||||
|
||||
|
||||
/*公告列表请求*/
|
||||
export async function GetNoticeList(params?:any){
|
||||
console.log("公告列表请求");
|
||||
return request('/api/biz-service-ebtp-bid/v1/anno/pageList', {
|
||||
method: 'post',
|
||||
data: {
|
||||
...params
|
||||
},
|
||||
})
|
||||
}
|
||||
/*当前公告可用包请求*/
|
||||
export async function GetNoticeUsablePackage(params?:any){
|
||||
return request('/api/biz-service-ebtp-bid/v1/anno/tobs/'+params)
|
||||
}
|
||||
/*公告信息查询*/
|
||||
export async function GetNoticeMsg(params?:any){
|
||||
return request('/api/biz-service-ebtp-bid/v1/anno/'+params)
|
||||
}
|
||||
/*创建公告*/
|
||||
export async function creatNotice(type:any,params?:any){
|
||||
let method="post";
|
||||
if(type=="edit")
|
||||
method="put";
|
||||
return request('/api/biz-service-ebtp-bid/v1/anno', {
|
||||
method: method,
|
||||
data: {
|
||||
...params
|
||||
},
|
||||
})
|
||||
}
|
||||
/*删除公告*/
|
||||
export async function removeNotice(params?:any){
|
||||
let method="delete";
|
||||
return request('/api/biz-service-ebtp-bid/v1/anno/'+params,{method:method})
|
||||
}
|
||||
/*发布公告*/
|
||||
export async function releaseNotice(params?:any){
|
||||
let method="post";
|
||||
return request('/api/biz-service-ebtp-bid/v1/anno/publish/'+params,{
|
||||
method:method,
|
||||
data: {
|
||||
...params
|
||||
},
|
||||
})
|
||||
}
|
||||
/*再次发布公告*/
|
||||
export async function releaseNoticeAgain(params?:any) {
|
||||
let method = "post";
|
||||
return request('/api/biz-service-ebtp-bid/v1/anno/republish/' + params, {
|
||||
method: method,
|
||||
data: {
|
||||
...params
|
||||
},
|
||||
})
|
||||
}
|
||||
/*公告发起审批*/
|
||||
export async function ApprovalNotice(params?:any) {
|
||||
let method = "post";
|
||||
return request('/api/biz-service-ebtp-bid/v1/anno/approval/' + params, {
|
||||
method: method,
|
||||
data: {
|
||||
...params
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
export async function GetfileList(params?: any) {
|
||||
console.log("招标文件列表请求");
|
||||
return request('/api/biz-service-ebtp-bid/v1/document/pageList', {
|
||||
method: 'post',
|
||||
data: {
|
||||
...params
|
||||
},
|
||||
})
|
||||
}
|
||||
export async function GetfileUsablePackage(params?: any) {
|
||||
console.log("当前招标文件可用包请求");
|
||||
return request('/api/biz-service-ebtp-bid/v1/document/tobs/getSectionList/'+params)
|
||||
}
|
||||
export async function GetfileMsg(params?: any) {
|
||||
console.log("当前招标文件信息查询");
|
||||
console.log(params)
|
||||
return request('/api/biz-service-ebtp-bid/v1/document/'+params)
|
||||
}
|
||||
export async function creatfile(type:any,params?:any){
|
||||
let method="post";
|
||||
if(type=="edit")
|
||||
method="put";
|
||||
return request('/api/biz-service-ebtp-bid/v1/document', {
|
||||
method: method,
|
||||
data: {
|
||||
...params
|
||||
},
|
||||
})
|
||||
}
|
||||
export async function removefile(params?:any){
|
||||
let method="delete";
|
||||
return request('/api/biz-service-ebtp-bid/v1/document/'+params,{method:method})
|
||||
}
|
||||
/*开标大厅选择*/
|
||||
export async function getChooseRoom(params?:any){
|
||||
let method="get";
|
||||
return request('/api/biz-service-ebtp-bid/v1/bizbidopenhall/list?opendate'+params,{method:method})
|
||||
}
|
||||
|
||||
/*当前公示可用包请求*/
|
||||
export async function GetPublicityUsablePackage(params?:any){
|
||||
return request('/api/biz-service-ebtp-bid/v1/anno/tobs/pub/'+params);
|
||||
}
|
Reference in New Issue
Block a user