浏览代码

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

周立森 5 年前
父节点
当前提交
66160939be
共有 34 个文件被更改,包括 2581 次插入215 次删除
  1. 62
    4
      config/config.js
  2. 4
    4
      src/components/EchartsTest/index.jsx
  3. 40
    0
      src/components/SelectButton/NewTypeSelect.jsx
  4. 1
    0
      src/components/Wangedit/Wangedit.jsx
  5. 10
    0
      src/global.less
  6. 217
    0
      src/pages/building/list/add/components/base.jsx
  7. 112
    0
      src/pages/building/list/add/components/imageSet.jsx
  8. 82
    0
      src/pages/building/list/add/components/tags.jsx
  9. 67
    0
      src/pages/building/list/add/index.jsx
  10. 0
    0
      src/pages/building/list/add/style.less
  11. 7
    1
      src/pages/building/list/index.jsx
  12. 11
    17
      src/pages/building/type/edi.jsx
  13. 230
    0
      src/pages/carouselFigure/advertisingList.jsx
  14. 230
    0
      src/pages/carouselFigure/carouselFigureList.jsx
  15. 155
    0
      src/pages/carouselFigure/editAdvertising.jsx
  16. 155
    0
      src/pages/carouselFigure/editCarousel.jsx
  17. 0
    30
      src/pages/channel/InviteClients.jsx
  18. 0
    16
      src/pages/channel/brokerList.jsx
  19. 0
    1
      src/pages/channel/channelList.jsx
  20. 21
    12
      src/pages/customer/customerlist/components/attribution.jsx
  21. 84
    0
      src/pages/customer/customerlist/components/changeStatus.jsx
  22. 10
    11
      src/pages/customer/customerlist/components/integralRecord.jsx
  23. 116
    0
      src/pages/customer/customerlist/customerDetail.jsx
  24. 62
    25
      src/pages/customer/customerlist/index.jsx
  25. 78
    0
      src/pages/customer/customerlist/style.less
  26. 272
    14
      src/pages/customer/independentList/index.jsx
  27. 1
    1
      src/pages/customer/recommendCustomer/index.jsx
  28. 74
    9
      src/pages/integralMall/writeOff.jsx
  29. 166
    69
      src/pages/news/list/NewsList.jsx
  30. 148
    0
      src/pages/news/list/editNewsList.jsx
  31. 1
    1
      src/pages/news/type/NewsType.jsx
  32. 76
    0
      src/pages/system/messageList.jsx
  33. 73
    0
      src/pages/system/report.jsx
  34. 16
    0
      src/services/apis.js

+ 62
- 4
config/config.js 查看文件

122
                   name: '项目列表',
122
                   name: '项目列表',
123
                   component: './building/list/index',
123
                   component: './building/list/index',
124
                 },
124
                 },
125
+                {
126
+                  path: '/building/list/add',
127
+                  name: '', // 项目添加
128
+                  component: './building/list/add/index',
129
+                },
125
                 {
130
                 {
126
                   path: '/building/type',
131
                   path: '/building/type',
127
                   name: '项目类型',
132
                   name: '项目类型',
144
                   name: '客户列表',
149
                   name: '客户列表',
145
                   component: './customer/customerlist/index',
150
                   component: './customer/customerlist/index',
146
                 },
151
                 },
152
+                {
153
+                  path: '/customer/customerlist/customerDetail',
154
+                  name: '',
155
+                  component: './customer/customerlist/customerDetail',
156
+                },
147
                 {
157
                 {
148
                   path: '/customer/drift/list',
158
                   path: '/customer/drift/list',
149
                   name: '游客列表',
159
                   name: '游客列表',
265
                   name: '资讯列表',
275
                   name: '资讯列表',
266
                   component: './news/list/NewsList',
276
                   component: './news/list/NewsList',
267
                 },
277
                 },
278
+                {
279
+                  path: '/news/list/editNewsList',
280
+                  name: '',
281
+                  component: './news/list/editNewsList',
282
+                },
268
               ],
283
               ],
269
             },
284
             },
270
             {
285
             {
289
                 },
304
                 },
290
               ],
305
               ],
291
             },
306
             },
292
-
293
             {
307
             {
294
               path: '/staff',
308
               path: '/staff',
295
               name: '员工管理',
309
               name: '员工管理',
305
                   name: '',
319
                   name: '',
306
                   component: './staff/list/editStaff',
320
                   component: './staff/list/editStaff',
307
                 },
321
                 },
308
-             
322
+
309
                 {
323
                 {
310
                   path: '/staff/RoleList',
324
                   path: '/staff/RoleList',
311
                   name: '角色管理',
325
                   name: '角色管理',
316
                   name: '',
330
                   name: '',
317
                   component: './staff/list/editRole',
331
                   component: './staff/list/editRole',
318
                 },
332
                 },
319
-             
333
+
334
+              ],
335
+            },
336
+            {
337
+              path: '/carouselFigure',
338
+              name: '轮播图管理',
339
+              component: '../layouts/BlankLayout',
340
+              routes: [
341
+                {
342
+                  path: '/carouselFigure/carouselFigureList',
343
+                  name: '轮播图列表',
344
+                  component: './carouselFigure/carouselFigureList',
345
+                },
346
+                {
347
+                  path: '/carouselFigure/editCarousel',
348
+                  name: '',
349
+                  component: './carouselFigure/editCarousel',
350
+                },
351
+                {
352
+                  path: '/carouselFigure/advertisingList',
353
+                  name: '开屏广告',
354
+                  component: './carouselFigure/advertisingList',
355
+                },
356
+                {
357
+                  path: '/carouselFigure/editAdvertising',
358
+                  name: '',
359
+                  component: './carouselFigure/editAdvertising',
360
+                },
361
+              ],
362
+            },
363
+            {
364
+              path: '/system',
365
+              name: '系统管理',
366
+              component: '../layouts/BlankLayout',
367
+              routes: [
368
+                {
369
+                  path: '/system/messageList',
370
+                  name: '客户留言',
371
+                  component: './system/messageList',
372
+                },
373
+                {
374
+                  path: '/system/report',
375
+                  name: '报表数据',
376
+                  component: './system/report',
377
+                },
320
               ],
378
               ],
321
             },
379
             },
322
             {
380
             {
382
 
440
 
383
   proxy: {
441
   proxy: {
384
     '/api/': {
442
     '/api/': {
385
-      target: 'http://192.168.0.11:8080/',
443
+      target: 'http://127.0.0.1:8080/',
386
       changeOrigin: true,
444
       changeOrigin: true,
387
       // pathRewrite: { '^/server': '' },
445
       // pathRewrite: { '^/server': '' },
388
     },
446
     },

+ 4
- 4
src/components/EchartsTest/index.jsx 查看文件

3
 // 引入 ECharts 主模块
3
 // 引入 ECharts 主模块
4
 import echarts from 'echarts/lib/echarts';
4
 import echarts from 'echarts/lib/echarts';
5
 // 引入柱状图
5
 // 引入柱状图
6
-import  'echarts/lib/chart/bar';
6
+import 'echarts/lib/chart/bar';
7
 // 引入提示框和标题组件
7
 // 引入提示框和标题组件
8
 import 'echarts/lib/component/tooltip';
8
 import 'echarts/lib/component/tooltip';
9
 import 'echarts/lib/component/title';
9
 import 'echarts/lib/component/title';
10
 class Chart extends Component {
10
 class Chart extends Component {
11
 
11
 
12
-  render() { 
13
-    return ( <div></div> );
12
+  render() {
13
+    return (<div></div>);
14
   }
14
   }
15
 }
15
 }
16
- 
16
+
17
 export default Chart;
17
 export default Chart;

+ 40
- 0
src/components/SelectButton/NewTypeSelect.jsx 查看文件

1
+import React, { useState, useEffect } from 'react';
2
+import { Select } from 'antd';
3
+
4
+import request from '../../utils/request'
5
+
6
+const { Option } = Select;
7
+
8
+/**
9
+ *
10
+ *
11
+ * @param {*} props
12
+ * @returns
13
+ */
14
+const NewsTypeSelect = (props) => {
15
+  const [ data, setData ] = useState([])
16
+
17
+  useEffect(() => {
18
+    getCityList();
19
+  },[])
20
+
21
+  const getCityList = (e) => {
22
+    request({
23
+        url: '/api/admin/taNewsType',
24
+        method: 'GET',
25
+        params: {pageNum: 1,pageSize: 999},
26
+    }).then((data) => {
27
+        setData(data.records)
28
+    })
29
+  }
30
+
31
+  return (
32
+      <Select value={props.value} style={{ width: '180px' }} placeholder="请选择咨询类型" onChange={props.onChange}>
33
+          {data.map(type => (
34
+            <Option key={type.newsTypeId}>{type.newsTypeName}</Option>
35
+          ))}
36
+      </Select>
37
+  )
38
+}
39
+export default NewsTypeSelect
40
+

+ 1
- 0
src/components/Wangedit/Wangedit.jsx 查看文件

32
         this.props.onChange(html)
32
         this.props.onChange(html)
33
       }
33
       }
34
     }
34
     }
35
+    this.editor.customConfig.zIndex = 100
35
     this.editor.create()
36
     this.editor.create()
36
     this.editor.txt.html(this.props.value)
37
     this.editor.txt.html(this.props.value)
37
   }
38
   }

+ 10
- 0
src/global.less 查看文件

110
 }
110
 }
111
 .ant-table{
111
 .ant-table{
112
   line-height: 3;
112
   line-height: 3;
113
+}
114
+.ant-modal-header{
115
+  border-bottom: none;
116
+  .ant-modal-title{
117
+    font-size: 24px;
118
+    line-height: 50px;
119
+  }
120
+}
121
+.ant-modal-footer{
122
+  border-top:none;
113
 }
123
 }

+ 217
- 0
src/pages/building/list/add/components/base.jsx 查看文件

1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Radio, Tag, Tooltip, Tabs } from 'antd';
3
+import moment from 'moment';
4
+import request from '../../../../../utils/request';
5
+import apis from '../../../../../services/apis';
6
+import Styles from '../style.less';
7
+import { router } from 'umi';
8
+import ImageUpload from '../../../../../components/XForm/ImageUpload'
9
+import Wangedit from '../../../../../components/Wangedit/Wangedit'
10
+import TagGroup from './tags'
11
+
12
+const { Option } = Select
13
+const { TabPane } = Tabs;
14
+
15
+const formItemLayout = {
16
+  labelCol: {
17
+    xs: { span: 24 },
18
+    sm: { span: 2 },
19
+  },
20
+  wrapperCol: {
21
+    xs: { span: 24 },
22
+    sm: { span: 16 },
23
+  },
24
+};
25
+
26
+function AddBuilding(props) {
27
+  // eslint-disable-next-line react-hooks/rules-of-hooks
28
+  const [dataSource, setDataSource] = useState({ records: [] })
29
+
30
+  const [buildingAreaTags, setBuildingAreaTags] = useState({ tags: ['Unremovable', 'Tag 2', 'Tag 3'], inputVisible: false, inputValue: '' })
31
+
32
+
33
+  const { getFieldDecorator } = props.form;
34
+
35
+  function handleSubmit(e) {
36
+    e.preventDefault();
37
+    props.form.validateFieldsAndScroll((err, values) => {
38
+      if (!err) {
39
+        console.log('Received values of form: ', values);
40
+      }
41
+    });
42
+  }
43
+
44
+  return (
45
+        <Form {...formItemLayout} onSubmit={handleSubmit}>
46
+          <Form.Item label="楼盘编号">
47
+            {getFieldDecorator('code')(<Input />)}
48
+          </Form.Item>
49
+          <Form.Item label="楼盘名称" hasFeedback>
50
+            {getFieldDecorator('buildingName')(<Input />)}
51
+          </Form.Item>
52
+          <Form.Item label="别名" hasFeedback>
53
+            {getFieldDecorator('name')(<Input />)}
54
+          </Form.Item>
55
+          <Form.Item label="项目类型" hasFeedback>
56
+            {getFieldDecorator('name')(<Input />)}
57
+          </Form.Item>
58
+          <Form.Item label="均价" hasFeedback>
59
+            {getFieldDecorator('price')(<Input />)}
60
+          </Form.Item>
61
+          <Form.Item label="开盘时间" hasFeedback>
62
+            {getFieldDecorator('openingDate')(<DatePicker />)}
63
+          </Form.Item>
64
+          <Form.Item label="电话" hasFeedback>
65
+            {getFieldDecorator('tel')(<Input />)}
66
+          </Form.Item>
67
+          <Form.Item label="项目动态" hasFeedback>
68
+            {getFieldDecorator('dynamic')(<Input />)}
69
+          </Form.Item>
70
+          <Form.Item label="物业类型" hasFeedback>
71
+            {getFieldDecorator('buildingProperty')(
72
+              <Select mode="multiple" placeholder="物业类型" style={{ width: '1016px' }}>
73
+                <Option value="未知">未知</Option>
74
+              </Select>,
75
+            )}
76
+          </Form.Item>
77
+          <Form.Item label="销售状态" hasFeedback>
78
+            {getFieldDecorator('marketStatus')(<Input />)}
79
+          </Form.Item>
80
+          <Form.Item label="标签" hasFeedback>
81
+            {getFieldDecorator('tags')(
82
+              <Select mode="multiple" placeholder="标签" style={{ width: '1016px' }}>
83
+              <Option value="未知">未知</Option>
84
+              </Select>,
85
+            )}
86
+          </Form.Item>
87
+          <Form.Item label="项目主图" hasFeedback>
88
+            {getFieldDecorator('tags')(
89
+              <ImageUpload />,
90
+            )}
91
+          </Form.Item>
92
+          <Form.Item label="地址图片" hasFeedback>
93
+            {getFieldDecorator('tags')(
94
+              <ImageUpload />,
95
+            )}
96
+          </Form.Item>
97
+          <Form.Item label="海报底图" hasFeedback>
98
+            {getFieldDecorator('tags')(
99
+              <ImageUpload />,
100
+            )}
101
+          </Form.Item>
102
+          <Form.Item label="排序" hasFeedback>
103
+            {getFieldDecorator('orderNo')(<Input />)}
104
+          </Form.Item>
105
+          <Form.Item label="优惠信息" hasFeedback>
106
+            {getFieldDecorator('discount')(<Input />)}
107
+          </Form.Item>
108
+          <Form.Item label="首页推荐" hasFeedback>
109
+            {getFieldDecorator('isMain')(
110
+            <Radio.Group>
111
+              <Radio value={1}>是</Radio>
112
+              <Radio value={2}>否</Radio>
113
+            </Radio.Group>,
114
+            )}
115
+          </Form.Item>
116
+          <Form.Item label="所在城市" hasFeedback>
117
+            {getFieldDecorator('cityId')(
118
+              <Select placeholder="选择城市" style={{ width: '200px' }}>
119
+                <Option value="red">Red</Option>
120
+              </Select>,
121
+            )}
122
+          </Form.Item>
123
+          <Form.Item label="楼盘区域" hasFeedback>
124
+            {getFieldDecorator('buildingArea')(<Input />)}
125
+          </Form.Item>
126
+          <Form.Item label="项目地址" hasFeedback>
127
+            {getFieldDecorator('address')(<Input />)}
128
+          </Form.Item>
129
+          <Form.Item label="项目坐标" hasFeedback>
130
+            {getFieldDecorator('coordinate')(<Input disabled />)}
131
+          </Form.Item>
132
+          <Form.Item label="项目地址" hasFeedback>
133
+            {getFieldDecorator('coordinate')(<Input />)}
134
+          </Form.Item>
135
+          <Form.Item label="周边交通" hasFeedback>
136
+            {getFieldDecorator('buildingArea')(
137
+              <TagGroup />,
138
+            )}
139
+          </Form.Item>
140
+          <Form.Item label="周边交通" hasFeedback>
141
+            {getFieldDecorator('buildingMall')(
142
+              <TagGroup />,
143
+            )}
144
+          </Form.Item>
145
+          <Form.Item label="周边学校" hasFeedback>
146
+            {getFieldDecorator('buildingEdu')(
147
+              <TagGroup />,
148
+            )}
149
+          </Form.Item>
150
+          <Form.Item label="周边医院" hasFeedback>
151
+            {getFieldDecorator('buildingHospital')(
152
+              <TagGroup />,
153
+            )}
154
+          </Form.Item>
155
+          <Form.Item label="周边银行" hasFeedback>
156
+            {getFieldDecorator('buildingBank')(
157
+              <TagGroup />,
158
+            )}
159
+          </Form.Item>
160
+          <Form.Item label="周边餐饮" hasFeedback>
161
+            {getFieldDecorator('buildingRestaurant')(
162
+              <TagGroup />,
163
+            )}
164
+          </Form.Item>
165
+          <Form.Item label="绿化率" hasFeedback>
166
+            {getFieldDecorator('greeningRate')(<Input />)}
167
+          </Form.Item>
168
+          <Form.Item label="容积率" hasFeedback>
169
+            {getFieldDecorator('volumeRate')(<Input />)}
170
+          </Form.Item>
171
+          <Form.Item label="车位比" hasFeedback>
172
+            {getFieldDecorator('parkingRate')(<Input />)}
173
+          </Form.Item>
174
+          <Form.Item label="规划户数" hasFeedback>
175
+            {getFieldDecorator('familyNum')(<Input />)}
176
+          </Form.Item>
177
+          <Form.Item label="物业公司" hasFeedback>
178
+            {getFieldDecorator('serviceCompany')(<Input />)}
179
+          </Form.Item>
180
+          <Form.Item label="物业费" hasFeedback>
181
+            {getFieldDecorator('serviceFee')(<Input />)}
182
+          </Form.Item>
183
+          <Form.Item label="装修标准" hasFeedback>
184
+            {getFieldDecorator('decoration')(<Input />)}
185
+          </Form.Item>
186
+          <Form.Item label="交房时间" hasFeedback>
187
+            {getFieldDecorator('receivedDate')(<DatePicker />)}
188
+          </Form.Item>
189
+          <Form.Item label="产权年限" hasFeedback>
190
+            {getFieldDecorator('rightsYear')(<Input />)}
191
+          </Form.Item>
192
+          <Form.Item label="预售许可证" hasFeedback>
193
+            {getFieldDecorator('decoration')(
194
+              <ImageUpload />,
195
+            )}
196
+          </Form.Item>
197
+          <Form.Item label="项目备注" hasFeedback>
198
+            {getFieldDecorator('remark')(
199
+              <Wangedit />,
200
+            )}
201
+          </Form.Item>
202
+          <Form.Item style={{ width: '400px', margin: 'auto', display: 'flex', justifyContent: 'space-between' }}>
203
+            <Button type="primary" htmlType="submit">
204
+                确定
205
+            </Button>
206
+            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
207
+            <Button onClick={() => router.go(-1)}>
208
+                取消
209
+            </Button>
210
+          </Form.Item>
211
+        </Form>
212
+  )
213
+}
214
+
215
+const WrappedAddBuildingForm = Form.create({ name: 'addBuilding' })(AddBuilding);
216
+
217
+export default WrappedAddBuildingForm

