zhoulisen пре 5 година
родитељ
комит
723a310cbf

+ 27
- 23
src/pages/customer/customerlist/components/BatchAssistConsultant.jsx Прегледај датотеку

@@ -22,8 +22,9 @@ class ModalAttribution extends React.Component {
22 22
     super(props);
23 23
     console.log(props, 'props')
24 24
     this.state = {
25
-       dataSource: { records: [] },
26
-       visibleData: { visible: false, customerId: [], buildingName: '' },
25
+      dataSource: { records: [] },
26
+      visibleData: { visible: false, customerId: [], buildingName: '' },
27
+      buildingId: ''
27 28
     }
28 29
   }
29 30
 
@@ -33,9 +34,11 @@ class ModalAttribution extends React.Component {
33 34
   }
34 35
 
35 36
   componentDidUpdate(preProps, preState) {
37
+    // this.setState({ buildingId: this.props.visibleData.buildingId })
36 38
     console.log(this.props.visibleData)
37 39
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
38
-      this.getList({ pageNumber: 1, pageSize: 5,buildingId: this.props.visibleData.buildingId})
40
+
41
+      this.getList({ pageNumber: 1, pageSize: 5, buildingId: this.props.visibleData.buildingId })
39 42
       this.setState({ visibleData: this.props.visibleData });
40 43
     }
41 44
   }
@@ -51,12 +54,12 @@ class ModalAttribution extends React.Component {
51 54
     this.props.onCancel()
52 55
   }
53 56
 
54
-  changBuilding(buildingId){
55
-    this.getUserList({ pageNumber: 1, pageSize: 5, buildingId: buildingId })
57
+  changBuilding(buildingId) {
58
+    this.getUserList({ pageNumber: 1, pageSize: 5, buildingId: this.buildingId })
56 59
     this.setState({ visibleData: { visible: this.props.visibleData.visible, customerId: this.props.visibleData.customerId, buildingName: buildingId } });
57 60
   }
58 61
 
59
-  getUserList(params){
62
+  getUserList(params) {
60 63
     console.log('params: ', params)
61 64
     if (params.buildingId === '' || params.buildingId === null || params.buildingId === undefined) {
62 65
       return
@@ -65,17 +68,17 @@ class ModalAttribution extends React.Component {
65 68
     request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
66 69
       this.setState({ dataSource: res })
67 70
     }).catch(err => {
68
-      
71
+
69 72
     })
70 73
   }
71 74
 
72 75
   getList(params) {
73 76
     // 网路请求
74 77
     console.log('params: ', params)
75
-    request({ ...apis.customer.buildingConsultant , params: { ...params }}).then(res => {
78
+    request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
76 79
       this.setState({ dataSource: res })
77 80
     }).catch(err => {
78
-      
81
+
79 82
     })
80 83
   }
81 84
 
@@ -87,10 +90,10 @@ class ModalAttribution extends React.Component {
87 90
     });
88 91
   };
89 92
 
90
-   // 分页
93
+  // 分页
91 94
   onChange(pageNum) {
92 95
 
93
-    this.getUserList({ pageNumber: pageNum, pageSize: 5, buildingId: this.state.visibleData.buildingName })
96
+    this.getList({ pageNumber: pageNum, pageSize: 5, buildingId: this.state.visibleData.buildingId })
94 97
   }
95 98
 
96 99
   // 提交
@@ -138,22 +141,23 @@ class ModalAttribution extends React.Component {
138 141
         dataIndex: 'personId',
139 142
         key: 'personId',
140 143
         // eslint-disable-next-line no-nested-ternary
141
-        render: (_, record) => <>{ <Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>, },
144
+        render: (_, record) => <>{<Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>,
145
+      },
142 146
     ]
