zlisen 4 年之前
父節點
當前提交
4096487732
共有 51 個文件被更改,包括 7302 次插入358 次删除
  1. 76
    6
      config/routes.js
  2. 2
    6
      package.json
  3. 3
    0
      src/components/QueryTable/index.jsx
  4. 2
    2
      src/components/TableList/index.jsx
  5. 109
    0
      src/components/Wangedit/Wangedit.jsx
  6. 124
    0
      src/pages/carouselFigure/LiveGroup.jsx
  7. 110
    0
      src/pages/carouselFigure/SalesBatchGroup.jsx
  8. 114
    0
      src/pages/carouselFigure/SelectActivity.jsx
  9. 110
    0
      src/pages/carouselFigure/SelectGroup.jsx
  10. 111
    0
      src/pages/carouselFigure/SelectH5.1.jsx
  11. 135
    0
      src/pages/carouselFigure/SelectH5.jsx
  12. 111
    0
      src/pages/carouselFigure/SelectHelp.jsx
  13. 106
    0
      src/pages/carouselFigure/SelectNews.jsx
  14. 286
    0
      src/pages/carouselFigure/advertisingList.jsx
  15. 284
    0
      src/pages/carouselFigure/carouselFigureList.jsx
  16. 148
    0
      src/pages/carouselFigure/customImg/edit.jsx
  17. 81
    0
      src/pages/carouselFigure/customImg/list.jsx
  18. 426
    0
      src/pages/carouselFigure/editAdvertising.jsx
  19. 393
    0
      src/pages/carouselFigure/editCarousel.jsx
  20. 361
    0
      src/pages/carouselFigure/propaganda.jsx
  21. 284
    0
      src/pages/carouselFigure/propagandaList.jsx
  22. 248
    0
      src/pages/customer/Customer/PrivateCustomer/CustomerDetail.jsx
  23. 98
    0
      src/pages/customer/Customer/PrivateCustomer/components/Attribution.jsx
  24. 0
    75
      src/pages/customer/Customer/PrivateCustomer/components/ChangeStatus.jsx
  25. 149
    0
      src/pages/customer/Customer/PrivateCustomer/components/IntegralRecord.jsx
  26. 285
    0
      src/pages/customer/Customer/PrivateCustomer/components/Recommend.jsx
  27. 99
    15
      src/pages/customer/Customer/PrivateCustomer/index.jsx
  28. 49
    0
      src/pages/customer/Customer/PrivateCustomer/searchFields.js
  29. 323
    0
      src/pages/customer/Customer/PublicCustomer/components/AssistConsultant.jsx
  30. 98
    0
      src/pages/customer/Customer/PublicCustomer/components/Attribution.jsx
  31. 170
    0
      src/pages/customer/Customer/PublicCustomer/components/BatchAssistConsultant.jsx
  32. 77
    0
      src/pages/customer/Customer/PublicCustomer/components/ChangeStatus.jsx
  33. 140
    0
      src/pages/customer/Customer/PublicCustomer/components/IntegralRecord.jsx
  34. 285
    0
      src/pages/customer/Customer/PublicCustomer/components/Recommend.jsx
  35. 281
    0
      src/pages/customer/Customer/PublicCustomer/index.jsx
  36. 21
    0
      src/pages/customer/Customer/PublicCustomer/searchFields.js
  37. 132
    0
      src/pages/customer/Customer/PublicCustomer/tableColumns.js
  38. 17
    5
      src/pages/customer/Customer/index.jsx
  39. 237
    0
      src/pages/customer/Recommend/audit.jsx
  40. 151
    0
      src/pages/customer/Recommend/components/attribution.jsx
  41. 187
    0
      src/pages/customer/Recommend/index.jsx
  42. 0
    0
      src/pages/customer/Recommend/style.less
  43. 24
    76
      src/pages/customer/drift/index.jsx
  44. 0
    173
      src/pages/customer/visiting/index.jsx
  45. 238
    0
      src/pages/recommend/recommendCustomer/audit.jsx
  46. 151
    0
      src/pages/recommend/recommendCustomer/components/attribution.jsx
  47. 252
    0
      src/pages/recommend/recommendCustomer/index.jsx
  48. 54
    0
      src/pages/recommend/recommendCustomer/style.css
  49. 58
    0
      src/pages/recommend/recommendCustomer/style.less
  50. 54
    0
      src/pages/recommend/recommendCustomer/style.wxss
  51. 48
    0
      src/pages/style/GoodsList.less

+ 76
- 6
config/routes.js 查看文件

@@ -94,15 +94,20 @@ export default [
94 94
               {
95 95
                 path: '/customer/customer/list',
96 96
                 name: '客户列表',
97
-                component: './customer/customer/index',
97
+                component: './customer/Customer/index',
98 98
               },
99
-
100
-
101 99
               {
102
-                path: '/customer/customerlist/list',
103
-                name: '客户列表old',
104
-                component: './customer/customerlist/index copy.jsx',
100
+                path: '/customer/customerlist/privateCustomerDetail',
101
+                name: '私客详情',
102
+                hideInMenu: true,
103
+                component: './customer/Customer/PrivateCustomer/CustomerDetail',
105 104
               },
105
+
106
+              // {
107
+              //   path: '/customer/customerlist/list',
108
+              //   name: '客户列表old',
109
+              //   component: './customer/customerlist/index copy.jsx',
110
+              // },
106 111
               {
107 112
                 path: '/customer/customerlist/customerDetail',
108 113
                 name: '私客详情',
@@ -120,8 +125,73 @@ export default [
120 125
                 hideInMenu: true,
121 126
                 component: './customer/customerlist/publicCustomerDetail',
122 127
               },
128
+               {
129
+                path: '/customer/recommend/list',
130
+                name: '推荐记录',
131
+                component: './customer/Recommend',
132
+              },
133
+              {
134
+                path: '/customer/recommend/audit',
135
+                name: '客户审核',
136
+                hideInMenu: true,
137
+                component: './customer/Recommend/audit',
138
+              },
139
+            ],
140
+          },
141
+
142
+
143
+          {
144
+            path: '/carouselFigure',
145
+            name: '资源位管理',
146
+            component: '../layouts/BlankLayout',
147
+            routes: [
148
+              {
149
+                path: '/carouselFigure/carouselFigureList',
150
+                name: '轮播图',
151
+                component: './carouselFigure/carouselFigureList',
152
+              },
153
+              {
154
+                path: '/carouselFigure/editCarousel',
155
+                name: '轮播图编辑',
156
+                hideInMenu: true,
157
+                component: './carouselFigure/editCarousel',
158
+              },
159
+              {
160
+                path: '/carouselFigure/advertisingList',
161
+                name: '开屏广告',
162
+                component: './carouselFigure/advertisingList',
163
+              },
164
+              {
165
+                path: '/carouselFigure/editAdvertising',
166
+                name: '开屏广告编辑',
167
+                hideInMenu: true,
168
+                component: './carouselFigure/editAdvertising',
169
+              },
170
+              {
171
+                path: '/carouselFigure/propagandaList',
172
+                name: '宣传位',
173
+                component: './carouselFigure/propagandaList',
174
+              },
175
+              {
176
+                path: '/carouselFigure/propaganda',
177
+                name: '宣传位编辑',
178
+                hideInMenu: true,
179
+                component: './carouselFigure/propaganda',
180
+              },
181
+              {
182
+                path: '/carouselFigure/customImg/list',
183
+                name: '其他',
184
+                component: './carouselFigure/customImg/list',
185
+              },
186
+              {
187
+                path: '/carouselFigure/customImg/edit',
188
+                name: '其他编辑',
189
+                hideInMenu: true,
190
+                component: './carouselFigure/customImg/edit',
191
+              },
123 192
             ],
124 193
           },
194
+         
125 195
           {
126 196
             component: './404',
127 197
           },

+ 2
- 6
package.json 查看文件

@@ -31,11 +31,6 @@
31 31
     "tsc": "tsc",
32 32
     "ui": "umi ui"
33 33
   },
34
-  "husky": {
35
-    "hooks": {
36
-      "pre-commit": "npm run lint-staged"
37
-    }
38
-  },
39 34
   "lint-staged": {
40 35
     "**/*.less": "stylelint --syntax less",
41 36
     "**/*.{js,jsx,ts,tsx}": "npm run lint-staged:js",
@@ -70,7 +65,8 @@
70 65
     "umi-plugin-antd-theme": "^1.0.1",
71 66
     "umi-plugin-pro-block": "^1.3.2",
72 67
     "umi-plugin-react": "^1.9.5",
73
-    "umi-request": "^1.0.8"
68
+    "umi-request": "^1.0.8",
69
+    "wangeditor": "^4.7.1"
74 70
   },
75 71
   "devDependencies": {
76 72
     "@ant-design/pro-cli": "^1.0.18",

+ 3
- 0
src/components/QueryTable/index.jsx 查看文件

@@ -4,6 +4,7 @@ import TableList from '@/components/TableList'
4 4
 
5 5
 export default React.forwardRef((props, ref) => {
6 6
   const tableRef = useRef()
7
+  const searchRef = useRef()
7 8
   const [searchData, setSearchData] = useState({})
8 9
   const {api, searchFields, params, onPageChange, ...leftProps} = props
9 10
   const handleSearch = (data) => setSearchData(data)
@@ -14,11 +15,13 @@ export default React.forwardRef((props, ref) => {
14 15
         tableRef.current.reload()
15 16
       }
16 17
     },
18
+    getSearchData: searchData,
17 19
   }))
18 20
 
