瀏覽代碼

* 客户列表优化

顾绍勇 5 年之前
父節點
當前提交
606082a644
共有 1 個檔案被更改,包括 37 行新增6 行删除
  1. 37
    6
      src/pages/customer/customerlist/index.jsx

+ 37
- 6
src/pages/customer/customerlist/index.jsx 查看文件

374
       key: 'picture',
374
       key: 'picture',
375
       align: 'center',
375
       align: 'center',
376
       width: '15%',
376
       width: '15%',
377
-      render: (_, record) => <Avatar shape="square" style={{ color: 'blue', cursor: 'pointer' }} onClick={() => publicCustomerDetail(record)} src={customerType === 'private' ? record.picture : record.avatarurl} size={64} icon="user" />,
377
+      // render: (_, record) => <Avatar shape="square" style={{ color: 'blue', cursor: 'pointer' }} onClick={() => publicCustomerDetail(record)} src={customerType === 'private' ? record.picture : record.avatarurl} size={64} icon="user" />,
378
+      render: (_, record) => <Avatar shape="square" style={{ color: 'blue', cursor: 'pointer' }} onClick={() => publicCustomerDetail(record)} src={record.picture } size={64} icon="user" />,
378
     },
379
     },
379
     {
380
     {
380
       title: '姓名',
381
       title: '姓名',
383
       align: 'center',
384
       align: 'center',
384
       width: '10%',
385
       width: '10%',
385
       // eslint-disable-next-line no-nested-ternary
386
       // eslint-disable-next-line no-nested-ternary
386
-      render: (_, record) => <><span style={{ color: 'blue', cursor: 'pointer' }} onClick={() => publicCustomerDetail(record)} >{customerType === 'private' ? record.name : record.nickname}</span></>,
387
+      // render: (_, record) => <><span style={{ color: 'blue', cursor: 'pointer' }} onClick={() => publicCustomerDetail(record)} >{customerType === 'private' ? record.name : record.nickname}</span></>,
387
     },
388
     },
388
     {
389
     {
389
       title: '电话',
390
       title: '电话',
392
       align: 'center',
393
       align: 'center',
393
       width: '15%',
394
       width: '15%',
394
     },
395
     },
396
+    {
397
+      title: '是否归属项目',
398
+      dataIndex: '',
399
+      key: '',
400
+      align: 'center',
401
+      width: '15%',
402
+      render: (_, record) => <><span>{record.buildingId != null ? '是' : '否'}</span></>,
403
+    },
404
+    {
405
+      title: '归属项目',
406
+      dataIndex: 'buildingName',
407
+      key: 'buildingName',
408
+      align: 'center',
409
+      width: '15%',
410
+    },
395
     {
411
     {
396
       title: '推广人员',
412
       title: '推广人员',
397
       dataIndex: 'sharePersonName',
413
       dataIndex: 'sharePersonName',
401
     },
417
     },
402
     {
418
     {
403
       title: '性别',
419
       title: '性别',
404
-      dataIndex: 'gender',
405
-      key: 'gender',
420
+      dataIndex: 'sex',
421
+      key: 'sex',
406
       align: 'center',
422
       align: 'center',
407
       width: '10%',
423
       width: '10%',
408
       // eslint-disable-next-line no-nested-ternary
424
       // eslint-disable-next-line no-nested-ternary
409
-      render: (_, record) => <><span>{record.gender === '1' ? '男' : record.gender === '2' ? '女' : '未知'}</span></>,
425
+      render: (_, record) => <><span>{record.sex === '1' ? '男' : record.sex === '2' ? '女' : '未知'}</span></>,
410
     },
426
     },
411
     {
427
     {
412
       title: '操作',
428
       title: '操作',
484
         </>
500
         </>
485
       ),
501
       ),
486
     },
502
     },
503
+    {
504
+      title: '归属项目',
505
+      dataIndex: 'buildingName',
506
+      key: 'buildingName',
507
+      align: 'center',
508
+      width: '15%',
509
+    },
487
     {
510
     {
488
       title: '推广人员',
511
       title: '推广人员',
489
       dataIndex: 'sharePersonName',
512
       dataIndex: 'sharePersonName',
542
   return (
565
   return (
543
     <>
566
     <>
544
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
567
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
568
+      {customerType === 'public' && <Form.Item>
569
+          {getFieldDecorator('belongStatus')(
570
+            <Select style={{ width: '180px' }} placeholder="是否归属项目" onChange={handleSelectChange}>
571
+              <Option value={1}>是</Option>
572
+              <Option value={0}>否</Option>
573
+            </Select>,
574
+          )}
575
+        </Form.Item>}
545
         <Form.Item>
576
         <Form.Item>
546
           {getFieldDecorator('buildingId')(
577
           {getFieldDecorator('buildingId')(
547
             <BuildSelect />,
578
             <BuildSelect />,
654
           //     onClick: () => publicCustomerDetail(record),
685
           //     onClick: () => publicCustomerDetail(record),
655
           //   };
686
           //   };
656
           // }}
687
           // }}
657
-          dataSource={dataSource.records} columns={publicColumns} pagination={{ current: dataSource.current, total: dataSource.total, pageSize: dataSource.size, onChange }} rowKey={r => r.personId} />
688
+          dataSource={dataSource.records} columns={publicColumns} pagination={{ current: dataSource.current, total: dataSource.total, pageSize: dataSource.size, onChange }} rowKey={r => r.customerId} />
658
       }
689
       }
659
 
690
 
660
       {/* 调整归属 */}
691
       {/* 调整归属 */}