12-23-上传master
This commit is contained in:
@ -0,0 +1,212 @@
|
||||
import React, { useState } from 'react';
|
||||
import '@/utils/lq.style.less';
|
||||
import { Button, Input, Form, Upload, Modal, DatePicker, Checkbox } from 'antd';
|
||||
import { UploadOutlined } from '@ant-design/icons';
|
||||
import ProTable from '@ant-design/pro-table';
|
||||
import { dateTimeFormatter } from '@/utils/DateUtils';
|
||||
|
||||
|
||||
const layout = {
|
||||
labelCol: { span: 6 },
|
||||
wrapperCol: { span: 14 },
|
||||
};
|
||||
|
||||
const listData = [
|
||||
{ key: 1, title: '标题', theInquiryDocuments: '文件', questionTime: '2020-01-01 12:12:12', requestResponseTime: '2020-01-01 12:12:12', state: '', recoveryTime: '2020-03-05 13:13:13' },
|
||||
{ key: 2, title: '标题1', theInquiryDocuments: '文件2', questionTime: '2020-01-02 12:12:12', requestResponseTime: '2020-01-01 12:12:12', state: '', recoveryTime: '2020-03-05 13:13:13' },
|
||||
{ key: 3, title: '标题2', theInquiryDocuments: '文件3', questionTime: '2020-01-03 12:12:12', requestResponseTime: '2020-01-01 12:12:12', state: '', recoveryTime: '2020-03-05 13:13:13' },
|
||||
{ key: 4, title: '标题3', theInquiryDocuments: '文件4', questionTime: '2020-01-04 12:12:12', requestResponseTime: '2020-01-01 12:12:12', state: '', recoveryTime: '2020-03-05 13:13:13' },
|
||||
|
||||
]
|
||||
|
||||
|
||||
const ClarificationOfTheBid: React.FC<{}> = () => {
|
||||
|
||||
const [tableData, setTableData] = useState(listData);
|
||||
const [visible, setVisible] = useState<boolean>(false);
|
||||
const [form] = Form.useForm();
|
||||
//禁用标识
|
||||
const [whetherReadonly, setWhetherReadonly] = useState<boolean>(false);
|
||||
const columns: any = [
|
||||
{
|
||||
title: '序号',
|
||||
valueType: 'index'
|
||||
},
|
||||
{
|
||||
title: '标题',
|
||||
dataIndex: 'title',
|
||||
},
|
||||
{
|
||||
title: '质询文件',
|
||||
dataIndex: 'theInquiryDocuments',
|
||||
},
|
||||
{
|
||||
title: '提问时间',
|
||||
dataIndex: 'questionTime',
|
||||
},
|
||||
{
|
||||
title: '要求回复时间',
|
||||
dataIndex: 'requestResponseTime',
|
||||
},
|
||||
{
|
||||
title: '投标人',
|
||||
dataIndex: 'state',
|
||||
},
|
||||
{
|
||||
title: '回复时间',
|
||||
dataIndex: 'recoveryTime',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: 130,
|
||||
valueType: 'option',
|
||||
render: (_: any, record: any) => [
|
||||
<a key="view" onClick={() => view(record)}>查看</a>,
|
||||
<a key="send" onClick={() => send(record)}>发送</a>
|
||||
]
|
||||
|
||||
},
|
||||
|
||||
]
|
||||
/**
|
||||
* 查看
|
||||
* @param data 数据
|
||||
*/
|
||||
const view = (data: any) => {
|
||||
setVisible(true);
|
||||
setWhetherReadonly(true);
|
||||
form.setFieldsValue(data);
|
||||
}
|
||||
/**
|
||||
* 发送
|
||||
* @param data 数据
|
||||
*/
|
||||
const send = (data: any) => {
|
||||
console.log(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 弹出层关闭
|
||||
* @param data
|
||||
*/
|
||||
const handleCancel = () => {
|
||||
setVisible(false);
|
||||
setWhetherReadonly(false);
|
||||
}
|
||||
|
||||
const save = () => {
|
||||
form.submit();
|
||||
}
|
||||
|
||||
const onFinish = (data: any) => {
|
||||
console.log(data);
|
||||
console.log('onFinish');
|
||||
}
|
||||
|
||||
const createForm = () => {
|
||||
return (
|
||||
<>
|
||||
<Modal visible={visible}
|
||||
style={{ top: 20 }}
|
||||
title="质询内容"
|
||||
onCancel={handleCancel}
|
||||
maskClosable={false}
|
||||
destroyOnClose={true}
|
||||
footer={whetherReadonly ? null : [
|
||||
<Button key="back" onClick={handleCancel}>
|
||||
取消
|
||||
</Button>,
|
||||
<Button key="submit" type="primary" onClick={save}>
|
||||
保存
|
||||
</Button>,
|
||||
]}
|
||||
>
|
||||
<Form
|
||||
{...layout}
|
||||
onFinish={onFinish}
|
||||
form={form}
|
||||
>
|
||||
<Form.Item
|
||||
label="选择供应商"
|
||||
name=""
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<Checkbox.Group disabled={whetherReadonly}>
|
||||
</Checkbox.Group>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="应答截止时间"
|
||||
name=""
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<DatePicker showTime format={dateTimeFormatter} disabled={whetherReadonly} />
|
||||
</Form.Item>
|
||||
|
||||
{/* 招标没有 */}
|
||||
<Form.Item
|
||||
label="应答打开时间"
|
||||
name=""
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<DatePicker showTime format={dateTimeFormatter} disabled={whetherReadonly} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="主题"
|
||||
name=""
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<Input disabled={whetherReadonly} readOnly={whetherReadonly} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="澄清文件"
|
||||
name=""
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<Upload name="logo" action="/upload.do" listType="picture" disabled={whetherReadonly} >
|
||||
<Button icon={<UploadOutlined />}>上传文件</Button>
|
||||
</Upload>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="内容"
|
||||
name="reasonsAndGrounds"
|
||||
rules={[{ required: true }]}
|
||||
>
|
||||
<Input.TextArea maxLength={32} disabled={whetherReadonly} readOnly={whetherReadonly} />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
</>
|
||||
)
|
||||
}
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
const added = () => {
|
||||
setVisible(true);
|
||||
form.resetFields();
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="background">
|
||||
<ProTable
|
||||
rowSelection={{ type: 'radio' }}
|
||||
rowKey="key"
|
||||
columns={columns}
|
||||
dataSource={tableData}
|
||||
search={false}
|
||||
toolBarRender={() => [
|
||||
<Button key="added" onClick={added} type="primary">
|
||||
新增
|
||||
</Button>,
|
||||
]}
|
||||
/>
|
||||
{createForm()}
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default ClarificationOfTheBid;
|
@ -0,0 +1,14 @@
|
||||
import React from 'react';
|
||||
import ClarificationOfTheBid from './components/ClarificationOfTheBid';
|
||||
import { PageHeaderWrapper } from '@ant-design/pro-layout';
|
||||
|
||||
// 标中质询澄清列表
|
||||
const Index: React.FC<{}> = () => {
|
||||
return (
|
||||
<PageHeaderWrapper>
|
||||
<ClarificationOfTheBid />
|
||||
</PageHeaderWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default Index;
|
Reference in New Issue
Block a user