3.10 工程代码同步master

This commit is contained in:
jl-zhoujl2
2022-03-10 14:24:13 +08:00
parent 41ab55a4ac
commit 62f6b07ee2
914 changed files with 143121 additions and 29110 deletions

View File

@ -0,0 +1,132 @@
import { UnorderedListOutlined } from "@ant-design/icons"
import ProTable, { ActionType, ProColumns } from "@ant-design/pro-table"
import { Button, Card, Divider, message } from "antd"
import React, { useEffect, useRef, useState } from "react"
import BiddingDocument from "./components/BiddingDocument"
import {
GetfileList,
GetfileUsablePackage,
removefile,
} from "./service"
import { getProId } from "@/utils/session";
interface DataItem {
key: number,
biddingDocument: string,
associatedPackage: string,
writeTime: Date,
}
/*
*
*
* */
const BiddingDocumentList: 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 [dataSource, setDataSource] = useState<any[]>([]);
const [type, setType] = useState<any>();// 状态 编辑or 查看
const [tpId, setTpId] = useState<any>(getProId);//项目id
const [pkId, setPkId] = useState<any>("");//公告id
const [dataSourcePage, setDataSourcePage] = useState<any>(1);//当前页数
const [dataSourceAllNum, setDataSourceAllNum] = useState<any>();//总行数
const [dataSourceNum, setDataSourceNum] = useState<any>(10);//当前每页行数
const [pageloading, setPageloading] = useState<boolean>(false);//加载遮罩
const columns: ProColumns<DataItem>[] = [
{
title: '询价文件',
dataIndex: 'documentName',
align: 'left',
},
{
title: '采购包名称',
dataIndex: 'sectionNames',
align: 'left',
},
{
title: '起草时间',
dataIndex: 'createDate',
// dataIndex: 'docStartTime',
align: 'left',
valueType: 'dateTime',
},
{
title: '操作',
dataIndex: 'status',
align: 'left',
render: (_: any, record: any) => {
return (<Button type="text" onClick={() => toRead(record)}></Button>)
}
}
];
useEffect(() => {
setPageloading(true);
GetfileList({
"pageNo": dataSourcePage,
"pageSize": dataSourceNum,
"tpId": tpId,
"roomType": "2",
}).then(res => {
if (res.code == 200) {
setDataSource(res.data.records)
setDataSourceAllNum(res.data.total)
}
setPageloading(false);
})
}, [tpId, dataSourcePage, dataSourceNum, Refresh])
const toRead = (props: any) => {
setUpdateChange('查看询价文件')
setPkId(props.id)
setType("read");
setUpdateVisible(true);
}
return (
<div style={{ padding: '24px 24px 0px' }}>
<ProTable
loading={pageloading}
size={"small"}
search={false}
options={false}
columns={columns}
dataSource={dataSource}
rowKey={"id"}
rowSelection={{
onChange: (_, selectedRows) => setSelectedRows(selectedRows),
}}
pagination={{
pageSize: dataSourceNum,
current: dataSourcePage,
total: dataSourceAllNum,
showQuickJumper: true,
pageSizeOptions: ['10', '20', '50'],
onShowSizeChange: ((current, size) => setDataSourceNum(size)),
onChange: ((page, pageSize) => setDataSourcePage(page))
}}
/>
{updateVisible ? (
<BiddingDocument key={Math.random()} SX={() => setRefresh(Math.random() + 1)} titleName={updateChange}
type={type} tpId={tpId} pkId={pkId} onCancel={() => setUpdateVisible(false)}
modalVisible={updateVisible} />
) : null}
</div>
)
}
export default BiddingDocumentList

View File

@ -0,0 +1,153 @@
import {Button, Checkbox, Form, Input, Modal, Spin} from "antd"
import React, {useEffect, useState} from "react"
import { GetfileMsg, GetfileMsgEnclosure} from "../service";
import {downloadAttachmentPathOId} from "@/utils/DownloadUtils";
import {isEmpty} from "@/utils/CommonUtils";
interface BiddingDocumentProps {
modalVisible: boolean;
titleName: string;
onCancel: () => void;
type: string;
tpId: string;
pkId: string;
SX: () => void;
}
const layout = {
labelCol: {span: 7},
wrapperCol: {span: 10},
};
const BiddingDocument: React.FC<BiddingDocumentProps> = (props) => {
const {titleName, modalVisible, onCancel, type, pkId} = props;
const [TpPackageId, setTpPackageId] = useState<any[]>([]); //标包信息
const [spinning, setSping] = useState<boolean>();//加载遮罩
const [editInformation, setEditInformation] = useState<boolean>(false);//是否可编
const [form] = Form.useForm();
const [enquiryForm, setEnquiryForm] = useState<any>(); //upload 业务id
const disposeEnquiryForm = (arr: any[]) => {
let data: any[] = [];
if (isEmpty(arr)) {
return data;
}
for (const item of arr) {
data.push(
<>
<a key={item.fileId} href={downloadAttachmentPathOId + item.fileId}>{item.fileName}</a>
<br/>
</>
)
}
return data;
}
useEffect(() => {
Int();
form.resetFields();//清除form中数据
}, [type, pkId]);
const Int = () => {
setSping(true);
GetfileMsg(pkId).then(res => {
if (res.code == 200) {
const data = res.data;
let thisData1 = [];
let defPak = [];
for (const item of data.sections) {
thisData1.push({"label": item.bsName, "value": item.bsId})
defPak.push(item.bsId);
}
GetfileMsgEnclosure(defPak[0]).then(res2 => {
if (res2.code == 200) {
let data = res2.data;
setEnquiryForm(
<Form labelCol={{span: 9}}>
<Form.Item label="询价文件" className="item-margin-top">
{disposeEnquiryForm(data['1'])}
</Form.Item>
<Form.Item label="项目需求或技术方案" className="item-margin-top">
{disposeEnquiryForm(data['2'])}
</Form.Item>
<Form.Item label="其它附件" className="item-margin-top">
{disposeEnquiryForm(data['3'])}
</Form.Item>
</Form>
);
}
})
setTpPackageId(thisData1);
form.setFieldsValue({
"documentName": data.documentName,
"documentSetId": data.documentSetId,
"sectionIds": defPak,
},
)
setSping(false);
setEditInformation(true)
}
});
/*upload*/
}
return (
<Modal
mask={true}
destroyOnClose
title={titleName}
visible={modalVisible}
onCancel={() => onCancel()}
className="返回"
width={"60%"}
style={{top: "2%", height: "96%", overflowY: "auto"}}
bodyStyle={{paddingTop: "16px"}}
footer={<Button onClick={onCancel}></Button>}
>
<Spin spinning={spinning}>
<Form
{...layout}
name="basic"
form={form}
>
<Form.Item
label="文件名称"
name="documentName"
rules={[
{
required: true,
message: '当前项不可为空',
},
]}
>
<Input readOnly={editInformation}/>
</Form.Item>
<Form.Item
label="关联采购包"
name="sectionIds"
rules={[
{
required: true,
message: '当前项不可为空',
},
]}
>
<Checkbox.Group
options={TpPackageId}
style={{width: '100%'}}
disabled={editInformation}
>
</Checkbox.Group>
</Form.Item>
{enquiryForm}
</Form>
</Spin>
</Modal>
)
}
export default BiddingDocument

