新增品类项增加名称字段
This commit is contained in:
@ -68,7 +68,7 @@ const CreateBlacklistModal: React.FC<CreateBlacklistModalProps> = ({
|
||||
} = {
|
||||
...values,
|
||||
backlistType: '0',
|
||||
supplierIds: suppliers.map((item) => item.supplierId),
|
||||
supplierIds: suppliers.map((item) => item.id),
|
||||
}
|
||||
const res = await blacklist(payload);
|
||||
if (res?.success) {
|
||||
@ -104,9 +104,10 @@ const CreateBlacklistModal: React.FC<CreateBlacklistModalProps> = ({
|
||||
<a onClick={() => supplierDetailModal?.(record.id)}>{name}</a>
|
||||
</Tooltip>)
|
||||
} },
|
||||
{ title: "准入部门", dataIndex: "unit", align: "center" },
|
||||
{ title: "准入时间", dataIndex: "accessTime", align: "center" },
|
||||
// { title: "准入部门", dataIndex: "unit", align: "center" },
|
||||
// { title: "准入时间", dataIndex: "accessTime", align: "center" },
|
||||
{ title: "准入品类", dataIndex: "categoryName", align: "center" },
|
||||
{ title: "统一社会信用代码/税号", dataIndex: "unifiedCode", align: "center" },
|
||||
{
|
||||
title: "操作",
|
||||
dataIndex: "option",
|
||||
|
@ -91,6 +91,8 @@ const SupplierSelectModal: React.FC<SupplierSelectModalProps> = ({
|
||||
};
|
||||
|
||||
const handleOk = () => {
|
||||
console.log(rightData,'rightData');
|
||||
|
||||
onOk(rightData);
|
||||
};
|
||||
|
||||
|
@ -1,20 +1,21 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { Modal, Button, Table, Descriptions, Spin, message, Tooltip } from "antd";
|
||||
import {viewBlacklist } from "../services"; // 假设的接口
|
||||
import { viewBlacklist } from "../services"; // 假设的接口
|
||||
import type { ColumnsType } from 'antd/es/table';
|
||||
import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
|
||||
import { getDictList } from '@/servers/api/dicts';
|
||||
|
||||
interface Supplier {
|
||||
id: number; // 作为 rowKey 用于唯一标识
|
||||
supplierName: string; // 供应商名称
|
||||
unit: string; // 准入部门
|
||||
accessTime: string; // 准入时间
|
||||
categoryName: string; // 准入品类
|
||||
lastEval: string; // 最近一次评价
|
||||
lastEvalDate: string; // 评价时间
|
||||
supplierId: string;
|
||||
categoryId: string;
|
||||
}
|
||||
id: number; // 作为 rowKey 用于唯一标识
|
||||
supplierName: string; // 供应商名称
|
||||
unit: string; // 准入部门
|
||||
accessTime: string; // 准入时间
|
||||
categoryName: string; // 准入品类
|
||||
lastEval: string; // 最近一次评价
|
||||
lastEvalDate: string; // 评价时间
|
||||
supplierId: string;
|
||||
categoryId: string;
|
||||
}
|
||||
interface DetailData {
|
||||
deptName: string;
|
||||
timelimitType: string;
|
||||
@ -36,11 +37,12 @@ const ViewBlacklistModal: React.FC<ViewBlacklistModalProps> = ({
|
||||
const [detail, setDetail] = useState<DetailData | null>(null);
|
||||
const [suppliers, setSuppliers] = useState<Supplier[]>([]);
|
||||
const supplierDetailModal = useSupplierDetailModal();
|
||||
const [timelimitMap, setTimelimitMap] = useState<{ [code: string]: string }>({});
|
||||
|
||||
const fetchData = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const { code, data } = await viewBlacklist(recordId)
|
||||
const { code, data } = await viewBlacklist(recordId)
|
||||
if (code == 200) {
|
||||
setDetail(data);
|
||||
} else {
|
||||
@ -61,11 +63,21 @@ const ViewBlacklistModal: React.FC<ViewBlacklistModalProps> = ({
|
||||
|
||||
useEffect(() => {
|
||||
if (visible && recordId) {
|
||||
getDictList('blacklist_deadline').then((res) => {
|
||||
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;
|
||||
});
|
||||
setTimelimitMap(map);
|
||||
}
|
||||
})
|
||||
fetchData();
|
||||
}
|
||||
}, [visible, recordId]);
|
||||
|
||||
const columns:ColumnsType<Supplier> = [
|
||||
const columns: ColumnsType<Supplier> = [
|
||||
{
|
||||
title: "供应商名称", dataIndex: "supplierName", align: "left",
|
||||
width: 200,
|
||||
@ -79,9 +91,11 @@ const ViewBlacklistModal: React.FC<ViewBlacklistModalProps> = ({
|
||||
}
|
||||
},
|
||||
|
||||
{ title: "准入部门", dataIndex: "deptName", align: "center" },
|
||||
{ title: "准入时间", dataIndex: "evaluateTime", align: "center" },
|
||||
{ title: "准入品类", dataIndex: "categoryName", align: "center", width: 180,
|
||||
// { title: "准入部门", dataIndex: "deptName", align: "center" },
|
||||
// { title: "准入时间", dataIndex: "evaluateTime", align: "center" },
|
||||
{ title: "统一社会信用代码/税号", dataIndex: "unifiedCode", align: "center" },
|
||||
{
|
||||
title: "准入品类", dataIndex: "categoryName", align: "center", width: 180,
|
||||
ellipsis: true,
|
||||
render: (dom, record) => {
|
||||
return (
|
||||
@ -89,7 +103,8 @@ const ViewBlacklistModal: React.FC<ViewBlacklistModalProps> = ({
|
||||
{record.categoryName}
|
||||
</Tooltip>
|
||||
)
|
||||
} },
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
@ -111,7 +126,7 @@ const ViewBlacklistModal: React.FC<ViewBlacklistModalProps> = ({
|
||||
bordered
|
||||
style={{ marginBottom: 24 }}
|
||||
>
|
||||
<Descriptions.Item label="时限类型" >{detail.timelimitType}</Descriptions.Item>
|
||||
<Descriptions.Item label="时限类型" >{timelimitMap[detail.timelimitType] || '' }</Descriptions.Item>
|
||||
<Descriptions.Item label="退出原因" >{detail.blacklistReason}</Descriptions.Item>
|
||||
</Descriptions>
|
||||
)}
|
||||
|
@ -178,7 +178,7 @@ const blacklistManage: React.FC = () => {
|
||||
onCancel={() => setCreateVisible(false)}
|
||||
onOk={() => {
|
||||
setCreateVisible(false)
|
||||
handleSearch
|
||||
handleSearch()
|
||||
}} />
|
||||
<ViewBlacklistModal
|
||||
visible={viewVisible}
|
||||
|
Reference in New Issue
Block a user