143 147
     return (
144 148
       <>
145 149
         <Modal
146
-            title="分配置业顾问"
147
-            width={800}
148
-            destroyOnClose="true"
149
-            footer={null}
150
-            visible={this.state.visibleData.visible}
151
-            onCancel={(e) => this.handleCancel(e)}
152
-          >
153
-            <span>你正在为{this.props.visibleData.customerId.length}位公客分配置业顾问</span><br/><br/>
154
-            {this.props.visibleData.buildingId == null && <BuildSelect onChange={this.changBuilding.bind(this)} value={this.state.visibleData.buildingName} />}
155
-            <Table rowKey="BatchAssistConsultant" dataSource={this.state.dataSource.records} columns={columns} pagination={{pageSize: 5, total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
156
-          </Modal>
150
+          title="分配置业顾问"
151
+          width={800}
152
+          destroyOnClose="true"
153
+          footer={null}
154
+          visible={this.state.visibleData.visible}
155
+          onCancel={(e) => this.handleCancel(e)}
156
+        >
157
+          <span>你正在为{this.props.visibleData.customerId.length}位公客分配置业顾问</span><br /><br />
158
+          {this.props.visibleData.buildingId == null && <BuildSelect onChange={this.changBuilding.bind(this)} value={this.state.visibleData.buildingName} />}
159
+          <Table rowKey="BatchAssistConsultant" dataSource={this.state.dataSource.records} columns={columns} pagination={{ pageSize: 5, total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
160
+        </Modal>
157 161
       </>
158 162
     );
159 163
   }

+ 21
- 20
src/pages/customer/customerlist/components/assistConsultant.jsx Прегледај датотеку

@@ -21,8 +21,8 @@ class ModalAttribution extends React.Component {
21 21
   constructor(props) {
22 22
     super(props);
23 23
     this.state = {
24
-       dataSource: { records: [] },
25
-       visibleData: { visible: false, customerId: '', buildingName: '' },
24
+      dataSource: { records: [] },
25
+      visibleData: { visible: false, customerId: '', buildingName: '' },
26 26
     }
27 27
   }
28 28
 
@@ -34,7 +34,7 @@ class ModalAttribution extends React.Component {
34 34
   componentDidUpdate(preProps, preState) {
35 35
     console.log(this.props.visibleData)
36 36
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
37
-      this.getList({ pageNumber: 1, pageSize: 5, customerId: this.props.visibleData.customerId,buildingId:this.props.visibleData.buildingId })
37
+      this.getList({ pageNumber: 1, pageSize: 5, customerId: this.props.visibleData.customerId, buildingId: this.props.visibleData.buildingId })
38 38
       this.setState({ visibleData: this.props.visibleData });
39 39
     }
40 40
   }
@@ -50,12 +50,12 @@ class ModalAttribution extends React.Component {
50 50
     this.props.onCancel()
51 51
   }
52 52
 
53
-  changBuilding(buildingId){
53
+  changBuilding(buildingId) {
54 54
     this.getUserList({ pageNumber: 1, pageSize: 5, buildingId: buildingId })
55 55
     this.setState({ visibleData: { visible: this.props.visibleData.visible, customerId: this.props.visibleData.customerId, buildingName: buildingId } });
56 56
   }
57 57
 
58
-  getUserList(params){
58
+  getUserList(params) {
59 59
     console.log('params: ', params)
60 60
     if (params.buildingId === '' || params.buildingId === null || params.buildingId === undefined) {
61 61
       return
@@ -64,7 +64,7 @@ class ModalAttribution extends React.Component {
64 64
     request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
65 65
       this.setState({ dataSource: res })
66 66
     }).catch(err => {
67
-      
67
+
68 68
     })
69 69
   }
70 70
 
@@ -73,7 +73,7 @@ class ModalAttribution extends React.Component {
73 73
     request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
74 74
       this.setState({ dataSource: res })
75 75
     }).catch(err => {
76
-      
76
+
77 77
     })
78 78
   }
79 79
 
@@ -85,9 +85,9 @@ class ModalAttribution extends React.Component {
85 85
     });
86 86
   };
87 87
 
88
-   // 分页
88
+  // 分页
89 89
   onChange(pageNum) {
90
-    this.getList({ pageNumber: pageNum, pageSize: 5, buildingId: this.state.visibleData.buildingName })
90
+    this.getList({ pageNumber: pageNum, pageSize: 5, customerId: this.props.visibleData.customerId, buildingId: this.props.visibleData.buildingId })
91 91
   }
92 92
 
93 93
   // 提交
@@ -135,21 +135,22 @@ class ModalAttribution extends React.Component {
135 135
         dataIndex: 'personId',
136 136
         key: 'personId',
137 137
         // eslint-disable-next-line no-nested-ternary
138
-        render: (_, record) => <>{ <Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>, },
138
+        render: (_, record) => <>{<Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>,
139
+      },
139 140
     ]
140 141
     return (
141 142
       <>
142 143
         <Modal
143
-            title="分配置业顾问"
144
-            width={800}
145
-            destroyOnClose="true"
146
-            footer={null}
147
-            visible={this.state.visibleData.visible}
148
-            onCancel={(e) => this.handleCancel(e)}
149
-          >
150
-            {this.props.visibleData.buildingId == null && <BuildSelect  onChange={this.changBuilding.bind(this)} value={this.state.visibleData.buildingName} />}
151
-            <Table rowKey="assistConsultant" dataSource={this.state.dataSource.records} columns={columns} pagination={{pageSize: 5, total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
152
-          </Modal>
144
+          title="分配置业顾问"
145
+          width={800}
146
+          destroyOnClose="true"
147
+          footer={null}
148
+          visible={this.state.visibleData.visible}
149
+          onCancel={(e) => this.handleCancel(e)}
150
+        >
151
+          {this.props.visibleData.buildingId == null && <BuildSelect onChange={this.changBuilding.bind(this)} value={this.state.visibleData.buildingName} />}
152
+          <Table rowKey="assistConsultant" dataSource={this.state.dataSource.records} columns={columns} pagination={{ pageSize: 5, total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
153
+        </Modal>
153 154
       </>
154 155
     );
155 156
   }

+ 1
- 1
src/pages/customer/customerlist/index.jsx Прегледај датотеку

@@ -699,7 +699,7 @@ function body(props) {
699 699
           //     onClick: () => publicCustomerDetail(record),
700 700
           //   };
701 701
           // }}
702
-          dataSource={dataPub.records} columns={publicColumns} pagination={{ current: dataPub.current, total: dataPub.total, pageSize: dataPub.size, onChange }} rowKey={r => r.customerId} >{console.log(dataPub, '123')}</Table>
702
+          dataSource={dataPub.records} columns={publicColumns} pagination={{ current: dataPub.current, total: dataPub.total, pageSize: dataPub.size, onChange }} rowKey={r => r.customerId} ></Table>
703 703
       }
704 704
 
705 705
       {/* 调整归属 */}