+ 112
- 0
src/pages/building/list/add/components/imageSet.jsx 查看文件

1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Radio, Tag, Tooltip, Tabs, Table, notification } from 'antd';
3
+import moment from 'moment';
4
+import request from '../../../../../utils/request';
5
+import apis from '../../../../../services/apis';
6
+import Styles from '../style.less';
7
+import { router } from 'umi';
8
+
9
+
10
+const saleType = [
11
+  {
12
+    id: 1,
13
+    name: '待定',
14
+  },
15
+  {
16
+    id: 2,
17
+    name: '售罄',
18
+  },
19
+  {
20
+    id: 3,
21
+    name: '在售',
22
+  },
23
+]
24
+
25
+/**
26
+ *图片设置
27
+ *
28
+ * @param {*} props
29
+ * @returns
30
+ */
31
+function imageSet(props) {
32
+  // eslint-disable-next-line react-hooks/rules-of-hooks
33
+  const [data, setData] = useState([])
34
+
35
+  // eslint-disable-next-line react-hooks/rules-of-hooks
36
+  useEffect(() => {
37
+    getList()
38
+  }, [])
39
+
40
+  function openNotificationWithIcon(type, message) {
41
+    notification[type]({
42
+      message,
43
+      description:
44
+        '',
45
+    });
46
+  }
47
+
48
+  function getList(params) {
49
+    console.log(props)
50
+    // 网路请求
51
+    const { url, method } = apis.building.buildingApartment
52
+    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(props.building.buildingId)
53
+
54
+    request({ url: tempUrl, method, params: { ...params } }).then(res => {
55
+      setData(res)
56
+    }).catch(err => {
57
+      openNotificationWithIcon('error', err)
58
+    })
59
+  }
60
+
61
+
62
+  const columns = [
63
+    {
64
+      title: '名称',
65
+      dataIndex: 'apartmentName',
66
+      key: 'apartmentName',
67
+    },
68
+    {
69
+      title: '类型',
70
+      dataIndex: 'apartmentType',
71
+      key: 'apartmentType',
72
+      render: (_, record) => <span>{ record.apartmentType === 'apart' ? '户型' : '相册' }</span>,
73
+    },
74
+    {
75
+      title: '销售状态',
76
+      dataIndex: 'marketStatus',
77
+      key: 'marketStatus',
78
+      render: (_, record) => <span>{ (saleType.filter(x => x.id == record.marketStatus)[0] || {}).name }</span>,
79
+    },
80
+    {
81
+      title: '备注',
82
+      dataIndex: 'remark',
83
+      key: 'remark',
84
+    },
85
+    {
86
+      title: '创建时间',
87
+      dataIndex: 'createDate',
88
+      key: 'createDate',
89
+      render: (_, record) => <span>{ moment(record.createDate).format('YYYY-MM-DD') }</span>,
90
+    },
91
+    {
92
+      title: '操作',
93
+      dataIndex: 'apartmentId',
94
+      key: 'apartmentId',
95
+      render: (_, record) => (
96
+        <>
97
+          <Button type="link" style={{ color: 'red' }}>编辑</Button>
98
+          <Button type="link" style={{ color: 'red' }}>删除</Button>
99
+        </>
100
+      ),
101
+    },
102
+  ]
103
+
104
+  return (
105
+    <>
106
+      <Button type="primary">新增图片库</Button>
107
+      <Table dataSource={data} columns={columns} pagination={false} />
108
+    </>
109
+  )
110
+}
111
+
112
+export default imageSet

+ 82
- 0
src/pages/building/list/add/components/tags.jsx 查看文件

1
+import React from 'react'
2
+import { Tag, Input, Tooltip, Icon } from 'antd';
3
+
4
+class EditableTagGroup extends React.Component {
5
+  state = {
6
+    tags: [],
7
+    inputVisible: false,
8
+    inputValue: '',
9
+  };
10
+
11
+  handleClose = removedTag => {
12
+    const tags = this.state.tags.filter(tag => tag !== removedTag);
13
+    console.log(tags);
14
+    this.setState({ tags });
15
+  };
16
+
17
+  showInput = () => {
18
+    this.setState({ inputVisible: true }, () => this.input.focus());
19
+  };
20
+
21
+  handleInputChange = e => {
22
+    this.setState({ inputValue: e.target.value });
23
+  };
24
+
25
+  handleInputConfirm = () => {
26
+    const { inputValue } = this.state;
27
+    let { tags } = this.state;
28
+    if (inputValue && tags.indexOf(inputValue) === -1) {
29
+      tags = [...tags, inputValue];
30
+    }
31
+    console.log(tags);
32
+    this.setState({
33
+      tags,
34
+      inputVisible: false,
35
+      inputValue: '',
36
+    });
37
+  };
38
+
39
+  saveInputRef = input => (this.input = input);
40
+
41
+  render() {
42
+    const { tags, inputVisible, inputValue } = this.state;
43
+    return (
44
+      <div>
45
+        {tags.map((tag, index) => {
46
+          const isLongTag = tag.length > 20;
47
+          const tagElem = (
48
+            <Tag key={tag} closable={index !== 0} onClose={() => this.handleClose(tag)}>
49
+              {isLongTag ? `${tag.slice(0, 20)}...` : tag}
50
+            </Tag>
51
+          );
52
+          return isLongTag ? (
53
+            <Tooltip title={tag} key={tag}>
54
+              {tagElem}
55
+            </Tooltip>
56
+          ) : (
57
+            tagElem
58
+          );
59
+        })}
60
+        {inputVisible && (
61
+          <Input
62
+            ref={this.saveInputRef}
63
+            type="text"
64
+            size="small"
65
+            style={{ width: 78 }}
66
+            value={inputValue}
67
+            onChange={this.handleInputChange}
68
+            onBlur={this.handleInputConfirm}
69
+            onPressEnter={this.handleInputConfirm}
70
+          />
71
+        )}
72
+        {!inputVisible && (
73
+          <Tag onClick={this.showInput} style={{ background: '#fff', borderStyle: 'dashed' }}>
74
+            <Icon type="plus" /> 新建
75
+          </Tag>
76
+        )}
77
+      </div>
78
+    );
79
+  }
80
+}
81
+
82
+export default EditableTagGroup

+ 67
- 0
src/pages/building/list/add/index.jsx 查看文件

1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Radio, Tag, Tooltip, Tabs } from 'antd';
3
+import moment from 'moment';
4
+import request from '../../../../utils/request';
5
+import apis from '../../../../services/apis';
6
+import Styles from './style.less';
7
+import { router } from 'umi';
8
+
9
+
10
+import ImageUpload from '../../../../components/XForm/ImageUpload'
11
+import Wangedit from '../../../../components/Wangedit/Wangedit'
12
+import TagGroup from './components/tags'
13
+import Base from './components/base'
14
+import ImageSet from './components/imageSet'
15
+
16
+
17
+const { Option } = Select
18
+const { TabPane } = Tabs;
19
+
20
+const formItemLayout = {
21
+  labelCol: {
22
+    xs: { span: 24 },
23
+    sm: { span: 2 },
24
+  },
25
+  wrapperCol: {
26
+    xs: { span: 24 },
27
+    sm: { span: 16 },
28
+  },
29
+};
30
+
31
+function AddBuilding(props) {
32
+  // eslint-disable-next-line react-hooks/rules-of-hooks
33
+  const [dataSource, setDataSource] = useState({ records: [] })
34
+
35
+  const [buildingAreaTags, setBuildingAreaTags] = useState({ tags: ['Unremovable', 'Tag 2', 'Tag 3'], inputVisible: false, inputValue: '' })
36
+
37
+
38
+  const { getFieldDecorator } = props.form;
39
+
40
+  function handleSubmit(e) {
41
+    e.preventDefault();
42
+    props.form.validateFieldsAndScroll((err, values) => {
43
+      if (!err) {
44
+        console.log('Received values of form: ', values);
45
+      }
46
+    });
47
+  }
48
+
49
+  function tabsCallback(key) {
50
+    console.log(key);
51
+  }
52
+
53
+  return (
54
+    <Tabs defaultActiveKey="1" onChange={tabsCallback}>
55
+      <TabPane tab="基本信息" key="1">
56
+        <Base />
57
+      </TabPane>
58
+      <TabPane tab="图片" key="2">
59
+        <ImageSet building={{ buildingId: '159fd19bb973b6972c10fbebf07ddeb1' }} />
60
+      </TabPane>
61
+    </Tabs>
62
+  )
63
+}
64
+
65
+const WrappedAddBuildingForm = Form.create({ name: 'addBuilding' })(AddBuilding);
66
+
67
+export default WrappedAddBuildingForm

+ 0
- 0
src/pages/building/list/add/style.less 查看文件


+ 7
- 1
src/pages/building/list/index.jsx 查看文件

4
 import request from '../../../utils/request';
4
 import request from '../../../utils/request';
5
 import apis from '../../../services/apis';
5
 import apis from '../../../services/apis';
6
 import Styles from './style.less';
6
 import Styles from './style.less';
7
+import { router } from 'umi';
7
 
8
 
8
 
9
 
9
 const { Option } = Select;
10
 const { Option } = Select;
137
     console.log(value, dateString)
138
     console.log(value, dateString)
138
   }
139
   }
139
 
140
 
141
+
142
+  function toAdd() {
143
+    router.push({ pathname: '/building/list/add' })
144
+  }
145
+
140
   return (
146
   return (
141
     <>
147
     <>
142
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
148
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
200
           </Button>
206
           </Button>
201
         </Form.Item>
207
         </Form.Item>
202
       </Form>
208
       </Form>
203
-      <Button type="primary" className={Styles.addButton}>
209
+      <Button type="primary" className={Styles.addButton} onClick={() => toAdd()}>
204
         新增楼盘
210
         新增楼盘
205
       </Button>
211
       </Button>
206
 
212
 

+ 11
- 17
src/pages/building/type/edi.jsx 查看文件

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import { Input, Button, Row, Col, Form, Alert } from 'antd';
2
+import { Input, Button, Row, Col, Form, Alert, notification } from 'antd';
3
 import router from 'umi/router';
3
 import router from 'umi/router';
4
 import Styles from './style.less';
4
 import Styles from './style.less';
5
 import request from '../../../utils/request';
5
 import request from '../../../utils/request';
40
     })
40
     })
41
   }
41
   }
42
 
42
 
