张延森 5 年之前
父節點
當前提交
057ff529ca

+ 0
- 1
package.json 查看文件

53
     "moment": "^2.24.0",
53
     "moment": "^2.24.0",
54
     "omit.js": "^1.0.2",
54
     "omit.js": "^1.0.2",
55
     "path-to-regexp": "^3.0.0",
55
     "path-to-regexp": "^3.0.0",
56
-    "qrcode.react": "^0.9.3",
57
     "qs": "^6.7.0",
56
     "qs": "^6.7.0",
58
     "react": "^16.8.6",
57
     "react": "^16.8.6",
59
     "react-amap": "^1.2.8",
58
     "react-amap": "^1.2.8",

+ 12
- 0
src/components/Wangedit/Wangedit.jsx 查看文件

73
       }
73
       }
74
     }
74
     }
75
   }
75
   }
76
+
77
+  /**
78
+   *增加这个 shouldComponentUpdate 生命函数
79
+    处理自动聚焦到富文本上
80
+   *
81
+   * @param {*} nextProps
82
+   * @returns
83
+   * @memberof Wangedit
84
+   */
85
+  shouldComponentUpdate(nextProps) {
86
+    return nextProps.value !== this.editor.txt.html()
87
+  }
76
 }
88
 }
77
 
89
 
78
 export default Wangedit
90
 export default Wangedit

+ 0
- 16
src/pages/activity/ActivityList.jsx 查看文件

3
 import { FormattedMessage } from 'umi-plugin-react/locale';
3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
 import router from 'umi/router';
4
 import router from 'umi/router';
5
 import moment from 'moment';
5
 import moment from 'moment';
6
-// import QRCode from 'qrcodejs2'
7
 import styles from '../style/GoodsList.less';
6
 import styles from '../style/GoodsList.less';
8
 import SelectCity from '../../components/SelectButton/CitySelect'
7
 import SelectCity from '../../components/SelectButton/CitySelect'
9
 import BuildSelect from '../../components/SelectButton/BuildSelect'
8
 import BuildSelect from '../../components/SelectButton/BuildSelect'
59
   }
58
   }
60
 
59
 
61
 
60
 
