优化初始化以及去掉固定供应商ID

This commit is contained in:
孙景学
2025-07-14 10:06:48 +08:00
parent 49f302194f
commit e1dd6bfa98
14 changed files with 73 additions and 51 deletions

View File

@ -75,8 +75,10 @@ const OtherAttachmentsTab: React.FC<Props> = (props) => {
//初始化
useEffect(() => {
if(record) {
getList();
}, []);
}
}, [record]);
const columns: ColumnsType<attachmentsAdd> = [

View File

@ -38,6 +38,7 @@ const InvoiceFormModal: React.FC<props> = ({
initialValues,
readOnly = false,
}) => {
const userId = sessionStorage.getItem('userId') || '';
// 新增与修改
const [form] = Form.useForm();
//查看
@ -75,7 +76,7 @@ const InvoiceFormModal: React.FC<props> = ({
const values = await form.validateFields();
const payload = {
...values,
"supplierId": "9c12e8ea-a681-4184-81ba-5fa276299a00",
supplierId: userId,
};
if (!values.id) {
bankAdd(payload).then((res) => {

View File

@ -75,8 +75,10 @@ const BankInfoTab: React.FC<Props> = (props) => {
//初始化
useEffect(() => {
if(record) {
getList();
}, []);
}
}, [record]);
// 表格头部
const columns: ColumnsType<BankInfo> = [
{

View File

@ -77,9 +77,11 @@ const BaseInfoTab: React.FC<BaseInfoTabProps> = (props) => {
useEffect(() => {
if(record) {
//供应商信息
fetchData()
}, []);
}
}, [record]);
if (!registerInfo?.coscoSupplierBase) return <div>{intl.formatMessage({ id: 'component.globalModal.loading' })}...</div>;

View File

@ -41,8 +41,10 @@ const ContactsInfoTab: React.FC<Props> = (props) => {
};
useEffect(() => {
if(record) {
fetchContacts();
}, []);
}
}, [record]);
const handleTableChange = (pagination: TablePaginationConfig) => {
fetchContacts(pagination.current!, pagination.pageSize!);

View File

@ -35,6 +35,7 @@ const InvoiceFormModal: React.FC<props> = ({
initialValues,
readOnly = false,
}) => {
const userId = sessionStorage.getItem('userId') || '';
// 新增与修改
const [form] = Form.useForm();
//查看
@ -72,7 +73,7 @@ const InvoiceFormModal: React.FC<props> = ({
const payload = {
...values,
qualificationCertificate,
"supplierId": "9c12e8ea-a681-4184-81ba-5fa276299a00",
supplierId: userId,
};
console.log(values,'values');

View File

@ -77,8 +77,10 @@ const InvoiceTab: React.FC<InvoiceTabProps> = (props) => {
//初始化
useEffect(() => {
if(record) {
getList();
}, []);
}
}, [record]);
const columns: ColumnsType<InvoiceInfo> = [
{ title: 'page.workbench.invoice.index', dataIndex: 'index', width: 80, key: 'index', render: (_: any, __: any, index: number) => index + 1 },

View File

@ -62,9 +62,11 @@ const BaseInfoTab: React.FC<BaseInfoTabProps> = (props) => {
useEffect(() => {
if(record) {
//供应商信息
fetchData()
}, []);
}
}, [record]);
if (!registerInfo?.coscoSupplierBase) return <div>{intl.formatMessage({ id: 'component.globalModal.loading' })}...</div>;

View File

@ -34,6 +34,7 @@ const QualificationFormModal: React.FC<QualificationFormModalProps> = ({
initialValues,
readOnly = false,
}) => {
const userId = sessionStorage.getItem('userId') || '';
// 新增与修改
const [form] = Form.useForm();
//查看
@ -78,7 +79,7 @@ const QualificationFormModal: React.FC<QualificationFormModalProps> = ({
dateTime: values.dateTime ? moment(values.dateTime) : undefined,
termOfValidity: values.termOfValidity ? moment(values.termOfValidity) : undefined,
accessory,
"supplierId": "9c12e8ea-a681-4184-81ba-5fa276299a00",
supplierId: userId,
};
if(!values.id) {
qualificationsaAdd(payload).then((res) => {

View File

@ -48,8 +48,10 @@ const QualificationTab: React.FC<QualificationTabProps> = (props) => {
};
useEffect(() => {
if(record) {
getList();
}, []);
}
}, [record]);
const handleAdd = () => {
setEditingRecord(null);

View File

@ -26,6 +26,7 @@ const CompanyInfo: React.FC<CompanyInfoProps> = (props) => {
const [subTab, setSubTab] = useState<string>('');
useEffect(() => {
if(record) {
coscoSupplierBase(record).then((res) => {
if (res.code === 200) {
if (res.data.coscoSupplierBase.supplierType === 'pe') {
@ -35,7 +36,7 @@ const CompanyInfo: React.FC<CompanyInfoProps> = (props) => {
}
}
})
}
}, [record])
return (

View File

@ -5,17 +5,17 @@ import { useIntl } from 'umi';
import type { ColumnsType } from 'antd/es/table';
interface data {
hit:string;
countries:string;
d1:string;
d2:string;
hit: string;
countries: string;
d1: string;
d2: string;
[key: string]: any;
}
const RiskList = ({id}:{id:string}) => {
const RiskList = ({ id }: { id: string }) => {
const intl = useIntl();
const columns:ColumnsType<data> = [
const columns: ColumnsType<data> = [
{
title: intl.formatMessage({ id: 'component.globalModal.hit', defaultMessage: '命中对象' }),
dataIndex: 'hit',
@ -51,17 +51,17 @@ const RiskList = ({id}:{id:string}) => {
if (code === 200) {
setDataList(data);
} else {
message.error(intl.formatMessage({id: 'component.globalModal.fetchRiskFail'}));
message.error(intl.formatMessage({ id: 'component.globalModal.fetchRiskFail' }));
}
} catch (error) {
message.error(intl.formatMessage({id: 'component.globalModal.apiError'}));
message.error(intl.formatMessage({ id: 'component.globalModal.apiError' }));
} finally {
// setLoading(false);
}
};
//初始化
useEffect(() => {
if(id) {
if (id) {
getList();
}
}, [id]);
@ -78,7 +78,7 @@ const RiskList = ({id}:{id:string}) => {
))}
</Descriptions>
))
}
}
</>
);

View File

@ -144,7 +144,7 @@ const SupplierChangeReviewManage: React.FC<Props> = ({ dispatch }) => {
},
{
title: '境内/境外',
dataIndex: 'supplierTypeCn',
dataIndex: 'supplierType',
align: 'center',
width: 160,
},
@ -179,6 +179,7 @@ const SupplierChangeReviewManage: React.FC<Props> = ({ dispatch }) => {
key: 'action',
align: 'center',
width: 160,
fixed: 'right',
render: (_: any, record: any) => (
<Button type="link" onClick={() => handleDetail(record)}>

View File

@ -152,6 +152,8 @@ const mySupplierInquiry: React.FC<mySupplierInquiryProps> = ({ dispatch }) => {
dataIndex: 'categoryName',
key: 'categoryName',
align: 'center',
width: 120,
ellipsis: true,
},
{
title: '准入时间',
@ -172,6 +174,7 @@ const mySupplierInquiry: React.FC<mySupplierInquiryProps> = ({ dispatch }) => {
key: 'option',
align: 'center',
width: 160,
fixed: 'right',
render: (record: any) => (
<Space>
<a