供应商
This commit is contained in:
67
src/pages/supplier/backend/changeProgressInquiry/_mock.ts
Normal file
67
src/pages/supplier/backend/changeProgressInquiry/_mock.ts
Normal file
@ -0,0 +1,67 @@
|
||||
import { Request, Response } from 'express';
|
||||
|
||||
// 代码中会兼容本地 service mock 以及部署站点的静态数据
|
||||
export default {
|
||||
|
||||
'GET /api/system/getPage': (req: Request, res: Response) => {
|
||||
res.json({
|
||||
code: 200,
|
||||
data: [
|
||||
{
|
||||
deptName: '供应商名称变更',
|
||||
categoryName: '2024-05-20 13:22:11',
|
||||
createTime: '集团采购部',
|
||||
exitTime: '已通过',
|
||||
exitReason: '2024-05-21 09:10:31',
|
||||
},
|
||||
{
|
||||
deptName: '法人代表变更',
|
||||
categoryName: '2024-05-18 08:30:55',
|
||||
createTime: '分公司审核部',
|
||||
exitTime: '审核中',
|
||||
exitReason: '',
|
||||
},
|
||||
],
|
||||
total: 2,
|
||||
msg: '操作成功'
|
||||
});
|
||||
},
|
||||
|
||||
'GET /api/system/getSupplierChangeDetail': (req: Request, res: Response) => {
|
||||
res.json({
|
||||
"code": 200,
|
||||
"msg": "success",
|
||||
"data": {
|
||||
baseInfo: [
|
||||
{ label: '供应商名称', value: 'xxx' },
|
||||
{ label: '境内/境外', value: '境内' },
|
||||
{ label: '准入单位', value: 'xxxx' },
|
||||
{ label: '准入部门', value: '采购部' },
|
||||
],
|
||||
changeInfo: [
|
||||
{ label: '供应商名称-变更前', value: 'xxxx' },
|
||||
{ label: '供应商名称-变更后', value: 'xxxx' },
|
||||
],
|
||||
"supplierName": "中山市合创展包装材料有限公司",
|
||||
"accessUnit": "中远海运(青岛)有限公司",
|
||||
"region": "境内",
|
||||
"accessDept": "采购部",
|
||||
"beforeName": "中山市合创展包装材料有限公司",
|
||||
"afterName": "中山市合创展包装有限公司",
|
||||
"qualifications": [
|
||||
{
|
||||
"type": "CMMI资质",
|
||||
"name": "CMMI资质",
|
||||
"level": "高级",
|
||||
"number": "546464",
|
||||
"org": "XX机构",
|
||||
"issueDate": "2024-09-08",
|
||||
"validDate": "2028-09-10",
|
||||
"file": "https://dummyimage.com/40x30/1890ff/fff.png&text=附件"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
};
|
@ -0,0 +1,144 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Modal, Table, Spin } from 'antd';
|
||||
import { getSupplierChangeDetail } from '../services';
|
||||
|
||||
interface Qualification {
|
||||
type: string;
|
||||
name: string;
|
||||
level: string;
|
||||
number: string;
|
||||
org: string;
|
||||
issueDate: string;
|
||||
validDate: string;
|
||||
file?: string;
|
||||
}
|
||||
interface InfoItem {
|
||||
label: string;
|
||||
value: string;
|
||||
}
|
||||
interface DetailData {
|
||||
baseInfo: InfoItem[];
|
||||
changeInfo: InfoItem[];
|
||||
qualifications: Qualification[];
|
||||
}
|
||||
interface DetailViewProps {
|
||||
visible: boolean;
|
||||
onClose: () => void;
|
||||
detailId?: string | number;
|
||||
}
|
||||
|
||||
const DetailView: React.FC<DetailViewProps> = ({ visible, onClose, detailId }) => {
|
||||
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [detailData, setDetailData] = useState<DetailData | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (visible && detailId) {
|
||||
setLoading(true);
|
||||
getSupplierChangeDetail(detailId)
|
||||
.then(res => {
|
||||
if (res.code === 200) {
|
||||
setDetailData(res.data);
|
||||
}
|
||||
})
|
||||
.finally(() => setLoading(false));
|
||||
}
|
||||
if (!visible) setDetailData(null);
|
||||
}, [visible, detailId]);
|
||||
|
||||
const columns = [
|
||||
{ title: '资质证书类型', dataIndex: 'type', width: 120 },
|
||||
{ title: '资质名称', dataIndex: 'name', width: 120 },
|
||||
{ title: '资质类别和等级', dataIndex: 'level', width: 120 },
|
||||
{ title: '资质证书编号', dataIndex: 'number', width: 120 },
|
||||
{ title: '发证机构', dataIndex: 'org', width: 120 },
|
||||
{ title: '发证日期', dataIndex: 'issueDate', width: 120 },
|
||||
{ title: '资质有效期至', dataIndex: 'validDate', width: 120 },
|
||||
{
|
||||
title: '附件',
|
||||
dataIndex: 'file',
|
||||
width: 120,
|
||||
render: (file: string) =>
|
||||
file ? (
|
||||
<span>
|
||||
<img src={file} alt="附件" style={{ width: 30, verticalAlign: 'middle', marginRight: 8 }} />
|
||||
<a>更多</a>
|
||||
</span>
|
||||
) : (
|
||||
'-'
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
// 把info数组两两合并成一行显示
|
||||
function renderInfoTable(infoArr: InfoItem[]) {
|
||||
const rows = [];
|
||||
for (let i = 0; i < infoArr.length; i += 2) {
|
||||
const left = infoArr[i];
|
||||
const right = infoArr[i + 1] || { label: '', value: '' };
|
||||
rows.push(
|
||||
<tr key={i}>
|
||||
<td style={tdStyleTitle}>{left.label}</td>
|
||||
<td style={tdStyle}>{left.value}</td>
|
||||
<td style={tdStyleTitle}>{right.label}</td>
|
||||
<td style={tdStyle}>{right.value}</td>
|
||||
</tr>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<table style={{ width: '100%', borderCollapse: 'collapse', background: '#fff', marginBottom: 8 }}>
|
||||
<tbody>{rows}</tbody>
|
||||
</table>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title="供应商信息变更审批"
|
||||
visible={visible}
|
||||
onCancel={onClose}
|
||||
footer={null}
|
||||
width={1000}
|
||||
bodyStyle={{ padding: 24 }}
|
||||
destroyOnClose
|
||||
>
|
||||
<Spin spinning={loading}>
|
||||
{detailData && (
|
||||
<div>
|
||||
{/* 基本信息 */}
|
||||
{renderInfoTable(detailData.baseInfo)}
|
||||
{/* 变更内容 */}
|
||||
<div style={{ padding: '16px 0 0 2px', fontWeight: 700 }}>变更内容:</div>
|
||||
{renderInfoTable(detailData.changeInfo)}
|
||||
{/* 新增资质 */}
|
||||
<div style={{ padding: '0 0 6px 2px', fontWeight: 700 }}>新增资质1</div>
|
||||
<Table
|
||||
columns={columns}
|
||||
dataSource={detailData.qualifications}
|
||||
rowKey="number"
|
||||
size="small"
|
||||
pagination={false}
|
||||
bordered
|
||||
style={{ margin: '0 0 16px 0' }}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</Spin>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
const tdStyleTitle: React.CSSProperties = {
|
||||
background: '#fafafa',
|
||||
fontWeight: 700,
|
||||
width: 130,
|
||||
padding: 8,
|
||||
border: '1px solid #f0f0f0',
|
||||
};
|
||||
const tdStyle: React.CSSProperties = {
|
||||
background: '#fff',
|
||||
padding: 8,
|
||||
border: '1px solid #f0f0f0',
|
||||
};
|
||||
|
||||
export default DetailView;
|
180
src/pages/supplier/backend/changeProgressInquiry/index.tsx
Normal file
180
src/pages/supplier/backend/changeProgressInquiry/index.tsx
Normal file
@ -0,0 +1,180 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { connect, useIntl } from 'umi';
|
||||
import { Form, Button, Table, Select, DatePicker, Input } from 'antd';
|
||||
import type { ColumnsType, TablePaginationConfig } from 'antd/es/table';
|
||||
import { SearchOutlined } from '@ant-design/icons';
|
||||
import { getPage } from './services';
|
||||
import moment from 'moment';
|
||||
import DetailView from './components/DetailView';
|
||||
|
||||
interface Data {
|
||||
deptName: string;
|
||||
categoryName: string;
|
||||
createTime: string;
|
||||
exitTime: string;
|
||||
exitReason: string;
|
||||
}
|
||||
|
||||
const CooperateEnterprise: React.FC = () => {
|
||||
//双语
|
||||
const intl = useIntl();
|
||||
//查询
|
||||
const [searchForm] = Form.useForm();
|
||||
//列表数据
|
||||
const [data, setData] = useState<Data[]>([]);
|
||||
//列表加载
|
||||
const [loading, setLoading] = useState(false);
|
||||
//列表分页
|
||||
const [pagination, setPagination] = useState<TablePaginationConfig>({ current: 1, pageSize: 10, total: 0 });
|
||||
//弹出组件开关状态
|
||||
const [detailVisible, setDetailVisible] = useState(false);
|
||||
//弹出组件参数
|
||||
const [currentDetail, setCurrentDetail] = useState<Data | null>(null);
|
||||
//列表头部
|
||||
const columns: ColumnsType<Data> = [
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'index',
|
||||
key: 'index',
|
||||
width: 80,
|
||||
align: 'center',
|
||||
render: (_: any, __: any, index: number) => index + 1,
|
||||
},
|
||||
{
|
||||
title: '变更内容',
|
||||
dataIndex: 'deptName',
|
||||
key: 'deptName',
|
||||
},
|
||||
{
|
||||
title: '提交时间',
|
||||
dataIndex: 'categoryName',
|
||||
key: 'categoryName',
|
||||
},
|
||||
{
|
||||
title: '审批单位',
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
},
|
||||
{
|
||||
title: '审批状态',
|
||||
dataIndex: 'exitTime',
|
||||
key: 'exitTime',
|
||||
},
|
||||
{
|
||||
title: '审批时间',
|
||||
dataIndex: 'exitReason',
|
||||
key: 'exitReason',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
render: (text: string, record: Data) => (
|
||||
<Button type="link" onClick={() => handleDetail(record)}>
|
||||
查看
|
||||
</Button>
|
||||
),
|
||||
},
|
||||
];
|
||||
//重置
|
||||
const handleReset = () => {
|
||||
searchForm.resetFields();
|
||||
getList({ page: 1, pageSize: pagination.pageSize ?? 10, parentCode: '', startTime: '', endTime: '' });
|
||||
};
|
||||
//搜索
|
||||
const handleSearch = (values: any) => {
|
||||
const { parentCode, createTime } = values;
|
||||
const startTime = createTime ? moment(createTime[0]).format('YYYY-MM-DD') : '';
|
||||
const endTime = createTime ? moment(createTime[1]).format('YYYY-MM-DD') : '';
|
||||
getList({
|
||||
page: 1,
|
||||
pageSize: pagination.pageSize ?? 10,
|
||||
parentCode: parentCode || '',
|
||||
startTime,
|
||||
endTime,
|
||||
});
|
||||
};
|
||||
//开启弹出
|
||||
const handleDetail = (record: Data) => {
|
||||
setCurrentDetail(record);
|
||||
setDetailVisible(true);
|
||||
};
|
||||
//关闭演出
|
||||
const handleDetailClose = () => {
|
||||
setDetailVisible(false);
|
||||
};
|
||||
//列表数据请求
|
||||
const getList = async (params: { page: number; pageSize: number; parentCode: string; startTime: string; endTime: string }) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const { code , data, total } = await getPage(params);
|
||||
if (code === 200) {
|
||||
setData(data);
|
||||
setPagination({ current: params.page, pageSize: params.pageSize, total });
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch data:', error);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
//初始化
|
||||
useEffect(() => {
|
||||
getList({ page: 1, pageSize: 10, parentCode: '', startTime: '', endTime: '' });
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Form
|
||||
form={searchForm}
|
||||
layout="inline"
|
||||
onFinish={handleSearch}
|
||||
style={{ marginBottom: 16 }}
|
||||
>
|
||||
<Form.Item name="parentCode" label="变更内容">
|
||||
<Input placeholder="请输入变更内容" />
|
||||
</Form.Item>
|
||||
<Form.Item name="parentCode" label="审批单位">
|
||||
<Select placeholder="请选择审批单位">
|
||||
<Select.Option value="品类1">品类1</Select.Option>
|
||||
<Select.Option value="品类2">品类2</Select.Option>
|
||||
<Select.Option value="品类3">品类3</Select.Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item name="createTime" label="提交时间">
|
||||
<DatePicker.RangePicker placeholder={['开始时间', '结束时间']} />
|
||||
</Form.Item>
|
||||
<Form.Item name="parentCode" label="审批状态">
|
||||
<Select placeholder="请选择审批状态">
|
||||
<Select.Option value="品类1">品类1</Select.Option>
|
||||
<Select.Option value="品类2">品类2</Select.Option>
|
||||
<Select.Option value="品类3">品类3</Select.Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Button type="primary" htmlType="submit" icon={<SearchOutlined />}>
|
||||
搜索
|
||||
</Button>
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Button onClick={handleReset}>重置</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
<Table
|
||||
rowKey="id"
|
||||
className="custom-table"
|
||||
columns={columns}
|
||||
dataSource={data}
|
||||
pagination={pagination}
|
||||
loading={loading}
|
||||
onChange={(pagination) => getList({ page: pagination.current!, pageSize: pagination.pageSize!, parentCode: '', startTime: '', endTime: '' })}
|
||||
/>
|
||||
<DetailView
|
||||
visible={detailVisible}
|
||||
onClose={handleDetailClose}
|
||||
detailId={10}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default connect()(CooperateEnterprise);
|
18
src/pages/supplier/backend/changeProgressInquiry/services.ts
Normal file
18
src/pages/supplier/backend/changeProgressInquiry/services.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
|
||||
|
||||
|
||||
export async function getPage(params:any) {
|
||||
return request('/api/system/getPage', {
|
||||
method: 'GET',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
export async function getSupplierChangeDetail(params:any) {
|
||||
return request('/api/system/getSupplierChangeDetail', {
|
||||
method: 'GET',
|
||||
params
|
||||
});
|
||||
}
|
63
src/pages/supplier/backend/cooperateEnterprise/_mock.ts
Normal file
63
src/pages/supplier/backend/cooperateEnterprise/_mock.ts
Normal file
@ -0,0 +1,63 @@
|
||||
import { Request, Response } from 'express';
|
||||
const categoryData = { "code": 200, "success": true, "message": "success", "data": [{ "pageNo": null, "pageSize": null, "createBy": "1", "createTime": "2025-06-16 10:22:16", "updateBy": null, "updateTime": null, "remark": null, "id": "5fb622f6-929c-41c2-be0d-508fecbff3d9", "categoryName": "添加", "parentId": "0", "type": "0", "orderBy": "1", "ancestors": "0,5fb622f6-929c-41c2-be0d-508fecbff3d9", "delFlag": "normal", "lastUpdateTime": null, "basePageRequest": null, "children": [{ "pageNo": null, "pageSize": null, "createBy": "1", "createTime": "2025-06-16 10:32:16", "updateBy": "1", "updateTime": "2025-06-16 10:37:30", "remark": null, "id": "0c653095-a553-48a7-9c2f-6fc708769dd6", "categoryName": "二级商品", "parentId": "5fb622f6-929c-41c2-be0d-508fecbff3d9", "type": "0", "orderBy": "3", "ancestors": "0,5fb622f6-929c-41c2-be0d-508fecbff3d9,0c653095-a553-48a7-9c2f-6fc708769dd6", "delFlag": "normal", "lastUpdateTime": null, "basePageRequest": null, "children": [{ "pageNo": null, "pageSize": null, "createBy": "1", "createTime": "2025-06-16 10:32:59", "updateBy": null, "updateTime": null, "remark": null, "id": "ff59e929-864e-4080-a9c5-852cab7ab129", "categoryName": "一级商品", "parentId": "0c653095-a553-48a7-9c2f-6fc708769dd6", "type": "1", "orderBy": "1", "ancestors": "0,5fb622f6-929c-41c2-be0d-508fecbff3d9,0c653095-a553-48a7-9c2f-6fc708769dd6,ff59e929-864e-4080-a9c5-852cab7ab129", "delFlag": "normal", "lastUpdateTime": null, "basePageRequest": null, "children": null }] }, { "pageNo": null, "pageSize": null, "createBy": "1", "createTime": "2025-06-16 10:29:09", "updateBy": null, "updateTime": null, "remark": null, "id": "ffd210c8-026b-4ec5-aa1e-40d70feb905e", "categoryName": "三级商品", "parentId": "5fb622f6-929c-41c2-be0d-508fecbff3d9", "type": "1", "orderBy": "1", "ancestors": "0,5fb622f6-929c-41c2-be0d-508fecbff3d9,ffd210c8-026b-4ec5-aa1e-40d70feb905e", "delFlag": "normal", "lastUpdateTime": null, "basePageRequest": null, "children": null }] }] }
|
||||
export default {
|
||||
|
||||
'GET /api/system/mockList': (req: Request, res: Response) => {
|
||||
res.json({
|
||||
code: 200,
|
||||
data: [
|
||||
{
|
||||
id: 1,
|
||||
name: "境外燃油备件库",
|
||||
category: "货物)燃料)燃油",
|
||||
region: "新加坡",
|
||||
creator: "集团",
|
||||
validDate: "2028-03-31",
|
||||
applyDate: "2025-03-02",
|
||||
processStatus: "未开始",
|
||||
result: "",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "境外燃油备件库",
|
||||
category: "货物)燃料)燃油",
|
||||
region: "马来西亚",
|
||||
creator: "集团",
|
||||
validDate: "2028-03-31",
|
||||
applyDate: "2025-03-02",
|
||||
processStatus: "未开始",
|
||||
result: "",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "润滑油库",
|
||||
category: "生产型物资)润滑剂)润滑油",
|
||||
region: "全球",
|
||||
creator: "集团",
|
||||
validDate: "2028-03-31",
|
||||
applyDate: "2025-03-02",
|
||||
processStatus: "进行中",
|
||||
result: "",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: "船用物料库",
|
||||
category: "生产型物资)船用物料",
|
||||
region: "全球",
|
||||
creator: "集团",
|
||||
validDate: "2028-03-31",
|
||||
applyDate: "2025-03-02",
|
||||
processStatus: "已结束",
|
||||
result: "通过",
|
||||
},
|
||||
],
|
||||
total: 188,
|
||||
msg: "success",
|
||||
});
|
||||
},
|
||||
|
||||
'GET /api/system/categoryOption': (req: Request, res: Response) => {
|
||||
res.json(categoryData);
|
||||
},
|
||||
|
||||
};
|
161
src/pages/supplier/backend/cooperateEnterprise/index.tsx
Normal file
161
src/pages/supplier/backend/cooperateEnterprise/index.tsx
Normal file
@ -0,0 +1,161 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { connect, useIntl } from 'umi';
|
||||
import { Form, Button, Table, Select, DatePicker, TreeSelect } from 'antd';
|
||||
import type { ColumnsType, TablePaginationConfig } from 'antd/es/table';
|
||||
import { SearchOutlined } from '@ant-design/icons';
|
||||
import { category, categoryOption } from './services';
|
||||
import moment from 'moment';
|
||||
|
||||
interface Data {
|
||||
deptName: string;
|
||||
categoryName: string;
|
||||
createTime: string;
|
||||
exitTime: string;
|
||||
exitReason: string;
|
||||
}
|
||||
|
||||
// 将 categoryTree 的字段从 categoryName 和 id 映射到 label 和 value
|
||||
const transformTreeData = (treeData: any[]): any[] => {
|
||||
return treeData.map((item) => ({
|
||||
value: item.id,
|
||||
label: item.categoryName,
|
||||
children: item.children ? transformTreeData(item.children) : undefined,
|
||||
}));
|
||||
};
|
||||
// 列表头
|
||||
const columns: ColumnsType<Data> = [
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'index',
|
||||
key: 'index',
|
||||
width: 80,
|
||||
align: 'center',
|
||||
render: (_: any, __: any, index: number) => index + 1,
|
||||
},
|
||||
{
|
||||
title: '准入部门',
|
||||
dataIndex: 'deptName',
|
||||
key: 'deptName',
|
||||
},
|
||||
{
|
||||
title: '准入品类',
|
||||
dataIndex: 'categoryName',
|
||||
key: 'categoryName',
|
||||
},
|
||||
{
|
||||
title: '准入时间',
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
},
|
||||
{
|
||||
title: '退出时间',
|
||||
dataIndex: 'exitTime',
|
||||
key: 'exitTime',
|
||||
},
|
||||
{
|
||||
title: '退出原因',
|
||||
dataIndex: 'exitReason',
|
||||
key: 'exitReason',
|
||||
ellipsis: true,
|
||||
},
|
||||
];
|
||||
|
||||
const CooperateEnterprise: React.FC = () => {
|
||||
//双语
|
||||
const intl = useIntl();
|
||||
//搜索
|
||||
const [searchForm] = Form.useForm();
|
||||
//列表数据
|
||||
const [data, setData] = useState<Data[]>([]);
|
||||
//列表加载
|
||||
const [loading, setLoading] = useState(false);
|
||||
//分页
|
||||
const [pagination, setPagination] = useState<TablePaginationConfig>({ current: 1, pageSize: 10, total: 0 });
|
||||
//搜索中树形下拉数据
|
||||
const [categoryTree, setCategoryTree] = useState<any[]>([]);
|
||||
//列表数据方法
|
||||
const getList = async (params: { page: number; pageSize: number; categoryName: string; startTime: string; endTime: string }) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const { code, data, total } = await category(params);
|
||||
if (code === 200) {
|
||||
setData(data);
|
||||
setPagination({ current: params.page, pageSize: params.pageSize, total});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch data:', error);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
//搜索重置
|
||||
const handleReset = () => {
|
||||
searchForm.resetFields();
|
||||
getList({ page: 1, pageSize: pagination.pageSize ?? 10, categoryName: '', startTime: '', endTime: '' });
|
||||
};
|
||||
//搜索
|
||||
const handleSearch = (values: any) => {
|
||||
const { categoryName, createTime } = values;
|
||||
const startTime = createTime ? moment(createTime[0]).format('YYYY-MM-DD') : '';
|
||||
const endTime = createTime ? moment(createTime[1]).format('YYYY-MM-DD') : '';
|
||||
getList({
|
||||
page: 1,
|
||||
pageSize: pagination.pageSize ?? 10,
|
||||
categoryName: categoryName || '',
|
||||
startTime,
|
||||
endTime,
|
||||
});
|
||||
};
|
||||
//初始化
|
||||
useEffect(() => {
|
||||
categoryOption().then((res:any) => {
|
||||
const { code, data } = res;
|
||||
if(code == 200) {
|
||||
setCategoryTree(transformTreeData(data))
|
||||
}
|
||||
})
|
||||
getList({ page: 1, pageSize: 10, categoryName: '', startTime: '', endTime: '' });
|
||||
}, []);
|
||||
return (
|
||||
<>
|
||||
<Form
|
||||
form={searchForm}
|
||||
layout="inline"
|
||||
onFinish={handleSearch}
|
||||
style={{ marginBottom: 16 }}
|
||||
>
|
||||
<Form.Item name="categoryName" label="准入品类">
|
||||
<TreeSelect
|
||||
style={{ width: '200px' }}
|
||||
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
||||
treeData={categoryTree}
|
||||
placeholder="请选择准入品类"
|
||||
treeDefaultExpandAll
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item name="createTime" label="准入时间">
|
||||
<DatePicker.RangePicker placeholder={['开始时间', '结束时间']} />
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Button type="primary" htmlType="submit" icon={<SearchOutlined />}>
|
||||
搜索
|
||||
</Button>
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Button onClick={handleReset}>重置</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
<Table
|
||||
rowKey="id"
|
||||
className="custom-table"
|
||||
columns={columns}
|
||||
dataSource={data}
|
||||
pagination={pagination}
|
||||
loading={loading}
|
||||
onChange={(pagination) => getList({ page: pagination.current!, pageSize: pagination.pageSize!, categoryName: '', startTime: '', endTime: '' })}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default connect()(CooperateEnterprise);
|
16
src/pages/supplier/backend/cooperateEnterprise/services.ts
Normal file
16
src/pages/supplier/backend/cooperateEnterprise/services.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
|
||||
export async function category(params:any) {
|
||||
return request('/api/system/category', {
|
||||
method: 'GET',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
export async function categoryOption() {
|
||||
return request('/api/system/categoryOption', {
|
||||
method: 'GET'
|
||||
});
|
||||
}
|
||||
|
52
src/pages/supplier/backend/supplierNews/_mock.ts
Normal file
52
src/pages/supplier/backend/supplierNews/_mock.ts
Normal file
@ -0,0 +1,52 @@
|
||||
import { Request, Response } from 'express';
|
||||
|
||||
export default {
|
||||
'GET /api/system/bank': (req: Request, res: Response) => {
|
||||
res.json({ code: 200,
|
||||
data: [
|
||||
{
|
||||
id: '1',
|
||||
interbankNumber: '123456789',
|
||||
bank: '中国银行',
|
||||
accountName: '张三',
|
||||
account: '6228480000000000000',
|
||||
currency: '人民币',
|
||||
nation: '中国',
|
||||
province: '广东省',
|
||||
city: '广州市',
|
||||
updateTime: '2024-06-18',
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
interbankNumber: '987654321',
|
||||
bank: '工商银行',
|
||||
accountName: '李四',
|
||||
account: '6228480000000000001',
|
||||
currency: '美元',
|
||||
nation: '中国',
|
||||
province: '江苏省',
|
||||
city: '南京市',
|
||||
updateTime: '2024-06-17',
|
||||
},
|
||||
],
|
||||
total: 2,
|
||||
msg: '操作成功'
|
||||
});
|
||||
},
|
||||
'GET /api/system/categoryOption': (req: Request, res: Response) => {
|
||||
res.json({ code: 200,
|
||||
data: [
|
||||
{
|
||||
value: '1',
|
||||
label: '1',
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
label: '3',
|
||||
},
|
||||
],
|
||||
total: 2,
|
||||
msg: '操作成功'
|
||||
});
|
||||
},
|
||||
};
|
152
src/pages/supplier/backend/supplierNews/index.tsx
Normal file
152
src/pages/supplier/backend/supplierNews/index.tsx
Normal file
@ -0,0 +1,152 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { connect, useIntl } from 'umi';
|
||||
import { Form, Button, Table, Select, Input } from 'antd';
|
||||
import type { ColumnsType, TablePaginationConfig } from 'antd/es/table';
|
||||
import { SearchOutlined } from '@ant-design/icons';
|
||||
import { bank, categoryOption } from './services';
|
||||
|
||||
interface Data {
|
||||
deptName: string;
|
||||
categoryName: string;
|
||||
createTime: string;
|
||||
exitTime: string;
|
||||
exitReason: string;
|
||||
}
|
||||
|
||||
interface CategoryOption {
|
||||
value: string;
|
||||
label: string;
|
||||
}
|
||||
|
||||
const columns: ColumnsType<Data> = [
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'index',
|
||||
key: 'index',
|
||||
width: 80,
|
||||
align: 'center',
|
||||
render: (_: any, __: any, index: number) => index + 1,
|
||||
},
|
||||
{
|
||||
title: '消息内容',
|
||||
dataIndex: 'deptName',
|
||||
key: 'deptName',
|
||||
},
|
||||
{
|
||||
title: '业务类型',
|
||||
dataIndex: 'categoryName',
|
||||
key: 'categoryName',
|
||||
},
|
||||
{
|
||||
title: '发送时间',
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
},
|
||||
{
|
||||
title: '审核单位',
|
||||
dataIndex: 'exitTime',
|
||||
key: 'exitTime',
|
||||
},
|
||||
{
|
||||
title: '审核状态',
|
||||
dataIndex: 'exitReason',
|
||||
key: 'exitReason',
|
||||
},
|
||||
];
|
||||
|
||||
const CooperateEnterprise: React.FC = () => {
|
||||
//双语
|
||||
const intl = useIntl();
|
||||
//搜索
|
||||
const [searchForm] = Form.useForm();
|
||||
//列表数据
|
||||
const [data, setData] = useState<Data[]>([]);
|
||||
//列表加载
|
||||
const [loading, setLoading] = useState(false);
|
||||
//分页
|
||||
const [pagination, setPagination] = useState<TablePaginationConfig>({ current: 1, pageSize: 10, total: 0 });
|
||||
//下拉数据
|
||||
const [categoryOptions, setCategoryOptions] = useState<CategoryOption[]>([]);
|
||||
//列表数据方法
|
||||
const getList = async (params: { page: number; pageSize: number; parentCode: string; }) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const response = await bank(params);
|
||||
if (response.code === 200) {
|
||||
setData(response.data);
|
||||
setPagination({ current: params.page, pageSize: params.pageSize, total: response.total });
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch data:', error);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
//搜索重置
|
||||
const handleReset = () => {
|
||||
searchForm.resetFields();
|
||||
getList({ page: 1, pageSize: pagination.pageSize ?? 10, parentCode: '' });
|
||||
};
|
||||
//搜索
|
||||
const handleSearch = (values: any) => {
|
||||
const { parentCode } = values;
|
||||
getList({
|
||||
page: 1,
|
||||
pageSize: pagination.pageSize ?? 10,
|
||||
parentCode: parentCode || ''
|
||||
});
|
||||
};
|
||||
//初始化
|
||||
useEffect(() => {
|
||||
categoryOption().then((res:any) => {
|
||||
const { code, data } = res;
|
||||
if(code == 200) {
|
||||
setCategoryOptions(data)
|
||||
}
|
||||
})
|
||||
getList({ page: 1, pageSize: 10, parentCode: '', });
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Form
|
||||
form={searchForm}
|
||||
layout="inline"
|
||||
onFinish={handleSearch}
|
||||
style={{ marginBottom: 16 }}
|
||||
>
|
||||
<Form.Item name="parentCode" label="消息内容">
|
||||
<Input placeholder="请输入消息内容" />
|
||||
</Form.Item>
|
||||
<Form.Item name="parentCode" label="业务类型">
|
||||
<Select placeholder="请选择业务类型">
|
||||
{categoryOptions.map((option) => (
|
||||
<Select.Option key={option.value} value={option.value}>
|
||||
{option.label}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Button type="primary" htmlType="submit" icon={<SearchOutlined />}>
|
||||
搜索
|
||||
</Button>
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Button onClick={handleReset}>重置</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
<Table
|
||||
rowKey="id"
|
||||
className="custom-table"
|
||||
columns={columns}
|
||||
dataSource={data}
|
||||
pagination={pagination}
|
||||
loading={loading}
|
||||
onChange={(pagination) => getList({ page: pagination.current!, pageSize: pagination.pageSize!, parentCode: '', })}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default connect()(CooperateEnterprise);
|
16
src/pages/supplier/backend/supplierNews/services.ts
Normal file
16
src/pages/supplier/backend/supplierNews/services.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
|
||||
export async function bank(params:any) {
|
||||
return request('/api/system/bank', {
|
||||
method: 'GET',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
export async function categoryOption() {
|
||||
return request('/api/system/categoryOption', {
|
||||
method: 'GET'
|
||||
});
|
||||
}
|
||||
|
343
src/pages/supplier/backend/workbenches/_mock.ts
Normal file
343
src/pages/supplier/backend/workbenches/_mock.ts
Normal file
@ -0,0 +1,343 @@
|
||||
import { Request, Response } from 'express';
|
||||
|
||||
// const data = [
|
||||
// {
|
||||
// title: 'Name',
|
||||
// dataIndex: '评审项',
|
||||
// key: '评审项',
|
||||
// },
|
||||
// {
|
||||
// title: 'Other',
|
||||
// children: [
|
||||
// {
|
||||
// title: 'Age',
|
||||
// key: '人员A',
|
||||
// },
|
||||
// {
|
||||
// title: 'Address',
|
||||
// key: '人员B',
|
||||
// },
|
||||
// ]
|
||||
// },
|
||||
// ]
|
||||
const dataInvoiceInfo = [
|
||||
{
|
||||
id: '1',
|
||||
taxpayerType: '一般纳税人',
|
||||
taxpayerCode: '91345678901234567X',
|
||||
head: '北京某科技有限公司',
|
||||
address: '北京市朝阳区XX路99号',
|
||||
phone: '010-12345678',
|
||||
bank: '中国银行北京分行',
|
||||
account: '6228888888888888',
|
||||
updateTime: '2025-06-17 10:20:00',
|
||||
voided: false,
|
||||
qualificationCertificate: 'https://example.com/cert1.pdf',
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
taxpayerType: '小规模纳税人',
|
||||
taxpayerCode: '91345678901234566Y',
|
||||
head: '上海某信息技术有限公司',
|
||||
address: '上海市浦东新区XX大厦8楼',
|
||||
phone: '021-87654321',
|
||||
bank: '工商银行上海分行',
|
||||
account: '6229999999999999',
|
||||
updateTime: '2025-06-16 15:30:00',
|
||||
voided: true,
|
||||
qualificationCertificate: '',
|
||||
},
|
||||
]
|
||||
const mockQualificationData = [
|
||||
{
|
||||
id: '1',
|
||||
certificateType: '建筑业企业资质证书',
|
||||
name: '建筑工程施工总承包一级',
|
||||
code: 'ZJ-A123456',
|
||||
typeLevel: '一级',
|
||||
authority: '住房和城乡建设部',
|
||||
dateTime: '2023-03-01',
|
||||
termOfValidity: '2028-03-01',
|
||||
updateTime: '2025-06-17 10:30:00',
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
certificateType: '安全生产许可证',
|
||||
name: '施工企业安全生产许可证',
|
||||
code: 'AQ-789012',
|
||||
typeLevel: 'A级',
|
||||
authority: '应急管理部',
|
||||
dateTime: '2022-06-15',
|
||||
termOfValidity: '2025-06-15',
|
||||
updateTime: '2025-06-17 11:45:00',
|
||||
},
|
||||
]
|
||||
export const mockData = {
|
||||
base: {
|
||||
"id": "123456",
|
||||
"supplierType": "dvs",
|
||||
"licenceAccessory": "https://example.com/license.pdf",
|
||||
"licenceDate": "2025-12-31",
|
||||
"enterpriseType": "company",
|
||||
"name": "深圳供应商有限公司",
|
||||
"nameEn": "Shenzhen Supplier Co., Ltd.",
|
||||
"socialCreditCode": "91440300MA5F3XXXXQ",
|
||||
"range": "电子元器件、金属材料销售",
|
||||
"regAddress": "广东省深圳市南山区科技园",
|
||||
"workAddress": "广东省深圳市南山区软件产业基地",
|
||||
"parentCompanyInvestor": "深圳控股集团有限公司",
|
||||
"legalPerson": "李四",
|
||||
"idCard": "440301199001015678",
|
||||
"capital": 5000,
|
||||
"contactsName": "王五",
|
||||
"contactsPhone": "13800138000",
|
||||
"contactsType": "法人代表",
|
||||
"contactsEmail": "contact@supplier.com",
|
||||
"telephone": "0755-12345678",
|
||||
"nation": "新加坡",
|
||||
"vat": "SG12345678VAT",
|
||||
"taxpayerId": "SG-TAX-998877",
|
||||
"currency": "SGD",
|
||||
"personName": "张三",
|
||||
"personPhone": "13812345678",
|
||||
"personBank": "中国银行深圳分行",
|
||||
"personAccount": "6222020200123456789",
|
||||
"remark": "该供应商已完成初步审核",
|
||||
"accessStatus": 1,
|
||||
"blacklistStatus": 0,
|
||||
"greylistStatus": 1,
|
||||
"fillinStatus": 0,
|
||||
"fillinBy": "",
|
||||
"sapCode": "SAP998877",
|
||||
"delFlag": "normal",
|
||||
"createBy": "admin",
|
||||
"createTime": "2024-06-01 10:00:00",
|
||||
"updateBy": "admin",
|
||||
"updateTime": "2025-06-01 11:00:00",
|
||||
"lastUpdateTime": "2025-06-17 09:30:00"
|
||||
},
|
||||
qualifications: [{
|
||||
"id": "cert-001",
|
||||
"supplierId": "supplier-123456",
|
||||
"certificateType": "安全生产许可证",
|
||||
"name": "建筑施工总承包一级资质",
|
||||
"code": "ZJ20230605001",
|
||||
"typeLevel": "一级",
|
||||
"authority": "住房和城乡建设部",
|
||||
"dateTime": "2023-06-05",
|
||||
"termOfValidity": "2026-06-05",
|
||||
"accessory": "https://example.com/certificate.pdf",
|
||||
"delFlag": "normal",
|
||||
"createBy": "admin",
|
||||
"createTime": "2023-06-01 10:00:00",
|
||||
"updateBy": "admin",
|
||||
"updateTime": "2024-06-01 11:00:00",
|
||||
"lastUpdateTime": "2025-06-17 09:30:00"
|
||||
}],
|
||||
invoice: {
|
||||
"id": "invoice-001",
|
||||
"supplierId": "supplier-123456",
|
||||
"taxpayerType": "general",
|
||||
"taxpayerCode": "91440300MA5F3XXXXQ",
|
||||
"phone": "0755-12345678",
|
||||
"account": "6222020200123456789",
|
||||
"head": "深圳供应商有限公司",
|
||||
"address": "深圳市南山区科技园开票楼101号",
|
||||
"bank": "中国银行深圳分行",
|
||||
"qualificationCertificate": "https://example.com/tax-cert.pdf",
|
||||
"delFlag": "normal",
|
||||
"createBy": "admin",
|
||||
"createTime": "2024-06-01 09:00:00",
|
||||
"updateBy": "admin",
|
||||
"updateTime": "2025-06-01 10:00:00",
|
||||
"lastUpdateTime": "2025-06-17 08:30:00"
|
||||
},
|
||||
bank: [{
|
||||
"id": "bank-001",
|
||||
"supplierId": "supplier-123456",
|
||||
"interbankNumber": "123456789012",
|
||||
"bank": "中国银行深圳分行",
|
||||
"swiftCode": "BKCHCNBJ45A",
|
||||
"accountName": "Shenzhen Supplier Co., Ltd.",
|
||||
"account": "6222020200123456789",
|
||||
"currency": "CNY",
|
||||
"nation": "中国",
|
||||
"province": "广东省",
|
||||
"city": "深圳市",
|
||||
"delFlag": "normal",
|
||||
"createBy": "admin",
|
||||
"createTime": "2024-06-01 09:00:00",
|
||||
"updateBy": "admin",
|
||||
"updateTime": "2025-06-01 10:00:00",
|
||||
"lastUpdateTime": "2025-06-17 08:30:00"
|
||||
}],
|
||||
survey: {
|
||||
"supplierName": "深圳供应商有限公司",
|
||||
"name": "李四",
|
||||
"position": "采购经理",
|
||||
"phone": "13800138000",
|
||||
"email": "lisi@supplier.com",
|
||||
"dateTime": "2025-06-17",
|
||||
},
|
||||
questionReply: [
|
||||
{
|
||||
"surveyQuestion": "法律法规:\n我们确保经营和提供的产品服务遵守国家及 各业务所在地的所有使用法律、法规",
|
||||
"replyValue": "是",
|
||||
},{
|
||||
"surveyQuestion": "健康和安全:\n我们为员工提供符合法律法规的安全且健康 的工作场所。我们建立安全管理体系,并向 员工传达工作场所或生活设施的健康和安全 标准,致力于减少工作对员工造成的伤害和 疾病。",
|
||||
"replyValue": "符合",
|
||||
},{
|
||||
"surveyQuestion": "环境:\n我们能够以环境友好的方式经营。我们遵守 适用的环境法律、法规和标准;并建立有效 的环境管理体系。\n我们遵守贵集团对相关产品或服务的部分附 加环境要求,这些要求和规定体现在设计与 产品规范的合同文档中。",
|
||||
"replyValue": "符合",
|
||||
},{
|
||||
"surveyQuestion": "监督和记录:\n我们保留记录遵守相关法律和此行为准则的必要文件,并根据要求为贵集团提供对文件的查看权。我们会允许贵集团在适当的时候,以验证行为准则执行为目的的现场勘查",
|
||||
"replyValue": "符合",
|
||||
}
|
||||
],
|
||||
attachments: {
|
||||
"attachmentsType": "commitment",
|
||||
"fileName": "anti-bribery-commitment.pdf",
|
||||
"fileType": "pdf",
|
||||
"fileSize": "204800",
|
||||
"filePath": "/data/files/anti-bribery-commitment.pdf",
|
||||
"fileUrl": "http://example.com/files/anti-bribery-commitment.pdf",
|
||||
}
|
||||
};
|
||||
// 代码中会兼容本地 service mock 以及部署站点的静态数据
|
||||
export default {
|
||||
// 供应商信息
|
||||
'GET /api/system/coscoSupplier': (req: Request, res: Response) => {
|
||||
res.json({
|
||||
code: 200,
|
||||
data: mockData,
|
||||
msg: '操作成功'
|
||||
});
|
||||
},
|
||||
//
|
||||
'GET /api/system/qualifications': (req: Request, res: Response) => {
|
||||
res.json({ code: 200,
|
||||
data: mockQualificationData,
|
||||
total: 2,
|
||||
msg: '操作成功'
|
||||
});
|
||||
},
|
||||
//
|
||||
'GET /api/system/invoice': (req: Request, res: Response) => {
|
||||
res.json({ code: 200,
|
||||
data: dataInvoiceInfo,
|
||||
total: 2,
|
||||
msg: '操作成功'
|
||||
});
|
||||
},
|
||||
//
|
||||
'GET /api/system/bank': (req: Request, res: Response) => {
|
||||
res.json({ code: 200,
|
||||
data: [
|
||||
{
|
||||
id: '1',
|
||||
interbankNumber: '123456789',
|
||||
bank: '中国银行',
|
||||
accountName: '张三',
|
||||
account: '6228480000000000000',
|
||||
currency: '人民币',
|
||||
nation: '中国',
|
||||
province: '广东省',
|
||||
city: '广州市',
|
||||
updateTime: '2024-06-18',
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
interbankNumber: '987654321',
|
||||
bank: '工商银行',
|
||||
accountName: '李四',
|
||||
account: '6228480000000000001',
|
||||
currency: '美元',
|
||||
nation: '中国',
|
||||
province: '江苏省',
|
||||
city: '南京市',
|
||||
updateTime: '2024-06-17',
|
||||
},
|
||||
],
|
||||
total: 2,
|
||||
msg: '操作成功'
|
||||
});
|
||||
},
|
||||
//
|
||||
'GET /api/system/tianyancha': (req: Request, res: Response) => {
|
||||
res.json({ code: 200,
|
||||
data: [
|
||||
{
|
||||
key: '1',
|
||||
base: '京',
|
||||
name: '北京科技有限公司',
|
||||
legalPersonName: '张三',
|
||||
legalPersonType: '1',
|
||||
regNumber: '110108123456789',
|
||||
industry: '信息技术',
|
||||
companyOrgType: '有限责任公司',
|
||||
regLocation: '北京市海淀区中关村',
|
||||
estiblishTime: '2010-06-15',
|
||||
fromTime: '2010-06-16',
|
||||
toTime: '2025-06-15',
|
||||
businessScope: '软件开发、技术咨询',
|
||||
approvedTime: '2010-06-10',
|
||||
regStatus: '存续',
|
||||
regCapital: '5000万元',
|
||||
regInstitute: '北京市工商局',
|
||||
orgNumber: '1234567890',
|
||||
creditCode: '91110108MA01A12345',
|
||||
property3: 'Beijing Tech Co., Ltd.',
|
||||
updatetime: '2025-06-15',
|
||||
companyId: '1001',
|
||||
taxNumber: '110108123456789',
|
||||
email: 'contact@bjtech.com',
|
||||
website: 'http://www.bjtech.com',
|
||||
phoneNumber: '010-12345678',
|
||||
lastUpdateTime: '2025-06-15 10:00:00',
|
||||
},
|
||||
{
|
||||
key: '2',
|
||||
base: '沪',
|
||||
name: '上海电子商务有限公司',
|
||||
legalPersonName: '李四',
|
||||
legalPersonType: '1',
|
||||
regNumber: '310101987654321',
|
||||
industry: '电子商务',
|
||||
companyOrgType: '股份有限公司',
|
||||
regLocation: '上海市浦东新区',
|
||||
estiblishTime: '2015-03-20',
|
||||
fromTime: '2015-03-21',
|
||||
toTime: '2030-03-20',
|
||||
businessScope: '电子商务平台运营、广告设计',
|
||||
approvedTime: '2015-03-15',
|
||||
regStatus: '存续',
|
||||
regCapital: '1亿元',
|
||||
regInstitute: '上海市工商局',
|
||||
orgNumber: '0987654321',
|
||||
creditCode: '91310101MA1AB23456',
|
||||
property3: 'Shanghai E-commerce Co., Ltd.',
|
||||
updatetime: '2025-06-15',
|
||||
companyId: '1002',
|
||||
taxNumber: '310101987654321',
|
||||
email: 'info@shcommerce.com',
|
||||
website: 'http://www.shcommerce.com',
|
||||
phoneNumber: '021-87654321',
|
||||
lastUpdateTime: '2025-06-15 09:30:00',
|
||||
},
|
||||
],
|
||||
total: 2,
|
||||
msg: '操作成功' });
|
||||
},
|
||||
|
||||
'GET /api/500': (req: Request, res: Response) => {
|
||||
res.status(500).send({
|
||||
timestamp: 1513932555104,
|
||||
status: 500,
|
||||
error: 'error',
|
||||
message: 'error',
|
||||
path: '/base/category/list',
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
};
|
@ -0,0 +1,49 @@
|
||||
import React from 'react';
|
||||
import { Form, Input, Button, message } from 'antd';
|
||||
import { useIntl } from 'umi';
|
||||
|
||||
const ChangePassword: React.FC = () => {
|
||||
const intl = useIntl();
|
||||
const [form] = Form.useForm();
|
||||
|
||||
const handleSubmit = async (values: any) => {
|
||||
if (values.newPassword !== values.confirmPassword) {
|
||||
message.error(intl.formatMessage({ id: 'page.changePassword.error.passwordMismatch' }));
|
||||
return;
|
||||
}
|
||||
// 模拟提交
|
||||
console.log('修改密码请求参数:', values);
|
||||
message.success(intl.formatMessage({ id: 'page.changePassword.success' }));
|
||||
form.resetFields();
|
||||
};
|
||||
|
||||
return (
|
||||
<div style={{ padding: '24px', maxWidth: 400 }}>
|
||||
<Form form={form} layout="vertical" onFinish={handleSubmit}>
|
||||
<Form.Item
|
||||
name="newPassword"
|
||||
label={intl.formatMessage({ id: 'page.changePassword.label.newPassword' })}
|
||||
rules={[{ required: true, message: intl.formatMessage({ id: 'page.changePassword.message.enterNewPassword' }) }]}
|
||||
>
|
||||
<Input.Password placeholder={intl.formatMessage({ id: 'page.changePassword.message.enterNewPassword' })} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
name="confirmPassword"
|
||||
label={intl.formatMessage({ id: 'page.changePassword.label.confirmPassword' })}
|
||||
rules={[{ required: true, message: intl.formatMessage({ id: 'page.changePassword.message.enterConfirmPassword' }) }]}
|
||||
>
|
||||
<Input.Password placeholder={intl.formatMessage({ id: 'page.changePassword.message.enterConfirmPassword' })} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item>
|
||||
<Button type="primary" htmlType="submit" style={{ width: '100%' }}>
|
||||
{intl.formatMessage({ id: 'page.changePassword.button.submit' })}
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default ChangePassword;
|
@ -0,0 +1,21 @@
|
||||
.custom-table {
|
||||
// 表头样式
|
||||
.ant-table-thead > tr > th {
|
||||
background-color: #f2f6fc; // 表头背景色
|
||||
color: #94989e; // 表头字体颜色
|
||||
border-right: none; // 去掉竖线
|
||||
}
|
||||
|
||||
// 表体样式,去除竖线
|
||||
.ant-table-tbody > tr > td {
|
||||
color: #262626;
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
// 可选:去除最右边列的边框(避免因 border-collapse 出现残留)
|
||||
|
||||
.ant-table-tbody > tr > td:last-child {
|
||||
border-right: none;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,36 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Descriptions } from 'antd';
|
||||
import { coscoSupplier } from '../services'
|
||||
import { useIntl } from 'umi';
|
||||
|
||||
const PersonalInfo: React.FC = () => {
|
||||
const intl = useIntl();
|
||||
const [registerInfo, setRegisterInfo] = useState<any>({ base: {} });
|
||||
|
||||
const fetchData = async () => {
|
||||
const { code, data } = await coscoSupplier({});
|
||||
if (code === 200) {
|
||||
setRegisterInfo(data);
|
||||
}
|
||||
};
|
||||
// 个人信息
|
||||
useEffect(() => {
|
||||
fetchData()
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div style={{ padding: '24px 24px 0 0' }}>
|
||||
<Descriptions bordered column={2} labelStyle={{ width: '120px' }}>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'page.workbench.personal.name' })}>{registerInfo.base.name}</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'page.workbench.personal.gender' })}>{registerInfo.base.gender}</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'page.workbench.personal.phone' })}>{registerInfo.base.phone}</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'page.workbench.personal.email' })}>{registerInfo.base.email}</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'page.workbench.personal.department' })}>{registerInfo.base.department}</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'page.workbench.personal.position' })}>{registerInfo.base.position}</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'page.workbench.personal.entryDate' })}>{registerInfo.base.entryDate}</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default PersonalInfo;
|
41
src/pages/supplier/backend/workbenches/index.tsx
Normal file
41
src/pages/supplier/backend/workbenches/index.tsx
Normal file
@ -0,0 +1,41 @@
|
||||
import React, { useState } from 'react';
|
||||
import { Tabs, Row, Col } from 'antd';
|
||||
import CompanyInfo from '@/components/CompanyInfo';
|
||||
import PersonalInfo from './components/PersonalInfo';
|
||||
import ChangePassword from './components/ChangePassword';
|
||||
const { TabPane } = Tabs;
|
||||
|
||||
const Workbench: React.FC = () => {
|
||||
const [activeTab, setActiveTab] = useState<string>('company');
|
||||
|
||||
return (
|
||||
<div style={{ height: '100vh', background: '#fff', display: 'flex', flexDirection: 'column' }}>
|
||||
<div style={{ padding: '16px 24px', borderBottom: '1px solid #f0f0f0' }}>
|
||||
<h2 style={{ margin: 0 }}>工作台</h2>
|
||||
</div>
|
||||
|
||||
<Row style={{ flex: 1, overflow: 'hidden' }}>
|
||||
<Col span={24} style={{ borderRight: '1px solid #f0f0f0' }}>
|
||||
<Tabs
|
||||
tabPosition="left"
|
||||
activeKey={activeTab}
|
||||
onChange={setActiveTab}
|
||||
style={{ height: '100%' }}
|
||||
>
|
||||
<TabPane tab="公司信息" key="company">
|
||||
<CompanyInfo />
|
||||
</TabPane>
|
||||
<TabPane tab="个人信息" key="tasks">
|
||||
<PersonalInfo />
|
||||
</TabPane>
|
||||
<TabPane tab="修改密码" key="settings">
|
||||
<ChangePassword />
|
||||
</TabPane>
|
||||
</Tabs>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Workbench;
|
38
src/pages/supplier/backend/workbenches/services.ts
Normal file
38
src/pages/supplier/backend/workbenches/services.ts
Normal file
@ -0,0 +1,38 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
|
||||
export async function coscoSupplier(params:any) {
|
||||
console.log(params,'params');
|
||||
|
||||
return request('/api/system/coscoSupplier', {
|
||||
method: 'GET',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
export async function library(params:any) {
|
||||
return request('/api/system/library', {
|
||||
method: 'GET',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
export async function qualifications(params:any) {
|
||||
return request('/api/system/qualifications', {
|
||||
method: 'GET',
|
||||
params
|
||||
});
|
||||
}
|
||||
export async function invoice(params:any) {
|
||||
return request('/api/system/invoice', {
|
||||
method: 'GET',
|
||||
params
|
||||
});
|
||||
}
|
||||
export async function bank(params:any) {
|
||||
return request('/api/system/bank', {
|
||||
method: 'GET',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user