魏熙美 5 年前
父节点
当前提交
b0417c6703

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

@@ -81,11 +81,8 @@ class ModalAttribution extends React.Component {
81 81
 
82 82
   // 提交
83 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 86
       // eslint-disable-next-line no-unused-expressions
90 87
       this.openNotificationWithIcon('success', '操作成功')
91 88
       this.handleCancel()

+ 1
- 4
src/pages/customer/customerlist/components/changeStatus.jsx 查看文件

@@ -41,11 +41,8 @@ class ChangeStatus extends React.Component {
41 41
   };
42 42
 
43 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 46
       // eslint-disable-next-line no-unused-expressions
50 47
       this.openNotificationWithIcon('success', '操作成功')
51 48
       this.handleCancel()

+ 1
- 4
src/pages/customer/customerlist/components/integralRecord.jsx 查看文件

@@ -62,11 +62,8 @@ class ModalIntegralRecord extends React.Component {
62 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 67
       this.setState({ dataSource: res })
71 68
     }).catch(err => {
72 69
       this.openNotificationWithIcon('error', err)

+ 1
- 3
src/pages/customer/customerlist/customerDetail.jsx 查看文件

@@ -28,10 +28,8 @@ function header(props) {
28 28
     if (id === '' || id === undefined) {
29 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 33
       setData(res)
36 34
     })
37 35
   }

+ 1
- 3
src/pages/customer/independentList/index.jsx 查看文件

@@ -53,10 +53,8 @@ class ModalTable extends React.Component {
53 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 58
       this.setState({ dataSource: res })
61 59
     }).catch(err => {
62 60
       // eslint-disable-next-line no-unused-expressions

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

@@ -41,20 +41,14 @@ function body(props) {
41 41
 
42 42
   // 获取详情信息
43 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 45
       props.form.setFieldsValue(res)
49 46
     })
50 47
   }
51 48
 
52 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 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 52
       // eslint-disable-next-line no-unused-expressions
59 53
       <Alert
60 54
         style={{

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

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