62
-  function download (data) {
63
-    if (!data) {
64
-      return
65
-    }
66
-
67
-    const url = URL.createObjectURL(data)
68
-    const link = document.createElement('a')
69
-    link.style.display = 'none'
70
-    link.href = url
71
-    link.setAttribute('download', '活动二维码.png')
72
-    document.body.append(link)
73
-    link.click()
74
-  }
75
-
76
-
77
   /**
61
   /**
78
    *
62
    *
79
    *
63
    *

+ 26
- 14
src/pages/activity/drainage/Detail.jsx 查看文件

13
 const data = []
13
 const data = []
14
 
14
 
15
 const header = (props) => {
15
 const header = (props) => {
16
-  const drainageId = props.location.query.drainageId
16
+  const { drainageId, name } = props.location.query
17
 
17
 
18
 
18
 
19
   const [datas, setDatas] = useState([])
19
   const [datas, setDatas] = useState([])
36
       console.log(data, '3333333333333')
36
       console.log(data, '3333333333333')
37
       if (data.total != 0) {
37
       if (data.total != 0) {
38
         setTotal(data)
38
         setTotal(data)
39
-        // console.log(data.total, '3333333333333')
40
-
41
         setDatas(tableData(data.records))
39
         setDatas(tableData(data.records))
42
         // content = data.records[0]
40
         // content = data.records[0]
43
         console.log('json: ', eval('(' + data.records[0].content + ')'))
41
         console.log('json: ', eval('(' + data.records[0].content + ')'))
44
         setContent(eval('(' + data.records[0].content + ')'))
42
         setContent(eval('(' + data.records[0].content + ')'))
45
-        setColumns(tableTitle(eval('(' + data.records[0].content + ')')))
43
+        setColumns(tableTitle(data.records))
46
       }
44
       }
47
       else {
45
       else {
46
+        setDatas([])
48
         message.info('数据为空')
47
         message.info('数据为空')
49
       }
48
       }
50
 
49
 
56
     })
55
     })
57
   }
56
   }
58
   function tableData (data) {
57
   function tableData (data) {
59
-    console.log('data', data)
58
+    console.log('tabledata', data)
60
     return data.map((row, inx) => {
59
     return data.map((row, inx) => {
61
       return eval('(' + row.content + ')').reduce((acc, col) => {
60
       return eval('(' + row.content + ')').reduce((acc, col) => {
62
         const r = {
61
         const r = {
62
+
63
           key: inx + 1,
63
           key: inx + 1,
64
+          createDate:row.createDate,
64
           [`${col.key}`]: col.value,
65
           [`${col.key}`]: col.value,
65
           ...acc,
66
           ...acc,
66
         }
67
         }
71
   }
72
   }
72
 
73
 
73
   function tableTitle (data) {
74
   function tableTitle (data) {
74
-    return data.map((item) => {
75
+   tableTitle = eval('(' + data[0].content + ')')
76
+    const cols = [{
77
+      title: "提交时间",
78
+      dataIndex: "createDate",
79
+      key: "createDate",
80
+      render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
81
+    }]
82
+    return cols.concat( tableTitle.map((item) => {
75
       const col = {
83
       const col = {
76
         title: item.label,
84
         title: item.label,
77
         dataIndex: item.key,
85
         dataIndex: item.key,
78
         key: item.key
86
         key: item.key
79
       }
87
       }
80
       return col
88
       return col
81
-    })
89
+    }))
82
   }
90
   }
83
 
91
 
84
 
92
 
105
 
113
 
106
   function excelPort () {
114
   function excelPort () {
107
     // const fieldsValue = getFieldsValue()
115
     // const fieldsValue = getFieldsValue()
108
-    console.log("111111")
116
+  
109
     request({ ...apis.activity.exporttaDrainageRecord, params: { drainageId: drainageId, startTime: fromTime(startDate), endTime: fromTime(endDate) } })
117
     request({ ...apis.activity.exporttaDrainageRecord, params: { drainageId: drainageId, startTime: fromTime(startDate), endTime: fromTime(endDate) } })
110
       .then(response => {
118
       .then(response => {
111
         download(response)
119
         download(response)
148
       </Button>
156
       </Button>
149
 
157
 
150
       <div>
158
       <div>
151
-        {/* H5项目名称 style={{ float: 'right', margin: '20px 0', zIndex: 1 }} */}
152
-        <AuthButton name="admin.taDrainageRecord.export.get" noRight={null}>
153
-          <Button type="primary" style={{ marginLeft: '30px', float: 'right', marginTop: '30px', marginBottom: '30px', zIndex: 1 }} onClick={excelPort}>导出数据</Button>
154
-        </AuthButton>
159
+        <div style={{ display: 'flex', justifyContent: 'space-between' }}>
160
+         <div style={{ lineHeight: '92px', width: '600px', fontWeight: 'bold', fontSize: '18px' }}>
161
+            H5项目:{ name }
162
+         </div>
163
+          {/* H5项目名称 style={{ float: 'right', margin: '20px 0', zIndex: 1 }} */}
164
+          <AuthButton name="admin.taDrainageRecord.export.get" noRight={null}>
165
+            <Button type="primary" style={{ marginLeft: '30px', float: 'right', marginTop: '30px', marginBottom: '30px', zIndex: 1 }} onClick={excelPort}>导出数据</Button>
166
+          </AuthButton>
167
+        </div>
155
         <Table columns={columns} dataSource={datas} pagination={false} />
168
         <Table columns={columns} dataSource={datas} pagination={false} />
156
         <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
169
         <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
157
-          <Pagination showQuickJumper defaultCurrent={1} total={total.total} onChange={(e) => changePageNum(e)} current={total.current}
158
-/>
170
+          <Pagination showQuickJumper defaultCurrent={1} total={total.total} onChange={(e) => changePageNum(e)} current={total.current}/>
159
         </div>
171
         </div>
160
       </div>
172
       </div>
161
 
173
 

+ 4
- 4
src/pages/activity/drainage/DrainageList.jsx 查看文件

9
 import moment from 'moment';
9
 import moment from 'moment';
10
 import AuthButton from '../../../components/AuthButton';
10
 import AuthButton from '../../../components/AuthButton';
11
 
11
 
12
-const toEditList = (drainageId) => () => {
13
-  console.log(drainageId, '12344567')
12
+const toEditList = (row) => () => {
14
   router.push({
13
   router.push({
15
     pathname: '/activity/drainage/Detail',
14
     pathname: '/activity/drainage/Detail',
16
     query: {
15
     query: {
17
-      drainageId
16
+      drainageId: row.drainageId,
17
+      name: row.name,
18
     },
18
     },
19
   });
19
   });
20
 }
20
 }
142
       render: (text, datas) => (
142
       render: (text, datas) => (
143
         <>
143
         <>
144
           <AuthButton name="admin.customer.recommend.edit.id.put" noRight={null}>
144
           <AuthButton name="admin.customer.recommend.edit.id.put" noRight={null}>
145
-            <span style={{ right: '20px', top: '20px', fontSize: ' 0.106rem', zIndex: 1, color: '#FF7E48', cursor: 'pointer' }} onClick={toEditList(datas.drainageId)}>
145
+            <span style={{ right: '20px', top: '20px', fontSize: ' 0.106rem', zIndex: 1, color: '#FF7E48', cursor: 'pointer' }} onClick={toEditList(datas)}>
146
               查看详情
146
               查看详情
147
             </span>
147
             </span>
148
           </AuthButton>
148
           </AuthButton>

+ 2
- 2
src/pages/activity/groupActivity/helpRecord.jsx 查看文件

206
           // onOk={() => this.handleOk()}
206
           // onOk={() => this.handleOk()}
207
           onCancel={(e) => this.handleCancel(e)}
207
           onCancel={(e) => this.handleCancel(e)}
208
         >
208
         >
209
-          <div><span>核销码:<input onChange={this.verify.bind(this)}/></span>
210
-           <Button name="admin.taShareRecord.verificate.put" noRight={null} style={{ marginLeft: '80px' }} onClick={() => this.verification()}>立即核销</Button>
209
+          <div><span>核销码:<input style={{marginLeft: '10px'}} onChange={this.verify.bind(this)}/></span>
210
+           <Button name="admin.taShareRecord.verificate.put" noRight={null} style={{ marginLeft: '80px', marginTop:'10px', backgroundColor:'red' }} onClick={() => this.verification()}><span style={{color:'white'}}>立即核销</span></Button>
211
           </div>
211
           </div>
212
         </Modal>
212
         </Modal>
213
       </>
213
       </>

+ 2
- 2
src/pages/activity/helpActivity/helpRecord.jsx 查看文件

217
           // onOk={() => this.handleOk()}
217
           // onOk={() => this.handleOk()}
218
           onCancel={e => this.handleCancel(e)}
218
           onCancel={e => this.handleCancel(e)}
219
         >
219
         >
220
-          <div><span>核销码:<input onChange={this.verify.bind(this)}/></span>
221
-           <Button name="admin.helpInitiateRecordVerify.post" noRight={null} onClick={e => this.verification(e)} style={{ marginLeft: '80px' }}>立即核销</Button>
220
+          <div><span>核销码:<input style={{marginLeft: '10px'}} onChange={this.verify.bind(this)}/></span>
221
+           <Button name="admin.helpInitiateRecordVerify.post" noRight={null} onClick={e => this.verification(e)} style={{ marginLeft: '80px', marginTop:'10px', backgroundColor:'red' }}><span style={{color:'white'}}>立即核销</span></Button>
222
           </div>
222
           </div>
223
         </Modal>
223
         </Modal>
224
       </>
224
       </>

+ 3
- 2
src/pages/building/list/add/components/buildingProjectType.jsx 查看文件

61
           position: 'relative',
61
           position: 'relative',
62
           border: '1px solid #eee',
62
           border: '1px solid #eee',
63
           borderRadius: '4px',
63
           borderRadius: '4px',
64
-          marginTop:'16px'
64
+          marginTop: '16px',
65
         }}>
65
         }}>
66
 
66
 
67
           <p style={{ padding: '20px', borderBottom: '1px solid #eee' }}>{this.props.type.buildingTypeName || ''}  <Button type="link" style={{ position: 'absolute', right: '16px' }} icon="close" onClick={() => this.close()} /></p>
67
           <p style={{ padding: '20px', borderBottom: '1px solid #eee' }}>{this.props.type.buildingTypeName || ''}  <Button type="link" style={{ position: 'absolute', right: '16px' }} icon="close" onClick={() => this.close()} /></p>
140
     const updateProjectDate = this.updateProjectType(tempDate)
140
     const updateProjectDate = this.updateProjectType(tempDate)
141
     console.log('updateProjectDate: ', updateProjectDate)
141
     console.log('updateProjectDate: ', updateProjectDate)
142
     this.setState({ data: updateProjectDate })
142
     this.setState({ data: updateProjectDate })
143
+    this.setState({ defaultCheckboxValue: updateProjectDate.map(item => item.buildingTypeId) })
143
   }
144
   }
144
 
145
 
145
   onClose = e => {
146
   onClose = e => {
239
           onOk={this.handleOk}
240
           onOk={this.handleOk}
240
           onCancel={this.handleCancel}
241
           onCancel={this.handleCancel}
241
         >
242
         >
242
-          <Checkbox.Group options={this.state.projectType.map(item => ({ label: item.buildingTypeName, value: item.buildingTypeId }))} defaultValue={this.state.defaultCheckboxValue} onChange={e => this.onCheckboxChange(e)} />
243
+          <Checkbox.Group options={this.state.projectType.map(item => ({ label: item.buildingTypeName, value: item.buildingTypeId }))} onChange={e => this.onCheckboxChange(e)} value={this.state.defaultCheckboxValue}/>
243
         </Modal>
244
         </Modal>
244
         <Row type="flex" justify="space-between">
245
         <Row type="flex" justify="space-between">
245
           {
246
           {

+ 4
- 12
src/pages/customer/customerlist/components/attribution.jsx 查看文件

31
   }
31
   }
32
 
32
 
33
   componentDidUpdate(preProps, preState) {
33
   componentDidUpdate(preProps, preState) {
34
-    console.log(this.props.visibleData.realtyConsultant)
35
-    if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
34
+    if (this.props.visibleData.visible !== preState.visibleData.visible) {
36
       this.getList({ pageNumber: 1, pageSize: 5 })
35
       this.getList({ pageNumber: 1, pageSize: 5 })
37
       this.setState({ visibleData: this.props.visibleData });
36
       this.setState({ visibleData: this.props.visibleData });
38
     }
37
     }
41
   // 弹框确定按钮
40
   // 弹框确定按钮
42
   // eslint-disable-next-line react/sort-comp
41
   // eslint-disable-next-line react/sort-comp
43
   handleOk() {
42
   handleOk() {
44
-    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
43
+    this.props.onCancel()
45
   }
44
   }
46
 
45
 
47
   // 弹框取消按钮
46
   // 弹框取消按钮
48
   handleCancel() {
47
   handleCancel() {
49
-    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
48
+    this.props.onCancel()
50
   }
49
   }
51
 
50
 
52
   getList(params) {
51
   getList(params) {
55
       this.setState({ dataSource: res })
54
       this.setState({ dataSource: res })
56
     }).catch(err => {
55
     }).catch(err => {
57
       // eslint-disable-next-line no-unused-expressions
56
       // eslint-disable-next-line no-unused-expressions
58
-      <Alert
59
-        style={{
60
-          marginBottom: 24,
61
-        }}
62
-        message={err}
63
-        type="error"
64
-        showIcon
65
-      />
57
+      
66
     })
58
     })
67
   }
59
   }
68
 
60
 

+ 7
- 1
src/pages/customer/customerlist/index.jsx 查看文件

171
     link.click()
171
     link.click()
172
   }
172
   }
173
 
173
 
174
+  // 关闭调整归属的窗口
175
+  function closeAttribution() {
176
+    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
177
+    getList({ pageNum: 1, pageSize: 10, customerType, ...props.form.getFieldsValue() })
178
+  }
179
+
174
   const publicColumns = [
180
   const publicColumns = [
175
     {
181
     {
176
       title: '头像',
182
       title: '头像',
374
       }
380
       }
375
       
381
       
376
       {/* 调整归属 */}
382
       {/* 调整归属 */}
377
-      <Attribution visibleData={gVisibleData} />
383
+      <Attribution visibleData={gVisibleData} onCancel={() => closeAttribution()}/>
378
 
384
 
379
       {/* 积分记录 */}
385
       {/* 积分记录 */}
380
       <IntegralRecord visibleData={recordVisibleData} />
386
       <IntegralRecord visibleData={recordVisibleData} />

+ 17
- 19
src/pages/customer/independentList/index.jsx 查看文件

155
 
155
 
156
   // 挂载之后
156
   // 挂载之后
157
   componentDidMount () {
157
   componentDidMount () {
158
-    const { customerId } = this.state.visibleData
159
-    this.getList({ id: customerId, pageNumber: 1, pageSize: 5 })
158
+    
160
   }
159
   }
161
 
160
 
162
   componentDidUpdate (preProps, preState) {
161
   componentDidUpdate (preProps, preState) {
163
-    const { customerId } = this.state.visibleData
164
-    if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
162
+    const { customerId } = this.props.visibleData
163
+    
164
+    if (this.props.visibleData.visible !== preState.visibleData.visible) {
165
       this.getList({ id: customerId, pageNumber: 1, pageSize: 5 })
165
       this.getList({ id: customerId, pageNumber: 1, pageSize: 5 })
166
       this.setState({ visibleData: this.props.visibleData });
166
       this.setState({ visibleData: this.props.visibleData });
167
     }
167
     }
170
   // 弹框确定按钮
170
   // 弹框确定按钮
171
   // eslint-disable-next-line react/sort-comp
171
   // eslint-disable-next-line react/sort-comp
172
   handleOk () {
172
   handleOk () {
173
-    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
173
+    this.setState({ dataSource: { records: [] } })
174
+    this.props.onCancel()
174
   }
175
   }
175
 
176
 
176
   // 弹框取消按钮
177
   // 弹框取消按钮
177
   handleCancel () {
178
   handleCancel () {
178
-    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
179
+    this.setState({ dataSource: { records: [] } })
180
+    this.props.onCancel()
179
   }
181
   }
180
 
182
 
181
   getList (params) {
183
   getList (params) {
182
-    const { customerId } = this.props.visibleData
183
-    if (customerId === '' || customerId === undefined) {
184
+    const { id } = params
185
+    console.log(id)
186
+    if (id === '' || id === undefined) {
184
       return
187
       return
185
     }
188
     }
186
     request({ ...apis.customer.InviteClientsList, params: { ...params } }).then(res => {
189
     request({ ...apis.customer.InviteClientsList, params: { ...params } }).then(res => {
187
       this.setState({ dataSource: res })
190
       this.setState({ dataSource: res })
188
     }).catch(err => {
191
     }).catch(err => {
189
       // eslint-disable-next-line no-unused-expressions
192
       // eslint-disable-next-line no-unused-expressions
190
-      <Alert
191
-        style={{
192
-          marginBottom: 24,
193
-        }}
194
-        message={err}
195
-        type="error"
196
-        showIcon
197
-      />
193
+    
198
     })
194
     })
199
   }
195
   }
200
 
196
 
236
     return (
232
     return (
237
       <>
233
       <>
238
         <Modal
234
         <Modal
239
-          title="推荐客户"
235
+          title="邀请经纪人"
240
           destroyOnClose="true"
236
           destroyOnClose="true"
241
           width={900}
237
           width={900}
242
           footer={null}
238
           footer={null}
451
         导出
447
         导出
452
       </Button>
448
       </Button>
453
       <Table rowKey="independentIndex" dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
449
       <Table rowKey="independentIndex" dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
454
-      {/* 调整归属 */}
450
+      {/* 推荐客户 */}
455
       <ModalTable visibleData={gVisibleData} />
451
       <ModalTable visibleData={gVisibleData} />
456
-      <InviteTable visibleData={gInviteData} />
452
+
453
+      {/* 邀请经纪人 */}
454
+      <InviteTable visibleData={gInviteData} onCancel={() => setGInviteData({ visible: false, customerId: '', realtyConsultant: '' })} />
457
     </>
455
     </>
458
   );
456
   );
459
 }
457
 }

+ 50
- 26
src/pages/customer/recommendCustomer/audit.jsx 查看文件

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Upload, message } from 'antd';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Upload, message, notification } from 'antd';
3
 import ImageUpload from '../../../components/XForm/ImageUpload';
3
 import ImageUpload from '../../../components/XForm/ImageUpload';
4
 import moment from 'moment';
4
 import moment from 'moment';
5
 import request from '../../../utils/request';
5
 import request from '../../../utils/request';
7
 import Styles from './style.less';
7
 import Styles from './style.less';
8
 import { router } from 'umi';
8
 import { router } from 'umi';
9
 
9
 
10
+import Attribution from './components/attribution'
11
+
10
 const { Option } = Select;
12
 const { Option } = Select;
11
 // eslint-disable-next-line @typescript-eslint/no-unused-vars
13
 // eslint-disable-next-line @typescript-eslint/no-unused-vars
12
 const { Meta } = Card;
14
 const { Meta } = Card;
24
   },
26
   },
25
 };
27
 };
26
 
28
 
