退出、黑名单、品类库、准入审核状态前端转换

This commit is contained in:
孙景学
2025-08-11 14:40:47 +08:00
parent 0e90bdb8ea
commit 1641d17504
10 changed files with 99 additions and 16 deletions

View File

@ -40,7 +40,9 @@ const SupplierCategoryEntry: React.FC = () => {
//列表分页 //列表分页
const [pagination, setPagination] = useState<TablePaginationConfig>({ current: 1, pageSize: 10, total: 0 }); const [pagination, setPagination] = useState<TablePaginationConfig>({ current: 1, pageSize: 10, total: 0 });
// //
const [enterpriseType, setEnterpriseType] = useState<Dict[]>(); const [enterpriseType, setEnterpriseType] = useState<Dict[]>();
const [approveTypeMap, setApproveTypeMap] = useState<{ [code: string]: string }>({});
//列表加载 //列表加载
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
// 列表方法 // 列表方法
@ -62,6 +64,11 @@ const SupplierCategoryEntry: React.FC = () => {
getList(values, 1, 10); getList(values, 1, 10);
getDictList('approve_type').then((res) => { getDictList('approve_type').then((res) => {
if (res.code == 200) { if (res.code == 200) {
const map: { [code: string]: string } = {};
res.data.forEach((item: { code: string, dicName: string }) => {
map[item.code] = item.dicName;
});
setApproveTypeMap(map);
setEnterpriseType(res.data) setEnterpriseType(res.data)
} }
}) })
@ -109,7 +116,7 @@ const SupplierCategoryEntry: React.FC = () => {
{ title: '准入部门', ellipsis: true, width: 120, dataIndex: 'deptName' }, { title: '准入部门', ellipsis: true, width: 120, dataIndex: 'deptName' },
{ title: '准入方式', ellipsis: true, width: 120, dataIndex: 'accessTypeText' }, { title: '准入方式', ellipsis: true, width: 120, dataIndex: 'accessTypeText' },
{ title: '申请时间', dataIndex: 'createTime', width: 180 }, { title: '申请时间', dataIndex: 'createTime', width: 180 },
{ title: '审批状态', ellipsis: true, width: 120, dataIndex: 'approveStatusText' }, { title: '审批状态', ellipsis: true, width: 120, dataIndex: 'approveStatus', render: (code: string) => approveTypeMap[code] || code },
{ {
title: '操作', title: '操作',
width: 140, width: 140,

View File

@ -10,6 +10,7 @@ import AccessStatusSelect from '@/components/CommonSelect/AccessStatusSelect';
import AccessDepartmentSelect from "@/components/AccessDepartmentSelect" import AccessDepartmentSelect from "@/components/AccessDepartmentSelect"
//接口 //接口
import { getPage } from './services' import { getPage } from './services'
import { getDictList } from '@/servers/api/dicts'
//统一列表分页 //统一列表分页
import tableProps from '@/utils/tableProps' import tableProps from '@/utils/tableProps'
@ -33,6 +34,7 @@ const SupplierCategoryEntryReview: React.FC = () => {
const [pagination, setPagination] = useState<TablePaginationConfig>({ current: 1, pageSize: 10, total: 0 }); const [pagination, setPagination] = useState<TablePaginationConfig>({ current: 1, pageSize: 10, total: 0 });
//列表加载 //列表加载
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [approveTypeMap, setApproveTypeMap] = useState<{ [code: string]: string }>({});
// 列表方法 // 列表方法
const getList = async (values: any = {}, pageNo: number = 1, pageSize: number = 10) => { const getList = async (values: any = {}, pageNo: number = 1, pageSize: number = 10) => {
setLoading(true); setLoading(true);
@ -50,6 +52,15 @@ const SupplierCategoryEntryReview: React.FC = () => {
useEffect(() => { useEffect(() => {
const values = form.getFieldsValue(); const values = form.getFieldsValue();
getList(values, 1, 10); getList(values, 1, 10);
getDictList('approve_type').then((res) => {
if (res.code == 200) {
const map: { [code: string]: string } = {};
res.data.forEach((item: { code: string, dicName: string }) => {
map[item.code] = item.dicName;
});
setApproveTypeMap(map);
}
})
}, []); }, []);
//开启弹窗 //开启弹窗
const openModal = (type: string, record?: any) => { const openModal = (type: string, record?: any) => {
@ -80,7 +91,7 @@ const SupplierCategoryEntryReview: React.FC = () => {
{ title: '准入部门', dataIndex: 'deptName', ellipsis: true }, { title: '准入部门', dataIndex: 'deptName', ellipsis: true },
{ title: '准入方式', dataIndex: 'accessTypeText', width: 120 }, { title: '准入方式', dataIndex: 'accessTypeText', width: 120 },
{ title: '申请时间', dataIndex: 'createTime', width: 180 }, { title: '申请时间', dataIndex: 'createTime', width: 180 },
{ title: '审批状态', dataIndex: 'approveStatusText', width: 120 }, { title: '审批状态', dataIndex: 'approveStatus', width: 120, render: (code: string) => approveTypeMap[code] || code },
{ {
title: '操作', title: '操作',
width: 80, width: 80,

View File

@ -42,7 +42,7 @@ const SupplierEntryReview: React.FC = () => {
const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 }); const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 });
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [modalInfo, setModalInfo] = useState<ModalInfo>({ visible: false, record: null }); const [modalInfo, setModalInfo] = useState<ModalInfo>({ visible: false, record: null });
// const [approveTypeMap, setApproveTypeMap] = useState<{ [code: string]: string }>({});
const [enterpriseType, setEnterpriseType] = useState<Dict[]>(); const [enterpriseType, setEnterpriseType] = useState<Dict[]>();
// 查询数据 // 查询数据
const fetchData = async (params = {}) => { const fetchData = async (params = {}) => {
@ -77,6 +77,11 @@ const SupplierEntryReview: React.FC = () => {
fetchData({ pageNo: 1 }); fetchData({ pageNo: 1 });
getDictList('approve_type').then((res) => { getDictList('approve_type').then((res) => {
if (res.code == 200) { if (res.code == 200) {
const map: { [code: string]: string } = {};
res.data.forEach((item: { code: string, dicName: string }) => {
map[item.code] = item.dicName;
});
setApproveTypeMap(map);
setEnterpriseType(res.data) setEnterpriseType(res.data)
} }
}) })
@ -132,6 +137,7 @@ const SupplierEntryReview: React.FC = () => {
title: '准入部门', title: '准入部门',
dataIndex: 'deptName', dataIndex: 'deptName',
align: 'center', align: 'center',
ellipsis: true,
width: 120, width: 120,
}, },
{ {
@ -145,6 +151,7 @@ const SupplierEntryReview: React.FC = () => {
title: '准入品类', title: '准入品类',
dataIndex: 'categoryNameList', dataIndex: 'categoryNameList',
width: 120, width: 120,
ellipsis: true,
align: 'center', align: 'center',
render: (value: { categoryName: string; categoryPathName: string }[] = []) => { render: (value: { categoryName: string; categoryPathName: string }[] = []) => {
if (!value || value.length === 0) return '-'; if (!value || value.length === 0) return '-';
@ -185,9 +192,10 @@ const SupplierEntryReview: React.FC = () => {
}, },
{ {
title: '审批状态', title: '审批状态',
dataIndex: 'approveStatusText', dataIndex: 'approveStatus',
align: 'center', align: 'center',
width: 120, width: 120,
render: (code: string) => approveTypeMap[code] || code
}, },
{ {
title: '操作', title: '操作',

View File

@ -46,6 +46,8 @@ const CategoryLibraryManage: React.FC = () => {
// //
const [areaMap, setAreaMap] = useState<{ [code: string]: string }>({}); const [areaMap, setAreaMap] = useState<{ [code: string]: string }>({});
const [enterpriseType, setEnterpriseType] = useState<Dict[]>(); const [enterpriseType, setEnterpriseType] = useState<Dict[]>();
const [approveTypeMap, setApproveTypeMap] = useState<{ [code: string]: string }>({});
// 新增弹窗 // 新增弹窗
const [viewVisible, setViewVisible] = useState(false); const [viewVisible, setViewVisible] = useState(false);
const [currentStoreId, setCurrentStoreId] = useState<string>(''); const [currentStoreId, setCurrentStoreId] = useState<string>('');
@ -95,6 +97,11 @@ const CategoryLibraryManage: React.FC = () => {
useEffect(() => { useEffect(() => {
getDictList('approve_type').then((res) => { getDictList('approve_type').then((res) => {
if (res.code == 200) { if (res.code == 200) {
const map: { [code: string]: string } = {};
res.data.forEach((item: { code: string, dicName: string }) => {
map[item.code] = item.dicName;
});
setApproveTypeMap(map);
setEnterpriseType(res.data) setEnterpriseType(res.data)
} }
}) })
@ -166,9 +173,10 @@ const CategoryLibraryManage: React.FC = () => {
}, },
{ {
title: '审批状态', title: '审批状态',
dataIndex: 'approveStatusName', dataIndex: 'approveStatus',
key: 'approveStatusName', key: 'approveStatus',
align: 'center', align: 'center',
render: (code: string) => approveTypeMap[code] || code
}, },
{ {
title: '操作', title: '操作',

View File

@ -43,6 +43,7 @@ const CategoryLibraryManage: React.FC = () => {
// 分页 // 分页
const [pagination, setPagination] = useState<TablePaginationConfig>({ current: 1, pageSize: 10, total: 0 }); const [pagination, setPagination] = useState<TablePaginationConfig>({ current: 1, pageSize: 10, total: 0 });
const [areaMap, setAreaMap] = useState<{ [code: string]: string }>({}); const [areaMap, setAreaMap] = useState<{ [code: string]: string }>({});
const [approveTypeMap, setApproveTypeMap] = useState<{ [code: string]: string }>({});
// 新增弹窗 // 新增弹窗
const [addVisible, setAddVisible] = useState(false); const [addVisible, setAddVisible] = useState(false);
@ -92,6 +93,15 @@ const CategoryLibraryManage: React.FC = () => {
// 初始化 // 初始化
useEffect(() => { useEffect(() => {
getDictList('approve_type').then((res) => {
if (res.code == 200) {
const map: { [code: string]: string } = {};
res.data.forEach((item: { code: string, dicName: string }) => {
map[item.code] = item.dicName;
});
setApproveTypeMap(map);
}
})
getDictList('area').then(res => { getDictList('area').then(res => {
if (res.code === 200) { if (res.code === 200) {
const map: { [code: string]: string } = {}; const map: { [code: string]: string } = {};
@ -157,11 +167,12 @@ const CategoryLibraryManage: React.FC = () => {
}, },
{ {
title: '审批状态', title: '审批状态',
dataIndex: 'processStatusName', dataIndex: 'approveStatus',
key: 'processStatusName', key: 'approveStatus',
align: 'center', align: 'center',
width: 140, width: 140,
ellipsis: true, ellipsis: true,
render: (code: string) => approveTypeMap[code] || code
}, },
{ {

View File

@ -79,7 +79,7 @@ const mySupplierInquiry: React.FC<mySupplierInquiryProps> = ({ dispatch }) => {
} }
}; };
const [enterpriseTypeMap, setEnterpriseTypeMap] = useState<{ [code: string]: string }>({}); const [enterpriseTypeMap, setEnterpriseTypeMap] = useState<{ [code: string]: string }>({});
const [approveTypeMap, setApproveTypeMap] = useState<{ [code: string]: string }>({});
// 初始化 // 初始化
useEffect(() => { useEffect(() => {
getDictList('enterprise_type').then((res: any) => { getDictList('enterprise_type').then((res: any) => {
@ -92,6 +92,15 @@ const mySupplierInquiry: React.FC<mySupplierInquiryProps> = ({ dispatch }) => {
setEnterpriseTypeMap(map); setEnterpriseTypeMap(map);
} }
}) })
getDictList('approve_type').then((res) => {
if (res.code == 200) {
const map: { [code: string]: string } = {};
res.data.forEach((item: { code: string, dicName: string }) => {
map[item.code] = item.dicName;
});
setApproveTypeMap(map);
}
})
getList(); getList();
}, []); }, []);
@ -175,10 +184,11 @@ const mySupplierInquiry: React.FC<mySupplierInquiryProps> = ({ dispatch }) => {
}, },
{ {
title: '准入状态', title: '准入状态',
dataIndex: 'accessStatusCn', dataIndex: 'accessStatus',
key: 'accessStatusCn', key: 'accessStatus',
align: 'center', align: 'center',
width: 140, width: 140,
render: (code: string) => approveTypeMap[code] || code
}, },
{ {
title: '操作', title: '操作',

View File

@ -27,6 +27,7 @@ const blacklistManage: React.FC = () => {
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 }); const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 });
const [enterpriseType, setEnterpriseType] = useState<Dict[]>(); const [enterpriseType, setEnterpriseType] = useState<Dict[]>();
const [approveTypeMap, setApproveTypeMap] = useState<{ [code: string]: string }>({});
// 查询接口 // 查询接口
const getList = async (pageNo = 1, pageSize = 10) => { const getList = async (pageNo = 1, pageSize = 10) => {
@ -88,6 +89,11 @@ const blacklistManage: React.FC = () => {
useEffect(() => { useEffect(() => {
getDictList('approve_type').then((res) => { getDictList('approve_type').then((res) => {
if (res.code == 200) { if (res.code == 200) {
const map: { [code: string]: string } = {};
res.data.forEach((item: { code: string, dicName: string }) => {
map[item.code] = item.dicName;
});
setApproveTypeMap(map);
setEnterpriseType(res.data) setEnterpriseType(res.data)
} }
}) })
@ -107,7 +113,8 @@ const blacklistManage: React.FC = () => {
{ title: "发起单位", dataIndex: "unitName", key: "unitName", align: "center", width: 180, ellipsis: true }, { title: "发起单位", dataIndex: "unitName", key: "unitName", align: "center", width: 180, ellipsis: true },
{ title: "发起部门", dataIndex: "deptName", key: "deptName", align: "center", width: 180, ellipsis: true }, { title: "发起部门", dataIndex: "deptName", key: "deptName", align: "center", width: 180, ellipsis: true },
{ title: "发起时间", dataIndex: "createTime", key: "createTime", align: "center", width: 180 }, { title: "发起时间", dataIndex: "createTime", key: "createTime", align: "center", width: 180 },
{ title: "审批记录状态", dataIndex: "approveStatusName", key: "approveStatusName", align: "center", width: 180 }, { title: "审批记录状态", dataIndex: "approveStatus", key: "approveStatus", align: "center", width: 180, render: (code: string) => approveTypeMap[code] || code },
{ {
title: "操作", title: "操作",

View File

@ -41,6 +41,7 @@ const blacklistManage: React.FC = () => {
const [selectedRecordId, setSelectedRecordId] = useState<string | null>(null); const [selectedRecordId, setSelectedRecordId] = useState<string | null>(null);
//字典下拉 //字典下拉
const [enterpriseType, setEnterpriseType] = useState<Dict[]>(); const [enterpriseType, setEnterpriseType] = useState<Dict[]>();
const [approveTypeMap, setApproveTypeMap] = useState<{ [code: string]: string }>({});
// 查询接口 // 查询接口
const getList = async (pageNo = 1, pageSize = 10) => { const getList = async (pageNo = 1, pageSize = 10) => {
@ -82,6 +83,11 @@ const blacklistManage: React.FC = () => {
useEffect(() => { useEffect(() => {
getDictList('approve_type').then((res) => { getDictList('approve_type').then((res) => {
if (res.code == 200) { if (res.code == 200) {
const map: { [code: string]: string } = {};
res.data.forEach((item: { code: string, dicName: string }) => {
map[item.code] = item.dicName;
});
setApproveTypeMap(map);
setEnterpriseType(res.data) setEnterpriseType(res.data)
} }
}) })
@ -101,7 +107,7 @@ const blacklistManage: React.FC = () => {
{ title: "发起单位", dataIndex: "unitName", key: "unitName", align: "center", width: 180, ellipsis: true }, { title: "发起单位", dataIndex: "unitName", key: "unitName", align: "center", width: 180, ellipsis: true },
{ title: "发起部门", dataIndex: "deptName", key: "deptName", align: "center", width: 180, ellipsis: true }, { title: "发起部门", dataIndex: "deptName", key: "deptName", align: "center", width: 180, ellipsis: true },
{ title: "发起时间", dataIndex: "createTime", key: "createTime", align: "center", width: 180 }, { title: "发起时间", dataIndex: "createTime", key: "createTime", align: "center", width: 180 },
{ title: "审批记录状态", dataIndex: "approveStatusName", key: "approveStatusName", align: "center", width: 180 }, { title: "审批记录状态", dataIndex: "approveStatus", key: "approveStatus", align: "center", width: 180, render: (code: string) => approveTypeMap[code] || code },
{ {
title: "操作", title: "操作",

View File

@ -35,6 +35,7 @@ const supplierExitAudit: React.FC = () => {
const [viewVisible, setViewVisible] = useState(false); const [viewVisible, setViewVisible] = useState(false);
const [selectedRecordId, setSelectedRecordId] = useState<string | null>(null); const [selectedRecordId, setSelectedRecordId] = useState<string | null>(null);
const [enterpriseType, setEnterpriseType] = useState<Dict[]>(); const [enterpriseType, setEnterpriseType] = useState<Dict[]>();
const [approveTypeMap, setApproveTypeMap] = useState<{ [code: string]: string }>({});
// 查询接口 // 查询接口
const getList = async (pageNo = 1, pageSize = 10) => { const getList = async (pageNo = 1, pageSize = 10) => {
@ -79,6 +80,11 @@ const supplierExitAudit: React.FC = () => {
useEffect(() => { useEffect(() => {
getDictList('approve_type').then((res) => { getDictList('approve_type').then((res) => {
if (res.code == 200) { if (res.code == 200) {
const map: { [code: string]: string } = {};
res.data.forEach((item: { code: string, dicName: string }) => {
map[item.code] = item.dicName;
});
setApproveTypeMap(map);
setEnterpriseType(res.data) setEnterpriseType(res.data)
} }
}) })
@ -98,7 +104,8 @@ const supplierExitAudit: React.FC = () => {
{ title: "发起单位", dataIndex: "orgName", key: "orgName", align: "center", width: 180, ellipsis: true }, { title: "发起单位", dataIndex: "orgName", key: "orgName", align: "center", width: 180, ellipsis: true },
{ title: "发起部门", dataIndex: "deptName", key: "deptName", align: "center", width: 180, ellipsis: true }, { title: "发起部门", dataIndex: "deptName", key: "deptName", align: "center", width: 180, ellipsis: true },
{ title: "发起时间", dataIndex: "createTime", key: "createTime", align: "center", width: 180 }, { title: "发起时间", dataIndex: "createTime", key: "createTime", align: "center", width: 180 },
{ title: "审批记录状态", dataIndex: "approveStatusText", key: "approveStatusText", align: "center", width: 180 }, { title: "审批记录状态", dataIndex: "approveStatus", key: "approveStatus", align: "center", width: 180, render: (code: string) => approveTypeMap[code] || code },
{ {
title: "操作", title: "操作",
key: "option", key: "option",

View File

@ -33,6 +33,8 @@ const supplierExitManage: React.FC = () => {
const [viewVisible, setViewVisible] = useState(false); const [viewVisible, setViewVisible] = useState(false);
const [selectedRecordId, setSelectedRecordId] = useState<string | null>(null); const [selectedRecordId, setSelectedRecordId] = useState<string | null>(null);
const [enterpriseType, setEnterpriseType] = useState<Dict[]>(); const [enterpriseType, setEnterpriseType] = useState<Dict[]>();
const [approveTypeMap, setApproveTypeMap] = useState<{ [code: string]: string }>({});
// 查询接口 // 查询接口
const getList = async (pageNo = 1, pageSize = 10) => { const getList = async (pageNo = 1, pageSize = 10) => {
setLoading(true); setLoading(true);
@ -77,6 +79,11 @@ const supplierExitManage: React.FC = () => {
useEffect(() => { useEffect(() => {
getDictList('approve_type').then((res) => { getDictList('approve_type').then((res) => {
if (res.code == 200) { if (res.code == 200) {
const map: { [code: string]: string } = {};
res.data.forEach((item: { code: string, dicName: string }) => {
map[item.code] = item.dicName;
});
setApproveTypeMap(map);
setEnterpriseType(res.data) setEnterpriseType(res.data)
} }
}) })
@ -96,7 +103,8 @@ const supplierExitManage: React.FC = () => {
{ title: "发起单位", dataIndex: "orgName", key: "orgName", align: "center", width: 180, ellipsis: true }, { title: "发起单位", dataIndex: "orgName", key: "orgName", align: "center", width: 180, ellipsis: true },
{ title: "发起部门", dataIndex: "deptName", key: "deptName", align: "center", width: 180, ellipsis: true }, { title: "发起部门", dataIndex: "deptName", key: "deptName", align: "center", width: 180, ellipsis: true },
{ title: "发起时间", dataIndex: "createTime", key: "createTime", align: "center", width: 180 }, { title: "发起时间", dataIndex: "createTime", key: "createTime", align: "center", width: 180 },
{ title: "审批记录状态", dataIndex: "approveStatusText", key: "approveStatusText", align: "center", width: 180 }, { title: "审批记录状态", dataIndex: "approveStatus", key: "approveStatus", align: "center", width: 180, render: (code: string) => approveTypeMap[code] || code },
{ {
title: "操作", title: "操作",
key: "option", key: "option",