|
@@ -22,7 +22,7 @@ const CustomerChange = (props) => {
|
22
|
22
|
};
|
23
|
23
|
|
24
|
24
|
const batchAssistConsultant = () => {
|
25
|
|
- if(selectIds.length < 1){
|
|
25
|
+ if (selectIds.length < 1) {
|
26
|
26
|
message.info("请至少选择一条数据");
|
27
|
27
|
return
|
28
|
28
|
}
|
|
@@ -30,10 +30,10 @@ const CustomerChange = (props) => {
|
30
|
30
|
}
|
31
|
31
|
|
32
|
32
|
const consulatanChange = (e) => {
|
33
|
|
- if(e){
|
34
|
|
- data.map(x =>{
|
|
33
|
+ if (e) {
|
|
34
|
+ data.map(x => {
|
35
|
35
|
selectIds.map(y => {
|
36
|
|
- if(x.customerId === y){
|
|
36
|
+ if (x.customerId === y) {
|
37
|
37
|
x.realtyConsultant = e.userId
|
38
|
38
|
x.moveUserId = e.userId
|
39
|
39
|
x.moveUserName = e.userName
|
|
@@ -46,9 +46,9 @@ const CustomerChange = (props) => {
|
46
|
46
|
}
|
47
|
47
|
|
48
|
48
|
//批量保存
|
49
|
|
- const batchSaveConsultant = () =>{
|
|
49
|
+ const batchSaveConsultant = () => {
|
50
|
50
|
const unMoveData = data.filter(x => !x.moveUserId)
|
51
|
|
- if(unMoveData.length > 0){
|
|
51
|
+ if (unMoveData.length > 0) {
|
52
|
52
|
message.info("存在未分配归属客户");
|
53
|
53
|
return
|
54
|
54
|
}
|
|
@@ -99,17 +99,17 @@ const CustomerChange = (props) => {
|
99
|
99
|
|
100
|
100
|
useEffect(() => {
|
101
|
101
|
request({ ...apis.staff.check, params: { userId: props.userId, personId: props.consultantPersonId, buildingId: props.buildingId } }).then(data => {
|
102
|
|
- setData(data)
|
103
|
|
- })
|
|
102
|
+ setData(data)
|
|
103
|
+ })
|
104
|
104
|
}, [props.userId])
|
105
|
105
|
|
106
|
106
|
return (
|
107
|
107
|
<div>
|
108
|
|
- <Button type="primary" onClick={() => batchAssistConsultant()} style={{ float: 'right', margin: '20px 0', marginLeft: '20px', zIndex: 1 }}>分配置业顾问</Button>
|
109
|
|
- <Table rowSelection={rowSelection} dataSource={data} columns={columns} rowKey="customerId" pagination={false} scroll={{ y: 500 }}/>
|
110
|
|
- <BatchAssistConsultant visible={consultantVisible} userId={props.userId} buildingId={props.buildingId} onCancel={consulatanChange} />
|
111
|
|
- <Button type="primary" onClick={() => batchSaveConsultant()} style={{}}>保存</Button>
|
112
|
|
- <Button onClick={() => cancelConsultant()} style={{}}>取消</Button>
|
|
108
|
+ <Button type="primary" onClick={() => batchAssistConsultant()} style={{ float: 'right', margin: '20px 0', marginLeft: '20px', zIndex: 1 }}>分配置业顾问</Button>
|
|
109
|
+ <Table rowSelection={rowSelection} dataSource={data} columns={columns} rowKey="customerId" pagination={false} scroll={{ y: 500 }} />
|
|
110
|
+ <BatchAssistConsultant visible={consultantVisible} userId={props.userId} buildingId={props.buildingId} onCancel={consulatanChange} />
|
|
111
|
+ <div style={{ textAlign: 'center', marginTop: '16px' }}><Button type="primary" onClick={() => batchSaveConsultant()}>保存</Button>
|
|
112
|
+ <Button style={{ marginLeft: '10px' }} onClick={() => cancelConsultant()}>取消</Button></div>
|
113
|
113
|
</div>
|
114
|
114
|
)
|
115
|
115
|
}
|