处理序号字典

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

@ -17,14 +17,17 @@ const CategoryAddModal: React.FC<Props> = ({ visible, onCancel }) => {
const [submitting, setSubmitting] = useState(false);
useEffect(() => {
if (!visible) setValue([]);
//tree数据
treeData().then((res) => {
const { code, data } = res;
if (code == 200) {
setDataTree(data)
}
})
if(visible) {
//tree数据
treeData().then((res) => {
const { code, data } = res;
if (code == 200) {
setDataTree(data)
}
})
} else {
setValue([]);
}
}, [visible]);
// 提交方法

View File

@ -8,7 +8,7 @@ import { useIntl } from 'umi';
//本地服务/接口
import { getCategoryPage } from '../services';
//本地组件
import CategoryAddModal from './CategoryAddModal';
// import CategoryAddModal from './CategoryAddModal';
interface Data {
id: number;
@ -78,7 +78,7 @@ const SupplierAccessDetailModal: React.FC<SupplierAccessDetailModalProps> = ({ v
dataIndex: "index",
key: "index",
align: "center",
render: (_: any, __: any, idx: number) => idx + 1,
render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1,
width: 60,
},
{
@ -143,7 +143,7 @@ const SupplierAccessDetailModal: React.FC<SupplierAccessDetailModalProps> = ({ v
<Form.Item>
<Button onClick={handleReset}></Button>
</Form.Item>
<Form.Item>
{/* <Form.Item>
<Button
type="primary"
style={{ background: "#52a8ff", borderColor: "#52a8ff" }}
@ -151,7 +151,7 @@ const SupplierAccessDetailModal: React.FC<SupplierAccessDetailModalProps> = ({ v
>
新增品类
</Button>
</Form.Item>
</Form.Item> */}
</Form>
{/* 表格内容 */}
<Table
@ -162,12 +162,12 @@ const SupplierAccessDetailModal: React.FC<SupplierAccessDetailModalProps> = ({ v
pagination={pagination}
onChange={(pagination) => getList(pagination.current!, pagination.pageSize!)}
/>
{/* 新增品类弹窗 */}
{/* 新增品类弹窗
<CategoryAddModal
visible={addModalVisible}
onCancel={() => setAddModalVisible(false)}
// onOk={...} // 根据你的业务需要加
/>
/>*/}
</Modal>
);
};

View File

@ -1,15 +1,16 @@
import React, { useEffect, useState } from "react";
//第三方UI库/组件
import { Form, Button, Table, Select, Input, Tree, Row, Col, Space, message } from 'antd';
import { Form, Button, Table, Select, Input, Tree, Row, Col, Space, Tooltip } from 'antd';
import { SearchOutlined, DownloadOutlined, ReloadOutlined } from '@ant-design/icons';
//类型定义
import type { ColumnsType, TablePaginationConfig } from 'antd/es/table';
//umi 相关
import { connect } from 'umi';
//本地组件、弹窗、业务逻辑
import SupplierViewModal from './components/SupplierViewModal';
import SupplierDetailModal from './components/SupplierDetailModal';
//本地服务/接口
import { treeData, systemDict, getPageQualified } from './services';
import { treeData, getPageQualified } from './services';
const { Option } = Select;
//下拉数据接口
@ -23,8 +24,10 @@ interface Data {
regTime: string;
status: string;
}
const groupQualifiedSupplierQuery: React.FC = () => {
interface Props {
dispatch: any;
}
const groupQualifiedSupplierQuery: React.FC<Props> = ({dispatch}) => {
//搜搜表单
const [form] = Form.useForm();
// 树数据
@ -38,7 +41,7 @@ const groupQualifiedSupplierQuery: React.FC = () => {
//列表加载
const [loading, setLoading] = useState(false);
//分页
const [pagination, setPagination] = useState<TablePaginationConfig>({ current: 1, pageSize: 10, total: 188 });
const [pagination, setPagination] = useState<TablePaginationConfig>({ current: 1, pageSize: 10, total: 0 });
//查看是否显示状态
const [viewVisible, setViewVisible] = useState(false);
//准入明细是否显示状态
@ -79,7 +82,8 @@ const groupQualifiedSupplierQuery: React.FC = () => {
const getList = async (treeId: string, pageNo: number = 1, pageSize: number = 10) => {
setLoading(true);
try {
const { code, data, message } = await getPageQualified({ pageNo, pageSize, treeId });
const values = form.getFieldsValue();
const { code, data, message } = await getPageQualified({ pageNo, pageSize, treeId, ...values });
if (code === 200) {
setData(data.records);
setPagination({ current: pageNo, pageSize, total: data.total });
@ -102,26 +106,24 @@ const groupQualifiedSupplierQuery: React.FC = () => {
// 初始化时选中树第一个叶子节点,并请求右表
useEffect(() => {
// 境内/境外 下拉
systemDict('regionOptions').then((res) => {
const { code, data } = res;
if (code == 200) {
setRegionOptions(data)
}
});
// 集采类别 下拉
systemDict('categoryOptions').then((res) => {
const { code, data } = res;
if (code == 200) {
setCategoryOptions(data)
}
});
// 集采库 下拉
systemDict('storeOptions').then((res) => {
const { code, data } = res;
if (code == 200) {
setStoreOptions(data)
}
});
setRegionOptions([
{ label: '境内企业', value: 'dvs' },
{ label: '境外企业', value: 'ovs' },
])
// // 集采类别 下拉
// systemDict('categoryOptions').then((res) => {
// const { code, data } = res;
// if (code == 200) {
// setCategoryOptions(data)
// }
// });
// // 集采库 下拉
// systemDict('storeOptions').then((res) => {
// const { code, data } = res;
// if (code == 200) {
// setStoreOptions(data)
// }
// });
//tree数据
treeData().then((res) => {
const { code, data } = res;
@ -145,14 +147,29 @@ const groupQualifiedSupplierQuery: 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: 'name',
key: 'name',
align: 'center',
align: 'left',
ellipsis: true,
render: (dom, record) =>
<Tooltip title={record.name}>
<a
onClick={() => {
dispatch({
type: 'globalModal/show',
payload: {
id: record.id,
},
});
}}
>
{record.name}
</a>
</Tooltip>,
},
{
title: '统一社会信用代码/税号',
@ -170,8 +187,8 @@ const groupQualifiedSupplierQuery: React.FC = () => {
},
{
title: '企业类型',
dataIndex: 'type',
key: 'type',
dataIndex: 'enterpriseTypeCn',
key: 'enterpriseTypeCn',
align: 'center',
ellipsis: true,
},
@ -236,9 +253,9 @@ const groupQualifiedSupplierQuery: React.FC = () => {
style={{ marginBottom: 12, }}
>
<Form.Item name="name" label="供应商名称">
<Input placeholder="请输入供应商名称关键字" style={{ width: 180 }} />
<Input placeholder="请输入供应商名称关键字" style={{ width: 180 }} maxLength={50} />
</Form.Item>
<Form.Item name="category" label="集采类别">
{/* <Form.Item name="category" label="集采类别">
<Select style={{ width: 150 }} allowClear>
{categoryOptions.map(opt => (
<Option key={opt.value} value={opt.value}>{opt.label}</Option>
@ -251,24 +268,24 @@ const groupQualifiedSupplierQuery: React.FC = () => {
<Option key={opt.value} value={opt.value}>{opt.label}</Option>
))}
</Select>
</Form.Item>
<Form.Item name="region" label="境内/境外">
<Select style={{ width: 130 }} allowClear>
</Form.Item> */}
<Form.Item name="supplierType" label="境内/境外">
<Select style={{ width: 130 }} allowClear placeholder="请选择境内/境外" >
{regionOptions.map(opt => (
<Option key={opt.value} value={opt.value}>{opt.label}</Option>
))}
</Select>
</Form.Item>
<Form.Item>
<Button type="primary" icon={<DownloadOutlined />} style={{ marginRight: 8 }} onClick={handleExport}>
</Button>
<Button type="primary" icon={<SearchOutlined />} htmlType="submit" onClick={handleSearch}>
</Button>
<Button style={{ marginLeft: 8 }} icon={<ReloadOutlined />} onClick={handleReset}>
</Button>
<Button type="primary" icon={<DownloadOutlined />} style={{ marginLeft: 8 }} onClick={handleExport}>
</Button>
</Form.Item>
</Form>
{/* 表格 */}
@ -299,4 +316,4 @@ const groupQualifiedSupplierQuery: React.FC = () => {
);
};
export default groupQualifiedSupplierQuery;
export default connect()(groupQualifiedSupplierQuery);

View File

@ -92,6 +92,7 @@ const mySupplierInquiry: React.FC<mySupplierInquiryProps> = ({ dispatch }) => {
// 准入状态下拉
setStoreOptions([
{ label: '未准入', value: '0' },
{ label: '已准入', value: '1' },
{ label: '退出', value: '2' },
])
@ -207,15 +208,15 @@ const mySupplierInquiry: React.FC<mySupplierInquiryProps> = ({ dispatch }) => {
</Select>
</Form.Item>
<Form.Item>
<Button type="primary" icon={<DownloadOutlined />} style={{ marginRight: 8 }} onClick={handleExport}>
</Button>
<Button type="primary" icon={<SearchOutlined />} htmlType="submit" onClick={handleSearch}>
</Button>
<Button style={{ marginLeft: 8 }} icon={<ReloadOutlined />} onClick={handleReset}>
</Button>
<Button type="primary" icon={<DownloadOutlined />} style={{ marginLeft: 8 }} onClick={handleExport}>
</Button>
</Form.Item>
</Form>
{/* 表格 */}

View File

@ -8,7 +8,7 @@ import { useIntl } from 'umi';
//本地服务/接口
import { getCategoryPage } from '../services';
//本地组件
import CategoryAddModal from './CategoryAddModal';
// import CategoryAddModal from './CategoryAddModal';
interface Data {
id: number;
@ -78,7 +78,7 @@ const SupplierAccessDetailModal: React.FC<SupplierAccessDetailModalProps> = ({ v
dataIndex: "index",
key: "index",
align: "center",
render: (_: any, __: any, idx: number) => idx + 1,
render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1,
width: 60,
},
{
@ -139,7 +139,7 @@ const SupplierAccessDetailModal: React.FC<SupplierAccessDetailModalProps> = ({ v
<Form.Item>
<Button onClick={handleReset}></Button>
</Form.Item>
<Form.Item>
{/* <Form.Item>
<Button
type="primary"
style={{ background: "#52a8ff", borderColor: "#52a8ff" }}
@ -147,7 +147,7 @@ const SupplierAccessDetailModal: React.FC<SupplierAccessDetailModalProps> = ({ v
>
新增品类
</Button>
</Form.Item>
</Form.Item> */}
</Form>
{/* 表格内容 */}
<Table
@ -158,12 +158,12 @@ const SupplierAccessDetailModal: React.FC<SupplierAccessDetailModalProps> = ({ v
pagination={pagination}
onChange={(pagination) => getList(pagination.current!, pagination.pageSize!)}
/>
{/* 新增品类弹窗 */}
{/* 新增品类弹窗
<CategoryAddModal
visible={addModalVisible}
onCancel={() => setAddModalVisible(false)}
// onOk={...} // 根据你的业务需要加
/>
/> */}
</Modal>
);
};

View File

@ -1,17 +1,17 @@
import React, { useEffect, useState } from "react";
//第三方UI库/组件
import { Form, Button, Table, Select, Input, Tree, Row, Col, Space, message } from 'antd';
import { Form, Button, Table , Input, Tree, Row, Col, Space, Tooltip } from 'antd';
import { SearchOutlined, DownloadOutlined, ReloadOutlined } from '@ant-design/icons';
//类型定义
import type { ColumnsType, TablePaginationConfig } from 'antd/es/table';
//umi 相关
import { connect } from 'umi';
//本地组件、弹窗、业务逻辑
import SupplierViewModal from './components/SupplierViewModal';
import SupplierDetailModal from './components/SupplierDetailModal';
//本地服务/接口
import { treeData, systemDict, getPagePe } from './services';
const { Option } = Select;
//下拉数据接口
type OptionType = { label: string; value: string };
// 列表数据接口
@ -20,11 +20,14 @@ interface Data {
name: string;
region: string;
supplierType: string;
personName: string;
regTime: string;
status: string;
}
const personQualifiedSupplierQuery: React.FC = () => {
interface Props {
dispatch: any;
}
const personQualifiedSupplierQuery: React.FC<Props> = ({ dispatch }) => {
//搜搜表单
const [form] = Form.useForm();
// 树数据
@ -146,7 +149,7 @@ const personQualifiedSupplierQuery: 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: '姓名',
@ -154,6 +157,21 @@ const personQualifiedSupplierQuery: React.FC = () => {
key: 'personName',
align: 'center',
ellipsis: true,
render: (dom, record) =>
<Tooltip title={record.personName}>
<a
onClick={() => {
dispatch({
type: 'globalModal/show',
payload: {
id: record.id,
},
});
}}
>
{record.personName}
</a>
</Tooltip>,
},
{
title: '身份证号',
@ -250,15 +268,15 @@ const personQualifiedSupplierQuery: React.FC = () => {
</Form.Item>
<Form.Item>
<Button type="primary" icon={<DownloadOutlined />} style={{ marginRight: 8 }} onClick={handleExport}>
</Button>
<Button type="primary" icon={<SearchOutlined />} htmlType="submit" onClick={handleSearch}>
</Button>
<Button style={{ marginLeft: 8 }} icon={<ReloadOutlined />} onClick={handleReset}>
</Button>
<Button type="primary" icon={<DownloadOutlined />} style={{ marginLeft: 8 }} onClick={handleExport}>
</Button>
</Form.Item>
</Form>
{/* 表格 */}
@ -289,4 +307,4 @@ const personQualifiedSupplierQuery: React.FC = () => {
);
};
export default personQualifiedSupplierQuery;
export default connect()(personQualifiedSupplierQuery);

View File

@ -94,7 +94,7 @@ const RegistrationQuery: React.FC<RegistrationQueryProps> = ({ dispatch }) => {
//状态 下拉
setStatusOptions([
{ label: '未准入', value: '0' },
{ label: '已准', value: '1' },
{ label: '已准', value: '1' },
{ label: '退出', value: '2' },
])
//列表