43
+  const openNotificationWithIcon = (type, message) => {
44
+    notification[type]({
45
+      message,
46
+      description:
47
+        '',
48
+    });
49
+  }
50
+
43
   function submitData(dataSources) {
51
   function submitData(dataSources) {
44
     if (id !== '') {
52
     if (id !== '') {
45
       // 修改
53
       // 修改
51
     dataSources.createDate = new Date()
59
     dataSources.createDate = new Date()
52
     request({ ...apis.buildingType.add, data: { ...dataSources } }).then(() => {
60
     request({ ...apis.buildingType.add, data: { ...dataSources } }).then(() => {
53
       // eslint-disable-next-line no-unused-expressions
61
       // eslint-disable-next-line no-unused-expressions
54
-      <Alert
55
-        style={{
56
-          marginBottom: 24,
57
-        }}
58
-        message="操作成功"
59
-        type="success"
60
-        showIcon
61
-      />
62
+      this.openNotificationWithIcon('success', '操作成功')
62
       router.go(-1)
63
       router.go(-1)
63
     }).catch(err => {
64
     }).catch(err => {
64
       // eslint-disable-next-line no-unused-expressions
65
       // eslint-disable-next-line no-unused-expressions
65
-      <Alert
66
-        style={{
67
-          marginBottom: 24,
68
-        }}
69
-        message={ err }
70
-        type="err"
71
-        showIcon
72
-      />
66
+      this.openNotificationWithIcon('error', err)
73
     })
67
     })
74
   }
68
   }
75
 
69
 

+ 230
- 0
src/pages/carouselFigure/advertisingList.jsx 查看文件

1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../style/GoodsList.less';
5
+import router from 'umi/router';
6
+import moment from 'moment';
7
+import SelectCity from '../../components/SelectButton/CitySelect'
8
+import BuildSelect from '../../components/SelectButton/BuildSelect'
9
+
10
+import request from '../../utils/request'
11
+
12
+const { Option } = Select;
13
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
14
+
15
+const header = (props) => {
16
+  const [ data, setData ] = useState({})
17
+//   const [page, changePage] = useState({})
18
+
19
+  useEffect(() => {
20
+    getList({ pageNum: 1, pageSize: 10, showType: 'screen' });
21
+  },[])
22
+
23
+  // 查询列表
24
+  const getList = (params) => {
25
+    request({
26
+        url: '/api/admin/extendContent',
27
+        method: 'GET',
28
+        params: { ...params },
29
+    }).then((data) => {
30
+        console.log(data)
31
+        setData(data)
32
+    })
33
+  }
34
+
35
+  
36
+// 跳转到编辑商品
37
+const toEdit = (contentId) => () => {
38
+    router.push({
39
+      pathname: '/carouselFigure/editAdvertising',
40
+      query: {
41
+        contentId
42
+      },
43
+    });
44
+  }
45
+  
46
+  const columns = [
47
+    {
48
+      title: '主图',
49
+      dataIndex: 'image',
50
+      key: 'image',
51
+      align: 'center',
52
+      render: (image) => <img src={image} className={styles.touxiang} />,
53
+    },
54
+    {
55
+      title: '类型',
56
+      dataIndex: 'contentType',
57
+      key: 'contentType',
58
+      align: 'center',
59
+      render: (contentType) => <span>{ contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' : '' }</span>
60
+    },
61
+    {
62
+      title: '发布位置',
63
+      dataIndex: 'showPosition',
64
+      key: 'showPosition',
65
+      align: 'center',
66
+      render: (showPosition) => <span>{ showPosition === 'index' ? '首页' : showPosition === 'mall' ? '商城' : '' }</span>
67
+    },
68
+    {
69
+      title: '发布时间',
70
+      dataIndex: 'createDate',
71
+      key: 'createDate',
72
+      align: 'center',
73
+      render: (x, row) => <><span>{moment(row.createDate).format('YYYY-MM-DD')}</span></>
74
+    },
75
+    {
76
+      title: '状态',
77
+      dataIndex: 'status',
78
+      key: 'status',
79
+      align: 'center',
80
+      render: (status)=> <><span>{status == 1 ? '启用' : '停用'}</span></>
81
+    },
82
+    {
83
+      title: '操作',
84
+      dataIndex: 'handle',
85
+      key: 'handle',
86
+      align: 'center',
87
+      render: (x,row) => <>
88
+                           <span style={{ color: '#1990FF', marginRight: '20px' }} onClick={changeStatus(row)}>{ row.status === 1 ? '禁用' : '启用' }<Icon type="vertical-align-top" className={styles.edit} /></span>
89
+                           <span style={{ color: '#FF925C' }} onClick={toEdit(row.contentId)}>编辑<Icon type="form" className={styles.edit} /></span>
90
+                         </>
91
+    },
92
+  ];
93
+  
94
+  const finishDynamic = (row) => {
95
+      Modal.confirm({
96
+          title: '结束以后将无法编辑, 是否继续?',
97
+          okText: '确定',
98
+          cancelText: '取消',
99
+          onOk() {
100
+              request({
101
+                  url: '/api/admin/buildingDynamic/finish',
102
+                  method: 'PUT',
103
+                  data: {dynamicId: row.dynamicId, top: ""},
104
+              }).then((data) => {
105
+                  console.log(data)
106
+                  message.info('操作成功!')
107
+                  getList({ pageNum: 1, pageSize: 10, showType: 'screen' })
108
+              }).catch((err) => {
109
+                  console.log(err)
110
+                  message.info(err.msg || err.message)
111
+              })
112
+          },
113
+        });
114
+  }
115
+  
116
+//   停用启用
117
+  const changeStatus = (row) => () => {
118
+      console.log(row)
119
+      if(row.status === 0) {
120
+        row.status = 1
121
+        Modal.confirm({
122
+          title: '确认发布此数据?',
123
+          okText: '确定',
124
+          cancelText: '取消',
125
+          onOk() {
126
+              request({
127
+                  url: '/api/admin/extendContent/'+row.contentId,
128
+                  method: 'PUT',
129
+                  data: row,
130
+              }).then((data) => {
131
+                  message.info('操作成功!')
132
+                  getList({ pageNum: 1, pageSize: 10, showType: 'screen' })
133
+              }).catch((err) => {
134
+                  console.log(err)
135
+                  message.info(err.msg || err.message)
136
+              })
137
+          },
138
+        });
139
+      }else if(row.status === 1){
140
+        row.status = 0
141
+        Modal.confirm({
142
+          title: '确认停用此轮播图?',
143
+          okText: '确定',
144
+          cancelText: '取消',
145
+          onOk() {
146
+              request({
147
+                  url: '/api/admin/extendContent/'+row.contentId,
148
+                  method: 'PUT',
149
+                  data: row,
150
+              }).then((data) => {
151
+                  message.info('操作成功!')
152
+                  getList({ pageNum: 1, pageSize: 10, showType: 'screen' })
153
+              }).catch((err) => {
154
+                  console.log(err)
155
+                  message.info(err.msg || err.message)
156
+              })
157
+          },
158
+        });
159
+      }
160
+
161
+  }
162
+  
163
+  const changePageNum = (pageNumber) => {
164
+      getList({ pageNum: pageNumber, pageSize: 10, showType: 'screen' })
165
+  }
166
+
167
+  // 提交事件
168
+const handleSubmit = (e, props) => {
169
+    e.preventDefault();
170
+    props.form.validateFields((err, values) => {
171
+      if (!err) {
172
+        console.log('提交数据: ', values)
173
+        getList({ pageNum: 1, pageSize: 10, ...values, showType: 'screen' })
174
+      }
175
+    });
176
+  }
177
+
178
+  const { getFieldDecorator } = props.form
179
+  return (
180
+
181
+    <>
182
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
183
+        <Form.Item>
184
+          {getFieldDecorator('buildingId')(
185
+            <BuildSelect />,
186
+          )}
187
+        </Form.Item>
188
+        <Form.Item>
189
+          {getFieldDecorator('contentType')(
190
+            <Select style={{ width: '180px' }} placeholder="类型">
191
+              <Option value="activity">活动</Option>
192
+              <Option value="project">项目</Option>
193
+              <Option value="news">资讯</Option>
194
+              <Option value="other">其他</Option>
195
+            </Select>,
196
+          )}
197
+        </Form.Item>
198
+        <Form.Item>
199
+          {getFieldDecorator('showPosition')(
200
+            <Select style={{ width: '180px' }} placeholder="发布位置">
201
+              <Option value="mall">商城</Option>
202
+              <Option value="index">首页</Option>
203
+            </Select>,
204
+          )}
205
+        </Form.Item>
206
+        <Form.Item>
207
+          {getFieldDecorator('status')(
208
+            <Select style={{ width: '180px' }} placeholder="状态">
209
+              <Option value="1">启用</Option>
210
+              <Option value="0">停用</Option>
211
+            </Select>,
212
+          )}
213
+        </Form.Item>
214
+        <Form.Item>
215
+          <Button type="primary" htmlType="submit" className={styles.searchBtn}>
216
+            搜索
217
+          </Button>
218
+        </Form.Item>
219
+      </Form>
220
+      <Button type="primary" className={styles.addBtn} onClick={toEdit()}>新增</Button>
221
+      <Table dataSource={data.records} columns={columns} pagination={false}/>
222
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
223
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
224
+      </div>
225
+    </>
226
+  )
227
+}
228
+const WrappedHeader = Form.create({ name: 'header' })(header);
229
+
230
+export default WrappedHeader

+ 230
- 0
src/pages/carouselFigure/carouselFigureList.jsx 查看文件

1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../style/GoodsList.less';
5
+import router from 'umi/router';
6
+import moment from 'moment';
7
+import SelectCity from '../../components/SelectButton/CitySelect'
8
+import BuildSelect from '../../components/SelectButton/BuildSelect'
9
+
10
+import request from '../../utils/request'
11
+
12
+const { Option } = Select;
13
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
14
+
15
+const header = (props) => {
16
+  const [ data, setData ] = useState({})
17
+//   const [page, changePage] = useState({})
18
+
19
+  useEffect(() => {
20
+    getList({ pageNum: 1, pageSize: 10, showType: 'banner' });
21
+  },[])
22
+
23
+  // 查询列表
24
+  const getList = (params) => {
25
+    request({
26
+        url: '/api/admin/extendContent',
27
+        method: 'GET',
28
+        params: { ...params },
29
+    }).then((data) => {
30
+        console.log(data)
31
+        setData(data)
32
+    })
33
+  }
34
+
35
+  
36
+// 跳转到编辑页面
37
+const toEditCarouse = (contentId) => () => {
38
+    router.push({
39
+      pathname: '/carouselFigure/editCarousel',
40
+      query: {
41
+        contentId
42
+      },
43
+    });
44
+  }
45
+  
46
+  const columns = [
47
+    {
48
+      title: '主图',
49
+      dataIndex: 'image',
50
+      key: 'image',
51
+      align: 'center',
52
+      render: (image) => <img src={image} className={styles.touxiang} />,
53
+    },
54
+    {
55
+      title: '类型',
56
+      dataIndex: 'contentType',
57
+      key: 'contentType',
58
+      align: 'center',
59
+      render: (contentType) => <span>{ contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' : '' }</span>
60
+    },
61
+    {
62
+      title: '发布位置',
63
+      dataIndex: 'showPosition',
64
+      key: 'showPosition',
65
+      align: 'center',
66
+      render: (showPosition) => <span>{ showPosition === 'index' ? '首页' : showPosition === 'mall' ? '商城' : '' }</span>
67
+    },
68
+    {
69
+      title: '发布时间',
70
+      dataIndex: 'createDate',
71
+      key: 'createDate',
72
+      align: 'center',
73
+      render: (x, row) => <><span>{moment(row.createDate).format('YYYY-MM-DD')}</span></>
74
+    },
75
+    {
76
+      title: '状态',
77
+      dataIndex: 'status',
78
+      key: 'status',
79
+      align: 'center',
80
+      render: (status)=> <><span>{status == 1 ? '启用' : '停用'}</span></>
81
+    },
82
+    {
83
+      title: '操作',
84
+      dataIndex: 'handle',
85
+      key: 'handle',
86
+      align: 'center',
87
+      render: (x,row) => <>
88
+                           <span style={{ color: '#1990FF', marginRight: '20px' }} onClick={changeStatus(row)}>{ row.status === 1 ? '禁用' : '启用' }<Icon type="vertical-align-top" className={styles.edit} /></span>
89
+                           <span style={{ color: '#FF925C' }} onClick={toEditCarouse(row.contentId)}>编辑<Icon type="form" className={styles.edit} /></span>
90
+                         </>
91
+    },
92
+  ];
93
+  
94
+  const finishDynamic = (row) => {
95
+      Modal.confirm({
96
+          title: '结束以后将无法编辑, 是否继续?',
97
+          okText: '确定',
98
+          cancelText: '取消',
99
+          onOk() {
100
+              request({
101
+                  url: '/api/admin/buildingDynamic/finish',
102
+                  method: 'PUT',
103
+                  data: {dynamicId: row.dynamicId, top: ""},
104
+              }).then((data) => {
105
+                  console.log(data)
106
+                  message.info('操作成功!')
107
+                  getList({ pageNum: 1, pageSize: 10, showType: 'banner' })
108
+              }).catch((err) => {
109
+                  console.log(err)
110
+                  message.info(err.msg || err.message)
111
+              })
112
+          },
113
+        });
114
+  }
115
+  
116
+//   停用启用
117
+  const changeStatus = (row) => () => {
118
+      console.log(row)
119
+      if(row.status === 0) {
120
+        row.status = 1
121
+        Modal.confirm({
122
+          title: '确认发布此数据?',
123
+          okText: '确定',
124
+          cancelText: '取消',
125
+          onOk() {
126
+              request({
127
+                  url: '/api/admin/extendContent/'+row.contentId,
128
+                  method: 'PUT',
129
+                  data: row,
130
+              }).then((data) => {
131
+                  message.info('操作成功!')
132
+                  getList({ pageNum: 1, pageSize: 10, showType: 'banner' })
133
+              }).catch((err) => {
134
+                  console.log(err)
135
+                  message.info(err.msg || err.message)
136
+              })
137
+          },
138
+        });
139
+      }else if(row.status === 1){
140
+        row.status = 0
141
+        Modal.confirm({
142
+          title: '确认停用此轮播图?',
143
+          okText: '确定',
144
+          cancelText: '取消',
145
+          onOk() {
146
+              request({
147
+                  url: '/api/admin/extendContent/'+row.contentId,
148
+                  method: 'PUT',
149
+                  data: row,
150
+              }).then((data) => {
151
+                  message.info('操作成功!')
152
+                  getList({ pageNum: 1, pageSize: 10, showType: 'banner' })
153
+              }).catch((err) => {
154
+                  console.log(err)
155
+                  message.info(err.msg || err.message)
156
+              })
157
+          },
158
+        });
159
+      }
160
+
161
+  }
162
+  
163
+  const changePageNum = (pageNumber) => {
164
+      getList({ pageNum: pageNumber, pageSize: 10, showType: 'banner' })
165
+  }
166
+
167
+  // 提交事件
168
+const handleSubmit = (e, props) => {
169
+    e.preventDefault();
170
+    props.form.validateFields((err, values) => {
171
+      if (!err) {
172
+        console.log('提交数据: ', values)
173
+        getList({ pageNum: 1, pageSize: 10, ...values, showType: 'banner' })
174
+      }
175
+    });
176
+  }
177
+
178
+  const { getFieldDecorator } = props.form
179
+  return (
180
+
181
+    <>
182
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
183
+        <Form.Item>
184
+          {getFieldDecorator('buildingId')(
185
+            <BuildSelect />,
186
+          )}
187
+        </Form.Item>
188
+        <Form.Item>
189
+          {getFieldDecorator('contentType')(
190
+            <Select style={{ width: '180px' }} placeholder="类型">
191
+              <Option value="activity">活动</Option>
192
+              <Option value="project">项目</Option>
193
+              <Option value="news">资讯</Option>
194
+              <Option value="other">其他</Option>
195
+            </Select>,
196
+          )}
197
+        </Form.Item>
198
+        <Form.Item>
199
+          {getFieldDecorator('showPosition')(
200
+            <Select style={{ width: '180px' }} placeholder="发布位置">
201
+              <Option value="mall">商城</Option>
202
+              <Option value="index">首页</Option>
203
+            </Select>,
204
+          )}
205
+        </Form.Item>
206
+        <Form.Item>
207
+          {getFieldDecorator('status')(
208
+            <Select style={{ width: '180px' }} placeholder="状态">
209
+              <Option value="1">启用</Option>
210
+              <Option value="0">停用</Option>
211
+            </Select>,
212
+          )}
213
+        </Form.Item>
214
+        <Form.Item>
215
+          <Button type="primary" htmlType="submit" className={styles.searchBtn}>
216
+            搜索
217
+          </Button>
218
+        </Form.Item>
219
+      </Form>
220
+      <Button type="primary" className={styles.addBtn} onClick={toEditCarouse()}>新增</Button>
221
+      <Table dataSource={data.records} columns={columns} pagination={false}/>
222
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
223
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
224
+      </div>
225
+    </>
226
+  )
227
+}
228
+const WrappedHeader = Form.create({ name: 'header' })(header);
229
+
230
+export default WrappedHeader

+ 155
- 0
src/pages/carouselFigure/editAdvertising.jsx 查看文件

1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker,message } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../style/GoodsList.less';
5
+import moment from 'moment';
6
+import router from 'umi/router';
7
+import BuildSelect from '../../components/SelectButton/BuildSelect'
8
+import XForm, { FieldTypes } from '../../components/XForm';
9
+import Wangedit from '../../components/Wangedit/Wangedit'
10
+import request from '../../utils/request'
11
+
12
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
13
+/**
14
+ *
15
+ *
16
+ * @param {*} props
17
+ * @returns
18
+ */
19
+ const Edit = (props) => {
20
+  const [ tab, changeTab ] = useState('basic')
21
+  const contentId = props.location.query.contentId
22
+  const [ data, setData ] = useState({})
23
+  if(contentId){
24
+    useEffect(() => {
25
+      getDetail(contentId);
26
+    },[])
27
+
28
+  // 查询列表
29
+  const getDetail = (contentId) => {
30
+    request({
31
+        url: '/api/admin/extendContent/' + contentId,
32
+        method: 'GET',
33
+    }).then((data) => {
34
+        console.log(data)
35
+        setData(data)
36
+    })
37
+  }
38
+  }
39
+
40
+  const cancelPage = () =>{
41
+    router.push({
42
+      pathname: '/carouselFigure/advertisingList',
43
+    });
44
+  }
45
+ 
46
+    const fields = [
47
+      {
48
+        label: '所属项目',
49
+        name: 'buildingId',
50
+        render: <BuildSelect />,
51
+        value: data.buildingId,
52
+      },
53
+      {
54
+        label: '商品图片',
55
+        name: 'image',
56
+        type: FieldTypes.ImageUploader,
57
+        value: data.image,
58
+      },
59
+      {
60
+        label: '标题',
61
+        name: 'title',
62
+        type: FieldTypes.Text,
63
+        value: data.title,
64
+      },
65
+      // {
66
+      //   label: '发布位置',
67
+      //   name: 'showPosition',
68
+      //   type: FieldTypes.Select,
69
+      //   dict: [{
70
+      //     label: '首页',
71
+      //     value: 'index'
72
+      //   },
73
+      //   {
74
+      //     label: '商城',
75
+      //     value: 'mall'
76
+      //   }],
77
+      //   value: data.showPosition,
78
+      // },
79
+      {
80
+        label: '类型',
81
+        name: 'contentType',
82
+        type: FieldTypes.Select,
83
+        dict: [{
84
+          label: '活动',
85
+          value: 'activity'
86
+        },
87
+        {
88
+          label: '项目',
89
+          value: 'project'
90
+        },
91
+        {
92
+          label: '资讯',
93
+          value: 'news'
94
+        },
95
+        {
96
+          label: '其他',
97
+          value: 'other'
98
+        }],
99
+        value: data.contentType,
100
+      },
101
+      // {
102
+      //   label: '发布内容',
103
+      //   name: 'content',
104
+      //   render: <Wangedit />,
105
+      //   value: data.content,
106
+      // },
107
+      {
108
+        label: '状态',
109
+        name: 'status',
110
+        type: FieldTypes.Select,
111
+        dict: [{
112
+          label: "启用",
113
+          value: 1
114
+        },
115
+        {
116
+          label: "停用",
117
+          value: 0
118
+        },],
119
+        value: data.status != null ? data.status : 1,
120
+      },
121
+    ]
122
+  
123
+    const handleSubmit = val => { 
124
+      val.showType = 'screen'
125
+      if(contentId){
126
+        request({
127
+          url: '/api/admin/extendContent/'+contentId,
128
+          method: 'PUT',
129
+          data: val,
130
+        }).then((data) => {
131
+          cancelPage()
132
+        }).catch((err) => {
133
+          message.info(err.msg || err.message)
134
+        })
135
+      }else{
136
+        request({
137
+          url: '/api/admin/extendContent',
138
+          method: 'POST',
139
+          data: val,
140
+        }).then((data) => {
141
+          cancelPage()
142
+        }).catch((err) => {
143
+          message.info(err.msg || err.message)
144
+        })
145
+      }
146
+    }
147
+
148
+  return (
149
+    <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
150
+  );
151
+ }
152
+
153
+
154
+
155
+export default Edit

+ 155
- 0
src/pages/carouselFigure/editCarousel.jsx 查看文件

1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker,message } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../style/GoodsList.less';
5
+import moment from 'moment';
6
+import router from 'umi/router';
7
+import BuildSelect from '../../components/SelectButton/BuildSelect'
8
+import XForm, { FieldTypes } from '../../components/XForm';
9
+import Wangedit from '../../components/Wangedit/Wangedit'
10
+import request from '../../utils/request'
11
+
12
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
13
+/**
14
+ *
15
+ *
16
+ * @param {*} props
17
+ * @returns
18
+ */
19
+ const Edit = (props) => {
20
+  const [ tab, changeTab ] = useState('basic')
21
+  const contentId = props.location.query.contentId
22
+  const [ data, setData ] = useState({})
23
+  if(contentId){
24
+    useEffect(() => {
25
+      getDetail(contentId);
26
+    },[])
27
+
28
+  // 查询列表
29
+  const getDetail = (contentId) => {
30
+    request({
31
+        url: '/api/admin/extendContent/' + contentId,
32
+        method: 'GET',
33
+    }).then((data) => {
34
+        console.log(data)
35
+        setData(data)
36
+    })
37
+  }
38
+  }
39
+
40
+  const cancelPage = () =>{
41
+    router.push({
42
+      pathname: '/carouselFigure/carouselFigureList',
43
+    });
44
+  }
45
+ 
46
+    const fields = [
47
+      {
48
+        label: '所属项目',
49
+        name: 'buildingId',
50
+        render: <BuildSelect />,
51
+        value: data.buildingId,
52
+      },
53
+      {
54
+        label: '商品图片',
55
+        name: 'image',
56
+        type: FieldTypes.ImageUploader,
57
+        value: data.image,
58
+      },
59
+      {
60
+        label: '标题',
61
+        name: 'title',
62
+        type: FieldTypes.Text,
63
+        value: data.title,
64
+      },
65
+      {
66
+        label: '发布位置',
67
+        name: 'showPosition',
68
+        type: FieldTypes.Select,
69
+        dict: [{
70
+          label: '首页',
71
+          value: 'index'
72
+        },
73
+        {
74
+          label: '商城',
75
+          value: 'mall'
76
+        }],
77
+        value: data.showPosition,
78
+      },
79
+      {
80
+        label: '类型',
81
+        name: 'contentType',
82
+        type: FieldTypes.Select,
83
+        dict: [{
84
+          label: '活动',
85
+          value: 'activity'
86
+        },
87
+        {
88
+          label: '项目',
89
+          value: 'project'
90
+        },
91
+        {
92
+          label: '资讯',
93
+          value: 'news'
94
+        },
95
+        {
96
+          label: '其他',
97
+          value: 'other'
98
+        }],
99
+        value: data.contentType,
100
+      },
101
+      {
102
+        label: '发布内容',
103
+        name: 'content',
104
+        render: <Wangedit />,
105
+        value: data.content,
106
+      },
107
+      {
108
+        label: '状态',
109
+        name: 'status',
110
+        type: FieldTypes.Select,
111
+        dict: [{
112
+          label: "启用",
113
+          value: 1
114
+        },
115
+        {
116
+          label: "停用",
117
+          value: 0
118
+        },],
119
+        value: data.status != null ? data.status : 1,
120
+      },
121
+    ]
122
+  
123
+    const handleSubmit = val => { 
124
+      val.showType = 'banner'
125
+      if(contentId){
126
+        request({
127
+          url: '/api/admin/extendContent/'+contentId,
128
+          method: 'PUT',
129
+          data: val,
130
+        }).then((data) => {
131
+          cancelPage()
132
+        }).catch((err) => {
133
+          message.info(err.msg || err.message)
134
+        })
135
+      }else{
136
+        request({
137
+          url: '/api/admin/extendContent',
138
+          method: 'POST',
139
+          data: val,
140
+        }).then((data) => {
141
+          cancelPage()
142
+        }).catch((err) => {
143
+          message.info(err.msg || err.message)
144
+        })
145
+      }
146
+    }
147
+
148
+  return (
149
+    <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
150
+  );
151
+ }
152
+
153
+
154
+
155
+export default Edit

+ 0
- 30
src/pages/channel/InviteClients.jsx 查看文件

10
 function handleChange(value) {
10
 function handleChange(value) {
11
   console.log(`selected ${value}`);
11
   console.log(`selected ${value}`);
12
 }
12
 }
13
-
14
-// const dataSource = [
15
-//   {
16
-//     key: '1',
17
-//     img: 'http://img0.imgtn.bdimg.com/it/u=4246326797,2657995307&fm=26&gp=0.jpg',
18
-//     name: '123',
19
-//     age: 32,
20
-//     address: '西湖区湖底公园1号',
21
-//   },
22
-//   {
23
-//     key: '2',
24
-//     img: '',
25
-//     age: 42,
26
-//     address: '西湖区湖底公园1号',
27
-//   },
28
-// ];
29
-
30
 const columns = [
13
 const columns = [
31
   {
14
   {
32
     title: '头像',
15
     title: '头像',
75
       setData(data)
58
       setData(data)
76
   })
59
   })
77
   }
60
   }