19 21
   return (
20 22
     <>
21 23
       <Search
24
+      ref={searchRef}
22 25
         fields={searchFields}
23 26
         onSearch={handleSearch}
24 27
         onReset={handleSearch}

+ 2
- 2
src/components/TableList/index.jsx 查看文件

@@ -12,7 +12,7 @@ export default React.forwardRef((props, ref) => {
12 12
   const [pageTotal, setPageTotal] = useState(0)
13 13
   const [pageConfig, setPageConfig] = useState({ current: 1, pageSize: 10 })
14 14
 
15
-  const { api, params, onPageChange, ...tableProps } = props
15
+  const { api,urlData, params, onPageChange, ...tableProps } = props
16 16
 
17 17
   // 更新分页
18 18
   const updatePage = useCallback(
@@ -40,7 +40,7 @@ export default React.forwardRef((props, ref) => {
40 40
         pageNum: pageConfig.current,
41 41
         pageSize: pageConfig.pageSize,
42 42
       }
43
-      request({...api, params: queryParams }).then((res) => {
43
+      request({...api, urlData:urlData||undefined, params: queryParams }).then((res) => {
44 44
         const {total, records = []} = res
45 45
         setLoading(false)
46 46
         setList(records)

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

@@ -0,0 +1,109 @@
1
+import React from 'react';
2
+import E from 'wangeditor';
3
+import { fetch, apis } from '../../utils/request';
4
+
5
+/**
6
+ * @param {*} props
7
+ * @returns
8
+ */
9
+class Wangedit extends React.Component {
10
+  constructor(props, context) {
11
+    super(props, context);
12
+    this.state = {
13
+      html: undefined,
14
+      contenteditable: props.contenteditable == false ? false : true
15
+    }
16
+    this.editor = undefined;
17
+  }
18
+
19
+  render() {
20
+    return (
21
+      <div ref="editorElem" style={{ textAlign: 'left' }}>
22
+      </div>
23
+    );
24
+  }
25
+
26
+  componentDidMount() {
27
+    const elem = this.refs.editorElem
28
+    this.editor = new E(elem)
29
+    // 使用 onchange 函数监听内容的变化
30
+    this.editor.customConfig.onchange = html => {
31
+      this.setState({ html })
32
+
33
+      if (typeof this.props.onChange === 'function') {
34
+        this.props.onChange(html)
35
+      }
36
+    }
37
+    this.editor.customConfig.zIndex = 100
38
+    this.editor.customConfig.uploadImgMaxLength = 1
39
+    this.editor.customConfig.customUploadImg = function (files, insert) {
40
+      if (!files.length) return
41
+      
42
+      const data = new FormData()
43
+      data.append('file', files[0])
44
+
45
+      fetch(apis.image.upload)({data}).then(insert)
46
+    }
47
+    this.editor.customConfig.menus = [
48
+      'head',  // 标题
49
+      'bold',  // 粗体
50
+      'fontSize',  // 字号
51
+      'fontName',  // 字体
52
+      'italic',  // 斜体
53
+      'underline',  // 下划线
54
+      'strikeThrough',  // 删除线
55
+      'foreColor',  // 文字颜色
56
+      'backColor',  // 背景颜色
57
+      'list',  // 列表
58
+      'justify',  // 对齐方式
59
+      'quote',  // 引用
60
+      'image',  // 插入图片
61
+      'undo',  // 撤销
62
+      'redo'  // 重复
63
+    ]
64
+    
65
+    // 过滤 word 字符
66
+    this.editor.customConfig.pasteFilterStyle = false
67
+    this.editor.customConfig.pasteTextHandle = function(content) {
68
+      const regs = [
69
+        /<!--\[if [\s\S]*?endif\]-->/ig,
70
+        /<[a-zA-Z0-9]+\:[^>]+>[^>]*<\/[a-zA-Z0-9]+\:[^>]+>/ig,
71
+        /<[a-zA-Z0-9]+\:[^>]+\/>/ig,
72
+        /<style>[\s\S]*?<\/style>/ig,
73
+        new RegExp('\u2029', 'ig'),     // 替换word分隔符 序号 8233
74
+      ]
75
+
76
+      return regs.reduce((acc, reg) => {
77
+        return acc.replace(reg, '')
78
+      }, content)
79
+    }
80
+
81
+    this.editor.create()
82
+    this.editor.$textElem.attr('contenteditable',this.state.contenteditable);
83
+    this.editor.customConfig.uploadImgShowBase64 = true
84
+    this.editor.txt.html(this.props.value)
85
+  }
86
+
87
+  componentDidUpdate(props, state) {
88
+    if (this.props.value && !state.html) {
89
+      if (this.editor) {
90
+        this.editor.txt.html(this.props.value)
91
+      }
92
+    }
93
+  }
94
+
95
+  /**
96
+   *增加这个 shouldComponentUpdate 生命函数
97
+    处理自动聚焦到富文本上
98
+   *
99
+   * @param {*} nextProps
100
+   * @returns
101
+   * @memberof Wangedit
102
+   */
103
+  shouldComponentUpdate(nextProps) {
104
+    return nextProps.value !== this.editor.txt.html()
105
+  }
106
+}
107
+
108
+export default Wangedit
109
+

+ 124
- 0
src/pages/carouselFigure/LiveGroup.jsx 查看文件

@@ -0,0 +1,124 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Select, Modal, Button, Table, Divider, Tag, Input } from 'antd';
3
+import { apis, fetch } from '../../utils/request';
4
+import Navigate from '@/components/Navigate';
5
+
6
+const { Search } = Input;
7
+
8
+const getGroupList = fetch(apis.taliveActivity.taLiveActivity)
9
+
10
+export default props => {
11
+  const {
12
+    value,
13
+    onChange,
14
+    ...rest
15
+  } = props;
16
+
17
+  const [list, setList] = useState([]);
18
+  const [visible, setVisible] = useState(false);
19
+  const [group, setGroup] = useState({ groupId: undefined, groupName: '请选择直播活动' })
20
+  const getGroupTitle = val => {
21
+    return (list.filter(x => x.liveActivityId == val)[0] || {}).liveActivityTitle || '请选择直播活动'
22
+  }
23
+  const updateGroup = val => setGroup({ groupId: val, groupName: getGroupTitle(val) })
24
+
25
+  const buildingId = props.buildingId()
26
+
27
+  useEffect(() => {
28
+    getGroupList({
29
+      params: {
30
+        buildingId,
31
+        pageNum: 1,
32
+        pageSize: 999,
33
+        status: 1,
34
+        source: 2,
35
+      },
36
+    }).then(data => {
37
+      setList(data.records || [])
38
+
39
+       const getGroupTitle = val => {
40
+        return (data.records.filter(x => x.liveActivityId == val)[0] || {}).liveActivityTitle || '请选择直播活动'
41
+      }
42
+      const updateGroup = val => setGroup({ groupId: val, groupName: getGroupTitle(val) })
43
+
44
+      updateGroup(buildingId ? undefined : value);
45
+
46
+      // updateGroup(buildingId ? undefined : value);
47
+    })
48
+  }, [buildingId]);
49
+  const searchGroup = (e) => {
50
+    getGroupList({
51
+      params: {
52
+        buildingId,
53
+        pageNum: 1,
54
+        pageSize: 999,
55
+        status: 1,
56
+        source: 2,
57
+        liveActivityTitle: e
58
+      }
59
+    }).then((data) => {
60
+      setList(data.records || [])
61
+
62
+      // const getGroupTitle = val => {
63
+      //   return (data.records.filter(x => x.liveActivityId == val)[0] || {}).liveActivityTitle || '请选择直播活动'
64
+      // }
65
+      // const updateGroup = val => setGroup({ groupId: val, groupName: getGroupTitle(val) })
66
+
67
+      updateGroup(buildingId ? undefined : value);
68
+      // setAct(buildingId ? undefined : value);
69
+    })
70
+  }
71
+  if (value !== group.groupId) {
72
+    updateGroup(value);
73
+  }
74
+
75
+  const handleChange = val => {
76
+    onChange(val)
77
+  }
78
+
79
+  const setData = val => {
80
+    updateGroup(val)
81
+    onChange(val)
82
+    setVisible(false)
83
+  }
84
+
85
+  const columns = [
86
+    {
87
+      title: '标题',
88
+      dataIndex: 'liveActivityTitle',
89
+      key: 'liveActivityId',
90
+      align: 'center',
91
+      ellipsis: true,
92
+      render: text => <a>{text}</a>,
93
+    },
94
+    {
95
+      title: '操作',
96
+      align: 'center',
97
+      width: '20%',
98
+      render: (text, record) => (
99
+        <Navigate onClick={() => setData(record.liveActivityId)}>选择</Navigate>
100
+      ),
101
+    },
102
+  ];
103
+
104
+  return (
105
+    <div>
106
+             <div ><Navigate onClick={() => setVisible(true)}>{group.groupName}</Navigate></div>
107
+      <Modal
108
+        title="请选择"
109
+        visible={visible}
110
+        onCancel={() => setVisible(false)}
111
+        footer={[]}
112
+      >
113
+        <Search
114
+          placeholder="请输入标题"
115
+          enterButton="搜索"
116
+          size="large"
117
+          onSearch={value => searchGroup(value)}
118
+          style={{ marginBottom: '16px' }}
119
+        />
120
+        <Table rowKey={list => list.liveActivityId} columns={columns} dataSource={list} />
121
+      </Modal>
122
+    </div>
123
+  );
124
+}

+ 110
- 0
src/pages/carouselFigure/SalesBatchGroup.jsx 查看文件

@@ -0,0 +1,110 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Select, Modal, Button, Table, Divider, Tag, Input } from 'antd';
3
+import { apis, fetch } from '../../utils/request';
4
+import Navigate from '@/components/Navigate';
5
+
6
+const { Search } = Input;
7
+
8
+const getGroupList = fetch(apis.house.taSalesBatch)
9
+
10
+export default props => {
11
+  const {
12
+    value,
13
+    onChange,
14
+    ...rest
15
+  } = props;
16
+
17
+  const [list, setList] = useState([]);
18
+  const [visible, setVisible] = useState(false);
19
+  const [group, setGroup] = useState({ groupId: undefined, groupName: '请选择销售批次' })
20
+  const getGroupTitle = val => {
21
+    return (list.filter(x => x.salesBatchId == val)[0] || {}).salesBatchName || '请选择销售批次'
22
+  }
23
+  const updateGroup = val => setGroup({ groupId: val, groupName: getGroupTitle(val) })
24
+
25
+  const buildingId = props.buildingId()
26
+
27
+  useEffect(() => {
28
+    getGroupList({
29
+      params: {
30
+        buildingId,
31
+        pageNum: 1,
32
+        pageSize: 999,
33
+        status: 1,
34
+      },
35
+    }).then(data => {
36
+      setList(data.records || [])
37
+
38
+      updateGroup(buildingId ? undefined : value);
39
+    })
40
+  }, [buildingId]);
41
+  const searchGroup = (e) => {
42
+    getGroupList({
43
+      params: {
44
+        buildingId,
45
+        pageNum: 1,
46
+        pageSize: 999,
47
+        status: 1,
48
+        salesBatchName: e
49
+      }
50
+    }).then((data) => {
51
+      setList(data.records || [])
52
+
53
+      updateGroup(buildingId ? undefined : value);
54
+      // setAct(buildingId ? undefined : value);
55
+    })
56
+  }
57
+  if (value !== group.groupId) {
58
+    updateGroup(value);
59
+  }
60
+
61
+  const handleChange = val => {
62
+    onChange(val)
63
+  }
64
+
65
+  const setData = val => {
66
+    updateGroup(val)
67
+    onChange(val)
68
+    setVisible(false)
69
+  }
70
+
71
+  const columns = [
72
+    {
73
+      title: '标题',
74
+      dataIndex: 'salesBatchName',
75
+      key: 'salesBatchId',
76
+      align: 'center',
77
+      ellipsis: true,
78
+      render: text => <a>{text}</a>,
79
+    },
80
+    {
81
+      title: '操作',
82
+      align: 'center',
83
+      width: '20%',
84
+      render: (text, record) => (
85
+        <Navigate onClick={() => setData(record.salesBatchId)}>选择</Navigate>
86
+      ),
87
+    },
88
+  ];
89
+
90
+  return (
91
+    <div>
92
+       <div ><Navigate onClick={() => setVisible(true)}>{group.groupName}</Navigate></div>
93
+      <Modal
94
+        title="请选择"
95
+        visible={visible}
96
+        onCancel={() => setVisible(false)}
97
+        footer={[]}
98
+      >
99
+        <Search
100
+          placeholder="请输入标题"
101
+          enterButton="搜索"
102
+          size="large"
103
+          onSearch={value => searchGroup(value)}
104
+          style={{ marginBottom: '16px' }}
105
+        />
106
+        <Table rowKey={list => list.salesBatchId} columns={columns} dataSource={list} />
107
+      </Modal>
108
+    </div>
109
+  );
110
+}

+ 114
- 0
src/pages/carouselFigure/SelectActivity.jsx 查看文件

@@ -0,0 +1,114 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Select, Modal, Button, Table, Divider, Tag, Input } from 'antd';
3
+import { apis, fetch } from '../../utils/request';
4
+import Navigate from '@/components/Navigate';
5
+
6
+const getActivities = fetch(apis.activity.listSelected)
7
+const { Search } = Input;
8
+
9
+export default (props) => {
10
+  const {
11
+    value,
12
+    onChange,
13
+    ...rest
14
+  } = props;
15
+
16
+  const [list, setList] = useState([]);
17
+  const [visible, setVisible] = useState(false);
18
+  const [activity, setActivity] = useState({ dynamicId: undefined, title: '请选择活动' })
19
+  const getActTitle = val => ((list.filter(x => x.dynamicId === val)[0]) || {}).title || '请选择活动'
20
+  const setAct = val => setActivity({ dynamicId: val, title: getActTitle(val) })
21
+
22
+  const buildingId = props.buildingId()
23
+
24
+  useEffect(() => {
25
+    getActivities({
26
+      params: {
27
+        buildingId,
28
+        pageNum: 1,
29
+        pageSize: 999,
30
+        activityStatus: 2,
31
+      }
32
+    }).then((data) => {
33
+      setList(data.list || [])
34
+
35
+      console.log('----', buildingId, value)
36
+
37
+      setAct(buildingId ? undefined : value);
38
+    })
39
+  }, [buildingId]);
40
+
41
+  if (value !== activity.dynamicId) {
42
+    setAct(value);
43
+  }
44
+  const searchActivity =(e)=>{
45
+    getActivities({
46
+      params: {
47
+        buildingId,
48
+        pageNum: 1,
49
+        pageSize: 999,
50
+        activityStatus: 2,
51
+        name:e
52
+      }
53
+    }).then((data) => {
54
+      setList(data.list || [])
55
+
56
+      console.log('----', buildingId, value)
57
+
58
+      // setAct(buildingId ? undefined : value);
59
+    })
60
+  }
61
+
62
+  let chooseVal = value
63
+
64
+  const handleChange = val => chooseVal = val
65
+
66
+  const setData = val => {
67
+    setAct(val)
68
+    onChange(val)
69
+    setVisible(false)
70
+  }
71
+
72
+  const columns = [
73
+    {
74
+      title: '标题',
75
+      dataIndex: 'title',
76
+      key: 'dynamicId',
77
+      align: 'center',
78
+      ellipsis: true,
79
+      render: text => <a>{text}</a>,
80
+    },
81
+    {
82
+      title: '操作',
83
+      dataIndex: 'name',
84
+      align: 'center',
85
+      width: '20%',
86
+      render: (text, record) => (
87
+        <Navigate onClick={() => setData(record.dynamicId)}>选择</Navigate>
88
+      ),
89
+    },
90
+  ];
91
+
92
+  return (
93
+
94
+    <div>
95
+      <div ><Navigate onClick={() => setVisible(true)}>{activity.title}</Navigate></div>
96
+      <Modal
97
+        title="请选择"
98
+        visible={visible}
99
+        onCancel={() => setVisible(false)}
100
+        footer={[]}
101
+      >
102
+        <Search
103
+          placeholder="请输入标题"
104
+          enterButton="搜索"
105
+          size="large"
106
+          onSearch={value => searchActivity(value)}
107
+          style={{ marginBottom: '16px' }}
108
+        />
109
+        <Table rowKey={list => list.dynamicId} columns={columns} dataSource={list} />
110
+      </Modal>
111
+    </div>
112
+
113
+  );
114
+}

+ 110
- 0
src/pages/carouselFigure/SelectGroup.jsx 查看文件

@@ -0,0 +1,110 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Select, Modal, Button, Table, Divider, Tag, Input } from 'antd';
3
+import { apis, fetch } from '../../utils/request';
4
+import Navigate from '@/components/Navigate';
5
+
6
+const { Search } = Input;
7
+
8
+const getGroupList = fetch(apis.groupActivity.EffectiveList)
9
+
10
+export default props => {
11
+  const {
12
+    value,
13
+    onChange,
14
+    ...rest
15
+  } = props;
16
+
17
+  const [list, setList] = useState([]);
18
+  const [visible, setVisible] = useState(false);
19
+  const [group, setGroup] = useState({ groupId: undefined, groupName: '请选择拼团' })
20
+  const getGroupTitle = val => {
21
+    return (list.filter(x => x.groupActivityId == val)[0] || {}).activityName || '请选择拼团'
22
+  }
23
+  const updateGroup = val => setGroup({ groupId: val, groupName: getGroupTitle(val) })
24
+
25
+  const buildingId = props.buildingId()
26
+
27
+  useEffect(() => {
28
+    getGroupList({
29
+      params: {
30
+        buildingId,
31
+        pageNum: 1,
32
+        pageSize: 999,
33
+        status: 1,
34
+      },
35
+    }).then(data => {
36
+      setList(data.records || [])
37
+
38
+      updateGroup(buildingId ? undefined : value);
39
+    })
40
+  }, [buildingId]);
41
+  const searchGroup = (e) => {
42
+    getGroupList({
43
+      params: {
44
+        buildingId,
45
+        pageNum: 1,
46
+        pageSize: 999,
47
+        status: 1,
48
+        name: e
49
+      }
50
+    }).then((data) => {
51
+      setList(data.records || [])
52
+
53
+      updateGroup(buildingId ? undefined : value);
54
+      // setAct(buildingId ? undefined : value);
55
+    })
56
+  }
57
+  if (value !== group.groupId) {
58
+    updateGroup(value);
59
+  }
60
+
61
+  const handleChange = val => {
62
+    onChange(val)
63
+  }
64
+
65
+  const setData = val => {
66
+    updateGroup(val)
67
+    onChange(val)
68
+    setVisible(false)
69
+  }
70
+
71
+  const columns = [
72
+    {
73
+      title: '标题',
74
+      dataIndex: 'activityName',
75
+      key: 'groupActivityId',
76
+      align: 'center',
77
+      ellipsis: true,
78
+      render: text => <a>{text}</a>,
79
+    },
80
+    {
81
+      title: '操作',
82
+      align: 'center',
83
+      width: '20%',
84
+      render: (text, record) => (
85
+         <Navigate onClick={() => setData(record.groupActivityId)}>选择</Navigate>
86
+      ),
87
+    },
88
+  ];
89
+
90
+  return (
91
+    <div>
92
+      <div><Navigate onClick={() => setVisible(true)} >{group.groupName}</Navigate></div>
93
+      <Modal
94
+        title="请选择"
95
+        visible={visible}
96
+        onCancel={() => setVisible(false)}
97
+        footer={[]}
98
+      >
99
+        <Search
100
+          placeholder="请输入标题"
101
+          enterButton="搜索"
102
+          size="large"
103
+          onSearch={value => searchGroup(value)}
104
+          style={{ marginBottom: '16px' }}
105
+        />
106
+        <Table rowKey={list => list.groupActivityId} columns={columns} dataSource={list} />
107
+      </Modal>
108
+    </div>
109
+  );
110
+}

+ 111
- 0
src/pages/carouselFigure/SelectH5.1.jsx 查看文件

@@ -0,0 +1,111 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Select, Modal, Button, Input } from 'antd';
3
+import { apis, fetch } from '../../utils/request';
4
+
5
+const getH5List = fetch(apis.h5Activity.EffectiveList)
6
+const { Search } = Input;
7
+
8
+export default props => {
9
+  const {
10
+    value,
11
+    onChange,
12
+    ...rest
13
+  } = props;
14
+
15
+  const [list, setList] = useState([]);
16
+  const [visible, setVisible] = useState(false);
17
+  const [group, setGroup] = useState({ groupId: undefined, groupName: '请选择' })
18
+  const getGroupTitle = val => {
19
+    return (list.filter(x => x.drainageId == val)[0] || {}).name || '请选择'
20
+  }
21
+  const updateGroup = val => setGroup({ groupId: val, groupName: getGroupTitle(val) })
22
+
23
+  useEffect(() => {
24
+    getH5List({
25
+      params: {
26
+        pageNum: 1,
27
+        pageSize: 999,
28
+        isMiniapp: 1,
29
+        status: 1,
30
+      },
31
+    }).then(data => {
32
+      setList(data.records || [])
33
+
34
+      updateGroup(value ? undefined : value);
35
+    })
36
+  }, []);
37
+  const searchH5 = (e) => {
38
+    getH5List({
39
+      params: {
40
+        buildingId,
41
+        pageNum: 1,
42
+        pageSize: 999,
43
+        activityStatus: 2,
44
+        name: e
45
+      }
46
+    }).then((data) => {
47
+      setList(data.records || [])
48
+
49
+      updateGroup(value ? undefined : value);
50
+    })
51
+  }
52
+
53
+  if (value !== group.groupId) {
54
+    updateGroup(value);
55
+  }
56
+
57
+  const handleChange = val => {
58
+    onChange(val)
59
+  }
60
+
61
+  const setData = val => {
62
+    updateGroup('')
63
+    onChange('')
64
+  }
65
+
66
+  return (
67
+    <div>
68
+      <div onClick={() => setVisible(true)}>{group.groupName}</div>
69
+      <Modal
70
+        title="请选择"
71
+        visible={visible}
72
+        onCancel={() => setVisible(false)}
73
+        footer={[
74
+          <Button key="back" onClick={() => setVisible(false)}>
75
+            取消
76
+            </Button>,
77
+          <Button key="cancel" onClick={() => setData(value)}>
78
+            清空
79
+            </Button>,
80
+          <Button key="submit" type="primary" onClick={() => {
81
+            updateGroup(value)
82
+            onChange(value)
83
+            setVisible(false)
84
+          }}>
85
+            提交
86
+            </Button>
87
+        ]}
88
+      >
89
+        <Search
90
+          placeholder="请输入标题"
91
+          enterButton="搜索"
92
+          size="large"
93
+          onSearch={value => searchH5(value)}
94
+          style={{ marginBottom: '16px' }}
95
+        />
96
+        <Select
97
+          showSearch
98
+          value={value ? parseInt(value) : undefined}
99
+          onChange={handleChange}
100
+          style={{ width: '90%' }}
101
+          filterOption={(input, option) =>
102
+            option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
103
+          }>
104
+          {
105
+            list.map(x => (<Select.Option key={x.drainageId} value={x.drainageId}>{x.name}</Select.Option>))
106
+          }
107
+        </Select>
108
+      </Modal>
109
+    </div>
110
+  );
111
+}

+ 135
- 0
src/pages/carouselFigure/SelectH5.jsx 查看文件

@@ -0,0 +1,135 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Select, Modal, Button, Table, Divider, Tag, Input, Row, Col } from 'antd';
3
+import { apis, fetch } from '../../utils/request';
4
+import Navigate from '@/components/Navigate';
5
+
6
+const { Column, ColumnGroup } = Table;
7
+const getH5List = fetch(apis.h5Activity.EffectiveList)
8
+const { Search } = Input;
9
+export default props => {
10
+  const {
11
+    value,
12
+    onChange,
13
+    ...rest
14
+  } = props;
15
+
16
+  const [list, setList] = useState([]);
17
+  const [visible, setVisible] = useState(false);
18
+  const [group, setGroup] = useState({ groupId: undefined, groupName: '请选择' })
19
+  const getGroupTitle = val => {
20
+    return (list.filter(x => x.drainageId == val)[0] || {}).name || '请选择'
21
+  }
22
+  const updateGroup = val => setGroup({ groupId: val, groupName: getGroupTitle(val) })
23
+
24
+  const buildingId = props.buildingId()
25
+
26
+  useEffect(() => {
27
+    getH5List({
28
+      params: {
29
+        pageNum: 1,
30
+        pageSize: 999,
31
+        isMiniapp: 1,
32
+        status: 1,
33
+        source: 2,
34
+        buildingId,
35
+      },
36
+    }).then(data => {
37
+      const getGroupTitle = val => {
38
+        return (data.records.filter(x => x.drainageId == val)[0] || {}).name || '请选择'
39
+      }
40
+      const updateGroup = val => setGroup({ groupId: val, groupName: getGroupTitle(val) })
41
+      setList(data.records || [])
42
+
43
+      updateGroup(buildingId ? undefined : value);
44
+    })
45
+  }, [buildingId]);
46
+  const searchH5 = e => {
47
+    getH5List({
48
+      params: {
49
+        pageNum: 1,
50
+        pageSize: 999,
51
+        isMiniapp: 1,
52
+        status: 1,
53
+        source: 2,
54
+        name: e
55
+      },
56
+    }).then(data => {
57
+      setList(data.records || [])
58
+      const getGroupTitle = val => {
59
+        return (data.records.filter(x => x.drainageId == val)[0] || {}).name || '请选择'
60
+      }
61
+      const updateGroup = val => setGroup({ groupId: val, groupName: getGroupTitle(val) })
62
+      setList(data.records || [])
63
+      updateGroup(value ? undefined : value);
64
+    })
65
+  }
66
+
67
+  if (value !== group.groupId) {
68
+    updateGroup(value);
69
+  }
70
+
71
+  const handleChange = val => {
72
+    onChange(val)
73
+  }
74
+
75
+  const setData = val => {
76
+    updateGroup(val)
77
+    onChange(val)
78
+    setVisible(false)
79
+  }
80
+
81
+  const clearVal = val => {
82
+    onChange(val)
83
+    setVisible(false)
84
+  }
85
+
86
+  const columns = [
87
+    {
88
+      title: '标题',
89
+      dataIndex: 'name',
90
+      key: 'drainageId',
91
+      align: 'center',
92
+      ellipsis: true,
93
+      render: text => <a>{text}</a>,
94
+    },
95
+    {
96
+      title: '操作',
97
+      align: 'center',
98
+      width: '20%',
99
+      render: (text, record) => (
100
+        <Navigate onClick={() => setData(record.drainageId)}>选择</Navigate>
101
+      ),
102
+    },
103
+  ];
104
+
105
+  return (
106
+    <div>
107
+      <div ><Navigate onClick={() => setVisible(true)}>{group.groupName}</Navigate></div>
108
+      <Modal
109
+        title="请选择"
110
+        visible={visible}
111
+        onCancel={() => setVisible(false)}
112
+        footer={[]}
113
+      >
114
+        <Row>
115
+          <Col span={18}>
116
+            <Search
117
+              placeholder="请输入标题"
118
+              enterButton="搜索"
119
+              size="default"
120
+              allowClear="true"
121
+              onSearch={value => searchH5(value)}
122
+              style={{ marginBottom: '16px' }}
123
+            />
124
+          </Col>
125
+          <Col span={4} offset={1}>
126
+            <Button type="primary" onClick={() => clearVal('')}>清除选择</Button>
127
+          </Col>
128
+        </Row>
129
+
130
+        <Table rowKey={list => list.drainageId} columns={columns} dataSource={list} />
131
+
132
+      </Modal>
133
+    </div>
134
+  )
135
+}

+ 111
- 0
src/pages/carouselFigure/SelectHelp.jsx 查看文件

@@ -0,0 +1,111 @@
1
+import React, { useState, useEffect } from 'react';
2
+
3
+import { Form, Select, Modal, Button, Table, Divider, Tag, Input } from 'antd';
4
+import { apis, fetch } from '../../utils/request';
5
+import Navigate from '@/components/Navigate';
6
+
7
+const { Search } = Input;
8
+
9
+const getHelpList = fetch(apis.helpActivity.effectiveList)
10
+
11
+export default props => {
12
+  const {
13
+    value,
14
+    onChange,
15
+    ...rest
16
+  } = props;
17
+
18
+  const [list, setList] = useState([]);
19
+  const [visible, setVisible] = useState(false);
20
+  const [help, setHelp] = useState({ helpId: undefined, helpName: '请选择助力' })
21
+  const getHelpTitle = val => {
22
+    return (list.filter(x => x.helpActivityId == val)[0] || {}).title || '请选择助力'
23
+  }
24
+
25
+  const updateHelp = val => setHelp({ helpId: val, helpName: getHelpTitle(val) })
26
+
27
+  const buildingId = props.buildingId()
28
+
29
+  useEffect(() => {
30
+    getHelpList({
31
+      params: {
32
+        buildingId,
33
+        pageNum: 1,
34
+        pageSize: 999,
35
+        status: 1
36
+      },
37
+    }).then(data => {
38
+      setList(data.records || [])
39
+
40
+      updateHelp(value ? undefined : value);
41
+    })
42
+  }, [buildingId]);
43
+  const searchHelp = (e) => {
44
+    getHelpList({
45
+      params: {
46
+        buildingId,
47
+        pageNum: 1,
48
+        pageSize: 999,
49
+        status: 1,
50
+        name: e
51
+      },
52
+    }).then(data => {
53
+      setList(data.records || [])
54
+
55
+      updateHelp(value ? undefined : value);
56
+    })
57
+  }
58
+  if (value !== help.helpId) {
59
+    updateHelp(value);
60
+  }
61
+
62
+  const handleChange = val => {
63
+    onChange(val)
64
+  }
65
+
66
+  const setData = val => {
67
+    updateHelp(val)
68
+    onChange(val)
69
+    setVisible(false)
70
+  }
71
+
72
+  const columns = [
73
+    {
74
+      title: '标题',
75
+      dataIndex: 'title',
76
+      key: 'helpActivityId',
77
+      align: 'center',
78
+      ellipsis: true,
79
+      render: text => <a>{text}</a>,
80
+    },
81
+    {
82
+      title: '操作',
83
+      align: 'center',
84
+      width: '20%',
85
+      render: (text, record) => (
86
+        <Navigate onClick={() => setData(record.helpActivityId)}>选择</Navigate>
87
+      ),
88
+    },
89
+  ];
90
+
91
+  return (
92
+    <div>
93
+      <div ><Navigate onClick={() => setVisible(true)}>{help.helpName}</Navigate></div>
94
+      <Modal
95
+        title="请选择"
96
+        visible={visible}
97
+        onCancel={() => setVisible(false)}
98
+        footer={[]}
99
+      >
100
+        <Search
101
+          placeholder="请输入标题"
102
+          enterButton="搜索"
103
+          size="large"
104
+          onSearch={value => searchHelp(value)}
105
+          style={{ marginBottom: '16px' }}
106
+        />
107
+        <Table rowKey={list => list.helpActivityId} columns={columns} dataSource={list} />
108
+      </Modal>
109
+    </div>
110
+  );
111
+}

+ 106
- 0
src/pages/carouselFigure/SelectNews.jsx 查看文件

@@ -0,0 +1,106 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Select, Modal, Button, Table, Divider, Tag, Input } from 'antd';
3
+import { apis, fetch } from '../../utils/request';
4
+import Navigate from '@/components/Navigate';
5
+
6
+const getNewsList = fetch(apis.news.getList)
7
+const { Search } = Input;
8
+
9
+export default props => {
10
+  const {
11
+    value,
12
+    onChange,
13
+    ...rest
14
+  } = props;
15
+
16
+  const [list, setList] = useState([]);
17
+  const [visible, setVisible] = useState(false);
18
+  const [news, setNews] = useState({ newsId: undefined, newsName: '请选择资讯' })
19
+  const getNewsTitle = val => ((list.filter(x => x.newsId == val)[0]) || {}).newsName || '请选择资讯'
20
+  const updateNews = val => setNews({ newsId: val, newsName: getNewsTitle(val) })
21
+
22
+  const buildingId = props.buildingId()
23
+
24
+  useEffect(() => {
25
+    getNewsList({
26
+      params: {
27
+        buildingId,
28
+        pageNum: 1,
29
+        pageSize: 999,
30
+        newsStatus: 0,
31
+      },
32
+    }).then(data => {
33
+      setList(data.records || [])
34
+
35
+      updateNews(buildingId ? undefined : value);
36
+    })
37
+  }, [buildingId]);
38
+  const searchActivity = (e) => {
39
+    getNewsList({
40
+      params: {
41
+        buildingId,
42
+        pageNum: 1,
43
+        pageSize: 999,
44
+        newsStatus: 0,
45
+        title: e
46
+      },
47
+    }).then(data => {
48
+      setList(data.records || [])
49
+
50
+      updateNews(buildingId ? undefined : value);
51
+    })
52
+  }
53
+  if (value !== news.newsId) {
54
+    updateNews(value);
55
+  }
56
+
57
+  const handleChange = val => {
58
+    onChange(val)
59
+  }
60
+
61
+  const setData = val => {
62
+    updateNews(val)
63
+    onChange(val)
64
+    setVisible(false)
65
+  }
66
+
67
+  const columns = [
68
+    {
69
+      title: '标题',
70
+      dataIndex: 'newsName',
71
+      key: 'newsId',
72
+      align: 'center',
73
+      ellipsis: true,
74
+      render: text => <a>{text}</a>,
75
+    },
76
+    {
77
+      title: '操作',
78
+      align: 'center',
79
+      width: '20%',
80
+      render: (text, record) => (
81
+        <Navigate onClick={() => setData(record.newsId)}>选择</Navigate>
82
+      ),
83
+    },
84
+  ];
85
+
86
+  return (
87
+    <div>
88
+      <div ><Navigate onClick={() => setVisible(true)}>{news.newsName}</Navigate></div>
89
+      <Modal
90
+        title="请选择"
91
+        visible={visible}
92
+        onCancel={() => setVisible(false)}
93
+        footer={[]}
94
+      >
95
+        <Search
96
+          placeholder="请输入标题"
97
+          enterButton="搜索"
98
+          size="large"
99
+          onSearch={value => searchActivity(value)}
100
+          style={{ marginBottom: '16px' }}
101
+        />
102
+        <Table rowKey={list => list.newsId} columns={columns} dataSource={list} />
103
+      </Modal>
104
+    </div>
105
+  );
106
+}

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

@@ -0,0 +1,286 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Button, Select, message, Table, Pagination, Modal, DatePicker } from 'antd';
3
+import router from 'umi/router';
4
+import moment from 'moment';
5
+import AuthButton from '@/components/AuthButton';
6
+import withActions from '@/components/ActionList';
7
+import EditIcon from '@/components/EditIcon';
8
+import Navigate from '@/components/Navigate';
9
+import SelectCity from '../../components/SelectButton/CitySelect'
10
+import BuildSelect from '../../components/SelectButton/BuildSelect'
11
+import apis from '../../services/apis';
12
+import request from '../../utils/request';
13
+import styles from '../style/GoodsList.less';
14
+
15
+const { Option } = Select;
16
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
17
+
18
+const header = (props) => {
19
+  const [data, setData] = useState({})
20
+  //   const [page, changePage] = useState({})
21
+
22
+  useEffect(() => {
23
+    getList({ pageNum: 1, pageSize: 10, showType: 'screen' });
24
+  }, [])
25
+
26
+  // 查询列表
27
+  const getList = (params) => {
28
+    request({ ...apis.carsuseFigure.extendContent, params: { ...params }, }).then((data) => {
29
+      console.log(data)
30
+      setData(data)
31
+    })
32
+  }
33
+
34
+
35
+  // 跳转到编辑商品
36
+  const toEdit = (contentId) => () => {
37
+    router.push({
38
+      pathname: '/carouselFigure/editAdvertising',
39
+      query: {
40
+        contentId
41
+      },
42
+    });
43
+  }
44
+
45
+  const columns = [
46
+    {
47
+      title: '主图',
48
+      dataIndex: 'image',
49
+      key: 'image',
50
+      align: 'center',
51
+      render: (image,row) => <Navigate onClick={toEdit(row.contentId)}><img src={image} className={styles.imgSmall} /></Navigate>,
52
+    },
53
+    {
54
+      title: '发布城市',
55
+      dataIndex: 'cityName',
56
+      key: 'cityName',
57
+      align: 'center',
58
+    },
59
+    {
60
+      title: '关联项目',
61
+      dataIndex: 'buildingName',
62
+      key: 'buildingName',
63
+      align: 'center',
64
+      render: (buildingName) => <span>{buildingName === null ? '无' : buildingName}</span>
65
+    },
66
+    {
67
+      title: '关联内容类型',
68
+      dataIndex: 'contentType',
69
+      key: 'contentType',
70
+      align: 'center',
71
+      render: (contentType) => <span>{contentType === 'project' ? '项目' : contentType === 'activity' ? '报名活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' :
72
+        contentType === 'help' ? '助力活动' : contentType === 'group' ? '拼团活动' : contentType === 'h5' ? 'H5活动' : contentType === 'salesBatch' ? '在线选房' : contentType === 'live' ? '直播活动' : '无'}</span>
73
+    },
74
+    {
75
+      title: '发布位置',
76
+      dataIndex: 'showPosition',
77
+      key: 'showPosition',
78
+      align: 'center',
79
+      render: (showPosition) => <span>{ showPosition === 'index' ? '首页' : showPosition === 'building' ? '项目' : '' }</span>
80
+    },
81
+    {
82
+      title: '发布时间',
83
+      dataIndex: 'createDate',
84
+      key: 'createDate',
85
+      align: 'center',
86
+      render: (x, row) => <><span>{moment(row.createDate).format('YYYY-MM-DD')}</span></>
87
+    },
88
+    {
89
+      title: '状态',
90
+      dataIndex: 'status',
91
+      key: 'status',
92
+      align: 'center',
93
+      render: (status) => <><span>{status == 1 ? '上架' : '下架'}</span></>
94
+    },
95
+    {
96
+      title: '操作',
97
+      dataIndex: 'handle',
98
+      key: 'handle',
99
+      align: 'center',
100
+      render: withActions((x, row) => [
101
+        <AuthButton name="admin.advert.publish" noRight={null}>
102
+          <EditIcon text={row.status === 1 ? '下架' : '上架'} type={row.status === 1 ? 'down' : 'up'}  onClick={changeStatus(row)} />
103
+        </AuthButton>,
104
+        <AuthButton name="admin.advert.put" noRight={null}>
105
+          <EditIcon text="编辑" type="edit" onClick={toEdit(row.contentId)} />
106
+        </AuthButton>,
107
+        <AuthButton name="admin.advert.delete" noRight={null}>
108
+          <EditIcon text="删除" type="delete" onClick={deleteCarouse(row.contentId)}/>
109
+        </AuthButton>,
110
+      ])
111
+    },
112
+  ];
113
+
114
+  const finishDynamic = (row) => {
115
+    Modal.confirm({
116
+      title: '结束以后将无法编辑, 是否继续?',
117
+      okText: '确定',
118
+      cancelText: '取消',
119
+      onOk() {
120
+        request({ ...apis.carsuseFigure.finish, data: { dynamicId: row.dynamicId, top: "" }, }).then((data) => {
121
+          console.log(data)
122
+          message.info('操作成功!')
123
+          getList({ pageNum: 1, pageSize: 10, showType: 'screen' })
124
+        }).catch((err) => {
125
+          console.log(err)
126
+          message.info(err.msg || err.message)
127
+        })
128
+      },
129
+    });
130
+  }
131
+
132
+  //删除
133
+  const deleteCarouse = (contentId) => () => {
134
+    Modal.confirm({
135
+      title: '确认删除此数据?',
136
+      okText: '确定',
137
+      cancelText: '取消',
138
+      onOk() {
139
+        request({ ...apis.carsuseFigure.deleteExtendContent, urlData: { id: contentId } }).then((data) => {
140
+          message.info('操作成功!')
141
+          getList({ pageNum: 1, pageSize: 10, showType: 'screen' })
142
+        }).catch((err) => {
143
+          console.log(err)
144
+          message.info(err.msg || err.message)
145
+        })
146
+      },
147
+    });
148
+  }
149
+
150
+  //   停用启用
151
+  const changeStatus = (row) => () => {
152
+    console.log(row)
153
+    if (row.status === 0) {
154
+
155
+      Modal.confirm({
156
+        title: '确认发布此数据?',
157
+        okText: '确定',
158
+        cancelText: '取消',
159
+        onOk() {
160
+          row.status = 1
161
+          request({ ...apis.carsuseFigure.updataExtendContent, urlData: { id: row.contentId }, data: row, }).then((data) => {
162
+            message.info('操作成功!')
163
+            getList({ pageNum: 1, pageSize: 10, showType: 'screen' })
164
+          }).catch((err) => {
165
+            console.log(err)
166
+            message.info(err.msg || err.message)
167
+          })
168
+        },
169
+      });
170
+    } else if (row.status === 1) {
171
+
172
+      Modal.confirm({
173
+        title: '停用后不会再显示在小程序端',
174
+        okText: '确定',
175
+        cancelText: '取消',
176
+        onOk() {
177
+          row.status = 0
178
+          request({ ...apis.carsuseFigure.updataExtendContent, urlData: { id: row.contentId }, data: row, }).then((data) => {
179
+            message.info('操作成功!')
180
+            getList({ pageNum: 1, pageSize: 10, showType: 'screen' })
181
+          }).catch((err) => {
182
+            console.log(err)
183
+            message.info(err.msg || err.message)
184
+          })
185
+        },
186
+      });
187
+    }
188
+
189
+  }
190
+
191
+  const changePageNum = (pageNumber, props) => {
192
+    props.form.validateFields((err, values) => {
193
+      if (!err) {
194
+        getList({ pageNum: pageNumber, pageSize: 10, ...values, showType: 'screen' })
195
+      }
196
+    });
197
+  }
198
+
199
+  // 提交事件
200
+  const handleSubmit = (e, props) => {
201
+    e.preventDefault();
202
+    props.form.validateFields((err, values) => {
203
+      if (!err) {
204
+        console.log('提交数据: ', values)
205
+        getList({ pageNum: 1, pageSize: 10, ...values, showType: 'screen' })
206
+      }
207
+    });
208
+  }
209
+
210
+  //重置搜索
211
+  function handleReset() {
212
+    props.form.resetFields();
213
+    getList({ pageNum: 1, pageSize: 10, showType: 'screen' });
214
+  }
215
+
216
+
217
+  const { getFieldDecorator } = props.form
218
+  return (
219
+
220
+    <>
221
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
222
+        <Form.Item>
223
+          {getFieldDecorator('cityId')(
224
+            <SelectCity />,
225
+          )}
226
+        </Form.Item>
227
+        <Form.Item>
228
+          {getFieldDecorator('buildingId')(
229
+            <BuildSelect />,
230
+          )}
231
+        </Form.Item>
232
+        <Form.Item>
233
+          {getFieldDecorator('contentType')(
234
+            <Select style={{ width: '180px' }} placeholder="类型">
235
+              <Option value="project">项目</Option>
236
+              <Option value="news">资讯</Option>
237
+              <Option value="activity">报名活动</Option>
238
+              <Option value="help">助力活动</Option>
239
+              <Option value="group">拼团活动</Option>
240
+              <Option value="h5">H5活动</Option>
241
+              <Option value="live">直播活动</Option>
242
+              <Option value="salesBatch">在线选房</Option>
243
+              <Option value="nothing">无</Option>
244
+            </Select>,
245
+          )}
246
+        </Form.Item>
247
+        <Form.Item>
248
+          {getFieldDecorator('showPosition')(
249
+            <Select style={{ width: '180px' }} placeholder="发布位置">
250
+              <Option value="index">首页</Option>
251
+              <Option value="building">项目</Option>
252
+            </Select>,
253
+          )}
254
+        </Form.Item>
255
+        <Form.Item>
256
+          {getFieldDecorator('status')(
257
+            <Select style={{ width: '180px' }} placeholder="状态">
258
+              <Option value="1">已上架</Option>
259
+              <Option value="0">已下架</Option>
260
+            </Select>,
261
+          )}
262
+        </Form.Item>
263
+        <Form.Item>
264
+          <AuthButton name="admin.advert.search" noRight={null}>
265
+            <Button type="primary" htmlType="submit" className={styles.searchBtn}>
266
+              搜索
267
+          </Button>
268
+          </AuthButton>
269
+          <Button style={{ marginLeft: 8 }} onClick={handleReset}>
270
+            重置
271
+            </Button>
272
+        </Form.Item>
273
+      </Form>
274
+      <AuthButton name="admin.advert.post" noRight={null}>
275
+        <Button type="danger" className={styles.addBtn} onClick={toEdit()}>新增</Button>
276
+      </AuthButton>
277
+      <Table dataSource={data.records} columns={columns} pagination={false} rowKey="advertisingList" />
278
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
279
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={e => changePageNum(e, props)} current={data.current} />
280
+      </div>
281
+    </>
282
+  )
283
+}
284
+const WrappedHeader = Form.create({ name: 'header' })(header);
285
+
286
+export default WrappedHeader

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

@@ -0,0 +1,284 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Button, Select, message, Table, Pagination, Modal, DatePicker } from 'antd';
3
+import router from 'umi/router';
4
+import moment from 'moment';
5
+import AuthButton from '@/components/AuthButton';
6
+import withActions from '@/components/ActionList';
7
+import EditIcon from '@/components/EditIcon';
8
+import Navigate from '@/components/Navigate';
9
+import SelectCity from '../../components/SelectButton/CitySelect'
10
+import BuildSelect from '../../components/SelectButton/BuildSelect'
11
+import apis from '../../services/apis';
12
+import request from '../../utils/request';
13
+import styles from '../style/GoodsList.less';
14
+
15
+const { Option } = Select;
16
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
17
+
18
+const header = (props) => {
19
+  const [data, setData] = useState({})
20
+  //   const [page, changePage] = useState({})
21
+
22
+  useEffect(() => {
23
+    getList({ pageNum: 1, pageSize: 10, showType: 'banner' });
24
+  }, [])
25
+
26
+  // 查询列表
27
+  const getList = (params) => {
28
+    request({ ...apis.carsuseFigure.extendContent, params: { ...params }, }).then((data) => {
29
+      console.log(data)
30
+      setData(data)
31
+    })
32
+  }
33
+
34
+
35
+  // 跳转到编辑页面
36
+  const toEditCarouse = (contentId) => () => {
37
+    router.push({
38
+      pathname: '/carouselFigure/editCarousel',
39
+      query: {
40
+        contentId
41
+      },
42
+    });
43
+  }
44
+
45
+  const columns = [
46
+    {
47
+      title: '主图',
48
+      dataIndex: 'image',
49
+      key: 'image',
50
+      align: 'center',
51
+      render: (x, row) => <Navigate onClick={toEditCarouse(row.contentId)} ><img src={row.image} className={row.showPosition === 'index' ? styles.imgIndex : row.showPosition === 'mall' ? styles.imgPerfect : ''} /></Navigate>,
52
+    },
53
+    {
54
+      title: '发布城市',
55
+      dataIndex: 'cityName',
56
+      key: 'cityName',
57
+      align: 'center',
58
+    },
59
+    {
60
+      title: '关联项目',
61
+      dataIndex: 'buildingName',
62
+      key: 'buildingName',
63
+      align: 'center',
64
+      render: (buildingName) => <span>{buildingName === null ? '无' : buildingName}</span>
65
+    },
66
+    {
67
+      title: '关联内容类型',
68
+      dataIndex: 'contentType',
69
+      key: 'contentType',
70
+      align: 'center',
71
+      render: (contentType) => <span>{contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' :
72
+        contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : contentType === 'h5' ? 'H5活动' : contentType === 'salesBatch' ? '销售批次详情' : contentType === 'live' ? '直播活动详情' : '无'}</span>
73
+    },
74
+    {
75
+      title: '发布位置',
76
+      dataIndex: 'showPosition',
77
+      key: 'showPosition',
78
+      align: 'center',
79
+      render: (showPosition) => <span>{showPosition === 'index' ? '首页' : showPosition === 'mall' ? '商城' : ''}</span>
80
+    },
81
+    {
82
+      title: '发布时间',
83
+      dataIndex: 'createDate',
84
+      key: 'createDate',
85
+      align: 'center',
86
+      render: (x, row) => <><span>{moment(row.createDate).format('YYYY-MM-DD')}</span></>
87
+    },
88
+    {
89
+      title: '状态',
90
+      dataIndex: 'status',
91
+      key: 'status',
92
+      align: 'center',
93
+      render: (status) => <><span>{status == 1 ? '已上架' : '已下架'}</span></>
94
+    },
95
+    {
96
+      title: '操作',
97
+      dataIndex: 'handle',
98
+      key: 'handle',
99
+      align: 'center',
100
+      render: withActions((x, row) => [
101
+        <AuthButton name="admin.extendContent.publish" noRight={null}>
102
+          <EditIcon type={row.status === 1 ? 'down' : 'up'} text={row.status === 1 ? '下架' : '上架'} onClick={changeStatus(row)} />
103
+        </AuthButton>,
104
+
105
+        <AuthButton name="admin.extendContent.id.put" noRight={null}>
106
+          <EditIcon text="编辑" type="edit" onClick={toEditCarouse(row.contentId)} />
107
+        </AuthButton>,
108
+
109
+        <AuthButton name="admin.extendContent.delete" noRight={null}>
110
+          <EditIcon text="删除" type="delete" onClick={deleteCarouse(row.contentId)} />
111
+        </AuthButton>,
112
+      ])
113
+    },
114
+  ];
115
+
116
+  const finishDynamic = (row) => {
117
+    Modal.confirm({
118
+      title: '结束以后将无法编辑, 是否继续?',
119
+      okText: '确定',
120
+      cancelText: '取消',
121
+      onOk() {
122
+        request({ ...apis.carsuseFigure.finish, data: { dynamicId: row.dynamicId, top: "" }, }).then((data) => {
123
+          console.log(data)
124
+          message.info('操作成功!')
125
+          getList({ pageNum: 1, pageSize: 10, showType: 'banner' })
126
+        }).catch((err) => {
127
+          console.log(err)
128
+          message.info(err.msg || err.message)
129
+        })
130
+      },
131
+    });
132
+  }
133
+
134
+  //删除
135
+  const deleteCarouse = (contentId) => () => {
136
+    Modal.confirm({
137
+      title: '确认删除此数据?',
138
+      okText: '确定',
139
+      cancelText: '取消',
140
+      onOk() {
141
+        request({ ...apis.carsuseFigure.deleteExtendContent, urlData: { id: contentId } }).then((data) => {
142
+          message.info('操作成功!')
143
+          getList({ pageNum: 1, pageSize: 10, showType: 'banner' })
144
+        }).catch((err) => {
145
+          console.log(err)
146
+          message.info(err.msg || err.message)
147
+        })
148
+      },
149
+    });
150
+  }
151
+
152
+  //   停用启用
153
+  const changeStatus = (row) => () => {
154
+    console.log(row)
155
+    if (row.status === 0) {
156
+
157
+      Modal.confirm({
158
+        title: '确认发布此数据?',
159
+        okText: '确定',
160
+        cancelText: '取消',
161
+        onOk() {
162
+          row.status = 1
163
+          request({ ...apis.carsuseFigure.updataExtendContent, urlData: { id: row.contentId }, data: row, }).then((data) => {
164
+            message.info('操作成功!')
165
+            getList({ pageNum: 1, pageSize: 10, showType: 'banner' })
166
+          }).catch((err) => {
167
+            console.log(err)
168
+            row.status = 0
169
+            message.info(err.msg || err.message)
170
+          })
171
+        },
172
+      });
173
+    } else if (row.status === 1) {
174
+
175
+      Modal.confirm({
176
+        title: '停用后不会再显示在小程序端',
177
+        okText: '确定',
178
+        cancelText: '取消',
179
+        onOk() {
180
+          row.status = 0
181
+          request({ ...apis.carsuseFigure.updataExtendContent, urlData: { id: row.contentId }, data: row, }).then((data) => {
182
+            message.info('操作成功!')
183
+            getList({ pageNum: 1, pageSize: 10, showType: 'banner' })
184
+          }).catch((err) => {
185
+            console.log(err)
186
+            row.status = 1
187
+            message.info(err.msg || err.message)
188
+          })
189
+        },
190
+      });
191
+    }
192
+
193
+  }
194
+
195
+  const changePageNum = (pageNumber) => {
196
+    getList({ pageNum: pageNumber, pageSize: 10, showType: 'banner', ...props.form.getFieldsValue() })
197
+  }
198
+
199
+  // 提交事件
200
+  const handleSubmit = (e, props) => {
201
+    e.preventDefault();
202
+    props.form.validateFields((err, values) => {
203
+      if (!err) {
204
+        console.log('提交数据: ', values)
205
+        getList({ pageNum: 1, pageSize: 10, ...values, showType: 'banner' })
206
+      }
207
+    });
208
+  }
209
+
210
+  //重置搜索
211
+  function handleReset() {
212
+    props.form.resetFields();
213
+    getList({ pageNum: 1, pageSize: 10, showType: 'banner' });
214
+  }
215
+
216
+  const { getFieldDecorator } = props.form
217
+  return (
218
+
219
+    <>
220
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
221
+        <Form.Item>
222
+          {getFieldDecorator('cityId')(
223
+            <SelectCity />,
224
+          )}
225
+        </Form.Item>
226
+        <Form.Item>
227
+          {getFieldDecorator('buildingId')(
228
+            <BuildSelect />,
229
+          )}
230
+        </Form.Item>
231
+        <Form.Item>
232
+          {getFieldDecorator('contentType')(
233
+            <Select style={{ width: '180px' }} placeholder="类型">
234
+              <Option value="activity">活动</Option>
235
+              <Option value="project">项目</Option>
236
+              <Option value="news">资讯</Option>
237
+              <Option value="help">助力</Option>
238
+              <Option value="group">拼团</Option>
239
+              <Option value="h5">H5</Option>
240
+              <Option value="nothing">无</Option>
241
+              {/* <Option value="other">其他</Option> */}
242
+            </Select>,
243
+          )}
244
+        </Form.Item>
245
+        <Form.Item>
246
+          {getFieldDecorator('showPosition')(
247
+            <Select style={{ width: '180px' }} placeholder="发布位置">
248
+              <Option value="mall">积分商城</Option>
249
+              <Option value="index">首页</Option>
250
+            </Select>,
251
+          )}
252
+        </Form.Item>
253
+        <Form.Item>
254
+          {getFieldDecorator('status')(
255
+            <Select style={{ width: '180px' }} placeholder="状态">
256
+              <Option value="1">已上架</Option>
257
+              <Option value="0">已下架</Option>
258
+            </Select>,
259
+          )}
260
+        </Form.Item>
261
+        <Form.Item>
262
+          <AuthButton name="admin.extendContent.search" noRight={null}>
263
+            <Button type="primary" htmlType="submit" className={styles.searchBtn}>
264
+              搜索
265
+          </Button>
266
+          </AuthButton>
267
+          <Button style={{ marginLeft: 8 }} onClick={handleReset}>
268
+            重置
269
+            </Button>
270
+        </Form.Item>
271
+      </Form>
272
+      <AuthButton name="admin.extendContent.post" noRight={null}>
273
+        <Button type="danger" className={styles.addBtn} onClick={toEditCarouse()}>新增</Button>
274
+      </AuthButton>
275
+      <Table dataSource={data.records} columns={columns} pagination={false} rowKey="carouseFigureList" />
276
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
277
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
278
+      </div>
279
+    </>
280
+  )
281
+}
282
+const WrappedHeader = Form.create({ name: 'header' })(header);
283
+
284
+export default WrappedHeader

+ 148
- 0
src/pages/carouselFigure/customImg/edit.jsx 查看文件

