zlisen 3 vuotta sitten
vanhempi
commit
a7aaadc5d6

+ 24
- 5
config/routes.js Näytä tiedosto

@@ -108,17 +108,31 @@ export default [
108 108
                 hideInMenu: true,
109 109
                 component: './customer/Customer/PublicCustomer/publicCustomerDetail',
110 110
               },
111
+
112
+               {
113
+                path: '/customer/recommend/channel',
114
+                name: '经纪人报备',
115
+                component: './recommend/channel',
116
+              },
111 117
               {
112
-                path: '/customer/recommend/list',
113
-                name: '推荐记录',
114
-                component: './customer/Recommend',
118
+                path: '/customer/recommend/channel/audit',
119
+                name: '到访确认',
120
+                hideInMenu: true,
121
+                component: './recommend/channel/audit',
115 122
               },
116 123
               {
117
-                path: '/customer/recommend/audit',
124
+                path: '/customer/recommend/customer',
125
+                name: '普通客户推荐',
126
+                component: './recommend/customer',
127
+              },
128
+              {
129
+                path: '/customer/recommend/customer/audit',
118 130
                 name: '客户审核',
119 131
                 hideInMenu: true,
120
-                component: './customer/Recommend/audit',
132
+                component: './recommend/customer/audit',
121 133
               },
134
+
135
+             
122 136
             ],
123 137
           },
124 138
 
@@ -582,6 +596,11 @@ export default [
582 596
                 path: '/findRoom/setting',
583 597
                 name: '回访设置',
584 598
                 component: './findRoom/setting',
599
+              },
600
+               {
601
+                path: '/findRoom/messageList',
602
+                name: '客户留言',
603
+                component: './system/messageList',
585 604
               },
586 605
               // {
587 606
               //   path: '/home/recommend/auditcopy',

+ 4
- 1
src/components/SelectButton/BuildSelect2.jsx Näytä tiedosto