78
-  // value 的值
79
-  // eslint-disable-next-line no-shadow
80
-  function handleChange(value) {
81
-    // setQueryData({ ...queryData, channelId: value });
82
-    localStorage.setItem('value', value);
83
-  }
84
-  // 查询
85
-  function queryList() {
86
-    getList({ pageNum: 1, pageSize: 10 })
87
-  }
88
-
89
-
90
   // 分页
61
   // 分页
91
   function onChange(pageNumber) {
62
   function onChange(pageNumber) {
92
     // eslint-disable-next-line react-hooks/rules-of-hooks
63
     // eslint-disable-next-line react-hooks/rules-of-hooks
93
       getList({ pageNum: pageNumber, pageSize: 9 })
64
       getList({ pageNum: pageNumber, pageSize: 9 })
94
   }
65
   }
95
-
96
   return (
66
   return (
97
     <>
67
     <>
98
       <div className={channels.searchBox}>
68
       <div className={channels.searchBox}>

+ 0
- 16
src/pages/channel/brokerList.jsx 查看文件

27
     </Menu.Item>
27
     </Menu.Item>
28
   </Menu>
28
   </Menu>
29
 );
29
 );
30
-// const dataSource = [
31
-//   {
32
-//     key: '1',
33
-//     img: 'http://img0.imgtn.bdimg.com/it/u=4246326797,2657995307&fm=26&gp=0.jpg',
34
-//     name: '123',
35
-//     age: 32,
36
-//     address: '西湖区湖底公园1号',
37
-//   },
38
-//   {
39
-//     key: '2',
40
-//     img: '',
41
-//     age: 42,
42
-//     address: '西湖区湖底公园1号',
43
-//   },
44
-// ];
45
-
46
 const columns = [
30
 const columns = [
47
   {
31
   {
48
     title: '头像',
32
     title: '头像',

+ 0
- 1
src/pages/channel/channelList.jsx 查看文件

74
     dataIndex: 'agentsInvite',
74
     dataIndex: 'agentsInvite',
75
     key: 'agentsInvite',
75
     key: 'agentsInvite',
76
     align: 'center',
76
     align: 'center',
77
-    // render: () => <a>Delete</a>,
78
   },
77
   },
79
   {
78
   {
80
     title: '操作',
79
     title: '操作',

+ 21
- 12
src/pages/customer/customerlist/components/attribution.jsx 查看文件

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions } from 'antd';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions, notification } from 'antd';
3
 import moment from 'moment';
3
 import moment from 'moment';
4
 import request from '../../../../utils/request';
4
 import request from '../../../../utils/request';
5
 import apis from '../../../../services/apis';
5
 import apis from '../../../../services/apis';
31
   }
31
   }
32
 
32
 
33
   componentDidUpdate(preProps, preState) {
33
   componentDidUpdate(preProps, preState) {
34
+    console.log(this.props.visibleData.realtyConsultant)
34
     if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
35
     if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
35
       this.getList({ pageNumber: 1, pageSize: 5 })
36
       this.getList({ pageNumber: 1, pageSize: 5 })
36
       this.setState({ visibleData: this.props.visibleData });
37
       this.setState({ visibleData: this.props.visibleData });
65
     })
66
     })
66
   }
67
   }
67
 
68
 
69
+  openNotificationWithIcon = (type, message) => {
70
+    notification[type]({
71
+      message,
72
+      description:
73
+        '',
74
+    });
75
+  };
76
+
68
    // 分页
77
    // 分页
69
   onChange(pageNum) {
78
   onChange(pageNum) {
70
     this.getList({ pageNumber: pageNum, pageSize: 5 })
79
     this.getList({ pageNumber: pageNum, pageSize: 5 })
71
   }
80
   }
72
 
81
 
73
   // 提交
82
   // 提交
74
-  submitGm() {
83
+  submitGm(record) {
75
     const { url, method } = apis.customer.recommendEdit
84
     const { url, method } = apis.customer.recommendEdit
76
     const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(this.state.visibleData.customerId)
85
     const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(this.state.visibleData.customerId)
77
 
86
 
78
     // 网路请求
87
     // 网路请求
79
-    request({ url: tempUrl, method, data: { ...this.state.visibleData } }).then(res => {
88
+    request({ url: tempUrl, method, data: { customerId: this.state.visibleData.customerId, realtyConsultant: record.personId } }).then(res => {
89
+      // eslint-disable-next-line no-unused-expressions
90
+      this.openNotificationWithIcon('success', '操作成功')
80
       this.handleCancel()
91
       this.handleCancel()
81
     }).catch(err => {
92
     }).catch(err => {
82
       // eslint-disable-next-line no-unused-expressions
93
       // eslint-disable-next-line no-unused-expressions
83
-      <Alert
84
-        style={{
85
-          marginBottom: 24,
86
-        }}
87
-        message={err}
88
-        type="error"
89
-        showIcon
90
-      />
94
+      this.openNotificationWithIcon('error', err)
91
     })
95
     })
92
   }
96
   }
93
 
97
 
94
   render() {
98
   render() {
95
     const columns = [
99
     const columns = [
100
+      // {
101
+      //   title: '编号',
102
+      //   dataIndex: 'personId',
103
+      //   key: 'personId',
104
+      // },
96
       {
105
       {
97
         title: '姓名',
106
         title: '姓名',
98
         dataIndex: 'name',
107
         dataIndex: 'name',
118
         dataIndex: 'personId',
127
         dataIndex: 'personId',
119
         key: 'personId',
128
         key: 'personId',
120
         // eslint-disable-next-line no-nested-ternary
129
         // eslint-disable-next-line no-nested-ternary
121
-        render: (_, record) => <><Button className={Styles.SubmitButton} onClick={() => this.submitGm()}>确定</Button></>,
130
+        render: (_, record) => <>{ this.props.visibleData.realtyConsultant !== record.personId && <Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>,
122
       },
131
       },
123
     ]
132
     ]
124
     return (
133
     return (

+ 84
- 0
src/pages/customer/customerlist/components/changeStatus.jsx 查看文件

1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions, notification } from 'antd';
3
+import moment from 'moment';
4
+import request from '../../../../utils/request';
5
+import apis from '../../../../services/apis';
6
+import Styles from '../style.less';
7
+
8
+class ChangeStatus extends React.Component {
9
+  constructor(props) {
10
+    super(props)
11
+    this.state = {
12
+      value: '',
13
+      visibleData: { visible: false, customerId: '' },
14
+    }
15
+  }
16
+
17
+  componentDidUpdate(preProps, preState) {
18
+    if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
19
+      this.setState({ visibleData: { ...this.props.visibleData } })
20
+      this.setState({ value: this.props.visibleData.status })
21
+    }
22
+  }
23
+
24
+  // 弹框取消按钮
25
+  handleCancel() {
26
+    this.setState({ visibleData: { visible: false, customerId: '' } })
27
+  }
28
+
29
+  onChange = e => {
30
+    this.setState({
31
+      value: e.target.value,
32
+    });
33
+  };
34
+
35
+  openNotificationWithIcon = (type, message) => {
36
+    notification[type]({
37
+      message,
38
+      description:
39
+        '',
40
+    });
41
+  };
42
+
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
+    // 网路请求
48
+    request({ url: tempUrl, method, data: { customerId: this.state.visibleData.customerId, status: this.state.value } }).then(res => {
49
+      // eslint-disable-next-line no-unused-expressions
50
+      this.openNotificationWithIcon('success', '操作成功')
51
+      this.handleCancel()
52
+    }).catch(err => {
53
+      // eslint-disable-next-line no-unused-expressions
54
+      this.openNotificationWithIcon('error', err)
55
+    })
56
+  }
57
+
58
+  render() {
59
+    return (
60
+      <>
61
+          <Modal
62
+            title="变更状态"
63
+            width={800}
64
+            destroyOnClose="true"
65
+            footer={null}
66
+            visible={this.state.visibleData.visible}
67
+            // onOk={() => this.handleOk()}
68
+            onCancel={(e) => this.handleCancel(e)}
69
+          >
70
+            <Radio.Group onChange={this.onChange} value={this.state.value}>
71
+              <Radio value={1}>客户报备</Radio>
72
+              <Radio value={2}>客户到访</Radio>
73
+              <Radio value={3}>客户认购</Radio>
74
+              <Radio value={4}>客户签约</Radio>
75
+            </Radio.Group>
76
+
77
+            <Button type="danger" onClick={this.submitButton}>确定</Button>
78
+          </Modal>
79
+      </>
80
+    )
81
+  }
82
+}
83
+
84
+export default ChangeStatus

+ 10
- 11
src/pages/customer/customerlist/components/integralRecord.jsx 查看文件

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions } from 'antd';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions, notification } from 'antd';
3
 import moment from 'moment';
