Quellcode durchsuchen

Merge branch 'v3.5' of http://git.ycjcjy.com/zhiyuxing/estateagents-admin-manager into v3.5

周立森 vor 5 Jahren
Ursprung
Commit
447ee98d35

+ 18
- 13
src/pages/customer/customerlist/components/attribution.jsx Datei anzeigen

21
     super(props);
21
     super(props);
22
     this.state = {
22
     this.state = {
23
        dataSource: { records: [] },
23
        dataSource: { records: [] },
24
-       visibleData: { visible: false, customerId: '', realtyConsultant: '' },
24
+       visibleData: { visible: false, customerId: '', realtyConsultant: '', buildingId: '' },
25
     }
25
     }
26
   }
26
   }
27
 
27
 
28
   // 挂载之后
28
   // 挂载之后
29
   componentDidMount() {
29
   componentDidMount() {
30
-    this.getList({ pageNumber: 1, pageSize: 5 })
30
+    // this.getList({ pageNumber: 1, pageSize: 5 })
31
   }
31
   }
32
 
32
 
33
   componentDidUpdate(preProps, preState) {
33
   componentDidUpdate(preProps, preState) {
34
+    console.log(this.props.visibleData)
34
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
35
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
35
-      this.getList({ pageNumber: 1, pageSize: 5 })
36
+      this.getList({ pageNumber: 1, pageSize: 5, buildingId: this.props.visibleData.buildingId })
36
       this.setState({ visibleData: this.props.visibleData });
37
       this.setState({ visibleData: this.props.visibleData });
37
     }
38
     }
38
   }
39
   }
49
   }
50
   }
50
 
51
 
