|
@@ -5,140 +5,14 @@ import request from '../../../utils/request';
|
5
|
5
|
import apis from '../../../services/apis';
|
6
|
6
|
import Styles from './style.less';
|
7
|
7
|
|
|
8
|
+import Attribution from './components/attribution'
|
|
9
|
+import IntegralRecord from './components/integralRecord'
|
|
10
|
+
|
8
|
11
|
|
9
|
12
|
const { Option } = Select;
|
10
|
13
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
11
|
14
|
const { Meta } = Card;
|
12
|
15
|
|
13
|
|
-/**
|
14
|
|
- * 调整归属
|
15
|
|
- * (废弃, 后面研究)
|
16
|
|
- *
|
17
|
|
- * @param {*} props
|
18
|
|
- * @returns
|
19
|
|
- */
|
20
|
|
-class ModalTable extends React.Component {
|
21
|
|
- constructor(props) {
|
22
|
|
- super(props);
|
23
|
|
- this.state = {
|
24
|
|
- dataSource: { records: [] },
|
25
|
|
- visibleData: { visible: false, customerId: '', realtyConsultant: '' },
|
26
|
|
- }
|
27
|
|
- }
|
28
|
|
-
|
29
|
|
- // 挂载之后
|
30
|
|
- componentDidMount() {
|
31
|
|
- this.getList({ pageNumber: 1, pageSize: 5 })
|
32
|
|
- }
|
33
|
|
-
|
34
|
|
- componentDidUpdate(preProps, preState) {
|
35
|
|
- if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
|
36
|
|
- this.getList({ pageNumber: 1, pageSize: 5 })
|
37
|
|
- this.setState({ visibleData: this.props.visibleData });
|
38
|
|
- }
|
39
|
|
- }
|
40
|
|
-
|
41
|
|
- // 弹框确定按钮
|
42
|
|
- // eslint-disable-next-line react/sort-comp
|
43
|
|
- handleOk() {
|
44
|
|
- this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
|
45
|
|
- }
|
46
|
|
-
|
47
|
|
- // 弹框取消按钮
|
48
|
|
- handleCancel() {
|
49
|
|
- this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
|
50
|
|
- }
|
51
|
|
-
|
52
|
|
- getList(params) {
|
53
|
|
- // 网路请求
|
54
|
|
- request({ ...apis.customer.consultant, params: { ...params } }).then(res => {
|
55
|
|
- this.setState({ dataSource: res })
|
56
|
|
- }).catch(err => {
|
57
|
|
- // eslint-disable-next-line no-unused-expressions
|
58
|
|
- <Alert
|
59
|
|
- style={{
|
60
|
|
- marginBottom: 24,
|
61
|
|
- }}
|
62
|
|
- message={err}
|
63
|
|
- type="error"
|
64
|
|
- showIcon
|
65
|
|
- />
|
66
|
|
- })
|
67
|
|
- }
|
68
|
|
-
|
69
|
|
- // 分页
|
70
|
|
- onChange(pageNum) {
|
71
|
|
- this.getList({ pageNumber: pageNum, pageSize: 5 })
|
72
|
|
- }
|
73
|
|
-
|
74
|
|
- // 提交
|
75
|
|
- submitGm() {
|
76
|
|
- const { url, method } = apis.customer.recommendEdit
|
77
|
|
- const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(this.state.visibleData.customerId)
|
78
|
|
-
|
79
|
|
- // 网路请求
|
80
|
|
- request({ url: tempUrl, method, data: { ...this.state.visibleData } }).then(res => {
|
81
|
|
- this.handleCancel()
|
82
|
|
- }).catch(err => {
|
83
|
|
- // eslint-disable-next-line no-unused-expressions
|
84
|
|
- <Alert
|
85
|
|
- style={{
|
86
|
|
- marginBottom: 24,
|
87
|
|
- }}
|
88
|
|
- message={err}
|
89
|
|
- type="error"
|
90
|
|
- showIcon
|
91
|
|
- />
|
92
|
|
- })
|
93
|
|
- }
|
94
|
|
-
|
95
|
|
- render() {
|
96
|
|
- const columns = [
|
97
|
|
- {
|
98
|
|
- title: '姓名',
|
99
|
|
- dataIndex: 'name',
|
100
|
|
- key: 'name',
|
101
|
|
- },
|
102
|
|
- {
|
103
|
|
- title: '电话',
|
104
|
|
- dataIndex: 'phone',
|
105
|
|
- key: 'phone',
|
106
|
|
- },
|
107
|
|
- {
|
108
|
|
- title: '部门',
|
109
|
|
- dataIndex: 'department',
|
110
|
|
- key: 'department',
|
111
|
|
- },
|
112
|
|
- {
|
113
|
|
- title: '岗位',
|
114
|
|
- dataIndex: 'post',
|
115
|
|
- key: 'post',
|
116
|
|
- },
|
117
|
|
- {
|
118
|
|
- title: '操作',
|
119
|
|
- dataIndex: 'personId',
|
120
|
|
- key: 'personId',
|
121
|
|
- // eslint-disable-next-line no-nested-ternary
|
122
|
|
- render: (_, record) => <><Button className={Styles.SubmitButton} onClick={() => this.submitGm()}>确定</Button></>,
|
123
|
|
- },
|
124
|
|
- ]
|
125
|
|
- return (
|
126
|
|
- <>
|
127
|
|
- <Modal
|
128
|
|
- title="选择置业顾问"
|
129
|
|
- destroyOnClose="true"
|
130
|
|
- footer={null}
|
131
|
|
- visible={this.state.visibleData.visible}
|
132
|
|
- // onOk={() => this.handleOk()}
|
133
|
|
- onCancel={(e) => this.handleCancel(e)}
|
134
|
|
- >
|
135
|
|
- <Table dataSource={this.state.dataSource.records} columns={columns} pagination={{ total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
|
136
|
|
- </Modal>
|
137
|
|
- </>
|
138
|
|
- );
|
139
|
|
- }
|
140
|
|
-}
|
141
|
|
-
|
142
|
16
|
/**
|
143
|
17
|
*
|
144
|
18
|
*
|
|
@@ -161,6 +35,12 @@ function body(props) {
|
161
|
35
|
|
162
|
36
|
// 调整归属 ============= end
|
163
|
37
|
|
|
38
|
+ // 积分记录 ============ start
|
|
39
|
+ // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
40
|
+ const [recordVisibleData, setRecordVisibleData] = useState({ visible: false, personId: '' })
|
|
41
|
+
|
|
42
|
+ // 积分记录 ============= end
|
|
43
|
+
|
164
|
44
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
165
|
45
|
useEffect(() => {
|
166
|
46
|
getList({ pageNumber: 1, pageSize: 10, customerType })
|
|
@@ -272,13 +152,13 @@ function body(props) {
|
272
|
152
|
// eslint-disable-next-line no-nested-ternary
|
273
|
153
|
render: (_, record) => (
|
274
|
154
|
<>
|
275
|
|
- <sapn className={ customerType === 'private' ? Styles.text : Styles.displayS }>变更状态</sapn>
|
|
155
|
+ <Button className={ customerType === 'private' ? Styles.text : Styles.displayS } type="link">变更状态</Button>
|
276
|
156
|
|
277
|
|
- <sapn className={ customerType === 'private' ? Styles.text : Styles.displayS } onClick={() => gM(record)}>调整归属</sapn>
|
|
157
|
+ <Button className={ customerType === 'private' ? Styles.text : Styles.displayS } type="link" onClick={() => gM(record)}>调整归属</Button>
|
278
|
158
|
<br/>
|
279
|
|
- <sapn className={ Styles.text }>查看详情</sapn>
|
|
159
|
+ <Button className={ customerType === 'private' ? Styles.text : Styles.displayS } type="link">查看详情</Button>
|
280
|
160
|
|
281
|
|
- <sapn className={ Styles.text }>积分记录</sapn>
|
|
161
|
+ <Button className={ customerType === 'private' ? Styles.text : Styles.displayS } type="link" onClick={ () => setRecordVisibleData({ visible: true, customerId: record.customerId }) }>积分记录</Button>
|
282
|
162
|
</>
|
283
|
163
|
),
|
284
|
164
|
},
|
|
@@ -345,8 +225,10 @@ function body(props) {
|
345
|
225
|
<Table dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
|
346
|
226
|
|
347
|
227
|
{/* 调整归属 */}
|
348
|
|
- <ModalTable visibleData={gVisibleData} />
|
|
228
|
+ <Attribution visibleData={gVisibleData} />
|
349
|
229
|
|
|
230
|
+ {/* 积分记录 */}
|
|
231
|
+ <IntegralRecord visibleData={recordVisibleData} />
|
350
|
232
|
</>
|
351
|
233
|
);
|
352
|
234
|
}
|