3
 import moment from 'moment';
4
 import request from '../../../../utils/request';
4
 import request from '../../../../utils/request';
5
 import apis from '../../../../services/apis';
5
 import apis from '../../../../services/apis';
31
   }
31
   }
32
 
32
 
33
   componentDidUpdate(preProps, preState) {
33
   componentDidUpdate(preProps, preState) {
34
-    console.log(this.props.visibleData)
35
     if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
34
     if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
36
       this.getList({ pageNumber: 1, pageSize: 5 })
35
       this.getList({ pageNumber: 1, pageSize: 5 })
37
       this.setState({ visibleData: this.props.visibleData });
36
       this.setState({ visibleData: this.props.visibleData });
49
     this.setState({ visibleData: { visible: false, customerId: '' } })
48
     this.setState({ visibleData: { visible: false, customerId: '' } })
50
   }
49
   }
51
 
50
 
51
+  openNotificationWithIcon = (type, message) => {
52
+    notification[type]({
53
+      message,
54
+      description:
55
+        '',
56
+    });
57
+  }
58
+
52
   getList(params) {
59
   getList(params) {
53
     const { customerId } = this.state.visibleData
60
     const { customerId } = this.state.visibleData
54
     if (customerId === '' || customerId === undefined) {
61
     if (customerId === '' || customerId === undefined) {
62
     request({ url: tempUrl, method, params: { ...params } }).then(res => {
69
     request({ url: tempUrl, method, params: { ...params } }).then(res => {
63
       this.setState({ dataSource: res })
70
       this.setState({ dataSource: res })
64
     }).catch(err => {
71
     }).catch(err => {
65
-      // eslint-disable-next-line no-unused-expressions
66
-      <Alert
67
-        style={{
68
-          marginBottom: 24,
69
-        }}
70
-        message={err}
71
-        type="error"
72
-        showIcon
73
-      />
72
+      this.openNotificationWithIcon('error', err)
74
     })
73
     })
75
   }
74
   }
76
 
75
 

+ 116
- 0
src/pages/customer/customerlist/customerDetail.jsx 查看文件

1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Table } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from './style.less';
5
+import apis from '../../../services/apis';
6
+import request from '../../../utils/request';
7
+import moment from 'moment';
8
+
9
+import router from 'umi/router';
10
+
11
+
12
+function header(props) {
13
+  /**
14
+   * @param {*} props
15
+   * @returns
16
+   */
17
+  // eslint-disable-next-line react-hooks/rules-of-hooks
18
+  const [data, setData] = useState([{ visitRecords: [] }])
19
+
20
+  // eslint-disable-next-line react-hooks/rules-of-hooks
21
+  useEffect(() => {
22
+    getById()
23
+  }, [])
24
+
25
+  // 查询
26
+  function getById(params) {
27
+    const { id } = props.location.query;
28
+    if (id === '' || id === undefined) {
29
+      return
30
+    }
31
+    const { url, method } = apis.customer.CustomerRecommendGet
32
+    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(id)
33
+
34
+    request({ url: tempUrl, method, params: { ...params } }).then(res => {
35
+      setData(res)
36
+    })
37
+  }
38
+
39
+  const columns = [
40
+    {
41
+      title: '访问事件',
42
+      dataIndex: 'activity',
43
+      key: 'activity',
44
+      align: 'center',
45
+    },
46
+    {
47
+      title: '访问时间',
48
+      dataIndex: 'visitTime',
49
+      key: 'visitTime',
50
+      align: 'center',
51
+
52
+    },
53
+    {
54
+      title: '停留时间',
55
+      dataIndex: 'visitDuration',
56
+      key: 'visitDuration',
57
+      align: 'center',
58
+      render: (_, record) => <span>{record.visitDuration === null ? 0 : record.visitDuration }秒</span>,
59
+    },
60
+  ]
61
+  return (
62
+    <>
63
+      <div className={styles.cardBox}>
64
+        <div className={styles.leftBox}>
65
+          <p className={styles.tit}>置业顾问信息</p>
66
+          <img className={styles.touxiang} src={ data.consultant && data.consultant.picture } />
67
+          <p className={styles.infoItem}>姓名:{ data.consultant && data.consultant.name }</p>
68
+          <p className={styles.infoItem}>部门:{ data.consultant && data.consultant.department }</p>
69
+          <p className={styles.infoItem}>岗位:{ data.consultant && data.consultant.post }</p>
70
+          <p className={styles.infoItem}>号码:{ data.consultant && data.consultant.phone } </p>
71
+          <p className={styles.infoItem}>公司:{ data.consultant && data.consultant.company } </p>
72
+          <p className={styles.infoItem}>
73
+            所属项目:
74
+            {
75
+              data.consultant && data.consultant.projects.map((item, _) => <span>{item}</span>)
76
+            }
77
+          </p>
78
+        </div>
79
+        <div className={styles.rightBox}>
80
+          <p className={styles.tit}>客户信息</p>
81
+          <img className={styles.touxiang} src={ data.picture && data.picture } />
82
+          <div className={styles.right}>
83
+            <p className={styles.rightItem}>用户名称:{ data.name }</p>
84
+            <p className={styles.rightItem}>手机号码:{ data.phone }</p>
85
+            <p className={styles.rightItem}>来访渠道:活动分享</p>
86
+          </div>
87
+          <p className={styles.rightItem}>访问时长:{ data.duration }秒</p>
88
+          <p className={styles.rightItem}>访问次数:{ data.visitTimes }</p>
89
+          <p className={styles.rightItem}>预约人数:{ data.visiteNum }</p>
90
+          <p className={styles.rightItem}>首次访问时间:{data.visitTime && moment(data.visitTime).format('YYYY-MM-DD')}</p>
91
+          <p className={styles.rightItem}>预约到访时间:{data.appointmentTime && moment(data.appointmentTime).format('YYYY-MM-DD') }</p>
92
+          <div className={styles.rightInfo}>
93
+            <p className={styles.rightItem}>国家:{ data.country }</p>
94
+            <p className={styles.rightItem}>省份:{ data.province }</p>
95
+            <p className={styles.rightItem}>城市:{data.city }</p>
96
+            <p className={styles.rightItem}>详细信息:</p>
97
+            <p className={styles.rightItem}>意向项目:{data.intention }</p>
98
+            <p className={styles.rightItem}>价格区间:{data.priceRange }</p>
99
+            <p className={styles.rightItem}>客户说明:{ data.verifyRemark }</p>
100
+            <p className={styles.rightItem}>客户描述:{ data.describe }</p>
101
+            <p className={styles.rightItem}>需求类型:{ data.demandType }</p>
102
+            <p className={styles.rightItem}>物业类型:{ data.realtyManageType }</p>
103
+          </div>
104
+        </div>
105
+      </div>
106
+      <div className={styles.recordBox}>
107
+        <p className={styles.tableName}>访问记录</p>
108
+        <Table dataSource={data.visitRecords} columns={columns} pagination={false} />
109
+      </div>
110
+
111
+    </>
112
+  )
113
+}
114
+const WrappedHeader = Form.create({ name: 'header' })(header);
115
+
116
+export default WrappedHeader

+ 62
- 25
src/pages/customer/customerlist/index.jsx 查看文件

4
 import request from '../../../utils/request';
4
 import request from '../../../utils/request';
5
 import apis from '../../../services/apis';
5
 import apis from '../../../services/apis';
6
 import Styles from './style.less';
6
 import Styles from './style.less';
7
+import router from 'umi/router';
7
 
8
 
8
 import Attribution from './components/attribution'
9
 import Attribution from './components/attribution'
9
 import IntegralRecord from './components/integralRecord'
10
 import IntegralRecord from './components/integralRecord'
11
+import ChangeStatus from './components/changeStatus'
10
 
12
 
11
 
13
 
12
 const { Option } = Select;
14
 const { Option } = Select;
26
   const [dataSource, setDataSource] = useState({ records: [] })
28
   const [dataSource, setDataSource] = useState({ records: [] })
27
 
29
 
28
   // 默认私客
30
   // 默认私客
29
-    // eslint-disable-next-line react-hooks/rules-of-hooks
31
+  // eslint-disable-next-line react-hooks/rules-of-hooks
30
   const [customerType, setCustomerType] = useState('private')
32
   const [customerType, setCustomerType] = useState('private')
31
 
33
 
32
   // 调整归属 ============  start
34
   // 调整归属 ============  start
39
   const [recordVisibleData, setRecordVisibleData] = useState({ visible: false, customerId: '' })
41
   const [recordVisibleData, setRecordVisibleData] = useState({ visible: false, customerId: '' })
40
   // 积分记录 ============= end
42
   // 积分记录 ============= end
41
 
43
 
44
+  // 变更状态 ============  start
45
+  // eslint-disable-next-line react-hooks/rules-of-hooks
46
+  const [statusVisibleData, setStatusVisibleData] = useState({ visible: false, customerId: '', status: '' })
47
+  // 变更状态 ============= end
48
+
42
   // eslint-disable-next-line react-hooks/rules-of-hooks
49
   // eslint-disable-next-line react-hooks/rules-of-hooks
43
   useEffect(() => {
50
   useEffect(() => {
44
     getList({ pageNumber: 1, pageSize: 10, customerType })
51
     getList({ pageNumber: 1, pageSize: 10, customerType })
61
     })
68
     })
62
   }
69
   }
63
 
70
 
71
+  function displayNone() {
72
+    setRecordVisibleData({ visible: false, customerId: '' })
73
+    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
74
+    setStatusVisibleData({ visible: false, customerId: '', status: '' })
75
+  }
76
+
64
   // 提交事件
77
   // 提交事件
65
   function handleSubmit(e) {
78
   function handleSubmit(e) {
79
+    displayNone()
80
+
81
+
66
     e.preventDefault();
82
     e.preventDefault();
67
     props.form.validateFields((err, values) => {
83
     props.form.validateFields((err, values) => {
68
       if (!err) {
84
       if (!err) {
80
   // 分页
96
   // 分页
81
   function onChange(pageNum) {
97
   function onChange(pageNum) {
82
     // eslint-disable-next-line react-hooks/rules-of-hooks
98
     // eslint-disable-next-line react-hooks/rules-of-hooks
83
-      getList({ pageNumber: pageNum, pageSize: 10, customerType })
99
+    getList({ pageNumber: pageNum, pageSize: 10, customerType })
84
   }
100
   }
85
 
101
 
86
   // 私客/公客切换
102
   // 私客/公客切换
87
   function radioButtonHandleSizeChange(e) {
103
   function radioButtonHandleSizeChange(e) {
104
+    displayNone()
105
+
88
     const { value } = e.target
106
     const { value } = e.target
89
     setCustomerType(value)
107
     setCustomerType(value)
90
     getList({ pageNumber: 1, pageSize: 10, customerType: value })
108
     getList({ pageNumber: 1, pageSize: 10, customerType: value })
93
   // 这里有个 Bug, 就是 Modal 弹框,会联动出现, 比如 我点击 调整归属的Model弹框, 那么 积分记录的Model弹框莫名其妙的也显示了
111
   // 这里有个 Bug, 就是 Modal 弹框,会联动出现, 比如 我点击 调整归属的Model弹框, 那么 积分记录的Model弹框莫名其妙的也显示了
94
   // 所有这里临时解决方法是,弹出一个Modal对话框的时候,把其他的对话框给隐藏
112
   // 所有这里临时解决方法是,弹出一个Modal对话框的时候,把其他的对话框给隐藏
95
 
113
 
96
-function showGM(record) {
114
+  function showGM(record) {
97
     setGVisibleData({ visible: true, customerId: record.customerId, realtyConsultant: record.realtyConsultant })
115
     setGVisibleData({ visible: true, customerId: record.customerId, realtyConsultant: record.realtyConsultant })
98
     setRecordVisibleData({ visible: false, customerId: '' })
116
     setRecordVisibleData({ visible: false, customerId: '' })
117
+    setStatusVisibleData({ visible: false, customerId: '' })
99
   }
118
   }
100
 
119
 
101
   function showRecord(record) {
120
   function showRecord(record) {
102
     setRecordVisibleData({ visible: true, customerId: record.customerId })
121
     setRecordVisibleData({ visible: true, customerId: record.customerId })
103
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
122
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
123
+    setStatusVisibleData({ visible: false, customerId: '' })
124
+  }
125
+
126
+  function showStatus(record) {
127
+    setRecordVisibleData({ visible: false, customerId: '' })
128
+    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
129
+    setStatusVisibleData({ visible: true, customerId: record.customerId, status: record.status })
130
+  }
131
+  function toCustomerDateil(record) {
132
+    router.push({
133
+      pathname: '/customer/customerlist/customerDetail',
134
+      query: {
135
+        id: record.customerId,
136
+      },
137
+    });
104
   }
138
   }
105
 
139
 
106
   const columns = [
140
   const columns = [
108
       title: '头像',
142
       title: '头像',
109
       dataIndex: 'picture',
143
       dataIndex: 'picture',
110
       key: 'picture',
144
       key: 'picture',
111
-      render: (_, record) => <Avatar shape="square" src={customerType === 'private' ? record.picture : record.avatarurl } size={64} icon="user" />,
145
+      render: (_, record) => <Avatar shape="square" src={customerType === 'private' ? record.picture : record.avatarurl} size={64} icon="user" />,
112
     },
146
     },
113
     {
147
     {
114
       title: '姓名',
148
       title: '姓名',
115
       dataIndex: 'name',
149
       dataIndex: 'name',
116
       key: 'name',
150
       key: 'name',
117
       // eslint-disable-next-line no-nested-ternary
151
       // eslint-disable-next-line no-nested-ternary
118
-      render: (_, record) => <><sapn>{ customerType === 'private' ? record.name : record.nickname }</sapn></>,
152
+      render: (_, record) => <><sapn>{customerType === 'private' ? record.name : record.nickname}</sapn></>,
119
     },
153
     },
120
     {
154
     {
121
       title: '电话',
155
       title: '电话',
127
       dataIndex: 'sex',
161
       dataIndex: 'sex',
128
       key: 'sex',
162
       key: 'sex',
129
       // eslint-disable-next-line no-nested-ternary
163
       // eslint-disable-next-line no-nested-ternary
130
-      render: (_, record) => <><sapn>{ record.sex === 1 ? '男' : record.sex === 2 ? '女' : '未知' }</sapn></>,
164
+      render: (_, record) => <><sapn>{record.sex === 1 ? '男' : record.sex === 2 ? '女' : '未知'}</sapn></>,
131
     },
165
     },
132
     {
166
     {
133
       title: '置业顾问',
167
       title: '置业顾问',
136
       // eslint-disable-next-line no-nested-ternary
170
       // eslint-disable-next-line no-nested-ternary
137
       render: (_, record) => (
171
       render: (_, record) => (
138
         <>
172
         <>
139
-          <sapn>{ record.consultantName }</sapn>
140
-          <br/>
141
-          <sapn>{ record.consultTel }</sapn>
173
+          <sapn>{record.consultantName}</sapn>
174
+          <br />
175
+          <sapn>{record.consultTel}</sapn>
142
         </>
176
         </>
143
       ),
177
       ),
144
     },
178
     },
146
       title: '客户状态',
180
       title: '客户状态',
147
       dataIndex: 'reportRecommendStatus',
181
       dataIndex: 'reportRecommendStatus',
148
       key: 'reportRecommendStatus',
182
       key: 'reportRecommendStatus',
149
-       // eslint-disable-next-line no-nested-ternary
150
-       render: (_, record) => <><sapn>{ record.reportRecommendStatus === 0 ? '为报备' : record.reportRecommendStatus === 1 ? '报备' : record.reportRecommendStatus === 2 ? '推荐' : '' }</sapn></>,
183
+      // eslint-disable-next-line no-nested-ternary
184
+      render: (_, record) => <><sapn>{record.reportRecommendStatus === 0 ? '为报备' : record.reportRecommendStatus === 1 ? '报备' : record.reportRecommendStatus === 2 ? '推荐' : ''}</sapn></>,
151
     },
185
     },
152
     {
186
     {
153
       title: '操作',
187
       title: '操作',
156
       // eslint-disable-next-line no-nested-ternary
190
       // eslint-disable-next-line no-nested-ternary
157
       render: (_, record) => (
191
       render: (_, record) => (
158
         <>
192
         <>
159
-          <Button className={ customerType === 'private' ? Styles.text : Styles.displayS } type="link">变更状态</Button>
193
+          <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showStatus(record)}>变更状态</Button>
160
           &nbsp;&nbsp;
194
           &nbsp;&nbsp;
161
-          <Button className={ customerType === 'private' ? Styles.text : Styles.displayS } type="link" onClick={() => showGM(record)}>调整归属</Button>
162
-          <br/>
163
-          <Button className={ customerType === 'private' ? Styles.text : Styles.displayS } type="link">查看详情</Button>
195
+          <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showGM(record)}>调整归属</Button>
196
+          <br />
197
+          <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => toCustomerDateil(record)}>查看详情</Button>
164
           &nbsp;&nbsp;
198
           &nbsp;&nbsp;
165
-          <Button className={ customerType === 'private' ? Styles.text : Styles.displayS } type="link" onClick={ () => showRecord(record) }>积分记录</Button>
199
+          <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showRecord(record)}>积分记录</Button>
166
         </>
200
         </>
167
       ),
201
       ),
168
     },
202
     },
214
           )}
248
           )}
