zlisen 3 anni fa
parent
commit
aa94e6e568

+ 2
- 2
config/proxy.js Vedi File

@@ -8,8 +8,8 @@
8 8
 export default {
9 9
   dev: {
10 10
     '/api/': {
11
-      // target: 'https://xlk.njyz.tech/',
12
-      target: 'http://localhost:8081/',
11
+      target: 'https://xlk.njyz.tech/',
12
+      // target: 'http://localhost:8081/',
13 13
       // target: 'https://xlj.newlandsh.com/',
14 14
       changeOrigin: true,
15 15
       pathRewrite: {

+ 36
- 29
config/routes.js Vedi File

@@ -97,6 +97,13 @@ export default [
97 97
                 hideInMenu: true,
98 98
                 component: './customer/customerlist/customerDetail',
99 99
               },
100
+              {
101
+                path: '/customer/customer/StatusChange',
102
+                name: '状态变更',
103
+                hideInMenu: true,
104
+                component: './customer/Customer/StatusChange',
105
+              },
106
+              
100 107
               // {
101 108
               //   path: '/customer/drift/list',
102 109
               //   name: '游客列表',
@@ -136,36 +143,36 @@ export default [
136 143
             ],
137 144
           },
138 145
 
139
-          {
140
-            path: '/recommend',
141
-            name: '推荐客户',
142
-            component: '../layouts/BlankLayout',
143
-            routes: [
144
-              {
145
-                path: '/recommend/customer',
146
-                name: '客户推荐',
147
-                component: './recommend/customer',
148
-              },
149
-              {
150
-                path: '/recommend/customer/audit',
151
-                name: '客户审核',
152
-                hideInMenu: true,
153
-                component: './recommend/customer/audit',
154
-              },
146
+          // {
147
+          //   path: '/recommend',
148
+          //   name: '推荐客户',
149
+          //   component: '../layouts/BlankLayout',
150
+          //   routes: [
151
+          //     {
152
+          //       path: '/recommend/customer',
153
+          //       name: '客户推荐',
154
+          //       component: './recommend/customer',
155
+          //     },
156
+          //     {
157
+          //       path: '/recommend/customer/audit',
158
+          //       name: '客户审核',
159
+          //       hideInMenu: true,
160
+          //       component: './recommend/customer/audit',
161
+          //     },
155 162
 
156
-              {
157
-                path: '/recommend/channel',
158
-                name: '经纪人推荐',
159
-                component: './recommend/channel',
160
-              },
161
-              {
162
-                path: '/recommend/channel/audit',
163
-                name: '客户审核',
164
-                hideInMenu: true,
165
-                component: './recommend/channel/audit',
166
-              },
167
-            ],
168
-          },
163
+          //     {
164
+          //       path: '/recommend/channel',
165
+          //       name: '经纪人推荐',
166
+          //       component: './recommend/channel',
167
+          //     },
168
+          //     {
169
+          //       path: '/recommend/channel/audit',
170
+          //       name: '客户审核',
171
+          //       hideInMenu: true,
172
+          //       component: './recommend/channel/audit',
173
+          //     },
174
+          //   ],
175
+          // },
169 176
           {
170 177
             path: '/staff',
171 178
             name: '员工管理',

+ 23
- 13
src/pages/customer/Customer/PrivateCustomer/index.jsx Vedi File

@@ -119,8 +119,8 @@ const PrivateCustomer = () => {
119 119
       },
120 120
       {
121 121
         title: '推广人员',
122
-        dataIndex: 'sharePersonName',
123
-        key: 'sharePersonName',
122
+        dataIndex: 'recommendName',
123
+        key: 'recommendName',
124 124
         align: 'center',
125 125
         width: '10%',
126 126
       },
@@ -139,11 +139,17 @@ const PrivateCustomer = () => {
139 139
             return '到访';
140 140
           }
141 141
           if (records.status === 3) {
142
-            return '认';
142
+            return '认';
143 143
           }
144 144
           if (records.status === 4) {
145 145
             return '签约';
146 146
           }
147
+          if (records.status === 5) {
148
+            return '结佣';
149
+          }
150
+          // if (records.status === 6) {
151
+          //   return '报废';
152
+          // }
147 153
         },
148 154
       },
149 155
       {
@@ -153,30 +159,35 @@ const PrivateCustomer = () => {
153 159
         align: 'center',
154 160
         width: '20%',
155 161
         render: withActions((_, record) => [
156
-          <Button  type="link" onClick={() => toCustomerDateil(record)}>
162
+          <Button type="link" onClick={() => toCustomerDateil(record)}>
157 163
             查看详情
158 164
           </Button>,
159 165
           // <EditIcon color="#FF4A4A" text="查看详情" onClick={() => toCustomerDateil(record)} />,
160 166
           <AuthButton name="admin.customer.recommend.edit.id.put" noRight={null}>
161 167
             <Button
162
-            
163 168
               type="link"
164
-              onClick={() => handShowModel(record, actionList.changeStatus)}
169
+              onClick={() => {
170
+                router.push({
171
+                  pathname: '/customer/customer/StatusChange',
172
+                  query: {
173
+                    id: record.customerId,
174
+                    buildingId:record.buildingId
175
+                  },
176
+                });
177
+              }}
178
+
179
+              // });
180
+              // onClick={() => handShowModel(record, actionList.changeStatus)}
165 181
             >
166 182
               变更状态
167 183
             </Button>
168 184
           </AuthButton>,
169 185
 
170 186
           <AuthButton name="admin.customer.recommend.belong" noRight={null}>
171
-            <Button
172
-            
173
-              type="link"
174
-              onClick={() => handShowModel(record, actionList.attribution)}
175
-            >
187
+            <Button type="link" onClick={() => handShowModel(record, actionList.attribution)}>
176 188
               调整归属
177 189
             </Button>
178 190
           </AuthButton>,
179
-
180 191
         ]),
181 192
       },
182 193
     ];
@@ -224,7 +235,6 @@ const PrivateCustomer = () => {
224 235
   };
225 236
 
226 237
   const actionRender = () => {
227
-    
228 238
     return (
229 239
       <Button type="danger" loading={exportLoding} onClick={() => exportCustomer()}>
230 240
         导出

+ 3
- 1
src/pages/customer/Customer/PrivateCustomer/searchFields.js Vedi File

@@ -27,7 +27,9 @@ export default () => [
27 27
       {label: '报备', value: 1},
28 28
       {label: '到访', value: 2},
29 29
       {label: '认筹', value: 3},
30
-      {label: '签约', value: 4}
30
+      {label: '签约', value: 4},
31
+      {label: '结佣', value: 5},
32
+      // {label: '作废', value: 6}
31 33
     ]
32 34
   },
33 35
   {

+ 5
- 4
src/pages/customer/Customer/PublicCustomer/components/AssistConsultant.jsx Vedi File

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Table, Modal, notification } from 'antd';
2
+import { Table, Modal, notification,Button } from 'antd';
3 3
 import request from '@/utils/request';
4 4
 import apis from '@/services/apis';
5 5
 import BuildSelect from '../../../../../components/SelectButton/BuildSelect';
@@ -44,7 +44,7 @@ const AssistConsultant = props => {
44 44
 
45 45
   useEffect(() => {
46 46
     if (visible) {
47
-      getList({ pageNumber: 1, pageSize: 5 });
47
+      getList({ pageNumber: 1, pageSize: 5,buildingId: data.buildingId });
48 48
     } else {
49 49
       setTableData({});
50 50
     }
@@ -133,13 +133,13 @@ const AssistConsultant = props => {
133 133
 
134 134
         {data && (
135 135
           <>
136
-            {data.customerId?.length > 0 && (
136
+            {/* {data.customerId?.length > 0 && (
137 137
               <>
138 138
                 <span>你正在为{data.customerId.length}位公客分配置业顾问</span>
139 139
                 <br />
140 140
                 <br />
141 141
               </>
142
-            )}
142
+            )} */}
143 143
             {data?.buildingId == null && (
144 144
               <BuildSelect onChange={e => changBuilding(e)} value={data?.buildingName} />
145 145
             )}
@@ -147,6 +147,7 @@ const AssistConsultant = props => {
147 147
               dataSource={tableData.records}
148 148
               columns={columns}
149 149
               loading={loading}
150
+              key={'userId'}
150 151
               pagination={{
151 152
                 pageSize: tableData.pageSize,
152 153
                 total: tableData.total,

+ 3
- 3
src/pages/customer/Customer/PublicCustomer/index.jsx Vedi File

@@ -200,7 +200,7 @@ const PublicCustomer = () => {
200 200
       <Button type="danger" loading={exportLoding} onClick={() => exportCustomer()}>
201 201
           导出
202 202
         </Button>
203
-        <AuthButton name="admin.customer.import" noRight={null}>
203
+        {/* <AuthButton name="admin.customer.import" noRight={null}>
204 204
           <Button
205 205
             type="primary"
206 206
             onClick={() => batchAssistConsultant()}
@@ -208,7 +208,7 @@ const PublicCustomer = () => {
208 208
           >
209 209
             批量分配置业顾问
210 210
           </Button>
211
-        </AuthButton>
211
+        </AuthButton> */}
212 212
         
213 213
       </>
214 214
     );
@@ -230,7 +230,7 @@ const PublicCustomer = () => {
230 230
     <>
231 231
       <QueryTable
232 232
         ref={ref}
233
-        rowSelection={rowSelection}
233
+        // rowSelection={rowSelection}
234 234
         rowKey="customerId"
235 235
         api={apis.customer.customerRecommend}
236 236
         searchFields={searchFields}

+ 280
- 0
src/pages/customer/Customer/statusChange.jsx Vedi File

@@ -0,0 +1,280 @@
1
+import React, { useState, useEffect } from 'react';
2
+import {
3
+  Form,
4
+  Input,
5
+  Button,
6
+  Icon,
7
+  Select,
8
+  Card,
9
+  Radio,
10
+  DatePicker,
11
+  message,
12
+  Switch,
13
+  InputNumber,
14
+} from 'antd';
15
+import { FormattedMessage } from 'umi-plugin-react/locale';
16
+import moment from 'moment';
17
+import router from 'umi/router';
18
+import FileUpload from '@/components/XForm/FileUpload';
19
+import XForm, { FieldTypes, createForm } from '@/components/XForm';
20
+import apis from '@/services/apis';
21
+import BuildSelect2 from '@/components/SelectButton/BuildSelect2';
22
+import LivePlatSelect from '@/components/SelectButton/LivePlatSelect';
23
+import CitySelect3 from '@/components/SelectButton/CitySelect3';
24
+import ImageUpload from '@/components/XForm/ImageUpload';
25
+import request from '@/utils/request';
26
+import Navigate from '@/components/Navigate';
27
+import ConsultantSelect from '@/components/SelectButton/consultantSelect';
28
+import ChannelSelect from '@/components/SelectButton/channelSelect';
29
+
30
+const { Option } = Select;
31
+const { TextArea } = Input;
32
+
33
+const header = props => {
34
+  console.log(props);
35
+
36
+  const { id, buildingId } = props.location.query;
37
+
38
+const [loading,setLoading] = useState(false)
39
+  const [data, setData] = useState({});
40
+  const [apartmentTypeList, setApartmentTypeList] = useState([]);
41
+
42
+  // 查询详情
43
+  const getData = () => {
44
+    request({ ...apis.customer.getStatusChange, urlData: { id } }).then(res => {
45
+      //   data.videoUrl = [data.videoUrl];
46
+      if (res.channelCustomer) {
47
+        res.channelId = res.channelCustomer.channelId;
48
+      }
49
+
50
+      setData({ ...res });
51
+    });
52
+  };
53
+
54
+  const getApartmentType = () => {
55
+    const params = { apartmentType: 'apart' };
56
+    request({
57
+      ...apis.building.buildingApartment,
58
+      urlData: { id: buildingId },
59
+      params,
60
+    })
61
+      .then(data => {
62
+        setApartmentTypeList(data || []);
63
+      })
64
+      .catch(err => {
65
+        message.info(err.msg || err.message);
66
+      });
67
+  };
68
+  useEffect(() => {
69
+    getApartmentType();
70
+    if (id) {
71
+      getData(id);
72
+    }
73
+  }, []);
74
+
75
+  const cancelPage = () => {
76
+    router.go('-1');
77
+  };
78
+
79
+  function handleSubmit(e) {
80
+    e.preventDefault();
81
+    props.form.validateFields((err, values) => {
82
+      console.log(values, 'values');
83
+      if (!err) {
84
+        const { status } = values;
85
+        // values.isNewHouse =  values.isNewHouse?1:0
86
+setLoading(true)
87
+        if (status == 3) {
88
+          //认筹
89
+          const params = {
90
+            customerId: id,
91
+            customerPreparatory: {
92
+              ...values,
93
+              customerId: id,
94
+            },
95
+          };
96
+          request({
97
+            ...apis.customer.preparatory,
98
+            data: params,
99
+          })
100
+            .then(data => {
101
+              message.info('认筹成功');
102
+              setLoading(false)
103
+                cancelPage();
104
+            })
105
+            .catch(err => {
106
+              message.info(err.msg || err.message);
107
+            });
108
+        } else if (status == 4) {
109
+          const params = {
110
+            customerId: id,
111
+            customerSignatory: {
112
+              ...values,
113
+              customerId: id,
114
+            },
115
+          };
116
+          request({
117
+            ...apis.customer.signatory,
118
+            data: params,
119
+          })
120
+            .then(data => {
121
+              message.info('认筹成功');
122
+              setLoading(false)
123
+                cancelPage();
124
+            })
125
+            .catch(err => {
126
+              message.info(err.msg || err.message);
127
+            });
128
+        }else if (status == 5) {
129
+            const params = {
130
+              customerId: id,
131
+              customerSignatory: {
132
+                ...values,
133
+                customerId: id,
134
+              },
135
+            };
136
+            request({
137
+              ...apis.customer.commission,
138
+              data: params,
139
+            })
140
+              .then(data => {
141
+                message.info('结佣成功');
142
+                setLoading(false)
143
+                  cancelPage();
144
+              })
145
+              .catch(err => {
146
+                message.info(err.msg || err.message);
147
+              });
148
+          }
149
+      }
150
+    });
151
+  }
152
+
153
+  const { getFieldDecorator } = props.form;
154
+
155
+  return (
156
+    <Card>
157
+      <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
158
+        <Form.Item label="变更状态为">
159
+          {getFieldDecorator('status', {
160
+            // initialValue: data.status,
161
+            rules: [{ required: true, message: ' 请选择变更状态' }],
162
+          })(
163
+            <Select>
164
+              <Option value={3}>认筹</Option>
165
+              <Option value={4}>签约</Option>
166
+              <Option value={5}>结佣</Option>
167
+            </Select>,
168
+          )}
169
+        </Form.Item>
170
+        <Form.Item label="客户姓名">
171
+          {getFieldDecorator('name', {
172
+            initialValue: data.name,
173
+          })(<Input placeholder="客户姓名" />)}
174
+        </Form.Item>
175
+        {data.channelId && (
176
+          <Form.Item label="归属渠道">
177
+            {getFieldDecorator('channelId', {
178
+              initialValue: data.channelId,
179
+            })(<ChannelSelect placeholder="归属渠道" disabled />)}
180
+          </Form.Item>
181
+        )}
182
+        <Form.Item label="内场接待">
183
+          {getFieldDecorator('realtyConsultant', {
184
+            initialValue: data.realtyConsultant,
185
+          })(<ConsultantSelect placeholder="内场接待" buildingId={buildingId} />)}
186
+        </Form.Item>
187
+
188
+        {props.form.getFieldValue('status') == 3 && (
189
+          <>
190
+            <Form.Item label="认筹日期">
191
+              {getFieldDecorator('preparatoryData')(<DatePicker />)}
192
+            </Form.Item>
193
+            <Form.Item label="备注">
194
+              {getFieldDecorator('remark')(<TextArea placeholder="客户描述" rows={10} />)}
195
+            </Form.Item>
196
+          </>
197
+        )}
198
+
199
+        {props.form.getFieldValue('status') == 4 && (
200
+          <>
201
+            <Form.Item label="业绩分成人">
202
+              {getFieldDecorator('dividendsName', {})(<Input placeholder="业绩分成人" />)}
203
+            </Form.Item>
204
+            <Form.Item label="比例">
205
+              {getFieldDecorator('proportion', {})(<Input placeholder="比例" />)}
206
+            </Form.Item>
207
+            <Form.Item label="户型">
208
+              {getFieldDecorator('houseType', {
209
+                // rules: [{ required: true, message: ' 请选择户型' }],
210
+              })(
211
+                <Select>
212
+                  {apartmentTypeList?.map(x => {
213
+                    return <Option key={x.apartmentId} value={x.apartmentId}>{x.apartmentName}</Option>;
214
+                  })}
215
+                </Select>,
216
+              )}
217
+            </Form.Item>
218
+            <Form.Item label="房号">
219
+              {getFieldDecorator('houseInfo', {})(<Input placeholder="房号" />)}
220
+            </Form.Item>
221
+            <Form.Item label="签约日期">
222
+              {getFieldDecorator('successDate', {})(<DatePicker />)}
223
+            </Form.Item>
224
+            <Form.Item label="成交金额">
225
+              {getFieldDecorator('price', {})(<Input suffix="万" />)}
226
+            </Form.Item>
227
+            <Form.Item label="备注">
228
+              {getFieldDecorator('remark')(<TextArea placeholder="客户描述" rows={10} />)}
229
+            </Form.Item>
230
+          </>
231
+        )}
232
+
233
+{props.form.getFieldValue('status') == 5 && (
234
+          <>
235
+            <Form.Item label="业绩分成人">
236
+              {getFieldDecorator('dividendsName', {})(<Input placeholder="业绩分成人" />)}
237
+            </Form.Item>
238
+            <Form.Item label="比例">
239
+              {getFieldDecorator('proportion', {})(<Input placeholder="比例" />)}
240
+            </Form.Item>
241
+            <Form.Item label="户型">
242
+              {getFieldDecorator('houseType', {
243
+                // rules: [{ required: true, message: ' 请选择户型' }],
244
+              })(
245
+                <Select>
246
+                  {apartmentTypeList?.map(x => {
247
+                    return <Option key={x.apartmentId} value={x.apartmentId}>{x.apartmentName}</Option>;
248
+                  })}
249
+                </Select>,
250
+              )}
251
+            </Form.Item>
252
+            <Form.Item label="房号">
253
+              {getFieldDecorator('houseInfo', {})(<Input placeholder="房号" />)}
254
+            </Form.Item>
255
+            <Form.Item label="结佣日期">
256
+              {getFieldDecorator('successDate', {})(<DatePicker />)}
257
+            </Form.Item>
258
+            <Form.Item label="成交金额">
259
+              {getFieldDecorator('price', {})(<Input suffix="万" />)}
260
+            </Form.Item>
261
+            <Form.Item label="备注">
262
+              {getFieldDecorator('remark')(<TextArea placeholder="客户描述" rows={10} />)}
263
+            </Form.Item>
264
+          </>
265
+        )}
266
+
267
+        <Form.Item wrapperCol={{ span: 15, offset: 7 }}>
268
+          <Button type="primary" htmlType="submit" loading={loading} style={{ marginRight: '20px' }}>
269
+            确定
270
+          </Button>
271
+          <Button onClick={() => router.go(-1)}>取消</Button>
272
+        </Form.Item>
273
+      </Form>
274
+    </Card>
275
+  );
276
+};
277
+
278
+const statusChange = Form.create({ name: 'header' })(header);
279
+
280
+export default statusChange;

+ 110
- 126
src/pages/recommend/channel/audit.jsx Vedi File

@@ -1,17 +1,34 @@
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
 import ChannelSelect from '@/components/SelectButton/channelSelect';
13 31
 
14
-
15 32
 const { TextArea } = Input;
16 33
 
17 34
 const tailFormItemLayout = {
@@ -28,93 +45,95 @@ const tailFormItemLayout = {
28 45
 const openNotificationWithIcon = (type, message) => {
29 46
   notification[type]({
30 47
     message,
31
-    description:
32
-      '',
48
+    description: '',
33 49
   });
34
-}
50
+};
35 51
 
36 52
 function body(props) {
37
-  const { getFieldDecorator } = props.form
53
+  const { getFieldDecorator } = props.form;
38 54
 
39 55
   // eslint-disable-next-line react-hooks/rules-of-hooks
40
-  const [visibleData, setVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
56
+  const [visibleData, setVisibleData] = useState({
57
+    visible: false,
58
+    customerId: '',
59
+    realtyConsultant: '',
60
+    buildingId: '',
61
+  });
41 62
 
42 63
   // eslint-disable-next-line react-hooks/rules-of-hooks
43
-  const [data, setData] = useState({})
64
+  const [data, setData] = useState({});
44 65
 
45 66
   const { id } = props.location.query;
46 67
 
47 68
   if (id !== '') {
48 69
     // eslint-disable-next-line react-hooks/rules-of-hooks
49 70
     useEffect(() => {
50
-      getById(id)
51
-    }, [])
71
+      getById(id);
72
+    }, []);
52 73
   }
53 74
 
54 75
   // 获取详情信息
55 76
   function getById(currentId) {
56 77
     request({ ...apis.customer.getDetail, urlData: { id: currentId } }).then(res => {
57 78
       // res.reportDate = moment(res.reportDate)
58
-      if(res){
59
-        let channelCustomer = {}
60
-        if(res.channelCustomer){
61
-          channelCustomer.channelId=res.channelCustomer.channelId
62
-          channelCustomer.remark=res.channelCustomer.remark
63
-          
79
+      if (res) {
80
+        let channelCustomer = {};
81
+        if (res.channelCustomer) {
82
+          channelCustomer.channelId = res.channelCustomer.channelId;
83
+          channelCustomer.remark = res.channelCustomer.remark;
64 84
         }
65
-        if(res.customerVisit){
66
-          channelCustomer.imageUrl=res.customerVisit.imageUrl
85
+        if (res.customerVisit) {
86
+          channelCustomer.imageUrl = res.customerVisit.imageUrl;
67 87
           // channelCustomer.remark=res.channelCustomer.remark
68
-          
69 88
         }
70
-        
71
-        setData(res)
72
-        props.form.setFieldsValue({...res,...channelCustomer})
89
+
90
+        setData(res);
91
+        props.form.setFieldsValue({ ...res, ...channelCustomer });
73 92
       }
74
-    
75
-    })
93
+    });
76 94
   }
77 95
 
78 96
   function submitDate(data) {
79 97
     // props.form.setFieldsValue(res)
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'),
98
+    console.log(data, 'data');
99
+    if (data.status == 1) {
100
+      const params = {
101
+        auditResult: data.status,
102
+        channelCustomerId: id,
103
+        realtyConsultant: props.form.getFieldValue('realtyConsultant'),
104
+        name: props.form.getFieldValue('name'),
105
+        customerVisit: {
106
+          imageUrl: props.form.getFieldValue('imageUrl'),
107
+        },
108
+        remark: props.form.getFieldValue('remark'),
109
+      };
110
+
111
+      request({ ...apis.customer.auto, urlData: { id: id }, data: { ...params } })
112
+        .then(() => {
113
+          // eslint-disable-next-line no-unused-expressions
114
+          openNotificationWithIcon('success', '操作成功');
115
+          router.go(-1);
116
+        })
117
+        .catch(err => {
118
+          // eslint-disable-next-line no-unused-expressions
119
+        });
120
+    } else {
121
+      const params = {
122
+        id:id,
123
+        type:'report'
124
+      };
125
+
126
+      request({ ...apis.customer.invalidCustomer,  data: { ...params } })
127
+      .then(() => {
128
+        // eslint-disable-next-line no-unused-expressions
129
+        openNotificationWithIcon('success', '操作成功');
130
+        router.go(-1);
131
+      })
132
+      .catch(err => {
133
+        // eslint-disable-next-line no-unused-expressions
134
+      });
135
+      ;
90 136
     }
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(() => {
111
-      // eslint-disable-next-line no-unused-expressions
112
-      openNotificationWithIcon('success', '操作成功')
113
-      router.go(-1)
114
-    }).catch(err => {
115
-      // eslint-disable-next-line no-unused-expressions
116
-
117
-    })
118 137
   }
119 138
 
120 139
   // 提交事件
@@ -122,16 +141,12 @@ function body(props) {
122 141
     e.preventDefault();
123 142
     props.form.validateFields((err, values) => {
124 143
       if (!err) {
125
-        submitDate({ status: '1' })
144
+        submitDate({ status: '1' });
126 145
         // submitDate({ ...values })
127 146
       }
128 147
     });
129 148
   }
130 149
 
131
-
132
-
133
-
134
-
135 150
   return (
136 151
     <Card>
137 152
       <Form {...tailFormItemLayout} onSubmit={e => handleSubmit(e)} style={{ maxWidth: '1000px' }}>
@@ -143,86 +158,55 @@ function body(props) {
143 158
           )}
144 159
         </Form.Item>*/}
145 160
         <Form.Item label="项目ID" style={{ display: 'none' }}>
146
-          {getFieldDecorator('buildingId')(
147
-            <Input
148
-              placeholder="项目ID"
149
-            />,
150
-          )}
161
+          {getFieldDecorator('buildingId')(<Input placeholder="项目ID" />)}
151 162
         </Form.Item>
152 163
         <Form.Item label="意向项目:">
153 164
           {getFieldDecorator('buildingId')(
154
-            <BuildingSelect
155
-            disabled
156
-              placeholder="意向项目"
157
-              style={{width:'100%'}}
158
-            />,
165
+            <BuildingSelect disabled placeholder="意向项目" style={{ width: '100%' }} />,
159 166
           )}
160
-        </Form.Item> 
167
+        </Form.Item>
161 168
         <Form.Item label="客户姓名">
162
-          {getFieldDecorator('name')(
163
-            <Input placeholder="客户姓名" />,
164
-          )}
169
+          {getFieldDecorator('name')(<Input placeholder="客户姓名" />)}
165 170
         </Form.Item>
166 171
         <Form.Item label="归属渠道">
167
-          {getFieldDecorator('channelId')(
168
-            <ChannelSelect placeholder="归属渠道" disabled/>,
169
-          )}
172
+          {getFieldDecorator('channelId')(<ChannelSelect placeholder="归属渠道" disabled />)}
170 173
         </Form.Item>
171 174
         <Form.Item label="归属置业顾问">
172 175
           {getFieldDecorator('realtyConsultant')(
173
-            <ConsultantSelect placeholder="归属置业顾问" buildingId={props.form.getFieldValue('buildingId')} />,
174
-          )}
175
-        </Form.Item>
176
-        <Form.Item label="到访照片">
177
-          {getFieldDecorator('imageUrl')(
178
-            <ImageUpload />,
176
+            <ConsultantSelect
177
+              placeholder="归属置业顾问"
178
+              buildingId={props.form.getFieldValue('buildingId')}
179
+            />,
179 180
           )}
180 181
         </Form.Item>
182
+        <Form.Item label="到访照片">{getFieldDecorator('imageUrl')(<ImageUpload />)}</Form.Item>
181 183
         <Form.Item label="备注">
182
-          {getFieldDecorator('remark')(
183
-            <TextArea placeholder="客户描述" rows={10} />,
184
-          )}
184
+          {getFieldDecorator('remark')(<TextArea placeholder="客户描述" rows={10} />)}
185 185
         </Form.Item>
186
-       
187
-
188
-        
189
-
190
-        {/* <Form.Item label="归属置业顾问"
191
-      >
192
-          <Row gutter={8}>
193
-            <Col span={12}>
194
-              {getFieldDecorator('consultantName', {
195
-                rules: [
196
-                  {
197
-                    required: true,
198
-                    message: '请选择置业顾问',
199
-                  },
200
-                ],
201
-              })(<Input placeholder="请选择置业顾问" />)}
202
-            </Col>
203
-            <Col span={12}>
204
-              <Button onClick={() => showConsultant()}>选择</Button>
205
-            </Col>
206
-          </Row>
207
-        </Form.Item> */}
208 186
         <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
209
-          {data.status==='1'&&<><Button type="primary" htmlType="submit" >
210
-            审核通过
211
-          </Button>
212
-          <Button type="danger" ghost style={{marginLeft: '4em'}} onClick={() => submitDate({ status: '2' })}>
213
-            驳回
214
-          </Button></>}
215
-          <Button style={{marginLeft: '4em'}} onClick={() => router.goBack(-1)}>
187
+          {data.status === '1' && (
188
+            <>
189
+              <Button type="primary" htmlType="submit">
190
+                确定
191
+              </Button>
192
+              <Button
193
+                type="danger"
194
+                ghost
195
+                style={{ marginLeft: '4em' }}
196
+                onClick={() => submitDate({ status: '2' })}
197
+              >
198
+                无效
199
+              </Button>
200
+            </>
201
+          )}
202
+          <Button style={{ marginLeft: '4em' }} onClick={() => router.goBack(-1)}>
216 203
             取消
217 204
           </Button>
218 205
         </Form.Item>
219 206
       </Form>
220
-
221
-      {/* 选择置业顾问 */}
222
-      {/* <Attribution visibleData={visibleData} onCancel={() => closeConsultant()} onSuccess={e => consultantSuccess(e)} /> */}
223 207
     </Card>
224 208
   );
225 209
 }
226 210
 const WrappedBody = Form.create({ name: 'body' })(body);
227 211
 
228
-export default WrappedBody
212
+export default WrappedBody;

+ 4
- 4
src/pages/recommend/channel/index.jsx Vedi File

@@ -170,9 +170,9 @@ function Recommend(props) {
170 170
     placeholder: '请选择状态',
171 171
     type: 'select',
172 172
     options: [
173
-      {label: '未通过', value: '1'},
174
-      {label: '已通过', value: '2'},
175
-      {label: '已驳回', value: '3'}
173
+      {label: '未到访', value: '1'},
174
+      {label: '已到访', value: '2'},
175
+      {label: '无效', value: '3'}
176 176
     ]
177 177
   },
178 178
  ]
@@ -189,7 +189,7 @@ function Recommend(props) {
189 189
   return (
190 190
     <>
191 191
       <QueryTable
192
-          rowKey="recommendCustomer"
192
+          rowKey="channelCustomerId"
193 193
           api={apis.customer.recommender}
194 194
           searchFields={searchFields}
195 195
           columns={columns}

+ 113
- 99
src/pages/recommend/customer/audit.jsx Vedi File

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

+ 5
- 5
src/pages/recommend/customer/index.jsx Vedi File

@@ -21,7 +21,7 @@ function Recommend(props) {
21 21
 
22 22
   function toAudit(cuurentId) {
23 23
     router.push({
24
-      pathname: '/recommend/customer/audit',
24
+      pathname: '/customer/recommend/customer/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: '操作',
@@ -162,9 +162,9 @@ function Recommend(props) {
162 162
     placeholder: '请选择状态',
163 163
     type: 'select',
164 164
     options: [
165
-      {label: '未通过', value: '1'},
166
-      {label: '已通过', value: '2'},
167
-      {label: '已驳回', value: '3'}
165
+      {label: '未到访', value: '1'},
166
+      {label: '已到访', value: '2'},
167
+      {label: '无效', value: '3'}
168 168
     ]
169 169
   },
170 170
  ]

+ 31
- 0
src/services/apis.js Vedi File

@@ -378,6 +378,37 @@ export default {
378 378
       url: `${prefix}/channelCustomer/:id`,
379 379
       action: 'admin.customer.recommend.recommender.get',
380 380
     },
381
+
382
+    getStatusChange: {
383
+      method: 'GET',
384
+      url: `${prefix}/customer/detail/:id`,
385
+      action: 'admin.customer.detail.recommender.get',
386
+    },
387
+    //认筹
388
+    preparatory: {
389
+      method: 'PUT',
390
+      url: `${prefix}/marking/preparatory`,
391
+      action: 'admin.marking.preparatory.put',
392
+    },
393
+    // 签约
394
+    signatory: {
395
+      method: 'PUT',
396
+      url: `${prefix}/marking/signatory`,
397
+      action: 'admin.marking.signatory.put',
398
+    },
399
+     // 结佣
400
+     commission: {
401
+      method: 'PUT',
402
+      url: `${prefix}/marking/commission`,
403
+      action: 'admin.marking.commission.put',
404
+    },
405
+    // 无效
406
+    invalidCustomer: {
407
+      method: 'PUT',
408
+      url: `${prefix}/marking/invalidCustomer`,
409
+      action: 'admin.marking.invalidCustomer.put',
410
+    },
411
+    
381 412
     recommendGetById: {
382 413
       method: 'GET',
383 414
       url: `${prefix}/customer/recommend/getById/:id`,