dingxin 5 år sedan
förälder
incheckning
059f33255b
3 ändrade filer med 18 tillägg och 3 borttagningar
  1. 1
    0
      config/routes.js
  2. 2
    2
      src/pages/channel/brokerList.jsx
  3. 15
    1
      src/pages/channel/channelList.jsx

+ 1
- 0
config/routes.js Visa fil

189
               {
189
               {
190
                 path: '/channel/brokerList',
190
                 path: '/channel/brokerList',
191
                 name: '经纪人',
191
                 name: '经纪人',
192
+                hideInMenu: true,
192
                 component: './channel/brokerList',
193
                 component: './channel/brokerList',
193
               },
194
               },
194
               {
195
               {

+ 2
- 2
src/pages/channel/brokerList.jsx Visa fil

103
 //   const [page, changePage] = useState({})
103
 //   const [page, changePage] = useState({})
104
   // eslint-disable-next-line react-hooks/rules-of-hooks
104
   // eslint-disable-next-line react-hooks/rules-of-hooks
105
   useEffect(() => {
105
   useEffect(() => {
106
-    getListBroker()
106
+    getListBroker({ channelId: props.location.query.id, pageNum: 1, pageSize: 10 })
107
   }, [])
107
   }, [])
108
 
108
 
109
     function getListBroker(params) {
109
     function getListBroker(params) {
118
 
118
 
119
  // 查询
119
  // 查询
120
  function queryList() {
120
  function queryList() {
121
-  getListBroker({ ...queryData, pageNum: 1, pageSize: 10, channelId: localStorage.getItem('value') })
121
+  getListBroker({ ...queryData, pageNum: 1, pageSize: 10, channelId: props.location.query.id })
122
 }
122
 }
123
     // 分页
123
     // 分页
124
     function onChange(pageNumber) {
124
     function onChange(pageNumber) {

+ 15
- 1
src/pages/channel/channelList.jsx Visa fil

64
     dataIndex: 'brokerCount',
64
     dataIndex: 'brokerCount',
65
     key: 'brokerCount',
65
     key: 'brokerCount',
66
     align: 'center',
66
     align: 'center',
67
+      render: (text, record) => <a style={ { color: '#66B3FF' } } onClick= {() => toBroker(record)} >{ record.recommendCount }</a>,
67
   },
68
   },
68
   {
69
   {
69
     title: '推荐客户有效',
70
     title: '推荐客户有效',
86
       <AuthButton name="admin.channel.id.put" noRight={null}>
87
       <AuthButton name="admin.channel.id.put" noRight={null}>
87
         <a style={{ color: '#66B3FF' }} onClick={() => toedit(record.channelId)} >编辑</a>
88
         <a style={{ color: '#66B3FF' }} onClick={() => toedit(record.channelId)} >编辑</a>
88
       </AuthButton>
89
       </AuthButton>
89
-    )
90
+    ),
90
   },
91
   },
91
 ];
92
 ];
92
 
93
 
110
   });
111
   });
111
 }
112
 }
112
 
113
 
114
+// 经纪人页面
115
+function toBroker(record) {
116
+  if (record.brokerCount === 0) {
117
+    return
118
+  }
119
+  router.push({
120
+    pathname: '/channel/brokerList',
121
+    query: {
122
+      id: record.channelId,
123
+    },
124
+  });
125
+}
126
+
113
 const header = props => {
127
 const header = props => {
114
   // eslint-disable-next-line react-hooks/rules-of-hooks
128
   // eslint-disable-next-line react-hooks/rules-of-hooks
115
   const [data, setData] = useState({ channelNmae: [], result: [] })
129
   const [data, setData] = useState({ channelNmae: [], result: [] })