zhoulisen 5 years ago
parent
commit
00fd7e9165
1 changed files with 38 additions and 7 deletions
  1. 38
    7
      src/pages/customer/customerlist/index.jsx

+ 38
- 7
src/pages/customer/customerlist/index.jsx View File

@@ -374,7 +374,8 @@ function body(props) {
374 374
       key: 'picture',
375 375
       align: 'center',
376 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 381
       title: '姓名',
@@ -383,7 +384,7 @@ function body(props) {
383 384
       align: 'center',
384 385
       width: '10%',
385 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 390
       title: '电话',
@@ -392,6 +393,21 @@ function body(props) {
392 393
       align: 'center',
393 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 412
       title: '推广人员',
397 413
       dataIndex: 'sharePersonName',
@@ -401,12 +417,12 @@ function body(props) {
401 417
     },
402 418
     {
403 419
       title: '性别',
404
-      dataIndex: 'gender',
405
-      key: 'gender',
420
+      dataIndex: 'sex',
421
+      key: 'sex',
406 422
       align: 'center',
407 423
       width: '10%',
408 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 428
       title: '操作',
@@ -467,7 +483,7 @@ function body(props) {
467 483
       align: 'center',
468 484
       width: '10%',
469 485
       // eslint-disable-next-line no-nested-ternary
470
-      render: (_, record) => <><span>{record.sex === 1 ? '男' : record.sex === 2 ? '女' : '未知'}</span></>,
486
+      render: (_, record) => <><span>{record.sex === 1 ? '男' : (record.sex === 2 ? '女' : '未知')}</span></>,
471 487
     },
472 488
     {
473 489
       title: '置业顾问',
@@ -484,6 +500,13 @@ function body(props) {
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 511
       title: '推广人员',
489 512
       dataIndex: 'sharePersonName',
@@ -542,6 +565,14 @@ function body(props) {
542 565
   return (
543 566
     <>
544 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 576
         <Form.Item>
546 577
           {getFieldDecorator('buildingId')(
547 578
             <BuildSelect />,
@@ -654,7 +685,7 @@ function body(props) {
654 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
       {/* 调整归属 */}