@@ -0,0 +1,148 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select, Form, Alert } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+// import channels from '../../channel/channelList.less';
5
+import { connect } from 'dva';
6
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
7
+import { createForm, FieldTypes } from '../../../components/XForm';
8
+import Wangedit from '../../../components/Wangedit/Wangedit'
9
+import router from 'umi/router';
10
+import apis from '../../../services/apis';
11
+import request from '../../../utils/request'
12
+
13
+const { TextArea } = Input;
14
+const { Option } = Select;
15
+
16
+let activityVisible = true
17
+let helpTips = ''
18
+
19
+const setExtraData = (data) => {
20
+    activityVisible = data.imgType === 'index';
21
+  }
22
+
23
+const handleFormValueChange = (props, changedValues, allValues) => {
24
+    setExtraData(allValues)
25
+}
26
+
27
+const XForm = createForm({ onValuesChange: handleFormValueChange })
28
+
29
+const header = props => {
30
+  const {
31
+    currentUser = {
32
+      avatar: '',
33
+      userName: '',
34
+    },
35
+    menu,
36
+  } = props;
37
+
38
+  const imgId = props.location.query.imgId
39
+  const imgType = props.location.query.imgType
40
+
41
+  const [ data, setData ] = useState(imgType === 'index' ? 
42
+  {
43
+    'imgUrl':'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1574145199853-97feda7895c65be33aa234a7b81b37f.jpg',
44
+    'imgType':'index',
45
+    'imgDesc':'小程序首页分享配图',
46
+    'imgDocument': currentUser.orgName+' 精准获客平台'
47
+  } : 
48
+  {
49
+    'imgUrl':'http://njcj.oss-cn-shanghai.aliyuncs.com/icon.png',
50
+    'imgType':'indexNews',
51
+  }
52
+  )
53
+
54
+  if(imgId){
55
+    useEffect(() => {
56
+      getData(imgId);
57
+    },[])
58
+
59
+  // 查询列表
60
+  const getData = (imgId) => {
61
+    request({ ...apis.carsuseFigure.getCustomImg, urlData: { id: imgId} }).then((data) => {
62
+        console.log(data)
63
+        if (data.imgType === 'index'){
64
+            activityVisible = true;
65
+            helpTips = '建议图片尺寸:750*600px,比例5:4,格式:jpg,用于:首页分享';
66
+        }else{
67
+            activityVisible = false;
68
+            helpTips = '建议尺寸:80*80px,比例1:1,格式:jpg,用于:首页资讯logo'
69
+        }
70
+        setData(data)
71
+    })
72
+  }
73
+  }
74
+
75
+  const fields = [
76
+    {
77
+      label: '图片',
78
+      name: 'imgUrl',
79
+      type: FieldTypes.ImageUploader,
80
+      value: data.imgUrl,
81
+      help: helpTips,
82
+      rules: [
83
+        {required: true, message: '请选择图片'},
84
+      ]
85
+    },
86
+    {
87
+      label: '类型',
88
+      name: 'imgType',
89
+      type: FieldTypes.Select,
90
+      value: data.imgType,
91
+      dict: [{
92
+          label: '首页分享',
93
+          value: 'index',
94
+        },
95
+        {
96
+          label: '首页资讯',
97
+          value: 'indexNews',
98
+        },
99
+      ],
100
+      rules: [
101
+        { required: true, message: '请选择类型' },
102
+      ],
103
+    },
104
+    data.imgType === 'index' && {
105
+      label: '分享文案',
106
+      name: 'imgDocument',
107
+      type: FieldTypes.Text,
108
+      value: data.imgDocument,
109
+      rules: [
110
+        { required: true, message: '请输入分享文案' },
111
+      ],
112
+    },
113
+  ]
114
+
115
+  const handleSubmit = values => {
116
+    
117
+    if (imgId) {
118
+      values.imgId = imgId
119
+      request({ ...apis.carsuseFigure.updateCustomImg, data: values,}).then((data) => {
120
+        cancelPage()
121
+      }).catch((err) => {
122
+        message.info(err.msg || err.message)
123
+      })
124
+      }else{
125
+      request({ ...apis.carsuseFigure.addCustomImg, data: values,}).then((data) => {
126
+        cancelPage()
127
+      }).catch((err) => {
128
+        message.info(err.msg || err.message)
129
+      })
130
+      }
131
+  }
132
+
133
+  const cancelPage = () => {
134
+    router.push({
135
+        pathname: '/carouselFigure/customImg/list',
136
+    });
137
+  }
138
+
139
+  return (
140
+    <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
141
+  )
142
+}
143
+
144
+const WrappedNormalLoginForm = Form.create({ name: 'header' })(header);
145
+
146
+export default connect(({ user }) => ({
147
+  currentUser: user.currentUser,
148
+}))(WrappedNormalLoginForm);

+ 81
- 0
src/pages/carouselFigure/customImg/list.jsx 查看文件

