优化初始化以及去掉固定供应商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(() => { useEffect(() => {
if(record) {
getList(); getList();
}, []); }
}, [record]);
const columns: ColumnsType<attachmentsAdd> = [ const columns: ColumnsType<attachmentsAdd> = [

View File

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

View File

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

View File

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

View File

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

View File

@ -77,8 +77,10 @@ const InvoiceTab: React.FC<InvoiceTabProps> = (props) => {
//初始化 //初始化
useEffect(() => { useEffect(() => {
if(record) {
getList(); getList();
}, []); }
}, [record]);
const columns: ColumnsType<InvoiceInfo> = [ const columns: ColumnsType<InvoiceInfo> = [
{ title: 'page.workbench.invoice.index', dataIndex: 'index', width: 80, key: 'index', render: (_: any, __: any, index: number) => index + 1 }, { 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(() => { useEffect(() => {
if(record) {
//供应商信息 //供应商信息
fetchData() fetchData()
}, []); }
}, [record]);
if (!registerInfo?.coscoSupplierBase) return <div>{intl.formatMessage({ id: 'component.globalModal.loading' })}...</div>; if (!registerInfo?.coscoSupplierBase) return <div>{intl.formatMessage({ id: 'component.globalModal.loading' })}...</div>;

View File

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

View File

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

View File

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

View File

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

View File

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