View File

@ -0,0 +1,23 @@
import request from '@/utils/request';
// import {demo} from './data.d';
export async function GetfileList(params?: any) {
return request('/api/biz-service-ebtp-bid/v1/document/pageList', {
method: 'post',
data: {
...params
},
})
}
export async function GetfileMsgEnclosure(params?: any) {
return request('/api/biz-service-ebtp-bid/v1/document/xj/attachment/'+params)
}
export async function GetfileMsg(params?: any) {
return request('/api/biz-service-ebtp-bid/v1/document/'+params)
}

View File

@ -0,0 +1,94 @@
import React, { useRef, useState } from 'react';
import '@/assets/xsy_style.less';
import { Button, Card, message, Spin } from 'antd';
import ProTable, { ActionType, ProColumns } from '@ant-design/pro-table';
import { getPage, getProjectById } from './service';
import { getURLInformation } from '@/utils/CommonUtils';
const Sing: React.FC<{}> = () => {
//表格控制
const actionRef = useRef<ActionType>();
//reviewTurnId获取
const reviewTurnId = getURLInformation('turnId') == undefined ? '' : getURLInformation('turnId');
//loading
const [loading, setLoading] = useState<boolean>(false)
const toViewOffer = async (record: any) => {
if(record.decryptStatus == "1") {
message.info("应答文件未解密,无法查看报价详情,请先到【应答文件查看】中进行解密")
} else {
setLoading(true)
await getProjectById(record?.projectId).then((res) => {
if (res?.code == 200 && res?.success == true) {
const data = res?.data;
const url = `${REACT_APP_XUNJIA_REDIRECT}/inquiryoffer/ztbViewOffer.do?inquiry_no=${data?.ebpProjectNumber}&offer_no=${record?.offerOrderNo}`
window.open(url);
}
}).finally(() => {
setLoading(false)
});
}
};
//columns列
const columns: ProColumns<any>[] = [
{
title: '序号',
width: 100,
render: (value: any, record: any, index: any) => index + 1,
},
{
title: '供应商名称',
dataIndex: 'companyName',
key: 'companyName',
},
{
title: '报价总金额净价(元)',
dataIndex: 'offerTotalPrice',
key: 'offerTotalPrice',
render: (value: any) => (value == null || value == -999 ? '-' : value),
},
{
title: '报价总金额含税价(元)',
dataIndex: 'offerTotalTaxPrice',
key: 'offerTotalTaxPrice',
render: (value: any) => (value == null || value == -999 ? '-' : value),
},
{
title: '操作',
width: 200,
render: (value: any, record: any, index: any) => {
return (
<Button type="text" onClick={() => toViewOffer(record)}>
</Button>
);
},
},
];
return (
<Card bordered={false} bodyStyle={{ padding: '24px 64px 24px 0px' }}>
<Spin spinning={loading} delay={300}>
<ProTable
columns={columns}
actionRef={actionRef}
search={false}
options={false}
size="small"
pagination={false}
request={async () =>
await getPage(reviewTurnId).then((res) => {
// 表单搜索项会从 params 传入,传递给后端接口。
return {
data: res?.data,
success: res?.success,
};
})
}
rowKey="id"
dateFormatter="string"
/>
</Spin>
</Card>
);
};
export default Sing;

View File

@ -0,0 +1,18 @@
import request from '@/utils/request';
/**
* 查询已报名的供应商
* @param params
*/
export async function getPage(params?: any) {
return request(`/api/biz-service-ebtp-tender/v1/supplier_register/get_register/${params}`,{
method: 'GET',
});
}
/**
* 根据id查询项目信息
* @param id
*/
export function getProjectById(id: any) {
return request('/api/biz-service-ebtp-project/v1/projectRecord/' + id);
}