@@ -22,6 +22,7 @@ function usePrevious(props) {
22 22
 const BuildingSelect2 = props => {
23 23
   const [data, setData] = useState([])
24 24
   const [value, setValue] = useState([])
25
+  const {cityId,disabled=false} = props
25 26
   console.log('props', props.cityId);
26 27
   useEffect(() => {
27 28
     getBuildList();
@@ -67,7 +68,9 @@ const BuildingSelect2 = props => {
67 68
       onChange={ onChange}
68 69
       filterOption={(input, option) =>
69 70
         option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
70
-      }>
71
+      }
72
+      disabled={disabled}
73
+      >
71 74
       {data.map(building => (
72 75
         <Option key={building.buildingId} value={building.buildingId}>{building.buildingName}</Option>
73 76
       ))}

+ 3
- 1
src/components/SelectButton/channelSelect.jsx Näytä tiedosto

@@ -13,6 +13,7 @@ const { Option } = Select;
13 13
  */
14 14
 const ChannelSelect = props => {
15 15
   const [data, setData] = useState([])
16
+  const {disabled=false}=props
16 17
   useEffect(() => {
17 18
     getChannelSelect();
18 19
   }, [props.value])
@@ -36,7 +37,8 @@ const ChannelSelect = props => {
36 37
       onChange={props.onChange}
37 38
       filterOption={(input, option) =>
38 39
         option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
39
-      }>
40
+      }
41
+      disabled={disabled}>
40 42
       {all && <Option key="" value="">全部渠道</Option>}
41 43
       {data.map(Item => (
42 44
         <Option key={Item.channelId} value={Item.channelId}> {Item.channelName} </Option>

+ 1
- 1
src/components/SelectButton/consultantSelect.jsx Näytä tiedosto

@@ -37,7 +37,7 @@ const ChannelSelect = props => {
37 37
         option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
38 38
       }>
39 39
       {data.map(Item => (
40
-        <Option key={Item.userId} value={Item.userId}> {Item.userName} </Option>
40
+        <Option key={Item.userId} value={`${Item.userId}`}> {Item.userName} </Option>
41 41
       ))}
42 42
     </Select>
43 43
   )

+ 2
- 2
src/pages/Live/LiveActivity/Edit/index.jsx Näytä tiedosto

@@ -78,12 +78,12 @@ function EditHouse(props) {
78 78
         <TabPane tab="基本信息" key="1">
79 79
           <Base liveActivityId={{ liveId }} onSuccess={e => buildingOnSuccess(e)} />
80 80
         </TabPane>
81
-        <TabPane tab="海报设置" key="2">
81
+        {/* <TabPane tab="海报设置" key="2">
82 82
           <Poster liveActivityId={{ liveId }} />
83 83
         </TabPane>
84 84
         <TabPane tab="分享设置" key="3">
85 85
           <Share liveActivityId={{ liveId }} />
86
-        </TabPane>
86
+        </TabPane> */}
87 87
         <TabPane tab="分享记录" key="4">
88 88
           <ShareRecord liveActivityId={{ liveId }} />
89 89
         </TabPane>

+ 2
- 2
src/pages/activity/SignupActivity/detail.jsx Näytä tiedosto

@@ -237,12 +237,12 @@ const Edit = props => {
237 237
         <TabPane tab="基础信息" key="1">
238 238
           <Basic dynamicId={dynamicId} detailData={detailData} />
239 239
         </TabPane>
240
-        <TabPane tab="海报图片" key="2">
240
+        {/* <TabPane tab="海报图片" key="2">
241 241
           <Poster target={target} />
242 242
         </TabPane>
243 243
         <TabPane tab="分享设置" key="3">
244 244
           <Share target={target} />
245
-        </TabPane>
245
+        </TabPane> */}
246 246
       </Tabs>
247 247
     </Card>
248 248
   );

+ 2
- 2
src/pages/activity/SignupActivity/edit/index.jsx Näytä tiedosto

@@ -24,12 +24,12 @@ const Edit = props => {
24 24
         <TabPane tab="基础信息" key="1">
25 25
           <Basic dynamicId={dynamicId} type={type}/>
26 26
         </TabPane>
27
-        <TabPane tab="海报图片" key="2">
27
+        {/* <TabPane tab="海报图片" key="2">
28 28
           <Poster target={target} />
29 29
         </TabPane>
30 30
         <TabPane tab="分享设置" key="3">
31 31
           <Share target={target} />
32
-        </TabPane>
32
+        </TabPane> */}
33 33
       </Tabs>
34 34
     </Card>
35 35
   );

+ 2
- 2
src/pages/activity/groupRoomActivity/detail.jsx Näytä tiedosto

@@ -237,8 +237,8 @@ const Edit = props => {
237 237
       <div>
238 238
         <Radio.Group value={tab} buttonStyle="solid" onChange={e => changeTab(e.target.value)}>
239 239
           <Radio.Button value="basic">基本信息</Radio.Button>
240
-          <Radio.Button value="poster">海报图片</Radio.Button>
241
-          <Radio.Button value="share">分享设置</Radio.Button>
240
+          {/* <Radio.Button value="poster">海报图片</Radio.Button>
241
+          <Radio.Button value="share">分享设置</Radio.Button> */}
242 242
         </Radio.Group>
243 243
       </div>
244 244
       <div>

+ 2
- 2
src/pages/activity/groupRoomActivity/edit/index.jsx Näytä tiedosto

@@ -21,8 +21,8 @@ const Edit = props => {
21 21
       <div>
22 22
         <Radio.Group value={tab} buttonStyle="solid" onChange={e => changeTab(e.target.value)}>
23 23
           <Radio.Button value="basic">基本信息</Radio.Button>
24
-          <Radio.Button value="poster">海报图片</Radio.Button>
25
-          <Radio.Button value="share">分享设置</Radio.Button>
24
+          {/* <Radio.Button value="poster">海报图片</Radio.Button>
25
+          <Radio.Button value="share">分享设置</Radio.Button> */}
26 26
         </Radio.Group>
27 27
       </div>
28 28
       <div>

+ 2
- 2
src/pages/activity/lookHouseActivity/detail.jsx Näytä tiedosto

@@ -237,8 +237,8 @@ const Edit = props => {
237 237
       <div>
238 238
         <Radio.Group value={tab} buttonStyle="solid" onChange={e => changeTab(e.target.value)}>
239 239
           <Radio.Button value="basic">基本信息</Radio.Button>
240
-          <Radio.Button value="poster">海报图片</Radio.Button>
241
-          <Radio.Button value="share">分享设置</Radio.Button>
240
+          {/* <Radio.Button value="poster">海报图片</Radio.Button>
241
+          <Radio.Button value="share">分享设置</Radio.Button> */}
242 242
         </Radio.Group>
243 243
       </div>
244 244
       <div>

+ 2
- 2
src/pages/activity/lookHouseActivity/edit/index.jsx Näytä tiedosto

@@ -21,8 +21,8 @@ const Edit = props => {
21 21
       <div>
22 22
         <Radio.Group value={tab} buttonStyle="solid" onChange={e => changeTab(e.target.value)}>
23 23
           <Radio.Button value="basic">基本信息</Radio.Button>
24
-          <Radio.Button value="poster">海报图片</Radio.Button>
25
-          <Radio.Button value="share">分享设置</Radio.Button>
24
+          {/* <Radio.Button value="poster">海报图片</Radio.Button>
25
+          <Radio.Button value="share">分享设置</Radio.Button> */}
26 26
         </Radio.Group>
27 27
       </div>
28 28
       <div>

+ 4
- 4
src/pages/news/list/Edit.jsx Näytä tiedosto

@@ -36,12 +36,12 @@ export default props => {
36 36
 
37 37
   return (
38 38
     <Card>
39
-      <Tabs defaultActiveKey="1">
40
-        <TabPane tab="基本信息" key="1">
39
+      {/* <Tabs defaultActiveKey="1">
40
+        <TabPane tab="基本信息" key="1"> */}
41 41
           {/* <div style={{ maxWidth: 1000 }}> */}
42 42
             <Basic newsId={newsId} />
43 43
           {/* </div> */}
44
-        </TabPane>
44
+        {/* </TabPane>
45 45
 
46 46
         <TabPane tab="海报图片" key="2">
47 47
         <Poster target={target} />
@@ -50,7 +50,7 @@ export default props => {
50 50
         <TabPane tab="分享设置" key="3">
51 51
         <Share target={target} />
52 52
         </TabPane>
53
-      </Tabs>
53
+      </Tabs> */}
54 54
     </Card>
55 55
   );
56 56
 };

+ 83
- 93
src/pages/recommend/channel/audit.jsx Näytä tiedosto

@@ -1,12 +1,16 @@
1 1
 import React, { useState, useEffect } from 'react';
2 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 4
 import moment from 'moment';
5 5
 import request from '../../../utils/request';
6 6
 import apis from '../../../services/apis';
7 7
 import { router } from 'umi';
8 8
 
9 9
 import Attribution from './components/attribution'
10
+import BuildingSelect from '@/components/SelectButton/BuildSelect2';
11
+import ConsultantSelect from '@/components/SelectButton/consultantSelect';
12
+import ChannelSelect from '@/components/SelectButton/channelSelect';
13
+
10 14
 
11 15
 const { TextArea } = Input;
12 16
 
@@ -36,7 +40,7 @@ function body(props) {
36 40
   const [visibleData, setVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
37 41
 
38 42
   // eslint-disable-next-line react-hooks/rules-of-hooks
39
-  const [dataSource, setDataSource] = useState({ picture: '' })
43
+  const [data, setData] = useState({})
40 44
 
41 45
   const { id } = props.location.query;
42 46
 
@@ -49,19 +53,61 @@ function body(props) {
49 53
 
50 54
   // 获取详情信息
51 55
   function getById(currentId) {
52
-    request({ ...apis.customer.recommendGetById, urlData: { id: currentId } }).then(res => {
56
+    request({ ...apis.customer.getDetail, urlData: { id: currentId } }).then(res => {
53 57
       // res.reportDate = moment(res.reportDate)
54 58
       if(res){
55
-        props.form.setFieldsValue({...res,reportDate:moment(res.reportDate)})
59
+        let channelCustomer = {}
60
+        if(res.channelCustomer){
61
+          channelCustomer.channelId=res.channelCustomer.channelId
62
+          channelCustomer.remark=res.channelCustomer.remark
63
+          
64
+        }
65
+        if(res.customerVisit){
66
+          channelCustomer.imageUrl=res.customerVisit.imageUrl
67
+          // channelCustomer.remark=res.channelCustomer.remark
68
+          
69
+        }
70
+        
71
+        setData(res)
72
+        props.form.setFieldsValue({...res,...channelCustomer})
56 73
       }
57 74
     
58 75
     })
59 76
   }
60 77
 
61
-  function submitDate(params) {
78
+  function submitDate(data) {
62 79
     // props.form.setFieldsValue(res)
63
-    console.log(params, 'params')
64
-    request({ ...apis.customer.auto, urlData: { id: params.customerId || props.form.getFieldValue('customerId') }, params: { verifyStatus: params.verifyStatus, realtyConsultant: props.form.getFieldValue('realtyConsultant') } }).then(() => {
80
+    console.log(data, 'data')
81
+    const params ={
82
+      auditResult:data.status,
83
+      channelCustomerId:id,
84
+      realtyConsultant:props.form.getFieldValue('realtyConsultant'),
85
+      name:props.form.getFieldValue('name'),
86
+      customerVisit:{ 
87
+        imageUrl:props.form.getFieldValue('imageUrl'),
88
+      },
89
+      remark:props.form.getFieldValue('remark'),
90
+    }
91
+    // {
92
+    //   "auditResult": "string",
93
+    //   "channelCustomerId": "string",
94
+    //   "customerVisit": {
95
+    //     "buildingId": "string",
96
+    //     "createDate": "2021-07-31T16:56:21.899Z",
97
+    //     "customerId": "string",
98
+    //     "customerVisitId": "string",
99
+    //     "imageUrl": "string",
100
+    //     "name": "string",
101
+    //     "orgId": 0,
102
+    //     "realtyConsultant": "string",
103
+    //     "realtyConsultantName": "string",
104
+    //     "recommendName": "string",
105
+    //     "recommendPerson": "string",
106
+    //     "remark": "string"
107
+    //   },
108
+    //   "realtyConsultant": "string"
109
+    // }
110
+    request({ ...apis.customer.auto, urlData: { id: id }, data: { ...params }}).then(() => {
65 111
       // eslint-disable-next-line no-unused-expressions
66 112
       openNotificationWithIcon('success', '操作成功')
67 113
       router.go(-1)
@@ -76,44 +122,26 @@ function body(props) {
76 122
     e.preventDefault();
77 123
     props.form.validateFields((err, values) => {
78 124
       if (!err) {
79
-        submitDate({ verifyStatus: '1' })
125
+        submitDate({ status: '1' })
80 126
         // submitDate({ ...values })
81 127
       }
82 128
     });
83 129
   }
84 130
 
85
-  // Change 事件
86
-  function handleSelectChange(e) {
87
-    // eslint-disable-next-line no-console
88
-    console.log(e)
89
-  }
90 131
 
91
-  // 显示选择置业顾问的窗口
92
-  function showConsultant() {
93
-    setVisibleData({ visible: true, customerId: props.form.getFieldValue('customerId'), realtyConsultant: props.form.getFieldValue('realtyConsultant'), buildingId: props.form.getFieldValue('buildingId') })
94
-  }
95 132
 
96
-  // 关闭选择置业顾问的窗口
97
-  function closeConsultant() {
98
-    setVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
99
-  }
100 133
 
101
-  // 选择置业顾问弹窗
102
-  function consultantSuccess(e) {
103
-    console.log(e)
104
-    props.form.setFieldsValue({ realtyConsultant: e.realtyConsultant, consultantName: e.name })
105
-  }
106 134
 
107 135
   return (
108 136
     <Card>
109 137
       <Form {...tailFormItemLayout} onSubmit={e => handleSubmit(e)} style={{ maxWidth: '1000px' }}>
110
-        <Form.Item label="客户ID" style={{ display: 'none' }}>
111
-          {getFieldDecorator('customerId')(
138
+        {/* <Form.Item label="客户ID" style={{ display: 'none' }}>
139
+          {getFieldDecorator('channelCustomerId')(
112 140
             <Input
113 141
               placeholder="客户ID"
114 142
             />,
115 143
           )}
116
-        </Form.Item>
144
+        </Form.Item>*/}
117 145
         <Form.Item label="项目ID" style={{ display: 'none' }}>
118 146
           {getFieldDecorator('buildingId')(
119 147
             <Input
@@ -121,83 +149,45 @@ function body(props) {
121 149
             />,
122 150
           )}
123 151
         </Form.Item>
124
-        <Form.Item label="归属人" style={{ display: 'none' }}>
125
-          {getFieldDecorator('realtyConsultant')(
126
-            <Input
127
-              placeholder="归属人"
128
-            />,
129
-          )}
130
-        </Form.Item>
131 152
         <Form.Item label="意向项目:">
132
-          {getFieldDecorator('intention')(
133
-            <Input
153
+          {getFieldDecorator('buildingId')(
154
+            <BuildingSelect
155
+            disabled
134 156
               placeholder="意向项目"
157
+              style={{width:'100%'}}
135 158
             />,
136 159
           )}
137
-        </Form.Item>
138
-        <Form.Item label="客户照片">
139
-          {getFieldDecorator('picture')(
140
-            <ImageUpload value={dataSource.picture} />,
141
-          )}
142
-        </Form.Item>
160
+        </Form.Item> 
143 161
         <Form.Item label="客户姓名">
144 162
           {getFieldDecorator('name')(
145 163
             <Input placeholder="客户姓名" />,
146 164
           )}
147 165
         </Form.Item>
148
-        <Form.Item label="客户电话">
149
-          {getFieldDecorator('phone')(
150
-            <Input placeholder="客户电话" />,
166
+        <Form.Item label="归属渠道">
167
+          {getFieldDecorator('channelId')(
168
+            <ChannelSelect placeholder="归属渠道" disabled/>,
151 169
           )}
152 170
         </Form.Item>
153
-        <Form.Item label="客户性别">
154
-          {getFieldDecorator('sex')(
155
-            <Radio.Group>
156
-              <Radio value={1}>男</Radio>
157
-              <Radio value={2}>女</Radio>
158
-            </Radio.Group>,
171
+        <Form.Item label="归属置业顾问">
172
+          {getFieldDecorator('realtyConsultant')(
173
+            <ConsultantSelect placeholder="归属置业顾问" buildingId={props.form.getFieldValue('buildingId')} />,
159 174
           )}
160 175
         </Form.Item>
161
-        <Form.Item label="到访人数">
162
-          {getFieldDecorator('visiteNum')(
163
-            <Input placeholder="到访人数" />,
176
+        <Form.Item label="到访照片">
177
+          {getFieldDecorator('imageUrl')(
178
+            <ImageUpload />,
164 179
           )}
165 180
         </Form.Item>
166
-        <Form.Item label="客户描述">
167
-          {getFieldDecorator('describe')(
181
+        <Form.Item label="备注">
182
+          {getFieldDecorator('remark')(
168 183
             <TextArea placeholder="客户描述" rows={10} />,
169 184
           )}
170 185
         </Form.Item>
171
-        <Form.Item label="物业类型">
172
-          {getFieldDecorator('realtyManageType')(
173
-            <Input placeholder="物业类型" />,
174
-          )}
175
-        </Form.Item>
176
-        <Form.Item label="需求类型">
177
-          {getFieldDecorator('demandType')(
178
-            <Input placeholder="需求类型" />,
179
-          )}
180
-        </Form.Item>
181
-        <Form.Item label="价格区间">
182
-          {getFieldDecorator('priceRange')(
183
-            <Input placeholder="价格区间" />,
184
-          )}
185
-        </Form.Item>
186
-        <Form.Item label="报备日期">
187
-          {getFieldDecorator('reportDate')(
188
-            <DatePicker showTime placeholder="报备日期" />,
189
-          )}
190
-        </Form.Item>
191
-        {/* <Form.Item label="状态">
192
-          {getFieldDecorator('verifyStatus')(
193
-            <Select style={{ width: '180px' }} placeholder="状态" onChange={handleSelectChange}>
194
-              <Option value={0}>未通过</Option>
195
-              <Option value={1}>已通过</Option>
196
-              <Option value={2}>已驳回</Option>
197
-            </Select>,
198
-          )}onClick={() => submitDate({ verifyStatus: '1' })}
199
-        </Form.Item> */}
200
-        <Form.Item label="归属置业顾问"
186
+       
187
+
188
+        
189
+
190
+        {/* <Form.Item label="归属置业顾问"
201 191
       >
202 192
           <Row gutter={8}>
203 193
             <Col span={12}>
@@ -214,14 +204,14 @@ function body(props) {
214 204
               <Button onClick={() => showConsultant()}>选择</Button>
215 205
             </Col>
216 206
           </Row>
217
-        </Form.Item>
207
+        </Form.Item> */}
218 208
         <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
219
-          <Button type="primary" htmlType="submit" >
209
+          {data.status==='1'&&<><Button type="primary" htmlType="submit" >
220 210
             审核通过
221 211
           </Button>
222
-          <Button type="danger" ghost style={{marginLeft: '4em'}} onClick={() => submitDate({ verifyStatus: '2' })}>
212
+          <Button type="danger" ghost style={{marginLeft: '4em'}} onClick={() => submitDate({ status: '2' })}>
223 213
             驳回
224
-          </Button>
214
+          </Button></>}
225 215
           <Button style={{marginLeft: '4em'}} onClick={() => router.goBack(-1)}>
226 216
             取消
227 217
           </Button>
@@ -229,7 +219,7 @@ function body(props) {
229 219
       </Form>
230 220
 
231 221
       {/* 选择置业顾问 */}
232
-      <Attribution visibleData={visibleData} onCancel={() => closeConsultant()} onSuccess={e => consultantSuccess(e)} />
222
+      {/* <Attribution visibleData={visibleData} onCancel={() => closeConsultant()} onSuccess={e => consultantSuccess(e)} /> */}
233 223
     </Card>
234 224
   );
235 225
 }

+ 3
- 3
src/pages/recommend/channel/index.jsx Näytä tiedosto

@@ -21,7 +21,7 @@ function Recommend(props) {
21 21
 
22 22
   function toAudit(cuurentId) {
23 23
     router.push({
24
-      pathname: '/customer/recommend/audit',
24
+      pathname: '/customer/recommend/channel/audit',
25 25
       query: {
26 26
         id: cuurentId,
27 27
       },
@@ -105,7 +105,7 @@ function Recommend(props) {
105 105
       title: '状态',
106 106
       dataIndex: 'status',
107 107
       key: 'status',
108
-      render: (_, record) => <><span>{record.status === '1' ? '待审核' : record.status === '2' ? '已通过' : record.status === '3' ? '已驳回' : ''}</span></>,
108
+      render: (_, record) => <><span>{record.status === '1' ? '未到访' : record.status === '2' ? '已到访' : record.status === '3' ? '无效' : ''}</span></>,
109 109
     },
110 110
     {
111 111
       title: '操作',
@@ -114,7 +114,7 @@ function Recommend(props) {
114 114
       render: (_, record) => (
115 115
         <>{record.status === '1' ?<Button type='link' onClick={() => {
116 116
           toAudit(record.channelCustomerId)
117
-          }}>审核</Button>:
117
+          }}>到访确认</Button>:
118 118
           <Button type='link' onClick={() => {
119 119
             toAudit(record.channelCustomerId)
120 120
             }}>查看详情</Button>

+ 70
- 93
src/pages/recommend/customer/audit.jsx Näytä tiedosto

@@ -1,12 +1,30 @@
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, notification } from 'antd';
2
+import {
3
+  Form,
4
+  Icon,
5
+  Input,
6
+  Button,
7
+  DatePicker,
8
+  Select,
9
+  Card,
10
+  Row,
11
+  Col,
12
+  Pagination,
13
+  Alert,
14
+  Table,
15
+  Avatar,
16
+  Radio,
17
+  Upload,
18
+  message,
19
+  notification,
20
+} from 'antd';
3 21
 import ImageUpload from '../../../components/XForm/ImageUpload';
4 22
 import moment from 'moment';
5 23
 import request from '../../../utils/request';
6 24
 import apis from '../../../services/apis';
7 25
 import { router } from 'umi';
8 26
 
9
-import Attribution from './components/attribution'
27
+import Attribution from './components/attribution';
10 28
 import BuildingSelect from '@/components/SelectButton/BuildSelect2';
11 29
 import ConsultantSelect from '@/components/SelectButton/consultantSelect';
12 30
 
@@ -26,51 +44,50 @@ const tailFormItemLayout = {
26 44
 const openNotificationWithIcon = (type, message) => {
27 45
   notification[type]({
28 46
     message,
29
-    description:
30
-      '',
47
+    description: '',
31 48
   });
32
-}
49
+};
33 50
 
34 51
 function body(props) {
35
-  const { getFieldDecorator } = props.form
36
-
37
-  // eslint-disable-next-line react-hooks/rules-of-hooks
38
-  const [visibleData, setVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
39
-
40
-  // eslint-disable-next-line react-hooks/rules-of-hooks
41
-  const [dataSource, setDataSource] = useState({ picture: '' })
52
+  const { getFieldDecorator } = props.form;
42 53
 
43 54
   const { id } = props.location.query;
44 55
 
45
-  if (id !== '') {
46
-    // eslint-disable-next-line react-hooks/rules-of-hooks
47
-    useEffect(() => {
48
-      getById(id)
49
-    }, [])
50
-  }
56
+  useEffect(() => {
57
+    if (id !== '') {
58
+      getById(id);
59
+    }
60
+  }, []);
51 61
 
52 62
   // 获取详情信息
53 63
   function getById(currentId) {
54 64
     request({ ...apis.customer.getDetail, urlData: { id: currentId } }).then(res => {
55 65
       // res.reportDate = moment(res.reportDate)
56
-      if(res){
57
-        props.form.setFieldsValue({...res,reportDate:moment(res.reportDate)})
66
+      if (res) {
67
+        props.form.setFieldsValue({ ...res, reportDate: moment(res.reportDate) });
58 68
       }
59
-    
60
-    })
69
+    });
61 70
   }
62 71
 
63 72
   function submitDate(params) {
64 73
     // props.form.setFieldsValue(res)
65
-    console.log(params, 'params')
66
-    request({ ...apis.customer.auto, urlData: { id: params.customerId || props.form.getFieldValue('customerId') }, params: { verifyStatus: params.verifyStatus, realtyConsultant: props.form.getFieldValue('realtyConsultant') } }).then(() => {
67
-      // eslint-disable-next-line no-unused-expressions
68
-      openNotificationWithIcon('success', '操作成功')
69
-      router.go(-1)
70
-    }).catch(err => {
71
-      // eslint-disable-next-line no-unused-expressions
72
-
74
+    console.log(params, 'params');
75
+    request({
76
+      ...apis.customer.auto,
77
+      urlData: { id: id },
78
+      params: {
79
+        status: params.status,
80
+        realtyConsultant: props.form.getFieldValue('realtyConsultant'),
81
+      },
73 82
     })
83
+      .then(() => {
84
+        // eslint-disable-next-line no-unused-expressions
85
+        openNotificationWithIcon('success', '操作成功');
86
+        router.go(-1);
87
+      })
88
+      .catch(err => {
89
+        // eslint-disable-next-line no-unused-expressions
90
+      });
74 91
   }
75 92
 
76 93
   // 提交事件
@@ -78,75 +95,31 @@ function body(props) {
78 95
     e.preventDefault();
79 96
     props.form.validateFields((err, values) => {
80 97
       if (!err) {
81
-        submitDate({ verifyStatus: '1' })
98
+        submitDate({ status: '1' });
82 99
         // submitDate({ ...values })
83 100
       }
84 101
     });
85 102
   }
86 103
 
87
-  // Change 事件
88
-  function handleSelectChange(e) {
89
-    // eslint-disable-next-line no-console
90
-    console.log(e)
91
-  }
92
-
93
-  // 显示选择置业顾问的窗口
94
-  function showConsultant() {
95
-    setVisibleData({ visible: true, customerId: props.form.getFieldValue('customerId'), realtyConsultant: props.form.getFieldValue('realtyConsultant'), buildingId: props.form.getFieldValue('buildingId') })
96
-  }
97
-
98
-  // 关闭选择置业顾问的窗口
99
-  function closeConsultant() {
100
-    setVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
101
-  }
102
-
103
-  // 选择置业顾问弹窗
104
-  function consultantSuccess(e) {
105
-    console.log(e)
106
-    props.form.setFieldsValue({ realtyConsultant: e.realtyConsultant, consultantName: e.name })
107
-  }
108
-
109 104
   return (
110 105
     <Card>
111 106
       <Form {...tailFormItemLayout} onSubmit={e => handleSubmit(e)} style={{ maxWidth: '1000px' }}>
112 107
         {/* <Form.Item label="客户ID" style={{ display: 'none' }}>
113
-          {getFieldDecorator('customerId')(
114
-            <Input
115
-              placeholder="客户ID"
116
-            />,
117
-          )}
108
+          {getFieldDecorator('channelCustomerId')(<Input placeholder="客户ID" />)}
118 109
         </Form.Item>
119 110
         <Form.Item label="项目ID" style={{ display: 'none' }}>
120
-          {getFieldDecorator('buildingId')(
121
-            <Input
122
-              placeholder="项目ID"
123
-            />,
124
-          )}
111
+          {getFieldDecorator('buildingId')(<Input placeholder="项目ID" />)}
125 112
         </Form.Item>
126
-        <Form.Item label="归属人" style={{ display: 'none' }}>
127
-          {getFieldDecorator('realtyConsultant')(
128
-            <Input
129
-              placeholder="归属人"
130
-            />,
131
-          )}
132
-        </Form.Item> */}
133 113
         <Form.Item label="意向项目:">
134 114
           {getFieldDecorator('buildingId')(
135
-            <BuildingSelect
136
-              placeholder="意向项目"
137
-              style={{width:'100%'}}
138
-            />,
115
+            <BuildingSelect placeholder="意向项目" style={{ width: '100%' }} />,
139 116
           )}
140
-        </Form.Item>
117
+        </Form.Item> */}
141 118
         <Form.Item label="客户姓名">
142
-          {getFieldDecorator('name')(
143
-            <Input placeholder="客户姓名" />,
144
-          )}
119
+          {getFieldDecorator('name')(<Input placeholder="客户姓名" />)}
145 120
         </Form.Item>
146 121
         <Form.Item label="客户电话">
147
-          {getFieldDecorator('phone')(
148
-            <Input placeholder="客户电话" />,
149
-          )}
122
+          {getFieldDecorator('phone')(<Input placeholder="客户电话" />)}
150 123
         </Form.Item>
151 124
         <Form.Item label="客户性别">
152 125
           {getFieldDecorator('sex')(
@@ -157,18 +130,17 @@ function body(props) {
157 130
           )}
158 131
         </Form.Item>
159 132
         <Form.Item label="客户描述">
160
-          {getFieldDecorator('describe')(
161
-            <TextArea placeholder="客户描述" rows={10} />,
162
-          )}
133
+          {getFieldDecorator('remark')(<TextArea placeholder="客户描述" rows={10} />)}
163 134
         </Form.Item>
164 135
         <Form.Item label="归属置业顾问">
165
-          {getFieldDecorator('describe11')(
166
-            <ConsultantSelect placeholder="归属置业顾问" buildingId={props.form.getFieldValue('buildingId')} />,
136
+          {getFieldDecorator('realtyConsultant')(
137
+            <ConsultantSelect
138
+              placeholder="归属置业顾问"
139
+              buildingId={props.form.getFieldValue('buildingId')}
140
+            />,
167 141
           )}
168 142
         </Form.Item>
169 143
 
170
-        
171
-
172 144
         {/* <Form.Item label="归属置业顾问"
173 145
       >
174 146
           <Row gutter={8}>
@@ -188,23 +160,28 @@ function body(props) {
188 160
           </Row>
189 161
         </Form.Item> */}
190 162
         <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
191
-          <Button type="primary" htmlType="submit" >
163
+          <Button type="primary" htmlType="submit">
192 164
             审核通过
193 165
           </Button>
194
-          <Button type="danger" ghost style={{marginLeft: '4em'}} onClick={() => submitDate({ status: '2' })}>
166
+          <Button
167
+            type="danger"
168
+            ghost
169
+            style={{ marginLeft: '4em' }}
170
+            onClick={() => submitDate({ status: '2' })}
171
+          >
195 172
             驳回
196 173
           </Button>
197
-          <Button style={{marginLeft: '4em'}} onClick={() => router.goBack(-1)}>
174
+          <Button style={{ marginLeft: '4em' }} onClick={() => router.goBack(-1)}>
198 175
             取消
199 176
           </Button>
200 177
         </Form.Item>
201 178
       </Form>
202 179
 
203 180
       {/* 选择置业顾问 */}
204
-      <Attribution visibleData={visibleData} onCancel={() => closeConsultant()} onSuccess={e => consultantSuccess(e)} />
181
+      {/* <Attribution visibleData={visibleData} onCancel={() => closeConsultant()} onSuccess={e => consultantSuccess(e)} /> */}
205 182
     </Card>
206 183
   );
207 184
 }
208 185
 const WrappedBody = Form.create({ name: 'body' })(body);
209 186
 
210
-export default WrappedBody
187
+export default WrappedBody;

+ 5
- 5
src/services/apis.js Näytä tiedosto

@@ -368,16 +368,16 @@ export default {
368 368
       url: `${prefix}/channelCustomer`,
369 369
       action: 'admin.customer.recommend.recommender.get',
370 370
     },
371
+    auto: {
372
+      method: 'PUT',
373
+      url: `${prefix}/channelCustomer/:id`,
374
+      action: 'admin.channelCustomer.id.put',
375
+    },
371 376
     getDetail: {
372 377
       method: 'GET',
373 378
       url: `${prefix}/channelCustomer/:id`,
374 379
       action: 'admin.customer.recommend.recommender.get',
375 380
     },
376
-    auto: {
377
-      method: 'PUT',
378
-      url: `${prefix}/customer/recommend/verify/:id`,
379
-      action: 'admin.customer.recommend.verify.id.put',
380
-    },
381 381
     recommendGetById: {
382 382
       method: 'GET',
383 383
       url: `${prefix}/customer/recommend/getById/:id`,