diff --git a/src/pages/Clarify/notice/index.tsx b/src/pages/Clarify/notice/index.tsx new file mode 100644 index 0000000..294d020 --- /dev/null +++ b/src/pages/Clarify/notice/index.tsx @@ -0,0 +1,400 @@ +import React, {useRef, useState} from 'react'; +import ProTable, {ActionType, ProColumns} from '@ant-design/pro-table'; +import { getPage,getDataById,deleteNotice,addNotice,updateNotice,sendNotice, getReceiptList } from './service'; +import {Button, DatePicker, Form, Input, message, Modal, PageHeader, Checkbox, Spin, Table, Radio} from 'antd'; +import TextArea from "antd/lib/input/TextArea"; +import {getDicData} from "@/utils/session"; +import moment, {Moment} from "moment"; +import {RadioGroup} from "@material-ui/core"; + +const NoticeList: React.FC<{}> = () => { + const [title, setTitle] = useState(''); + const [open, setOpen] = useState(false); + const [openView, setOpenView] = useState(false); + const [spin, spinSet] = useState(false); + const [receiptData, setReceiptData] = useState([]); // 回执数据 + const [receiptLoading, setReceiptLoading] = useState(false); // 回执加载状态 + const [currentNoticeId, setCurrentNoticeId] = useState(null); // 当前查看的通知ID + const actionRef = useRef(); + const [form] = Form.useForm(); + //获取字典 + const getDict: any = getDicData(); + //查询分页数据 + const [pageData, pageDataSet] = useState({ + pageNo: 1, + pageSize: 10 + }); + const layout = { + labelCol: { span: 6 }, + wrapperCol: { span: 13 }, + }; + const dictData = JSON.parse(getDict); + interface DictType { + value: string; + label: string; + } + const version_status: DictType[] = [ + { value: 1, label: '启用' }, + { value: 0, label: '停用' }, + ]; + + const { CheckboxGroup } = Checkbox; + const options = [ + { label: '服务器采购', value: 'server_purchase' }, + { label: '交换机采购', value: 'switch_purchase' } + ]; + + //委托列表 + const columns: ProColumns[] = [ + { title: '序号', valueType: 'index', width: 50, }, + { title: '澄清标题', dataIndex: 'clarificationTitle' },//, ellipsis: true + { title: '关联标段', dataIndex: 'relatedSection', width: '30%' , + valueEnum: { '1': { text: '交换机采购', relatedSection: '1' }, }, + render: (_, record) => { + if (record.relatedSection === '1') { + return (<>交换机采购) + } else { + return (<>服务器采购) + } + } + }, + { title: '起草时间', dataIndex: 'createDate', width: '10%', valueType: 'dateTime', search: false, + render: (value: Moment, record: any) => value?moment(value).format('yyyy-MM-DD'):null + }, + { title: '澄清状态', dataIndex: 'clarifyStatus', width: '10%', + valueEnum: { '1': { text: '已发送', clarifyStatus: '1' }, }, + render: (_, record) => { + if (record.clarifyStatus === 1) { + return (<>已发送) + } else { + return (<>已保存) + } + } + }, + { + title: '操作', width: '9%', + valueType: 'option', + render: (_, record) => [ + , + , + , + + ] + }, + ]; + + // 回执表格列配置 + const receiptColumns = [ + { + title: '供应商名称', + dataIndex: 'supplierName', + key: 'supplierName', + }, + { + title: '状态', + dataIndex: 'receiptStatus', + key: 'receiptStatus', + valueEnum: { '1': { text: '已回执', receiptStatus: '1' }, }, + render: (_, record) => { + if (record.receiptStatus === '1') { + return (<>已回执) + } else { + return (<>-) + } + } + }, + { + title: '回执时间', + dataIndex: 'createDate', + key: 'createDate', + }, + { + title: '回执附件', + dataIndex: 'receiptAttachment', + key: 'receiptAttachment', + }, + { + title: '回执内容', + dataIndex: 'receiptContent', + key: 'receiptContent', + }, + ]; + + const handleSubmit = async () => { + try { + const values = await form.validateFields(); + values.openingTime = values.openingTime.format("yyyy-MM-DD HH:mm:ss") + values.bidDeadline = values.bidDeadline.format("yyyy-MM-DD HH:mm:ss") + values.relatedSection = values.relatedSection?.join(',') || '' + console.log(values) + if (values.id) { + await updateNotice(values).then((r: any) => { + if (r?.code == 200) { + message.success('修改成功'); + } else { + message.error('修改失败'); + } + }); + } else { + await addNotice(values).then((r: any) => { + if (r?.code == 200) { + message.success('新增成功'); + } else { + message.error('新增失败'); + } + }); + } + closeModal(); + } catch (error) { + console.log("错误失败!") + console.error(error); + } + }; + + const checkSupModal = ( + setOpen(false)}>关闭} + onOk={handleSubmit} + onCancel={() => closeModal()} + > +

关联标段

+
+ + + + 服务器采购 + 交换机采购 + + +

基础信息

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +