张延森 5 년 전
부모
커밋
057ff529ca

+ 0
- 1
package.json 파일 보기

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

+ 12
- 0
src/components/Wangedit/Wangedit.jsx 파일 보기

@@ -73,6 +73,18 @@ class Wangedit extends React.Component {
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 90
 export default Wangedit

+ 0
- 16
src/pages/activity/ActivityList.jsx 파일 보기

@@ -3,7 +3,6 @@ import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagina
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import router from 'umi/router';
5 5
 import moment from 'moment';
6
-// import QRCode from 'qrcodejs2'
7 6
 import styles from '../style/GoodsList.less';
8 7
 import SelectCity from '../../components/SelectButton/CitySelect'
9 8
 import BuildSelect from '../../components/SelectButton/BuildSelect'
@@ -59,21 +58,6 @@ const header = props => {
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,7 +13,7 @@ import AuthButton from '../../../components/AuthButton';
13 13
 const data = []
14 14
 
15 15
 const header = (props) => {
16
-  const drainageId = props.location.query.drainageId
16
+  const { drainageId, name } = props.location.query
17 17
 
18 18
 
19 19
   const [datas, setDatas] = useState([])
@@ -36,15 +36,14 @@ const header = (props) => {
36 36
       console.log(data, '3333333333333')
37 37
       if (data.total != 0) {
38 38
         setTotal(data)
39
-        // console.log(data.total, '3333333333333')
40
-
41 39
         setDatas(tableData(data.records))
42 40
         // content = data.records[0]
43 41
         console.log('json: ', eval('(' + data.records[0].content + ')'))
44 42
         setContent(eval('(' + data.records[0].content + ')'))
45
-        setColumns(tableTitle(eval('(' + data.records[0].content + ')')))
43
+        setColumns(tableTitle(data.records))
46 44
       }
47 45
       else {
46
+        setDatas([])
48 47
         message.info('数据为空')
49 48
       }
50 49
 
@@ -56,11 +55,13 @@ const header = (props) => {
56 55
     })
57 56
   }
58 57
   function tableData (data) {
59
-    console.log('data', data)
58
+    console.log('tabledata', data)
60 59
     return data.map((row, inx) => {
61 60
       return eval('(' + row.content + ')').reduce((acc, col) => {
62 61
         const r = {
62
+
63 63
           key: inx + 1,
64
+          createDate:row.createDate,
64 65
           [`${col.key}`]: col.value,
65 66
           ...acc,
66 67
         }
@@ -71,14 +72,21 @@ const header = (props) => {
71 72
   }
72 73
 
73 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 83
       const col = {
76 84
         title: item.label,
77 85
         dataIndex: item.key,
78 86
         key: item.key
79 87
       }
80 88
       return col
81
-    })
89
+    }))
82 90
   }
83 91
 
84 92
 
@@ -105,7 +113,7 @@ const header = (props) => {
105 113
 
106 114
   function excelPort () {
107 115
     // const fieldsValue = getFieldsValue()
108
-    console.log("111111")
116
+  
109 117
     request({ ...apis.activity.exporttaDrainageRecord, params: { drainageId: drainageId, startTime: fromTime(startDate), endTime: fromTime(endDate) } })
110 118
       .then(response => {
111 119
         download(response)
@@ -148,14 +156,18 @@ const header = (props) => {
148 156
       </Button>
149 157
 
150 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 168
         <Table columns={columns} dataSource={datas} pagination={false} />
156 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 171
         </div>
160 172
       </div>
161 173
 

+ 4
- 4
src/pages/activity/drainage/DrainageList.jsx 파일 보기

@@ -9,12 +9,12 @@ import XForm, { FieldTypes } from '../../../components/XForm';
9 9
 import moment from 'moment';
10 10
 import AuthButton from '../../../components/AuthButton';
11 11
 
12
-const toEditList = (drainageId) => () => {
13
-  console.log(drainageId, '12344567')
12
+const toEditList = (row) => () => {
14 13
   router.push({
15 14
     pathname: '/activity/drainage/Detail',
16 15
     query: {
17
-      drainageId
16
+      drainageId: row.drainageId,
17
+      name: row.name,
18 18
     },
19 19
   });
20 20
 }
@@ -142,7 +142,7 @@ const header = (props) => {
142 142
       render: (text, datas) => (
143 143
         <>
144 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 147
             </span>
148 148
           </AuthButton>

+ 2
- 2
src/pages/activity/groupActivity/helpRecord.jsx 파일 보기

@@ -206,8 +206,8 @@ class Verifier extends React.Component {
206 206
           // onOk={() => this.handleOk()}
207 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 211
           </div>
212 212
         </Modal>
213 213
       </>

+ 2
- 2
src/pages/activity/helpActivity/helpRecord.jsx 파일 보기

@@ -217,8 +217,8 @@ class Verifier extends React.Component {
217 217
           // onOk={() => this.handleOk()}
218 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 222
           </div>
223 223
         </Modal>
224 224
       </>

+ 3
- 2
src/pages/building/list/add/components/buildingProjectType.jsx 파일 보기

@@ -61,7 +61,7 @@ class TypeForm extends React.Component {
61 61
           position: 'relative',
62 62
           border: '1px solid #eee',
63 63
           borderRadius: '4px',
64
-          marginTop:'16px'
64
+          marginTop: '16px',
65 65
         }}>
66 66
 
67 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,6 +140,7 @@ class ProjectTypeBody extends React.Component {
140 140
     const updateProjectDate = this.updateProjectType(tempDate)
141 141
     console.log('updateProjectDate: ', updateProjectDate)
142 142
     this.setState({ data: updateProjectDate })
143
+    this.setState({ defaultCheckboxValue: updateProjectDate.map(item => item.buildingTypeId) })
143 144
   }
144 145
 
145 146
   onClose = e => {
@@ -239,7 +240,7 @@ class ProjectTypeBody extends React.Component {
239 240
           onOk={this.handleOk}
240 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 244
         </Modal>
244 245
         <Row type="flex" justify="space-between">
245 246
           {

+ 4
- 12
src/pages/customer/customerlist/components/attribution.jsx 파일 보기

@@ -31,8 +31,7 @@ class ModalAttribution extends React.Component {
31 31
   }
32 32
 
33 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 35
       this.getList({ pageNumber: 1, pageSize: 5 })
37 36
       this.setState({ visibleData: this.props.visibleData });
38 37
     }
@@ -41,12 +40,12 @@ class ModalAttribution extends React.Component {
41 40
   // 弹框确定按钮
42 41
   // eslint-disable-next-line react/sort-comp
43 42
   handleOk() {
44
-    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
43
+    this.props.onCancel()
45 44
   }
46 45
 
47 46
   // 弹框取消按钮
48 47
   handleCancel() {
49
-    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
48
+    this.props.onCancel()
50 49
   }
51 50
 
52 51
   getList(params) {
@@ -55,14 +54,7 @@ class ModalAttribution extends React.Component {
55 54
       this.setState({ dataSource: res })
56 55
     }).catch(err => {
57 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,6 +171,12 @@ function body(props) {
171 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 180
   const publicColumns = [
175 181
     {
176 182
       title: '头像',
@@ -374,7 +380,7 @@ function body(props) {
374 380
       }
375 381
       
376 382
       {/* 调整归属 */}
377
-      <Attribution visibleData={gVisibleData} />
383
+      <Attribution visibleData={gVisibleData} onCancel={() => closeAttribution()}/>
378 384
 
379 385
       {/* 积分记录 */}
380 386
       <IntegralRecord visibleData={recordVisibleData} />

+ 17
- 19
src/pages/customer/independentList/index.jsx 파일 보기

@@ -155,13 +155,13 @@ class InviteTable extends React.Component {
155 155
 
156 156
   // 挂载之后
157 157
   componentDidMount () {
158
-    const { customerId } = this.state.visibleData
159
-    this.getList({ id: customerId, pageNumber: 1, pageSize: 5 })
158
+    
160 159
   }
161 160
 
162 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 165
       this.getList({ id: customerId, pageNumber: 1, pageSize: 5 })
166 166
       this.setState({ visibleData: this.props.visibleData });
167 167
     }
@@ -170,31 +170,27 @@ class InviteTable extends React.Component {
170 170
   // 弹框确定按钮
171 171
   // eslint-disable-next-line react/sort-comp
172 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 178
   handleCancel () {
178
-    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
179
+    this.setState({ dataSource: { records: [] } })
180
+    this.props.onCancel()
179 181
   }
180 182
 
181 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 187
       return
185 188
     }
186 189
     request({ ...apis.customer.InviteClientsList, params: { ...params } }).then(res => {
187 190
       this.setState({ dataSource: res })
188 191
     }).catch(err => {
189 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,7 +232,7 @@ class InviteTable extends React.Component {
236 232
     return (
237 233
       <>
238 234
         <Modal
239
-          title="推荐客户"
235
+          title="邀请经纪人"
240 236
           destroyOnClose="true"
241 237
           width={900}
242 238
           footer={null}
@@ -451,9 +447,11 @@ function body (props) {
451 447
         导出
452 448
       </Button>
453 449
       <Table rowKey="independentIndex" dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
454
-      {/* 调整归属 */}
450
+      {/* 推荐客户 */}
455 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,5 +1,5 @@
1 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 3
 import ImageUpload from '../../../components/XForm/ImageUpload';
4 4
 import moment from 'moment';
5 5
 import request from '../../../utils/request';
@@ -7,6 +7,8 @@ import apis from '../../../services/apis';
7 7
 import Styles from './style.less';
8 8
 import { router } from 'umi';
9 9
 
10
+import Attribution from './components/attribution'
11
+
10 12
 const { Option } = Select;
11 13
 // eslint-disable-next-line @typescript-eslint/no-unused-vars
12 14
 const { Meta } = Card;
@@ -24,9 +26,20 @@ const tailFormItemLayout = {
24 26
   },
25 27
 };
26 28
 
29
+const openNotificationWithIcon = (type, message) => {
30
+  notification[type]({
31
+    message,
32
+    description:
33
+      '',
34
+  });
35
+}
36
+
27 37
 function body(props) {
28 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 43
   // eslint-disable-next-line react-hooks/rules-of-hooks
31 44
   const [dataSource, setDataSource] = useState({ picture: '' })
32 45
 
@@ -49,27 +62,13 @@ function body(props) {
49 62
 
50 63
   function submitDate(params) {
51 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 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 68
       router.go(-1)
63 69
     }).catch(err => {
64 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,6 +88,21 @@ function body(props) {
89 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 106
   return (
93 107
     <>
94 108
       <Form {...tailFormItemLayout} onSubmit={e => handleSubmit(e)} style={{ width: '800px', margin: 'auto' }}>
@@ -99,6 +113,13 @@ function body(props) {
99 113
             />,
100 114
           )}
101 115
         </Form.Item>
116
+        <Form.Item label="归属人" style={{ display: 'none' }}>
117
+          {getFieldDecorator('realtyConsultant')(
118
+            <Input
119
+              placeholder="归属人"
120
+            />,
121
+          )}
122
+        </Form.Item>
102 123
         <Form.Item label="意向项目:">
103 124
           {getFieldDecorator('intention')(
104 125
             <Input
@@ -159,7 +180,7 @@ function body(props) {
159 180
             <DatePicker showTime placeholder="报备日期" />,
160 181
           )}
161 182
         </Form.Item>
162
-        <Form.Item label="状态">
183
+        {/* <Form.Item label="状态">
163 184
           {getFieldDecorator('verifyStatus')(
164 185
             <Select style={{ width: '180px' }} placeholder="状态" onChange={handleSelectChange}>
165 186
               <Option value={0}>未通过</Option>
@@ -167,27 +188,30 @@ function body(props) {
167 188
               <Option value={2}>已驳回</Option>
168 189
             </Select>,
169 190
           )}
170
-        </Form.Item>
191
+        </Form.Item> */}
171 192
         <Form.Item label="归属置业顾问">
172 193
             <Row gutter={8}>
173 194
               <Col span={12}>
174
-                {getFieldDecorator('consultantName')(<Input placeholder="归属置业顾问" />)}
195
+                {getFieldDecorator('consultantName')(<Input placeholder="请选择置业顾问" />)}
175 196
               </Col>
176 197
               <Col span={12}>
177
-                <Button>选择</Button>
198
+                <Button onClick={() => showConsultant()}>选择</Button>
178 199
               </Col>
179 200
             </Row>
180 201
         </Form.Item>
181 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 205
           </Button>
185 206
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
186
-          <Button onClick={() => router.go(-1)}>
187
-            取消
207
+          <Button onClick={() => submitDate({ verifyStatus: '2' })}>
208
+            驳回
188 209
           </Button>
189 210
         </Form.Item>
190 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 파일 보기

@@ -0,0 +1,141 @@
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,7 +160,7 @@ function body(props) {
160 160
       title: '状态',
161 161
       dataIndex: 'verifyStatus',
162 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 166
       title: '操作',
@@ -170,7 +170,7 @@ function body(props) {
170 170
         <>
171 171
           {
172 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 174
             </AuthButton>
175 175
           }
176 176
         </>

+ 14
- 5
src/pages/news/type/NewsType.jsx 파일 보기

@@ -114,6 +114,10 @@ function header(props) {
114 114
       ),
115 115
     },
116 116
   ];
117
+  function handleReset() {
118
+    props.form.resetFields();
119
+    getList({ pageNum: 1, pageSize: 10 })
120
+  }
117 121
 
118 122
   const { getFieldDecorator } = props.form
119 123
   return (
@@ -121,13 +125,18 @@ function header(props) {
121 125
     <>
122 126
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
123 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 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 140
       </Form>
132 141
       <AuthButton name="admin.taNewsType.post" noRight={null}>
133 142
         <Button type="danger" className={styles.addBtn} onClick={toEditNews()}>新增</Button>

+ 5
- 0
src/services/apis.js 파일 보기

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