zlisen пре 3 година
родитељ
комит
c232b22098
2 измењених фајлова са 49 додато и 21 уклоњено
  1. 2
    1
      src/components/TableList/index.jsx
  2. 47
    20
      src/pages/customer/Customer/PublicCustomer/index.jsx

+ 2
- 1
src/components/TableList/index.jsx Прегледај датотеку

39
     const queryParams = {
39
     const queryParams = {
40
       pageNum: pageConfig.current,
40
       pageNum: pageConfig.current,
41
       pageSize: pageConfig.pageSize,
41
       pageSize: pageConfig.pageSize,
42
+      pageNumber: pageConfig.current,
42
       ...(postData(params) || params || {}),
43
       ...(postData(params) || params || {}),
43
     };
44
     };
44
 
45
 
45
     request({ ...api, urlData: urlData || undefined, params: queryParams })
46
     request({ ...api, urlData: urlData || undefined, params: queryParams })
46
       .then(res => {
47
       .then(res => {
47
-        console.log(res, 'fetchData');
48
+ 
48
         if (res.records) {
49
         if (res.records) {
49
           const { total, records = [] } = res;
50
           const { total, records = [] } = res;
50
           setLoading(false);
51
           setLoading(false);

+ 47
- 20
src/pages/customer/Customer/PublicCustomer/index.jsx Прегледај датотеку

1
 import React, { useState, useMemo, useRef } from 'react';
1
 import React, { useState, useMemo, useRef } from 'react';
2
-import { Avatar, Button,message } from 'antd';
2
+import { Avatar, Button, message } from 'antd';
3
 import router from 'umi/router';
3
 import router from 'umi/router';
4
 import QueryTable from '@/components/QueryTable';
4
 import QueryTable from '@/components/QueryTable';
5
 import apis from '@/services/apis';
5
 import apis from '@/services/apis';
25
     // changeStatus: { visible: true, data: {} },
25
     // changeStatus: { visible: true, data: {} },
26
   });
26
   });
27
   const [exportLoding, setExportLoding] = useState(false);
27
   const [exportLoding, setExportLoding] = useState(false);
28
-   // 选中的公客信息
29
-   const [personInfo, setPersonInfo] = useState([])
28
+  // 选中的公客信息
29
+  const [personInfo, setPersonInfo] = useState([]);
30
 
30
 
31
-   const [selectedRowKeys, setSelectedRowKeys] = useState([])
31
+  const [selectedRowKeys, setSelectedRowKeys] = useState([]);
32
 
32
 
33
   const handShowModel = (record, actionType) => {
33
   const handShowModel = (record, actionType) => {
34
     SetShowModel({
34
     SetShowModel({
40
   };
40
   };
41
 
41
 
42
   function batchAssistConsultant() {
42
   function batchAssistConsultant() {
43
-    console.log(personInfo, 'personInfo')
44
-    console.log(personInfo.length)
43
+    console.log(personInfo, 'personInfo');
44
+    console.log(personInfo.length);
45
     if (personInfo.length <= 0) {
45
     if (personInfo.length <= 0) {
46
       return message.info('请至少选择一条数据');
46
       return message.info('请至少选择一条数据');
47
     }
47
     }
48
 
48
 
49
     const compareSet = new Set();
49
     const compareSet = new Set();
50
     personInfo.filter(record => {
50
     personInfo.filter(record => {
51
-      compareSet.add(record.buildingName)
52
-    })
51
+      compareSet.add(record.buildingName);
52
+    });
53
 
53
 
54
     if (compareSet.size != 1) {
54
     if (compareSet.size != 1) {
55
       return message.info('选中的公客存在于不同项目中,请分开进行分配置业顾问操作');
55
       return message.info('选中的公客存在于不同项目中,请分开进行分配置业顾问操作');
56
     }
56
     }
57
-    handShowModel({
58
-      customerId: personInfo, buildingId: personInfo[0].buildingId
59
-    }, actionList.assistConsultant)
57
+    handShowModel(
58
+      {
59
+        customerId: personInfo,
60
+        buildingId: personInfo[0].buildingId,
61
+      },
62
+      actionList.assistConsultant,
63
+    );
60
     //   SetShowModel({
64
     //   SetShowModel({
61
     //     [actionList[actionType]]: {
65
     //     [actionList[actionType]]: {
62
     //       visible: true,
66
     //       visible: true,
141
         align: 'center',
145
         align: 'center',
142
         width: '20%',
146
         width: '20%',
143
       },
147
       },
148
+      {
149
+        title: '是否归属项目',
150
+        dataIndex: '',
151
+        key: '',
152
+        align: 'center',
153
+        width: '10%',
154
+        render: (_, record) => <><span>{record.buildingId != null ? '是' : '否'}</span></>,
155
+      },
156
+      {
157
+        title: '归属项目',
158
+        dataIndex: 'buildingName',
159
+        key: 'buildingName',
160
+        align: 'center',
161
+        width: '15%',
162
+      },
144
       {
163
       {
145
         title: '性别',
164
         title: '性别',
146
         dataIndex: 'sex',
165
         dataIndex: 'sex',
154
           </>
173
           </>
155
         ),
174
         ),
156
       },
175
       },
176
+
157
       {
177
       {
158
         title: '推广人员',
178
         title: '推广人员',
159
         dataIndex: 'sharePersonName',
179
         dataIndex: 'sharePersonName',
169
 
189
 
170
         render: withActions((_, record) => [
190
         render: withActions((_, record) => [
171
           <AuthButton name="customer.detail">
191
           <AuthButton name="customer.detail">
172
-            <Button  type="link" onClick={() => publicCustomerDetail(record)}>
192
+            <Button type="link" onClick={() => publicCustomerDetail(record)}>
173
               查看详情
193
               查看详情
174
-          </Button>
194
+            </Button>
175
           </AuthButton>,
195
           </AuthButton>,
176
 
196
 
177
           <AuthButton name="customer.consultant.dispatch" noRight={null}>
197
           <AuthButton name="customer.consultant.dispatch" noRight={null}>
195
   const actionRender = () => {
215
   const actionRender = () => {
196
     return (
216
     return (
197
       <>
217
       <>
198
-      <Button type="primary" loading={exportLoding} onClick={() => exportCustomer()}>
218
+        <Button type="primary" loading={exportLoding} onClick={() => exportCustomer()}>
199
           导出
219
           导出
200
         </Button>
220
         </Button>
201
         {/* <AuthButton name="admin.customer.import" noRight={null}>
221
         {/* <AuthButton name="admin.customer.import" noRight={null}>
207
             批量分配置业顾问
227
             批量分配置业顾问
208
           </Button>
228
           </Button>
209
         </AuthButton> */}
229
         </AuthButton> */}
210
-        
211
       </>
230
       </>
212
     );
231
     );
213
   };
232
   };
216
     selectedRowKeys,
235
     selectedRowKeys,
217
     onChange: (selectedRowKeys, selectedRows) => {
236
     onChange: (selectedRowKeys, selectedRows) => {
218
       console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
237
       console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
219
-      setSelectedRowKeys(selectedRowKeys)
220
-      const newSelectedRows = personInfo.filter(x => !selectedRows.some(y => x.customerId === y.customerId))     // 去重
221
-        .concat(selectedRows)                                                                 // 新增选择
222
-        .filter(x => selectedRowKeys.some(y => y === x.customerId))                             // 去掉未选的数据
223
-      setPersonInfo(newSelectedRows)
238
+      setSelectedRowKeys(selectedRowKeys);
239
+      const newSelectedRows = personInfo
240
+        .filter(x => !selectedRows.some(y => x.customerId === y.customerId)) // 去重
241
+        .concat(selectedRows) // 新增选择
242
+        .filter(x => selectedRowKeys.some(y => y === x.customerId)); // 去掉未选的数据
243
+      setPersonInfo(newSelectedRows);
224
     },
244
     },
225
   };
245
   };
226
 
246
 
235
         params={{
255
         params={{
236
           customerType: 'public',
256
           customerType: 'public',
237
         }}
257
         }}
258
+        leftProps={{
259
+          postData: params => {
260
+            console.log('23')
261
+            params.pageNumber = params.pageNum;
262
+            return params;
263
+          },
264
+        }}
238
         columns={columns}
265
         columns={columns}
239
         actionRender={actionRender}
266
         actionRender={actionRender}
240
       />
267
       />