215
         </Form.Item>
249
         </Form.Item>
216
         <Form.Item>
250
         <Form.Item>
217
-          <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
251
+          <Button type="danger" htmlType="submit" >
218
             搜索
252
             搜索
219
           </Button>
253
           </Button>
220
         </Form.Item>
254
         </Form.Item>
221
       </Form>
255
       </Form>
222
 
256
 
223
-       <div style={{ marginTop: '20px', marginBottom: '20px' }}>
257
+      <div style={{ marginTop: '20px', marginBottom: '20px' }}>
224
         <Radio.Group value={customerType} onChange={radioButtonHandleSizeChange} buttonStyle="solid">
258
         <Radio.Group value={customerType} onChange={radioButtonHandleSizeChange} buttonStyle="solid">
225
-            <Radio.Button value="private">私客</Radio.Button>
226
-            <Radio.Button value="public">公客</Radio.Button>
259
+          <Radio.Button value="private">私客</Radio.Button>
260
+          <Radio.Button value="public">公客</Radio.Button>
227
         </Radio.Group>
261
         </Radio.Group>
228
-       </div>
262
+      </div>
229
       <Table dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
263
       <Table dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
230
 
264
 
231
-        {/* 调整归属 */}
232
-        <Attribution visibleData={gVisibleData} />
265
+      {/* 调整归属 */}
266
+      <Attribution visibleData={gVisibleData} />
267
+
268
+      {/* 积分记录 */}
269
+      <IntegralRecord visibleData={recordVisibleData} />
233
 
270
 
234
-        {/* 积分记录 */}
235
-        <IntegralRecord visibleData={recordVisibleData} />
271
+      {/* 变更状态 */}
272
+      <ChangeStatus visibleData={statusVisibleData} />
236
     </>
273
     </>
237
   );
274
   );
238
 }
275
 }

+ 78
- 0
src/pages/customer/customerlist/style.less 查看文件

70
 .displayS {
70
 .displayS {
71
   display: none;
71
   display: none;
72
 }
72
 }
73
+
74
+
75
+// 客户详情样式
76
+.cardBox{
77
+  display: flex;
78
+  .leftBox{
79
+    width:342px;
80
+    min-width:342px;
81
+    height:511px;
82
+    background:rgba(255,255,255,1);
83
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
84
+    border-radius:8px;
85
+    display: inline-block;
86
+    margin-right: 30px;
87
+    padding: 30px;
88
+    overflow: hidden;
89
+  }
90
+  .rightBox{
91
+    width:-webkit-fill-available;
92
+    height:511px;
93
+    min-width: 800px;
94
+    background:rgba(255,255,255,1);
95
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
96
+    border-radius:8px;
97
+    display: inline-block;
98
+    padding: 30px;
99
+    overflow: hidden;
100
+    position: relative;
101
+  }
102
+  .tit{
103
+    font-size:24px;
104
+    font-weight:600;
105
+    color:#222;
106
+    margin: 10px 0 0 0;
107
+  }
108
+  .touxiang{
109
+    width: 120px;
110
+    width: 120px;
111
+    border-radius: 6px;
112
+    margin: 30px 0 20px 0;
113
+  }
114
+  .infoItem{
115
+    color:#666;
116
+    font-size: 19px;
117
+    margin: 0 0 10px 0;
118
+    
119
+  }
120
+  .rightItem{
121
+    color:#666;
122
+    font-size: 19px;
123
+    margin: 0 0 15px 0;
124
+  }
125
+  .right{
126
+    position: absolute;
127
+    top:108px;
128
+    left:170px;
129
+  }
130
+  .rightInfo{
131
+    position: absolute;
132
+    top:50px;
133
+    left:50%;
134
+  }
135
+  
136
+}
137
+.recordBox{
138
+  width:100%;
139
+  background:rgba(255,255,255,1);
140
+  box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
141
+  border-radius:8px;
142
+  margin-top: 30px;
143
+  padding: 30px;
144
+  .tableName{
145
+    font-size:24px;
146
+    font-weight:600;
147
+    color:#222;
148
+  }
149
+}
150
+

+ 272
- 14
src/pages/customer/independentList/index.jsx 查看文件

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar } from 'antd';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, notification } from 'antd';
3
 import moment from 'moment';
3
 import moment from 'moment';
4
 import request from '../../../utils/request';
4
 import request from '../../../utils/request';
5
 import apis from '../../../services/apis';
5
 import apis from '../../../services/apis';
10
 const { Option } = Select;
10
 const { Option } = Select;
11
 // eslint-disable-next-line @typescript-eslint/no-unused-vars
11
 // eslint-disable-next-line @typescript-eslint/no-unused-vars
12
 const { Meta } = Card;
12
 const { Meta } = Card;
13
+/**
14
+ * 推荐客户
15
+ */
16
+class ModalTable extends React.Component {
17
+  constructor(props) {
18
+    super(props);
19
+    this.state = {
20
+       dataSource: { records: [] },
21
+       visibleData: { visible: false, customerId: '', realtyConsultant: '' },
22
+    }
23
+  }
24
+
25
+  // 挂载之后
26
+  componentDidMount() {
27
+    this.getList({ pageNumber: 1, pageSize: 5 })
28
+  }
29
+
30
+  componentDidUpdate(preProps, preState) {
31
+    if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
32
+      this.getList({ pageNumber: 1, pageSize: 5 })
33
+      this.setState({ visibleData: this.props.visibleData });
34
+    }
35
+  }
36
+
37
+  // 弹框确定按钮
38
+  // eslint-disable-next-line react/sort-comp
39
+  handleOk() {
40
+    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
41
+  }
42
+
43
+  // 弹框取消按钮
44
+  handleCancel() {
45
+    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
46
+  }
47
+
48
+  getList(params) {
49
+    console.log('this.state.visibleData', this.state.visibleData)
50
+    const { customerId } = this.state.visibleData
51
+    if (customerId === '' || customerId === undefined) {
52
+      return
53
+    }
54
+    // 网路请求
55
+    const { url, method } = apis.customer.recommend
56
+    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(customerId)
57
+    // 网路请求
58
+    request({ url: tempUrl, method, params: { ...params } }).then(res => {
59
+      this.setState({ dataSource: res })
60
+    }).catch(err => {
61
+      // eslint-disable-next-line no-unused-expressions
62
+      <Alert
63
+        style={{
64
+          marginBottom: 24,
65
+        }}
66
+        message={err}
67
+        type="error"
68
+        showIcon
69
+      />
70
+    })
71
+  }
72
+
73
+   // 分页
74
+  onChange(pageNum) {
75
+    this.getList({ pageNumber: pageNum, pageSize: 5 })
76
+  }
77
+
78
+  render() {
79
+    const columns = [
80
+      {
81
+        title: '头像',
82
+        // eslint-disable-next-line jsx-a11y/alt-text
83
+        render: (text, records) => <img src={records.picture } width={50} height={50} />,
84
+      },
85
+      {
86
+        title: '用户名',
87
+        dataIndex: 'name',
88
+        key: 'name',
89
+      },
90
+      {
91
+        title: '电话',
92
+        dataIndex: 'phone',
93
+        key: 'phone',
94
+      },
95
+      {
96
+        title: '性别',
97
+        dataIndex: 'sex',
98
+        key: 'sex',
99
+        render: (text, records) => <span>{ records.sex === 1 ? '男' : '女' }</span>,
100
+      },
101
+      {
102
+        title: '意向项目',
103
+        dataIndex: 'intention',
104
+        key: 'intention',
105
+      },
106
+      {
107
+        title: '推荐时间',
108
+        dataIndex: 'createDate',
109
+        key: 'createDate',
110
+      },
111
+      {
112
+        title: '状态',
113
+        // eslint-disable-next-line consistent-return
114
+        render: (text, records) => {
115
+                                    if (records.status === 1) { return '报备' }
116
+                                    if (records.status === 2) { return '到访' }
117
+                                    if (records.status === 3) { return '认购' }
118
+                                    if (records.status === 4) { return '签约' }
119
+                                    if (records.verifyStatus === 1) { return '待审核' }
120
+                                    if (records.verifyStatus === 2) { return '审核同意' }
121
+                                    if (records.verifyStatus === 3) { return '签约' }
122
+                                  },
123
+      },
124
+    ]
125
+    return (
126
+      <>
127
+        <Modal
128
+            title="推荐客户"
129
+            destroyOnClose="true"
130
+            width={900}
131
+            footer={null}
132
+            visible={this.state.visibleData.visible}
133
+            // onOk={() => this.handleOk()}
134
+            onCancel={(e) => this.handleCancel(e)}
135
+          >
136
+            <Table dataSource={this.state.dataSource.records} columns={columns} pagination={{ total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
137
+          </Modal>
138
+      </>
139
+    );
140
+  }
141
+}
142
+
143
+
144
+/**
145
+ * 邀请客户
146
+ */
147
+class InviteTable extends React.Component {
148
+  constructor(props) {
149
+    super(props);
150
+    this.state = {
151
+       dataSource: { records: [] },
152
+       visibleData: { visible: false, customerId: '', realtyConsultant: '' },
153
+    }
154
+  }
155
+
156
+  // 挂载之后
157
+  componentDidMount() {
158
+    const { customerId } = this.state.visibleData
159
+    this.getList({ id: customerId, pageNumber: 1, pageSize: 5 })
160
+  }
161
+
162
+  componentDidUpdate(preProps, preState) {
163
+    const { customerId } = this.state.visibleData
164
+    if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
165
+      this.getList({ id: customerId, pageNumber: 1, pageSize: 5 })
166
+      this.setState({ visibleData: this.props.visibleData });
167
+    }
168
+  }
169
+
170
+  // 弹框确定按钮
171
+  // eslint-disable-next-line react/sort-comp
172
+  handleOk() {
173
+    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
174
+  }
175
+
176
+  // 弹框取消按钮
177
+  handleCancel() {
178
+    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
179
+  }
180
+
181
+  getList(params) {
182
+     const { customerId } = this.props.visibleData
183
+    if (customerId === '' || customerId === undefined) {
184
+      return
185
+    }
186
+    request({ ...apis.customer.InviteClientsList, params: { ...params } }).then(res => {
187
+      this.setState({ dataSource: res })
188
+    }).catch(err => {
189
+      // eslint-disable-next-line no-unused-expressions
190
+      <Alert
191
+        style={{
192
+          marginBottom: 24,
193
+        }}
194
+        message={err}
195
+        type="error"
196
+        showIcon
197
+      />
198
+    })
199
+  }
200
+
201
+   // 分页
202
+  onChange(pageNum) {
203
+    this.getList({ pageNumber: pageNum, pageSize: 5 })
204
+  }
205
+
206
+  render() {
207
+    const columns = [
208
+      {
209
+        title: '头像',
210
+        dataIndex: 'img',
211
+        key: 'img',
212
+        align: 'center',
213
+        render: (text, record) => <img src={record.avatarurl}  width = {50} height = {50}/>,
214
+      },
215
+      {
216
+        title: '用户姓名',
217
+        dataIndex: 'name',
218
+        key: 'name',
219
+        align: 'center',
220
+        render: text => <a>{text}</a>,
221
+      },
222
+      {
223
+        title: '电话',
224
+        dataIndex: 'tel',
225
+        key: 'tel',
226
+        align: 'center',
227
+      },
228
+      {
229
+        title: '性别',
230
+        dataIndex: 'sex',
231
+        key: 'sex',
232
+        align: 'center',
233
+        render: (text, list) => <span>{ list.sex === 1 ? '男' : '女' }</span>,
234
+      },
235
+    ]
236
+    return (
237
+      <>
238
+        <Modal
239
+            title="推荐客户"
240
+            destroyOnClose="true"
241
+            width={900}
242
+            footer={null}
243
+            visible={this.state.visibleData.visible}
244
+            // onOk={() => this.handleOk()}
245
+            onCancel={(e) => this.handleCancel(e)}
246
+          >
247
+            <Table dataSource={this.state.dataSource.records} columns={columns} pagination={{ total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
248
+          </Modal>
249
+      </>
250
+    );
251
+  }
252
+}
13
 
253
 
14
 /**
254
 /**
15
  *
255
  *
16
- *
256
+ *主题列表
17
  * @param {*} props
257
  * @param {*} props
18
  * @returns
258
  * @returns
19
  */
259
  */
28
     getList({ pageNumber: 1, pageSize: 10 })
268
     getList({ pageNumber: 1, pageSize: 10 })
29
   }, [])
269
   }, [])
30
 
270
 
271
+
272
+  function openNotificationWithIcon(type, message) {
273
+    notification[type]({
274
+      message,
275
+      description:
276
+        '',
277
+    });
278
+  }
279
+
31
   function getList(params) {
280
   function getList(params) {
32
     // 网路请求
281
     // 网路请求
33
     request({ ...apis.customer.agents, params: { ...params } }).then(res => {
282
     request({ ...apis.customer.agents, params: { ...params } }).then(res => {
34
       setDataSource(res)
283
       setDataSource(res)
35
     }).catch(err => {
284
     }).catch(err => {
36
-      // eslint-disable-next-line no-unused-expressions
37
-      <Alert
38
-        style={{
39
-          marginBottom: 24,
40
-        }}
41
-        message={err}
42
-        type="error"
43
-        showIcon
44
-      />
285
+      openNotificationWithIcon('error', err)
45
     })
286
     })
46
   }
287
   }
47
 
288
 
54
       }
295
       }
55
     });
296
     });
56
   }
297
   }
57
-
298
+  // eslint-disable-next-line react-hooks/rules-of-hooks
299
+  const [gVisibleData, setGVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '' })
300
+  // eslint-disable-next-line react-hooks/rules-of-hooks
301
+  const [gInviteData, setGInviteData] = useState({ visible: false, customerId: '', realtyConsultant: '' })
58
   // Change 事件
302
   // Change 事件
59
   function handleSelectChange(e) {
303
   function handleSelectChange(e) {
60
     // eslint-disable-next-line no-console
304
     // eslint-disable-next-line no-console
61
     console.log(e)
305
     console.log(e)
62
   }
306
   }
