diff --git a/src/components/CompanyInfo/component/AttachmentsFormModal.tsx b/src/components/CompanyInfo/component/AttachmentsFormModal.tsx index cb324ed..1386bc2 100644 --- a/src/components/CompanyInfo/component/AttachmentsFormModal.tsx +++ b/src/components/CompanyInfo/component/AttachmentsFormModal.tsx @@ -107,6 +107,13 @@ const InvoiceFormModal: React.FC = ({ const uploadProps: UploadProps = { name: 'file', showUploadList: true, + beforeUpload: (file) => { + if (file.size > 1048576) { // 1MB + message.error('文件大小不能超过1MB'); + return Upload.LIST_IGNORE; // 阻止上传 + } + return true; + }, customRequest: async ({ file, onSuccess, onError }) => { try { const realFile = file as File; diff --git a/src/components/CompanyInfo/component/BankFormModal.tsx b/src/components/CompanyInfo/component/BankFormModal.tsx index 532f8f5..269cc74 100644 --- a/src/components/CompanyInfo/component/BankFormModal.tsx +++ b/src/components/CompanyInfo/component/BankFormModal.tsx @@ -1,10 +1,16 @@ import React, { useEffect, useState } from 'react'; -import { Modal, Form, Input, Button, Upload, message, Row, Col, Descriptions } from 'antd'; +import { Modal, Form, Input, Button, Upload, message, Row, Col, Descriptions, Cascader } from 'antd'; import type { UploadProps } from 'antd'; import { UploadOutlined } from '@ant-design/icons'; import { uploadFile, bankView, bankAdd, bankEdit, coscoSupplierBase } from '../services'; import { getRegionTree, getregionInternational } from '@/servers/api/register'; - +function convertToCascaderOptions(data: any[]): any[] { + return data.map(item => ({ + label: item.name, + value: item.id, + children: item.children && item.children.length > 0 ? convertToCascaderOptions(item.children) : undefined, + })); +} interface props { visible: boolean; onOk: () => void; @@ -43,6 +49,9 @@ const InvoiceFormModal: React.FC = ({ const [form] = Form.useForm(); //查看 const [viewData, setViewData] = useState({}); + // 地区 + const [addressOptions, setAddressOptions] = useState([]); + useEffect(() => { if (visible) { if (initialValues) { @@ -59,14 +68,14 @@ const InvoiceFormModal: React.FC = ({ setViewData(fields); } }); - - - - - } else { form.resetFields(); // ✅ 只有无 initialValues 才重置 } + getRegionTree().then(res => { + if (res.code === 200) { + setAddressOptions(convertToCascaderOptions(res.data)); + } + }); } }, [visible, initialValues]); @@ -78,6 +87,10 @@ const InvoiceFormModal: React.FC = ({ ...values, supplierId: userId, }; + payload.province = payload.address[0]; + payload.city = payload.address[1]; + payload.nation = payload.address[2]; + if (!values.id) { bankAdd(payload).then((res) => { if (res.code == 200) { @@ -103,6 +116,13 @@ const InvoiceFormModal: React.FC = ({ const uploadProps: UploadProps = { name: 'file', showUploadList: true, + beforeUpload: (file) => { + if (file.size > 1048576) { // 1MB + message.error('文件大小不能超过1MB'); + return Upload.LIST_IGNORE; // 阻止上传 + } + return true; + }, customRequest: async ({ file, onSuccess, onError }) => { try { const realFile = file as File; @@ -172,7 +192,28 @@ const InvoiceFormModal: React.FC = ({ + + + { + return path.some((option) => { + if (typeof option.label === 'string') { + return ( + option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1 + ); + } + return false; + }); + }, + }} + /> + + + {/* @@ -186,7 +227,7 @@ const InvoiceFormModal: React.FC = ({ - + */} diff --git a/src/components/CompanyInfo/component/BaseInfoFormModal.tsx b/src/components/CompanyInfo/component/BaseInfoFormModal.tsx index fbf9aea..91c19f9 100644 --- a/src/components/CompanyInfo/component/BaseInfoFormModal.tsx +++ b/src/components/CompanyInfo/component/BaseInfoFormModal.tsx @@ -99,14 +99,14 @@ const BaseInfoFormModal: React.FC = ({ coscoSupplierBase: { ...initialValues, licenceAccessoryD: initialValues?.licenceAccessory - ? [{ - uid: '-1', - name: '营业执照', - status: 'done', - url: initialValues.licenceAccessory, - thumbUrl: initialValues.licenceAccessory, - }] - : [], + ? [{ + uid: '-1', + name: '营业执照', + status: 'done', + url: initialValues.licenceAccessory, + thumbUrl: initialValues.licenceAccessory, + }] + : [], }, attachment: changeData?.coscoSupplierSurveyAttachments ? [{ @@ -176,7 +176,7 @@ const BaseInfoFormModal: React.FC = ({ ...values, }; //values.attachment 有附件就处理 - if(values.attachment) { + if (values.attachment) { const file = values.attachment?.[0].response; payload.coscoSupplierSurveyAttachments = [ { @@ -190,14 +190,14 @@ const BaseInfoFormModal: React.FC = ({ ]; } // 处理营业执照回显字段转换问题 - if(payload.coscoSupplierBase.supplierType === 'dvs') { + if (payload.coscoSupplierBase.supplierType === 'dvs') { let licenceAccessoryD = payload.coscoSupplierBase.licenceAccessoryD; - if(licenceAccessoryD[0].response) { + if (licenceAccessoryD[0].response) { payload.coscoSupplierBase.licenceAccessory = payload.coscoSupplierBase.licenceAccessoryD[0].response.url } else { payload.coscoSupplierBase.licenceAccessory = payload.coscoSupplierBase.licenceAccessoryD[0].url } - delete payload.coscoSupplierBase.licenceAccessoryD + delete payload.coscoSupplierBase.licenceAccessoryD } const res = await updateSupplierBase(payload); if (res.code === 200) { @@ -212,6 +212,13 @@ const BaseInfoFormModal: React.FC = ({ const uploadProps: UploadProps = { name: 'file', showUploadList: true, + beforeUpload: (file) => { + if (file.size > 1048576) { // 1MB + message.error('文件大小不能超过1MB'); + return Upload.LIST_IGNORE; // 阻止上传 + } + return true; + }, customRequest: async ({ file, onSuccess, onError }) => { try { const realFile = file as File; diff --git a/src/components/CompanyInfo/component/DomesticForm.tsx b/src/components/CompanyInfo/component/DomesticForm.tsx index 9862508..19876b2 100644 --- a/src/components/CompanyInfo/component/DomesticForm.tsx +++ b/src/components/CompanyInfo/component/DomesticForm.tsx @@ -18,28 +18,35 @@ interface ForeignFormProps { * 其他部分使用通用表单组件 */ const DomesticForm: React.FC = ({ form, countdown, handleGetCaptcha }) => { -//上传接口 -const uploadProps: UploadProps = { - name: 'file', - showUploadList: true, - customRequest: async ({ file, onSuccess, onError }) => { - try { - const realFile = file as File; - const res = await uploadFile(realFile); - const uploadedFile = { - uid: res.fileSize, - name: res.fileName, - status: 'done', - url: res.url, - }; - onSuccess?.(uploadedFile, new XMLHttpRequest()) - message.success('上传成功'); - } catch (err: any) { - onError?.(err); - message.error(err.message || '上传失败'); + //上传接口 + const uploadProps: UploadProps = { + name: 'file', + showUploadList: true, + beforeUpload: (file) => { + if (file.size > 1048576) { // 1MB + message.error('文件大小不能超过1MB'); + return Upload.LIST_IGNORE; // 阻止上传 } - } -}; + return true; + }, + customRequest: async ({ file, onSuccess, onError }) => { + try { + const realFile = file as File; + const res = await uploadFile(realFile); + const uploadedFile = { + uid: res.fileSize, + name: res.fileName, + status: 'done', + url: res.url, + }; + onSuccess?.(uploadedFile, new XMLHttpRequest()) + message.success('上传成功'); + } catch (err: any) { + onError?.(err); + message.error(err.message || '上传失败'); + } + } + }; return ( <> {/* 境外企业特有的基本信息部分 */} @@ -59,7 +66,7 @@ const uploadProps: UploadProps = { - + - + - + Array.isArray(e) ? e : e?.fileList} > - + - - - + + + diff --git a/src/components/CompanyInfo/component/InvoiceFormModal.tsx b/src/components/CompanyInfo/component/InvoiceFormModal.tsx index b9b354e..e4e9bb4 100644 --- a/src/components/CompanyInfo/component/InvoiceFormModal.tsx +++ b/src/components/CompanyInfo/component/InvoiceFormModal.tsx @@ -3,6 +3,8 @@ import { Modal, Form, Input, Select, Button, Upload, message, Row, Col, Descript import type { UploadProps } from 'antd'; import { UploadOutlined } from '@ant-design/icons'; import { uploadFile, invoiceView, invoiceAdd, invoiceEdit } from '../services'; +import { getDictList } from '@/servers/api/dicts' + interface props { visible: boolean; onOk: () => void; @@ -10,6 +12,10 @@ interface props { initialValues?: any; readOnly?: boolean; } +interface Dict { + dicName: string; + code: string; +} interface viewDataData { id?: string | null; account?: string; @@ -22,12 +28,12 @@ interface viewDataData { taxpayerCode?: string; taxpayerType?: string; attachment?: { - uid: string; - name: string; - url: string; - status: string; + uid: string; + name: string; + url: string; + status: string; }[]; - } +} const InvoiceFormModal: React.FC = ({ visible, onOk, @@ -36,10 +42,13 @@ const InvoiceFormModal: React.FC = ({ readOnly = false, }) => { const userId = sessionStorage.getItem('userId') || ''; - // 新增与修改 + // 新增与修改 const [form] = Form.useForm(); //查看 const [viewData, setViewData] = useState({}); + //纳税人option + const [taxpayerType, setTaxpayerType] = useState(); + useEffect(() => { if (visible) { if (initialValues) { @@ -53,8 +62,8 @@ const InvoiceFormModal: React.FC = ({ ? [{ uid: '-1', name: data.qualificationCertificate, url: data.qualificationCertificate, status: 'done', response: { url: data.qualificationCertificate } }] : [], }; - console.log(fields,'fields'); - + console.log(fields, 'fields'); + form.setFieldsValue(fields); setViewData(fields); } @@ -62,6 +71,13 @@ const InvoiceFormModal: React.FC = ({ } else { form.resetFields(); // ✅ 只有无 initialValues 才重置 } + + getDictList('taxpayer_type').then((res) => { + if (res.code == 200) { + setTaxpayerType(res.data) + } + }) + } }, [visible, initialValues]); @@ -76,8 +92,8 @@ const InvoiceFormModal: React.FC = ({ supplierId: userId, }; - console.log(values,'values'); - + console.log(values, 'values'); + if (!values.id) { invoiceAdd(payload).then((res) => { if (res.code == 200) { @@ -103,6 +119,13 @@ const InvoiceFormModal: React.FC = ({ const uploadProps: UploadProps = { name: 'file', showUploadList: true, + beforeUpload: (file) => { + if (file.size > 1048576) { // 1MB + message.error('文件大小不能超过1MB'); + return Upload.LIST_IGNORE; // 阻止上传 + } + return true; + }, customRequest: async ({ file, onSuccess, onError }) => { try { const realFile = file as File; @@ -168,7 +191,12 @@ const InvoiceFormModal: React.FC = ({ - + {taxpayerType?.map(item => ( + {item.dicName} + ))} + + diff --git a/src/components/CompanyInfo/component/QualificationFormModal.tsx b/src/components/CompanyInfo/component/QualificationFormModal.tsx index 1622b42..d867f19 100644 --- a/src/components/CompanyInfo/component/QualificationFormModal.tsx +++ b/src/components/CompanyInfo/component/QualificationFormModal.tsx @@ -106,6 +106,13 @@ const QualificationFormModal: React.FC = ({ const uploadProps: UploadProps = { name: 'file', showUploadList: true, + beforeUpload: (file) => { + if (file.size > 1048576) { // 1MB + message.error('文件大小不能超过1MB'); + return Upload.LIST_IGNORE; // 阻止上传 + } + return true; + }, customRequest: async ({ file, onSuccess, onError }) => { try { const realFile = file as File; diff --git a/src/pages/supplier/admission/SupplierCategoryEntry/index.tsx b/src/pages/supplier/admission/SupplierCategoryEntry/index.tsx index 4380364..f203311 100644 --- a/src/pages/supplier/admission/SupplierCategoryEntry/index.tsx +++ b/src/pages/supplier/admission/SupplierCategoryEntry/index.tsx @@ -9,6 +9,7 @@ import CreateModal from './components/CreateModal'; import CategorySelector from '@/components/CategorySelector'; //接口 import { getPage, startApprove } from './services' +import { getDictList } from '@/servers/api/dicts' //统一列表分页 import tableProps from '@/utils/tableProps' const { Option } = Select; @@ -20,6 +21,11 @@ interface Data { createTime: string; approveStatus: string; } +interface Dict { + dicName: string; + code: string; +} + const SupplierCategoryEntry: React.FC = () => { // 查询 @@ -30,6 +36,8 @@ const SupplierCategoryEntry: React.FC = () => { const [modalInfo, setModalInfo] = useState<{ type: string; visible: boolean; record?: any }>({ type: '', visible: false, }); //列表分页 const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 }); + // + const [enterpriseType, setEnterpriseType] = useState(); //列表加载 const [loading, setLoading] = useState(false); // 列表方法 @@ -49,6 +57,11 @@ const SupplierCategoryEntry: React.FC = () => { useEffect(() => { const values = form.getFieldsValue(); getList(values, 1, 10); + getDictList('approve_type').then((res) => { + if (res.code == 200) { + setEnterpriseType(res.data) + } + }) }, []); //开启弹窗 const openModal = (type: string, record?: any) => { @@ -93,7 +106,7 @@ const SupplierCategoryEntry: React.FC = () => { { title: '准入部门', ellipsis: true, width: 120, dataIndex: 'deptId' }, { title: '准入方式', ellipsis: true, width: 120, dataIndex: 'accessTypeText' }, { title: '申请时间', dataIndex: 'createTime', width: 180 }, - { title: '状态', ellipsis: true, width: 120, dataIndex: 'approveStatusText' }, + { title: '审批状态', ellipsis: true, width: 120, dataIndex: 'approveStatusText' }, { title: '操作', width: 140, @@ -129,12 +142,11 @@ const SupplierCategoryEntry: React.FC = () => { - + @@ -159,7 +171,7 @@ const SupplierCategoryEntry: React.FC = () => { dataSource={data} columns={columns} loading={loading} - pagination={{...tableProps.pagination, total: pagination.total }} + pagination={{ ...tableProps.pagination, total: pagination.total }} onChange={(pagination) => { const values = form.getFieldsValue(); getList(values, pagination.current!, pagination.pageSize!) diff --git a/src/pages/supplier/admission/SupplierEntryReview/index.tsx b/src/pages/supplier/admission/SupplierEntryReview/index.tsx index 212cebc..2d63543 100644 --- a/src/pages/supplier/admission/SupplierEntryReview/index.tsx +++ b/src/pages/supplier/admission/SupplierEntryReview/index.tsx @@ -4,6 +4,7 @@ import { SearchOutlined, DeleteOutlined } from '@ant-design/icons'; import type { ColumnsType } from 'antd/es/table'; //接口 import { getApprovePage } from './services'; +import { getDictList } from '@/servers/api/dicts' //组件 import ViewModal from './components/ViewModal'; //统一列表分页 @@ -35,7 +36,10 @@ const deptOptions = [ { label: '采购部', value: 'DEPT001' }, { label: '业务部', value: 'DEPT002' }, ]; - +interface Dict { + dicName: string; + code: string; +} const SupplierEntryReview: React.FC = () => { const [form] = Form.useForm(); @@ -43,6 +47,8 @@ const SupplierEntryReview: React.FC = () => { const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 }); const [loading, setLoading] = useState(false); const [modalInfo, setModalInfo] = useState({ visible: false, record: null }); + // + const [enterpriseType, setEnterpriseType] = useState(); // 查询数据 const fetchData = async (params = {}) => { setLoading(true); @@ -74,6 +80,11 @@ const SupplierEntryReview: React.FC = () => { useEffect(() => { fetchData({ pageNo: 1 }); + getDictList('approve_type').then((res) => { + if (res.code == 200) { + setEnterpriseType(res.data) + } + }) }, []); // 表格分页切换 @@ -165,13 +176,13 @@ const SupplierEntryReview: React.FC = () => { width: 180, }, { - title: '流程状态', + title: '评审状态', dataIndex: 'reviewStatusText', align: 'center', width: 120, }, { - title: '审核', + title: '审批状态', dataIndex: 'approveStatusText', align: 'center', width: 120, @@ -210,12 +221,11 @@ const SupplierEntryReview: React.FC = () => { - - - - + {enterpriseType?.map(item => ( + {item.dicName} + ))} diff --git a/src/pages/supplier/admission/admissionManagement/components/CreateModal.tsx b/src/pages/supplier/admission/admissionManagement/components/CreateModal.tsx index 7bcb42b..c3ef7bf 100644 --- a/src/pages/supplier/admission/admissionManagement/components/CreateModal.tsx +++ b/src/pages/supplier/admission/admissionManagement/components/CreateModal.tsx @@ -8,6 +8,7 @@ import ReviewerSelector from './ReviewerSelector'; import DivisionModal from './DivisionModal'; // 请求 import { categoryTree, add, uploadFile } from '../services'; + const { Option } = Select; const { RangePicker } = DatePicker; //selected 类型 @@ -232,8 +233,10 @@ const CreateModal: React.FC<{ visible: boolean; onCancel: () => void; }> = ({ vi if (code == 200) { setCategoriesTreeData(data) } - }) + + + form.setFieldsValue({ method: 'online' }); } }, [visible, form]); diff --git a/src/pages/supplier/admission/admissionManagement/index.tsx b/src/pages/supplier/admission/admissionManagement/index.tsx index 05c2e3a..0db799d 100644 --- a/src/pages/supplier/admission/admissionManagement/index.tsx +++ b/src/pages/supplier/admission/admissionManagement/index.tsx @@ -96,7 +96,18 @@ const AccessManagement: React.FC = () => { { title: '准入部门', ellipsis: true, width: 120, dataIndex: 'deptId' }, { title: '准入方式', ellipsis: true, width: 120, dataIndex: 'accessTypeText' }, { title: '申请时间', ellipsis: true, width: 180, dataIndex: 'createTime' }, - { title: '状态', dataIndex: 'reviewStatusText', width: 80, }, + { + title: '评审状态', + dataIndex: 'reviewStatusText', + key: 'reviewStatusText', + width: 120, + }, + { + title: '审批状态', + dataIndex: 'approveStatusText', + key: 'approveStatusText', + width: 120, + }, { title: '操作', width: 200, @@ -139,8 +150,8 @@ const AccessManagement: React.FC = () => { - - diff --git a/src/pages/supplier/admission/admissionReviewManagement/index.tsx b/src/pages/supplier/admission/admissionReviewManagement/index.tsx index 38de021..90bc451 100644 --- a/src/pages/supplier/admission/admissionReviewManagement/index.tsx +++ b/src/pages/supplier/admission/admissionReviewManagement/index.tsx @@ -146,6 +146,12 @@ const CooperateEnterprise: React.FC = () => { key: 'reviewStatusText', width: 120, }, + { + title: '审批状态', + dataIndex: 'approveStatusText', + key: 'approveStatusText', + width: 120, + }, { title: '操作', width: 140, diff --git a/src/pages/supplier/informationRetrieval/mySupplierInquiry/components/SupplierDetailModal.tsx b/src/pages/supplier/informationRetrieval/mySupplierInquiry/components/SupplierDetailModal.tsx index 7bbd4d9..52d79a1 100644 --- a/src/pages/supplier/informationRetrieval/mySupplierInquiry/components/SupplierDetailModal.tsx +++ b/src/pages/supplier/informationRetrieval/mySupplierInquiry/components/SupplierDetailModal.tsx @@ -55,7 +55,7 @@ const SupplierAccessDetailModal: React.FC = ({ v setLoading(true); try { const values = form.getFieldsValue(); - const { code, data, message } = await getCategoryPage({ pageNo, pageSize , id:record, ...values}); + const { code, data, message } = await getCategoryPage({ pageNo, pageSize , supplierId:record, ...values}); if (code === 200) { setData(data.records); setPagination({ current: pageNo, pageSize, total: data.total }); diff --git a/src/pages/supplier/informationRetrieval/mySupplierInquiry/services.ts b/src/pages/supplier/informationRetrieval/mySupplierInquiry/services.ts index b69ed04..a7bb405 100644 --- a/src/pages/supplier/informationRetrieval/mySupplierInquiry/services.ts +++ b/src/pages/supplier/informationRetrieval/mySupplierInquiry/services.ts @@ -17,6 +17,7 @@ interface getCategoryPage { pageNo: number; pageSize: number; categoryNames?: string; + supplierId?: string; } export const getCategoryPage = (data: getCategoryPage) => request.post('/coscoSupplierBase/getCategoryPage', { data }); diff --git a/src/pages/supplier/informationRetrieval/registrationQuery/components/SupplierDetailModal.tsx b/src/pages/supplier/informationRetrieval/registrationQuery/components/SupplierDetailModal.tsx index 136ee3a..ab2986d 100644 --- a/src/pages/supplier/informationRetrieval/registrationQuery/components/SupplierDetailModal.tsx +++ b/src/pages/supplier/informationRetrieval/registrationQuery/components/SupplierDetailModal.tsx @@ -51,7 +51,7 @@ const SupplierAccessDetailModal: React.FC = ({ v setLoading(true); try { const values = form.getFieldsValue(); - const { code, data, message } = await getCategoryPage({ pageNo, pageSize, id: record, ...values}); + const { code, data, message } = await getCategoryPage({ pageNo, pageSize, supplierId: record, ...values}); if (code === 200) { setData(data.records); setPagination({ current: pageNo, pageSize, total: data.total }); diff --git a/src/pages/supplier/informationRetrieval/registrationQuery/services.ts b/src/pages/supplier/informationRetrieval/registrationQuery/services.ts index 28ffe63..6f215a3 100644 --- a/src/pages/supplier/informationRetrieval/registrationQuery/services.ts +++ b/src/pages/supplier/informationRetrieval/registrationQuery/services.ts @@ -13,6 +13,7 @@ interface getCategoryPage { pageNo: number; pageSize: number; categoryNames?: string; + supplierId?: string; } export const getCategoryPage = (data: getCategoryPage) => request.post('/coscoSupplierBase/getCategoryPage', { data }); diff --git a/src/pages/supplier/supplierBlacklist/blacklistManage/components/CreateBlacklistModal.tsx b/src/pages/supplier/supplierBlacklist/blacklistManage/components/CreateBlacklistModal.tsx index eed520c..3abf48d 100644 --- a/src/pages/supplier/supplierBlacklist/blacklistManage/components/CreateBlacklistModal.tsx +++ b/src/pages/supplier/supplierBlacklist/blacklistManage/components/CreateBlacklistModal.tsx @@ -1,5 +1,5 @@ import React, { useEffect , useState } from "react"; -import { Modal, Button, Select, Input, Table, message, Form } from "antd"; +import { Modal, Button, Select, Input, Table, message, Form, Tooltip } from "antd"; import SupplierSelectModal from "./SupplierSelectModal"; import { blacklist, getAllList } from "../services"; import type { ColumnsType } from 'antd/es/table'; @@ -86,7 +86,13 @@ const CreateBlacklistModal: React.FC = ({ } }, [visible]); const columns: ColumnsType = [ - { title: "供应商名称", dataIndex: "supplierName", align: "center" }, + { title: '供应商名称', dataIndex: 'name', ellipsis: true, width: 160, render: (_: any, record: any) => { + const name = record.supplierType === "ovs"? record.nameEn : record.name; + return( + + {name} + ) + } }, { title: "准入部门", dataIndex: "unit", align: "center" }, { title: "准入时间", dataIndex: "accessTime", align: "center", render: () => "2023-04-20 13:00" }, { title: "准入品类", dataIndex: "categoryName", align: "center" }, @@ -123,6 +129,8 @@ const CreateBlacklistModal: React.FC = ({ rowKey="id" bordered pagination={false} + style={{ flex: 1, minHeight: 0 }} + scroll={{ y: 'calc(100vh - 650px)' }} />
diff --git a/src/pages/supplier/supplierBlacklist/blacklistManage/components/SupplierSelectModal.tsx b/src/pages/supplier/supplierBlacklist/blacklistManage/components/SupplierSelectModal.tsx index 72836e2..ae3a228 100644 --- a/src/pages/supplier/supplierBlacklist/blacklistManage/components/SupplierSelectModal.tsx +++ b/src/pages/supplier/supplierBlacklist/blacklistManage/components/SupplierSelectModal.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useState } from "react"; import { - Modal, Table, Button, Checkbox, Row, Col, Input, Select, Form, Space, message + Modal, Table, Button, Checkbox, Row, Col, Input, Select, Form, Space, message, Tooltip } from "antd"; import { getSupplierCategoryPage } from '../services'; import CategorySelector from '@/components/CategorySelector'; @@ -52,7 +52,7 @@ const SupplierSelectModal: React.FC = ({ const fetchData = async (params: any = {}, pageNo = 1, pageSize = 5) => { setLoading(true); try { - const res = await getSupplierCategoryPage({ ...params, pageNo, pageSize }); + const res = await getSupplierCategoryPage({ ...params, basePageRequest: { pageNo, pageSize } }); if (res.code === 200) { setData(res.data.records); setPagination({ current: pageNo, pageSize: pageSize, total: res.data.total }); @@ -100,9 +100,9 @@ const SupplierSelectModal: React.FC = ({ onChange={e => { setLeftSelected(e.target.checked ? data.map(i => i.id) : []); }} - >全选, + >, dataIndex: "select", - width: 80, + width: 40, render: (_: any, record: Supplier) => ( = ({ ? [...leftSelected, record.id] : leftSelected.filter(id => id !== record.id)); }} - >选择 + > ) }, - { title: "供应商名称", dataIndex: "supplierName", ellipsis: true }, - { title: "准入品类", dataIndex: "categoryName" } + { title: '供应商名称', dataIndex: 'name', ellipsis: true, width: 160, render: (_: any, record: any) => { + const name = record.supplierType === "ovs"? record.nameEn : record.name; + return( + + {name} + ) + } }, + { title: "准入品类", dataIndex: "categoryName", ellipsis: true, width: 100, render: (_: any, record: any) => { + return( + + {record.categoryName} + ) + } } ]; const rightColumns = [ @@ -126,9 +137,9 @@ const SupplierSelectModal: React.FC = ({ onChange={e => { setRightSelected(e.target.checked ? rightData.map(i => i.id) : []); }} - >全选, + >, dataIndex: "select", - width: 80, + width: 40, render: (_: any, record: Supplier) => ( = ({ ? [...rightSelected, record.id] : rightSelected.filter(id => id !== record.id)); }} - >选择 + > ) }, - { title: "供应商名称", dataIndex: "supplierName", ellipsis: true }, - { title: "准入品类", dataIndex: "categoryName" } + { title: '供应商名称', dataIndex: 'name', ellipsis: true, width: 160, render: (_: any, record: any) => { + const name = record.supplierType === "ovs"? record.nameEn : record.name; + return( + + {name} + ) + } }, + { title: "准入品类", dataIndex: "categoryName", ellipsis: true, width: 100, render: (_: any, record: any) => { + return( + + {record.categoryName} + ) + } } ]; return ( diff --git a/src/pages/supplier/supplierBlacklist/blacklistManage/index.tsx b/src/pages/supplier/supplierBlacklist/blacklistManage/index.tsx index 795ca21..8e18726 100644 --- a/src/pages/supplier/supplierBlacklist/blacklistManage/index.tsx +++ b/src/pages/supplier/supplierBlacklist/blacklistManage/index.tsx @@ -96,11 +96,11 @@ const blacklistManage: React.FC = () => { width: 60, render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1, }, - { title: "申请主题", dataIndex: "exitTheme", key: "exitTheme", align: "left" }, - { title: "发起单位", dataIndex: "deptId", key: "deptId", align: "center" }, + { title: "申请主题", dataIndex: "themeName", key: "themeName", align: "left", ellipsis: true }, + { title: "发起单位", dataIndex: "unitName", key: "unitName", align: "center" }, { title: "发起部门", dataIndex: "deptName", key: "deptName", align: "center" }, { title: "发起时间", dataIndex: "createTime", key: "createTime", align: "center", width: 180 }, - { title: "审批记录状态", dataIndex: "approveStatusText", key: "approveStatusText", align: "center" }, + { title: "审批记录状态", dataIndex: "approveStatusName", key: "approveStatusName", align: "center" }, { title: "操作", key: "option", @@ -170,7 +170,13 @@ const blacklistManage: React.FC = () => { scroll={{ y: 'calc(100vh - 350px)' }} />
- setCreateVisible(false)} onOk={() => setCreateVisible(false)} /> + setCreateVisible(false)} + onOk={() => { + setCreateVisible(false) + handleSearch + }} /> request.post('/black/blacklist/get * 供应商分页列表查询 */ interface getSupplierCategoryPageData { - pageNo: number; - pageSize: number; + basePageRequest: basePageRequest; supplierName?: number; categoryId?: string; reviewResult?: string; @@ -31,11 +30,15 @@ interface getSupplierCategoryPageData { name?: string; } +interface basePageRequest { + pageNo: number; + pageSize: number; +} -export const getSupplierCategoryPage = (data: getSupplierCategoryPageData) => request.post('/coscoSupplierexit/getSupplierCategoryPage', { data }); - +export const getSupplierCategoryPage = (data: getSupplierCategoryPageData) => request.post('/coscoSupplierBase/getSupplierPage', { data }); +// /coscoSupplierBase/getSupplierPage diff --git a/src/pages/supplier/supplierMessage/index.tsx b/src/pages/supplier/supplierMessage/index.tsx index 6926f86..42e1ad2 100644 --- a/src/pages/supplier/supplierMessage/index.tsx +++ b/src/pages/supplier/supplierMessage/index.tsx @@ -170,7 +170,7 @@ const SupplierMessage: React.FC = () => { {viewRecord && ( {viewRecord.content} - {viewRecord.type} + {viewRecord.typeCn} {viewRecord.createTime} )}