Merge branch 'dev' of http://59.110.10.99:53000/liuc/fe_supplier_frontend into dev
This commit is contained in:
@ -99,6 +99,10 @@ const ViewBlacklistModal: React.FC<ViewBlacklistModalProps> = ({
|
||||
{ title: "发起单位", dataIndex: "orgName", align: "center", ellipsis: true, width: 160 },
|
||||
{ title: "发起部门", dataIndex: "deptName", align: "center", ellipsis: true, width: 160 },
|
||||
{ title: "退出品类", dataIndex: "categoryName", align: "center", ellipsis: true, width: 160 },
|
||||
{
|
||||
title: "退出原因", dataIndex: "exitReason", align: "center", ellipsis: true, width: 180,
|
||||
render: (dom, record:any) => <span>{record.exitReason}</span>,
|
||||
},
|
||||
{ title: "退出时间", dataIndex: "createTime", align: "center", width: 180 },
|
||||
];
|
||||
|
||||
|
@ -81,13 +81,13 @@ const SupplierCategoryEntry: React.FC = () => {
|
||||
const closeModal = () => {
|
||||
setModalInfo({ type: '', visible: false });
|
||||
const values = form.getFieldsValue();
|
||||
getList(values, 1, 10);
|
||||
getList(values, 1, pagination.pageSize);
|
||||
};
|
||||
// 重置
|
||||
const handleReset = () => {
|
||||
form.resetFields()
|
||||
const values = form.getFieldsValue();
|
||||
getList(values, 1, 10);
|
||||
getList(values, 1, pagination.pageSize);
|
||||
};
|
||||
|
||||
const handleApproval = (accessWorkId: string) => {
|
||||
@ -98,7 +98,7 @@ const SupplierCategoryEntry: React.FC = () => {
|
||||
if (res.code === 200) {
|
||||
message.success('发起审批成功');
|
||||
const values = form.getFieldsValue();
|
||||
getList(values, 1, 10);
|
||||
getList(values, 1, pagination.pageSize);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
@ -70,13 +70,13 @@ const SupplierCategoryEntryReview: React.FC = () => {
|
||||
const closeModal = () => {
|
||||
setModalInfo({ type: '', visible: false });
|
||||
const values = form.getFieldsValue();
|
||||
getList(values, 1, 10);
|
||||
getList(values, 1, pagination.pageSize);
|
||||
};
|
||||
// 重置
|
||||
const handleReset = () => {
|
||||
form.resetFields()
|
||||
const values = form.getFieldsValue();
|
||||
getList(values, 1, 10);
|
||||
getList(values, 1, pagination.pageSize);
|
||||
};
|
||||
//列表头部数据
|
||||
const columns: ColumnsType<Data> = [
|
||||
|
@ -59,7 +59,7 @@ const AccessManagement: React.FC = () => {
|
||||
//初始化
|
||||
useEffect(() => {
|
||||
const values = form.getFieldsValue();
|
||||
getList(values, 1, 10);
|
||||
getList(values, 1, pagination.pageSize);
|
||||
|
||||
getDictList('approve_type').then((res) => {
|
||||
if (res.code == 200) {
|
||||
@ -80,13 +80,13 @@ const AccessManagement: React.FC = () => {
|
||||
const closeModal = () => {
|
||||
setModalInfo({ type: '', visible: false });
|
||||
const values = form.getFieldsValue();
|
||||
getList(values, 1, 10);
|
||||
getList(values, 1, pagination.pageSize);
|
||||
};
|
||||
// 重置
|
||||
const handleReset = () => {
|
||||
form.resetFields()
|
||||
const values = form.getFieldsValue();
|
||||
getList(values, 1, 10);
|
||||
getList(values, 1, pagination.pageSize);
|
||||
};
|
||||
|
||||
const handleApproval = (id: string) => {
|
||||
@ -97,7 +97,7 @@ const AccessManagement: React.FC = () => {
|
||||
if (res.code === 200) {
|
||||
message.success('发起审批成功');
|
||||
const values = form.getFieldsValue();
|
||||
getList(values, 1, 10);
|
||||
getList(values, 1, pagination.pageSize);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
@ -254,7 +254,7 @@ const CategoryLibraryManage: React.FC = () => {
|
||||
onCancel={() => setAddVisible(false)}
|
||||
onSuccess={() => {
|
||||
setAddVisible(false);
|
||||
getList();
|
||||
getList(1, pagination.pageSize || 10);
|
||||
}}
|
||||
/>
|
||||
{/* 添加供应商弹窗 */}
|
||||
@ -264,7 +264,7 @@ const CategoryLibraryManage: React.FC = () => {
|
||||
onCancel={() => setAddSupplierVisible(false)}
|
||||
onSuccess={() => {
|
||||
setAddSupplierVisible(false);
|
||||
getList();
|
||||
getList(1, pagination.pageSize || 10);
|
||||
}}
|
||||
/>
|
||||
{/* 库内供应商数量弹窗 */}
|
||||
|
@ -75,7 +75,7 @@ const CategoryLibraryManage: React.FC = () => {
|
||||
const res = await approval({ id });
|
||||
if (res.code === 200) {
|
||||
message.success('提交成功');
|
||||
getList(); // 刷新列表
|
||||
getList(1, pagination.pageSize || 10);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
@ -236,7 +236,7 @@ const SupplierEntryManage: React.FC = () => {
|
||||
onCancel={() => setAddVisible(false)}
|
||||
onSuccess={() => {
|
||||
setAddVisible(false);
|
||||
getList();
|
||||
getList(1, pagination.pageSize || 10);
|
||||
}}
|
||||
/>
|
||||
{/* 添加供应商弹窗 */}
|
||||
@ -246,7 +246,7 @@ const SupplierEntryManage: React.FC = () => {
|
||||
onCancel={() => setAddSupplierVisible(false)}
|
||||
onSuccess={() => {
|
||||
setAddSupplierVisible(false);
|
||||
getList();
|
||||
getList(1, pagination.pageSize || 10);
|
||||
}}
|
||||
/>
|
||||
{/* 库内供应商数量弹窗 */}
|
||||
|
@ -73,7 +73,7 @@ const CategoryLibraryManage: React.FC = () => {
|
||||
const res = await approval({ id });
|
||||
if (res.code === 200) {
|
||||
message.success('提交成功');
|
||||
getList(); // 刷新列表
|
||||
getList(1, pagination.pageSize || 10); // 刷新列表
|
||||
}
|
||||
},
|
||||
});
|
||||
@ -267,7 +267,7 @@ const CategoryLibraryManage: React.FC = () => {
|
||||
onCancel={() => setAddVisible(false)}
|
||||
onSuccess={() => {
|
||||
setAddVisible(false);
|
||||
getList();
|
||||
getList(1, pagination.pageSize || 10);
|
||||
}}
|
||||
/>
|
||||
{/* 新增品类库弹窗 */}
|
||||
|
@ -203,9 +203,9 @@ const SupplierChangeReviewManage: React.FC<Props> = ({ dispatch }) => {
|
||||
审批记录
|
||||
</Button>
|
||||
{/* 测试使用,需删除 */}
|
||||
{ record.approveStatus === '0' && userId == '8' && (
|
||||
{record.approveStatus === '0' && userId == '8' && (
|
||||
<Button type="link" onClick={() => {
|
||||
supplierChangeApprove({ id:record.id, approveStatus: '1' }).then(() => {
|
||||
supplierChangeApprove({ id: record.id, approveStatus: '1' }).then(() => {
|
||||
handleReset()
|
||||
})
|
||||
}}>
|
||||
@ -264,7 +264,13 @@ const SupplierChangeReviewManage: React.FC<Props> = ({ dispatch }) => {
|
||||
dataSource={data}
|
||||
loading={loading}
|
||||
pagination={{ ...tableProps.pagination, total: pagination.total }}
|
||||
onChange={() => setPagination({ ...pagination })}
|
||||
onChange={(pag) => {
|
||||
setPagination({
|
||||
current: pag.current ?? 1,
|
||||
pageSize: pag.pageSize ?? 10,
|
||||
total: pag.total ?? 0,
|
||||
});
|
||||
}}
|
||||
style={{ flex: 1, minHeight: 0 }}
|
||||
scroll={{ y: 'calc(100vh - 350px)' }}
|
||||
/>
|
||||
|
@ -40,17 +40,17 @@ const groupQualifiedSupplierQuery: React.FC<Props> = ({ dispatch }) => {
|
||||
// 查询
|
||||
const handleSearch = () => {
|
||||
setPagination(p => ({ ...p, current: 1 }));
|
||||
getList(selectedKeys ? selectedKeys : currentUser.organizationId);
|
||||
getList(selectedKeys ? selectedKeys : currentUser.organizationId, 1, pagination.pageSize);
|
||||
};
|
||||
const handleReset = () => {
|
||||
form.resetFields();
|
||||
setPagination(p => ({ ...p, current: 1 }));
|
||||
getList(selectedKeys ? selectedKeys : currentUser.organizationId);
|
||||
getList(selectedKeys ? selectedKeys : currentUser.organizationId, 1, pagination.pageSize);
|
||||
};
|
||||
const handleTreeSelect = (keys: string | number) => {
|
||||
const key = keys as string;
|
||||
setSelectedKeys(key);
|
||||
getList(key);
|
||||
getList(key,1, pagination.pageSize);
|
||||
|
||||
};
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
//第三方UI库/组件
|
||||
import { Form, Button, Table, Input, Space, Tooltip } from 'antd';
|
||||
import { Form, Button, Table, Input, Space, Tooltip, Select } from 'antd';
|
||||
import { SearchOutlined, DeleteOutlined } from '@ant-design/icons';
|
||||
//类型定义
|
||||
import type { ColumnsType, TablePaginationConfig } from 'antd/es/table';
|
||||
@ -11,14 +11,24 @@ import { connect } from 'umi';
|
||||
// import SupplierDetailModal from './components/SupplierDetailModal';
|
||||
import CategorySelector from '@/components/TreeCategorySelector';
|
||||
import RegionTypeSelect from '@/components/CommonSelect/RegionTypeSelect'
|
||||
import AccessStatusSelect from '@/components/CommonSelect/AccessStatusSelect'
|
||||
//本地服务/接口
|
||||
import { getPageMy } from './services';
|
||||
import { downloadFile } from '@/utils/download';
|
||||
import { getDictList } from '@/servers/api/dicts'
|
||||
//统一列表分页
|
||||
import tableProps from '@/utils/tableProps'
|
||||
const accessStatusType = [
|
||||
{ code: '0', dicName: '未准入' },
|
||||
{ code: '1', dicName: '已准入' },
|
||||
{ code: '2', dicName: '已退出' }
|
||||
]
|
||||
|
||||
//准入状态
|
||||
const statusColor = (status: string) => {
|
||||
if (status === '已驳回' || status === '已退出') return '#ef6969';
|
||||
if (status === '已准入') return '#004f8e';
|
||||
return undefined;
|
||||
};
|
||||
// 列表数据接口
|
||||
interface Data {
|
||||
id: number;
|
||||
@ -54,13 +64,13 @@ const mySupplierInquiry: React.FC<mySupplierInquiryProps> = ({ dispatch }) => {
|
||||
// 查询
|
||||
const handleSearch = () => {
|
||||
setPagination({ ...pagination, current: 1 });
|
||||
getList();
|
||||
getList(1, pagination.pageSize);
|
||||
};
|
||||
// 重置
|
||||
const handleReset = () => {
|
||||
form.resetFields();
|
||||
setPagination({ ...pagination, current: 1 });
|
||||
getList();
|
||||
getList(1, pagination.pageSize);
|
||||
};
|
||||
//列表方法
|
||||
const getList = async (pageNo: number = 1, pageSize: number = 10) => {
|
||||
@ -79,7 +89,6 @@ const mySupplierInquiry: React.FC<mySupplierInquiryProps> = ({ dispatch }) => {
|
||||
}
|
||||
};
|
||||
const [enterpriseTypeMap, setEnterpriseTypeMap] = useState<{ [code: string]: string }>({});
|
||||
const [approveTypeMap, setApproveTypeMap] = useState<{ [code: string]: string }>({});
|
||||
// 初始化
|
||||
useEffect(() => {
|
||||
getDictList('enterprise_type').then((res: any) => {
|
||||
@ -92,15 +101,6 @@ const mySupplierInquiry: React.FC<mySupplierInquiryProps> = ({ dispatch }) => {
|
||||
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();
|
||||
}, []);
|
||||
|
||||
@ -184,11 +184,14 @@ const mySupplierInquiry: React.FC<mySupplierInquiryProps> = ({ dispatch }) => {
|
||||
},
|
||||
{
|
||||
title: '准入状态',
|
||||
dataIndex: 'accessStatus',
|
||||
key: 'accessStatus',
|
||||
dataIndex: 'accessStatusCn',
|
||||
key: 'accessStatusCn',
|
||||
width: 160,
|
||||
align: 'center',
|
||||
width: 140,
|
||||
render: (code: string) => approveTypeMap[code] || code
|
||||
render: (val: string) =>
|
||||
<span style={{
|
||||
color: statusColor(val) || (val === '未准入' ? '#aaa' : undefined),
|
||||
}}>{val}</span>
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
@ -232,7 +235,11 @@ const mySupplierInquiry: React.FC<mySupplierInquiryProps> = ({ dispatch }) => {
|
||||
<CategorySelector multiple={false} />
|
||||
</Form.Item>
|
||||
<Form.Item name="accessStatus" label="准入状态">
|
||||
<AccessStatusSelect />
|
||||
<Select style={{ width: 160 }} placeholder="请选择" allowClear>
|
||||
{accessStatusType?.map(item => (
|
||||
<Select.Option key={item.code} value={item.code}>{item.dicName}</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item name="supplierType" label="境内/境外">
|
||||
<RegionTypeSelect />
|
||||
@ -260,7 +267,7 @@ const mySupplierInquiry: React.FC<mySupplierInquiryProps> = ({ dispatch }) => {
|
||||
pagination={{ ...tableProps.pagination, total: pagination.total }}
|
||||
onChange={(pagination) => getList(pagination.current!, pagination.pageSize!)}
|
||||
style={{ flex: 1, minHeight: 0 }}
|
||||
scroll={{ y: 'calc(100vh - 350px)' }}
|
||||
scroll={{ y: 'calc(100vh - 380px)' }}
|
||||
/>
|
||||
</div>
|
||||
{/* 查看组件
|
||||
|
@ -43,18 +43,18 @@ const PersonQualifiedSupplierQuery: React.FC<Props> = ({ dispatch }) => {
|
||||
// 查询
|
||||
const handleSearch = () => {
|
||||
setPagination(p => ({ ...p, current: 1 }));
|
||||
getList(selectedKeys ? selectedKeys : currentUser.organizationId);
|
||||
getList(selectedKeys ? selectedKeys : currentUser.organizationId, 1, pagination.pageSize);
|
||||
};
|
||||
const handleReset = () => {
|
||||
form.resetFields();
|
||||
setPagination(p => ({ ...p, current: 1 }));
|
||||
getList(selectedKeys ? selectedKeys : currentUser.organizationId);
|
||||
getList(selectedKeys ? selectedKeys : currentUser.organizationId, 1, pagination.pageSize);
|
||||
};
|
||||
|
||||
const handleTreeSelect = (keys: string | number) => {
|
||||
const key = keys as string;
|
||||
setSelectedKeys(key);
|
||||
getList(key);
|
||||
getList(key, 1, pagination.pageSize);
|
||||
};
|
||||
|
||||
const getList = async (orgId: string, pageNo: number = 1, pageSize: number = 10) => {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
//第三方UI库/组件
|
||||
import { Form, Button, Table, Input, Space, Tooltip } from 'antd';
|
||||
import { Form, Button, Table, Input, Space, Tooltip, Select } from 'antd';
|
||||
import { SearchOutlined, DeleteOutlined } from '@ant-design/icons';
|
||||
//类型定义
|
||||
import type { ColumnsType, TablePaginationConfig } from 'antd/es/table';
|
||||
@ -10,7 +10,7 @@ import { useIntl, connect } from 'umi';
|
||||
import SupplierViewModal from './components/SupplierViewModal';
|
||||
import SupplierDetailModal from './components/SupplierDetailModal';
|
||||
import RegionTypeSelect from '@/components/CommonSelect/RegionTypeSelect'
|
||||
import AccessStatusSelect from '@/components/CommonSelect/AccessStatusSelect'
|
||||
// import AccessStatusSelect from '@/components/CommonSelect/AccessStatusSelect'
|
||||
//本地服务/接口
|
||||
import { getRegisterPage } from './services';
|
||||
import { getDictList } from '@/servers/api/dicts'
|
||||
@ -26,6 +26,12 @@ interface Data {
|
||||
regTime: string;
|
||||
status: string;
|
||||
}
|
||||
const accessStatusType = [
|
||||
{ code: '0', dicName: '未准入' },
|
||||
{ code: '1', dicName: '已准入' },
|
||||
{ code: '2', dicName: '已退出' }
|
||||
]
|
||||
|
||||
//准入状态
|
||||
const statusColor = (status: string) => {
|
||||
if (status === '已驳回' || status === '已退出') return '#ef6969';
|
||||
@ -57,13 +63,13 @@ const RegistrationQuery: React.FC<RegistrationQueryProps> = ({ dispatch }) => {
|
||||
// 搜索
|
||||
const handleSearch = () => {
|
||||
setPagination({ ...pagination, current: 1 });
|
||||
getList();
|
||||
getList(1, pagination.pageSize);
|
||||
};
|
||||
// 重置
|
||||
const handleReset = () => {
|
||||
form.resetFields();
|
||||
setPagination({ ...pagination, current: 1 });
|
||||
getList();
|
||||
getList(1, pagination.pageSize);
|
||||
};
|
||||
//列表方法
|
||||
const getList = async (pageNo: number = 1, pageSize: number = 10) => {
|
||||
@ -205,6 +211,13 @@ const RegistrationQuery: React.FC<RegistrationQueryProps> = ({ dispatch }) => {
|
||||
<Form.Item name="supplierType" label="境内/境外">
|
||||
<RegionTypeSelect />
|
||||
</Form.Item>
|
||||
<Form.Item name="accessStatus" label="准入状态">
|
||||
<Select style={{ width: 160 }} placeholder="请选择" allowClear>
|
||||
{accessStatusType?.map(item => (
|
||||
<Select.Option key={item.code} value={item.code}>{item.dicName}</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item>
|
||||
<Button className="buttonSubmit" type="primary" htmlType="submit" icon={<SearchOutlined />}>查询</Button>
|
||||
@ -222,7 +235,7 @@ const RegistrationQuery: React.FC<RegistrationQueryProps> = ({ dispatch }) => {
|
||||
pagination={{ ...tableProps.pagination, total: pagination.total }}
|
||||
onChange={(pagination) => getList(pagination.current!, pagination.pageSize!)}
|
||||
style={{ flex: 1, minHeight: 0 }}
|
||||
scroll={{ y: 'calc(100vh - 350px)' }}
|
||||
scroll={{ y: 'calc(100vh - 380px)' }}
|
||||
/>
|
||||
{/* 查看组件 */}
|
||||
<SupplierViewModal
|
||||
|
@ -68,7 +68,7 @@ const blacklistManage: React.FC = () => {
|
||||
const res = await submit({ id });
|
||||
if (res.code === 200) {
|
||||
message.success('提交成功');
|
||||
getList(); // 刷新列表
|
||||
getList(1, pagination.pageSize);
|
||||
}
|
||||
},
|
||||
});
|
||||
@ -80,7 +80,7 @@ const blacklistManage: React.FC = () => {
|
||||
const res = await restoreSubmit({ id });
|
||||
if (res.code === 200) {
|
||||
message.success('提交成功');
|
||||
getList(); // 刷新列表
|
||||
getList(1, pagination.pageSize);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
@ -42,11 +42,11 @@ const supplierExitAudit: React.FC = () => {
|
||||
setLoading(true);
|
||||
// 可传查询条件 form.getFieldsValue()
|
||||
const values = form.getFieldsValue();
|
||||
const { exitTheme, time, orgId, approveStatus } = values;
|
||||
const { time } = 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({ pageNo, pageSize, exitTheme, orgId, approveStatus, startTime, endTime });
|
||||
const { code, data } = await getPage({ pageNo, pageSize, ...values, startTime, endTime });
|
||||
if (code === 200) {
|
||||
setData(data.records);
|
||||
setPagination(prev => ({ ...prev, current: pageNo, pageSize, total: data.total }));
|
||||
@ -74,7 +74,7 @@ const supplierExitAudit: React.FC = () => {
|
||||
setCreateVisible(true)
|
||||
};
|
||||
const handleSelectOk = () => {
|
||||
getList();
|
||||
getList(1, pagination.pageSize);
|
||||
setCreateVisible(false);
|
||||
};
|
||||
useEffect(() => {
|
||||
|
@ -93,6 +93,10 @@ const ViewBlacklistModal: React.FC<ViewBlacklistModalProps> = ({
|
||||
{ title: "发起单位", dataIndex: "orgName", align: "center", ellipsis: true, width: 160 },
|
||||
{ title: "发起部门", dataIndex: "deptName", align: "center", ellipsis: true, width: 160 },
|
||||
{ title: "退出品类", dataIndex: "categoryName", align: "center", ellipsis: true, width: 160 },
|
||||
{
|
||||
title: "退出原因", dataIndex: "exitReason", align: "center", ellipsis: true, width: 180,
|
||||
render: (dom, record:any) => <span>{record.exitReason}</span>,
|
||||
},
|
||||
{ title: "退出时间", dataIndex: "createTime", align: "center", width: 180 },
|
||||
];
|
||||
|
||||
|
@ -41,11 +41,11 @@ const supplierExitManage: React.FC = () => {
|
||||
// 可传查询条件 form.getFieldsValue()
|
||||
|
||||
const values = form.getFieldsValue();
|
||||
const { exitTheme, time, deptId, approveStatus } = values;
|
||||
const { time } = 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({ pageNo, pageSize, exitTheme, deptId, approveStatus, startTime, endTime });
|
||||
const { code, data } = await getPage({ pageNo, pageSize, ...values, startTime, endTime });
|
||||
if (code === 200) {
|
||||
setData(data.records);
|
||||
setPagination(prev => ({ ...prev, current: pageNo, pageSize, total: data.total }));
|
||||
@ -73,7 +73,7 @@ const supplierExitManage: React.FC = () => {
|
||||
setCreateVisible(true)
|
||||
};
|
||||
const handleSelectOk = () => {
|
||||
getList();
|
||||
getList(1, pagination.pageSize);
|
||||
setCreateVisible(false);
|
||||
};
|
||||
useEffect(() => {
|
||||
|
Reference in New Issue
Block a user