diff --git a/src/pages/Company/List/edit.tsx b/src/pages/Company/List/edit.tsx index 0aad5fa..3c4aa34 100644 --- a/src/pages/Company/List/edit.tsx +++ b/src/pages/Company/List/edit.tsx @@ -40,13 +40,15 @@ const ListEdit: React.FC = (props) => { const [form] = Form.useForm(); useEffect(() => { - form.resetFields(); - if (props.values) { - form.setFieldsValue({ - ...props.values, - }); + if (props.open) { + form.resetFields(); + if (props.values) { + form.setFieldsValue({ + ...props.values, + }); + } } - }, [form, props]); + }, [form, props.values?.companyId, props.open]); const handleCancel = () => { props.onCancel(); @@ -55,6 +57,7 @@ const ListEdit: React.FC = (props) => { const handleFinish = async (values: Record) => { await props.onSubmit(values as API.CompanyList.Company); + return true; }; return ( diff --git a/src/pages/Company/List/index.tsx b/src/pages/Company/List/index.tsx index 40ee021..74ce0fd 100644 --- a/src/pages/Company/List/index.tsx +++ b/src/pages/Company/List/index.tsx @@ -146,8 +146,19 @@ function ManagementList() { { title: '公司行业', dataIndex: 'industry', - valueType: 'text', + valueType: 'treeSelect', align: 'center', + fieldProps: { + fieldNames: { label: 'label', value: 'id', children: 'children' }, + treeDefaultExpandAll: false, + showSearch: true, + allowClear: true, + placeholder: '请选择行业', + }, + request: async () => { + const res = await getCmsIndustryTreeList(); + return (res?.data || []) as any; + }, render: (_, record) => { return ; }, @@ -170,6 +181,24 @@ function ManagementList() { valueEnum: companyNatureEnum, render: (_, record) => , }, + { + title: '法定代表人', + dataIndex: 'legalPerson', + valueType: 'text', + align: 'center', + }, + { + title: '联系人', + dataIndex: 'contactPerson', + valueType: 'text', + align: 'center', + }, + { + title: '联系电话', + dataIndex: 'contactPersonPhone', + valueType: 'text', + align: 'center', + }, { title: '公司位置', dataIndex: 'location', @@ -329,6 +358,9 @@ function ManagementList() { }; }) } + search={{ + defaultCollapsed: false, + }} toolBarRender={() => [