@@ -0,0 +1,81 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Table } from 'antd';
3
+import router from 'umi/router';
4
+import AuthButton from '@/components/AuthButton';
5
+import withActions from '@/components/ActionList';
6
+import EditIcon from '@/components/EditIcon';
7
+import Navigate from '@/components/Navigate';
8
+import apis from '../../../services/apis';
9
+import request from '../../../utils/request'
10
+
11
+const { Column } = Table;
12
+
13
+function header(props) {
14
+  // 获取初始化数据
15
+  const [data, setData] = useState([])
16
+
17
+  useEffect(() => {
18
+    getList({ pageNum: 1, pageSize: 10 });
19
+  }, [])
20
+
21
+  // 查询列表
22
+  const getList = (params) => {
23
+    request({ ...apis.carsuseFigure.customImg, params: { ...params }, }).then((data) => {
24
+      console.log(data, "datadata")
25
+      if (data.records.length > 0) {
26
+        setData(data.records)
27
+      } else {
28
+        setData([
29
+          { 'imgUrl': 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1574145199853-97feda7895c65be33aa234a7b81b37f.jpg', 'imgType': 'index', 'imgDesc': '小程序首页分享配图' },
30
+          { 'imgUrl': 'http://njcj.oss-cn-shanghai.aliyuncs.com/icon.png', 'imgType': 'indexNews', 'imgDesc': '首页资讯logo' }
31
+        ])
32
+      }
33
+
34
+    })
35
+  }
36
+
37
+  // 跳转到编辑商品
38
+  const toEditCustom = (imgId, imgType) => () => {
39
+    router.push({
40
+      pathname: '/carouselFigure/customImg/edit',
41
+      query: {
42
+        imgId,
43
+        imgType: imgType
44
+      },
45
+    });
46
+  }
47
+
48
+
49
+  // const { getFieldDecorator } = props.form
50
+  return (
51
+
52
+    <>
53
+      <Table dataSource={data}>
54
+        <Column title="图片" dataIndex="imgUrl" key="imgUrl"
55
+          render={(text, record) => (
56
+            <Navigate onClick={toEditCustom(record.imgId, record.imgType)} ><img src={record.imgUrl} height="120px" width="150px" style={{ objectFit: 'contain' }} /></Navigate>
57
+          )} />
58
+        <Column title="类型" dataIndex="imgType" key="imgType"
59
+          render={(text, record) => (
60
+            <span>
61
+              {record.imgType === 'index' ? '首页分享' : record.imgType === 'indexNews' ? '首页资讯' : '请编辑'}
62
+            </span>
63
+          )}
64
+        />
65
+        <Column title="说明" dataIndex="imgDesc" key="imgDesc" />
66
+        <Column title="操作"
67
+          dataIndex="handle"
68
+          key="handle"
69
+          render={withActions((text, record) => [
70
+            <AuthButton name="admin.custom.put" noRight={null}>
71
+              <EditIcon text="编辑" type="edit" onClick={toEditCustom(record.imgId, record.imgType)}></EditIcon>
72
+            </AuthButton>,
73
+          ])}
74
+        />
75
+      </Table>,
76
+    </>
77
+  )
78
+}
79
+const WrappedHeader = Form.create({ name: 'header' })(header);
80
+
81
+export default WrappedHeader

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

@@ -0,0 +1,426 @@
1
+import React, { useState, useEffect, useRef } from 'react';
2
+import { Modal, 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/BuildSelect2'
8
+import CitySelect from '../../components/SelectButton/CitySelect2'
9
+import { FieldTypes, createForm } from '../../components/XForm';
10
+import Wangedit from '../../components/Wangedit/Wangedit';
11
+import SelectActivity from './SelectActivity';
12
+import SelectNews from './SelectNews';
13
+import apis from '../../services/apis';
14
+import request from '../../utils/request'
15
+import SelectHelp from './SelectHelp';
16
+import SelectGroup from './SelectGroup';
17
+import SelectH5 from './SelectH5';
18
+import SalesBatchGroup from './SalesBatchGroup';
19
+import LiveGroup from './LiveGroup';
20
+/**
21
+ *
22
+ *
23
+ * @param {*} props
24
+ * @returns
25
+ */
26
+const createEditor = () => {
27
+  let contentVisible = false
28
+  let activityVisible = false
29
+  let newsVisible = false
30
+  let helpVisible = false
31
+  let groupVisible = false
32
+  let salesBatchVisible = false
33
+  let liveVisible = false
34
+  let h5Visible = false
35
+  let buildingId = ''
36
+  let cityId = ''
37
+  let isHaveActive = false
38
+  let isCanChoose = true
39
+  let isHavePosition = false
40
+  let islet = true
41
+
42
+  const setExtraData = (data) => {
43
+    if (data.isHaveActive !== undefined) {
44
+      isHaveActive = data.isHaveActive
45
+      if (!isHaveActive) {
46
+        // data.contentType=null
47
+        data.buildingId = null
48
+      }
49
+    }
50
+    islet = isHaveActive
51
+    if (data.showPosition == 'index') {
52
+      isHavePosition = true;
53
+    } else {
54
+      isHavePosition = false;
55
+    }
56
+
57
+    // if (data.contentType == 'h5' || data.contentType=='live') {
58
+    //   isHaveActive = true;
59
+    // } else {
60
+    //   isHaveActive = false;
61
+    // }
62
+
63
+    contentVisible = data.contentType === 'other';
64
+    activityVisible = data.contentType === 'activity';
65
+    newsVisible = data.contentType === 'news';
66
+    helpVisible = data.contentType === 'help';
67
+    groupVisible = data.contentType === 'group';
68
+    salesBatchVisible = data.contentType === 'salesBatch';
69
+    liveVisible = data.contentType === 'live';
70
+    h5Visible = data.contentType === 'h5';
71
+
72
+    cityId = data.cityId
73
+    // console.log(data.buildingId, ' data.buildingId')
74
+    buildingId = data.buildingId
75
+  }
76
+
77
+  const setExtraData1 = data => {
78
+    console.log(data, "data.buildingIddata.buildingId2")
79
+    islet = data.isHaveActive
80
+
81
+    if ((data.contentType === 'h5' && data.buildingId == null) || data.contentType === '' || data.contentType === 'nothing' || (data.contentType === 'live' && data.buildingId == null)) {
82
+      isHaveActive = false
83
+    } else {
84
+      isHaveActive = true
85
+    }
86
+    // if (!isHaveActivea && data.contentType === 'h5') {
87
+    //   // data.contentType=null
88
+    //   data.buildingId = null
89
+    // }
90
+
91
+    // if (data.isHaveActive !== undefined) {
92
+    //   isHaveActive = data.isHaveActive
93
+    //   if (!isHaveActive) {
94
+    //     // data.contentType=null
95
+    //     data.buildingId = null
96
+    //   }
97
+    // }
98
+    if (data.showPosition == 'index') {
99
+      isHavePosition = true;
100
+    } else {
101
+      isHavePosition = false;
102
+    }
103
+
104
+    contentVisible = data.contentType === 'other';
105
+    activityVisible = data.contentType === 'activity';
106
+    newsVisible = data.contentType === 'news';
107
+    helpVisible = data.contentType === 'help';
108
+    groupVisible = data.contentType === 'group';
109
+    salesBatchVisible = data.contentType === 'salesBatch';
110
+    liveVisible = data.contentType === 'live';
111
+    h5Visible = data.contentType === 'h5';
112
+
113
+    console.log(data.buildingId, ' data.buildingId')
114
+    buildingId = data.buildingId
115
+  }
116
+
117
+  const handleFormValueChange = (props, changedValues, allValues) => {
118
+    setExtraData(allValues)
119
+  }
120
+
121
+  const XForm = createForm({ onValuesChange: handleFormValueChange })
122
+
123
+  return (props) => {
124
+    // const [tab, changeTab] = useState('basic')
125
+    const contentId = props.location.query.contentId
126
+    const [data, setData] = useState({})
127
+    const formRef = useRef(null);
128
+
129
+    // 查询列表
130
+    const getDetail = contentId => {
131
+      request({ ...apis.carsuseFigure.getExtendContent, urlData: { id: contentId } }).then((data) => {
132
+        setExtraData1(data)
133
+        setData(data)
134
+      })
135
+    }
136
+    useEffect(() => {
137
+      if (contentId) {
138
+        isCanChoose = false
139
+        getDetail(contentId);
140
+      } else {
141
+        isCanChoose = true
142
+      }
143
+    }, [])
144
+
145
+    const cancelPage = () => {
146
+      isCanChoose = true
147
+      router.push({
148
+        pathname: '/carouselFigure/advertisingList',
149
+      });
150
+    }
151
+
152
+    const fields = [
153
+      {
154
+        label: '是否关联项目',
155
+        name: 'isHaveActive',
156
+        type: FieldTypes.Switch,
157
+        value: isHaveActive,
158
+        hidden: () => !isCanChoose,
159
+        props: {
160
+          onChange: () => {
161
+            const type = formRef.current.props.form.getFieldValue('contentType')
162
+            if (formRef.current && (type !== 'live' && type !== 'h5')) {
163
+              console.log(formRef.current.props.form.getFieldValue('contentType'), '2222')
164
+              formRef.current.props.form.resetFields(['contentType', []]);
165
+            }
166
+          },
167
+        },
168
+        rules: [
169
+          { required: true, message: '是否城市活动' },
170
+        ],
171
+      },
172
+      {
173
+        label: '发布位置',
174
+        name: 'showPosition',
175
+        type: FieldTypes.Select,
176
+        value: isHaveActive,
177
+        dict: [{
178
+          label: '首页',
179
+          value: 'index',
180
+        },
181
+        {
182
+          label: '项目',
183
+          value: 'building',
184
+        }],
185
+        value: data.showPosition,
186
+        rules: [
187
+          { required: true, message: '请选择发布位置' },
188
+        ],
189
+      },
190
+      {
191
+        label: '所属项目',
192
+        name: 'buildingId',
193
+        render: <BuildSelect />,
194
+        value: data.buildingId,
195
+        hidden: () => !isHaveActive && isHavePosition,
196
+        rules: [
197
+          { required: true, message: '请选择所属项目' },
198
+        ],
199
+      },
200
+      {
201
+        label: '展示城市',
202
+        name: 'cityId',
203
+        render: <CitySelect />,
204
+        hidden: () => !isHavePosition || isHaveActive,
205
+        value: data.cityId,
206
+        rules: [
207
+          { required: true, message: '请选择展示城市' },
208
+        ],
209
+      },
210
+      {
211
+        label: '开屏广告',
212
+        name: 'image',
213
+        type: FieldTypes.ImageUploader,
214
+        value: data.image,
215
+        help: '建议图片尺寸:640*960px,比例2:3,格式:jpg,用于开屏广告',
216
+        rules: [
217
+          { required: true, message: '请上传图片' },
218
+        ],
219
+      },
220
+      {
221
+        label: '类型',
222
+        name: 'contentType',
223
+        type: FieldTypes.Select,
224
+        hidden: () => isHaveActive,
225
+        dict: [{
226
+          label: 'H5活动详情',
227
+          value: 'h5',
228
+        },
229
+        {
230
+          label: '直播活动详情',
231
+          value: 'live',
232
+        },
233
+        {
234
+          label: '其它',
235
+          value: 'others',
236
+        }],
237
+        value: data.contentType,
238
+        rules: [
239
+          { required: true, message: '请选择类型' },
240
+        ],
241
+      },
242
+      {
243
+        label: '标题',
244
+        name: 'title',
245
+        type: FieldTypes.Text,
246
+        hidden: true,
247
+        value: data.title,
248
+        rules: [
249
+          { required: true, message: '请输入标题' },
250
+        ],
251
+      },
252
+      {
253
+        label: '类型',
254
+        name: 'contentType',
255
+        hidden: () => !isHaveActive,
256
+        type: FieldTypes.Select,
257
+        dict: [{
258
+          label: '报名活动详情',
259
+          value: 'activity'
260
+        },
261
+        {
262
+          label: '项目详情',
263
+          value: 'project'
264
+        },
265
+        {
266
+          label: '资讯详情',
267
+          value: 'news'
268
+        },
269
+        {
270
+          label: '拼团活动详情',
271
+          value: 'group'
272
+        },
273
+        {
274
+          label: '助力活动详情',
275
+          value: 'help'
276
+        },
277
+        {
278
+          label: 'H5活动详情',
279
+          value: 'h5',
280
+        },
281
+        {
282
+          label: '在线选房详情',
283
+          value: 'salesBatch',
284
+        },
285
+        {
286
+          label: '直播活动详情',
287
+          value: 'live',
288
+        },
289
+        {
290
+          label: '其它',
291
+          value: 'others',
292
+        }],
293
+        value: data.contentType,
294
+        rules: [
295
+          { required: true, message: '请选择类型' },
296
+        ],
297
+      },
298
+      {
299
+        label: '发布H5活动',
300
+        name: 'targetId',
301
+        render: <SelectH5 buildingId={() => islet ? buildingId : ''} />,
302
+        hidden: () => !h5Visible,
303
+        value: data.targetId,
304
+        rules: [
305
+          { required: true, message: '请选择发布H5' },
306
+        ],
307
+      },
308
+      {
309
+        label: '发布活动',
310
+        name: 'targetId',
311
+        render: <SelectActivity buildingId={() => buildingId} />,
312
+        hidden: () => !activityVisible,
313
+        value: data.targetId,
314
+        rules: [
315
+          { required: true, message: '请选择发布活动' },
316
+        ],
317
+      },
318
+      {
319
+        label: '发布资讯',
320
+        name: 'targetId',
321
+        render: <SelectNews buildingId={() => buildingId} />,
322
+        hidden: () => !newsVisible,
323
+        value: data.targetId,
324
+        rules: [
325
+          { required: true, message: '请选择发布资讯' },
326
+        ],
327
+      },
328
+      {
329
+        label: '发布内容',
330
+        name: 'content',
331
+        render: <Wangedit />,
332
+        value: data.content,
333
+        hidden: () => !contentVisible,
334
+        rules: [
335
+          { required: true, message: '请选择发布内容' },
336
+        ],
337
+      },
338
+      {
339
+        label: '发布助力',
340
+        name: 'targetId',
341
+        render: <SelectHelp buildingId={() => buildingId} />,
342
+        hidden: () => !helpVisible,
343
+        value: data.targetId,
344
+        rules: [
345
+          { required: true, message: '请选择发布助力' },
346
+        ],
347
+      },
348
+      {
349
+        label: '发布拼团',
350
+        name: 'targetId',
351
+        render: <SelectGroup buildingId={() => buildingId} />,
352
+        hidden: () => !groupVisible,
353
+        value: data.targetId,
354
+        rules: [
355
+          { required: true, message: '请选择发布拼团' },
356
+        ],
357
+      },
358
+      {
359
+        label: '发布销售批次',
360
+        name: 'targetId',
361
+        render: <SalesBatchGroup buildingId={() => buildingId} />,
362
+        hidden: () => !salesBatchVisible,
363
+        value: data.targetId,
364
+        rules: [
365
+          { required: true, message: '请选择发布销售批次' },
366
+        ],
367
+      },
368
+      {
369
+        label: '发布直播活动',
370
+        name: 'targetId',
371
+        render: <LiveGroup buildingId={() => islet ? buildingId : ''} />,
372
+        hidden: () => !liveVisible,
373
+        value: data.targetId,
374
+        rules: [
375
+          { required: true, message: '请选择发布直播活动' },
376
+        ],
377
+      },
378
+      {
379
+        label: '状态',
380
+        name: 'status',
381
+        type: FieldTypes.Select,
382
+        dict: [{
383
+          label: "上架",
384
+          value: 1
385
+        },
386
+        {
387
+          label: "下架",
388
+          value: 0
389
+        },],
390
+        value: data.status != null ? data.status : 1,
391
+      },
392
+    ]
393
+
394
+    const handleSubmit = val => {
395
+      val.showType = 'screen'
396
+      if (!isHaveActive && val.targetId) {
397
+        if (!val.contentType) {
398
+          val.contentType = 'h5'
399
+        }
400
+      }
401
+      if (!isHaveActive && !val.targetId) {
402
+        val.contentType = ''
403
+      }
404
+      if (contentId) {
405
+        request({ ...apis.carsuseFigure.updataExtendContent, urlData: { id: contentId }, data: val, }).then((data) => {
406
+          cancelPage()
407
+        }).catch((err) => {
408
+          message.info(err.msg || err.message)
409
+        })
410
+      } else {
411
+        request({ ...apis.carsuseFigure.addExtendContent, data: val, }).then((data) => {
412
+          cancelPage()
413
+        }).catch((err) => {
414
+          message.info(err.msg || err.message)
415
+        })
416
+      }
417
+    }
418
+
419
+
420
+    return (
421
+      <XForm wrappedComponentRef={formRef} onSubmit={handleSubmit} onCancel={cancelPage} onValuesChange={handleFormValueChange} fields={fields}></XForm>
422
+    );
423
+  }
424
+}
425
+
426
+export default createEditor()

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

@@ -0,0 +1,393 @@
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 moment from 'moment';
5
+import router from 'umi/router';
6
+import styles from '../style/GoodsList.less';
7
+import BuildSelect from '../../components/SelectButton/BuildSelect2'
8
+import CitySelect from '../../components/SelectButton/CitySelect2'
9
+import { createForm, FieldTypes } from '../../components/XForm';
10
+import Wangedit from '../../components/Wangedit/Wangedit'
11
+import apis from '../../services/apis';
12
+import request from '../../utils/request'
13
+import SelectHelp from './SelectHelp';
14
+import SelectGroup from './SelectGroup';
15
+import SalesBatchGroup from './SalesBatchGroup';
16
+import LiveGroup from './LiveGroup';
17
+import SelectNews from './SelectNews';
18
+import SelectActivity from './SelectActivity';
19
+import SelectH5 from './SelectH5';
20
+
21
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
22
+/**
23
+ *
24
+ *
25
+ * @param {*} props
26
+ * @returns
27
+ */
28
+ const Edit = props => {
29
+  let contentVisible = false
30
+  let activityVisible = false
31
+  let newsVisible = false
32
+  let helpVisible = false
33
+  let groupVisible = false
34
+  let salesBatchVisible = false
35
+  let liveVisible = false
36
+  let h5Visible = false
37
+  let buildingId = ''
38
+  let cityId=''
39
+  let locationType = false
40
+  let isHaveActive=false
41
+  let isCanChoose=true
42
+
43
+  const setExtraData = (data) => {
44
+    console.log(data, 'data');
45
+    if(data.isHaveActive!=undefined){
46
+      isHaveActive=data.isHaveActive
47
+      if(!isHaveActive) {
48
+        // data.contentType=null
49
+        data.buildingId=null
50
+      }
51
+    }
52
+
53
+    contentVisible = data.contentType === 'other';
54
+    activityVisible = data.contentType === 'activity';
55
+    newsVisible = data.contentType === 'news';
56
+    helpVisible = data.contentType === 'help';
57
+    groupVisible = data.contentType === 'group';
58
+    salesBatchVisible = data.contentType === 'salesBatch';
59
+    liveVisible = data.contentType === 'live';
60
+    h5Visible = data.contentType === 'h5';
61
+
62
+    cityId=data.cityId
63
+    buildingId = data.buildingId
64
+    locationType = data.showPosition === 'mall';
65
+    console.log(locationType, 'locationType');
66
+  }
67
+
68
+  const setExtraData1 = (data) => {
69
+     if((data.contentType=='h5'  && data.buildingId == null) || data.contentType==''||data.contentType=='nothing' || (data.contentType=='live' && data.buildingId == null)){
70
+        isHaveActive=false
71
+     }else{
72
+        isHaveActive=true
73
+     }
74
+
75
+    contentVisible = data.contentType === 'other';
76
+    activityVisible = data.contentType === 'activity';
77
+    newsVisible = data.contentType === 'news';
78
+    helpVisible = data.contentType === 'help';
79
+    groupVisible = data.contentType === 'group';
80
+    salesBatchVisible = data.contentType === 'salesBatch';
81
+    liveVisible = data.contentType === 'live';
82
+    buildingId = data.buildingId
83
+    locationType = data.showPosition === 'mall';
84
+    h5Visible = data.contentType === 'h5';
85
+    console.log(locationType, 'locationType');
86
+  }
87
+
88
+
89
+  const handleFormValueChange = (props, changedValues, allValues) => {
90
+      setExtraData(allValues)
91
+  }
92
+
93
+  const XForm = createForm({ onValuesChange: handleFormValueChange })
94
+
95
+  return props => {
96
+    const [tab, changeTab] = useState('basic')
97
+    const { contentId } = props.location.query
98
+    const [data, setData] = useState({})
99
+
100
+    if (contentId) {
101
+      isCanChoose=false
102
+      // eslint-disable-next-line react-hooks/rules-of-hooks
103
+      useEffect(() => {
104
+        getDetail(contentId);
105
+      }, [])
106
+
107
+      // 查询列表
108
+      const getDetail = contentId => {
109
+        request({ ...apis.carsuseFigure.getExtendContent, urlData: { id: contentId } }).then(data => {
110
+            console.log(data)
111
+            setExtraData1(data)
112
+            setData(data)
113
+        })
114
+      }
115
+    }else{
116
+      isCanChoose=true
117
+    }
118
+
119
+    const cancelPage = () => {
120
+      router.push({
121
+        pathname: '/carouselFigure/carouselFigureList',
122
+      });
123
+    }
124
+
125
+      const fields = [
126
+        {
127
+          label: '是否关联项目',
128
+          name: 'isHaveActive',
129
+          type: FieldTypes.Switch,
130
+          value:isHaveActive,
131
+          hidden: () => !isCanChoose,
132
+          rules: [
133
+            { required: true,message: '是否城市活动' },
134
+          ],
135
+        },
136
+        {
137
+          label: '所属项目',
138
+          name: 'buildingId',
139
+          render: <BuildSelect />,
140
+          hidden: () => !isHaveActive,
141
+          value: data.buildingId,
142
+          rules: [
143
+            { required: true, message: '请选择所属项目' },
144
+          ],
145
+        },
146
+        {
147
+          label: '展示城市',
148
+          name: 'cityId',
149
+          render: <CitySelect />,
150
+          hidden: () => isHaveActive,
151
+          value: data.cityId,
152
+          rules: [
153
+            { required: true, message: '请选择展示城市' },
154
+          ],
155
+        },
156
+        {
157
+          label: '发布位置',
158
+          name: 'showPosition',
159
+          type: FieldTypes.Select,
160
+          dict: [{
161
+            label: '首页',
162
+            value: 'index',
163
+          },
164
+          {
165
+            label: '积分商城',
166
+            value: 'mall',
167
+          }],
168
+          value: data.showPosition,
169
+          rules: [
170
+            { required: true, message: '请选择发布位置' },
171
+          ],
172
+        },
173
+        {
174
+          label: () => (locationType ? '积分商城轮播图' : '首页轮播图'),
175
+          name: 'image',
176
+          type: FieldTypes.ImageUploader,
177
+          value: data.image,
178
+          help: () => (locationType ? '建议图片尺寸:750*250px,比例3:1,格式:jpg,用于积分商城banner轮播' : '建议图片尺寸:750*464px,比例1.:0.618,格式:jpg,用于:首页顶部banner轮播'),
179
+          rules: [
180
+            { required: true, message: '请上传轮播图' },
181
+          ],
182
+        },
183
+        {
184
+          label: '类型',
185
+          name: 'contentType',
186
+          type: FieldTypes.Select,
187
+          hidden: () => isHaveActive,
188
+          dict: [{
189
+            label: 'h5',
190
+            value: 'h5',
191
+          },
192
+          {
193
+            label: '直播活动详情',
194
+            value: 'live',
195
+          }],
196
+          value: data.contentType,
197
+          rules: [
198
+            { required: true, message: '请选择类型' },
199
+          ],
200
+        },
201
+        {
202
+          label: '标题',
203
+          name: 'title',
204
+          type: FieldTypes.Text,
205
+          value: data.title,
206
+          hidden: true,
207
+          rules: [
208
+            { required: true, message: '请输入标题' },
209
+          ],
210
+        },
211
+        {
212
+          label: '类型',
213
+          name: 'contentType',
214
+          type: FieldTypes.Select,
215
+          hidden: () => !isHaveActive,
216
+          dict: [{
217
+            label: '常规活动',
218
+            value: 'activity',
219
+          },
220
+          {
221
+            label: '项目',
222
+            value: 'project',
223
+          },
224
+          {
225
+            label: '资讯',
226
+            value: 'news',
227
+          },
228
+          // {
229
+          //   label: '其他',
230
+          //   value: 'other',
231
+          // },
232
+          {
233
+            label: '拼团',
234
+            value: 'group',
235
+          },
236
+          {
237
+            label: '助力',
238
+            value: 'help',
239
+          },
240
+          {
241
+            label: 'h5',
242
+            value: 'h5',
243
+          },
244
+          {
245
+            label: '销售批次详情',
246
+            value: 'salesBatch',
247
+          },
248
+          {
249
+            label: '直播活动详情',
250
+            value: 'live',
251
+          }],
252
+          value: data.contentType,
253
+          rules: [
254
+            { required: true, message: '请选择类型' },
255
+          ],
256
+        },
257
+        {
258
+          label: '发布活动',
259
+          name: 'targetId',
260
+          render: <SelectActivity buildingId={() => buildingId} />,
261
+          hidden: () => !activityVisible,
262
+          value: data.targetId,
263
+          rules: [
264
+            { required: true, message: '请选择发布活动' },
265
+          ],
266
+        },
267
+        {
268
+          label: '是否发布H5',
269
+          name: 'targetId',
270
+          render: <SelectH5 buildingId={() => buildingId}/>,
271
+          hidden: () => !h5Visible,
272
+          value: data.targetId,
273
+          rules: [
274
+            { required: false, message: '请选择发布H5' },
275
+          ],
276
+        },
277
+        {
278
+          label: '发布资讯',
279
+          name: 'targetId',
280
+          render: <SelectNews buildingId={() => buildingId} />,
281
+          hidden: () => !newsVisible,
282
+          value: data.targetId,
283
+          rules: [
284
+            { required: true, message: '请选择发布资讯' },
285
+          ],
286
+        },
287
+        {
288
+          label: '发布内容',
289
+          name: 'content',
290
+          render: <Wangedit />,
291
+          value: data.content,
292
+          hidden: () => !contentVisible,
293
+          rules: [
294
+            { required: true, message: '请输入发布内容' },
295
+          ],
296
+        },
297
+        {
298
+          label: '发布助力',
299
+          name: 'targetId',
300
+          render: <SelectHelp buildingId={() => buildingId} />,
301
+          hidden: () => !helpVisible,
302
+          value: data.targetId,
303
+          rules: [
304
+            { required: true, message: '请选择发布助力' },
305
+          ],
306
+        },
307
+        {
308
+          label: '发布拼团',
309
+          name: 'targetId',
310
+          render: <SelectGroup buildingId={() => buildingId} />,
311
+          hidden: () => !groupVisible,
312
+          value: data.targetId,
313
+          rules: [
314
+            { required: true, message: '请选择发布拼团' },
315
+          ],
316
+        },
317
+        {
318
+          label: '发布销售批次',
319
+          name: 'targetId',
320
+          render: <SalesBatchGroup buildingId={() => buildingId} />,
321
+          hidden: () => !salesBatchVisible,
322
+          value: data.targetId,
323
+          rules: [
324
+            { required: true, message: '请选择发布销售批次' },
325
+          ],
326
+        },
327
+        {
328
+          label: '发布直播活动',
329
+          name: 'targetId',
330
+          render: <LiveGroup buildingId={() => buildingId} />,
331
+          hidden: () => !liveVisible,
332
+          value: data.targetId, 
333
+          rules: [
334
+            { required: true, message: '请选择发布直播活动' },
335
+          ],
336
+        },
337
+        {
338
+          label: '状态',
339
+          name: 'status',
340
+          type: FieldTypes.Select,
341
+          dict: [{
342
+            label: '上架',
343
+            value: 1,
344
+          },
345
+          {
346
+            label: '下架',
347
+            value: 0,
348
+          }],
349
+          value: data.status != null ? data.status : 1,
350
+        },
351
+        {
352
+          label: '权重',
353
+          name: 'orderNo',
354
+          type: FieldTypes.Number,
355
+          value: data.orderNo,
356
+          help: "数值越大越靠前",
357
+        },
358
+      ]
359
+
360
+      const handleSubmit = val => {
361
+        console.log(val,"232323")
362
+        val.showType = 'banner'
363
+        if(!isHaveActive&&val.targetId) {
364
+          if(!val.contentType){
365
+            val.contentType='h5'
366
+          }
367
+        }
368
+        if(!isHaveActive&&!val.targetId){
369
+          val.contentType=''
370
+        }
371
+        if (contentId) {
372
+          request({ ...apis.carsuseFigure.updataExtendContent, urlData: { id: contentId }, data: val }).then(data => {
373
+            cancelPage()
374
+          }).catch(err => {
375
+            message.info(err.msg || err.message)
376
+          })
377
+        } else {
378
+          request({ ...apis.carsuseFigure.addExtendContent, data: val }).then(data => {
379
+            cancelPage()
380
+          }).catch(err => {
381
+            message.info(err.msg || err.message)
382
+          })
383
+        }
384
+      }
385
+
386
+    return (
387
+      <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
388
+    );
389
+  }
390
+ }
391
+
392
+
393
+export default Edit()

+ 361
- 0
src/pages/carouselFigure/propaganda.jsx 查看文件

@@ -0,0 +1,361 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Modal, 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/BuildSelect2'
8
+import CitySelect from '../../components/SelectButton/CitySelect2'
9
+import { FieldTypes, createForm } from '../../components/XForm';
10
+import Wangedit from '../../components/Wangedit/Wangedit';
11
+import SelectActivity from './SelectActivity';
12
+import SelectNews from './SelectNews';
13
+import apis from '../../services/apis';
14
+import request from '../../utils/request'
15
+import SelectHelp from './SelectHelp';
16
+import SelectGroup from './SelectGroup';
17
+import SelectH5 from './SelectH5';
18
+import SalesBatchGroup from './SalesBatchGroup';
19
+import LiveGroup from './LiveGroup';
20
+/**
21
+ *
22
+ *
23
+ * @param {*} props
24
+ * @returns
25
+ */
26
+ const createEditor = () => {
27
+  let contentVisible = false
28
+  let activityVisible = false
29
+  let newsVisible = false
30
+  let helpVisible = false
31
+  let groupVisible = false
32
+  let salesBatchVisible = false
33
+  let liveVisible = false
34
+  let h5Visible = false
35
+  let buildingId = ''
36
+  let cityId = ''
37
+  let isHaveActive=false
38
+  let isCanChoose=true
39
+
40
+  const setExtraData = (data) => {
41
+    if(data.isHaveActive!=undefined){
42
+      isHaveActive=data.isHaveActive
43
+      if(!isHaveActive) {
44
+        // data.contentType=null
45
+        data.buildingId=null
46
+      }
47
+    }
48
+
49
+    contentVisible = data.contentType === 'other';
50
+    activityVisible = data.contentType === 'activity';
51
+    newsVisible = data.contentType === 'news';
52
+    helpVisible = data.contentType === 'help';
53
+    groupVisible = data.contentType === 'group';
54
+    salesBatchVisible = data.contentType === 'salesBatch';
55
+    liveVisible = data.contentType === 'live';
56
+    h5Visible = data.contentType === 'h5';
57
+    cityId=data.cityId
58
+    buildingId = data.buildingId
59
+  }
60
+
61
+  const setExtraData1 = (data) => {
62
+    console.log(data.buildingId,"data.buildingIddata.buildingId3")
63
+    if(data.contentType=='h5'||data.contentType==''||data.contentType=='nothing' || (data.contentType=='live' && data.buildingId == null)){
64
+       isHaveActive=false
65
+    }else{
66
+       isHaveActive=true
67
+    }
68
+
69
+    contentVisible = data.contentType === 'other';
70
+    activityVisible = data.contentType === 'activity';
71
+    newsVisible = data.contentType === 'news';
72
+    helpVisible = data.contentType === 'help';
73
+    groupVisible = data.contentType === 'group';
74
+    salesBatchVisible = data.contentType === 'salesBatch';
75
+    liveVisible = data.contentType === 'live';
76
+    h5Visible = data.contentType === 'h5';
77
+    buildingId = data.buildingId
78
+  }
79
+
80
+  const handleFormValueChange = (props, changedValues, allValues) => {
81
+      setExtraData(allValues)
82
+  }
83
+
84
+  const XForm = createForm({ onValuesChange: handleFormValueChange })
85
+
86
+  return (props) => {
87
+    const [ tab, changeTab ] = useState('basic')
88
+    const contentId = props.location.query.contentId
89
+    const [ data, setData ] = useState({})
90
+
91
+    if(contentId){
92
+      isCanChoose=false
93
+      useEffect(() => {
94
+        getDetail(contentId);
95
+      },[])
96
+
97
+      // 查询列表
98
+      const getDetail = (contentId) => {
99
+        request({ ...apis.carsuseFigure.getExtendContent,urlData:{id: contentId}}).then((data) => {
100
+          setExtraData1(data)
101
+          setData(data)
102
+        })
103
+      }
104
+    }else{
105
+      isCanChoose=true
106
+    }
107
+
108
+    const cancelPage = () =>{
109
+      router.push({
110
+        pathname: '/carouselFigure/propagandaList',
111
+      });
112
+    }
113
+
114
+    const fields = [
115
+      {
116
+        label: '是否关联项目',
117
+        name: 'isHaveActive',
118
+        type: FieldTypes.Switch,
119
+        value:isHaveActive,
120
+        hidden: () => !isCanChoose,
121
+        rules: [
122
+          { required: true,message: '是否城市活动' },
123
+        ],
124
+      },
125
+      {
126
+        label: '所属项目',
127
+        name: 'buildingId',
128
+        render: <BuildSelect />,
129
+        value: data.buildingId,
130
+        hidden: () => !isHaveActive,
131
+        rules: [
132
+          { required: true, message: '请选择所属项目' },
133
+        ],
134
+      },
135
+      {
136
+        label: '所属城市',
137
+        name: 'cityId',
138
+        render: <CitySelect />,
139
+        hidden: () => isHaveActive,
140
+        value: data.cityId,
141
+        rules: [
142
+          { required: true, message: '请选择展示城市' },
143
+        ],
144
+      },
145
+      {
146
+        label: '主图',
147
+        name: 'image',
148
+        type: FieldTypes.ImageUploader,
149
+        value: data.image,
150
+        help: '建议图片尺寸:750*188px,比例4:1,格式:jpg,用于:首页宣传位',
151
+        rules: [
152
+          { required: true, message: '请上传图片' },
153
+        ],
154
+      },
155
+      {
156
+        label: '类型',
157
+        name: 'contentType',
158
+        type: FieldTypes.Select,
159
+        hidden: () => isHaveActive,
160
+        dict: [{
161
+          label: 'h5',
162
+          value: 'h5',
163
+        },
164
+        {
165
+          label: '直播活动详情',
166
+          value: 'live',
167
+        }],
168
+        value: data.contentType,
169
+        rules: [
170
+          { required: true, message: '请选择类型' },
171
+        ],
172
+      },
173
+      {
174
+        label: '标题',
175
+        name: 'title',
176
+        type: FieldTypes.Text,
177
+        hidden: true,
178
+        value: data.title,
179
+        rules: [
180
+          { required: true, message: '请输入标题' },
181
+        ],
182
+      },
183
+      {
184
+        label: '类型',
185
+        name: 'contentType',
186
+        hidden: () => !isHaveActive,
187
+        type: FieldTypes.Select,
188
+        dict: [{
189
+          label: '常规活动',
190
+          value: 'activity'
191
+        },
192
+        {
193
+          label: '项目',
194
+          value: 'project'
195
+        },
196
+        {
197
+          label: '资讯',
198
+          value: 'news'
199
+        },
200
+        {
201
+          label: '拼团',
202
+          value: 'group'
203
+        },
204
+        {
205
+          label: '助力',
206
+          value: 'help'
207
+        },
208
+        {
209
+          label: 'h5',
210
+          value: 'h5',
211
+        },
212
+        {
213
+          label: '销售批次详情',
214
+          value: 'salesBatch',
215
+        },
216
+        {
217
+          label: '直播活动详情',
218
+          value: 'live',
219
+        }],
220
+        value: data.contentType,
221
+        rules: [
222
+          { required: true, message: '请选择类型' },
223
+        ],
224
+      },
225
+      {
226
+        label: '发布活动',
227
+        name: 'targetId',
228
+        render: <SelectActivity buildingId={() => buildingId} />,
229
+        hidden: () => !activityVisible,
230
+        value: data.targetId,
231
+        rules: [
232
+          { required: true, message: '请选择发布活动' },
233
+        ],
234
+      },
235
+      {
236
+        label: '发布资讯',
237
+        name: 'targetId',
238
+        render: <SelectNews buildingId={() => buildingId} />,
239
+        hidden: () => !newsVisible,
240
+        value: data.targetId,
241
+        rules: [
242
+          { required: true, message: '请选择发布资讯' },
243
+        ],
244
+      },
245
+      {
246
+        label: '发布内容',
247
+        name: 'content',
248
+        render: <Wangedit />,
249
+        value: data.content,
250
+        hidden: () => !contentVisible,
251
+        rules: [
252
+          { required: true, message: '请选择发布内容' },
253
+        ],
254
+      },
255
+      {
256
+        label: '发布助力',
257
+        name: 'targetId',
258
+        render: <SelectHelp buildingId={() => buildingId} />,
259
+        hidden: () => !helpVisible,
260
+        value: data.targetId,
261
+        rules: [
262
+          { required: true, message: '请选择发布助力' },
263
+        ],
264
+      },
265
+      {
266
+        label: '是否发布H5',
267
+        name: 'targetId',
268
+        render: <SelectH5 buildingId={() => buildingId}/>,
269
+        hidden: () => !h5Visible,
270
+        value: data.targetId,
271
+        rules: [
272
+          { required: false, message: '请选择发布H5' },
273
+        ],
274
+      },
275
+      {
276
+        label: '发布拼团',
277
+        name: 'targetId',
278
+        render: <SelectGroup buildingId={() => buildingId} />,
279
+        hidden: () => !groupVisible,
280
+        value: data.targetId,
281
+        rules: [
282
+          { required: true, message: '请选择发布拼团' },
283
+        ],
284
+      },
285
+      {
286
+        label: '发布销售批次',
287
+        name: 'targetId',
288
+        render: <SalesBatchGroup buildingId={() => buildingId} />,
289
+        hidden: () => !salesBatchVisible,
290
+        value: data.targetId,
291
+        rules: [
292
+          { required: true, message: '请选择发布销售批次' },
293
+        ],
294
+      },
295
+      {
296
+        label: '发布直播活动',
297
+        name: 'targetId',
298
+        render: <LiveGroup buildingId={() => buildingId} />,
299
+        hidden: () => !liveVisible,
300
+        value: data.targetId,
301
+        rules: [
302
+          { required: true, message: '请选择发布直播活动' },
303
+        ],
304
+      },
305
+      {
306
+        label: '状态',
307
+        name: 'status',
308
+        type: FieldTypes.Select,
309
+        dict: [{
310
+          label: "上架",
311
+          value: 1
312
+        },
313
+        {
314
+          label: "下架",
315
+          value: 0
316
+        },],
317
+        value: data.status != null ? data.status : 1,
318
+      },
319
+      {
320
+        label: '权重',
321
+        name: 'orderNo',
322
+        type: FieldTypes.Number,
323
+        value: data.orderNo,
324
+        help: "数值越大越靠前",
325
+      },
326
+    ]
327
+
328
+    const handleSubmit = val => {
329
+      console.log(val,"valvalval")
330
+      val.showType = 'propaganda'
331
+      if(!isHaveActive&&val.targetId) {
332
+          if(!val.contentType){
333
+            val.contentType='h5'
334
+          }
335
+      }
336
+      if(!isHaveActive&&!val.targetId){
337
+        val.contentType=''
338
+      }
339
+      if(contentId){
340
+        request({ ...apis.carsuseFigure.updataExtendContent,urlData:{id: contentId}, data: val,}).then((data) => {
341
+          cancelPage()
342
+        }).catch((err) => {
343
+          message.info(err.msg || err.message)
344
+        })
345
+      }else{
346
+        request({ ...apis.carsuseFigure.addExtendContent, data: val,}).then((data) => {
347
+          cancelPage()
348
+        }).catch((err) => {
349
+          message.info(err.msg || err.message)
350
+        })
351
+      }
352
+    }
353
+
354
+
355
+    return (
356
+      <XForm onSubmit={handleSubmit} onCancel={cancelPage} onValuesChange={handleFormValueChange} fields={fields}></XForm>
357
+    );
358
+   }
359
+ }
360
+
361
+export default createEditor()

+ 284
- 0
src/pages/carouselFigure/propagandaList.jsx 查看文件

@@ -0,0 +1,284 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Button, Select, message, Table, Pagination, Modal, DatePicker } from 'antd';
3
+import router from 'umi/router';
4
+import moment from 'moment';
5
+import AuthButton from '@/components/AuthButton';
6
+import EditIcon from '@/components/EditIcon';
7
+import withActions from '@/components/ActionList';
8
+import Navigate from '@/components/Navigate';
9
+import SelectCity from '../../components/SelectButton/CitySelect'
10
+import BuildSelect from '../../components/SelectButton/BuildSelect'
11
+import apis from '../../services/apis';
12
+import request from '../../utils/request';
13
+import styles from '../style/GoodsList.less';
14
+
15
+const { Option } = Select;
16
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
17
+
18
+const header = (props) => {
19
+  const [data, setData] = useState({})
20
+  //   const [page, changePage] = useState({})
21
+
22
+  useEffect(() => {
23
+    getList({ pageNum: 1, pageSize: 10, showType: 'propaganda' });
24
+  }, [])
25
+
26
+  // 查询列表
27
+  const getList = (params) => {
28
+    request({ ...apis.carsuseFigure.extendContent, params: { ...params }, }).then((data) => {
29
+      console.log(data)
30
+      setData(data)
31
+    })
32
+  }
33
+
34
+
35
+  // 跳转到编辑商品
36
+  const toEdit = (contentId) => () => {
37
+    router.push({
38
+      pathname: '/carouselFigure/propaganda',
39
+      query: {
40
+        contentId
41
+      },
42
+    });
43
+  }
44
+
45
+  const columns = [
46
+    {
47
+      title: '主图',
48
+      dataIndex: 'image',
49
+      key: 'image',
50
+      align: 'center',
51
+      render: (image,row) => <Navigate onClick={toEdit(row.contentId)} ><img src={image} className={styles.propaganda} /></Navigate>,
52
+    },
53
+    {
54
+      title: '发布城市',
55
+      dataIndex: 'cityName',
56
+      key: 'cityName',
57
+      align: 'center',
58
+    },
59
+    {
60
+      title: '关联项目',
61
+      dataIndex: 'buildingName',
62
+      key: 'buildingName',
63
+      align: 'center',
64
+      render: (buildingName) => <span>{buildingName === null ? '无' : buildingName}</span>
65
+    },
66
+    {
67
+      title: '关联内容类型',
68
+      dataIndex: 'contentType',
69
+      key: 'contentType',
70
+      align: 'center',
71
+      render: (contentType) => <span>{contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' :
72
+        contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : contentType === 'h5' ? 'H5活动' : contentType === 'salesBatch' ? '销售批次详情' : contentType === 'live' ? '直播活动详情' : '无'}</span>
73
+    },
74
+    // {
75
+    //   title: '发布位置',
76
+    //   dataIndex: 'showPosition',
77
+    //   key: 'showPosition',
78
+    //   align: 'center',
79
+    //   render: (showPosition) => <span>{ showPosition === 'index' ? '首页' : showPosition === 'mall' ? '商城' : '' }</span>
80
+    // },
81
+    {
82
+      title: '发布时间',
83
+      dataIndex: 'createDate',
84
+      key: 'createDate',
85
+      align: 'center',
86
+      render: (x, row) => <><span>{moment(row.createDate).format('YYYY-MM-DD')}</span></>
87
+    },
88
+    {
89
+      title: '状态',
90
+      dataIndex: 'status',
91
+      key: 'status',
92
+      align: 'center',
93
+      render: (status) => <><span>{status == 1 ? '上架' : '下架'}</span></>
94
+    },
95
+    {
96
+      title: '操作',
97
+      dataIndex: 'handle',
98
+      key: 'handle',
99
+      align: 'center',
100
+      render: withActions((x, row) => [
101
+        <AuthButton name="admin.propaganda.publish" noRight={null}>
102
+          <EditIcon text={row.status === 1 ? '下架': '上架'} type={row.status === 1 ? 'down': 'up'} onClick={changeStatus(row)} />
103
+        </AuthButton>,
104
+        <AuthButton name="admin.propaganda.put" noRight={null}>
105
+          <EditIcon text="编辑" type="edit" onClick={toEdit(row.contentId)} />
106
+        </AuthButton>,
107
+        <AuthButton name="admin.propaganda.delete" noRight={null}>
108
+          <EditIcon text="删除" type="delete" onClick={deleteCarouse(row.contentId)} />
109
+        </AuthButton>,
110
+      ])
111
+    },
112
+  ];
113
+
114
+  const finishDynamic = (row) => {
115
+    Modal.confirm({
116
+      title: '结束以后将无法编辑, 是否继续?',
117
+      okText: '确定',
118
+      cancelText: '取消',
119
+      onOk() {
120
+        request({ ...apis.carsuseFigure.finish, data: { dynamicId: row.dynamicId, top: "" }, }).then((data) => {
121
+          console.log(data)
122
+          message.info('操作成功!')
123
+          getList({ pageNum: 1, pageSize: 10, showType: 'propaganda' })
124
+        }).catch((err) => {
125
+          console.log(err)
126
+          message.info(err.msg || err.message)
127
+        })
128
+      },
129
+    });
130
+  }
131
+
132
+  //删除
133
+  const deleteCarouse = (contentId) => () => {
134
+    Modal.confirm({
135
+      title: '确认删除此数据?',
136
+      okText: '确定',
137
+      cancelText: '取消',
138
+      onOk() {
139
+        request({ ...apis.carsuseFigure.deleteExtendContent, urlData: { id: contentId } }).then((data) => {
140
+          message.info('操作成功!')
141
+          getList({ pageNum: 1, pageSize: 10, showType: 'propaganda' })
142
+        }).catch((err) => {
143
+          console.log(err)
144
+          message.info(err.msg || err.message)
145
+        })
146
+      },
147
+    });
148
+  }
149
+
150
+  //   停用启用
151
+  const changeStatus = (row) => () => {
152
+    console.log(row)
153
+    if (row.status === 0) {
154
+
155
+      Modal.confirm({
156
+        title: '确认发布此数据?',
157
+        okText: '确定',
158
+        cancelText: '取消',
159
+        onOk() {
160
+          row.status = 1
161
+          request({ ...apis.carsuseFigure.updataExtendContent, urlData: { id: row.contentId }, data: row, }).then((data) => {
162
+            message.info('操作成功!')
163
+            getList({ pageNum: 1, pageSize: 10, showType: 'propaganda' })
164
+          }).catch((err) => {
165
+            console.log(err)
166
+            message.info(err.msg || err.message)
167
+          })
168
+        },
169
+      });
170
+    } else if (row.status === 1) {
171
+
172
+      Modal.confirm({
173
+        title: '停用后不会再显示在小程序端',
174
+        okText: '确定',
175
+        cancelText: '取消',
176
+        onOk() {
177
+          row.status = 0
178
+          request({ ...apis.carsuseFigure.updataExtendContent, urlData: { id: row.contentId }, data: row, }).then((data) => {
179
+            message.info('操作成功!')
180
+            getList({ pageNum: 1, pageSize: 10, showType: 'propaganda' })
181
+          }).catch((err) => {
182
+            console.log(err)
183
+            message.info(err.msg || err.message)
184
+          })
185
+        },
186
+      });
187
+    }
188
+
189
+  }
190
+
191
+  const changePageNum = (pageNumber, props) => {
192
+    props.form.validateFields((err, values) => {
193
+      if (!err) {
194
+        getList({ pageNum: pageNumber, pageSize: 10, ...values, showType: 'propaganda' })
195
+      }
196
+    });
197
+  }
198
+
199
+  // 提交事件
200
+  const handleSubmit = (e, props) => {
201
+    e.preventDefault();
202
+    props.form.validateFields((err, values) => {
203
+      if (!err) {
204
+        console.log('提交数据: ', values)
205
+        getList({ pageNum: 1, pageSize: 10, ...values, showType: 'propaganda' })
206
+      }
207
+    });
208
+  }
209
+
210
+  //重置搜索
211
+  function handleReset() {
212
+    props.form.resetFields();
213
+    getList({ pageNum: 1, pageSize: 10, showType: 'propaganda' });
214
+  }
215
+
216
+
217
+  const { getFieldDecorator } = props.form
218
+  return (
219
+
220
+    <>
221
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
222
+        <Form.Item>
223
+          {getFieldDecorator('cityId')(
224
+            <SelectCity />,
225
+          )}
226
+        </Form.Item>
227
+        <Form.Item>
228
+          {getFieldDecorator('buildingId')(
229
+            <BuildSelect />,
230
+          )}
231
+        </Form.Item>
232
+        <Form.Item>
233
+          {getFieldDecorator('contentType')(
234
+            <Select style={{ width: '180px' }} placeholder="类型">
235
+              <Option value="activity">活动</Option>
236
+              <Option value="project">项目</Option>
237
+              <Option value="news">资讯</Option>
238
+              <Option value="help">助力</Option>
239
+              <Option value="group">拼团</Option>
240
+              <Option value="h5">H5</Option>
241
+              <Option value="nothing">无</Option>
242
+            </Select>,
243
+          )}
244
+        </Form.Item>
245
+        {/* <Form.Item>
246
+          {getFieldDecorator('showPosition')(
247
+            <Select style={{ width: '180px' }} placeholder="发布位置">
248
+              <Option value="mall">商城</Option>
249
+              <Option value="index">首页</Option>
250
+            </Select>,
251
+          )}
252
+        </Form.Item> */}
253
+        <Form.Item>
254
+          {getFieldDecorator('status')(
255
+            <Select style={{ width: '180px' }} placeholder="状态">
256
+              <Option value="1">已上架</Option>
257
+              <Option value="0">已下架</Option>
258
+            </Select>,
259
+          )}
260
+        </Form.Item>
261
+        <Form.Item>
262
+          <AuthButton name="admin.advert.search" noRight={null}>
263
+            <Button type="primary" htmlType="submit" className={styles.searchBtn}>
264
+              搜索
265
+          </Button>
266
+          </AuthButton>
267
+          <Button style={{ marginLeft: 8 }} onClick={handleReset}>
268
+            重置
269
+            </Button>
270
+        </Form.Item>
271
+      </Form>
272
+      <AuthButton name="admin.propaganda.post" noRight={null}>
273
+        <Button type="danger" className={styles.addBtn} onClick={toEdit()}>新增</Button>
274
+      </AuthButton>
275
+      <Table dataSource={data.records} columns={columns} pagination={false} rowKey="advertisingList" />
276
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
277
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={e => changePageNum(e, props)} current={data.current} />
278
+      </div>
279
+    </>
280
+  )
281
+}
282
+const WrappedHeader = Form.create({ name: 'header' })(header);
283
+
284
+export default WrappedHeader

+ 248
- 0
src/pages/customer/Customer/PrivateCustomer/CustomerDetail.jsx 查看文件

@@ -0,0 +1,248 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Table, Pagination, Button } from 'antd';
3
+
4
+import styles from '../style.less';
5
+import apis from '@/services/apis';
6
+import request from '@/utils/request';
7
+import moment from 'moment';
8
+import BuildSelect from '@/components/SelectButton/BuildSelect';
9
+
10
+import router from 'umi/router';
11
+import Prompt from 'umi/prompt';
12
+
13
+function CustomerDetail(props) {
14
+  /**
15
+   * @param {*} props
16
+   * @returns
17
+   */
18
+  // eslint-disable-next-line react-hooks/rules-of-hooks
19
+  const [data, setData] = useState([{}]);
20
+  const [tableData, setTableDataData] = useState([{}]);
21
+  const [dataConsultant, setDataonsultant] = useState({});
22
+  const [intentionData, setIntentionData] = useState([]);
23
+  const [buildingIdValue, setBuildingIdData] = useState();
24
+
25
+  // eslint-disable-next-line react-hooks/rules-of-hooks
26
+  useEffect(() => {
27
+    getById();
28
+    toLoadIntention();
29
+  }, []);
30
+
31
+  function toLoadIntention() {
32
+    const arr = [];
33
+    // 意向值
34
+    for (let i = 0; i < intentionData.length; i++) {
35
+      const a = [].concat(
36
+        intentionData.concat([
37
+          {
38
+            key: i,
39
+            name: `Edward King ${i}`,
40
+            age: 32,
41
+            address: `London, Park Lane no. ${i}`,
42
+          },
43
+        ]),
44
+      );
45
+      arr.push(a);
46
+    }
47
+    setIntentionData(arr);
48
+  }
49
+
50
+  // 查询
51
+  const { id } = props.location.query;
52
+  function getById(params) {
53
+    if (id === '' || id === undefined) {
54
+      return;
55
+    }
56
+    // eslint-disable-next-line max-len
57
+    request({
58
+      ...apis.customer.CustomerRecommendGet,
59
+      urlData: { id },
60
+      params: { ...params, pageNumber: 1, pageSize: 10 },
61
+    }).then(res => {
62
+      setData(res);
63
+      if (res.visitRecords) {
64
+        setTableDataData(res.visitRecords);
65
+      }
66
+      setDataonsultant(res.geoInfo);
67
+      setIntentionData(res.intentions);
68
+    });
69
+  }
70
+  // 分页
71
+  function onChange(number) {
72
+    if (id === '' || id === undefined) {
73
+      return;
74
+    }
75
+    // eslint-disable-next-line max-len
76
+    request({
77
+      ...apis.customer.CustomerRecommendGet,
78
+      urlData: { id },
79
+      params: { pageNumber: number, pageSize: 10 },
80
+    }).then(res => {
81
+      setData(res);
82
+      setTableDataData(res.visitRecords);
83
+      setDataonsultant(res.geoInfo);
84
+    });
85
+  }
86
+
87
+  function changBuilding(buildingId) {
88
+    setBuildingIdData(buildingId);
89
+    getById({ pageNumber: 1, pageSize: 10, buildingId: buildingId });
90
+  }
91
+
92
+  const columns = [
93
+    {
94
+      title: '访问事件',
95
+      dataIndex: 'activity',
96
+      key: 'activity',
97
+      align: 'center',
98
+    },
99
+    {
100
+      title: '访问内容',
101
+      dataIndex: 'activityName',
102
+      key: 'activityName',
103
+      align: 'center',
104
+    },
105
+    {
106
+      title: '访问时间',
107
+      dataIndex: 'visitTime',
108
+      key: 'visitTime',
109
+      align: 'center',
110
+      render: (_, record) => <span> {moment(record.visitTime).format('YYYY-MM-DD HH:mm:ss')}</span>,
111
+    },
112
+    {
113
+      title: '停留时间',
114
+      dataIndex: 'visitDuration',
115
+      key: 'visitDuration',
116
+      align: 'center',
117
+      render: (_, record) => (
118
+        <span>{record.visitDuration === null ? 0 : record.visitDuration}秒</span>
119
+      ),
120
+    },
121
+  ];
122
+  // 意向
123
+  const intention = [
124
+    {
125
+      title: <span styles={{ color: '#222', fontSize: '24px' }}>项目名称</span>,
126
+      dataIndex: 'name',
127
+      width: '64%',
128
+      render: (_, record) => <span>{record.buildingName}</span>,
129
+    },
130
+    {
131
+      title: <span styles={{ color: '#222', fontSize: '24px' }}>意向值</span>,
132
+      dataIndex: 'address',
133
+      render: (_, record) => <span>{record.intention}</span>,
134
+    },
135
+  ];
136
+  return (
137
+    <>
138
+      <div style={{ textAlign: 'right', marginBottom: '16px' }}>
139
+        <Button onClick={() => router.go(-1)}>返回</Button>
140
+      </div>
141
+
142
+      <div className={styles.cardBox}>
143
+        <div className={styles.rightBox}>
144
+          <p className={styles.tit}>客户信息</p>
145
+          <div className={styles.flexBox}>
146
+            <img className={styles.touxiang} src={data.picture && data.picture} />
147
+            <div className={styles.right}>
148
+              <p className={styles.rightItem}>用户名称:{data.name}</p>
149
+              <p className={styles.rightItem}>手机号码:{data.phone}</p>
150
+              <p className={styles.rightItem}>
151
+                首次访问时间:{data.visitTime && moment(data.visitTime).format('YYYY-MM-DD')}
152
+              </p>
153
+            </div>
154
+            <div className={styles.Centered}>
155
+              <p>访问时长:{data.duration}秒</p>
156
+              <p>访问次数:{data.visitTimes}次</p>
157
+              <p className={styles.rightItem}>客户描述:{data.describe}</p>
158
+              {/* <p>预约人数:{ data.visiteNum }</p> */}
159
+            </div>
160
+            <div className={styles.rightCentered}>
161
+              <p>需求类型:{data.demandType}</p>
162
+              <p>价格区间:{data.priceRange}</p>
163
+              <p>物业类型:{data.realtyManageType}</p>
164
+              {/* <p>预约人数:{ data.visiteNum }</p> */}
165
+            </div>
166
+            {/* <p className={styles.rightItem}>预约到访时间:{data.appointmentTime && moment(data.appointmentTime).format('YYYY-MM-DD') }</p> */}
167
+            <div className={styles.rightInfo}>
168
+              <p className={styles.rightItem}>国家:{dataConsultant && dataConsultant.country}</p>
169
+              <p className={styles.rightItem}>省份:{dataConsultant && dataConsultant.provience}</p>
170
+              <p className={styles.rightItem}>城市:{dataConsultant && dataConsultant.city}</p>
171
+              <p className={styles.rightItem}>
172
+                来源渠道:{data.personFrom ? data.personFrom : '其他'}
173
+              </p>
174
+              {/* <p className={styles.rightItem}>详细信息:</p> */}
175
+              {/* <p className={styles.rightItem}>意向项目:{data.intention }</p> */}
176
+              {/* <p className={styles.rightItem}>客户说明:{ data.verifyRemark }</p> */}
177
+            </div>
178
+          </div>
179
+        </div>
180
+      </div>
181
+      <br></br>
182
+      <div className={styles.cardBox}>
183
+        <div className={styles.rightBoxCentre}>
184
+          <p className={styles.tit}>置业顾问信息</p>
185
+          <div>
186
+            <img className={styles.touxiangphoto} src={data.consultant && data.consultant.photo} />
187
+            <p>{data.consultant && data.consultant.userName}</p>
188
+          </div>
189
+          <div className={styles.rightphone}>
190
+            {/* <p className={styles.infoItem}>姓名:{ data.consultant && data.consultant.name }</p>
191
+          <p className={styles.infoItem}>部门:{ data.consultant && data.consultant.department }</p> */}
192
+            <p className={styles.infoItem}>号码:{data.consultant && data.consultant.phone} </p>
193
+            <p className={styles.infoItem}>岗位:{data.consultant && data.consultant.position}</p>
194
+          </div>
195
+          <div className={styles.left}>
196
+            <p className={styles.infoItem}>公司:{data.consultant && data.consultant.orgName} </p>
197
+            <p className={styles.infoItem}>
198
+              所属项目:
199
+              {data.consultant && data.consultant.projects.map((item, _) => <span>{item}</span>)}
200
+            </p>
201
+          </div>
202
+        </div>
203
+        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
204
+        <div className={styles.leftBoxCentre}>
205
+          {/* <div className={styles.tit}>
206
+                <span>项目名称</span>
207
+                <span style={{ marginLeft: '50%' }}>意向值</span>
208
+          </div> */}
209
+          {/* <img className={styles.touxiang} src={ data.picture && data.picture } /> */}
210
+          {/* <div className={styles.infoItem}> */}
211
+          <Table
212
+            bordered={false}
213
+            columnWidth={10}
214
+            columns={intention}
215
+            dataSource={intentionData}
216
+            pagination={false}
217
+            scroll={intentionData && intentionData.length >= 3 ? { y: 240 } : false}
218
+            width={500}
219
+          />
220
+          {/* </div> */}
221
+        </div>
222
+      </div>
223
+      <div className={styles.recordBox}>
224
+        <p className={styles.tableName}>访问记录</p>
225
+        <BuildSelect onChange={changBuilding} value={buildingIdValue} />
226
+        <Table
227
+          dataSource={tableData.records}
228
+          columns={columns}
229
+          style={{ marginTop: '15px' }}
230
+          pagination={{ pageSize: 10, total: tableData.total, onChange }}
231
+        />
232
+        {/* <Pagination showQuickJumper defaultCurrent={1} total={data.records} onChange={e => changePageNum(e)} current={data.visitRecords.total}/> */}
233
+      </div>
234
+      <Prompt
235
+        message={location =>
236
+          location.pathname.startsWith('/customer/customerlist')
237
+            ? true
238
+            : (localStorage.removeItem('priPageParams'),
239
+              localStorage.removeItem('pubPageParams'),
240
+              localStorage.removeItem('state'))
241
+        }
242
+      />
243
+    </>
244
+  );
245
+}
246
+const WrappedHeader = Form.create({ name: 'header' })(CustomerDetail);
247
+
248
+export default WrappedHeader;

+ 98
- 0
src/pages/customer/Customer/PrivateCustomer/components/Attribution.jsx 查看文件

@@ -0,0 +1,98 @@
1
+import React from 'react';
2
+import { Button, Modal, notification } from 'antd';
3
+import request from '@/utils/request';
4
+import apis from '@/services/apis';
5
+import TableList from '@/components/TableList';
6
+
7
+const Attribution = props => {
8
+  console.log(props, 'props');
9
+
10
+  const { visible, data } = props.modelProps || {};
11
+
12
+  const openNotificationWithIcon = (type, message) => {
13
+    notification[type]({
14
+      message,
15
+      description: '',
16
+    });
17
+  };
18
+
19
+  // 提交
20
+  function submitGm(record) {
21
+    // 网路请求
22
+    request({
23
+      ...apis.customer.recommendEdit,
24
+      urlData: { id: data.customerId },
25
+      data: { customerId: data.customerId, realtyConsultant: record.userId },
26
+    })
27
+      .then(res => {
28
+        // eslint-disable-next-line no-unused-expressions
29
+        openNotificationWithIcon('success', '操作成功');
30
+        props.handleCancel();
31
+      })
32
+      .catch(err => {
33
+        // eslint-disable-next-line no-unused-expressions
34
+        openNotificationWithIcon('error', err);
35
+      });
36
+  }
37
+
38
+  const columns = [
39
+    {
40
+      title: '姓名',
41
+      dataIndex: 'userName',
42
+      key: 'userName',
43
+    },
44
+    {
45
+      title: '电话',
46
+      dataIndex: 'phone',
47
+      key: 'phone',
48
+    },
49
+    {
50
+      title: '部门',
51
+      dataIndex: 'department',
52
+      key: 'department',
53
+    },
54
+    {
55
+      title: '岗位',
56
+      dataIndex: 'position',
57
+      key: 'position',
58
+    },
59
+    {
60
+      title: '操作',
61
+      dataIndex: 'personId',
62
+      key: 'personId',
63
+      render: (_, record) => (
64
+        <>
65
+          {data.realtyConsultant != record.userId && (
66
+            <Button type="primary" onClick={() => submitGm(record)}>
67
+              确定
68
+            </Button>
69
+          )}
70
+        </>
71
+      ),
72
+    },
73
+  ];
74
+
75
+  return (
76
+    <>
77
+      <Modal
78
+        title="变更状态"
79
+        width={800}
80
+        destroyOnClose="true"
81
+        footer={null}
82
+        visible={visible}
83
+        onCancel={() => props.onCancel()}
84
+      >
85
+        {data && (
86
+          <TableList
87
+            rowKey="userId"
88
+            api={apis.customer.buildingConsultant}
89
+            params={{ buildingId: data.buildingId }}
90
+            columns={columns}
91
+          />
92
+        )}
93
+      </Modal>
94
+    </>
95
+  );
96
+};
97
+
98
+export default Attribution;

