|
@@ -9,6 +9,7 @@ import apis from '../../../services/apis';
|
9
|
9
|
import request from '../../../utils/request'
|
10
|
10
|
import Styles from './style.less';
|
11
|
11
|
import BuildingSelect from '@/components/SelectButton/BuildSelect';
|
|
12
|
+import CustomerChange from '../components/CustomerChange'
|
12
|
13
|
|
13
|
14
|
const { Meta } = Card;
|
14
|
15
|
const { Option } = Select;
|
|
@@ -32,22 +33,39 @@ const toEditStaff = userId => () => {
|
32
|
33
|
*/
|
33
|
34
|
const CartBody = props => {
|
34
|
35
|
const { data } = props
|
|
36
|
+ const [visible, setVisible] = useState(false)
|
35
|
37
|
// console.log("data11:", data)
|
36
|
38
|
|
37
|
39
|
const confirm = data => () => {
|
38
|
40
|
// console.log(data, "11111")
|
39
|
41
|
if (data.status === 1) {
|
40
|
|
- Modal.confirm({
|
41
|
|
- title: '停用后无法登录后台系统',
|
42
|
|
- okText: '确认',
|
43
|
|
- cancelText: '取消',
|
44
|
|
- onOk () {
|
45
|
|
- request({ ...apis.staff.change, urlData: { id: data.userId, type: 'off' } }).then(data => {
|
46
|
|
- message.info('操作成功')
|
47
|
|
- props.onFresh()
|
48
|
|
- })
|
49
|
|
- },
|
50
|
|
- });
|
|
42
|
+ if(data.isConsultant){
|
|
43
|
+ request({ ...apis.staff.check, params: { userId: data.userId, personId: data.consultantPersonId, buildingId: data.buildingId } }).then(data => {
|
|
44
|
+ if(data){
|
|
45
|
+ Modal.confirm({
|
|
46
|
+ title: '此置业顾问下有私客,是否转移私客?',
|
|
47
|
+ okText: '确认',
|
|
48
|
+ cancelText: '取消',
|
|
49
|
+ onOk () {
|
|
50
|
+ setVisible(true)
|
|
51
|
+ },
|
|
52
|
+ });
|
|
53
|
+ }
|
|
54
|
+ })
|
|
55
|
+ }else{
|
|
56
|
+ const titleMessahe = data.isConsultant ? '停用后此员工无法继续登录后台(若为置业顾问停用后在小程序端将成为普通用户)确认进行停用操作?' : '停用后此员工无法继续登录后台,确认进行停用操作?';
|
|
57
|
+ Modal.confirm({
|
|
58
|
+ title: titleMessahe,
|
|
59
|
+ okText: '确认',
|
|
60
|
+ cancelText: '取消',
|
|
61
|
+ onOk () {
|
|
62
|
+ request({ ...apis.staff.change, urlData: { id: data.userId, type: 'off' } }).then(data => {
|
|
63
|
+ message.info('操作成功')
|
|
64
|
+ props.onFresh()
|
|
65
|
+ })
|
|
66
|
+ },
|
|
67
|
+ });
|
|
68
|
+ }
|
51
|
69
|
} else {
|
52
|
70
|
Modal.confirm({
|
53
|
71
|
title: '确认启用该角色?',
|
|
@@ -95,45 +113,55 @@ const CartBody = props => {
|
95
|
113
|
}
|
96
|
114
|
|
97
|
115
|
return (
|
|
116
|
+ <div>
|
|
117
|
+ <Card className={Styles.card}>
|
|
118
|
+ <div>
|
|
119
|
+ <Avatar src={data.photo} style={{ width: '0.48rem', height: '0.48rem' }} />
|
|
120
|
+ <AuthButton name="admin.user.put" noRight={null}>
|
|
121
|
+ <Button type="link" style={{ color: '#FF925C', fontSize: '0.106rem', position: 'absolute', top: '40px', left: '0.56rem' }} onClick={toEditStaff(data.userId)}>
|
|
122
|
+ 编辑
|
|
123
|
+ <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '0.04rem' }} />
|
|
124
|
+ </Button>
|
|
125
|
+ </AuthButton>
|
|
126
|
+ {/* <Button type="link" style={{ fontSize: ' 0.106rem', color: '#cacaca', position: 'absolute', top: '40px', right: '0' }} onClick={() => departure(data)}>
|
|
127
|
+ 离职
|
|
128
|
+ <Icon type="exclamation-circle" style={{ color: '#C0C4CC', marginLeft: '0.04rem' }} />
|
|
129
|
+ </Button> */}
|
|
130
|
+ <AuthButton name="admin.user.publish" noRight={null}>
|
|
131
|
+ <Button type="link" style={{ fontSize: ' 0.106rem', color: '#cacaca', position: 'absolute', top: '40px', right: '0' }} onClick={confirm(data)}>
|
|
132
|
+ {data.status === 1 ? '停用' : '启用'}
|
|
133
|
+ <Icon type={data.status === 1 ? 'close-circle' : 'form'} style={{ color: '#C0C4CC', marginLeft: '0.04rem' }} />
|
|
134
|
+ </Button>
|
|
135
|
+ </AuthButton>
|
|
136
|
+ </div>
|
|
137
|
+ <div>
|
98
|
138
|
|
99
|
|
- <Card className={Styles.card}>
|
100
|
|
- <div>
|
101
|
|
- <Avatar src={data.photo} style={{ width: '0.48rem', height: '0.48rem' }} />
|
102
|
|
- <AuthButton name="admin.user.put" noRight={null}>
|
103
|
|
- <Button type="link" style={{ color: '#FF925C', fontSize: '0.106rem', position: 'absolute', top: '40px', left: '0.56rem' }} onClick={toEditStaff(data.userId)}>
|
104
|
|
- 编辑
|
105
|
|
- <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '0.04rem' }} />
|
106
|
|
- </Button>
|
107
|
|
- </AuthButton>
|
108
|
|
- {/* <Button type="link" style={{ fontSize: ' 0.106rem', color: '#cacaca', position: 'absolute', top: '40px', right: '0' }} onClick={() => departure(data)}>
|
109
|
|
- 离职
|
110
|
|
- <Icon type="exclamation-circle" style={{ color: '#C0C4CC', marginLeft: '0.04rem' }} />
|
111
|
|
- </Button> */}
|
112
|
|
- <AuthButton name="admin.user.publish" noRight={null}>
|
113
|
|
- <Button type="link" style={{ fontSize: ' 0.106rem', color: '#cacaca', position: 'absolute', top: '40px', right: '0' }} onClick={confirm(data)}>
|
114
|
|
- {data.status === 1 ? '停用' : '启用'}
|
115
|
|
- <Icon type={data.status === 1 ? 'close-circle' : 'form'} style={{ color: '#C0C4CC', marginLeft: '0.04rem' }} />
|
116
|
|
- </Button>
|
117
|
|
- </AuthButton>
|
118
|
|
- </div>
|
119
|
|
- <div>
|
|
139
|
+ <span>
|
|
140
|
+ {
|
|
141
|
+ data.taTagsList.map((item, index) => <Tag className={Styles.cardTag} color={item.tagColor}>{item.tagName}</Tag>)
|
|
142
|
+ }
|
|
143
|
+ </span>
|
120
|
144
|
|
121
|
|
- <span>
|
122
|
|
- {
|
123
|
|
- data.taTagsList.map((item, index) => <Tag className={Styles.cardTag} color={item.tagColor}>{item.tagName}</Tag>)
|
124
|
|
- }
|
125
|
|
- </span>
|
126
|
|
-
|
127
|
|
- <p className={Styles.cardText} >姓名 : {data.userName}
|
128
|
|
- </p>
|
129
|
|
- {/* <p className={Styles.statusText} > 状态 : {data.status === 1 ? '启用' : '停用'} </p> */}
|
130
|
|
- <p className={Styles.statusText} > 绑定状态 : {data.miniStatus === 1 ? '已绑定' : '未绑定'} </p>
|
131
|
|
- <p className={Styles.phoneText} >
|
132
|
|
- 电话 : {data.phone}
|
133
|
|
- </p>
|
134
|
|
- </div>
|
|
145
|
+ <p className={Styles.cardText} >姓名 : {data.userName}
|
|
146
|
+ </p>
|
|
147
|
+ {/* <p className={Styles.statusText} > 状态 : {data.status === 1 ? '启用' : '停用'} </p> */}
|
|
148
|
+ <p className={Styles.statusText} > 绑定状态 : {data.miniStatus === 1 ? '已绑定' : '未绑定'} </p>
|
|
149
|
+ <p className={Styles.phoneText} >
|
|
150
|
+ 电话 : {data.phone}
|
|
151
|
+ </p>
|
|
152
|
+ </div>
|
135
|
153
|
|
136
|
|
- </Card>
|
|
154
|
+ </Card>
|
|
155
|
+ <Modal
|
|
156
|
+ visible={visible}
|
|
157
|
+ title="分配归属"
|
|
158
|
+ onCancel={() => setVisible(false)}
|
|
159
|
+ footer={null}
|
|
160
|
+ width={900}
|
|
161
|
+ >
|
|
162
|
+ <CustomerChange userId={data.userId} consultantPersonId={data.consultantPersonId} buildingId={data.buildingId} />
|
|
163
|
+ </Modal>
|
|
164
|
+ </div>
|
137
|
165
|
)
|
138
|
166
|
}
|
139
|
167
|
|
|
@@ -219,6 +247,16 @@ const header = props => {
|
219
|
247
|
)}
|
220
|
248
|
</Form.Item>
|
221
|
249
|
|
|
250
|
+ <Form.Item>
|
|
251
|
+
|
|
252
|
+ {getFieldDecorator('miniStatus')(
|
|
253
|
+ <Select style={{ width: '180px' }} placeholder="是否绑定" >
|
|
254
|
+ <Option value="0">未绑定</Option>
|
|
255
|
+ <Option value="1">已绑定</Option>
|
|
256
|
+ </Select>,
|
|
257
|
+ )}
|
|
258
|
+ </Form.Item>
|
|
259
|
+
|
222
|
260
|
<Form.Item>
|
223
|
261
|
<AuthButton name="admin.user.search" noRight={null}>
|
224
|
262
|
<Button type="primary" htmlType="submit" className={styles.searchBtn}>
|