业务员

This commit is contained in:
houjishuang
2025-06-09 15:23:21 +08:00
parent d929a8f0a4
commit f9d6d38866
4 changed files with 137 additions and 4 deletions

View File

@ -105,18 +105,22 @@ export default [
path: '/PublicPlatform',
component: './Bid/BiddingAnnouncement/components/PublicPlatform',
},
{
{//代理库管理
path: '/ToAgencyManager',
component: './Agency/AgencyManager',
},
{
{//代理库申请
path: '/ToAgencyValid',
component: './Agency/AgencyManager/applyIndex',
},
{
{//代理库审批
path: '/ToAgencyApprove',
component: './Agency/AgencyManager/approveIndex',
},
{//代理库业务员
path: '/ToAgencyAgent',
component: './Agency/AgencyManager/agentIndex',
},
//==============================================================引入的业务路由
...approvalForm,//审批单
...juryRoom,//评标室内所有路由

View File

@ -0,0 +1,116 @@
import React, { useState, useRef } from 'react';
import {Radio, message, Modal, Input, Form, PageHeader, Button, Spin, Select, Tree, DatePicker } from 'antd';
import ProTable, { ProColumns, ActionType } from '@ant-design/pro-table';
import {getCurrentUserSupplierAgent, addRoleUser} from './service';
// import './styles.less';
import {getSessionRoleData, getDicData,getSessionUserData } from '@/utils/session';
import TextArea from 'antd/lib/input/TextArea';
import SelectProvider from './components/SelectProvider';
const agent: React.FC<{}> = () => {
//获取字典
const getDict: any = getDicData();
const [form] = Form.useForm();
const dictData = JSON.parse(getDict);
const actionRef = useRef<ActionType>();
const [spin, spinSet] = useState<boolean>(false);
//查询分页数据
const [pageData, pageDataSet] = useState<any>({
pageNo: 1,
pageSize: 10
});
const layout = {
labelCol: { span: 6 },
wrapperCol: { span: 13 },
};
interface DictType {
value: string;
label: string;
}
const [date, setDate] = useState('');
//业务员列表
const columns: ProColumns<any>[] = [
{ title: '序号', valueType: 'index', width: 50, search: false, },
{ title: '姓名', dataIndex: 'name', },//, ellipsis: true
{ title: '手机号', dataIndex: 'phone', search: false, },//, ellipsis: true//, ellipsis: true
{ title: '账号', dataIndex: 'account', search: false, },//, ellipsis: true
{ title: '权限', dataIndex: 'roleCode', valueType: 'select',search: false,hideInTable:true,
valueEnum: { '121': { text: '招标代理业务员', status: '121' },'role2': { text: '供应商', status: 'role2' }, },
},//, ellipsis: true
{ title: 'id', dataIndex: 'id', search: false,hideInTable:true,},//, ellipsis: true
{ title: '是否有权限', dataIndex: 'hasAgentRole', search: false, valueType: 'select',
valueEnum: { 'true': { text: '有', status: '1' },'false': { text: '无', status: '2' }, },//, ellipsis: true
},
{
title: '操作', width: '9%',
valueType: 'option',
render: (_, record) => [
!record.hasAgentRole && <Button type='text' onClick={() => { handleAdd(record) }}></Button>,
]
},
];
const handleAdd = async (record: any) => {
await addRoleUser({
//...record,
userId: record.id,
roleId: record.roleCode,
}).then((r: any) => {
if (r?.code == 200) {
message.success('操作成功');
actionRef.current?.reload();
} else {
message.error('操作失败');
}
});
};
return (
<Spin spinning={spin}>
<PageHeader title="业务员管理" />
<div style={{ maxHeight: innerHeight - 130, height: innerHeight - 130 }} className='xsy-entrust bgCWhite'>
<ProTable<any>
actionRef={actionRef}//action触发后更新表格
columns={columns}//表格
options={false}
bordered={false}
className='tableSearch'
size='small'
search={{ labelWidth: 'auto', span: 6 }}
request={(params) =>
getCurrentUserSupplierAgent({
...params,
basePageRequest: { pageNo: pageData.pageNo, pageSize: pageData.pageSize },
}).then((res) => {
const result = {
data: res.data.records,
total: res.data.total,
success: res.success,
pageSize: res.data.size,
current: res.data.current
}
return result;
})
}
pagination={{
defaultPageSize: 10,
showSizeChanger: false,
onChange: (page, pageSize) => pageDataSet({ pageNo: page, pageSize: pageSize }),
onShowSizeChange: (current, size) => pageDataSet({ pageNo: current, pageSize: size }),
}}
onReset={() => { pageDataSet({ pageNo: 1, pageSize: 10 }) }}
/>
</div>
{/* 查看 */}
</Spin >
)
};
export default agent;

View File

@ -440,7 +440,7 @@ marginBottom: '1.5rem'
<SelectProvider
visible={selectProviderVisible}
onSelect={(provider) => {
console.log('Selected provider:', provider);
// 处理选中的供应商数据
setCurrentRecord(provider);
// if (currentRecord && provider) {

View File

@ -79,4 +79,17 @@ export async function getEntrustedProjects(params: any) {
data: params,
});
}
export async function addRoleUser(params: any) {
return request('/api/sys-manager-ebtp-project/v1/sysuserrole', {
method: 'post',
data: params,
});
}
export async function getCurrentUserSupplierAgent(params: any) {
return request('/api/biz-supplier-manage/supplier/base/supplierContact/agents', {
method: 'post',
data: params,
});
}