From 3438db919f4a39944df83d996eb485c294fe6a7c Mon Sep 17 00:00:00 2001 From: xixi <123@qq.com> Date: Wed, 11 Sep 2024 15:04:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0pdf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CorrectionModal/CorrectionModal.tsx | 20 +++++++++----- src/components/RefunModal/RefunModal.tsx | 26 ++++++++++++++----- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/src/components/CorrectionModal/CorrectionModal.tsx b/src/components/CorrectionModal/CorrectionModal.tsx index 36431b6..bebdf0d 100644 --- a/src/components/CorrectionModal/CorrectionModal.tsx +++ b/src/components/CorrectionModal/CorrectionModal.tsx @@ -5,7 +5,7 @@ import { Form, Select, Button, Upload, message, Input, Modal, Table,Empty } from import type { TableColumnsType } from 'antd'; const { Search } = Input; import { UploadOutlined } from '@ant-design/icons'; -import { uploadImageUrl, DevUserId, get, post } from "../../util/AjaxUtils.ts"; +import { DevUserId, get, post,uploadFileUrl} from "../../util/AjaxUtils.ts"; // import { getMenuActive } from '../../util/cache.ts' import { useDispatch } from 'react-redux' const { TextArea } = Input; @@ -32,6 +32,13 @@ export default function CorrectionModal(props: any) { render: (text: string) => <>{text}, }, + { + title: '所属者名称', + dataIndex: 'applyContactName', + align: 'center', + + render: (text: string) => <>{text}, + }, { title: '编号', dataIndex: 'projContext', @@ -345,13 +352,14 @@ export default function CorrectionModal(props: any) { rules={[{ required: true, message: '请上传补正通知书' }]} > { - const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'; - if (!isJpgOrPng) { - message.error('只能上传 JPG/PNG 格式文件!'); + const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'|| file.type === 'application/pdf'; + // const isPdf = file.type === 'application/pdf'; + if (!isJpgOrPng ) { + message.error('只能上传 JPG/PNG/PDF 格式文件!'); return Upload.LIST_IGNORE; // 不允许上传非 } return isJpgOrPng; diff --git a/src/components/RefunModal/RefunModal.tsx b/src/components/RefunModal/RefunModal.tsx index 6e1b9b2..11f9aae 100644 --- a/src/components/RefunModal/RefunModal.tsx +++ b/src/components/RefunModal/RefunModal.tsx @@ -3,7 +3,7 @@ import './RefunModal.css' import { Form, Button, Upload, message, Input, Modal, Table, Empty } from 'antd'; import type { TableColumnsType } from 'antd'; import { UploadOutlined } from '@ant-design/icons'; -import { uploadImageUrl, DevUserId, get, post } from "../../util/AjaxUtils.ts"; +import { DevUserId, get, post,uploadFileUrl } from "../../util/AjaxUtils.ts"; // import { getMenuActive } from '../../util/cache.ts' import { useDispatch } from 'react-redux' const { Search } = Input; @@ -13,7 +13,8 @@ interface DataType { projName: string; projContext: string; gmtCreate: string; - projId: string + projId: string, + applyContactName: string; } export default function RefunModal(props: any) { @@ -32,6 +33,13 @@ export default function RefunModal(props: any) { render: (text: string) => <>{text}, }, + { + title: '所属者名称', + dataIndex: 'applyContactName', + align: 'center', + + render: (text: string) => <>{text}, + }, { title: '编号', dataIndex: 'projContext', @@ -238,8 +246,11 @@ export default function RefunModal(props: any) { valuePropName="fileList" getValueFromEvent={(e: any) => { if (e.file.status === 'done') { + // console.log(e); + refunArray.push(e.file.response.data.fileId); setRefunArray(refunArray); + } if (e.file.status === 'removed') { const idArray = refunArray.filter(item => item != e.file.response.data.fileId); @@ -250,13 +261,14 @@ export default function RefunModal(props: any) { rules={[{ required: true, message: '请上传补正通知书' }]} > { - const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'; - if (!isJpgOrPng) { - message.error('只能上传 JPG/PNG 格式文件!'); + const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png' ||file.type === 'application/pdf'; + // const isPng = file.type == 'application/pdf' + if (!isJpgOrPng ) { + message.error('只能上传 JPG/PNG/PDF 格式文件!'); return Upload.LIST_IGNORE; // 不允许上传非 } return isJpgOrPng;