zhoulisen 5 år sedan
förälder
incheckning
26825b5aec

+ 1
- 1
src/components/SelectButton/QrcodeType.jsx Visa fil

@@ -52,7 +52,7 @@ const qrcodeType = props => {
52 52
         },
53 53
         {
54 54
             name: '在线选房',
55
-            value: 'house',
55
+            value: 'salesBatch',
56 56
             visible,
57 57
         },
58 58
     ]

+ 1
- 1
src/pages/carouselFigure/LiveGroup.jsx Visa fil

@@ -89,7 +89,7 @@ export default props => {
89 89
 
90 90
   return (
91 91
     <div>
92
-      <div onClick={() => setVisible(true)}>{group.groupName}</div>
92
+             <div ><Navigate onClick={() => setVisible(true)}>{group.groupName}</Navigate></div>
93 93
       <Modal
94 94
         title="请选择"
95 95
         visible={visible}

+ 1
- 1
src/pages/carouselFigure/SalesBatchGroup.jsx Visa fil

@@ -89,7 +89,7 @@ export default props => {
89 89
 
90 90
   return (
91 91
     <div>
92
-      <div onClick={() => setVisible(true)}>{group.groupName}</div>
92
+       <div ><Navigate onClick={() => setVisible(true)}>{group.groupName}</Navigate></div>
93 93
       <Modal
94 94
         title="请选择"
95 95
         visible={visible}

+ 1
- 1
src/pages/carouselFigure/SelectActivity.jsx Visa fil

@@ -92,7 +92,7 @@ export default (props) => {
92 92
   return (
93 93
 
94 94
     <div>
95
-      <div onClick={() => setVisible(true)}>{activity.title}</div>
95
+      <div ><Navigate onClick={() => setVisible(true)}>{activity.title}</Navigate></div>
96 96
       <Modal
97 97
         title="请选择"
98 98
         visible={visible}

+ 1
- 1
src/pages/carouselFigure/SelectGroup.jsx Visa fil

@@ -89,7 +89,7 @@ export default props => {
89 89
 
90 90
   return (
91 91
     <div>
92
-      <div onClick={() => setVisible(true)}>{group.groupName}</div>
92
+      <div><Navigate onClick={() => setVisible(true)} >{group.groupName}</Navigate></div>
93 93
       <Modal
94 94
         title="请选择"
95 95
         visible={visible}

+ 1
- 1
src/pages/carouselFigure/SelectH5.1.jsx Visa fil

@@ -65,7 +65,7 @@ export default props => {
65 65
 
66 66
   return (
67 67
     <div>
68
-      <div onClick={() => setVisible(true)}>{group.groupName}</div>
68
+      <div onClick={() => setVisible(true)} style={{ color: 'red' }}>{group.groupName}</div>
69 69
       <Modal
70 70
         title="请选择"
71 71
         visible={visible}

+ 1
- 1
src/pages/carouselFigure/SelectH5.jsx Visa fil

@@ -94,7 +94,7 @@ export default props => {
94 94
 
95 95
   return (
96 96
     <div>
97
-      <div onClick={() => setVisible(true)}>{group.groupName}</div>
97
+      <div ><Navigate onClick={() => setVisible(true)}>{group.groupName}</Navigate></div>
98 98
       <Modal
99 99
         title="请选择"
100 100
         visible={visible}

+ 1
- 1
src/pages/carouselFigure/SelectHelp.jsx Visa fil

@@ -90,7 +90,7 @@ export default props => {
90 90
 
91 91
   return (
92 92
     <div>
93
-      <div onClick={() => setVisible(true)}>{help.helpName}</div>
93
+      <div ><Navigate onClick={() => setVisible(true)}>{help.helpName}</Navigate></div>
94 94
       <Modal
95 95
         title="请选择"
96 96
         visible={visible}

+ 1
- 1
src/pages/carouselFigure/SelectNews.jsx Visa fil

@@ -85,7 +85,7 @@ export default props => {
85 85
 
86 86
   return (
87 87
     <div>
88
-      <div onClick={() => setVisible(true)}>{news.newsName}</div>
88
+      <div ><Navigate onClick={() => setVisible(true)}>{news.newsName}</Navigate></div>
89 89
       <Modal
90 90
         title="请选择"
91 91
         visible={visible}

+ 61
- 52
src/pages/carouselFigure/editAdvertising.jsx Visa fil

@@ -1,4 +1,4 @@
1
-import React, { useState, useEffect } from 'react';
1
+import React, { useState, useEffect, useRef } from 'react';
2 2
 import { Modal, message } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import styles from '../style/GoodsList.less';
@@ -23,7 +23,7 @@ import LiveGroup from './LiveGroup';
23 23
  * @param {*} props
24 24
  * @returns
25 25
  */
26
- const createEditor = () => {
26
+const createEditor = () => {
27 27
   let contentVisible = false
28 28
   let activityVisible = false
29 29
   let newsVisible = false
@@ -34,22 +34,22 @@ import LiveGroup from './LiveGroup';
34 34
   let h5Visible = false
35 35
   let buildingId = ''
36 36
   let cityId = ''
37
-  let isHaveActive=false
38
-  let isCanChoose=true
37
+  let isHaveActive = false
38
+  let isCanChoose = true
39 39
   let isHavePosition = false
40 40
 
41 41
   const setExtraData = (data) => {
42
-    if(data.isHaveActive!=undefined){
43
-      isHaveActive=data.isHaveActive
44
-      if(!isHaveActive) {
42
+    if (data.isHaveActive != undefined) {
43
+      isHaveActive = data.isHaveActive
44
+      if (!isHaveActive) {
45 45
         // data.contentType=null
46
-        data.buildingId=null
46
+        data.buildingId = null
47 47
       }
48 48
     }
49 49
 
50
-    if (data.showPosition == 'index'){
50
+    if (data.showPosition == 'index') {
51 51
       isHavePosition = true;
52
-    }else{
52
+    } else {
53 53
       isHavePosition = false;
54 54
     }
55 55
 
@@ -62,16 +62,16 @@ import LiveGroup from './LiveGroup';
62 62
     liveVisible = data.contentType === 'live';
63 63
     h5Visible = data.contentType === 'h5';
64 64
 
65
-    cityId=data.cityId
65
+    cityId = data.cityId
66 66
     buildingId = data.buildingId
67 67
   }
68 68
 
69 69
   const setExtraData1 = (data) => {
70
-    console.log(data.buildingId,"data.buildingIddata.buildingId2")
71
-    if((data.contentType=='h5'  && data.buildingId == null) || data.contentType==''||data.contentType=='nothing' || (data.contentType=='live' && data.buildingId == null)){
72
-       isHaveActive=false
73
-    }else{
74
-       isHaveActive=true
70
+    console.log(data.buildingId, "data.buildingIddata.buildingId2")
71
+    if ((data.contentType == 'h5' && data.buildingId == null) || data.contentType == '' || data.contentType == 'nothing' || (data.contentType == 'live' && data.buildingId == null)) {
72
+      isHaveActive = false
73
+    } else {
74
+      isHaveActive = true
75 75
     }
76 76
 
77 77
     contentVisible = data.contentType === 'other';
@@ -86,34 +86,34 @@ import LiveGroup from './LiveGroup';
86 86
   }
87 87
 
88 88
   const handleFormValueChange = (props, changedValues, allValues) => {
89
-      setExtraData(allValues)
89
+    setExtraData(allValues)
90 90
   }
91 91
 
92 92
   const XForm = createForm({ onValuesChange: handleFormValueChange })
93 93
 
94 94
   return (props) => {
95
-    const [ tab, changeTab ] = useState('basic')
95
+    const [tab, changeTab] = useState('basic')
96 96
     const contentId = props.location.query.contentId
97
-    const [ data, setData ] = useState({})
97
+    const [data, setData] = useState({})
98
+    const formRef = useRef(null);
98 99
 
99
-    if(contentId){
100
-      isCanChoose=false
101
-      useEffect(() => {
100
+    // 查询列表
101
+    const getDetail = contentId => {
102
+      request({ ...apis.carsuseFigure.getExtendContent, urlData: { id: contentId } }).then((data) => {
103
+        setExtraData1(data)
104
+        setData(data)
105
+      })
106
+    }
107
+    useEffect(() => {
108
+      if (contentId) {
109
+        isCanChoose = false
102 110
         getDetail(contentId);
103
-      },[])
104
-
105
-      // 查询列表
106
-      const getDetail = (contentId) => {
107
-        request({ ...apis.carsuseFigure.getExtendContent,urlData:{id: contentId}}).then((data) => {
108
-          setExtraData1(data)
109
-          setData(data)
110
-        })
111
+      } else {
112
+        isCanChoose = true
111 113
       }
112
-    }else{
113
-      isCanChoose=true
114
-    }
114
+    }, [])
115 115
 
116
-    const cancelPage = () =>{
116
+    const cancelPage = () => {
117 117
       router.push({
118 118
         pathname: '/carouselFigure/advertisingList',
119 119
       });
@@ -124,17 +124,26 @@ import LiveGroup from './LiveGroup';
124 124
         label: '是否关联项目',
125 125
         name: 'isHaveActive',
126 126
         type: FieldTypes.Switch,
127
-        value:isHaveActive,
127
+        value: isHaveActive,
128 128
         hidden: () => !isCanChoose,
129
+        props: {
130
+          onChange: () => {
131
+            const type = formRef.current.props.form.getFieldValue('contentType')
132
+            if (formRef.current && (type !== 'live' && type !== 'h5' )) {
133
+              console.log(formRef.current.props.form.getFieldValue('contentType'), '2222')
134
+              formRef.current.props.form.resetFields(['contentType', []]);
135
+            }
136
+          },
137
+        },
129 138
         rules: [
130
-          { required: true,message: '是否城市活动' },
139
+          { required: true, message: '是否城市活动' },
131 140
         ],
132 141
       },
133 142
       {
134 143
         label: '发布位置',
135 144
         name: 'showPosition',
136 145
         type: FieldTypes.Select,
137
-        value:isHaveActive,
146
+        value: isHaveActive,
138 147
         dict: [{
139 148
           label: '首页',
140 149
           value: 'index',
@@ -249,13 +258,13 @@ import LiveGroup from './LiveGroup';
249 258
         ],
250 259
       },
251 260
       {
252
-        label: '是否发布H5',
261
+        label: '是否发布H5活动',
253 262
         name: 'targetId',
254 263
         render: <SelectH5 buildingId={() => buildingId} />,
255 264
         hidden: () => !h5Visible,
256 265
         value: data.targetId,
257 266
         rules: [
258
-          { required: false, message: '请选择发布H5' },
267
+          { required: true, message: '请选择发布H5' },
259 268
         ],
260 269
       },
261 270
       {
@@ -346,22 +355,22 @@ import LiveGroup from './LiveGroup';
346 355
 
347 356
     const handleSubmit = val => {
348 357
       val.showType = 'screen'
349
-      if(!isHaveActive&&val.targetId) {
350
-          if(!val.contentType){
351
-            val.contentType='h5'
352
-          }
358
+      if (!isHaveActive && val.targetId) {
359
+        if (!val.contentType) {
360
+          val.contentType = 'h5'
361
+        }
353 362
       }
354
-      if(!isHaveActive&&!val.targetId){
355
-        val.contentType=''
363
+      if (!isHaveActive && !val.targetId) {
364
+        val.contentType = ''
356 365
       }
357
-      if(contentId){
358
-        request({ ...apis.carsuseFigure.updataExtendContent,urlData:{id: contentId}, data: val,}).then((data) => {
366
+      if (contentId) {
367
+        request({ ...apis.carsuseFigure.updataExtendContent, urlData: { id: contentId }, data: val, }).then((data) => {
359 368
           cancelPage()
360 369
         }).catch((err) => {
361 370
           message.info(err.msg || err.message)
362 371
         })
363
-      }else{
364
-        request({ ...apis.carsuseFigure.addExtendContent, data: val,}).then((data) => {
372
+      } else {
373
+        request({ ...apis.carsuseFigure.addExtendContent, data: val, }).then((data) => {
365 374
           cancelPage()
366 375
         }).catch((err) => {
367 376
           message.info(err.msg || err.message)
@@ -371,9 +380,9 @@ import LiveGroup from './LiveGroup';
371 380
 
372 381
 
373 382
     return (
374
-      <XForm onSubmit={handleSubmit} onCancel={cancelPage} onValuesChange={handleFormValueChange} fields={fields}></XForm>
383
+      <XForm wrappedComponentRef={formRef} onSubmit={handleSubmit} onCancel={cancelPage} onValuesChange={handleFormValueChange} fields={fields}></XForm>
375 384
     );
376
-   }
377
- }
385
+  }
386
+}
378 387
 
379 388
 export default createEditor()

+ 29
- 5
src/pages/channel/newCustomer/index.jsx Visa fil

@@ -52,6 +52,8 @@ const qrcodelist = props => {
52 52
                 targetType: record.targetType,
53 53
                 buildingId: record.buildingId,
54 54
                 newCustomers: record.newCustomers,
55
+                startDate,
56
+                endDate,
55 57
             },
56 58
         });
57 59
     }
@@ -66,6 +68,8 @@ const qrcodelist = props => {
66 68
                 targetType: record.targetType,
67 69
                 buildingId: record.buildingId,
68 70
                 visitNum: record.visitNum,
71
+                startDate,
72
+                endDate,
69 73
             },
70 74
         });
71 75
     }
@@ -80,6 +84,8 @@ const qrcodelist = props => {
80 84
                 targetType: record.targetType,
81 85
                 buildingId: record.buildingId,
82 86
                 visitPersons: record.visitPersons,
87
+                startDate,
88
+                endDate,
83 89
             },
84 90
         });
85 91
     }
@@ -89,7 +95,7 @@ const qrcodelist = props => {
89 95
      */
90 96
     const exportExcel = () => {
91 97
         // console.log('fieldsValue', ...props.form.getFieldsValue())
92
-        request({ ...apis.channelList.getIntroductionListExport, params: { channelId: id } })
98
+        request({ ...apis.channelList.getIntroductionListExport, params: { channelId: id, ...props.form.getFieldsValue(), startDate, endDate } })
93 99
             .then(data => {
94 100
                 if (!data) {
95 101
                     return
@@ -106,6 +112,21 @@ const qrcodelist = props => {
106 112
             })
107 113
     }
108 114
 
115
+    // 排序
116
+    const handleTableChange = (pagination, filters, sorter) => {
117
+        console.log(pagination, filters, sorter)
118
+        // if (sorter.order === 'ascend') { 
119
+        //     getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue(), startDate, endDate, asc: sorter.columnKey })
120
+        // } else if (sorter.order === 'descend') {
121
+        //     getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue(), startDate, endDate, desc: sorter.columnKey })
122
+        // } else {
123
+        //     getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue(), startDate, endDate });
124
+        // }
125
+        // sortField, sortOrder
126
+        // getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue(), startDate, endDate, sorter.columnKey, sorter.order })
127
+        getList({ channelId: id, ...props.form.getFieldsValue(), startDate, endDate, sortField: sorter.columnKey, sortOrder: sorter.order })
128
+    };
129
+
109 130
     /**
110 131
      *
111 132
      *
@@ -118,8 +139,8 @@ const qrcodelist = props => {
118 139
             dataIndex: 'targetType',
119 140
             key: 'targetType',
120 141
             align: 'center',
121
-        render: (text, record) => <span>{text == 'project' ? '项目' : text == 'activity' ? '常规活动'  : text == 'help' ? '助力活动'  : text == 'group' ? '拼团活动'
122
-        : text == 'h5' ? 'H5活动' : text == 'live' ? '直播活动': text == 'news' ? '资讯' : text == 'house' ? '在线选房' : ''}</span>,
142
+            render: (text, record) => <span>{text == 'project' ? '项目' : text == 'activity' ? '常规活动' : text == 'help' ? '助力活动' : text == 'group' ? '拼团活动'
143
+                : text == 'h5' ? 'H5活动' : text == 'live' ? '直播活动' : text == 'news' ? '资讯' : text == 'salesBatch' ? '在线选房' : ''}</span>,
123 144
         },
124 145
         {
125 146
             title: '内容',
@@ -140,6 +161,7 @@ const qrcodelist = props => {
140 161
             dataIndex: 'newCustomers',
141 162
             key: 'newCustomers',
142 163
             align: 'center',
164
+            sorter: true,
143 165
             render: (text, record) => <Navigate onClick={() => toNewuser(record)}>{text}</Navigate>,
144 166
 
145 167
         },
@@ -148,6 +170,7 @@ const qrcodelist = props => {
148 170
             dataIndex: 'visitPersons',
149 171
             key: 'visitPersons',
150 172
             align: 'center',
173
+            sorter: true,
151 174
             render: (text, record) => <Navigate onClick={() => toPersonNum(record)}>{text}</Navigate>,
152 175
 
153 176
         },
@@ -156,6 +179,7 @@ const qrcodelist = props => {
156 179
             dataIndex: 'visitNum',
157 180
             key: 'visitNum',
158 181
             align: 'center',
182
+            sorter: true,
159 183
             render: (text, record) => <Navigate onClick={() => toVisitNum(record)}>{text}</Navigate>,
160 184
         },
161 185
     ];
@@ -277,9 +301,9 @@ const qrcodelist = props => {
277 301
                 </Form.Item>
278 302
             </Form>
279 303
             <Button type="primary" style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} onClick={exportExcel}>导出</Button>
280
-            <Table dataSource={data.records} columns={columns} pagination={false} rowKey={r => r.serialNo} />
304
+            <Table dataSource={data.records} columns={columns} pagination={false} rowKey={r => r.serialNo} onChange={handleTableChange} />
281 305
             <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
282
-                <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={e => changePageNum(e)} current={data.current} />
306
+                <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={e => changePageNum(e)} current={data.current} scroll={{ y: 500 }} />
283 307
             </div>
284 308
         </>
285 309
     )

+ 2
- 2
src/pages/qrcode/qrcodelist/index.jsx Visa fil

@@ -18,13 +18,13 @@ const typeName = targetType => {
18 18
     // eslint-disable-next-line default-case
19 19
     switch (targetType) {
20 20
         case 'project': return '项目';
21
-        case 'activity': return '常规活动';
21
+        case 'activity': return '报名活动';
22 22
         case 'help': return '助力活动';
23 23
         case 'group': return '拼团活动';
24 24
         case 'h5': return 'H5活动';
25 25
         case 'live': return '直播活动';
26 26
         case 'news': return '资讯';
27
-        case 'salesBatch': return '销售批次';
27
+        case 'salesBatch': return '在线选房';
28 28
     }
29 29
 }
30 30