企业类型 字典回显

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

@ -27,6 +27,7 @@ const SupplierMessage: React.FC = () => {
const [viewVisible, setViewVisible] = useState(false); // 弹窗显隐
//下拉数据
const [categoryOptions, setCategoryOptions] = useState<CategoryOption[]>([]);
const [typeMap, setTypeMap] = useState<{ [code: string]: string }>({});
// 获取数据
const getList = async (pageNo = 1, pageSize = 10) => {
@ -62,6 +63,11 @@ const SupplierMessage: React.FC = () => {
getDictList('message_type').then((res: any) => {
const { code, data } = res;
if (code == 200) {
const map: { [code: string]: string } = {};
res.data.forEach((item: { code: string, dicName: string }) => {
map[item.code] = item.dicName;
});
setTypeMap(map);
setCategoryOptions(data)
}
})
@ -87,9 +93,10 @@ const SupplierMessage: React.FC = () => {
},
{
title: '业务类型',
dataIndex: 'typeCn',
key: 'typeCn',
dataIndex: 'type',
key: 'type',
align: 'center',
render: (code: string) => typeMap[code] || code
},
{
title: '接收时间',