307
+  function gM(row) {
308
+    setGVisibleData({ visible: true, customerId: row.personId, realtyConsultant: row.realtyConsultant })
309
+
310
+    setGInviteData({ visible: false })
311
+  }
312
+
313
+  function Invite(row) {
314
+    setGInviteData({ visible: true, customerId: row.personId, realtyConsultant: row.realtyConsultant })
315
+
316
+    setGVisibleData({ visible: false })
317
+  }
63
 
318
 
64
   // 分页
319
   // 分页
65
   function onChange(pageNum) {
320
   function onChange(pageNum) {
121
             <>
376
             <>
122
               <sapn style={{ color: 'rgba(239,39,58,1)' }}>查看详细</sapn>
377
               <sapn style={{ color: 'rgba(239,39,58,1)' }}>查看详细</sapn>
123
               &nbsp;&nbsp;&nbsp;&nbsp;
378
               &nbsp;&nbsp;&nbsp;&nbsp;
124
-              <sapn style={{ color: 'rgba(239,39,58,1)' }}>邀请经纪人</sapn>
379
+              <sapn style={{ color: 'rgba(239,39,58,1)' }} onClick={() => Invite(record)}>邀请经纪人</sapn>
125
               &nbsp;&nbsp;&nbsp;&nbsp;
380
               &nbsp;&nbsp;&nbsp;&nbsp;
126
-              <sapn style={{ color: 'rgba(239,39,58,1)' }}>推荐客户</sapn>
381
+              <sapn style={{ color: 'rgba(239,39,58,1)' }} onClick={() => gM(record)}>推荐客户</sapn>
127
             </>
382
             </>
128
           }
383
           }
129
         </>
384
         </>
158
       </Form>
413
       </Form>
159
 
414
 
160
       <Table dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
415
       <Table dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
416
+            {/* 调整归属 */}
417
+        <ModalTable visibleData={gVisibleData} />
418
+        <InviteTable visibleData={gInviteData} />
161
     </>
419
     </>
162
   );
420
   );
163
 }
421
 }

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

115
       title: '推荐时间',
115
       title: '推荐时间',
116
       dataIndex: 'createDate',
116
       dataIndex: 'createDate',
117
       key: 'createDate',
117
       key: 'createDate',
118
-      render: (_, record) => <><sapn>{ moment(record.createDate).format('YYYY-MM-DD') }</sapn></>,
118
+      render: (_, record) => <><sapn>{ record.createDate && moment(record.createDate).format('YYYY-MM-DD') }</sapn></>,
119
     },
119
     },
120
     {
120
     {
121
       title: '状态',
121
       title: '状态',

+ 74
- 9
src/pages/integralMall/writeOff.jsx 查看文件

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Input, Button, Icon, Tabs, Row, Col, message } from 'antd';
2
+import { Form, Input, Button, Icon, Tabs, Row, Col, Modal, message } from 'antd';
3
 import { FormattedMessage } from 'umi-plugin-react/locale';
3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
 import styles from '../style/GoodsList.less';
4
 import styles from '../style/GoodsList.less';
5
 import router from 'umi/router';
5
 import router from 'umi/router';
13
 }
13
 }
14
 
14
 
15
 /**
15
 /**
16
- *
17
- *
18
  * @param {*} props
16
  * @param {*} props
19
  * @returns
17
  * @returns
20
  */
18
  */
19
+class Dialog extends React.Component {
20
+  state = {
21
+    visible: false,
22
+  };
23
+
24
+  showModal = () => {
25
+    this.setState({ visible: true, });
26
+  };
27
+
28
+  handleCancel = () => {
29
+    this.setState({ visible: false });
30
+  };
31
+
32
+  onKeyDown = (e) => {
33
+
34
+    if (e.keyCode == 13) {
35
+      this.setState({ visible: false });
36
+      this.props.onEnter();
37
+    }
38
+  }
39
+
40
+  render() {
41
+    const { visible, loading } = this.state;
42
+    return (
43
+      <div>
44
+        <Button type="primary" onClick={this.showModal} style={{ margin: '80px auto', display: 'block', padding: '6px 46px', backgroundColor: '#EA2323', border: 'none' }}>立即核销</Button>
45
+        <Modal
46
+          style={{ marginTop: '20vh' }}
47
+          visible={visible}
48
+          title="核销数据"
49
+          onCancel={this.handleCancel}
50
+          footer={[]}
51
+        >
52
+          <p>扫描二维码数据</p>
53
+          <Input placeholder="请用扫描枪扫描二维码" onKeyDown={this.onKeyDown} onChange={this.props.onChange} />
54
+        </Modal>
55
+      </div>
56
+    );
57
+  }
58
+}
59
+
21
 
60
 
22
 function header(props) {
61
 function header(props) {
23
   const [telValue, setTelValue] = useState('')
62
   const [telValue, setTelValue] = useState('')
63
+
24
   const changeTel = (e) => {
64
   const changeTel = (e) => {
25
     setTelValue(e.target.value)
65
     setTelValue(e.target.value)
26
   }
66
   }
27
 
67
 
28
-  const verifyTel = () =>{
29
-    if(telValue === ""){
68
+  const [codeValue, setCodeValue] = useState('')
69
+  const changeCode = (e) => {
70
+
71
+    setCodeValue(e.target.value)
72
+
73
+  }
74
+
75
+  const verifyTel = () => {
76
+    if (telValue === "") {
30
       message.error("请输入手机号");
77
       message.error("请输入手机号");
31
       return;
78
       return;
32
     }
79
     }
38
     });
85
     });
39
   }
86
   }
40
 
87
 
88
+
89
+  const handleEnter = (e) => {
90
+    if (codeValue === "") {
91
+      message.error("无二维码数据");
92
+      return;
93
+    } else {
94
+
95
+      router.push({
96
+        pathname: '/integralMall/verifyList',
97
+        query: {
98
+          telValue:codeValue
99
+        },
100
+      });
101
+    }
102
+  }
103
+
41
   const { getFieldDecorator } = props.form
104
   const { getFieldDecorator } = props.form
42
   return (
105
   return (
43
     <>
106
     <>
62
               <p style={{ margin: '44px auto' }}>根据提示进行核销操作</p>
125
               <p style={{ margin: '44px auto' }}>根据提示进行核销操作</p>
63
             </Col>
126
             </Col>
64
           </Row>
127
           </Row>
65
-          <Button type="primary" style={{ margin: '80px auto', display: 'block', padding: '6px 46px', backgroundColor: '#EA2323', border: 'none' }}>立即核销</Button>
128
+          <Dialog onEnter={handleEnter} onChange={changeCode} />
66
         </TabPane>
129
         </TabPane>
67
         <TabPane tab="手机号核销" key="2">
130
         <TabPane tab="手机号核销" key="2">
68
           <Row>
131
           <Row>
77
               <p>点击“立即核销”按钮</p>
140
               <p>点击“立即核销”按钮</p>
78
             </Col>
141
             </Col>
79
           </Row>
142
           </Row>
80
-          <div style={{ margin: '110px auto', display: 'block',textAlign:'center' }}>
81
-            <Input placeholder="请输入手机号" style={{width:'200px'}} onChange={changeTel}/>
82
-            <Button type="primary" style={{marginLeft:'10px', padding: '6px 46px', backgroundColor: '#EA2323', border: 'none' }} onClick={verifyTel}>立即核销</Button>
143
+          <div style={{ margin: '110px auto', display: 'block', textAlign: 'center' }}>
144
+            <Input placeholder="请输入手机号" style={{ width: '200px' }} onChange={changeTel} />
145
+            <Button type="primary" style={{ marginLeft: '10px', padding: '6px 46px', backgroundColor: '#EA2323', border: 'none' }} onClick={verifyTel}>立即核销</Button>
83
           </div>
146
           </div>
84
         </TabPane>
147
         </TabPane>
85
       </Tabs>,
148
       </Tabs>,
86
     </>
149
     </>
87
   )
150
   )
88
 }
151
 }
152
+
89
 const WrappedHeader = Form.create({ name: 'header' })(header);
153
 const WrappedHeader = Form.create({ name: 'header' })(header);
90
 
154
 
155
+
91
 export default WrappedHeader
156
 export default WrappedHeader

+ 166
- 69
src/pages/news/list/NewsList.jsx 查看文件

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert } from 'antd';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Modal, message, Card, Row, Col, Pagination, Alert } from 'antd';
3
 import moment from 'moment';
3
 import moment from 'moment';
4
+import router from 'umi/router';
4
 import request from '../../../utils/request';
5
 import request from '../../../utils/request';
5
 import apis from '../../../services/apis';
6
 import apis from '../../../services/apis';
6
 import Styles from './style.less';
7
 import Styles from './style.less';
8
+import NewsTypeSelect from '../../../components/SelectButton/NewTypeSelect'
9
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
10
+import SelectCity from '../../../components/SelectButton/CitySelect'
7
 
11
 
8
 
12
 
9
 const { Option } = Select;
13
 const { Option } = Select;
12
 
16
 
13
 const tempDate = [{ code: 's101' }]
17
 const tempDate = [{ code: 's101' }]
14
 
18
 
19
+/**
20
+ *
21
+ *
22
+ * @param {*} props
23
+ * @returns
24
+ */
25
+function body(props) {
26
+  const { getFieldDecorator } = props.form
27
+
28
+  // eslint-disable-next-line react-hooks/rules-of-hooks
29
+  const [dataSource, setDataSource] = useState({ records: [] })
30
+
31
+  // eslint-disable-next-line react-hooks/rules-of-hooks
32
+  useEffect(() => {
33
+    getList({ pageNum: 1, pageSize: 6 })
34
+  }, [])
35
+
36
+  function getList(params) {
37
+    // 网路请求
38
+    request({ ...apis.news.getList, params: { ...params } }).then(res => {
39
+      setDataSource(res)
40
+    }).catch(err => {
41
+      // eslint-disable-next-line no-unused-expressions
42
+      <Alert
43
+        style={{
44
+          marginBottom: 24,
45
+        }}
46
+        message={err}
47
+        type="error"
48
+        showIcon
49
+      />
50
+    })
51
+  }
52
+
53
+  // 提交事件
54
+  function handleSubmit(e) {
55
+    e.preventDefault();
56
+    props.form.validateFields((err, values) => {
57
+      if (!err) {
58
+        console.log('提交数据: ', values)
59
+        const { startDate } = values
60
+        getList({ pageNum: 1, pageSize: 6, ...values })
61
+      }
62
+    });
63
+  }
64
+
65
+  // 跳转到编辑资讯列表
66
+  const toEditList = (id) => ()  => {
67
+    router.push({
68
+      pathname: '/news/list/editNewsList',
69
+      query: {
70
+        id
71
+      },
72
+    });
73
+  }
74
+
75
+
76
+
15
 /**
77
 /**
16
  *卡片
78
  *卡片
17
  *
79
  *
19
  */
81
  */
20
 function CartBody(props) {
82
 function CartBody(props) {
21
   const { data } = props
83
   const { data } = props
22
-  console.log(props);
84
+  console.log(data);
85
+  const cancelPage = () =>{
86
+    router.push({
87
+      pathname: '/news/list/NewsList',
88
+    });
89
+  }
90
+
91
+  //删除资讯
92
+  const changeNewsListStatus = (newsId) => () => {
93
+    Modal.confirm({
94
+      title: '确认删除该资讯?',
95
+      okText: '确认',
96
+      cancelText: '取消',
97
+      onOk() {
98
+        request({
99
+          url: '/api/admin/taNews/' + newsId,
100
+          method: 'DELETE',
101
+          // data: { ...row },
102
+        }).then((data) => {
103
+          message.info('操作成功!')
104
+          getList({ pageNum: 1, pageSize: 10 });
105
+        })
106
+      }
107
+    });
108
+  }
109
+
110
+  // 跳转到编辑资讯列表
111
+  const toEditList = (newsId) => ()  => {
112
+    router.push({
113
+      pathname: '/news/list/editNewsList',
114
+      query: {
115
+        newsId
116
+      },
117
+    });
118
+  } 
119
+
120
+  function cancelRelease (newsId, newsStatus, buildingId,newsTypeId) {
121
+    console.log("newsId" + newsId + "status" + newsStatus);
122
+    if (newsStatus === 1){
123
+      Modal.confirm({
124
+        title: '确认取消该资讯?',
125
+        okText: '确认',
126
+        cancelText: '取消',
127
+        onOk () {
128
+          request({
129
+            url: '/api/admin/taNews/' + newsId,
130
+            method: 'PUT',
131
+            data: { "newsStatus": newsStatus, "buildingId":buildingId, "newsTypeId":newsTypeId },
132
+          }).then((data) => {
133
+            message.info('操作成功!')
134
+            getList({ pageNum: 1, pageSize: 10 });
135
+          })
136
+        },
137
+        onCancel () {
138
+          console.log('Cancel');
139
+        },
140
+      });
141
+    }else if (newsStatus === 0){
142
+      Modal.confirm({
143
+        title: '确认发布该资讯?',
144
+        okText: '确认',
145
+        cancelText: '取消',
146
+        onOk () {
147
+          request({
148
+            url: '/api/admin/taNews/' + newsId,
149
+            method: 'PUT',
150
+            data: { "newsStatus": newsStatus, "buildingId":buildingId, "newsTypeId":newsTypeId },
151
+          }).then((data) => {
152
+            message.info('操作成功!')
153
+            getList({ pageNum: 1, pageSize: 10 });
154
+          })
155
+        },
156
+        onCancel () {
157
+          console.log('Cancel');
158
+        },
159
+      });
160
+    }  
161
+  }
162
+
23
   return (
163
   return (
24
           <Card
164
           <Card
25
             hoverable
165
             hoverable
30
             <p className={Styles.cardText}>
170
             <p className={Styles.cardText}>
31
               <span className={Styles.title}>资讯类型</span>
171
               <span className={Styles.title}>资讯类型</span>
32
               <span >:{ data.newsType.newsTypeName }</span>
172
               <span >:{ data.newsType.newsTypeName }</span>
33
-              <span className={Styles.ediText}>
173
+              <span className={Styles.ediText} onClick={toEditList(data.newsId)}>
34
                 编辑
174
                 编辑
35
                 <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '10px' }} />
175
                 <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '10px' }} />
36
               </span>
176
               </span>
37
             </p>
177
             </p>
38
             <p className={Styles.cardText}>
178
             <p className={Styles.cardText}>
39
               <span className={Styles.title}>状态</span>
179
               <span className={Styles.title}>状态</span>
40
-              <span >:{ data.status == 0 ? "已发布" : "未发布" }</span>
180
+              <span >:{ data.newsStatus == 0 ? "已发布" : "未发布" }</span>
41
             </p>
181
             </p>
42
             <p className={Styles.cardItem}>
182
             <p className={Styles.cardItem}>
43
               <span className={Styles.title}>阅读数量</span>
183
               <span className={Styles.title}>阅读数量</span>
45
             </p>
185
             </p>
46
             <p className={Styles.cardItem}>
186
             <p className={Styles.cardItem}>
47
               <span className={Styles.title}>转发数量</span>
187
               <span className={Styles.title}>转发数量</span>
48
-              <span className={ Styles.address }>:{ data.shareNum }</span>
188
+              <span>:{ data.shareNum }</span>
49
             </p>
189
             </p>
50
             <p className={Styles.cardItem}>
190
             <p className={Styles.cardItem}>
51
               <span className={Styles.title}>点赞数量</span>     
191
               <span className={Styles.title}>点赞数量</span>     
60
               <span >:{ data.createDate }</span>
200
               <span >:{ data.createDate }</span>
61
             </p>
201
             </p>
62
             <p style={{ margin: '15px 0', position: 'relative', fontSize: '18px' }}>
202
             <p style={{ margin: '15px 0', position: 'relative', fontSize: '18px' }}>
63
-              <span style={{ color: '#1990FF' }}>
64
-                取消发布
65
-                <Icon type="close-circle" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
203
+              {data.newsStatus === 0 ? 
204
+              <span style={{ color: '#1990FF' }} onClick={cancelRelease.bind(this,data.newsId, 1, data.buildingId, data.newsType.newsTypeId)}>
205
+              取消发布
206
+              <Icon type="close-circle" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
207
+              </span>:
208
+              <span style={{ color: '#1990FF' }} onClick={cancelRelease.bind(this,data.newsId, 0, data.buildingId, data.newsType.newsTypeId)}>
209
+              发布
210
+              <Icon type="close-circle" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
66
               </span>
211
               </span>
212
+              }
213
+              
67
               <span style={{
214
               <span style={{
68
                 color: '#FF4A4A', position: 'absolute', right: '0',
215
                 color: '#FF4A4A', position: 'absolute', right: '0',
69
-              }} >
216
+              }} onClick={changeNewsListStatus(data.newsId)}>
70
                 删除
217
                 删除
71
                 <Icon type="rest" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
218
                 <Icon type="rest" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
72
               </span>
219
               </span>
75
   )
