|
@@ -7,6 +7,7 @@ import Styles from './style.less';
|
7
|
7
|
|
8
|
8
|
import Attribution from './components/attribution'
|
9
|
9
|
import IntegralRecord from './components/integralRecord'
|
|
10
|
+import ChangeStatus from './components/changeStatus'
|
10
|
11
|
|
11
|
12
|
|
12
|
13
|
const { Option } = Select;
|
|
@@ -39,6 +40,11 @@ function body(props) {
|
39
|
40
|
const [recordVisibleData, setRecordVisibleData] = useState({ visible: false, customerId: '' })
|
40
|
41
|
// 积分记录 ============= end
|
41
|
42
|
|
|
43
|
+ // 变更状态 ============ start
|
|
44
|
+ // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
45
|
+ const [statusVisibleData, setStatusVisibleData] = useState({ visible: false, customerId: '', status: '' })
|
|
46
|
+ // 变更状态 ============= end
|
|
47
|
+
|
42
|
48
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
43
|
49
|
useEffect(() => {
|
44
|
50
|
getList({ pageNumber: 1, pageSize: 10, customerType })
|
|
@@ -61,8 +67,17 @@ function body(props) {
|
61
|
67
|
})
|
62
|
68
|
}
|
63
|
69
|
|
|
70
|
+ function displayNone() {
|
|
71
|
+ setRecordVisibleData({ visible: false, customerId: '' })
|
|
72
|
+ setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
|
|
73
|
+ setStatusVisibleData({ visible: false, customerId: '', status: '' })
|
|
74
|
+ }
|
|
75
|
+
|
64
|
76
|
// 提交事件
|
65
|
77
|
function handleSubmit(e) {
|
|
78
|
+ displayNone()
|
|
79
|
+
|
|
80
|
+
|
66
|
81
|
e.preventDefault();
|
67
|
82
|
props.form.validateFields((err, values) => {
|
68
|
83
|
if (!err) {
|
|
@@ -85,6 +100,8 @@ function body(props) {
|
85
|
100
|
|
86
|
101
|
// 私客/公客切换
|
87
|
102
|
function radioButtonHandleSizeChange(e) {
|
|
103
|
+ displayNone()
|
|
104
|
+
|
88
|
105
|
const { value } = e.target
|
89
|
106
|
setCustomerType(value)
|
90
|
107
|
getList({ pageNumber: 1, pageSize: 10, customerType: value })
|
|
@@ -93,14 +110,22 @@ function body(props) {
|
93
|
110
|
// 这里有个 Bug, 就是 Modal 弹框,会联动出现, 比如 我点击 调整归属的Model弹框, 那么 积分记录的Model弹框莫名其妙的也显示了
|
94
|
111
|
// 所有这里临时解决方法是,弹出一个Modal对话框的时候,把其他的对话框给隐藏
|
95
|
112
|
|
96
|
|
-function showGM(record) {
|
|
113
|
+ function showGM(record) {
|
97
|
114
|
setGVisibleData({ visible: true, customerId: record.customerId, realtyConsultant: record.realtyConsultant })
|
98
|
115
|
setRecordVisibleData({ visible: false, customerId: '' })
|
|
116
|
+ setStatusVisibleData({ visible: false, customerId: '' })
|
99
|
117
|
}
|
100
|
118
|
|
101
|
119
|
function showRecord(record) {
|
102
|
120
|
setRecordVisibleData({ visible: true, customerId: record.customerId })
|
103
|
121
|
setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
|
|
122
|
+ setStatusVisibleData({ visible: false, customerId: '' })
|
|
123
|
+ }
|
|
124
|
+
|
|
125
|
+ function showStatus(record) {
|
|
126
|
+ setRecordVisibleData({ visible: false, customerId: '' })
|
|
127
|
+ setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
|
|
128
|
+ setStatusVisibleData({ visible: true, customerId: record.customerId, status: record.status })
|
104
|
129
|
}
|
105
|
130
|
|
106
|
131
|
const columns = [
|
|
@@ -156,7 +181,7 @@ function showGM(record) {
|
156
|
181
|
// eslint-disable-next-line no-nested-ternary
|
157
|
182
|
render: (_, record) => (
|
158
|
183
|
<>
|
159
|
|
- <Button className={ customerType === 'private' ? Styles.text : Styles.displayS } type="link">变更状态</Button>
|
|
184
|
+ <Button className={ customerType === 'private' ? Styles.text : Styles.displayS } type="link" onClick={() => showStatus(record)}>变更状态</Button>
|
160
|
185
|
|
161
|
186
|
<Button className={ customerType === 'private' ? Styles.text : Styles.displayS } type="link" onClick={() => showGM(record)}>调整归属</Button>
|
162
|
187
|
<br/>
|
|
@@ -214,7 +239,7 @@ function showGM(record) {
|
214
|
239
|
)}
|
215
|
240
|
</Form.Item>
|
216
|
241
|
<Form.Item>
|
217
|
|
- <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
|
|
242
|
+ <Button type="danger" htmlType="submit" >
|
218
|
243
|
搜索
|
219
|
244
|
</Button>
|
220
|
245
|
</Form.Item>
|
|
@@ -233,6 +258,9 @@ function showGM(record) {
|
233
|
258
|
|
234
|
259
|
{/* 积分记录 */}
|
235
|
260
|
<IntegralRecord visibleData={recordVisibleData} />
|
|
261
|
+
|
|
262
|
+ {/* 变更状态 */}
|
|
263
|
+ <ChangeStatus visibleData={statusVisibleData} />
|
236
|
264
|
</>
|
237
|
265
|
);
|
238
|
266
|
}
|