企业类型 字典回显

This commit is contained in:
孙景学
2025-07-24 11:56:57 +08:00
parent 823da974f9
commit b2109fdd90
9 changed files with 131 additions and 28 deletions

View File

@ -15,6 +15,7 @@ import AccessStatusSelect from '@/components/CommonSelect/AccessStatusSelect'
//本地服务/接口
import { getPageMy } from './services';
import { downloadFile } from '@/utils/download';
import { getDictList } from '@/servers/api/dicts'
//统一列表分页
import tableProps from '@/utils/tableProps'
@ -77,8 +78,20 @@ const mySupplierInquiry: React.FC<mySupplierInquiryProps> = ({ dispatch }) => {
setLoading(false);
}
};
const [enterpriseTypeMap, setEnterpriseTypeMap] = useState<{ [code: string]: string }>({});
// 初始化
useEffect(() => {
getDictList('enterprise_type').then((res: any) => {
const { code, data } = res;
if (code == 200) {
const map: { [code: string]: string } = {};
data.forEach((item: { code: string, dicName: string }) => {
map[item.code] = item.dicName;
});
setEnterpriseTypeMap(map);
}
})
getList();
}, []);
@ -123,10 +136,11 @@ const mySupplierInquiry: React.FC<mySupplierInquiryProps> = ({ dispatch }) => {
},
{
title: '企业类型',
dataIndex: 'enterpriseTypeCn',
key: 'enterpriseTypeCn',
dataIndex: 'enterpriseType',
key: 'enterpriseType',
align: 'center',
width: 120,
render: (code: string) => enterpriseTypeMap[code] || code
},
{
title: '准入品类',