29
+const openNotificationWithIcon = (type, message) => {
30
+  notification[type]({
31
+    message,
32
+    description:
33
+      '',
34
+  });
35
+}
36
+
27
 function body(props) {
37
 function body(props) {
28
   const { getFieldDecorator } = props.form
38
   const { getFieldDecorator } = props.form
29
 
39
 
40
+  // eslint-disable-next-line react-hooks/rules-of-hooks
41
+  const [visibleData, setVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '' })
42
+
30
   // eslint-disable-next-line react-hooks/rules-of-hooks
43
   // eslint-disable-next-line react-hooks/rules-of-hooks
31
   const [dataSource, setDataSource] = useState({ picture: '' })
44
   const [dataSource, setDataSource] = useState({ picture: '' })
32
 
45
 
49
 
62
 
50
   function submitDate(params) {
63
   function submitDate(params) {
51
     // props.form.setFieldsValue(res)
64
     // props.form.setFieldsValue(res)
52
-    request({ ...apis.customer.auto, urlData: { id: params.customerId }, params: { verifyStatus: params.verifyStatus } }).then(() => {
65
+    request({ ...apis.customer.auto, urlData: { id: params.customerId || props.form.getFieldValue('customerId') }, params: { verifyStatus: params.verifyStatus } }).then(() => {
53
       // eslint-disable-next-line no-unused-expressions
66
       // eslint-disable-next-line no-unused-expressions
54
-      <Alert
55
-        style={{
56
-          marginBottom: 24,
57
-        }}
58
-        message="操作成功"
59
-        type="success"
60
-        showIcon
61
-      />
67
+      openNotificationWithIcon('success', '操作成功')
62
       router.go(-1)
68
       router.go(-1)
63
     }).catch(err => {
69
     }).catch(err => {
64
       // eslint-disable-next-line no-unused-expressions
70
       // eslint-disable-next-line no-unused-expressions
65
-      <Alert
66
-        style={{
67
-          marginBottom: 24,
68
-        }}
69
-        message={err}
70
-        type="error"
71
-        showIcon
72
-      />
71
+
73
     })
72
     })
74
   }
73
   }
75
 
74
 
89
     console.log(e)
88
     console.log(e)
90
   }
89
   }
91
 
90
 
91
+  // 显示选择置业顾问的窗口
92
+  function showConsultant() {
93
+    setVisibleData({ visible: true, customerId: props.form.getFieldValue('customerId'), realtyConsultant: props.form.getFieldValue('realtyConsultant') })
94
+  }
95
+
96
+  // 关闭选择置业顾问的窗口
97
+  function closeConsultant() {
98
+    setVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
99
+  }
100
+
101
+  // 选择置业顾问弹窗
102
+  function consultantSuccess(e) {
103
+    props.form.setFieldsValue({ realtyConsultant: e.realtyConsultant, consultantName: e.name })
104
+  }
105
+
92
   return (
106
   return (
93
     <>
107
     <>
94
       <Form {...tailFormItemLayout} onSubmit={e => handleSubmit(e)} style={{ width: '800px', margin: 'auto' }}>
108
       <Form {...tailFormItemLayout} onSubmit={e => handleSubmit(e)} style={{ width: '800px', margin: 'auto' }}>
99
             />,
113
             />,
100
           )}
114
           )}
101
         </Form.Item>
115
         </Form.Item>
116
+        <Form.Item label="归属人" style={{ display: 'none' }}>
117
+          {getFieldDecorator('realtyConsultant')(
118
+            <Input
119
+              placeholder="归属人"
120
+            />,
121
+          )}
122
+        </Form.Item>
102
         <Form.Item label="意向项目:">
123
         <Form.Item label="意向项目:">
103
           {getFieldDecorator('intention')(
124
           {getFieldDecorator('intention')(
104
             <Input
125
             <Input
159
             <DatePicker showTime placeholder="报备日期" />,
180
             <DatePicker showTime placeholder="报备日期" />,
160
           )}
181
           )}
161
         </Form.Item>
182
         </Form.Item>
162
-        <Form.Item label="状态">
183
+        {/* <Form.Item label="状态">
163
           {getFieldDecorator('verifyStatus')(
184
           {getFieldDecorator('verifyStatus')(
164
             <Select style={{ width: '180px' }} placeholder="状态" onChange={handleSelectChange}>
185
             <Select style={{ width: '180px' }} placeholder="状态" onChange={handleSelectChange}>
165
               <Option value={0}>未通过</Option>
186
               <Option value={0}>未通过</Option>
167
               <Option value={2}>已驳回</Option>
188
               <Option value={2}>已驳回</Option>
168
             </Select>,
189
             </Select>,
169
           )}
190
           )}
170
-        </Form.Item>
191
+        </Form.Item> */}
171
         <Form.Item label="归属置业顾问">
192
         <Form.Item label="归属置业顾问">
172
             <Row gutter={8}>
193
             <Row gutter={8}>
173
               <Col span={12}>
194
               <Col span={12}>
174
-                {getFieldDecorator('consultantName')(<Input placeholder="归属置业顾问" />)}
195
+                {getFieldDecorator('consultantName')(<Input placeholder="请选择置业顾问" />)}
175
               </Col>
196
               </Col>
176
               <Col span={12}>
197
               <Col span={12}>
177
-                <Button>选择</Button>
198
+                <Button onClick={() => showConsultant()}>选择</Button>
178
               </Col>
199
               </Col>
179
             </Row>
200
             </Row>
180
         </Form.Item>
201
         </Form.Item>
181
         <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
202
         <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