222
   )
76
 }
223
 }
77
 
224
 
78
-/**
79
- *
80
- *
81
- * @param {*} props
82
- * @returns
83
- */
84
-function body(props) {
85
-  const { getFieldDecorator } = props.form
86
-
87
-  // eslint-disable-next-line react-hooks/rules-of-hooks
88
-  const [dataSource, setDataSource] = useState({ records: [] })
89
-
90
-  // eslint-disable-next-line react-hooks/rules-of-hooks
91
-  useEffect(() => {
92
-    getList({ pageNum: 1, pageSize: 6 })
93
-  }, [])
94
-
95
-  function getList(params) {
96
-    // 网路请求
97
-    request({ ...apis.news.getList, params: { ...params } }).then(res => {
98
-      setDataSource(res)
99
-    }).catch(err => {
100
-      // eslint-disable-next-line no-unused-expressions
101
-      <Alert
102
-        style={{
103
-          marginBottom: 24,
104
-        }}
105
-        message={err}
106
-        type="error"
107
-        showIcon
108
-      />
109
-    })
110
-  }
111
-
112
-  // 提交事件
113
-  function handleSubmit(e) {
114
-    e.preventDefault();
115
-    props.form.validateFields((err, values) => {
116
-      if (!err) {
117
-        // eslint-disable-next-line no-console
118
-        console.log('提交数据: ', values)
119
-        const { startDate } = values
120
-        getList({ pageNum: 1, pageSize: 9, ...values })
121
-      }
122
-    });
123
-  }
124
 
225
 
125
   // Change 事件
226
   // Change 事件
126
   function handleSelectChange(e) {
227
   function handleSelectChange(e) {
131
   // 分页
232
   // 分页
132
   function onChange(pageNumber) {
233
   function onChange(pageNumber) {
133
     // eslint-disable-next-line react-hooks/rules-of-hooks
234
     // eslint-disable-next-line react-hooks/rules-of-hooks
134
-      getList({ pageNum: pageNumber, pageSize: 9 })
235
+      getList({ pageNum: pageNumber, pageSize: 6 })
135
   }
236
   }
136
 
237
 
137
   function getDate(value, dateString) {
238
   function getDate(value, dateString) {
144
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
245
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
145
 
246
 
146
         <Form.Item>
247
         <Form.Item>
147
-          {getFieldDecorator('city')(
148
-            <Select style={{ width: '180px' }} placeholder="请选择城市" onChange={handleSelectChange}>
149
-            </Select>,
248
+          {getFieldDecorator('cityId')(
249
+            <SelectCity />,  
150
           )}
250
           )}
151
         </Form.Item>
251
         </Form.Item>
152
-
153
         <Form.Item>
252
         <Form.Item>
154
-          {getFieldDecorator('project')(
155
-            <Select style={{ width: '180px' }} placeholder="请选择项目" onChange={handleSelectChange}>
156
-            </Select>,
157
-          )}
253
+          {getFieldDecorator('buildingId')(
254
+              <BuildSelect />,
255
+            )}
158
         </Form.Item>
256
         </Form.Item>
159
         <Form.Item>
257
         <Form.Item>
160
           {getFieldDecorator('title')(
258
           {getFieldDecorator('title')(
165
           )}
263
           )}
166
         </Form.Item>
264
         </Form.Item>
167
         <Form.Item>
265
         <Form.Item>
168
-          {getFieldDecorator('type')(
169
-            <Select style={{ width: '180px' }} placeholder="咨询类型" onChange={handleSelectChange}>
170
-            </Select>,
266
+          {getFieldDecorator('newsTypeId')(
267
+            <NewsTypeSelect />,
171
           )}
268
           )}
172
         </Form.Item>       
269
         </Form.Item>       
173
         <Form.Item>
270
         <Form.Item>
174
           {getFieldDecorator('newsStatus')(
271
           {getFieldDecorator('newsStatus')(
175
-            <Select style={{ width: '180px' }} placeholder="状态" onChange={handleSelectChange}>
272
+            <Select style={{ width: '180px' }} placeholder="状态">
176
               <Option value="0">已发布</Option>
273
               <Option value="0">已发布</Option>
177
               <Option value="1">未发布</Option>
274
               <Option value="1">未发布</Option>
178
             </Select>,
275
             </Select>,
184
           </Button>
281
           </Button>
185
         </Form.Item>
282
         </Form.Item>
186
       </Form>
283
       </Form>
187
-      <Button type="primary" className={Styles.addButton}>
284
+      <Button type="primary" className={Styles.addButton} onClick={toEditList()}>
188
         新增
285
         新增
189
       </Button>
286
       </Button>
190
 
287
 

+ 148
- 0
src/pages/news/list/editNewsList.jsx 查看文件

1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker,message } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../../style/GoodsList.less';
5
+import moment from 'moment';
6
+import router from 'umi/router';
7
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
8
+import NewsTypeSelect from '../../../components/SelectButton/NewTypeSelect'
9
+import XForm, { FieldTypes } from '../../../components/XForm';
10
+import Wangedit from '../../../components/Wangedit/Wangedit'
11
+import request from '../../../utils/request'
12
+
13
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
14
+/**
15
+ *
16
+ *
17
+ * @param {*} props
18
+ * @returns
19
+ */
20
+ const Edit = (props) => {
21
+  const [ tab, changeTab ] = useState('basic')
22
+  const newsId = props.location.query.newsId
23
+  const [ dynamicData, setDynamicData ] = useState({})
24
+  if(newsId){
25
+    useEffect(() => {
26
+      getDynamicData(newsId);
27
+    },[])
28
+
29
+  // 查询列表
30
+  const getDynamicData = (newsId) => {
31
+    request({
32
+        url: '/api/admin/taNews/' + newsId,
33
+        method: 'GET',
34
+        params: { newsId },
35
+    }).then((data) => {
36
+        console.log(data)
37
+        setDynamicData(data)
38
+    })
39
+  }
40
+  }
41
+
42
+  const cancelPage = () =>{
43
+    router.push({
44
+      pathname: '/news/list/NewsList',
45
+    });
46
+  }
47
+
48
+  const Basic = (props) => {
49
+    const fields = [
50
+      {
51
+        label: '意向项目',
52
+        name: 'buildingId',
53
+        render: <BuildSelect />,
54
+        value: dynamicData.buildingId,
55
+        rules: [
56
+          {required: true, message: '请选择所属项目'},
57
+        ]
58
+      },
59
+      {
60
+        label: '资讯图片',
61
+        name: 'newsImg',
62
+        type: FieldTypes.ImageUploader,
63
+        value: dynamicData.newsImg,
64
+      },
65
+      {
66
+        label: '资讯标题',
67
+        name: 'newsName',
68
+        type: FieldTypes.Text,
69
+        value: dynamicData.newsName,
70
+        rules: [
71
+          {required: true, message: '请输入资讯标题'},
72
+        ]
73
+      },
74
+      {
75
+        label: '资讯类型',
76
+        name: 'newsTypeId',
77
+        render: <NewsTypeSelect />,
78
+        value: dynamicData.newsTypeId,
79
+        rules: [
80
+          {required: true, message: '请选择资讯类型'},
81
+        ]
82
+      },
83
+      {
84
+        label: '资讯详情',
85
+        name: 'desc',
86
+        render: <Wangedit />,
87
+        value: dynamicData.desc,
88
+      },
89
+    ]
90
+  
91
+    const handleSubmit = val => { 
92
+      let {...submitValue} = val
93
+      if(newsId){
94
+        submitValue.newsId = newsId
95
+        request({
96
+          url: '/api/admin/taNews/' + newsId,
97
+          method: 'PUT',
98
+          data: submitValue,
99
+        }).then((data) => {
100
+          cancelPage()
101
+        }).catch((err) => {
102
+          message.info(err.msg || err.message)
103
+        })
104
+      }else{
105
+        request({
106
+          url: '/api/admin/taNews',
107
+          method: 'POST',
108
+          data: submitValue,
109
+        }).then((data) => {
110
+          cancelPage()
111
+        }).catch((err) => {
112
+          message.info(err.msg || err.message)
113
+        })
114
+      }
115
+    }
116
+    
117
+    return <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
118
+  }
119
+  
120
+  const Poster = (props) => {
121
+   return <div>Poster</div>
122
+  }
123
+ 
124
+  const Share = (props) => {
125
+    return <div>Share</div>
126
+  }
127
+
128
+  return (
129
+    <div>
130
+      <div>
131
+        <Radio.Group value={tab} buttonStyle="solid" onChange={e => changeTab(e.target.value)}>
132
+          <Radio.Button value="basic">基本信息</Radio.Button>
133
+          <Radio.Button value="poster">海报图片</Radio.Button>
134
+          <Radio.Button value="share">分享设置</Radio.Button>
135
+        </Radio.Group>
136
+      </div>
137
+      <div>
138
+        { tab === 'basic' && <Basic /> }
139
+        { tab === 'poster' && <Poster /> }
140
+        { tab === 'share' && <Share /> }
141
+      </div>
142
+    </div>
143
+  );
144
+ }
145
+
146
+
147
+
148
+export default Edit

+ 1
- 1
src/pages/news/type/NewsType.jsx 查看文件

45
   }
45
   }
46
 
46
 
47
 
47
 
48
-  // 跳转到编辑咨询
48
+  // 跳转到编辑资讯
49
   const toEditNews = (id) => () => {
49
   const toEditNews = (id) => () => {
50
     router.push({
50
     router.push({
51
       pathname: '/news/type/editNews',
51
       pathname: '/news/type/editNews',

+ 76
- 0
src/pages/system/messageList.jsx 查看文件

1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../style/GoodsList.less';
5
+import router from 'umi/router';
6
+import moment from 'moment';
7
+import SelectCity from '../../components/SelectButton/CitySelect'
8
+import BuildSelect from '../../components/SelectButton/BuildSelect'
9
+
10
+import request from '../../utils/request'
11
+
12
+const { Option } = Select;
13
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
14
+
15
+const header = (props) => {
16
+  const [ data, setData ] = useState({})
17
+//   const [page, changePage] = useState({})
18
+
19
+  useEffect(() => {
20
+    getList({ pageNum: 1, pageSize: 10 });
21
+  },[])
22
+
23
+  // 查询列表
24
+  const getList = (params) => {
25
+    request({
26
+        url: '/api/admin/taCustomerMessage',
27
+        method: 'GET',
28
+        params: { ...params },
29
+    }).then((data) => {
30
+        console.log(data)
31
+        setData(data)
32
+    })
33
+  }
34
+
35
+  const columns = [
36
+    {
37
+      title: '电话号码',
38
+      dataIndex: 'phone',
39
+      key: 'phone',
40
+      align: 'center',
41
+    },
42
+    {
43
+      title: '留言内容',
44
+      dataIndex: 'message',
45
+      key: 'message',
46
+      align: 'center',
47
+    },
48
+    {
49
+      title: '创建时间',
50
+      dataIndex: 'createDate',
51
+      key: 'createDate',
52
+      align: 'center',
53
+      render: (x, row) => <><span>{moment(row.createDate).format('YYYY-MM-DD')}</span></>
54
+    },
55
+  ];
56
+   
57
+  
58
+  const changePageNum = (pageNumber) => {
59
+      getList({ pageNum: pageNumber, pageSize: 10 })
60
+  }
61
+ 
62
+
63
+  const { getFieldDecorator } = props.form
64
+  return (
65
+
66
+    <>
67
+      <Table dataSource={data.records} columns={columns} pagination={false}/>
68
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
69
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
70
+      </div>
71
+    </>
72
+  )
73
+}
74
+const WrappedHeader = Form.create({ name: 'header' })(header);
75
+
76
+export default WrappedHeader

+ 73
- 0
src/pages/system/report.jsx 查看文件

1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker,message,Checkbox } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../style/GoodsList.less';
5
+import moment from 'moment';
6
+import router from 'umi/router';
7
+import BuildSelect from '../../components/SelectButton/BuildSelect'
8
+import XForm, { FieldTypes } from '../../components/XForm';
9
+import Wangedit from '../../components/Wangedit/Wangedit'
10
+import request from '../../utils/request'
11
+
12
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
13
+/**
14
+ *
15
+ *
16
+ * @param {*} props
17
+ * @returns
18
+ */
19
+ const Edit = (props) => {
20
+  const [ data, setData ] = useState([])
21
+  const [ checkData, setCheckData ] = useState([])
22
+
23
+  useEffect(() => {
24
+    getReportList();
25
+    getCheckedList();
26
+  },[])
27
+
28
+  // 查询数据
29
+  const getReportList = () => {
30
+    request({
31
+        url: '/api/admin/tdReports',
32
+        method: 'GET',
33
+    }).then((data) => {
34
+        setData((data.records || []).map(x => ({label: x.reportName, value: x.reportCode}) ))
35
+    })
36
+  }
37
+
38
+  const getCheckedList = () => {
39
+    request({
40
+      url: '/api/admin/taBuildingReports',
41
+      method: 'GET',
42
+    }).then((data) => {
43
+      setCheckData((data.records || []).map((x) => x.reportCode))
44
+    })
45
+  }
46
+   
47
+  const onChange = (checkedValues) => {
48
+    console.log('checked = ', checkedValues);
49
+    setCheckData(checkedValues)
50
+  }
51
+
52
+  const saveCheckedReport = () => {
53
+    console.log(checkData)
54
+    request({
55
+      url: '/api/admin/taBuildingReport/add',
56
+      method: 'POST',
57
+      data: {list: checkData}
58
+    }).then((data) => {
59
+      message.info("保存成功")
60
+    })
61
+  }
62
+
63
+  return (
64
+    <>
65
+      <Checkbox.Group options={data} value={checkData} onChange={onChange} />
66
+      <Button type="primary" className={styles.searchBtn} onClick={saveCheckedReport}>提交</Button>
67
+    </>
68
+  );
69
+ }
70
+
71
+
72
+
73
+export default Edit

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

22
       method: 'GET',
22
       method: 'GET',
23
       url: `${prefix}/buildinglist`,
23
       url: `${prefix}/buildinglist`,
24
     },
24
     },
25
+    buildingApartment: {
26
+      method: 'GET',
27
+      url: `${prefix}/buildingApartment/buildingId/id`,
28
+    },
25
   },
29
   },
26
   buildingType: {
30
   buildingType: {
27
     getList: {
31
     getList: {
92
       method: 'GET',
96
       method: 'GET',
93
       url: `${prefix}/mine/taPointsRecords/id`,
97
       url: `${prefix}/mine/taPointsRecords/id`,
94
     },
98
     },
99
+    recommend: {
100
+      method: 'GET',
101
+      url: `${prefix}/customer/recommend/id`,
102
+    },
103
+    InviteClientsList: {
104
+      method: 'GET',
105
+      url: `${prefix}/channel/InviteClientsList`,
106
+    },
107
+    CustomerRecommendGet: {
108
+      method: 'GET',
109
+      url: `${prefix}/customer/recommend/get/id`,
110
+    },
95
   },
111
   },
96
 }
112
 }