处理序号字典

This commit is contained in:
孙景学
2025-07-10 09:31:22 +08:00
parent 1f2986b5ae
commit eefc97e553
26 changed files with 300 additions and 426 deletions

View File

@ -7,7 +7,7 @@ import { getDictList } from '@/servers/api/dicts'
import { getPage, submit, restoreSubmit } from './services'
interface Columns {
themeName: string;
unitName: string;
@ -24,18 +24,18 @@ const blacklistManage: React.FC = () => {
const [data, setData] = useState<Columns[]>([]);
const [loading, setLoading] = useState(false);
const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 });
const [enterpriseType, setEnterpriseType] = useState<Dict[]>();
const [enterpriseType, setEnterpriseType] = useState<Dict[]>();
// 查询接口
const getList = async (pageNo = 1, pageSize = 10) => {
setLoading(true);
// 可传查询条件
const values = form.getFieldsValue();
const { exitTheme, time, deptId, approveStatus } = values;
const startTime = time ? moment(time[0]).format('YYYY-MM-DD') : '';
const endTime = time ? moment(time[1]).format('YYYY-MM-DD') : '';
const { code, data } = await getPage({ basePageRequest: { pageNo, pageSize } , exitTheme, deptId, approveStatus, startTime, endTime });
const values = form.getFieldsValue();
const { exitTheme, time, deptId, approveStatus } = values;
const startTime = time ? moment(time[0]).format('YYYY-MM-DD') : '';
const endTime = time ? moment(time[1]).format('YYYY-MM-DD') : '';
const { code, data } = await getPage({ basePageRequest: { pageNo, pageSize }, exitTheme, deptId, approveStatus, startTime, endTime });
if (code === 200) {
setData(data.records);
setPagination(prev => ({ ...prev, current: pageNo, pageSize, total: data.total }));
@ -84,11 +84,11 @@ const blacklistManage: React.FC = () => {
};
useEffect(() => {
getDictList('approve_type').then((res) => {
if (res.code == 200) {
setEnterpriseType(res.data)
}
})
getDictList('approve_type').then((res) => {
if (res.code == 200) {
setEnterpriseType(res.data)
}
})
getList();
}, []);
@ -99,7 +99,7 @@ const blacklistManage: React.FC = () => {
key: "index",
align: "center",
width: 60,
render: (_: any, __: any, idx: number) => idx + 1,
render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1,
},
{ title: "申请主题", dataIndex: "themeName", key: "themeName", align: "center" },
{ title: "发起单位", dataIndex: "unitName", key: "unitName", align: "center" },
@ -132,21 +132,21 @@ const blacklistManage: React.FC = () => {
{/* 查询表单 */}
<Form form={form} layout="inline" style={{ marginBottom: 12 }}>
<Form.Item name="exitTheme" label="申请主题">
<Input placeholder="请输入供应商名称关键字" style={{ width: 150 }} allowClear maxLength={50} />
</Form.Item>
<Form.Item name="deptId" label="发起单位">
</Form.Item>
<Form.Item name="approveStatus" label="审批记录状态">
<Select style={{ width: 150 }} placeholder="请选择审批记录状态" allowClear>
{enterpriseType?.map(item => (
<Select.Option key={item.code} value={item.code}>{item.dicName}</Select.Option>
))}
</Select>
</Form.Item>
<Form.Item name="time" label="发起时间">
<DatePicker.RangePicker style={{ width: 220 }} allowClear />
</Form.Item>
<Input placeholder="请输入供应商名称关键字" style={{ width: 150 }} allowClear maxLength={50} />
</Form.Item>
<Form.Item name="deptId" label="发起单位">
</Form.Item>
<Form.Item name="approveStatus" label="审批记录状态">
<Select style={{ width: 150 }} placeholder="请选择审批记录状态" allowClear>
{enterpriseType?.map(item => (
<Select.Option key={item.code} value={item.code}>{item.dicName}</Select.Option>
))}
</Select>
</Form.Item>
<Form.Item name="time" label="发起时间">
<DatePicker.RangePicker style={{ width: 220 }} allowClear />
</Form.Item>
<Form.Item>
<Button type="primary" icon={<SearchOutlined />} onClick={handleSearch}></Button>
<Button style={{ marginLeft: 8 }} icon={<ReloadOutlined />} onClick={handleReset}></Button>

View File

@ -61,6 +61,7 @@ const CreateBlacklistModal: React.FC<CreateBlacklistModalProps> = ({
supplierIds: string[],
} = {
...values,
backlistType: '0',
supplierIds: suppliers.map((item) => item.supplierId),
}
const res = await blacklist(payload);
@ -137,7 +138,7 @@ const CreateBlacklistModal: React.FC<CreateBlacklistModalProps> = ({
layout="horizontal"
>
<Form.Item
{/* <Form.Item
label="黑名单类型"
name="backlistType"
rules={[{ required: true, message: '请选择黑名单类型' }]}
@ -147,7 +148,7 @@ const CreateBlacklistModal: React.FC<CreateBlacklistModalProps> = ({
<Option key={opt.value} value={opt.value}>{opt.label}</Option>
))}
</Select>
</Form.Item>
</Form.Item> */}
<Form.Item
label="时限类型"

View File

@ -114,9 +114,7 @@ const SupplierSelectModal: React.FC<SupplierSelectModalProps> = ({
></Checkbox>
)
},
{ title: "供应商名称", dataIndex: "supplierName" },
{ title: "准入单位", dataIndex: "deptId" },
{ title: "准入部门", dataIndex: "deptId" },
{ title: "供应商名称", dataIndex: "supplierName", ellipsis: true },
{ title: "准入品类", dataIndex: "categoryName" }
];
@ -142,9 +140,7 @@ const SupplierSelectModal: React.FC<SupplierSelectModalProps> = ({
></Checkbox>
)
},
{ title: "供应商名称", dataIndex: "supplierName" },
{ title: "准入单位", dataIndex: "deptId" },
{ title: "准入部门", dataIndex: "deptId" },
{ title: "供应商名称", dataIndex: "supplierName", ellipsis: true },
{ title: "准入品类", dataIndex: "categoryName" }
];

View File

@ -2,9 +2,11 @@ import React, { useEffect, useState } from "react";
import { Form, Button, Table, Select, Input, DatePicker, Space, message } from "antd";
import { SearchOutlined, ReloadOutlined, PlusOutlined } from "@ant-design/icons";
import type { ColumnsType } from 'antd/es/table';
//组件
import ViewBlacklistModal from './components/ViewBlacklistModal';
import CreateBlacklistModal from './components/CreateBlacklistModal'
import moment from 'moment';
//字典与接口
import { getDictList } from '@/servers/api/dicts'
import { getPage } from './services'
@ -21,13 +23,21 @@ interface Dict {
code: string;
}
const blacklistManage: React.FC = () => {
//搜索
const [form] = Form.useForm();
// 渲染列表数据
const [data, setData] = useState<Columns[]>([]);
//列表加载
const [loading, setLoading] = useState(false);
//列表分页
const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 });
//发起申请组件
const [createVisible, setCreateVisible] = useState(false);
//查看组件
const [viewVisible, setViewVisible] = useState(false);
// 组件传递ID
const [selectedRecordId, setSelectedRecordId] = useState<string | null>(null);
//字典下拉
const [enterpriseType, setEnterpriseType] = useState<Dict[]>();
// 查询接口