182
-          <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
183
-            确定
203
+          <Button type="primary" className={Styles.SubmitButton} onClick={() => submitDate({ verifyStatus: '1' })}>
204
+            审核通过
184
           </Button>
205
           </Button>
185
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
206
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
186
-          <Button onClick={() => router.go(-1)}>
187
-            取消
207
+          <Button onClick={() => submitDate({ verifyStatus: '2' })}>
208
+            驳回
188
           </Button>
209
           </Button>
189
         </Form.Item>
210
         </Form.Item>
190
       </Form>
211
       </Form>
212
+
213
+      {/* 选择置业顾问 */}
214
+      <Attribution visibleData={visibleData} onCancel={() => closeConsultant()} onSuccess={e => consultantSuccess(e)}/>
191
     </>
215
     </>
192
   );
216
   );
193
 }
217
 }

+ 141
- 0
src/pages/customer/recommendCustomer/components/attribution.jsx 查看文件

1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions, notification } from 'antd';
3
+import moment from 'moment';
4
+import request from '../../../../utils/request';
5
+import apis from '../../../../services/apis';
6
+import Styles from '../style.less';
7
+
8
+
9
+const { Option } = Select;
10
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
11
+const { Meta } = Card;
12
+
13
+/**
14
+ * 调整归属
15
+ *
16
+ * @param {*} props
17
+ * @returns
18
+ */
19
+class ModalAttribution extends React.Component {
20
+  constructor(props) {
21
+    super(props);
22
+    this.state = {
23
+       dataSource: { records: [] },
24
+       visibleData: { visible: false, customerId: '', realtyConsultant: '' },
25
+    }
26
+  }
27
+
28
+  // 挂载之后
29
+  componentDidMount() {
30
+    this.getList({ pageNumber: 1, pageSize: 5 })
31
+  }
32
+
33
+  componentDidUpdate(preProps, preState) {
34
+    if (this.props.visibleData.visible !== preState.visibleData.visible) {
35
+      this.getList({ pageNumber: 1, pageSize: 5 })
36
+      this.setState({ visibleData: this.props.visibleData });
37
+    }
38
+  }
39
+
40
+  // 弹框确定按钮
41
+  // eslint-disable-next-line react/sort-comp
42
+  handleOk() {
43
+    this.props.onCancel()
44
+  }
45
+
46
+  // 弹框取消按钮
47
+  handleCancel() {
48
+    this.props.onCancel()
49
+  }
50
+
51
+  getList(params) {
52
+    // 网路请求
53
+    request({ ...apis.customer.consultant, params: { ...params } }).then(res => {
54
+      this.setState({ dataSource: res })
55
+    }).catch(err => {
56
+      // eslint-disable-next-line no-unused-expressions
57
+
58
+    })
59
+  }
60
+
61
+  openNotificationWithIcon = (type, message) => {
62
+    notification[type]({
63
+      message,
64
+      description:
65
+        '',
66
+    });
67
+  };
68
+
69
+   // 分页
70
+  onChange(pageNum) {
71
+    this.getList({ pageNumber: pageNum, pageSize: 5 })
72
+  }
73
+
74
+  // 提交
75
+  submitGm(record) {
76
+    // 网路请求
77
+    request({ ...apis.customer.recommendEdit, urlData: { id: this.state.visibleData.customerId }, data: { customerId: this.state.visibleData.customerId, realtyConsultant: record.personId } }).then(res => {
78
+      // eslint-disable-next-line no-unused-expressions
79
+      this.openNotificationWithIcon('success', '操作成功')
80
+      this.handleCancel()
81
+      this.props.onSuccess({ realtyConsultant: record.personId, name: record.name })
82
+    }).catch(err => {
83
+      // eslint-disable-next-line no-unused-expressions
84
+      // this.openNotificationWithIcon('error', err)
85
+    })
86
+  }
87
+
88
+  render() {
89
+    const columns = [
90
+      // {
91
+      //   title: '编号',
92
+      //   dataIndex: 'personId',
93
+      //   key: 'personId',
94
+      // },
95
+      {
96
+        title: '姓名',
97
+        dataIndex: 'name',
98
+        key: 'name',
99
+      },
100
+      {
101
+        title: '电话',
102
+        dataIndex: 'phone',
103
+        key: 'phone',
104
+      },
105
+      {
106
+        title: '部门',
107
+        dataIndex: 'department',
108
+        key: 'department',
109
+      },
110
+      {
111
+        title: '岗位',
112
+        dataIndex: 'post',
113
+        key: 'post',
114
+      },
115
+      {
116
+        title: '操作',
117
+        dataIndex: 'personId',
118
+        key: 'personId',
119
+        // eslint-disable-next-line no-nested-ternary
120
+        render: (_, record) => <>{ this.props.visibleData.realtyConsultant !== record.personId && <Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>,
121
+      },
122
+    ]
123
+    return (
124
+      <>
125
+        <Modal
126
+            title="选择置业顾问"
127
+            width={800}
128
+            destroyOnClose="true"
129
+            footer={null}
130
+            visible={this.state.visibleData.visible}
131
+            // onOk={() => this.handleOk()}
132
+            onCancel={(e) => this.handleCancel(e)}
133
+          >
134
+            <Table rowKey="attribution" dataSource={this.state.dataSource.records} columns={columns} pagination={{ total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
135
+          </Modal>
136
+      </>
137
+    );
138
+  }
139
+}
140
+
141
+export default ModalAttribution

+ 2
- 2
src/pages/customer/recommendCustomer/index.jsx 查看文件

160
       title: '状态',
160
       title: '状态',
161
       dataIndex: 'verifyStatus',
161
       dataIndex: 'verifyStatus',
162
       key: 'verifyStatus',
162
       key: 'verifyStatus',
163
-      render: (_, record) => <><span>{ record.verifyStatus === 0 ? '未通过': record.verifyStatus === 1 ? '已通过' : record.verifyStatus === 2 ? '已驳回' : '' }</span></>,
163
+      render: (_, record) => <><span>{ record.verifyStatus === 0 ? '待审核': record.verifyStatus === 1 ? '已通过' : record.verifyStatus === 2 ? '已驳回' : '' }</span></>,
164
     },
164
     },
165
     {
165
     {
166
       title: '操作',
166
       title: '操作',
170
         <>
170
         <>
171
           {
171
           {
172
             <AuthButton name="admin.customer.recommend.verify.id.put" noRight={null}>
172
             <AuthButton name="admin.customer.recommend.verify.id.put" noRight={null}>
173
-              {record.verifyStatus === null ? <span style={{ color: 'rgba(239,39,58,1)',cursor: 'pointer' }} onClick={() => toAudit(record.customerId)}>审核</span> : ''}
173
+              {record.verifyStatus === 0 ? <span style={{ color: 'rgba(239,39,58,1)',cursor: 'pointer' }} onClick={() => toAudit(record.customerId)}>审核</span> : ''}
174
             </AuthButton>
174
             </AuthButton>
175
           }
175
           }
176
         </>
176
         </>

+ 14
- 5
src/pages/news/type/NewsType.jsx 查看文件

114
       ),
114
       ),
115
     },