51
   getList(params) {
52
   getList(params) {
53
+    console.log('params: ', params)
54
+    if (params.buildingId === '') {
55
+      return
56
+    }
52
     // 网路请求
57
     // 网路请求
53
-    request({ ...apis.customer.consultant, params: { ...params } }).then(res => {
58
+    request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
54
       this.setState({ dataSource: res })
59
       this.setState({ dataSource: res })
55
     }).catch(err => {
60
     }).catch(err => {
56
       // eslint-disable-next-line no-unused-expressions
61
       // eslint-disable-next-line no-unused-expressions
68
 
73
 
69
    // 分页
74
    // 分页
70
   onChange(pageNum) {
75
   onChange(pageNum) {
71
-    this.getList({ pageNumber: pageNum, pageSize: 5 })
76
+    this.getList({ pageNumber: pageNum, pageSize: 5, buildingId: this.props.visibleData.buildingId })
72
   }
77
   }
73
 
78
 
74
   // 提交
79
   // 提交
75
   submitGm(record) {
80
   submitGm(record) {
76
     // 网路请求
81
     // 网路请求
77
-    request({ ...apis.customer.recommendEdit, urlData: { id: this.state.visibleData.customerId }, data: { customerId: this.state.visibleData.customerId, realtyConsultant: record.personId } }).then(res => {
82
+    request({ ...apis.customer.recommendEdit, urlData: { id: this.state.visibleData.customerId }, data: { customerId: this.state.visibleData.customerId, realtyConsultant: record.userId } }).then(res => {
78
       // eslint-disable-next-line no-unused-expressions
83
       // eslint-disable-next-line no-unused-expressions
79
       this.openNotificationWithIcon('success', '操作成功')
84
       this.openNotificationWithIcon('success', '操作成功')
80
       this.handleCancel()
85
       this.handleCancel()
88
     const columns = [
93
     const columns = [
89
       // {
94
       // {
90
       //   title: '编号',
95
       //   title: '编号',
91
-      //   dataIndex: 'personId',
92
-      //   key: 'personId',
96
+      //   dataIndex: 'userId',
97
+      //   key: 'userId',
93
       // },
98
       // },
94
       {
99
       {
95
         title: '姓名',
100
         title: '姓名',
96
-        dataIndex: 'name',
97
-        key: 'name',
101
+        dataIndex: 'userName',
102
+        key: 'userName',
98
       },
103
       },
99
       {
104
       {
100
         title: '电话',
105
         title: '电话',
108
       },
113
       },
109
       {
114
       {
110
         title: '岗位',
115
         title: '岗位',
111
-        dataIndex: 'post',
112
-        key: 'post',
116
+        dataIndex: 'position',
117
+        key: 'position',
113
       },
118
       },
114
       {
119
       {
115
         title: '操作',
120
         title: '操作',
116
         dataIndex: 'personId',
121
         dataIndex: 'personId',
117
         key: 'personId',
122
         key: 'personId',
118
         // eslint-disable-next-line no-nested-ternary
123
         // eslint-disable-next-line no-nested-ternary
119
-        render: (_, record) => <>{ this.props.visibleData.realtyConsultant !== record.personId && <Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>,
124
+        render: (_, record) => <>{ this.props.visibleData.realtyConsultant != record.userId && <Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>,
120
       },
125
       },
121
     ]
126
     ]
122
     return (
127
     return (

+ 5
- 5
src/pages/customer/customerlist/index.jsx Datei anzeigen

37
 
37
 
38
   // 调整归属 ============  start
38
   // 调整归属 ============  start
39
   // eslint-disable-next-line react-hooks/rules-of-hooks
39
   // eslint-disable-next-line react-hooks/rules-of-hooks
40
-  const [gVisibleData, setGVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '' })
40
+  const [gVisibleData, setGVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
41
   // 调整归属 ============= end
41
   // 调整归属 ============= end
42
 
42
 
43
   // 积分记录 ============  start
43
   // 积分记录 ============  start
123
   // 所有这里临时解决方法是,弹出一个Modal对话框的时候,把其他的对话框给隐藏
123
   // 所有这里临时解决方法是,弹出一个Modal对话框的时候,把其他的对话框给隐藏
124
 
124
 
125
   function showGM(record) {
125
   function showGM(record) {
126
-    setGVisibleData({ visible: true, customerId: record.customerId, realtyConsultant: record.realtyConsultant })
126
+    setGVisibleData({ visible: true, customerId: record.customerId, realtyConsultant: record.realtyConsultant, buildingId: record.buildingId })
127
     setRecordVisibleData({ visible: false, customerId: '' })
127
     setRecordVisibleData({ visible: false, customerId: '' })
128
     setStatusVisibleData({ visible: false, customerId: '' })
128
     setStatusVisibleData({ visible: false, customerId: '' })
129
   }
129
   }
130
 
130
 
131
   function showRecord(record) {
131
   function showRecord(record) {
132
     setRecordVisibleData({ visible: true, customerId: record.customerId })
132
     setRecordVisibleData({ visible: true, customerId: record.customerId })
133
-    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
133
+    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
134
     setStatusVisibleData({ visible: false, customerId: '' })
134
     setStatusVisibleData({ visible: false, customerId: '' })
135
   }
135
   }
136
 
136
 
137
   function showStatus(record) {
137
   function showStatus(record) {
138
     setRecordVisibleData({ visible: false, customerId: '' })
138
     setRecordVisibleData({ visible: false, customerId: '' })
139
-    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
139
+    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
140
     setStatusVisibleData({ visible: true, customerId: record.customerId, status: record.status })
140
     setStatusVisibleData({ visible: true, customerId: record.customerId, status: record.status })
141
   }
141
   }
142
   function toCustomerDateil(record) {
142
   function toCustomerDateil(record) {
173
 
173
 
174
   // 关闭调整归属的窗口
174
   // 关闭调整归属的窗口
175
   function closeAttribution() {
175
   function closeAttribution() {
176
-    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
176
+    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
177
     getList({ pageNum: 1, pageSize: 10, customerType, ...props.form.getFieldsValue() })
177
     getList({ pageNum: 1, pageSize: 10, customerType, ...props.form.getFieldsValue() })
178
   }
178
   }
179
 
179
 

+ 16
- 16
src/pages/staff/list/editStaff.jsx Datei anzeigen

158
       </Select>,
158
       </Select>,
159
       value: userData.roleIds,
159
       value: userData.roleIds,
160
     },
160
     },
161
-    {
162
-      label: '标签',
163
-      name: 'taTags',
164
-      render: <Select
165
-        mode="multiple"
166
-        style={{ width: '100%' }}
167
-        placeholder="请选择标签"
168
-        onChange={tagsChange} >
169
-        {tagData.map(item => (
170
-          <Select.Option key={item.tagId} value={item.tagId}>
171
-            {item.tagName}
172
-          </Select.Option>
173
-        ))}
174
-      </Select>,
175
-      value: userData.taTags,
176
-    },
161
+    // {
162
+    //   label: '标签',
163
+    //   name: 'taTags',
164
+    //   render: <Select
165
+    //     mode="multiple"
166
+    //     style={{ width: '100%' }}
167
+    //     placeholder="请选择标签"
168
+    //     onChange={tagsChange} >
169
+    //     {tagData.map(item => (
170
+    //       <Select.Option key={item.tagId} value={item.tagId}>
171
+    //         {item.tagName}
172
+    //       </Select.Option>
173
+    //     ))}
174
+    //   </Select>,
175
+    //   value: userData.taTags,
176
+    // },
177
     {
177
     {
178
       label: '地址',
178
       label: '地址',
179
       name: 'address',
179
       name: 'address',

+ 1
- 1
src/pages/system/document/list.jsx Datei anzeigen

84
       dataIndex: 'createDate',
84
       dataIndex: 'createDate',
85
       key: 'createDate',
85
       key: 'createDate',
86
       align: 'center',
86
       align: 'center',
87
-      render: (createDate) => moment(createDate).format('YYYY-MM-DD h:mm:ss')
87
+      render: (createDate) => moment(createDate).format('YYYY-MM-DD HH:mm:ss')
88
     },
88
     },
89
 
89
 
90
     {
90
     {

+ 5
- 0
src/services/apis.js Datei anzeigen

236
       url: `${prefix}/consultant`,
236
       url: `${prefix}/consultant`,
237
       action: 'admin.consultant.get',
237
       action: 'admin.consultant.get',
238
     },
238
     },
239
+    buildingConsultant: {
240
+      method: 'GET',
241
+      url: `${prefix}/building/consultant`,
242
+      action: 'admin.building.consultant.get',
243
+    },
239
     recommendEdit: {
244
     recommendEdit: {
240
       method: 'PUT',
245
       method: 'PUT',
241
       url: `${prefix}/customer/recommend/edit/:id`,
246
       url: `${prefix}/customer/recommend/edit/:id`,

+ 1
- 1
src/utils/request.js Datei anzeigen

92
           throw new Error('请登录系统');
92
           throw new Error('请登录系统');
93
         } else {
93
         } else {
94
           notification.error({
94
           notification.error({
95
-            message,
95
+            message: message || '请求错误',
96
             // description: message,
96
             // description: message,
97
           });
97
           });
98
           throw new Error(message);
98
           throw new Error(message);