+ 0
- 75
src/pages/customer/Customer/PrivateCustomer/components/ChangeStatus.jsx 查看文件

@@ -75,78 +75,3 @@ const  submitButton = () => {
75 75
 };
76 76
 
77 77
 export default ChangeStatus;
78
-
79
-// class ChangeStatus extends React.Component {
80
-//   constructor(props) {
81
-//     super(props)
82
-//     this.state = {
83
-//       value: '',
84
-//       visibleData: { visible: false, customerId: '' },
85
-//     }
86
-//   }
87
-
88
-//   componentDidUpdate(preProps, preState) {
89
-//     if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
90
-//       this.setState({ visibleData: { ...this.props.visibleData } })
91
-//       this.setState({ value: this.props.visibleData.status })
92
-//     }
93
-//   }
94
-
95
-//   // 弹框取消按钮
96
-//   handleCancel() {
97
-//     this.props.onCancel()
98
-//   }
99
-
100
-//   onChange = e => {
101
-//     this.setState({
102
-//       value: e.target.value,
103
-//     });
104
-//   };
105
-
106
-//   openNotificationWithIcon = (type, message) => {
107
-//     notification[type]({
108
-//       message,
109
-//       description:
110
-//         '',
111
-//     });
112
-//   };
113
-
114
-//   submitButton = e => {
115
-//     // 网路请求
116
-//     request({ ...apis.customer.recommendEdit, urlData: { id: this.state.visibleData.customerId }, data: { customerId: this.state.visibleData.customerId, status: this.state.value } }).then(res => {
117
-//       // eslint-disable-next-line no-unused-expressions
118
-//       this.openNotificationWithIcon('success', '操作成功')
119
-//       this.handleCancel()
120
-//     }).catch(err => {
121
-//       // eslint-disable-next-line no-unused-expressions
122
-//       this.openNotificationWithIcon('error', err)
123
-//     })
124
-//   }
125
-
126
-//   render() {
127
-//     return (
128
-//       <>
129
-//           <Modal
130
-//             title="变更状态"
131
-//             width={800}
132
-//             // destroyOnClose="true"
133
-//             footer={null}
134
-//             visible={this.state.visibleData.visible}
135
-//             // onOk={() => this.handleOk()}
136
-//             onCancel={(e) => this.handleCancel(e)}
137
-//           >
138
-//             <Radio.Group onChange={this.onChange} value={this.state.value}>
139
-//               <Radio value={1}>客户报备</Radio>
140
-//               <Radio value={2}>客户到访</Radio>
141
-//               <Radio value={3}>客户认购</Radio>
142
-//               <Radio value={4}>客户签约</Radio>
143
-//             </Radio.Group>
144
-
145
-//             <Button type="danger" onClick={this.submitButton}>确定</Button>
146
-//           </Modal>
147
-//       </>
148
-//     )
149
-//   }
150
-// }
151
-
152
-// export default ChangeStatus

+ 149
- 0
src/pages/customer/Customer/PrivateCustomer/components/IntegralRecord.jsx 查看文件

@@ -0,0 +1,149 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Select, Card, Modal, notification, Table } 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
+/**
9
+ * 积分记录
10
+ *
11
+ * @param {*} props
12
+ * @returns
13
+ */
14
+const IntegralRecord = props => {
15
+  const { visible, data } = props.modelProps || {};
16
+
17
+  const [tableData, setTableData] = useState({});
18
+  const [totalPoints, setTotalPoints] = useState();
19
+const [loading,setLoading] = useState(false)
20
+  function getList(params) {
21
+    const { personId } = data || {};
22
+    if (personId === '' || personId === undefined) {
23
+      return;
24
+    }
25
+
26
+    console.log(personId, 'customerId');
27
+    // 网路请求
28
+    setLoading(true);
29
+    request({
30
+      ...apis.customer.taPointsRecords,
31
+      urlData: { id: personId },
32
+      params: { ...params },
33
+    })
34
+      .then(res => {
35
+        console.log(res, 'res');
36
+        setTableData(res.result);
37
+        setTotalPoints(res.totalPoints);
38
+        setLoading(false);
39
+      })
40
+      .catch(err => {
41
+        this.openNotificationWithIcon('error', err);
42
+        setLoading(false);
43
+      });
44
+  }
45
+
46
+  useEffect(() => {
47
+    if (visible) {
48
+      getList({ pageNumber: 1, pageSize: 5 });
49
+    }else{
50
+      setTableData({})
51
+    }
52
+  }, [visible]);
53
+
54
+  // 分页
55
+  function onChange(pageNum) {
56
+    this.getList({ pageNumber: pageNum, pageSize: 5 });
57
+  }
58
+
59
+  // 积分类型
60
+  function showChangeType(str) {
61
+    switch (str) {
62
+      case 'goods':
63
+        return '兑换商品';
64
+      case 'checkin':
65
+        return '签到';
66
+      case 'share-poster':
67
+        return '分享';
68
+      case 'signup-agent':
69
+        return '授权手机号';
70
+      case 'activity_checkin':
71
+        return '活动签到';
72
+      case 'document_verify':
73
+        return '资料审核';
74
+      case 'recommend-customer':
75
+        return '推荐客户';
76
+      case 'group':
77
+        return '拼团';
78
+      case 'recommend-customer':
79
+        return '推荐客户';
80
+      default:
81
+        return '未知类型';
82
+    }
83
+  }
84
+
85
+  // // 判断是否是 - 开头
86
+  // subPoints(points) {
87
+  //   const subStr = points.toString().substring(0, 1)
88
+  //   if (subStr === '-') {
89
+  //     return true
90
+  //   }
91
+  //   return false
92
+  // }
93
+
94
+  const columns = [
95
+    {
96
+      title: '序号',
97
+      dataIndex: 'index',
98
+      key: 'index',
99
+      render: (_text, _record, index) => <span>{index + 1}</span>,
100
+      // render: (text, record, index) => <span>{(this.state.dataSource.result.total - this.state.dataSource.result.records.length) * 1 + index + 1}</span>,
101
+    },
102
+    {
103
+      title: '积分类型',
104
+      dataIndex: 'changeType',
105
+      key: 'changeType',
106
+      render: (_, record) => <span>{showChangeType(record.changeType)}</span>,
107
+    },
108
+    {
109
+      title: '积分变化',
110
+      dataIndex: 'pointsAmount',
111
+      key: 'pointsAmount',
112
+      // render: (pointsAmount, record) => { <span style={this.subPoints(pointsAmount) && {color: 'red'}}>{ pointsAmount }</span> },
113
+    },
114
+    {
115
+      title: '发生时间',
116
+      dataIndex: 'createDate',
117
+      key: 'createDate',
118
+      render: (createDate) => <span> {moment(createDate).format('YYYY-MM-DD')}</span>,
119
+    },
120
+  ];
121
+  return (
122
+    <>
123
+      <Modal
124
+        title={'当前可用积分:' + (totalPoints || 0)}
125
+        width={800}
126
+        destroyOnClose="true"
127
+        footer={null}
128
+        visible={visible}
129
+        // onOk={() => this.handleOk()}
130
+        onCancel={() => props.onCancel()}
131
+      >
132
+        {data && (
133
+          <Table
134
+            dataSource={tableData.records}
135
+            columns={columns}
136
+            loading={loading}
137
+            pagination={{
138
+              pageSize: tableData.pageSize,
139
+              total: tableData.total,
140
+              onChange: e => onChange(e),
141
+            }}
142
+          />
143
+        )}
144
+      </Modal>
145
+    </>
146
+  );
147
+};
148
+
149
+export default IntegralRecord;

+ 285
- 0
src/pages/customer/Customer/PrivateCustomer/components/Recommend.jsx 查看文件

@@ -0,0 +1,285 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Table, Modal, notification } from 'antd';
3
+import moment from 'moment';
4
+import request from '@/utils/request';
5
+import apis from '@/services/apis';
6
+
7
+/**
8
+ * 推荐客户
9
+ *
10
+ * @param {*} props
11
+ * @returns
12
+ */
13
+
14
+const Recommend = props => {
15
+  const { visible, data } = props.modelProps || {};
16
+
17
+  const [tableData, setTableData] = useState({});
18
+  const [loading, setLoading] = useState(false);
19
+
20
+  const openNotificationWithIcon = (type, message) => {
21
+    notification[type]({
22
+      message,
23
+      description: '',
24
+    });
25
+  };
26
+
27
+  function getList(params) {
28
+    const { personId } = data || {};
29
+    if (personId === '' || personId === undefined) {
30
+      return;
31
+    }
32
+    // 网路请求
33
+    setLoading(true);
34
+    request({
35
+      ...apis.customer.recommendClient,
36
+      urlData: { id: personId },
37
+      params: { ...params },
38
+    })
39
+      .then(res => {
40
+        console.log(res, 'res');
41
+        setTableData(res);
42
+        setLoading(false);
43
+      })
44
+      .catch(err => {
45
+        this.openNotificationWithIcon('error', err);
46
+        setLoading(false);
47
+      });
48
+  }
49
+
50
+  useEffect(() => {
51
+    if (visible) {
52
+      getList({ pageNumber: 1, pageSize: 5 });
53
+    } else {
54
+      setTableData({});
55
+    }
56
+  }, [visible]);
57
+
58
+  // 分页
59
+  function onChange(pageNum) {
60
+    this.getList({ pageNumber: pageNum, pageSize: 5 });
61
+  }
62
+
63
+  const columns = [
64
+    {
65
+      title: '头像',
66
+      dataIndex: 'picture',
67
+      key: 'picture',
68
+      // eslint-disable-next-line jsx-a11y/alt-text
69
+      render: text => <img src={text} width={50} height={50} />,
70
+    },
71
+    {
72
+      title: '用户名',
73
+      dataIndex: 'name',
74
+      key: 'name',
75
+    },
76
+    {
77
+      title: '电话',
78
+      dataIndex: 'phone',
79
+      key: 'phone',
80
+    },
81
+    {
82
+      title: '性别',
83
+      dataIndex: 'sex',
84
+      key: 'sex',
85
+      render: text => <span>{text === 1 ? '男' : '女'}</span>,
86
+    },
87
+    {
88
+      title: '意向项目',
89
+      dataIndex: 'intention',
90
+      key: 'intention',
91
+    },
92
+    {
93
+      title: '推荐时间',
94
+      dataIndex: 'createDate',
95
+      key: 'createDate',
96
+      render: (_, record) => (
97
+        <>
98
+          <span>
99
+            {record.createDate && moment(record.createDate).format('YYYY-MM-DD HH:mm:ss')}
100
+          </span>
101
+        </>
102
+      ),
103
+    },
104
+    {
105
+      title: '状态',
106
+      dataIndex: 'state',
107
+      key: 'state',
108
+      // eslint-disable-next-line consistent-return
109
+      render: (_, records) => {
110
+        if (records.verifyStatus === 0) {
111
+          return '未审核';
112
+        }
113
+        if (records.verifyStatus === 1) {
114
+          if (records.reportRecommendStatus === 1) {
115
+            return '报备';
116
+          }
117
+          if (records.reportRecommendStatus === 2) {
118
+            return '推荐';
119
+          }
120
+        }
121
+        if (records.verifyStatus === 2) {
122
+          return '审核不通过';
123
+        }
124
+      },
125
+    },
126
+  ];
127
+
128
+  return (
129
+    <>
130
+      <Modal
131
+        title={'推荐客户'}
132
+        width={800}
133
+        destroyOnClose="true"
134
+        footer={null}
135
+        visible={visible}
136
+        // onOk={() => this.handleOk()}
137
+        onCancel={() => props.onCancel()}
138
+      >
139
+        {data && (
140
+          <Table
141
+            dataSource={tableData.records}
142
+            columns={columns}
143
+            loading={loading}
144
+            pagination={{
145
+              pageSize: tableData.pageSize,
146
+              total: tableData.total,
147
+              onChange: e => onChange(e),
148
+            }}
149
+          />
150
+        )}
151
+      </Modal>
152
+    </>
153
+  );
154
+};
155
+
156
+export default Recommend;
157
+
158
+// class ModalRecommendRecord extends React.Component {
159
+//   constructor(props) {
160
+//     super(props);
161
+//     this.state = {
162
+//        dataSource: [],
163
+//        visibleData: { visible: false, customerId: '' },
164
+//     }
165
+//   }
166
+
167
+//   // 挂载之后
168
+//   componentDidMount() {
169
+//     this.getList({ pageNumber: 1, pageSize: 5 })
170
+//   }
171
+
172
+//   componentDidUpdate(preProps, preState) {
173
+//     // console.log('this.props.visibleData', this.props.visibleData)
174
+//     if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
175
+//       this.getList({ pageNumber: 1, pageSize: 5 })
176
+//       this.setState({ visibleData: this.props.visibleData });
177
+//     }
178
+//   }
179
+
180
+//   // 弹框确定按钮
181
+//   // eslint-disable-next-line react/sort-comp
182
+//   handleOk() {
183
+//     this.props.onCancel()
184
+//   }
185
+
186
+//   // 弹框取消按钮
187
+//   handleCancel() {
188
+//     this.props.onCancel()
189
+//   }
190
+
191
+//   openNotificationWithIcon = (type, message) => {
192
+//     notification[type]({
193
+//       message,
194
+//       description:
195
+//         '',
196
+//     });
197
+//   }
198
+
199
+//   getList(params) {
200
+//     const { customerId } = this.state.visibleData
201
+//     if (customerId === '' || customerId === undefined) {
202
+//       return
203
+//     }
204
+//     console.log('customerId', customerId)
205
+//     // 网路请求
206
+//     // 网路请求
207
+//     request({ ...apis.customer.recommendClient, urlData: { id: customerId }, params: { ...params } }).then(res => {
208
+//       this.setState({ dataSource: res })
209
+//     }).catch(err => {
210
+//       this.openNotificationWithIcon('error', err)
211
+//     })
212
+//   }
213
+
214
+//    // 分页
215
+//   onChange(pageNum) {
216
+//     this.getList({ pageNumber: pageNum, pageSize: 5 })
217
+//   }
218
+
219
+//   render() {
220
+//     const columns = [
221
+//       {
222
+//         title: '头像',
223
+//         // eslint-disable-next-line jsx-a11y/alt-text
224
+//         render: (text, records) => <img src={records.picture} width={50} height={50} />,
225
+//       },
226
+//       {
227
+//         title: '用户名',
228
+//         dataIndex: 'name',
229
+//         key: 'name',
230
+//       },
231
+//       {
232
+//         title: '电话',
233
+//         dataIndex: 'phone',
234
+//         key: 'phone',
235
+//       },
236
+//       {
237
+//         title: '性别',
238
+//         dataIndex: 'sex',
239
+//         key: 'sex',
240
+//         render: (text, records) => <span>{records.sex === 1 ? '男' : '女'}</span>,
241
+//       },
242
+//       {
243
+//         title: '意向项目',
244
+//         dataIndex: 'intention',
245
+//         key: 'intention',
246
+//       },
247
+//       {
248
+//         title: '推荐时间',
249
+//         dataIndex: 'createDate',
250
+//         key: 'createDate',
251
+//         render: (_, record) => <><span>{ record.createDate && moment(record.createDate).format('YYYY-MM-DD HH:mm:ss') }</span></>,
252
+//       },
253
+//       {
254
+//         title: '状态',
255
+//         // eslint-disable-next-line consistent-return
256
+//         render: (text, records) => {
257
+//           if (records.verifyStatus === 0) { return '未审核' }
258
+//           if (records.verifyStatus === 1) {
259
+//             if (records.reportRecommendStatus === 1) { return '报备' }
260
+//             if (records.reportRecommendStatus === 2) { return '推荐' }
261
+//            }
262
+//           if (records.verifyStatus === 2) { return '审核不通过' }
263
+//         },
264
+//       },
265
+//     ]
266
+//     return (
267
+//       <>
268
+//         <Modal
269
+//             title="推荐客户"
270
+//             width={800}
271
+//             destroyOnClose="true"
272
+//             footer={null}
273
+//             visible={this.state.visibleData.visible}
274
+//             // onOk={() => this.handleOk()}
275
+//             onCancel={(e) => this.handleCancel(e)}
276
+//           >
277
+//             {console.log('this.state.dataSource11111111111', this.state.dataSource.total)}
278
+//             <Table dataSource={this.state.dataSource.records} rowKey="integralrecord" columns={columns} pagination={{ total: this.state.dataSource.total, pageSize: this.state.dataSource.size, onChange: e => this.onChange(e) }} />
279
+//           </Modal>
280
+//       </>
281
+//     );
282
+//   }
283
+// }
284
+
285
+// export default ModalRecommendRecord

+ 99
- 15
src/pages/customer/Customer/PrivateCustomer/index.jsx 查看文件

@@ -1,22 +1,30 @@
1 1
 import React, { useState, useMemo, useRef } from 'react';
2
-import { Avatar, Button } from 'antd';
2
+import { Avatar, Button, message } from 'antd';
3
+import router from 'umi/router';
3 4
 import QueryTable from '@/components/QueryTable';
4 5
 import apis from '@/services/apis';
6
+import request from '@/utils/request';
5 7
 import withActions from '@/components/ActionList';
6 8
 import AuthButton from '@/components/AuthButton';
7 9
 import Styles from '../style.less';
8 10
 import ChangeStatus from './components/ChangeStatus';
11
+import Attribution from './components/Attribution';
12
+import IntegralRecord from './components/IntegralRecord';
13
+import Recommend from './components/Recommend';
14
+import getSearchFields from './searchFields';
9 15
 
10 16
 const actionList = {
11 17
   changeStatus: 'changeStatus', // 变更状态
18
+  attribution: 'attribution', //调整归属
19
+  integralRecord: 'integralRecord', //积分记录
20
+  recommend: 'recommend', //推荐客户
12 21
 };
13 22
 
