diff --git a/config/router.config.ts b/config/router.config.ts index b916f61..2e27551 100644 --- a/config/router.config.ts +++ b/config/router.config.ts @@ -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,//评标室内所有路由 diff --git a/src/pages/Agency/AgencyManager/agentIndex.tsx b/src/pages/Agency/AgencyManager/agentIndex.tsx new file mode 100644 index 0000000..7942aa5 --- /dev/null +++ b/src/pages/Agency/AgencyManager/agentIndex.tsx @@ -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(); + const [spin, spinSet] = useState(false); + //查询分页数据 + const [pageData, pageDataSet] = useState({ + 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[] = [ + { 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 && , + + ] + }, + ]; + + + + + 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 ( + + +
+ + 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 }) }} + /> +
+ {/* 查看 */} +
+ ) +}; +export default agent; \ No newline at end of file diff --git a/src/pages/Agency/AgencyManager/index.tsx b/src/pages/Agency/AgencyManager/index.tsx index 23c1728..a0eeb83 100644 --- a/src/pages/Agency/AgencyManager/index.tsx +++ b/src/pages/Agency/AgencyManager/index.tsx @@ -440,7 +440,7 @@ marginBottom: '1.5rem' { - console.log('Selected provider:', provider); + // 处理选中的供应商数据 setCurrentRecord(provider); // if (currentRecord && provider) { diff --git a/src/pages/Agency/AgencyManager/service.ts b/src/pages/Agency/AgencyManager/service.ts index e92eab4..8269850 100644 --- a/src/pages/Agency/AgencyManager/service.ts +++ b/src/pages/Agency/AgencyManager/service.ts @@ -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, + }); +} \ No newline at end of file