115
     },
116
   ];
116
   ];
117
+  function handleReset() {
118
+    props.form.resetFields();
119
+    getList({ pageNum: 1, pageSize: 10 })
120
+  }
117
 
121
 
118
   const { getFieldDecorator } = props.form
122
   const { getFieldDecorator } = props.form
119
   return (
123
   return (
121
     <>
125
     <>
122
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
126
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
123
         <Form.Item>
127
         <Form.Item>
124
-          {getFieldDecorator('status')(
125
-            <Select style={{ width: '180px' }} placeholder="请选择">
126
-              <Option value="1">已上架</Option>
127
-              <Option value="0">已下架</Option>
128
-            </Select>,
128
+          {getFieldDecorator('buildingId')(
129
+            <BuildSelect />,
129
           )}
130
           )}
130
         </Form.Item>
131
         </Form.Item>
132
+        <Form.Item>
133
+            <Button type="primary" htmlType="submit" >
134
+              查询
135
+            </Button>
136
+            <Button style={{ marginLeft: 8 }} onClick={handleReset}>
137
+              重置
138
+            </Button>
139
+        </Form.Item>
131
       </Form>
140
       </Form>
132
       <AuthButton name="admin.taNewsType.post" noRight={null}>
141
       <AuthButton name="admin.taNewsType.post" noRight={null}>
133
         <Button type="danger" className={styles.addBtn} onClick={toEditNews()}>新增</Button>
142
         <Button type="danger" className={styles.addBtn} onClick={toEditNews()}>新增</Button>

+ 5
- 0
src/services/apis.js 查看文件

730
   },
730
   },
731
  },
731
  },
732
  helpActivity: {
732
  helpActivity: {
733
+  effectiveList: {
734
+    url: `${prefix}/helpActivityEffective/list`,
735
+    method: 'GET',
736
+    action: 'admin.helpActivityEffective.list.get',
737
+  },
733
   list: {
738
   list: {
734
     url: `${prefix}/helpActivity/list`,
739
     url: `${prefix}/helpActivity/list`,
735
     method: 'GET',
740
     method: 'GET',