14 23
 const PrivateCustomer = () => {
15 24
   const ref = useRef();
16 25
 
17
-  const [showModel, SetShowModel] = useState({
18
-    // changeStatus: { visible: true, data: {} },
19
-  });
26
+  const [showModel, SetShowModel] = useState({});
27
+  const [exportLoding, setExportLoding] = useState(false);
20 28
 
21 29
   const handShowModel = (record, actionType) => {
22 30
     SetShowModel({
@@ -26,6 +34,16 @@ const PrivateCustomer = () => {
26 34
       },
27 35
     });
28 36
   };
37
+
38
+  function toCustomerDateil(record) {
39
+    router.push({
40
+      pathname: '/customer/customerlist/privateCustomerDetail',
41
+      query: {
42
+        id: record.customerId,
43
+      },
44
+    });
45
+  }
46
+
29 47
   const columns = useMemo(() => {
30 48
     return [
31 49
       {
@@ -135,6 +153,10 @@ const PrivateCustomer = () => {
135 153
         align: 'center',
136 154
         width: '20%',
137 155
         render: withActions((_, record) => [
156
+          <Button className={Styles.text} type="link" onClick={() => toCustomerDateil(record)}>
157
+            查看详情
158
+          </Button>,
159
+          // <EditIcon color="#FF4A4A" text="查看详情" onClick={() => toCustomerDateil(record)} />,
138 160
           <AuthButton name="admin.customer.recommend.edit.id.put" noRight={null}>
139 161
             <Button
140 162
               className={Styles.text}
@@ -146,13 +168,21 @@ const PrivateCustomer = () => {
146 168
           </AuthButton>,
147 169
 
148 170
           <AuthButton name="admin.customer.recommend.belong" noRight={null}>
149
-            <Button className={Styles.text} type="link" onClick={() => showGM(record)}>
171
+            <Button
172
+              className={Styles.text}
173
+              type="link"
174
+              onClick={() => handShowModel(record, actionList.attribution)}
175
+            >
150 176
               调整归属
151 177
             </Button>
152 178
           </AuthButton>,
153 179
 
154 180
           <AuthButton name="admin.mine.taPointsRecords.point.record" noRight={null}>
155
-            <Button className={Styles.text} type="link" onClick={() => showRecord(record)}>
181
+            <Button
182
+              className={Styles.text}
183
+              type="link"
184
+              onClick={() => handShowModel(record, actionList.integralRecord)}
185
+            >
156 186
               积分记录
157 187
             </Button>
158 188
           </AuthButton>,
@@ -161,7 +191,7 @@ const PrivateCustomer = () => {
161 191
             <Button
162 192
               className={Styles.text}
163 193
               type="link"
164
-              onClick={() => showRecommend(record.personId)}
194
+              onClick={() => handShowModel(record, actionList.recommend)}
165 195
             >
166 196
               推荐客户
167 197
             </Button>
@@ -171,19 +201,55 @@ const PrivateCustomer = () => {
171 201
     ];
172 202
   }, []);
173 203
 
174
-  const searchFields = [
175
-    {
176
-      name: 'name',
177
-      label: '姓名',
178
-      placeholder: '请输入姓名',
204
+  //导出
205
+  function exportCustomer() {
206
+    console.log(ref.current, 'ref');
207
+    setExportLoding(true);
208
+
209
+    request({
210
+      ...apis.customer.customerRecommendExport,
211
+      responseType: 'blob',
212
+      params: ref.current.getSearchData,
213
+    })
214
+      .then(response => {
215
+        download(response);
216
+        setExportLoding(false);
217
+      })
218
+      .catch(() => {
219
+        message.err('连接超时');
220
+        setExportLoding(false);
221
+      });
222
+  }
223
+
224
+  function download(data) {
225
+    if (!data) {
226
+      return;
179 227
     }
180
-  ];
228
+    const url = window.URL.createObjectURL(new Blob([data]));
229
+    const link = document.createElement('a');
230
+    link.style.display = 'none';
231
+    link.href = url;
232
+    link.setAttribute('download', '客户列表.xlsx');
233
+    document.body.append(link);
234
+    link.click();
235
+  }
236
+
237
+  const searchFields = useMemo(getSearchFields, []);
238
+
181 239
   //操作成功请求数据
182 240
   const handleCancel = () => {
183
-    SetShowModel({})
241
+    SetShowModel({});
184 242
     ref.current.reload();
185 243
   };
186 244
 
245
+  const actionRender = () => {
246
+    
247
+    return (
248
+      <Button type="danger" loading={exportLoding} onClick={() => exportCustomer()}>
249
+        导出
250
+      </Button>
251
+    );
252
+  };
187 253
   return (
188 254
     <>
189 255
       <QueryTable
@@ -195,7 +261,7 @@ const PrivateCustomer = () => {
195 261
           customerType: 'private',
196 262
         }}
197 263
         columns={columns}
198
-        //   actionRender={actionRender}
264
+        actionRender={actionRender}
199 265
         //   onPageChange={(pg) => setPage(pg)}
200 266
       />
201 267
 
@@ -204,6 +270,24 @@ const PrivateCustomer = () => {
204 270
         handleCancel={handleCancel}
205 271
         onCancel={() => SetShowModel({})}
206 272
       ></ChangeStatus>
273
+
274
+      <Attribution
275
+        modelProps={showModel[actionList.attribution]}
276
+        handleCancel={handleCancel}
277
+        onCancel={() => SetShowModel({})}
278
+      />
279
+
280
+      <IntegralRecord
281
+        modelProps={showModel[actionList.integralRecord]}
282
+        handleCancel={handleCancel}
283
+        onCancel={() => SetShowModel({})}
284
+      />
285
+
286
+      <Recommend
287
+        modelProps={showModel[actionList.recommend]}
288
+        handleCancel={handleCancel}
289
+        onCancel={() => SetShowModel({})}
290
+      />
207 291
     </>
208 292
   );
209 293
 };

+ 49
- 0
src/pages/customer/Customer/PrivateCustomer/searchFields.js 查看文件

@@ -0,0 +1,49 @@
1
+import WxDictSelect from '@/components/SelectButton/WxDictSelect'
2
+import BuildSelect from '@/components/SelectButton/BuildSelect'
3
+
4
+export default () => [
5
+  {
6
+    name: 'buildingId',
7
+    label: '项目',
8
+    placeholder: '请选择项目',
9
+    render: () => <BuildSelect style={{width: 160}} />
10
+  },
11
+  {
12
+    name: 'consultName',
13
+    label: '置业顾问',
14
+    placeholder: '请输入置业顾问',
15
+  },
16
+  {
17
+    name: 'consultTel',
18
+    label: '置业顾问电话',
19
+    placeholder: '请输入置业顾问电话',
20
+  },
21
+  {
22
+    name: 'status',
23
+    label: '状态',
24
+    placeholder: '请选择状态',
25
+    type: 'select',
26
+    options: [
27
+      {label: '报备', value: 1},
28
+      {label: '到访', value: 2},
29
+      {label: '认筹', value: 3},
30
+      {label: '签约', value: 4}
31
+    ]
32
+  },
33
+  {
34
+    name: 'name',
35
+    label: '姓名',
36
+    placeholder: '请输入姓名',
37
+  },
38
+  {
39
+    name: 'tel',
40
+    label: '电话',
41
+    placeholder: '请输入电话',
42
+  },
43
+  {
44
+    name: 'sceneType',
45
+    label: '用户来源',
46
+    // placeholder: '请选择城市',
47
+    render: () => <WxDictSelect style={{width: 160}} />
48
+  },
49
+]

+ 323
- 0
src/pages/customer/Customer/PublicCustomer/components/AssistConsultant.jsx 查看文件

@@ -0,0 +1,323 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Table, Modal, notification } from 'antd';
3
+import request from '@/utils/request';
4
+import apis from '@/services/apis';
5
+import BuildSelect from '../../../../../components/SelectButton/BuildSelect';
6
+
7
+/**
8
+ * 分配置业顾问
9
+ *
10
+ * @param {*} props
11
+ * @returns
12
+ */
13
+
14
+const AssistConsultant = props => {
15
+  const { visible, data } = props.modelProps || {};
16
+
17
+  const [tableData, setTableData] = useState({});
18
+  const [loading, setLoading] = useState(false);
19
+
20
+  const openNotificationWithIcon = (type, message) => {
21
+    notification[type]({
22
+      message,
23
+      description: '',
24
+    });
25
+  };
26
+
27
+  function getList(params) {
28
+    // 网路请求
29
+    setLoading(true);
30
+    request({
31
+      ...apis.customer.buildingConsultant,
32
+      params: { ...params },
33
+    })
34
+      .then(res => {
35
+        console.log(res, 'res');
36
+        setTableData(res);
37
+        setLoading(false);
38
+      })
39
+      .catch(err => {
40
+        openNotificationWithIcon('error', err);
41
+        setLoading(false);
42
+      });
43
+  }
44
+
45
+  useEffect(() => {
46
+    if (visible) {
47
+      getList({ pageNumber: 1, pageSize: 5 });
48
+    } else {
49
+      setTableData({});
50
+    }
51
+  }, [visible]);
52
+
53
+  // 分页
54
+  function onChange(pageNum) {
55
+    getList({ pageNumber: pageNum, pageSize: 5 });
56
+  }
57
+
58
+  function changBuilding(buildingId) {
59
+    if (buildingId) {
60
+      getList({ pageNumber: 1, pageSize: 5, buildingId: buildingId });
61
+    }
62
+  }
63
+
64
+  //   // 提交
65
+  function submitGm(record) {
66
+    // 网路请求
67
+    request({
68
+      ...apis.customer.consultantAssist,
69
+      urlData: { id: data.customerId },
70
+      data: { userId: record.userId, buildingId: data.buildingName || data.buildingId },
71
+    })
72
+      .then(res => {
73
+        // eslint-disable-next-line no-unused-expressions
74
+
75
+        openNotificationWithIcon('success', '操作成功');
76
+        props.handleCancel();
77
+      })
78
+      .catch(err => {
79
+        // eslint-disable-next-line no-unused-expressions
80
+      });
81
+  }
82
+
83
+  const columns = [
84
+    {
85
+      title: '姓名',
86
+      dataIndex: 'userName',
87
+      key: 'userName',
88
+    },
89
+    {
90
+      title: '电话',
91
+      dataIndex: 'phone',
92
+      key: 'phone',
93
+    },
94
+    {
95
+      title: '部门',
96
+      dataIndex: 'department',
97
+      key: 'department',
98
+    },
99
+    {
100
+      title: '岗位',
101
+      dataIndex: 'position',
102
+      key: 'position',
103
+    },
104
+    {
105
+      title: '操作',
106
+      dataIndex: 'personId',
107
+      key: 'personId',
108
+      // eslint-disable-next-line no-nested-ternary
109
+      render: (_, record) => (
110
+        <>
111
+          {
112
+            <Button type="danger" onClick={() => submitGm(record)}>
113
+              确定
114
+            </Button>
115
+          }
116
+        </>
117
+      ),
118
+    },
119
+  ];
120
+
121
+  return (
122
+    <>
123
+      <Modal
124
+        title={'分配置业顾问'}
125
+        width={800}
126
+        destroyOnClose="true"
127
+        footer={null}
128
+        visible={visible}
129
+        onCancel={() => props.onCancel()}
130
+      >
131
+        {/* <span>你正在为{this.props.visibleData.customerId.length}位公客分配置业顾问</span><br/><br/>
132
+            {this.props.visibleData.buildingId == null && <BuildSelect onChange={this.changBuilding.bind(this)} value={this.state.visibleData.buildingName} />} */}
133
+
134
+        {data && (
135
+          <>
136
+            {data.customerId?.length > 0 && (
137
+              <>
138
+                <span>你正在为{data.customerId.length}位公客分配置业顾问</span>
139
+                <br />
140
+                <br />
141
+              </>
142
+            )}
143
+            {data?.buildingId == null && (
144
+              <BuildSelect onChange={e => changBuilding(e)} value={data?.buildingName} />
145
+            )}
146
+            <Table
147
+              dataSource={tableData.records}
148
+              columns={columns}
149
+              loading={loading}
150
+              pagination={{
151
+                pageSize: tableData.pageSize,
152
+                total: tableData.total,
153
+                onChange: e => onChange(e),
154
+              }}
155
+            />
156
+          </>
157
+        )}
158
+      </Modal>
159
+    </>
160
+  );
161
+};
162
+
163
+export default AssistConsultant;
164
+
165
+// import React, { useState, useEffect } from 'react';
166
+// import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions, notification } from 'antd';
167
+// import moment from 'moment';
168
+// import request from '../../../../utils/request';
169
+// import apis from '../../../../services/apis';
170
+// import Styles from '../style.less';
171
+// import BuildSelect from '../../../../components/SelectButton/BuildSelect'
172
+
173
+// const { Option } = Select;
174
+// // eslint-disable-next-line @typescript-eslint/no-unused-vars
175
+// const { Meta } = Card;
176
+
177
+// /**
178
+//  * 分配置业顾问
179
+//  *
180
+//  * @param {*} props
181
+//  * @returns
182
+//  */
183
+// class ModalAttribution extends React.Component {
184
+//   constructor(props) {
185
+//     super(props);
186
+//     this.state = {
187
+//        dataSource: { records: [] },
188
+//        visibleData: { visible: false, customerId: '', buildingName: '' },
189
+//     }
190
+//   }
191
+
192
+//   // 挂载之后
193
+//   componentDidMount() {
194
+//     // this.getList({ pageNumber: 1, pageSize: 5 })
195
+//   }
196
+
197
+//   componentDidUpdate(preProps, preState) {
198
+//     console.log(this.props.visibleData)
199
+//     if (this.props.visibleData.visible !== preState.visibleData.visible) {
200
+//       this.getList({ pageNumber: 1, pageSize: 5, customerId: this.props.visibleData.customerId,buildingId:this.props.visibleData.buildingId })
201
+//       this.setState({ visibleData: this.props.visibleData });
202
+//     }
203
+//   }
204
+
205
+//   // 弹框确定按钮
206
+//   // eslint-disable-next-line react/sort-comp
207
+//   handleOk() {
208
+//     this.props.onCancel()
209
+//   }
210
+
211
+//   // 弹框取消按钮
212
+//   handleCancel() {
213
+//     this.props.onCancel()
214
+//   }
215
+
216
+//   changBuilding(buildingId){
217
+//     this.getUserList({ pageNumber: 1, pageSize: 5, buildingId: buildingId })
218
+//     this.setState({ visibleData: { visible: this.props.visibleData.visible, customerId: this.props.visibleData.customerId, buildingName: buildingId } });
219
+//   }
220
+
221
+//   getUserList(params){
222
+//     console.log('params: ', params)
223
+//     if (params.buildingId === '' || params.buildingId === null || params.buildingId === undefined) {
224
+//       return
225
+//     }
226
+//     // 网路请求
227
+//     request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
228
+//       this.setState({ dataSource: res })
229
+//     }).catch(err => {
230
+
231
+//     })
232
+//   }
233
+
234
+//   getList(params) {
235
+//     // 网路请求
236
+//     request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
237
+//       this.setState({ dataSource: res })
238
+//     }).catch(err => {
239
+
240
+//     })
241
+//   }
242
+
243
+//   openNotificationWithIcon = (type, message) => {
244
+//     notification[type]({
245
+//       message,
246
+//       description:
247
+//         '',
248
+//     });
249
+//   };
250
+
251
+//    // 分页
252
+//   onChange(pageNum) {
253
+//     this.getList({ pageNumber: pageNum, pageSize: 5, customerId: this.props.visibleData.customerId, buildingId: this.state.visibleData.buildingName ||this.props.visibleData.buildingId})
254
+//   }
255
+
256
+//   // 提交
257
+//   submitGm(record) {
258
+//     debugger
259
+//     // 网路请求
260
+//     request({ ...apis.customer.consultantAssist, urlData: { id: this.state.visibleData.customerId },
261
+//       data: { userId: record.userId,buildingId:this.state.visibleData.buildingName  || this.props.visibleData.buildingId } }).then(res => {
262
+//       // eslint-disable-next-line no-unused-expressions
263
+
264
+//       this.openNotificationWithIcon('success', '操作成功')
265
+//       this.handleCancel()
266
+//     }).catch(err => {
267
+//       // eslint-disable-next-line no-unused-expressions
268
+//     })
269
+//   }
270
+
271
+//   render() {
272
+//     const columns = [
273
+//       // {
274
+//       //   title: '编号',
275
+//       //   dataIndex: 'userId',
276
+//       //   key: 'userId',
277
+//       // },
278
+//       {
279
+//         title: '姓名',
280
+//         dataIndex: 'userName',
281
+//         key: 'userName',
282
+//       },
283
+//       {
284
+//         title: '电话',
285
+//         dataIndex: 'phone',
286
+//         key: 'phone',
287
+//       },
288
+//       {
289
+//         title: '部门',
290
+//         dataIndex: 'department',
291
+//         key: 'department',
292
+//       },
293
+//       {
294
+//         title: '岗位',
295
+//         dataIndex: 'position',
296
+//         key: 'position',
297
+//       },
298
+//       {
299
+//         title: '操作',
300
+//         dataIndex: 'personId',
301
+//         key: 'personId',
302
+//         // eslint-disable-next-line no-nested-ternary
303
+//         render: (_, record) => <>{ <Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>, },
304
+//     ]
305
+//     return (
306
+//       <>
307
+//         <Modal
308
+//             title="分配置业顾问"
309
+//             width={800}
310
+//             destroyOnClose="true"
311
+//             footer={null}
312
+//             visible={this.state.visibleData.visible}
313
+//             onCancel={(e) => this.handleCancel(e)}
314
+//           >
315
+//             {this.props.visibleData.buildingId == null && <BuildSelect  onChange={this.changBuilding.bind(this)} value={this.state.visibleData.buildingName} />}
316
+//             <Table rowKey="assistConsultant" dataSource={this.state.dataSource.records} columns={columns} pagination={{pageSize: 5, total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
317
+//           </Modal>
318
+//       </>
319
+//     );
320
+//   }
321
+// }
322
+
323
+// export default ModalAttribution

+ 98
- 0
src/pages/customer/Customer/PublicCustomer/components/Attribution.jsx 查看文件

@@ -0,0 +1,98 @@
1
+import React from 'react';
2
+import { Button, Modal, notification } from 'antd';
3
+import request from '@/utils/request';
4
+import apis from '@/services/apis';
5
+import TableList from '@/components/TableList';
6
+
7
+const Attribution = props => {
8
+  console.log(props, 'props');
9
+
10
+  const { visible, data } = props.modelProps || {};
11
+
12
+  const openNotificationWithIcon = (type, message) => {
13
+    notification[type]({
14
+      message,
15
+      description: '',
16
+    });
17
+  };
18
+
19
+  // 提交
20
+  function submitGm(record) {
21
+    // 网路请求
22
+    request({
23
+      ...apis.customer.recommendEdit,
24
+      urlData: { id: data.customerId },
25
+      data: { customerId: data.customerId, realtyConsultant: record.userId },
26
+    })
27
+      .then(res => {
28
+        // eslint-disable-next-line no-unused-expressions
29
+        openNotificationWithIcon('success', '操作成功');
30
+        props.handleCancel();
31
+      })
32
+      .catch(err => {
33
+        // eslint-disable-next-line no-unused-expressions
34
+        openNotificationWithIcon('error', err);
35
+      });
36
+  }
37
+
38
+  const columns = [
39
+    {
40
+      title: '姓名',
41
+      dataIndex: 'userName',
42
+      key: 'userName',
43
+    },
44
+    {
45
+      title: '电话',
46
+      dataIndex: 'phone',
47
+      key: 'phone',
48
+    },
49
+    {
50
+      title: '部门',
51
+      dataIndex: 'department',
52
+      key: 'department',
53
+    },
54
+    {
55
+      title: '岗位',
56
+      dataIndex: 'position',
57
+      key: 'position',
58
+    },
59
+    {
60
+      title: '操作',
61
+      dataIndex: 'personId',
62
+      key: 'personId',
63
+      render: (_, record) => (
64
+        <>
65
+          {data.realtyConsultant != record.userId && (
66
+            <Button type="primary" onClick={() => submitGm(record)}>
67
+              确定
68
+            </Button>
69
+          )}
70
+        </>
71
+      ),
72
+    },
73
+  ];
74
+
75
+  return (
76
+    <>
77
+      <Modal
78
+        title="变更状态"
79
+        width={800}
80
+        destroyOnClose="true"
81
+        footer={null}
82
+        visible={visible}
83
+        onCancel={() => props.onCancel()}
84
+      >
85
+        {data && (
86
+          <TableList
87
+            rowKey="userId"
88
+            api={apis.customer.buildingConsultant}
89
+            params={{ buildingId: data.buildingId }}
90
+            columns={columns}
91
+          />
92
+        )}
93
+      </Modal>
94
+    </>
95
+  );
96
+};
97
+
98
+export default Attribution;

+ 170
- 0
src/pages/customer/Customer/PublicCustomer/components/BatchAssistConsultant.jsx 查看文件

@@ -0,0 +1,170 @@
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
+import BuildSelect from '../../../../components/SelectButton/BuildSelect'
8
+
9
+
10
+const { Option } = Select;
11
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
12
+const { Meta } = Card;
13
+
14
+/**
15
+ * 分配置业顾问
16
+ *
17
+ * @param {*} props
18
+ * @returns
19
+ */
20
+class ModalAttribution extends React.Component {
21
+  constructor(props) {
22
+    super(props);
23
+    console.log(props, 'props')
24
+    this.state = {
25
+       dataSource: { records: [] },
26
+       visibleData: { visible: false, customerId: [], buildingName: '' },
27
+    }
28
+  }
29
+
30
+  // 挂载之后
31
+  componentDidMount() {
32
+    // this.getList({ pageNumber: 1, pageSize: 5 })
33
+  }
34
+
35
+  componentDidUpdate(preProps, preState) {
36
+    console.log(this.props.visibleData)
37
+    if (this.props.visibleData.visible !== preState.visibleData.visible) {
38
+      this.getList({ pageNumber: 1, pageSize: 5,buildingId: this.props.visibleData.buildingId})
39
+      this.setState({ visibleData: this.props.visibleData });
40
+    }
41
+  }
42
+
43
+  // 弹框确定按钮
44
+  // eslint-disable-next-line react/sort-comp
45
+  handleOk() {
46
+    this.props.onCancel()
47
+  }
48
+
49
+  // 弹框取消按钮
50
+  handleCancel() {
51
+    this.props.onCancel()
52
+  }
53
+
54
+  changBuilding(buildingId){
55
+    this.getUserList({ pageNumber: 1, pageSize: 5, buildingId: buildingId })
56
+    this.setState({ visibleData: { visible: this.props.visibleData.visible, customerId: this.props.visibleData.customerId, buildingName: buildingId } });
57
+  }
58
+
59
+  getUserList(params){
60
+    console.log('params: ', params)
61
+    if (params.buildingId === '' || params.buildingId === null || params.buildingId === undefined) {
62
+      return
63
+    }
64
+    // 网路请求
65
+    request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
66
+      this.setState({ dataSource: res })
67
+    }).catch(err => {
68
+      message.err(err)
69
+    })
70
+  }
71
+
72
+  getList(params) {
73
+    // 网路请求
74
+    console.log('params: ', params)
75
+    request({ ...apis.customer.buildingConsultant , params: { ...params }}).then(res => {
76
+      this.setState({ dataSource: res })
77
+    }).catch(err => {
78
+      
79
+    })
80
+  }
81
+
82
+  openNotificationWithIcon = (type, message) => {
83
+    notification[type]({
84
+      message,
85
+      description:
86
+        '',
87
+    });
88
+  };
89
+
90
+   // 分页
91
+  onChange(pageNum) {
92
+    this.getList({ pageNumber: pageNum, pageSize: 5, buildingId: this.state.visibleData.buildingName ||this.props.visibleData.buildingId})
93
+
94
+    // this.getUserList({ pageNumber: pageNum, pageSize: 5, buildingId: this.state.visibleData.buildingName })
95
+  }
96
+
97
+  // 提交
98
+  submitGm(record) {
99
+    // 网路请求
100
+    request({ ...apis.customer.batchConsultantAssist, data: { userId: record.userId
101
+      ,buildingId:this.state.visibleData.buildingName  || this.props.visibleData.buildingId
102
+      , customerIds: this.state.visibleData.customerId } }).then(res => {
103
+      // eslint-disable-next-line no-unused-expressions
104
+      debugger
105
+      if(res!= null && res.failNum > 0 ){
106
+        this.openNotificationWithIcon('success', '共'+res.totalNum+'条数据,失败操作'+res.failNum+'条')
107
+      }else{
108
+        this.openNotificationWithIcon('success', '操作成功')
109
+      }
110
+      this.handleCancel()
111
+    }).catch(err => {
112
+      // eslint-disable-next-line no-unused-expressions
113
+  
114
+    })
115
+  }
116
+
117
+  render() {
118
+    const columns = [
119
+      // {
120
+      //   title: '编号',
121
+      //   dataIndex: 'userId',
122
+      //   key: 'userId',
123
+      // },
124
+      {
125
+        title: '姓名',
126
+        dataIndex: 'userName',
127
+        key: 'userName',
128
+      },
129
+      {
130
+        title: '电话',
131
+        dataIndex: 'phone',
132
+        key: 'phone',
133
+      },
134
+      {
135
+        title: '部门',
136
+        dataIndex: 'department',
137
+        key: 'department',
138
+      },
139
+      {
140
+        title: '岗位',
141
+        dataIndex: 'position',
142
+        key: 'position',
143
+      },
144
+      {
145
+        title: '操作',
146
+        dataIndex: 'personId',
147
+        key: 'personId',
148
+        // eslint-disable-next-line no-nested-ternary
149
+        render: (_, record) => <>{ <Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>, },
150
+    ]
151
+    return (
152
+      <>
153
+        <Modal
154
+            title="分配置业顾问"
155
+            width={800}
156
+            destroyOnClose="true"
157
+            footer={null}
158
+            visible={this.state.visibleData.visible}
159
+            onCancel={(e) => this.handleCancel(e)}
160
+          >
161
+            <span>你正在为{this.props.visibleData.customerId.length}位公客分配置业顾问</span><br/><br/>
162
+            {this.props.visibleData.buildingId == null && <BuildSelect onChange={this.changBuilding.bind(this)} value={this.state.visibleData.buildingName} />}
163
+            <Table rowKey="BatchAssistConsultant" dataSource={this.state.dataSource.records} columns={columns} pagination={{pageSize: 5, total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
164
+          </Modal>
165
+      </>
166
+    );
167
+  }
168
+}
169
+
170
+export default ModalAttribution

+ 77
- 0
src/pages/customer/Customer/PublicCustomer/components/ChangeStatus.jsx 查看文件

@@ -0,0 +1,77 @@
1
+import React, { useState, useEffect } from 'react';
2
+import {
3
+  Button,
4
+  Radio,
5
+  Modal,
6
+  notification,
7
+} from 'antd';
8
+import request from '@/utils/request';
9
+import apis from '@/services/apis';
10
+
11
+const ChangeStatus = props => {
12
+  console.log(props, 'props');
13
+
14
+  const [value, setValue] = useState();
15
+
16
+  const { visible, data } = props.modelProps || {};
17
+
18
+  useEffect(() => {
19
+    console.log(data, 'data');
20
+    setValue(data?.status);
21
+  }, [data]);
22
+
23
+  const openNotificationWithIcon = (type, message) => {
24
+    notification[type]({
25
+      message,
26
+      description: '',
27
+    });
28
+  };
29
+
30
+const  submitButton = () => {
31
+    // 网路请求
32
+    request({
33
+      ...apis.customer.recommendEdit,
34
+      urlData: { id: data.customerId },
35
+      data: { customerId: data.customerId, status: value },
36
+    })
37
+      .then(() => {
38
+        // eslint-disable-next-line no-unused-expressions
39
+        openNotificationWithIcon('success', '操作成功');
40
+        props.handleCancel()
41
+      })
42
+      .catch(err => {
43
+        // eslint-disable-next-line no-unused-expressions
44
+        openNotificationWithIcon('error', err);
45
+      });
46
+  };
47
+
48
+  return (
49
+    <>
50
+      <Modal
51
+        title="变更状态"
52
+        width={800}
53
+        destroyOnClose="true"
54
+        footer={null}
55
+        visible={visible}
56
+        // onOk={() => this.handleOk()}
57
+        onCancel={() => props.onCancel()}
58
+      >
59
+        {data && (
60
+          <>
61
+            <Radio.Group value={value} onChange={e => setValue(e.target.value)}>
62
+              <Radio value={1}>客户报备</Radio>
63
+              <Radio value={2}>客户到访</Radio>
64
+              <Radio value={3}>客户认购</Radio>
65
+              <Radio value={4}>客户签约</Radio>
66
+            </Radio.Group>
67
+            <Button type="primary" onClick={submitButton}>
68
+              确定
69
+            </Button>
70
+          </>
71
+        )}
72
+      </Modal>
73
+    </>
74
+  );
75
+};
76
+
77
+export default ChangeStatus;

+ 140
- 0
src/pages/customer/Customer/PublicCustomer/components/IntegralRecord.jsx 查看文件

@@ -0,0 +1,140 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Select, Card, Modal, notification, Table } 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
+/**
9
+ * 积分记录
10
+ *
11
+ * @param {*} props
12
+ * @returns
13
+ */
14
+const IntegralRecord = props => {
15
+  const { visible, data } = props.modelProps || {};
16
+
17
+  const [tableData, setTableData] = useState({});
18
+  const [totalPoints, setTotalPoints] = useState();
19
+const [loading,setLoading] = useState(false)
20
+  function getList(params) {
21
+    const { personId } = data || {};
22
+    if (personId === '' || personId === undefined) {
23
+      return;
24
+    }
25
+
26
+    console.log(personId, 'customerId');
27
+    // 网路请求
28
+    setLoading(true);
29
+    request({
30
+      ...apis.customer.taPointsRecords,
31
+      urlData: { id: personId },
32
+      params: { ...params },
33
+    })
34
+      .then(res => {
35
+        console.log(res, 'res');
36
+        setTableData(res.result);
37
+        setTotalPoints(res.totalPoints);
38
+        setLoading(false);
39
+      })
40
+      .catch(err => {
41
+        this.openNotificationWithIcon('error', err);
42
+        setLoading(false);
43
+      });
44
+  }
45
+
46
+  useEffect(() => {
47
+    if (visible) {
48
+      getList({ pageNumber: 1, pageSize: 5 });
49
+    }else{
50
+      setTableData({})
51
+    }
52
+  }, [visible]);
53
+
54
+  // 分页
55
+  function onChange(pageNum) {
56
+    this.getList({ pageNumber: pageNum, pageSize: 5 });
57
+  }
58
+
59
+  // 积分类型
60
+  function showChangeType(str) {
61
+    switch (str) {
62
+      case 'goods':
63
+        return '兑换商品';
64
+      case 'checkin':
65
+        return '签到';
66
+      case 'share-poster':
67
+        return '分享';
68
+      case 'signup-agent':
69
+        return '授权手机号';
70
+      case 'activity_checkin':
71
+        return '活动签到';
72
+      case 'document_verify':
73
+        return '资料审核';
74
+      case 'recommend-customer':
75
+        return '推荐客户';
76
+      case 'group':
77
+        return '拼团';
78
+      case 'recommend-customer':
79
+        return '推荐客户';
80
+      default:
81
+        return '未知类型';
82
+    }
83
+  }
84
+
85
+
86
+
87
+  const columns = [
88
+    {
89
+      title: '序号',
90
+      dataIndex: 'index',
91
+      key: 'index',
92
+      render: (_text, _record, index) => <span>{index + 1}</span>,
93
+    },
94
+    {
95
+      title: '积分类型',
96
+      dataIndex: 'changeType',
97
+      key: 'changeType',
98
+      render: (_, record) => <span>{showChangeType(record.changeType)}</span>,
99
+    },
100
+    {
101
+      title: '积分变化',
102
+      dataIndex: 'pointsAmount',
103
+      key: 'pointsAmount',
104
+    },
105
+    {
106
+      title: '发生时间',
107
+      dataIndex: 'createDate',
108
+      key: 'createDate',
109
+      render: (createDate) => <span> {moment(createDate).format('YYYY-MM-DD')}</span>,
110
+    },
111
+  ];
112
+  return (
113
+    <>
114
+      <Modal
115
+        title={'当前可用积分:' + (totalPoints || 0)}
116
+        width={800}
117
+        destroyOnClose="true"
118
+        footer={null}
119
+        visible={visible}
120
+        // onOk={() => this.handleOk()}
121
+        onCancel={() => props.onCancel()}
122
+      >
123
+        {data && (
124
+          <Table
125
+            dataSource={tableData.records}
126
+            columns={columns}
127
+            loading={loading}
128
+            pagination={{
129
+              pageSize: tableData.pageSize,
130
+              total: tableData.total,
131
+              onChange: e => onChange(e),
132
+            }}
133
+          />
134
+        )}
135
+      </Modal>
136
+    </>
137
+  );
138
+};
139
+
140
+export default IntegralRecord;

+ 285
- 0
src/pages/customer/Customer/PublicCustomer/components/Recommend.jsx 查看文件

@@ -0,0 +1,285 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Table, Modal, notification } from 'antd';
3
+import moment from 'moment';
4
+import request from '@/utils/request';
5
+import apis from '@/services/apis';
6
+
7
+/**
8
+ * 推荐客户
9
+ *
10
+ * @param {*} props
11
+ * @returns
12
+ */
13
+
14
+const Recommend = props => {
15
+  const { visible, data } = props.modelProps || {};
16
+
17
+  const [tableData, setTableData] = useState({});
18
+  const [loading, setLoading] = useState(false);
19
+
20
+  const openNotificationWithIcon = (type, message) => {
21
+    notification[type]({
22
+      message,
23
+      description: '',
24
+    });
25
+  };
26
+
27
+  function getList(params) {
28
+    const { personId } = data || {};
29
+    if (personId === '' || personId === undefined) {
30
+      return;
31
+    }
32
+    // 网路请求
33
+    setLoading(true);
34
+    request({
35
+      ...apis.customer.recommendClient,
36
+      urlData: { id: personId },
37
+      params: { ...params },
38
+    })
39
+      .then(res => {
40
+        console.log(res, 'res');
41
+        setTableData(res);
42
+        setLoading(false);
43
+      })
44
+      .catch(err => {
45
+        this.openNotificationWithIcon('error', err);
46
+        setLoading(false);
47
+      });
48
+  }
49
+
50
+  useEffect(() => {
51
+    if (visible) {
52
+      getList({ pageNumber: 1, pageSize: 5 });
53
+    } else {
54
+      setTableData({});
55
+    }
56
+  }, [visible]);
57
+
58
+  // 分页
59
+  function onChange(pageNum) {
60
+    this.getList({ pageNumber: pageNum, pageSize: 5 });
61
+  }
62
+
63
+  const columns = [
64
+    {
65
+      title: '头像',
66
+      dataIndex: 'picture',
67
+      key: 'picture',
68
+      // eslint-disable-next-line jsx-a11y/alt-text
69
+      render: text => <img src={text} width={50} height={50} />,
70
+    },
71
+    {
72
+      title: '用户名',
73
+      dataIndex: 'name',
74
+      key: 'name',
75
+    },
76
+    {
77
+      title: '电话',
78
+      dataIndex: 'phone',
79
+      key: 'phone',
80
+    },
81
+    {
82
+      title: '性别',
83
+      dataIndex: 'sex',
84
+      key: 'sex',
85
+      render: text => <span>{text === 1 ? '男' : '女'}</span>,
86
+    },
87
+    {
88
+      title: '意向项目',
89
+      dataIndex: 'intention',
90
+      key: 'intention',
91
+    },
92
+    {
93
+      title: '推荐时间',
94
+      dataIndex: 'createDate',
95
+      key: 'createDate',
96
+      render: (_, record) => (
97
+        <>
98
+          <span>
99
+            {record.createDate && moment(record.createDate).format('YYYY-MM-DD HH:mm:ss')}
100
+          </span>
101
+        </>
102
+      ),
103
+    },
104
+    {
105
+      title: '状态',
106
+      dataIndex: 'state',
107
+      key: 'state',
108
+      // eslint-disable-next-line consistent-return
109
+      render: (_, records) => {
110
+        if (records.verifyStatus === 0) {
111
+          return '未审核';
112
+        }
113
+        if (records.verifyStatus === 1) {
114
+          if (records.reportRecommendStatus === 1) {
115
+            return '报备';
116
+          }
117
+          if (records.reportRecommendStatus === 2) {
118
+            return '推荐';
119
+          }
120
+        }
121
+        if (records.verifyStatus === 2) {
122
+          return '审核不通过';
123
+        }
124
+      },
125
+    },
126
+  ];
127
+
128
+  return (
129
+    <>
130
+      <Modal
131
+        title={'推荐客户'}
132
+        width={800}
133
+        destroyOnClose="true"
134
+        footer={null}
135
+        visible={visible}
136
+        // onOk={() => this.handleOk()}
137
+        onCancel={() => props.onCancel()}
138
+      >
139
+        {data && (
140
+          <Table
141
+            dataSource={tableData.records}
142
+            columns={columns}
143
+            loading={loading}
144
+            pagination={{
145
+              pageSize: tableData.pageSize,
146
+              total: tableData.total,
147
+              onChange: e => onChange(e),
148
+            }}
149
+          />
150
+        )}
151
+      </Modal>
152
+    </>
153
+  );
154
+};
155
+
156
+export default Recommend;
157
+
158
+// class ModalRecommendRecord extends React.Component {
159
+//   constructor(props) {
160
+//     super(props);
161
+//     this.state = {
162
+//        dataSource: [],
163
+//        visibleData: { visible: false, customerId: '' },
164
+//     }
165
+//   }
166
+
167
+//   // 挂载之后
168
+//   componentDidMount() {
169
+//     this.getList({ pageNumber: 1, pageSize: 5 })
170
+//   }
171
+
172
+//   componentDidUpdate(preProps, preState) {
173
+//     // console.log('this.props.visibleData', this.props.visibleData)
174
+//     if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
175
+//       this.getList({ pageNumber: 1, pageSize: 5 })
176
+//       this.setState({ visibleData: this.props.visibleData });
177
+//     }
178
+//   }
179
+
180
+//   // 弹框确定按钮
181
+//   // eslint-disable-next-line react/sort-comp
182
+//   handleOk() {
183
+//     this.props.onCancel()
184
+//   }
185
+
186
+//   // 弹框取消按钮
187
+//   handleCancel() {
188
+//     this.props.onCancel()
189
+//   }
190
+
191
+//   openNotificationWithIcon = (type, message) => {
192
+//     notification[type]({
193
+//       message,
194
+//       description:
195
+//         '',
196
+//     });
197
+//   }
198
+
199
+//   getList(params) {
200
+//     const { customerId } = this.state.visibleData
201
+//     if (customerId === '' || customerId === undefined) {
202
+//       return
203
+//     }
204
+//     console.log('customerId', customerId)
205
+//     // 网路请求
206
+//     // 网路请求
207
+//     request({ ...apis.customer.recommendClient, urlData: { id: customerId }, params: { ...params } }).then(res => {
208
+//       this.setState({ dataSource: res })
209
+//     }).catch(err => {
210
+//       this.openNotificationWithIcon('error', err)
211
+//     })
212
+//   }
213
+
214
+//    // 分页
215
+//   onChange(pageNum) {
216
+//     this.getList({ pageNumber: pageNum, pageSize: 5 })
217
+//   }
218
+
219
+//   render() {
220
+//     const columns = [
221
+//       {
222
+//         title: '头像',
223
+//         // eslint-disable-next-line jsx-a11y/alt-text
224
+//         render: (text, records) => <img src={records.picture} width={50} height={50} />,
225
+//       },
226
+//       {
227
+//         title: '用户名',
228
+//         dataIndex: 'name',
229
+//         key: 'name',
230
+//       },
231
+//       {
232
+//         title: '电话',
233
+//         dataIndex: 'phone',
234
+//         key: 'phone',
235
+//       },
236
+//       {
237
+//         title: '性别',
238
+//         dataIndex: 'sex',
239
+//         key: 'sex',
240
+//         render: (text, records) => <span>{records.sex === 1 ? '男' : '女'}</span>,
241
+//       },
242
+//       {
243
+//         title: '意向项目',
244
+//         dataIndex: 'intention',
245
+//         key: 'intention',
246
+//       },
247
+//       {
248
+//         title: '推荐时间',
249
+//         dataIndex: 'createDate',
250
+//         key: 'createDate',
251
+//         render: (_, record) => <><span>{ record.createDate && moment(record.createDate).format('YYYY-MM-DD HH:mm:ss') }</span></>,
252
+//       },
253
+//       {
254
+//         title: '状态',
255
+//         // eslint-disable-next-line consistent-return
256
+//         render: (text, records) => {
257
+//           if (records.verifyStatus === 0) { return '未审核' }
258
+//           if (records.verifyStatus === 1) {
259
+//             if (records.reportRecommendStatus === 1) { return '报备' }
260
+//             if (records.reportRecommendStatus === 2) { return '推荐' }
261
+//            }
262
+//           if (records.verifyStatus === 2) { return '审核不通过' }
263
+//         },
264
+//       },
265
+//     ]
266
+//     return (
267
+//       <>
268
+//         <Modal
269
+//             title="推荐客户"
270
+//             width={800}
271
+//             destroyOnClose="true"
272
+//             footer={null}
273
+//             visible={this.state.visibleData.visible}
274
+//             // onOk={() => this.handleOk()}
275
+//             onCancel={(e) => this.handleCancel(e)}
276
+//           >
277
+//             {console.log('this.state.dataSource11111111111', this.state.dataSource.total)}
278
+//             <Table dataSource={this.state.dataSource.records} rowKey="integralrecord" columns={columns} pagination={{ total: this.state.dataSource.total, pageSize: this.state.dataSource.size, onChange: e => this.onChange(e) }} />
279
+//           </Modal>
280
+//       </>
281
+//     );
282
+//   }
283
+// }
284
+
285
+// export default ModalRecommendRecord

+ 281
- 0
src/pages/customer/Customer/PublicCustomer/index.jsx 查看文件

@@ -0,0 +1,281 @@
1
+import React, { useState, useMemo, useRef } from 'react';
2
+import { Avatar, Button,message } from 'antd';
3
+import router from 'umi/router';
4
+import QueryTable from '@/components/QueryTable';
5
+import apis from '@/services/apis';
6
+import request from '@/utils/request';
7
+import withActions from '@/components/ActionList';
8
+import AuthButton from '@/components/AuthButton';
9
+import Styles from '../style.less';
10
+import IntegralRecord from './components/IntegralRecord';
11
+import Recommend from './components/Recommend';
12
+import AssistConsultant from './components/assistConsultant';
13
+import getSearchFields from './searchFields';
14
+
15
+const actionList = {
16
+  integralRecord: 'integralRecord', //积分记录
17
+  recommend: 'recommend', //推荐客户
18
+  assistConsultant: 'assistConsultant', //分配置业顾问
19
+};
20
+
21
+const PublicCustomer = () => {
22
+  const ref = useRef();
23
+
24
+  const [showModel, SetShowModel] = useState({
25
+    // changeStatus: { visible: true, data: {} },
26
+  });
27
+  const [exportLoding, setExportLoding] = useState(false);
28
+   // 选中的公客信息
29
+   const [personInfo, setPersonInfo] = useState([])
30
+
31
+   const [selectedRowKeys, setSelectedRowKeys] = useState([])
32
+
33
+  const handShowModel = (record, actionType) => {
34
+    SetShowModel({
35
+      [actionList[actionType]]: {
36
+        visible: true,
37
+        data: record,
38
+      },
39
+    });
40
+  };
41
+
42
+  function batchAssistConsultant() {
43
+    console.log(personInfo, 'personInfo')
44
+    console.log(personInfo.length)
45
+    if (personInfo.length <= 0) {
46
+      return message.info('请至少选择一条数据');
47
+    }
48
+
49
+    const compareSet = new Set();
50
+    personInfo.filter(record => {
51
+      compareSet.add(record.buildingName)
52
+    })
53
+
54
+    if (compareSet.size != 1) {
55
+      return message.info('选中的公客存在于不同项目中,请分开进行分配置业顾问操作');
56
+    }
57
+    handShowModel({
58
+      customerId: personInfo, buildingId: personInfo[0].buildingId
59
+    }, actionList.assistConsultant)
60
+    //   SetShowModel({
61
+    //     [actionList[actionType]]: {
62
+    //       visible: true,
63
+    //       data: record,
64
+    //     },
65
+    //   });
66
+    // };
67
+    // setBatchAssistVisibleData({ visible: true, customerId: personInfo, buildingId: personInfo[0].buildingId })
68
+  }
69
+
70
+  function toCustomerDateil(record) {
71
+    router.push({
72
+      pathname: '/customer/customerlist/privateCustomerDetail',
73
+      query: {
74
+        id: record.customerId,
75
+      },
76
+    });
77
+  }
78
+
79
+  //导出
80
+  function exportCustomer() {
81
+    console.log(ref.current, 'ref');
82
+    setExportLoding(true);
83
+
84
+    request({
85
+      ...apis.customer.customerRecommendExport,
86
+      responseType: 'blob',
87
+      params: ref.current.getSearchData,
88
+    })
89
+      .then(response => {
90
+        download(response);
91
+        setExportLoding(false);
92
+      })
93
+      .catch(() => {
94
+        message.err('连接超时');
95
+        setExportLoding(false);
96
+      });
97
+  }
98
+
99
+  function download(data) {
100
+    if (!data) {
101
+      return;
102
+    }
103
+    const url = window.URL.createObjectURL(new Blob([data]));
104
+    const link = document.createElement('a');
105
+    link.style.display = 'none';
106
+    link.href = url;
107
+    link.setAttribute('download', '客户列表.xlsx');
108
+    document.body.append(link);
109
+    link.click();
110
+  }
111
+
112
+  const columns = useMemo(() => {
113
+    return [
114
+      {
115
+        title: '头像',
116
+        dataIndex: 'picture',
117
+        key: 'picture',
118
+        align: 'center',
119
+        width: '10%',
120
+        render: (_, record) => (
121
+          <Avatar
122
+            shape="square"
123
+            style={{ color: 'blue' }}
124
+            src={record.picture}
125
+            size={64}
126
+            icon="user"
127
+          />
128
+        ),
129
+      },
130
+      {
131
+        title: '姓名',
132
+        dataIndex: 'name',
133
+        key: 'name',
134
+        align: 'center',
135
+        width: '20%',
136
+      },
137
+      {
138
+        title: '电话',
139
+        dataIndex: 'phone',
140
+        key: 'phone',
141
+        align: 'center',
142
+        width: '20%',
143
+      },
144
+      {
145
+        title: '性别',
146
+        dataIndex: 'sex',
147
+        key: 'sex',
148
+        align: 'center',
149
+        width: '10%',
150
+        // eslint-disable-next-line no-nested-ternary
151
+        render: (_, record) => (
152
+          <>
153
+            <span>{record.sex === 1 ? '男' : record.sex === 2 ? '女' : '未知'}</span>
154
+          </>
155
+        ),
156
+      },
157
+      {
158
+        title: '推广人员',
159
+        dataIndex: 'sharePersonName',
160
+        key: 'sharePersonName',
161
+        align: 'center',
162
+        width: '20%',
163
+      },
164
+      {
165
+        title: '操作',
166
+        dataIndex: 'customerId',
167
+        key: 'customerId',
168
+        align: 'center',
169
+       
170
+        render: withActions((_, record) => [
171
+          <AuthButton name="admin.mine.taPointsRecords.point.record" noRight={null}>
172
+            <Button
173
+              className={Styles.text}
174
+              type="link"
175
+              onClick={() => handShowModel(record, actionList.integralRecord)}
176
+            >
177
+              积分记录
178
+            </Button>
179
+          </AuthButton>,
180
+
181
+          <AuthButton name="admin.mine.taPointsRecords.id.get" noRight={null}>
182
+            <Button
183
+              className={Styles.text}
184
+              type="link"
185
+              onClick={() => handShowModel(record, actionList.recommend)}
186
+            >
187
+              推荐客户
188
+            </Button>
189
+          </AuthButton>,
190
+
191
+          <AuthButton name="admin.customer.assign" noRight={null}>
192
+            <Button
193
+              className={Styles.text}
194
+              type="link"
195
+              onClick={() => handShowModel(record, actionList.assistConsultant)}
196
+            >
197
+              分配置业顾问
198
+            </Button>
199
+          </AuthButton>,
200
+        ]),
201
+      },
202
+    ];
203
+  }, []);
204
+
205
+  const searchFields = useMemo(getSearchFields, []);
206
+
207
+  //操作成功请求数据
208
+  const handleCancel = () => {
209
+    SetShowModel({});
210
+    ref.current.reload();
211
+  };
212
+
213
+  const actionRender = () => {
214
+    return (
215
+      <>
216
+      <Button type="danger" loading={exportLoding} onClick={() => exportCustomer()}>
217
+          导出
218
+        </Button>
219
+        <AuthButton name="admin.customer.import" noRight={null}>
220
+          <Button
221
+            type="primary"
222
+            onClick={() => batchAssistConsultant()}
223
+            style={{ marginLeft: '20px' }}
224
+          >
225
+            批量分配置业顾问
226
+          </Button>
227
+        </AuthButton>
228
+        
229
+      </>
230
+    );
231
+  };
232
+
233
+  const rowSelection = {
234
+    selectedRowKeys,
235
+    onChange: (selectedRowKeys, selectedRows) => {
236
+      console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
237
+      setSelectedRowKeys(selectedRowKeys)
238
+      const newSelectedRows = personInfo.filter(x => !selectedRows.some(y => x.customerId === y.customerId))     // 去重
239
+        .concat(selectedRows)                                                                 // 新增选择
240
+        .filter(x => selectedRowKeys.some(y => y === x.customerId))                             // 去掉未选的数据
241
+      setPersonInfo(newSelectedRows)
242
+    },
243
+  };
244
+
245
+  return (
246
+    <>
247
+      <QueryTable
248
+        ref={ref}
249
+        rowSelection={rowSelection}
250
+        rowKey="customerId"
251
+        api={apis.customer.customerRecommend}
252
+        searchFields={searchFields}
253
+        params={{
254
+          customerType: 'public',
255
+        }}
256
+        columns={columns}
257
+        actionRender={actionRender}
258
+      />
259
+
260
+      <IntegralRecord
261
+        modelProps={showModel[actionList.integralRecord]}
262
+        handleCancel={handleCancel}
263
+        onCancel={() => SetShowModel({})}
264
+      />
265
+
266
+      <Recommend
267
+        modelProps={showModel[actionList.recommend]}
268
+        handleCancel={handleCancel}
269
+        onCancel={() => SetShowModel({})}
270
+      />
271
+
272
+      <AssistConsultant
273
+        modelProps={showModel[actionList.assistConsultant]}
274
+        handleCancel={handleCancel}
275
+        onCancel={() => SetShowModel({})}
276
+      />
277
+    </>
278
+  );
279
+};
280
+
281
+export default PublicCustomer;

+ 21
- 0
src/pages/customer/Customer/PublicCustomer/searchFields.js 查看文件

@@ -0,0 +1,21 @@
1
+import WxDictSelect from '@/components/SelectButton/WxDictSelect'
2
+
3
+export default () => [
4
+  {
5
+    name: 'name',
6
+    label: '用户名',
7
+    placeholder: '请输入用户名',
8
+  },
9
+  {
10
+    name: 'tel',
11
+    label: '电话',
12
+    placeholder: '请输入电话',
13
+  },
14
+  {
15
+    name: 'sceneType',
16
+    label: '用户来源',
17
+    // placeholder: '请选择城市',
18
+    render: () => <WxDictSelect style={{width: 160}} />
19
+  },
20
+]
21
+

+ 132
- 0
src/pages/customer/Customer/PublicCustomer/tableColumns.js 查看文件

@@ -0,0 +1,132 @@
1
+
2
+import { Avatar } from 'antd'
3
+import Navigate from '@/components/Navigate';
4
+
5
+export default () => [
6
+  {
7
+    title: '头像',
8
+    dataIndex: 'picture',
9
+    key: 'picture',
10
+    align: 'center',
11
+    width: '10%',
12
+    render: (_, record) => (
13
+      <Avatar
14
+        shape="square"
15
+        style={{ color: 'blue', cursor: 'pointer' }}
16
+        onClick={() => toCustomerDateil(record)}
17
+        src={record.picture}
18
+        size={64}
19
+        icon="user"
20
+      />
21
+    ),
22
+  },
23
+  {
24
+    title: '姓名',
25
+    dataIndex: 'name',
26
+    key: 'name',
27
+    align: 'center',
28
+    width: '10%',
29
+    // eslint-disable-next-line no-nested-ternary
30
+    render: (_, record) => (
31
+      <>
32
+        <Navigate onClick={() => toCustomerDateil(record)}>{record.name}</Navigate>
33
+      </>
34
+    ),
35
+  },
36
+  {
37
+    title: '电话',
38
+    dataIndex: 'phone',
39
+    key: 'phone',
40
+    align: 'center',
41
+    width: '10%',
42
+  },
43
+  {
44
+    title: '性别',
45
+    dataIndex: 'sex',
46
+    key: 'sex',
47
+    align: 'center',
48
+    width: '10%',
49
+    // eslint-disable-next-line no-nested-ternary
50
+    render: (_, record) => (
51
+      <>
52
+        <span>{record.sex === 1 ? '男' : record.sex === 2 ? '女' : '未知'}</span>
53
+      </>
54
+    ),
55
+  },
56
+  {
57
+    title: '置业顾问',
58
+    dataIndex: 'consultantName',
59
+    key: 'consultantName',
60
+    align: 'center',
61
+    width: '10%',
62
+    // eslint-disable-next-line no-nested-ternary
63
+    render: (_, record) => (
64
+      <>
65
+        <span>{record.consultantName}</span>
66
+        <br />
67
+        <span>{record.consultTel}</span>
68
+      </>
69
+    ),
70
+  },
71
+  {
72
+    title: '归属项目',
73
+    dataIndex: 'buildingName',
74
+    key: 'buildingName',
75
+    align: 'center',
76
+    width: '10%',
77
+  },
78
+  {
79
+    title: '推广人员',
80
+    dataIndex: 'sharePersonName',
81
+    key: 'sharePersonName',
82
+    align: 'center',
83
+    width: '10%',
84
+  },
85
+  {
86
+    title: '客户状态',
87
+    dataIndex: 'reportRecommendStatus',
88
+    key: 'reportRecommendStatus',
89
+    align: 'center',
90
+    width: '10%',
91
+    // eslint-disable-next-line no-nested-ternary
92
+    render: (text, records) => {
93
+      if (records.status === 1) {
94
+        return '报备';
95
+      }
96
+      if (records.status === 2) {
97
+        return '到访';
98
+      }
99
+      if (records.status === 3) {
100
+        return '认购';
101
+      }
102
+      if (records.status === 4) {
103
+        return '签约';
104
+      }
105
+    },
106
+  },
107
+  {
108
+    title: '操作',
109
+    dataIndex: 'customerId',
110
+    key: 'customerId',
111
+    align: 'center',
112
+    width: '20%',
113
+    //   render: withActions((text, record) => [
114
+    //     <EditIcon color="#FF4A4A" text="查看详情" onClick={() => toCustomerDateil(record)} />,
115
+    //     <AuthButton name="admin.customer.recommend.edit.id.put" noRight={null}>
116
+    //       <Button className={Styles.text} type="link" onClick={() => showStatus(record)}>变更状态</Button>
117
+    //     </AuthButton>,
118
+
119
+    //     <AuthButton name="admin.customer.recommend.belong" noRight={null}>
120
+    //       <Button className={Styles.text} type="link" onClick={() => showGM(record)}>调整归属</Button>
121
+    //     </AuthButton>,
122
+
123
+    //     <AuthButton name="admin.mine.taPointsRecords.point.record" noRight={null}>
124
+    //       <Button className={ Styles.text } type="link" onClick={() => showRecord(record)}>积分记录</Button>
125
+    //     </AuthButton>,
126
+
127
+    //     <AuthButton name="admin.mine.taPointsRecords.id.get" noRight={null}>
128
+    //       <Button className={ Styles.text} type="link" onClick={() => showRecommend(record.personId)}>推荐客户</Button>
129
+    //     </AuthButton>
130
+    //   ]),
131
+  },
132
+];

+ 17
- 5
src/pages/customer/Customer/index.jsx 查看文件

@@ -1,13 +1,25 @@
1 1
 import React, { useState } from 'react';
2
-import { Radio } from 'antd';
2
+import { Card, Radio, Tabs } from 'antd';
3 3
 import PrivateCustomer from './PrivateCustomer';
4
+import PublicCustomer from './PublicCustomer';
5
+
6
+const { TabPane } = Tabs;
4 7
 
5 8
 const Customer = () => {
6 9
   const [customerType, setCustomerType] = useState('private');
7 10
 
8 11
   return (
9
-    <>
10
-      <div style={{ margin: '20px 0' }}>
12
+    <Card>
13
+      <Tabs defaultActiveKey="private" type="card">
14
+        <TabPane tab="私客" key="1">
15
+          <PrivateCustomer></PrivateCustomer>
16
+        </TabPane>
17
+        <TabPane tab="公客" key="2">
18
+        <PublicCustomer></PublicCustomer>
19
+        </TabPane>
20
+      
21
+      </Tabs>
22
+      {/* <div style={{ margin: '20px 0' }}> 
11 23
         <Radio.Group
12 24
           value={customerType}
13 25
           onChange={e => {
@@ -21,8 +33,8 @@ const Customer = () => {
21 33
       </div>
22 34
       <div>
23 35
         <PrivateCustomer></PrivateCustomer>
24
-      </div>
25
-    </>
36
+      </div> */}
37
+    </Card>
26 38
   );
27 39
 };
28 40
 

+ 237
- 0
src/pages/customer/Recommend/audit.jsx 查看文件

@@ -0,0 +1,237 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Upload, message, notification } from 'antd';
3
+import ImageUpload from '../../../components/XForm/ImageUpload';
4
+import moment from 'moment';
5
+import request from '../../../utils/request';
6
+import apis from '../../../services/apis';
7
+import Styles from './style.less';
8
+import { router } from 'umi';
9
+
10
+import Attribution from './components/attribution'
11
+
12
+const { TextArea } = Input;
13
+
14
+const tailFormItemLayout = {
15
+  labelCol: {
16
+    xs: { span: 20 },
17
+    sm: { span: 3 },
18
+  },
19
+  wrapperCol: {
20
+    xs: { span: 20 },
21
+    sm: { span: 16 },
22
+  },
23
+};
24
+
25
+const openNotificationWithIcon = (type, message) => {
26
+  notification[type]({
27
+    message,
28
+    description:
29
+      '',
30
+  });
31
+}
32
+
33
+function body(props) {
34
+  const { getFieldDecorator } = props.form
35
+
36
+  // eslint-disable-next-line react-hooks/rules-of-hooks
37
+  const [visibleData, setVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
38
+
39
+  // eslint-disable-next-line react-hooks/rules-of-hooks
40
+  const [dataSource, setDataSource] = useState({ picture: '' })
41
+
42
+  const { id } = props.location.query;
43
+
44
+  if (id !== '') {
45
+    // eslint-disable-next-line react-hooks/rules-of-hooks
46
+    useEffect(() => {
47
+      getById(id)
48
+    }, [])
49
+  }
50
+
51
+  // 获取详情信息
52
+  function getById(currentId) {
53
+    request({ ...apis.customer.recommendGetById, urlData: { id: currentId } }).then(res => {
54
+      // res.reportDate = moment(res.reportDate)
55
+      if(res){
56
+        props.form.setFieldsValue({...res,reportDate:moment(res.reportDate)})
57
+      }
58
+    
59
+    })
60
+  }
61
+
62
+  function submitDate(params) {
63
+    // props.form.setFieldsValue(res)
64
+    console.log(params, 'params')
65
+    request({ ...apis.customer.auto, urlData: { id: params.customerId || props.form.getFieldValue('customerId') }, params: { verifyStatus: params.verifyStatus, realtyConsultant: props.form.getFieldValue('realtyConsultant') } }).then(() => {
66
+      // eslint-disable-next-line no-unused-expressions
67
+      openNotificationWithIcon('success', '操作成功')
68
+      router.go(-1)
69
+    }).catch(err => {
70
+      // eslint-disable-next-line no-unused-expressions
71
+
72
+    })
73
+  }
74
+
75
+  // 提交事件
76
+  function handleSubmit(e) {
77
+    e.preventDefault();
78
+    props.form.validateFields((err, values) => {
79
+      if (!err) {
80
+        submitDate({ verifyStatus: '1' })
81
+        // submitDate({ ...values })
82
+      }
83
+    });
84
+  }
85
+
86
+  // Change 事件
87
+  function handleSelectChange(e) {
88
+    // eslint-disable-next-line no-console
89
+    console.log(e)
90
+  }
91
+
92
+  // 显示选择置业顾问的窗口
93
+  function showConsultant() {
94
+    setVisibleData({ visible: true, customerId: props.form.getFieldValue('customerId'), realtyConsultant: props.form.getFieldValue('realtyConsultant'), buildingId: props.form.getFieldValue('buildingId') })
95
+  }
96
+
97
+  // 关闭选择置业顾问的窗口
98
+  function closeConsultant() {
99
+    setVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
100
+  }
101
+
102
+  // 选择置业顾问弹窗
103
+  function consultantSuccess(e) {
104
+    console.log(e)
105
+    props.form.setFieldsValue({ realtyConsultant: e.realtyConsultant, consultantName: e.name })
106
+  }
107
+
108
+  return (
109
+    <Card>
110
+      <Form {...tailFormItemLayout} onSubmit={e => handleSubmit(e)} style={{ width: '800px', margin: 'auto' }}>
111
+        <Form.Item label="客户ID" style={{ display: 'none' }}>
112
+          {getFieldDecorator('customerId')(
113
+            <Input
114
+              placeholder="客户ID"
115
+            />,
116
+          )}
117
+        </Form.Item>
118
+        <Form.Item label="项目ID" style={{ display: 'none' }}>
119
+          {getFieldDecorator('buildingId')(
120
+            <Input
121
+              placeholder="项目ID"
122
+            />,
123
+          )}
124
+        </Form.Item>
125
+        <Form.Item label="归属人" style={{ display: 'none' }}>
126
+          {getFieldDecorator('realtyConsultant')(
127
+            <Input
128
+              placeholder="归属人"
129
+            />,
130
+          )}
131
+        </Form.Item>
132
+        <Form.Item label="意向项目:">
133
+          {getFieldDecorator('intention')(
134
+            <Input
135
+              placeholder="意向项目"
136
+            />,
137
+          )}
138
+        </Form.Item>
139
+        <Form.Item label="客户照片">
140
+          {getFieldDecorator('picture')(
141
+            <ImageUpload value={dataSource.picture} />,
142
+          )}
143
+        </Form.Item>
144
+        <Form.Item label="客户姓名">
145
+          {getFieldDecorator('name')(
146
+            <Input placeholder="客户姓名" />,
147
+          )}
148
+        </Form.Item>
149
+        <Form.Item label="客户电话">
150
+          {getFieldDecorator('phone')(
151
+            <Input placeholder="客户电话" />,
152
+          )}
153
+        </Form.Item>
154
+        <Form.Item label="客户性别">
155
+          {getFieldDecorator('sex')(
156
+            <Radio.Group>
157
+              <Radio value={1}>男</Radio>
158
+              <Radio value={2}>女</Radio>
159
+            </Radio.Group>,
160
+          )}
161
+        </Form.Item>
162
+        <Form.Item label="到访人数">
163
+          {getFieldDecorator('visiteNum')(
164
+            <Input placeholder="到访人数" />,
165
+          )}
166
+        </Form.Item>
167
+        <Form.Item label="客户描述">
168
+          {getFieldDecorator('describe')(
169
+            <TextArea placeholder="客户描述" rows={10} />,
170
+          )}
171
+        </Form.Item>
172
+        <Form.Item label="物业类型">
173
+          {getFieldDecorator('realtyManageType')(
174
+            <Input placeholder="物业类型" />,
175
+          )}
176
+        </Form.Item>
177
+        <Form.Item label="需求类型">
178
+          {getFieldDecorator('demandType')(
179
+            <Input placeholder="需求类型" />,
180
+          )}
181
+        </Form.Item>
182
+        <Form.Item label="价格区间">
183
+          {getFieldDecorator('priceRange')(
184
+            <Input placeholder="价格区间" />,
185
+          )}
186
+        </Form.Item>
187
+        <Form.Item label="报备日期">
188
+          {getFieldDecorator('reportDate')(
189
+            <DatePicker showTime placeholder="报备日期" />,
190
+          )}
191
+        </Form.Item>
192
+        {/* <Form.Item label="状态">
193
+          {getFieldDecorator('verifyStatus')(
194
+            <Select style={{ width: '180px' }} placeholder="状态" onChange={handleSelectChange}>
195
+              <Option value={0}>未通过</Option>
196
+              <Option value={1}>已通过</Option>
197
+              <Option value={2}>已驳回</Option>
198
+            </Select>,
199
+          )}onClick={() => submitDate({ verifyStatus: '1' })}
200
+        </Form.Item> */}
201
+        <Form.Item label="归属置业顾问"
202
+      >
203
+          <Row gutter={8}>
204
+            <Col span={12}>
205
+              {getFieldDecorator('consultantName', {
206
+                rules: [
207
+                  {
208
+                    required: true,
209
+                    message: '请选择置业顾问',
210
+                  },
211
+                ],
212
+              })(<Input placeholder="请选择置业顾问" />)}
213
+            </Col>
214
+            <Col span={12}>
215
+              <Button onClick={() => showConsultant()}>选择</Button>
216
+            </Col>
217
+          </Row>
218
+        </Form.Item>
219
+        <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
220
+          <Button type="primary" className={Styles.SubmitButton} htmlType="submit" >
221
+            审核通过
222
+          </Button>
223
+          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
224
+          <Button onClick={() => submitDate({ verifyStatus: '2' })}>
225
+            驳回
226
+          </Button>
227
+        </Form.Item>
228
+      </Form>
229
+
230
+      {/* 选择置业顾问 */}
231
+      <Attribution visibleData={visibleData} onCancel={() => closeConsultant()} onSuccess={e => consultantSuccess(e)} />
232
+    </Card>
233
+  );
234
+}
235
+const WrappedBody = Form.create({ name: 'body' })(body);
236
+
237
+export default WrappedBody

+ 151
- 0
src/pages/customer/Recommend/components/attribution.jsx 查看文件

@@ -0,0 +1,151 @@
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
+
7
+
8
+
9
+const { Option } = Select;
10
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
11
+const { Meta } = Card;
12
+
13
+/**
14
+ * 调整归属
15
+ *
16
+ * @param {*} props
17
+ * @returns
18
+ */
19
+class ModalAttribution extends React.Component {
20
+  constructor(props) {
21
+    super(props);
22
+    this.state = {
23
+       dataSource: { records: [] },
24
+       visibleData: { visible: false, customerId: '', realtyConsultant: '', buildingId: '' },
25
+    }
26
+  }
27
+
28
+  // 挂载之后
29
+  componentDidMount() {
30
+    // this.getList({ pageNumber: 1, pageSize: 5 })
31
+  }
32
+
33
+  componentDidUpdate(preProps, preState) {
34
+    if (this.props.visibleData.visible !== preState.visibleData.visible) {
35
+      this.getList({ pageNumber: 1, pageSize: 5, buildingId: this.props.visibleData.buildingId })
36
+      this.setState({ visibleData: this.props.visibleData });
37
+    }
38
+  }
39
+
40
+  // 弹框确定按钮
41
+  // eslint-disable-next-line react/sort-comp
42
+  handleOk() {
43
+    this.props.onCancel()
44
+  }
45
+
46
+  // 弹框取消按钮
47
+  handleCancel() {
48
+    this.props.onCancel()
49
+  }
50
+
51
+  getList(params) {
52
+    if (params.buildingId === '' || params.buildingId === null || params.buildingId === undefined) {
53
+      return
54
+    }
55
+
56
+    // 网路请求
57
+    request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
58
+      this.setState({ dataSource: res })
59
+    }).catch(err => {
60
+      // eslint-disable-next-line no-unused-expressions
61
+
62
+    })
63
+  }
64
+
65
+  openNotificationWithIcon = (type, message) => {
66
+    notification[type]({
67
+      message,
68
+      description:
69
+        '',
70
+    });
71
+  };
72
+
73
+   // 分页
74
+  onChange(pageNum) {
75
+    this.getList({ pageNumber: pageNum, pageSize: 5, buildingId: this.props.visibleData.buildingId })
76
+  }
77
+
78
+  // 提交
79
+  submitGm(record) {
80
+
81
+    console.log('传递之前:', record)
82
+    this.handleCancel()
83
+    this.props.onSuccess({ realtyConsultant: record.userId, name: record.userName })
84
+
85
+
86
+    // // 网路请求
87
+    // request({ ...apis.customer.recommendEdit, urlData: { id: this.state.visibleData.customerId }, data: { customerId: this.state.visibleData.customerId, realtyConsultant: record.personId } }).then(res => {
88
+    //   // eslint-disable-next-line no-unused-expressions
89
+    //   this.openNotificationWithIcon('success', '操作成功')
90
+    //   this.handleCancel()
91
+    //   this.props.onSuccess({ realtyConsultant: record.personId, name: record.name })
92
+    // }).catch(err => {
93
+    //   // eslint-disable-next-line no-unused-expressions
94
+    //   // this.openNotificationWithIcon('error', err)
95
+    // })
96
+  }
97
+
98
+  render() {
99
+    const columns = [
100
+      // {
101
+      //   title: '编号',
102
+      //   dataIndex: 'personId',
103
+      //   key: 'personId',
104
+      // },
105
+      {
106
+        title: '姓名',
107
+        dataIndex: 'userName',
108
+        key: 'userName',
109
+      },
110
+      {
111
+        title: '电话',
112
+        dataIndex: 'phone',
113
+        key: 'phone',
114
+      },
115
+      {
116
+        title: '部门',
117
+        dataIndex: 'department',
118
+        key: 'department',
119
+      },
120
+      {
121
+        title: '岗位',
122
+        dataIndex: 'position',
123
+        key: 'position',
124
+      },
125
+      {
126
+        title: '操作',
127
+        dataIndex: 'personId',
128
+        key: 'personId',
129
+        // eslint-disable-next-line no-nested-ternary
130
+        render: (_, record) => <>{ this.props.visibleData.realtyConsultant !== record.userId && <Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>,
131
+      },
132
+    ]
133
+    return (
134
+      <>
135
+        <Modal
136
+            title="选择置业顾问"
137
+            width={800}
138
+            destroyOnClose="true"
139
+            footer={null}
140
+            visible={this.state.visibleData.visible}
141
+            // onOk={() => this.handleOk()}
142
+            onCancel={(e) => this.handleCancel(e)}
143
+          >
144
+            <Table rowKey="attribution" dataSource={this.state.dataSource.records} columns={columns} pagination={{ pageSize: 5,total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
145
+          </Modal>
146
+      </>
147
+    );
148
+  }
149
+}
150
+
151
+export default ModalAttribution

+ 187
- 0
src/pages/customer/Recommend/index.jsx 查看文件

@@ -0,0 +1,187 @@
1
+import React, { useState } from 'react';
2
+import {  Avatar, Button } from 'antd';
3
+import moment from 'moment';
4
+import request from '../../../utils/request';
5
+import apis from '../../../services/apis';
6
+import QueryTable from '@/components/QueryTable'
7
+import { router } from 'umi';
8
+import AuthButton from '@/components/AuthButton';
9
+import BuildingSelect from '@/components/SelectButton/BuildSelect';
10
+
11
+
12
+
13
+/**
14
+ *
15
+ *
16
+ * @param {*} props
17
+ * @returns
18
+ */
19
+function Recommend(props) {
20
+  const [exportLoding,setExportLoding] = useState(false)
21
+
22
+  function toAudit(cuurentId) {
23
+    router.push({
24
+      pathname: '/customer/recommend/audit',
25
+      query: {
26
+        id: cuurentId,
27
+      },
28
+    })
29
+  }
30
+
31
+
32
+  /**
33
+   *导出数据(推荐用户)
34
+   *
35
+   */
36
+  function exportRecommendCustomer() {
37
+    setExportLoding(true)
38
+    request({
39
+      ...apis.customer.customerRecommendRecommenderExport,
40
+      responseType: 'blob',
41
+    }).then(response => {
42
+      console.log('exportRecommendCustomer: ', response)
43
+      download(response)
44
+    }).catch(error => {
45
+
46
+    })
47
+  }
48
+
49
+  function download(data) {
50
+    if (!data) {
51
+      return
52
+    }
53
+    const url = window.URL.createObjectURL(new Blob([data]))
54
+    const link = document.createElement('a')
55
+    link.style.display = 'none'
56
+    link.href = url
57
+    link.setAttribute('download', '推荐客户.xlsx')
58
+    document.body.append(link)
59
+    link.click()
60
+    setExportLoding(false)
61
+  }
62
+
63
+  const columns = [
64
+    {
65
+      title: '头像',
66
+      dataIndex: 'picture',
67
+      key: 'picture',
68
+      render: (_, record) => <Avatar shape="square" src={record.picture} size={64} icon="user" />,
69
+    },
70
+    {
71
+      title: '姓名',
72
+      dataIndex: 'name',
73
+      key: 'name',
74
+    },
75
+    {
76
+      title: '电话',
77
+      dataIndex: 'phone',
78
+      key: 'phone',
79
+    },
80
+    {
81
+      title: '性别',
82
+      dataIndex: 'sex',
83
+      key: 'sex',
84
+      // eslint-disable-next-line no-nested-ternary
85
+      render: (_, record) => <><span>{record.sex === 1 ? '男' : record.sex === 2 ? '女' : '未知'}</span></>,
86
+    },
87
+    {
88
+      title: '意向项目',
89
+      dataIndex: 'intention',
90
+      key: 'intention',
91
+    },
92
+    {
93
+      title: '推荐人',
94
+      dataIndex: 'consultantName',
95
+      key: 'consultantName',
96
+      render: (_, record) => <><span>{(record.recommendName !== null ? record.recommendName : '') + " " + (record.recommendTel !== null ? record.recommendTel : '')}</span></>,
97
+    },
98
+    {
99
+      title: '推荐时间',
100
+      dataIndex: 'createDate',
101
+      key: 'createDate',
102
+      render: (_, record) => <><span>{record.createDate && moment(record.createDate).format('YYYY-MM-DD')}</span></>,
103
+    },
104
+    {
105
+      title: '状态',
106
+      dataIndex: 'verifyStatus',
107
+      key: 'verifyStatus',
108
+      render: (_, record) => <><span>{record.verifyStatus === 0 ? '待审核' : record.verifyStatus === 1 ? '已通过' : record.verifyStatus === 2 ? '已驳回' : ''}</span></>,
109
+    },
110
+    {
111
+      title: '操作',
112
+      dataIndex: 'customerId',
113
+      key: 'customerId',
114
+      render: (_, record) => (
115
+        <><span style={{ color: 'rgba(239,39,58,1)', cursor: 'pointer' }} onClick={() => toAudit(record.customerId)}>审核</span>
116
+          {/* {
117
+            <AuthButton name="admin.customer.recommend.verify.id.put" noRight={null}>
118
+              {record.verifyStatus === 0 ? <span style={{ color: 'rgba(239,39,58,1)', cursor: 'pointer' }} onClick={() => toAudit(record.customerId)}>审核</span> : ''}
119
+            </AuthButton>
120
+          } */}
121
+        </>
122
+      ),
123
+    },
124
+  ]
125
+
126
+  // const searchFields = [
127
+  //   {
128
+  //     name: 'sceneType',
129
+  //     label: '用户来源',
130
+  //     placeholder: '请选择用户来源',
131
+  //     render: () => <WxDictSelect style={{width: 160}} />
132
+  //   },
133
+  // ]
134
+ const searchFields=[
135
+     {
136
+      name: 'buildingId',
137
+      label: '用户来源',
138
+      placeholder: '请选择用户来源',
139
+      render: () => <BuildingSelect style={{width: 160}} />
140
+    },
141
+  {
142
+    name: 'name',
143
+    label: '姓名',
144
+    placeholder: '请输入姓名',
145
+  },
146
+  {
147
+    name: 'tel',
148
+    label: '电话',
149
+    placeholder: '请输入电话',
150
+  },
151
+  {
152
+    name: 'verifyStatus',
153
+    label: '状态',
154
+    placeholder: '请选择状态',
155
+    type: 'select',
156
+    options: [
157
+      {label: '未通过', value: 0},
158
+      {label: '已通过', value: 1},
159
+      {label: '已驳回', value: 2}
160
+    ]
161
+  },
162
+ ]
163
+
164
+ const actionRender = () => {
165
+    
166
+  return (
167
+    <Button type="danger" loading={exportLoding} onClick={() => exportRecommendCustomer()}>
168
+      导出
169
+    </Button>
170
+  );
171
+};
172
+
173
+  return (
174
+    <>
175
+      <QueryTable
176
+          rowKey="recommendCustomer"
177
+          api={apis.customer.recommender}
178
+          searchFields={searchFields}
179
+          columns={columns}
180
+          actionRender={actionRender}
181
+        />
182
+    
183
+    </>
184
+  );
185
+}
186
+
187
+export default Recommend

src/pages/customer/visiting/style.less → src/pages/customer/Recommend/style.less 查看文件


+ 24
- 76
src/pages/customer/drift/index.jsx 查看文件

@@ -1,78 +1,30 @@
1
-import React, { useState, useEffect } from 'react';
2
-import { Form, Table, Avatar, Alert, Select, Button } from 'antd';
3
-
4
-import request from '../../../utils/request';
1
+import React from 'react';
2
+import { Avatar } from 'antd';
5 3
 import apis from '../../../services/apis';
6
-import Styles from './style.less'
7 4
 import WxDictSelect from '@/components/SelectButton/WxDictSelect';
5
+import QueryTable from '@/components/QueryTable'
8 6
 
9 7
 function costomerDrift(props) {
10
-  const { getFieldDecorator } = props.form
11
-  // eslint-disable-next-line react-hooks/rules-of-hooks
12
-  const [dataSources, setDataSources] = useState({ records: [] })
13
-
14
-  // eslint-disable-next-line react-hooks/rules-of-hooks
15
-  useEffect(() => {
16
-   getList({ pageNumber: '1', pageSize: '10' })
17
-  }, [])
18
-
19
-  function getList(params) {
20
-    request({ ...apis.customer.drift, params: { ...params } }).then(res => {
21
-      setDataSources(res)
22
-    }).catch(err => {
23
-      // eslint-disable-next-line no-unused-expressions
24
-      <Alert
25
-        style={{
26
-          marginBottom: 24,
27
-        }}
28
-        message={err}
29
-        type="error"
30
-        showIcon
31
-      />
32
-    })
33
-  }
34
-
35
-  // 分页
36
-  function onChange(pageNum) {
37
-    // eslint-disable-next-line no-console
38
-    console.log('Page: ', pageNum);
39
-    getList({ pageNumber: pageNum, pageSize: 10 })
40
-  }
41
-
42
-  //重置搜索
43
-  function handleReset() {
44
-    props.form.resetFields();
45
-    getList({ pageNumber: '1', pageSize: '10' })
46
-  }
47
-
48
-  // 提交事件
49
-  function handleSubmit(e) {
50
-    e.preventDefault();
51
-    props.form.validateFields((err, values) => {
52
-      if (!err) {
53
-        console.log('提交数据: ', values)
54
-        const { startDate } = values
55
-        getList({ pageNum: 1, pageSize: 10, ...values })
56
-      }
57
-    });
58
-  }
59 8
 
60 9
   const columns = [
61 10
     {
62 11
       title: '头像',
63 12
       dataIndex: 'avatarurl',
64 13
       key: 'avatarurl',
14
+      align: 'center',
65 15
       render: (_, record) => <Avatar shape="square" src={record.avatarurl} size={64} icon="user" />,
66 16
     },
67 17
     {
68 18
       title: '姓名',
69 19
       dataIndex: 'nickname',
70 20
       key: 'nickname',
21
+      align: 'center',
71 22
     },
72 23
     {
73 24
       title: '性别',
74 25
       dataIndex: 'gender',
75 26
       key: 'gender',
27
+      align: 'center',
76 28
       // eslint-disable-next-line no-nested-ternary
77 29
       render: (_, record) => <><span>{ record.gender === '1' ? '男' : record.gender === '2' ? '女' : '未知' }</span></>,
78 30
     },
@@ -80,36 +32,32 @@ function costomerDrift(props) {
80 32
       title: '用户来源',
81 33
       dataIndex: 'sceneAlias',
82 34
       key: 'sceneAlias',
35
+      align: 'center',
83 36
       render: (_, record) => <><span>{ record.sceneAlias ? record.sceneAlias : '其他'}</span></>,
84 37
     },
85 38
   ];
86
-  
39
+
40
+ const searchFields = [
41
+  {
42
+    name: 'sceneType',
43
+    label: '用户来源',
44
+    placeholder: '请选择用户来源',
45
+    render: () => <WxDictSelect style={{width: 160}} />
46
+  },
47
+]
87 48
   return (
88 49
     <>
89
-      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
90
-        <Form.Item>
91
-          {getFieldDecorator('sceneType')(
92
-            <WxDictSelect />,
93
-          )}
94
-        </Form.Item>
50
+      <QueryTable
51
+          rowKey="personId"
52
+          api={apis.customer.drift}
53
+          searchFields={searchFields}
54
+          columns={columns}
55
+        />
95 56
 
96
-        <Form.Item>
97
-            {/* <AuthButton name="admin.customer.recommend.search" noRight={null}> */}
98
-            <Button type="primary" htmlType="submit" >
99
-              搜索
100
-            </Button>
101
-            {/* </AuthButton> */}
102
-            <Button style={{ marginLeft: 8 }} onClick={handleReset}>
103
-              重置
104
-            </Button>
105
-        </Form.Item>
106
-      </Form>
107
-      <Table style={{marginTop:'10px'}} dataSource={dataSources.records} rowKey="drift" columns={columns} pagination={{ total: dataSources.total, onChange }} />
108 57
     </>
109
-    // eslint-disable-next-line max-len
58
+    
110 59
     
111 60
   )
112 61
 }
113 62
 
114
-const WrappedBody = Form.create()(costomerDrift);
115
-export default WrappedBody
63
+export default costomerDrift

+ 0
- 173
src/pages/customer/visiting/index.jsx 查看文件

@@ -1,173 +0,0 @@
1
-import React, { useState, useEffect } from 'react';
2
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar } 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 BuildSelect from '../../../components/SelectButton/BuildSelect'
8
-import AuthButton from '@/components/AuthButton';
9
-
10
-const columns = [
11
-  {
12
-    title: '头像',
13
-    dataIndex: 'picture',
14
-    key: 'picture',
15
-    align: 'center',
16
-    width: '15%',
17
-    render: (_, record) => <Avatar shape="square"  size={64} icon="user" />,
18
-  },
19
-  {
20
-    title: '姓名',
21
-    dataIndex: 'name',
22
-    key: 'name',
23
-    align: 'center',
24
-    width: '10%',
25
-    // eslint-disable-next-line no-nested-ternary
26
-    // render: (_, record) => <><span>{customerType === 'private' ? record.name : record.nickname}</span></>,
27
-  },
28
-  {
29
-    title: '电话',
30
-    dataIndex: 'phone',
31
-    key: 'phone',
32
-    align: 'center',
33
-    width: '15%',
34
-  },
35
-  {
36
-    title: '性别',
37
-    dataIndex: 'sex',
38
-    key: 'sex',
39
-    align: 'center',
40
-    width: '15%',
41
-  },
42
-  {
43
-    title: '置业顾问',
44
-    dataIndex: 'asdf',
45
-    key: 'asdf',
46
-    align: 'center',
47
-    width: '15%',
48
-  },
49
-  {
50
-    title: '置业顾问电话',
51
-    dataIndex: 'tel',
52
-    key: 'tel',
53
-    align: 'center',
54
-    width: '15%',
55
-  },
56
-  {
57
-    title: '到访时间',
58
-    dataIndex: 'time',
59
-    key: 'time',
60
-    align: 'center',
61
-    width: '15%',
62
-  },
63
-]
64
-
65
-const data = [
66
-
67
-]
68
-
69
-function onChangetime(dates, dateStrings) {
70
- 
71
-  // setEndDate(dateStrings[1])
72
-  // setStartDate(dateStrings[0])
73
-  
74
-}
75
-
76
-function exportReport() {
77
-  // request({ ...apis.customer.customerRecommendReportExport, responseType: 'blob' })
78
-  //   .then(response => {
79
-  //     download(response)
80
-  //   })
81
-}
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
-function body (props) {
90
-  const { getFieldDecorator, getFieldsValue } = props.form
91
-  const { RangePicker } = DatePicker;
92
-
93
-  function handleReset() {
94
-    props.form.resetFields();
95
-    // getList({ pageNumber: 1, pageSize: 10, customerType })
96
-  }
97
-
98
-  function handleSubmit(e) {
99
- 
100
-  }
101
-
102
-  // 分页
103
-  function onChange(pageNum) {
104
-    props.form.validateFields((err, values) => {
105
-      if (!err) {
106
-        getList({ pageNumber: pageNum, pageSize: 5, ...values })
107
-      }
108
-    });
109
-    // getList({ pageNumber: pageNum, pageSize: 9 })
110
-  }
111
-
112
-  return (
113
-    <>
114
-    <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
115
-       <Form.Item>
116
-          {getFieldDecorator('buildingId')(
117
-            <BuildSelect />,
118
-          )}
119
-        </Form.Item>
120
-       
121
-        <Form.Item>
122
-          {getFieldDecorator('name')(
123
-            <Input
124
-              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
125
-              placeholder="姓名"
126
-            />,
127
-          )}
128
-        </Form.Item>
129
-        <Form.Item>
130
-          {getFieldDecorator('tel')(
131
-            <Input
132
-              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
133
-              placeholder="电话"
134
-            />,
135
-          )}
136
-        </Form.Item>
137
-        
138
-         <Form.Item label="到访时间">
139
-          { getFieldDecorator('time')(
140
-            <RangePicker
141
-            style={{ width: '400px' }}
142
-            // placeholder="到访时间"
143
-            // ranges={{
144
-            //   Today: [moment(), moment()],
145
-            //   'This Month': [moment().startOf('month'), moment().endOf('month')],
146
-            // }}
147
-            // defaultValue={[moment(new Date(new Date().setDate((new Date().getDate() - 6))), 'YYYY-MM-DD HH:MM:SS'), moment(new Date(), 'YYYY-MM-DD HH:MM:SS')]}
148
-            showTime
149
-            onChange={onChangetime}
150
-          />
151
-          )}
152
-        </Form.Item>
153
-        <Form.Item>
154
-            <Button type="primary" htmlType="submit" >
155
-              搜索
156
-            </Button>
157
-            <Button style={{ marginLeft: 8 }} onClick={handleReset}>
158
-              重置
159
-            </Button>
160
-        </Form.Item>
161
-      </Form>
162
-      <Button type="primary" onClick={() => exportReport()} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
163
-        导出
164
-      </Button>
165
-
166
-      <Table dataSource={data} columns={columns} pagination={{ total: data.total, onChange }} />
167
-      {/* pagination={{ total: dataSource.total, onChange }} */}
168
-    </>
169
-  );
170
-}
171
-const WrappedBody = Form.create({ name: 'body' })(body);
172
-
173
-export default WrappedBody

+ 238
- 0
src/pages/recommend/recommendCustomer/audit.jsx 查看文件

@@ -0,0 +1,238 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Upload, message, notification } from 'antd';
3
+import ImageUpload from '../../../components/XForm/ImageUpload';
4
+import moment from 'moment';
5
+import request from '../../../utils/request';
6
+import apis from '../../../services/apis';
7
+import Styles from './style.less';
8
+import { router } from 'umi';
9
+
10
+import Attribution from './components/attribution'
11
+
12
+const { Option } = Select;
13
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
14
+const { Meta } = Card;
15
+
16
+const { TextArea } = Input;
17
+
18
+const tailFormItemLayout = {
19
+  labelCol: {
20
+    xs: { span: 20 },
21
+    sm: { span: 3 },
22
+  },
23
+  wrapperCol: {
24
+    xs: { span: 20 },
25
+    sm: { span: 16 },
26
+  },
27
+};
28
+
29
+const openNotificationWithIcon = (type, message) => {
30
+  notification[type]({
31
+    message,
32
+    description:
33
+      '',
34
+  });
35
+}
36
+
37
+function body(props) {
38
+  const { getFieldDecorator } = props.form
39
+
40
+  // eslint-disable-next-line react-hooks/rules-of-hooks
41
+  const [visibleData, setVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
42
+
43
+  // eslint-disable-next-line react-hooks/rules-of-hooks
44
+  const [dataSource, setDataSource] = useState({ picture: '' })
45
+
46
+  const { id } = props.location.query;
47
+
48
+  if (id !== '') {
49
+    // eslint-disable-next-line react-hooks/rules-of-hooks
50
+    useEffect(() => {
51
+      getById(id)
52
+    }, [])
53
+  }
54
+
55
+  // 获取详情信息
56
+  function getById(currentId) {
57
+    request({ ...apis.customer.recommendGetById, urlData: { id: currentId } }).then(res => {
58
+      res.reportDate = moment(res.reportDate)
59
+      props.form.setFieldsValue(res)
60
+    })
61
+  }
62
+
63
+  function submitDate(params) {
64
+    // props.form.setFieldsValue(res)
65
+    console.log(params, 'params')
66
+    request({ ...apis.customer.auto, urlData: { id: params.customerId || props.form.getFieldValue('customerId') }, params: { verifyStatus: params.verifyStatus, realtyConsultant: props.form.getFieldValue('realtyConsultant') } }).then(() => {
67
+      // eslint-disable-next-line no-unused-expressions
68
+      openNotificationWithIcon('success', '操作成功')
69
+      router.go(-1)
70
+    }).catch(err => {
71
+      // eslint-disable-next-line no-unused-expressions
72
+
73
+    })
74
+  }
75
+
76
+  // 提交事件
77
+  function handleSubmit(e) {
78
+    e.preventDefault();
79
+    props.form.validateFields((err, values) => {
80
+      if (!err) {
81
+        submitDate({ verifyStatus: '1' })
82
+        // submitDate({ ...values })
83
+      }
84
+    });
85
+  }
86
+
87
+  // Change 事件
88
+  function handleSelectChange(e) {
89
+    // eslint-disable-next-line no-console
90
+    console.log(e)
91
+  }
92
+
93
+  // 显示选择置业顾问的窗口
94
+  function showConsultant() {
95
+    setVisibleData({ visible: true, customerId: props.form.getFieldValue('customerId'), realtyConsultant: props.form.getFieldValue('realtyConsultant'), buildingId: props.form.getFieldValue('buildingId') })
96
+  }
97
+
98
+  // 关闭选择置业顾问的窗口
99
+  function closeConsultant() {
100
+    setVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
101
+  }
102
+
103
+  // 选择置业顾问弹窗
104
+  function consultantSuccess(e) {
105
+    console.log(e)
106
+    props.form.setFieldsValue({ realtyConsultant: e.realtyConsultant, consultantName: e.name })
107
+  }
108
+
109
+  return (
110
+    <>
111
+      <Form {...tailFormItemLayout} onSubmit={e => handleSubmit(e)} style={{ width: '800px', margin: 'auto' }}>
112
+        <Form.Item label="客户ID" style={{ display: 'none' }}>
113
+          {getFieldDecorator('customerId')(
114
+            <Input
115
+              placeholder="客户ID"
116
+            />,
117
+          )}
118
+        </Form.Item>
119
+        <Form.Item label="项目ID" style={{ display: 'none' }}>
120
+          {getFieldDecorator('buildingId')(
121
+            <Input
122
+              placeholder="项目ID"
123
+            />,
124
+          )}
125
+        </Form.Item>
126
+        <Form.Item label="归属人" style={{ display: 'none' }}>
127
+          {getFieldDecorator('realtyConsultant')(
128
+            <Input
129
+              placeholder="归属人"
130
+            />,
131
+          )}
132
+        </Form.Item>
133
+        <Form.Item label="意向项目:">
134
+          {getFieldDecorator('intention')(
135
+            <Input
136
+              placeholder="意向项目"
137
+            />,
138
+          )}
139
+        </Form.Item>
140
+        <Form.Item label="客户照片">
141
+          {getFieldDecorator('picture')(
142
+            <ImageUpload value={dataSource.picture} />,
143
+          )}
144
+        </Form.Item>
145
+        <Form.Item label="客户姓名">
146
+          {getFieldDecorator('name')(
147
+            <Input placeholder="客户姓名" />,
148
+          )}
149
+        </Form.Item>
150
+        <Form.Item label="客户电话">
151
+          {getFieldDecorator('phone')(
152
+            <Input placeholder="客户电话" />,
153
+          )}
154
+        </Form.Item>
155
+        <Form.Item label="客户性别">
156
+          {getFieldDecorator('sex')(
157
+            <Radio.Group>
158
+              <Radio value={1}>男</Radio>
159
+              <Radio value={2}>女</Radio>
160
+            </Radio.Group>,
161
+          )}
162
+        </Form.Item>
163
+        <Form.Item label="到访人数">
164
+          {getFieldDecorator('visiteNum')(
165
+            <Input placeholder="到访人数" />,
166
+          )}
167
+        </Form.Item>
168
+        <Form.Item label="客户描述">
169
+          {getFieldDecorator('describe')(
170
+            <TextArea placeholder="客户描述" rows={10} />,
171
+          )}
172
+        </Form.Item>
173
+        <Form.Item label="物业类型">
174
+          {getFieldDecorator('realtyManageType')(
175
+            <Input placeholder="物业类型" />,
176
+          )}
177
+        </Form.Item>
178
+        <Form.Item label="需求类型">
179
+          {getFieldDecorator('demandType')(
180
+            <Input placeholder="需求类型" />,
181
+          )}
182
+        </Form.Item>
183
+        <Form.Item label="价格区间">
184
+          {getFieldDecorator('priceRange')(
185
+            <Input placeholder="价格区间" />,
186
+          )}
187
+        </Form.Item>
188
+        <Form.Item label="报备日期">
189
+          {getFieldDecorator('reportDate')(
190
+            <DatePicker showTime placeholder="报备日期" />,
191
+          )}
192
+        </Form.Item>
193
+        {/* <Form.Item label="状态">
194
+          {getFieldDecorator('verifyStatus')(
195
+            <Select style={{ width: '180px' }} placeholder="状态" onChange={handleSelectChange}>
196
+              <Option value={0}>未通过</Option>
197
+              <Option value={1}>已通过</Option>
198
+              <Option value={2}>已驳回</Option>
199
+            </Select>,
200
+          )}onClick={() => submitDate({ verifyStatus: '1' })}
201
+        </Form.Item> */}
202
+        <Form.Item label="归属置业顾问"
203
+      >
204
+          <Row gutter={8}>
205
+            <Col span={12}>
206
+              {getFieldDecorator('consultantName', {
207
+                rules: [
208
+                  {
209
+                    required: true,
210
+                    message: '请选择置业顾问',
211
+                  },
212
+                ],
213
+              })(<Input placeholder="请选择置业顾问" />)}
214
+            </Col>
215
+            <Col span={12}>
216
+              <Button onClick={() => showConsultant()}>选择</Button>
217
+            </Col>
218
+          </Row>
219
+        </Form.Item>
220
+        <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
221
+          <Button type="primary" className={Styles.SubmitButton} htmlType="submit" >
222
+            审核通过
223
+          </Button>
224
+          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
225
+          <Button onClick={() => submitDate({ verifyStatus: '2' })}>
226
+            驳回
227
+          </Button>
228
+        </Form.Item>
229
+      </Form>
230
+
231
+      {/* 选择置业顾问 */}
232
+      <Attribution visibleData={visibleData} onCancel={() => closeConsultant()} onSuccess={e => consultantSuccess(e)} />
233
+    </>
234
+  );
235
+}
236
+const WrappedBody = Form.create({ name: 'body' })(body);
237
+
238
+export default WrappedBody

+ 151
- 0
src/pages/recommend/recommendCustomer/components/attribution.jsx 查看文件

@@ -0,0 +1,151 @@
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
+
9
+const { Option } = Select;
10
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
11
+const { Meta } = Card;
12
+
13
+/**
14
+ * 调整归属
15
+ *
16
+ * @param {*} props
17
+ * @returns
18
+ */
19
+class ModalAttribution extends React.Component {
20
+  constructor(props) {
21
+    super(props);
22
+    this.state = {
23
+       dataSource: { records: [] },
24
+       visibleData: { visible: false, customerId: '', realtyConsultant: '', buildingId: '' },
25
+    }
26
+  }
27
+
28
+  // 挂载之后
29
+  componentDidMount() {
30
+    // this.getList({ pageNumber: 1, pageSize: 5 })
31
+  }
32
+
33
+  componentDidUpdate(preProps, preState) {
34
+    if (this.props.visibleData.visible !== preState.visibleData.visible) {
35
+      this.getList({ pageNumber: 1, pageSize: 5, buildingId: this.props.visibleData.buildingId })
36
+      this.setState({ visibleData: this.props.visibleData });
37
+    }
38
+  }
39
+
40
+  // 弹框确定按钮
41
+  // eslint-disable-next-line react/sort-comp
42
+  handleOk() {
43
+    this.props.onCancel()
44
+  }
45
+
46
+  // 弹框取消按钮
47
+  handleCancel() {
48
+    this.props.onCancel()
49
+  }
50
+
51
+  getList(params) {
52
+    if (params.buildingId === '' || params.buildingId === null || params.buildingId === undefined) {
53
+      return
54
+    }
55
+
56
+    // 网路请求
57
+    request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
58
+      this.setState({ dataSource: res })
59
+    }).catch(err => {
60
+      // eslint-disable-next-line no-unused-expressions
61
+
62
+    })
63
+  }
64
+
65
+  openNotificationWithIcon = (type, message) => {
66
+    notification[type]({
67
+      message,
68
+      description:
69
+        '',
70
+    });
71
+  };
72
+
73
+   // 分页
74
+  onChange(pageNum) {
75
+    this.getList({ pageNumber: pageNum, pageSize: 5, buildingId: this.props.visibleData.buildingId })
76
+  }
77
+
78
+  // 提交
79
+  submitGm(record) {
80
+
81
+    console.log('传递之前:', record)
82
+    this.handleCancel()
83
+    this.props.onSuccess({ realtyConsultant: record.userId, name: record.userName })
84
+
85
+
86
+    // // 网路请求
87
+    // request({ ...apis.customer.recommendEdit, urlData: { id: this.state.visibleData.customerId }, data: { customerId: this.state.visibleData.customerId, realtyConsultant: record.personId } }).then(res => {
88
+    //   // eslint-disable-next-line no-unused-expressions
89
+    //   this.openNotificationWithIcon('success', '操作成功')
90
+    //   this.handleCancel()
91
+    //   this.props.onSuccess({ realtyConsultant: record.personId, name: record.name })
92
+    // }).catch(err => {
93
+    //   // eslint-disable-next-line no-unused-expressions
94
+    //   // this.openNotificationWithIcon('error', err)
95
+    // })
96
+  }
97
+
98
+  render() {
99
+    const columns = [
100
+      // {
101
+      //   title: '编号',
102
+      //   dataIndex: 'personId',
103
+      //   key: 'personId',
104
+      // },
105
+      {
106
+        title: '姓名',
107
+        dataIndex: 'userName',
108
+        key: 'userName',
109
+      },
110
+      {
111
+        title: '电话',
112
+        dataIndex: 'phone',
113
+        key: 'phone',
114
+      },
115
+      {
116
+        title: '部门',
117
+        dataIndex: 'department',
118
+        key: 'department',
119
+      },
120
+      {
121
+        title: '岗位',
122
+        dataIndex: 'position',
123
+        key: 'position',
124
+      },
125
+      {
126
+        title: '操作',
127
+        dataIndex: 'personId',
128
+        key: 'personId',
129
+        // eslint-disable-next-line no-nested-ternary
130
+        render: (_, record) => <>{ this.props.visibleData.realtyConsultant !== record.userId && <Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>,
131
+      },
132
+    ]
133
+    return (
134
+      <>
135
+        <Modal
136
+            title="选择置业顾问"
137
+            width={800}
138
+            destroyOnClose="true"
139
+            footer={null}
140
+            visible={this.state.visibleData.visible}
141
+            // onOk={() => this.handleOk()}
142
+            onCancel={(e) => this.handleCancel(e)}
143
+          >
144
+            <Table rowKey="attribution" dataSource={this.state.dataSource.records} columns={columns} pagination={{ pageSize: 5,total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
145
+          </Modal>
146
+      </>
147
+    );
148
+  }
149
+}
150
+
151
+export default ModalAttribution

+ 252
- 0
src/pages/recommend/recommendCustomer/index.jsx 查看文件

@@ -0,0 +1,252 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar } 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 AuthButton from '@/components/AuthButton';
9
+import BuildingSelect from '@/components/SelectButton/BuildSelect';
10
+
11
+
12
+const { Option } = Select;
13
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
14
+const { Meta } = Card;
15
+
16
+/**
17
+ *
18
+ *
19
+ * @param {*} props
20
+ * @returns
21
+ */
22
+function body(props) {
23
+  const { getFieldDecorator } = props.form
24
+
25
+  // eslint-disable-next-line react-hooks/rules-of-hooks
26
+  const [dataSource, setDataSource] = useState({ records: [] })
27
+
28
+  // eslint-disable-next-line react-hooks/rules-of-hooks
29
+  useEffect(() => {
30
+    getList({ pageNumber: 1, pageSize: 10 })
31
+  }, [])
32
+
33
+  function getList(params) {
34
+    // 网路请求
35
+    request({ ...apis.customer.recommender, params: { ...params } }).then(res => {
36
+      setDataSource(res)
37
+    }).catch(err => {
38
+      // eslint-disable-next-line no-unused-expressions
39
+      <Alert
40
+        style={{
41
+          marginBottom: 24,
42
+        }}
43
+        message={err}
44
+        type="error"
45
+        showIcon
46
+      />
47
+    })
48
+  }
49
+
50
+  // 提交事件
51
+  function handleSubmit(e) {
52
+    e.preventDefault();
53
+    props.form.validateFields((err, values) => {
54
+      if (!err) {
55
+        getList({ pageNum: 1, pageSize: 10, ...values })
56
+      }
57
+    });
58
+  }
59
+
60
+  // Change 事件
61
+  function handleSelectChange(e) {
62
+    // eslint-disable-next-line no-console
63
+    console.log(e)
64
+  }
65
+
66
+  // 分页
67
+  function onChange(pageNum) {
68
+    props.form.validateFields((err, values) => {
69
+      if (!err) {
70
+        getList({ pageNumber: pageNum, pageSize: 10, ...values })
71
+      }
72
+    });
73
+  }
74
+
75
+  function toAudit(cuurentId) {
76
+    router.push({
77
+      pathname: '/recommend/recommendCustomer/audit',
78
+      query: {
79
+        id: cuurentId,
80
+      },
81
+    })
82
+  }
83
+
84
+
85
+  /**
86
+    * 重置搜索
87
+    */
88
+  function handleReset() {
89
+    props.form.resetFields();
90
+  }
91
+
92
+  /**
93
+   *导出数据(推荐用户)
94
+   *
95
+   */
96
+  function exportRecommendCustomer() {
97
+    request({
98
+      ...apis.customer.customerRecommendRecommenderExport,
99
+      responseType: 'blob',
100
+    }).then(response => {
101
+      console.log('exportRecommendCustomer: ', response)
102
+      download(response)
103
+    }).catch(error => {
104
+
105
+    })
106
+  }
107
+
108
+  function download(data) {
109
+    if (!data) {
110
+      return
111
+    }
112
+    const url = window.URL.createObjectURL(new Blob([data]))
113
+    const link = document.createElement('a')
114
+    link.style.display = 'none'
115
+    link.href = url
116
+    link.setAttribute('download', '推荐客户.xlsx')
117
+    document.body.append(link)
118
+    link.click()
119
+  }
120
+
121
+  const columns = [
122
+    {
123
+      title: '头像',
124
+      dataIndex: 'picture',
125
+      key: 'picture',
126
+      render: (_, record) => <Avatar shape="square" src={record.picture} size={64} icon="user" />,
127
+    },
128
+    {
129
+      title: '姓名',
130
+      dataIndex: 'name',
131
+      key: 'name',
132
+    },
133
+    {
134
+      title: '电话',
135
+      dataIndex: 'phone',
136
+      key: 'phone',
137
+    },
138
+    {
139
+      title: '性别',
140
+      dataIndex: 'sex',
141
+      key: 'sex',
142
+      // eslint-disable-next-line no-nested-ternary
143
+      render: (_, record) => <><span>{record.sex === 1 ? '男' : record.sex === 2 ? '女' : '未知'}</span></>,
144
+    },
145
+    {
146
+      title: '意向项目',
147
+      dataIndex: 'intention',
148
+      key: 'intention',
149
+    },
150
+    {
151
+      title: '推荐人',
152
+      dataIndex: 'consultantName',
153
+      key: 'consultantName',
154
+      render: (_, record) => <><span>{(record.recommendName !== null ? record.recommendName : '') + " " + (record.recommendTel !== null ? record.recommendTel : '')}</span></>,
155
+    },
156
+    {
157
+      title: '推荐时间',
158
+      dataIndex: 'createDate',
159
+      key: 'createDate',
160
+      render: (_, record) => <><span>{record.createDate && moment(record.createDate).format('YYYY-MM-DD')}</span></>,
161
+    },
162
+    {
163
+      title: '状态',
164
+      dataIndex: 'verifyStatus',
165
+      key: 'verifyStatus',
166
+      render: (_, record) => <><span>{record.verifyStatus === 0 ? '待审核' : record.verifyStatus === 1 ? '已通过' : record.verifyStatus === 2 ? '已驳回' : ''}</span></>,
167
+    },
168
+    {
169
+      title: '操作',
170
+      dataIndex: 'customerId',
171
+      key: 'customerId',
172
+      render: (_, record) => (
173
+        <>
174
+          {
175
+            <AuthButton name="admin.customer.recommend.verify.id.put" noRight={null}>
176
+              {record.verifyStatus === 0 ? <span style={{ color: 'rgba(239,39,58,1)', cursor: 'pointer' }} onClick={() => toAudit(record.customerId)}>审核</span> : ''}
177
+            </AuthButton>
178
+          }
179
+        </>
180
+      ),
181
+    },
182
+  ]
183
+
184
+  return (
185
+    <>
186
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)} style={{ display: 'flex' }}>
187
+        <Form.Item>
188
+          {getFieldDecorator('name')(
189
+            <Input
190
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
191
+              placeholder="姓名"
192
+            />,
193
+          )}
194
+        </Form.Item>
195
+        <Form.Item>
196
+          {getFieldDecorator('tel')(
197
+            <Input
198
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
199
+              placeholder="电话"
200
+            />,
201
+          )}
202
+        </Form.Item>
203
+        <Form.Item>
204
+          {getFieldDecorator('consultName')(
205
+            <Input placeholder="推荐人" />,
206
+          )}
207
+        </Form.Item>
208
+        <Form.Item>
209
+          {getFieldDecorator('consultTel')(
210
+            <Input placeholder="推荐人电话" />,
211
+          )}
212
+        </Form.Item>
213
+        <Form.Item>
214
+          {getFieldDecorator('verifyStatus')(
215
+            <Select style={{ width: '180px' }} placeholder="状态" onChange={handleSelectChange}>
216
+              <Option value={0}>未通过</Option>
217
+              <Option value={1}>已通过</Option>
218
+              <Option value={2}>已驳回</Option>
219
+            </Select>,
220
+          )}
221
+        </Form.Item>
222
+        <Form.Item>
223
+          {getFieldDecorator('buildingId')(
224
+            <BuildingSelect />,
225
+          )}
226
+        </Form.Item>
227
+        <Form.Item>
228
+          <AuthButton name="admin.recommend.search" noRight={null}>
229
+            <Button type="primary" htmlType="submit" >
230
+              搜索
231
+              </Button>
232
+          </AuthButton>
233
+          <Button style={{ marginLeft: 8 }} onClick={handleReset}>
234
+            重置
235
+            </Button>
236
+        </Form.Item>
237
+      </Form>
238
+      {/* style={{float:'right',margin:'20px 0'}} */}
239
+      <div style={{ textAlign: 'right', padding: '10px 0' }}>
240
+        <AuthButton name="admin.recommend.import" noRight={null} >
241
+          <Button type="primary" onClick={() => exportRecommendCustomer()}>
242
+            导出
243
+        </Button>
244
+        </AuthButton>
245
+      </div>
246
+      <Table rowKey="recommendCustomer" dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
247
+    </>
248
+  );
249
+}
250
+const WrappedBody = Form.create({ name: 'body' })(body);
251
+
252
+export default WrappedBody

+ 54
- 0
src/pages/recommend/recommendCustomer/style.css 查看文件

@@ -0,0 +1,54 @@
1
+.SubmitButton {
2
+  background: #ef273a;
3
+  border-radius: 7px;
4
+  border: 0px;
5
+}
6
+.SelectFrom {
7
+  width: 180px;
8
+  background: #ffffff;
9
+  border-radius: 7px;
10
+  border: 1px solid #dbdbdb;
11
+}
12
+.addButton {
13
+  background: #50be00;
14
+  border-radius: 4px;
15
+  border: 0px;
16
+  margin: 10px 0px;
17
+}
18
+.cardText {
19
+  font-size:  0.106rem;
20
+  color: #333;
21
+  line-height: 24px;
22
+  display: flex;
23
+  align-items: center;
24
+  position: relative;
25
+}
26
+.cardItem {
27
+  font-size:  0.106rem;
28
+  font-weight: 400;
29
+  color: #666;
30
+  line-height: 24px;
31
+  display: flex;
32
+  align-items: center;
33
+}
34
+.ediText {
35
+  font-size:  0.106rem;
36
+  color: #ff925c;
37
+  line-height: 24px;
38
+  position: absolute;
39
+  right: 0;
40
+}
41
+.title {
42
+  display: inline-block;
43
+  width:  0.54rem;
44
+  justify-content: space-between;
45
+  text-align: justify;
46
+  text-align-last: justify;
47
+}
48
+.address {
49
+  width: 400px;
50
+  height: 24px;
51
+  text-overflow: ellipsis;
52
+  white-space: nowrap;
53
+  overflow: hidden;
54
+}

+ 58
- 0
src/pages/recommend/recommendCustomer/style.less 查看文件

@@ -0,0 +1,58 @@
1
+.SubmitButton {
2
+  background: rgba(239,39,58,1);
3
+  border-radius: 7px;
4
+  border: 0px;
5
+}
6
+.SelectFrom {
7
+  width: 180px;
8
+  background: #ffffff;
9
+  border-radius: 7px;
10
+  border: 1px solid #dbdbdb;
11
+}
12
+.addButton {
13
+  background: #50be00;
14
+  border-radius: 4px;
15
+  border: 0px;
16
+  margin: 10px 0px;
17
+}
18
+.cardText {
19
+  color: #333;
20
+  display: flex;
21
+  align-items: center;
22
+  position: relative;
23
+  line-height: 1.5;
24
+  font-size: 0.106rem;
25
+  margin-bottom: 0.08rem;
26
+
27
+}
28
+.cardItem{
29
+  font-size: 0.106rem;
30
+  font-weight: 400;
31
+  color: #666;
32
+  line-height: 24px;
33
+  display: flex;
34
+  align-items: center;  
35
+}
36
+.ediText {
37
+  font-size:  0.106rem;
38
+  color: #ff925c;
39
+  line-height: 24px;
40
+  position: absolute;
41
+  right: 0;
42
+}
43
+.title{
44
+  display: inline-block;
45
+  width:  0.54rem;
46
+  justify-content: space-between;
47
+  text-align: justify;
48
+  text-align-last:justify
49
+}
50
+
51
+.address { 
52
+  width: 400px;
53
+  height: 24px; 
54
+  text-overflow: ellipsis; 
55
+  white-space: nowrap;
56
+  overflow: hidden;
57
+}
58
+

+ 54
- 0
src/pages/recommend/recommendCustomer/style.wxss 查看文件

@@ -0,0 +1,54 @@
1
+.SubmitButton {
2
+  background: #ef273a;
3
+  border-radius: 7px;
4
+  border: 0px;
5
+}
6
+.SelectFrom {
7
+  width: 180px;
8
+  background: #ffffff;
9
+  border-radius: 7px;
10
+  border: 1px solid #dbdbdb;
11
+}
12
+.addButton {
13
+  background: #50be00;
14
+  border-radius: 4px;
15
+  border: 0px;
16
+  margin: 10px 0px;
17
+}
18
+.cardText {
19
+  font-size:  0.106rem;
20
+  color: #333;
21
+  line-height: 24px;
22
+  display: flex;
23
+  align-items: center;
24
+  position: relative;
25
+}
26
+.cardItem {
27
+  font-size:  0.106rem;
28
+  font-weight: 400;
29
+  color: #666;
30
+  line-height: 24px;
31
+  display: flex;
32
+  align-items: center;
33
+}
34
+.ediText {
35
+  font-size:  0.106rem;
36
+  color: #ff925c;
37
+  line-height: 24px;
38
+  position: absolute;
39
+  right: 0;
40
+}
41
+.title {
42
+  display: inline-block;
43
+  width:  0.54rem;
44
+  justify-content: space-between;
45
+  text-align: justify;
46
+  text-align-last: justify;
47
+}
48
+.address {
49
+  width: 400px;
50
+  height: 24px;
51
+  text-overflow: ellipsis;
52
+  white-space: nowrap;
53
+  overflow: hidden;
54
+}

+ 48
- 0
src/pages/style/GoodsList.less 查看文件

@@ -0,0 +1,48 @@
1
+.addBtn {
2
+  padding: 0 40px;
3
+  height: 36px;
4
+  margin: 30px 0;
5
+}
6
+
7
+.touxiang {
8
+  width: 93px;
9
+  height: 93px;
10
+}
11
+
12
+.imgPerfect {
13
+  width: 120px;
14
+  height: 40px;
15
+}
16
+
17
+.imgIndex {
18
+  width: 150px;
19
+  height: 92.7px;
20
+}
21
+
22
+.imgSmall {
23
+  width: 128px;
24
+  height: 192px;
25
+}
26
+
27
+.propaganda {
28
+  width: 240px;
29
+  height: 60px;
30
+}
31
+
32
+.ant-table-column-title {
33
+  font-weight: 600;
34
+}
35
+
36
+.shoppingCart {
37
+  // color: #dcdcdc;
38
+  color: #bebebe;
39
+  margin-left: 6px;
40
+  font-size: 16px;
41
+}
42
+
43
+.edit {
44
+  // color: #dcdcdc;
45
+  color: #bebebe;
46
+  margin-left: 6px;
47
+  font-size: 15px;
48
+}