xujing 5 年 前
コミット
461de30cc1
共有2 個のファイルを変更した41 個の追加37 個の削除を含む
  1. 38
    36
      src/pages/channel/brokerList.jsx
  2. 3
    1
      src/pages/customer/customerlist/index.jsx

+ 38
- 36
src/pages/channel/brokerList.jsx ファイルの表示

@@ -5,6 +5,7 @@ import channels from './channelList.less';
5 5
 import router from 'umi/router';
6 6
 import apis from '../../services/apis';
7 7
 import request from '../../utils/request'
8
+import Navigate from '@/components/Navigate';
8 9
 
9 10
 const { Option } = Select;
10 11
 function handleChange(value) {
@@ -43,7 +44,7 @@ const columns = [
43 44
     dataIndex: 'nickname',
44 45
     key: 'nickname',
45 46
     align: 'center',
46
-    render: (text, list) => <><span>{ list.name || list.nickname }</span></>,
47
+    render: (text, list) => <><span>{list.name || list.nickname}</span></>,
47 48
   },
48 49
   {
49 50
     title: '电话',
@@ -56,14 +57,15 @@ const columns = [
56 57
     dataIndex: 'sex',
57 58
     key: 'sex',
58 59
     align: 'center',
59
-    render: (text, list) => <a>{list.gender === '1' ? '男' : list.gender === '2' ? '女':'未知'}</a>,
60
+    render: (text, list) => <a>{list.gender === '1' ? '男' : list.gender === '2' ? '女' : '未知'}</a>,
60 61
   },
61 62
   {
62 63
     title: '推荐客户',
63 64
     dataIndex: 'recommendCount',
64 65
     key: 'recommendCount',
65 66
     align: 'center',
66
-    render: (text, list) => <a style={ { color: '#66B3FF' } } onClick= {() => torecommend(list.personId)} >{ list.recommendCount }</a>,
67
+    // render: (text, list) => <a style={ { color: '#66B3FF' } } onClick= {() => torecommend(list.personId)} >{ list.recommendCount }</a>,
68
+    render: (text, list) => <Navigate onClick={() => torecommend(list.personId)} >{list.recommendCount}</Navigate>,
67 69
   },
68 70
   // {
69 71
   //   title: '邀请经纪人',
@@ -101,31 +103,31 @@ const header = props => {
101 103
 
102 104
   // eslint-disable-next-line react-hooks/rules-of-hooks
103 105
   const [queryData, setQueryData] = useState({})
104
-//   const [page, changePage] = useState({})
106
+  //   const [page, changePage] = useState({})
105 107
   // eslint-disable-next-line react-hooks/rules-of-hooks
106 108
   useEffect(() => {
107 109
     getListBroker({ channelId: props.location.query.id, pageNum: 1, pageSize: 10 })
108 110
   }, [])
109 111
 
110
-    function getListBroker(params) {
111
-      request({ ...apis.channelList.getListBroker, params: { ...params } }).then((data) => {
112
-        setData(data)
112
+  function getListBroker(params) {
113
+    request({ ...apis.channelList.getListBroker, params: { ...params } }).then((data) => {
114
+      setData(data)
113 115
     }).catch((err) => {
114
-        console.log(err)
115
-        message.info(err.msg || err.message)
116
+      console.log(err)
117
+      message.info(err.msg || err.message)
116 118
     })
117
-    }
119
+  }
118 120
 
119 121
 
120
- // 搜索
121
- function queryList() {
122
-  getListBroker({ ...queryData, pageNum: 1, pageSize: 10, channelId: props.location.query.id })
123
-}
124
-    // 分页
125
-    function onChange(pageNumber) {
126
-      // eslint-disable-next-line react-hooks/rules-of-hooks
127
-      getListBroker({ pageNum: pageNumber, pageSize: 10 })
128
-    }
122
+  // 搜索
123
+  function queryList() {
124
+    getListBroker({ ...queryData, pageNum: 1, pageSize: 10, channelId: props.location.query.id })
125
+  }
126
+  // 分页
127
+  function onChange(pageNumber) {
128
+    // eslint-disable-next-line react-hooks/rules-of-hooks
129
+    getListBroker({ pageNum: pageNumber, pageSize: 10 })
130
+  }
129 131
   //   // 获取input的值
130 132
   //   function onInputChangeName (e) {
131 133
   //     // const InputValue = e.target.name.x.value;
@@ -161,25 +163,25 @@ const header = props => {
161 163
     getListBroker({ pageNum: 1, pageSize: 10, channelId: props.location.query.id })
162 164
   }
163 165
   const { getFieldDecorator } = props.form;
164
-return (
165
-  <>
166
-   <Form layout="inline" onSubmit={handleSubmit}>
167
-   <Form.Item label="姓名">
166
+  return (
167
+    <>
168
+      <Form layout="inline" onSubmit={handleSubmit}>
169
+        <Form.Item label="姓名">
168 170
           {getFieldDecorator('name', {
169
-          })(<Input/>)}
171
+          })(<Input />)}
172
+        </Form.Item>
173
+        <Form.Item label="电话">
174
+          {getFieldDecorator('phone', {
175
+          })(<Input />)}
176
+        </Form.Item>
177
+        <Form.Item >
178
+          <Button type="primary" htmlType="submit" >搜索</Button>
179
+          <Button onClick={handleReset} style={{ marginLeft: 18 }}>重置</Button>
170 180
         </Form.Item>
171
-    <Form.Item label="电话">
172
-      {getFieldDecorator('phone', {
173
-      })(<Input/>)}
174
-    </Form.Item>
175
-    <Form.Item >
176
-   <Button type="primary" htmlType="submit" >搜索</Button>
177
-     <Button onClick={handleReset} style={{ marginLeft: 18 }}>重置</Button>
178
-    </Form.Item>
179
-   </Form>
180
-    <Table style={{ marginTop: '40px' }} dataSource={data.list} columns={columns} pagination={{ pageSize: 10, total: data.total, onChange }} rowKey="brokerList"/>
181
-  </>
182
-)
181
+      </Form>
182
+      <Table style={{ marginTop: '40px' }} dataSource={data.list} columns={columns} pagination={{ pageSize: 10, total: data.total, onChange }} rowKey="brokerList" />
183
+    </>
184
+  )
183 185
 }
184 186
 const WrappedNormalLoginForm = Form.create({ name: 'header' })(header);
185 187
 function handleMenuClick(e) {

+ 3
- 1
src/pages/customer/customerlist/index.jsx ファイルの表示

@@ -17,6 +17,7 @@ import AuthButton from '@/components/AuthButton';
17 17
 import Navigate from '@/components/Navigate';
18 18
 import WxDictSelect from '@/components/SelectButton/WxDictSelect';
19 19
 import Prompt from 'umi/prompt';
20
+import EditIcon from '@/components/EditIcon';
20 21
 
21 22
 
22 23
 const { Option } = Select;
@@ -471,6 +472,7 @@ function body(props) {
471 472
       align: 'center',
472 473
       width: '20%',
473 474
       render: withActions((text, record) => [
475
+        <EditIcon color="#FF4A4A" text="查看详情" onClick={() => publicCustomerDetail(record)} />,
474 476
         <AuthButton name="admin.customer.recommend" noRight={null}>
475 477
           <Button className={customerType === 'private' ? Styles.displayS : Styles.text} type="link" onClick={() => showRecommend(record.personId)}>推荐客户</Button>
476 478
         </AuthButton>,
@@ -585,7 +587,7 @@ function body(props) {
585 587
       align: 'center',
586 588
       width: '20%',
587 589
       render: withActions((text, record) => [
588
-
590
+        <EditIcon color="#FF4A4A" text="查看详情" onClick={() => toCustomerDateil(record)} />,
589 591
         <AuthButton name="admin.customer.recommend.edit.id.put" noRight={null}>
590 592
           <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showStatus(record)}>变更状态</Button>
591 593
         </AuthButton>,