魏熙美 5 years ago
parent
commit
b0417c6703

+ 1
- 4
src/pages/customer/customerlist/components/attribution.jsx View File

81
 
81
 
82
   // 提交
82
   // 提交
83
   submitGm(record) {
83
   submitGm(record) {
84
-    const { url, method } = apis.customer.recommendEdit
85
-    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(this.state.visibleData.customerId)
86
-
87
     // 网路请求
84
     // 网路请求
88
-    request({ url: tempUrl, method, data: { customerId: this.state.visibleData.customerId, realtyConsultant: record.personId } }).then(res => {
85
+    request({ ...apis.customer.recommendEdit, urlData: { id: this.state.visibleData.customerId }, data: { customerId: this.state.visibleData.customerId, realtyConsultant: record.personId } }).then(res => {
89
       // eslint-disable-next-line no-unused-expressions
86
       // eslint-disable-next-line no-unused-expressions
90
       this.openNotificationWithIcon('success', '操作成功')
87
       this.openNotificationWithIcon('success', '操作成功')
91
       this.handleCancel()
88
       this.handleCancel()

+ 1
- 4
src/pages/customer/customerlist/components/changeStatus.jsx View File

41
   };
41
   };
42
 
42
 
43
   submitButton = e => {
43
   submitButton = e => {
44
-    const { url, method } = apis.customer.recommendEdit
45
-    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(this.state.visibleData.customerId)
46
-
47
     // 网路请求
44
     // 网路请求
48
-    request({ url: tempUrl, method, data: { customerId: this.state.visibleData.customerId, status: this.state.value } }).then(res => {
45
+    request({ ...apis.customer.recommendEdit, urlData: { id: this.state.visibleData.customerId }, data: { customerId: this.state.visibleData.customerId, status: this.state.value } }).then(res => {
49
       // eslint-disable-next-line no-unused-expressions
46
       // eslint-disable-next-line no-unused-expressions
50
       this.openNotificationWithIcon('success', '操作成功')
47
       this.openNotificationWithIcon('success', '操作成功')
51
       this.handleCancel()
48
       this.handleCancel()

+ 1
- 4
src/pages/customer/customerlist/components/integralRecord.jsx View File

62
       return
62
       return
63
     }
63
     }
64
     // 网路请求
64
     // 网路请求
65
-    const { url, method } = apis.customer.taPointsRecords
66
-    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(customerId)
67
-
68
     // 网路请求
65
     // 网路请求
69
-    request({ url: tempUrl, method, params: { ...params } }).then(res => {
66
+    request({ ...apis.customer.taPointsRecords, urlData: { id: customerId }, params: { ...params } }).then(res => {
70
       this.setState({ dataSource: res })
67
       this.setState({ dataSource: res })
71
     }).catch(err => {
68
     }).catch(err => {
72
       this.openNotificationWithIcon('error', err)
69
       this.openNotificationWithIcon('error', err)

+ 1
- 3
src/pages/customer/customerlist/customerDetail.jsx View File

28
     if (id === '' || id === undefined) {
28
     if (id === '' || id === undefined) {
29
       return
29
       return
30
     }
30
     }
31
-    const { url, method } = apis.customer.CustomerRecommendGet
32
-    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(id)
33
 
31
 
34
-    request({ url: tempUrl, method, params: { ...params } }).then(res => {
32
+    request({ ...apis.customer.CustomerRecommendGet, urlData: { id }, params: { ...params } }).then(res => {
35
       setData(res)
33
       setData(res)
36
     })
34
     })
37
   }
35
   }

+ 1
- 3
src/pages/customer/independentList/index.jsx View File

53
       return
53
       return
54
     }
54
     }
55
     // 网路请求
55
     // 网路请求
56
-    const { url, method } = apis.customer.recommend
57
-    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(customerId)
58
     // 网路请求
56
     // 网路请求
59
-    request({ url: tempUrl, method, params: { ...params } }).then(res => {
57
+    request({ ...apis.customer.recommend, urlData: { id: customerId }, params: { ...params } }).then(res => {
60
       this.setState({ dataSource: res })
58
       this.setState({ dataSource: res })
61
     }).catch(err => {
59
     }).catch(err => {
62
       // eslint-disable-next-line no-unused-expressions
60
       // eslint-disable-next-line no-unused-expressions

+ 2
- 8
src/pages/customer/recommendCustomer/audit.jsx View File

41
 
41
 
42
   // 获取详情信息
42
   // 获取详情信息
43
   function getById(currentId) {
43
   function getById(currentId) {
44
-    const { url, method } = apis.customer.recommendGetById
45
-    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(currentId)
46
-
47
-    request({ url: tempUrl, method }).then(res => {
44
+    request({ ...apis.customer.recommendGetById, urlData: { id: currentId } }).then(res => {
48
       props.form.setFieldsValue(res)
45
       props.form.setFieldsValue(res)
49
     })
46
     })
50
   }
47
   }
51
 
48
 
52
   function submitDate(params) {
49
   function submitDate(params) {
53
-    const { url, method } = apis.customer.auto
54
-    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(params.customerId)
55
-
56
     // props.form.setFieldsValue(res)
50
     // props.form.setFieldsValue(res)
57
-    request({ url: tempUrl, method, params: { verifyStatus: params.verifyStatus } }).then(() => {
51
+    request({ ...apis.customer.auto, urlData: { id: params.customerId }, params: { verifyStatus: params.verifyStatus } }).then(() => {
58
       // eslint-disable-next-line no-unused-expressions
52
       // eslint-disable-next-line no-unused-expressions
59
       <Alert
53
       <Alert
60
         style={{
54
         style={{

+ 6
- 6
src/services/apis.js View File

168
     },
168
     },
169
     auto: {
169
     auto: {
170
       method: 'PUT',
170
       method: 'PUT',
171
-      url: `${prefix}/customer/recommend/verify/id`,
171
+      url: `${prefix}/customer/recommend/verify/:id`,
172
       action: 'admin.customer.recommend.verify.id.put',
172
       action: 'admin.customer.recommend.verify.id.put',
173
     },
173
     },
174
     recommendGetById: {
174
     recommendGetById: {
175
       method: 'GET',
175
       method: 'GET',
176
-      url: `${prefix}/customer/recommend/getById/id`,
176
+      url: `${prefix}/customer/recommend/getById/:id`,
177
       action: 'admin.customer.recommend.getById.id.get',
177
       action: 'admin.customer.recommend.getById.id.get',
178
     },
178
     },
179
     agents: {
179
     agents: {
193
     },
193
     },
194
     recommendEdit: {
194
     recommendEdit: {
195
       method: 'PUT',
195
       method: 'PUT',
196
-      url: `${prefix}/customer/recommend/edit/id`,
196
+      url: `${prefix}/customer/recommend/edit/:id`,
197
       action: 'admin.customer.recommend.edit.id.put',
197
       action: 'admin.customer.recommend.edit.id.put',
198
     },
198
     },
199
     taPointsRecords: {
199
     taPointsRecords: {
200
       method: 'GET',
200
       method: 'GET',
201
-      url: `${prefix}/mine/taPointsRecords/id`,
201
+      url: `${prefix}/mine/taPointsRecords/:id`,
202
       action: 'admin.mine.taPointsRecords.id.get',
202
       action: 'admin.mine.taPointsRecords.id.get',
203
     },
203
     },
204
     recommend: {
204
     recommend: {
205
       method: 'GET',
205
       method: 'GET',
206
-      url: `${prefix}/customer/recommend/id`,
206
+      url: `${prefix}/customer/recommend/:id`,
207
       action: 'admin.customer.recommend.id.get',
207
       action: 'admin.customer.recommend.id.get',
208
     },
208
     },
209
     InviteClientsList: {
209
     InviteClientsList: {
213
     },
213
     },
214
     CustomerRecommendGet: {
214
     CustomerRecommendGet: {
215
       method: 'GET',
215
       method: 'GET',
216
-      url: `${prefix}/customer/recommend/get/id`,
216
+      url: `${prefix}/customer/recommend/get/:id`,
217
       action: 'admin.customer.recommend.get.id.get',
217
       action: 'admin.customer.recommend.get.id.get',
218
     },
218
     },
219
     customerRecommendRecommenderExport: { // 导出数据(推荐客户)
219
     customerRecommendRecommenderExport: { // 导出数据(推荐客户)