瀏覽代碼

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

许静 5 年之前
父節點
當前提交
2f8bf1befd

+ 15
- 0
config/config.js 查看文件

@@ -375,6 +375,21 @@ export default {
375 375
                   name: '报表数据',
376 376
                   component: './system/report',
377 377
                 },
378
+                {
379
+                  path: '/system/intention',
380
+                  name: '意向值',
381
+                  component: './system/intention',
382
+                },
383
+                {
384
+                  path: '/system/housingPolicy',
385
+                  name: '购房政策维护',
386
+                  component: './system/housingPolicy',
387
+                },
388
+                {
389
+                  path: '/system/editPolicy',
390
+                  name: '',
391
+                  component: './system/editPolicy',
392
+                },
378 393
               ],
379 394
             },
380 395
             {

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

@@ -37,6 +37,7 @@ const columns = [
37 37
     dataIndex: 'sex',
38 38
     key: 'sex',
39 39
     align: 'center',
40
+    render: (text, record) => <a style={ { color: '#66B3FF' } } >{ record.sex === 1 ? '男' : '女' }</a>,
40 41
   },
41 42
 ];
42 43
 const header = props => {

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

@@ -155,7 +155,7 @@ const header = props => {
155 155
 return (
156 156
   <>
157 157
     <div className={ channels.searchBox }>
158
-      <div>
158
+      <div style = {{ marginLeft: '-5px' }}>
159 159
         <span className={ channels.selectName }>姓名</span>
160 160
         <Input onChange = { onInputChangePhone } style ={{ width: 150 }} />
161 161
         <span className={ channels.selectName }>电话</span>
@@ -163,7 +163,7 @@ return (
163 163
       </div>
164 164
       <div>
165 165
       <Button type="primary" onClick={() => queryList() }>查询</Button>
166
-      <Button onClick={() => refurbishList() }>重置</Button>
166
+      {/* <Button onClick={() => refurbishList() }>重置</Button> */}
167 167
     </div>
168 168
     </div>
169 169
     <Table dataSource={data.list} columns={columns} pagination={{ pageSize: 10, total: data.total, onChange }} />

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

@@ -168,10 +168,10 @@ const header = props => {
168 168
         </dvi>
169 169
         <div >
170 170
         <Button type="primary" onClick={() => queryList() }>查询</Button>
171
-        <Button onClick={() => reset() }>重置</Button>
171
+        {/* <Button onClick={() => reset() }>重置</Button> */}
172 172
         </div>
173 173
       </div>
174
-      <Button type="danger" onClick={toAdd}>新增</Button>
174
+      <Button type="danger" onClick={toAdd} className={channels.about} >新增</Button>
175 175
       <Table dataSource={data.result.records} columns={columns} pagination={{ pageSize: 10, total: data.result.total, onChange }} />
176 176
   </>
177 177
   )

+ 7
- 3
src/pages/channel/channelList.less 查看文件

@@ -32,13 +32,12 @@
32 32
 .about {
33 33
   padding: 0 30px;
34 34
   height: 36px;
35
-  background-color:rgba(255,255,255,1);
36
-  color: #fff;
37 35
   margin: 30px 0;
36
+  margin-left:8px;
38 37
 }
39 38
 
40 39
 .selectName {
41
-  font-size: 17px;
40
+  font-size: 14px;
42 41
   padding: 0 10px;
43 42
   height: 36px;
44 43
   color: rgb(10, 10, 10);
@@ -62,3 +61,8 @@
62 61
   float: 'left'; 
63 62
   width: 500
64 63
 }
64
+.brokerTable{
65
+  padding: 0 30px;
66
+  height: 36px;
67
+  margin: 30px 0;
68
+}

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

@@ -70,6 +70,7 @@ const columns = [
70 70
     dataIndex: 'sex',
71 71
     key: 'sex',
72 72
     align: 'center',
73
+    render: (text, record) => <a style={ { color: '#66B3FF' } } >{ record.sex === 1 ? '男' : '女' }</a>,
73 74
   },
74 75
   {
75 76
     title: '意向项目',

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

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, notification } from 'antd';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, notification, Modal } from 'antd';
3 3
 import moment from 'moment';
4 4
 import request from '../../../utils/request';
5 5
 import apis from '../../../services/apis';

+ 115
- 0
src/pages/system/editPolicy.jsx 查看文件

@@ -0,0 +1,115 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker,message } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../style/GoodsList.less';
5
+import moment from 'moment';
6
+import router from 'umi/router';
7
+import BuildSelect from '../../components/SelectButton/BuildSelect'
8
+import SelectCity from '../../components/SelectButton/CitySelect'
9
+import XForm, { FieldTypes } from '../../components/XForm';
10
+import Wangedit from '../../components/Wangedit/Wangedit'
11
+import request from '../../utils/request'
12
+
13
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
14
+/**
15
+ *
16
+ *
17
+ * @param {*} props
18
+ * @returns
19
+ */
20
+ const Edit = (props) => {
21
+  const policyId = props.location.query.policyId
22
+  const [ policyData, setPolicyData ] = useState({})
23
+  if(policyId){
24
+    useEffect(() => {
25
+      getPolicyData(policyId);
26
+    },[])
27
+
28
+  // 查询列表
29
+  const getPolicyData = (policyId) => {
30
+    request({
31
+        url: '/api/admin/taPolicy/' + policyId,
32
+        method: 'GET',
33
+    }).then((data) => {
34
+        console.log(data)
35
+        setPolicyData(data)
36
+    })
37
+  }
38
+  }
39
+
40
+  const cancelPage = () =>{
41
+    router.push({
42
+      pathname: '/system/housingPolicy',
43
+    });
44
+  }
45
+    const fields = [
46
+      {
47
+        label: '城市',
48
+        name: 'cityId',
49
+        render: <SelectCity />,
50
+        value: policyData.cityId,
51
+      },
52
+      {
53
+        label: '政策图片',
54
+        name: 'policyImg',
55
+        type: FieldTypes.ImageUploader,
56
+        value: policyData.policyImg,
57
+      },
58
+      {
59
+        label: '政策标题',
60
+        name: 'title',
61
+        type: FieldTypes.Text,
62
+        value: policyData.title,
63
+      },
64
+      {
65
+        label: '政策详情',
66
+        name: 'body',
67
+        render: <Wangedit />,
68
+        value: policyData.body,
69
+      },
70
+      {
71
+        label: '状态',
72
+        name: 'publishStatus',
73
+        type: FieldTypes.Select,
74
+        dict: [{label:"未发布",value:0},{label:"已发布",value:1}],
75
+        value: policyData.publishStatus != null ? policyData.publishStatus : 1,
76
+      },
77
+    ]
78
+  
79
+    const handleSubmit = val => { 
80
+      console.log('submit data --->', val)
81
+      if(policyId){
82
+        val.policyId = policyId
83
+        request({
84
+          url: '/api/admin/taPolicy/'+policyId,
85
+          method: 'PUT',
86
+          data: val,
87
+        }).then((data) => {
88
+          message.info("保存成功")
89
+          cancelPage()
90
+        }).catch((err) => {
91
+          message.info(err.msg || err.message)
92
+        })
93
+      }else{
94
+        request({
95
+          url: '/api/admin/taPolicy',
96
+          method: 'POST',
97
+          data: val,
98
+        }).then((data) => {
99
+          message.info("保存成功")
100
+          cancelPage()
101
+        }).catch((err) => {
102
+          message.info(err.msg || err.message)
103
+        })
104
+      }
105
+    }
106
+     
107
+
108
+  return (
109
+    <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
110
+  );
111
+ }
112
+
113
+
114
+
115
+export default Edit

+ 202
- 0
src/pages/system/housingPolicy.jsx 查看文件

@@ -0,0 +1,202 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../style/GoodsList.less';
5
+import router from 'umi/router';
6
+import moment from 'moment';
7
+import SelectCity from '../../components/SelectButton/CitySelect'
8
+import BuildSelect from '../../components/SelectButton/BuildSelect'
9
+
10
+import request from '../../utils/request'
11
+
12
+const { Option } = Select;
13
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
14
+
15
+const header = (props) => {
16
+  const [ data, setData ] = useState({})
17
+
18
+  useEffect(() => {
19
+    getList({ pageNum: 1, pageSize: 10,cityId: '' });
20
+  },[])
21
+
22
+  // 查询列表
23
+  const getList = (params) => {
24
+    request({
25
+        url: '/api/admin/taPolicy',
26
+        method: 'GET',
27
+        params: { ...params },
28
+    }).then((data) => {
29
+        console.log(data)
30
+        setData(data)
31
+    })
32
+  }
33
+
34
+  
35
+// 跳转到编辑商品
36
+const toEditPolicy = (policyId) => () => {
37
+    router.push({
38
+      pathname: '/system/editPolicy',
39
+      query: {
40
+        policyId
41
+      },
42
+    });
43
+  }
44
+  
45
+  /**
46
+   *
47
+   *
48
+   * @param {*} props
49
+   * @returns
50
+   */
51
+  
52
+  const columns = [
53
+    {
54
+      title: '购房政策主图',
55
+      dataIndex: 'policyImg',
56
+      key: 'policyImg',
57
+      align: 'center',
58
+      render: (policyImg) => <img src={policyImg} className={styles.touxiang} />,
59
+    },
60
+    {
61
+      title: '标题',
62
+      dataIndex: 'title',
63
+      key: 'title',
64
+      align: 'center',
65
+    },
66
+    {
67
+      title: '城市',
68
+      dataIndex: 'cityName',
69
+      key: 'cityName',
70
+      align: 'center',
71
+    },
72
+    {
73
+      title: '创建时间',
74
+      dataIndex: 'createDate',
75
+      key: 'createDate',
76
+      align: 'center',
77
+      render: (createDate) => <><span>{moment(createDate).format('YYYY-MM-DD')}</span></>
78
+    },
79
+    {
80
+      title: '状态',
81
+      dataIndex: 'publishStatus',
82
+      key: 'publishStatus',
83
+      align: 'center',
84
+      render: (publishStatus)=> <><span>{publishStatus === 1 ? '已发布' : '未发布' }</span></>
85
+    },
86
+    {
87
+      title: '操作',
88
+      dataIndex: 'handle',
89
+      key: 'handle',
90
+      align: 'center',
91
+      render: (x,row) => <>
92
+                           <span style={{ color: '#1990FF' }} onClick={publicOrNoPublic(row)}>{ row.publishStatus === 0 ? '发布' : '取消发布' }<Icon type="close-circle" className={styles.edit} /></span>
93
+                           <span style={{ color: '#1990FF', marginRight: '20px' }} onClick={topPolicy(row)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
94
+                           <span style={{ color: '#FF925C' }} onClick={toEditPolicy(row.policyId)}>编辑<Icon type="form" className={styles.edit} /></span>
95
+                           <span style={{ color: '#FF925C' }} onClick={deletePolicy(row.policyId)}>删除<Icon type="form" className={styles.edit} /></span>
96
+                         </>
97
+    },
98
+  ];
99
+  
100
+  // 删除
101
+const deletePolicy = (policyId) => () => {
102
+  Modal.confirm({
103
+    title: '是否继续删除此政策?',
104
+    okText: '确定',
105
+    cancelText: '取消',
106
+    onOk() {
107
+        request({
108
+            url: '/api/admin/taPolicy/'+policyId,
109
+            method: 'DELETE',
110
+        }).then((data) => {
111
+            message.info('操作成功!')
112
+            getList({ pageNum: 1, pageSize: 10,cityId: '' });
113
+        }).catch((err) => {
114
+            console.log(err)
115
+            message.info(err.msg || err.message)
116
+        })
117
+    },
118
+  });
119
+}
120
+
121
+
122
+//   置顶
123
+  const topPolicy = (row) => () => {
124
+      const weight = Math.abs(row.weight - 1)
125
+      row.weight = weight
126
+      request({
127
+          url: '/api/admin/taPolicy/'+row.policyId,
128
+          method: 'PUT',
129
+          data: row,
130
+      }).then((data) => {
131
+          console.log(data)
132
+          message.info('操作成功!')
133
+          getList({ pageNum: 1, pageSize: 10,cityId: '' });
134
+      }).catch((err) => {
135
+          console.log(err)
136
+          message.info(err.msg || err.message)
137
+      })
138
+  }
139
+  
140
+  const publicOrNoPublic = (row) => () => {
141
+      if (row.publishStatus === 1) {
142
+        row.publishStatus = 0
143
+      } else {
144
+        row.publishStatus = 1
145
+      }
146
+
147
+      request({
148
+        url: '/api/admin/taPolicy/'+row.policyId,
149
+        method: 'PUT',
150
+        data: row,
151
+      }).then((data) => {
152
+          console.log(data)
153
+          message.info('操作成功!')
154
+          getList({ pageNum: 1, pageSize: 10,cityId: '' });
155
+      }).catch((err) => {
156
+          console.log(err)
157
+          message.info(err.msg || err.message)
158
+      })
159
+  }
160
+  
161
+  const changePageNum = (pageNumber) => {
162
+      getList({ pageNum: pageNumber, pageSize: 10 })
163
+  }
164
+
165
+  // 提交事件
166
+const handleSubmit = (e, props) => {
167
+    e.preventDefault();
168
+    props.form.validateFields((err, values) => {
169
+      if (!err) {
170
+        console.log('提交数据: ', values)
171
+        getList({ pageNum: 1, pageSize: 10, ...values })
172
+      }
173
+    });
174
+  }
175
+
176
+  const { getFieldDecorator } = props.form
177
+  return (
178
+
179
+    <>
180
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
181
+        <Form.Item>
182
+          {getFieldDecorator('cityId')(
183
+            <SelectCity />,
184
+          )}
185
+        </Form.Item>
186
+        <Form.Item>
187
+          <Button type="primary" htmlType="submit" className={styles.searchBtn}>
188
+            搜索
189
+          </Button>
190
+        </Form.Item>
191
+      </Form>
192
+      <Button type="primary" className={styles.addBtn} onClick={toEditPolicy()}>新增</Button>
193
+      <Table dataSource={data.records} columns={columns} pagination={false}/>
194
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
195
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
196
+      </div>
197
+    </>
198
+  )
199
+}
200
+const WrappedHeader = Form.create({ name: 'header' })(header);
201
+
202
+export default WrappedHeader

+ 69
- 0
src/pages/system/intention.jsx 查看文件

@@ -0,0 +1,69 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker,message,Checkbox,Row, Col } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../style/GoodsList.less';
5
+import moment from 'moment';
6
+import router from 'umi/router';
7
+import BuildSelect from '../../components/SelectButton/BuildSelect'
8
+import XForm, { FieldTypes } from '../../components/XForm';
9
+import Wangedit from '../../components/Wangedit/Wangedit'
10
+import request from '../../utils/request'
11
+import SelectCity from '../../components/SelectButton/CitySelect'
12
+
13
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
14
+/**
15
+ *
16
+ *
17
+ * @param {*} props
18
+ * @returns
19
+ */
20
+ const Edit = (props) => {
21
+  const [ data, setData ] = useState([])
22
+
23
+  const changBuilding = (buildingId) => {
24
+    request({
25
+      url: '/api/admin/tdBizEventIntention',
26
+      method: 'GET',
27
+      params: {pageNum: 1, pageSize: 999,buildingId}
28
+    }).then((data) => {
29
+      console.log(data)
30
+      setData(data.records)
31
+    })
32
+  }
33
+
34
+  return (
35
+    <>
36
+    <Row>
37
+      <Col span={12}>
38
+        <BuildSelect onChange={changBuilding}/>
39
+      </Col>
40
+    </Row>
41
+    <Row>
42
+      <Col span={6} offset={6}>
43
+        用户操作
44
+      </Col>
45
+      <Col span={6} offset={6}>
46
+        意向值
47
+      </Col>
48
+    </Row>
49
+    {data.map((x) => {
50
+      console.log(x)
51
+      return <Row>
52
+                <Col span={6} offset={6}>
53
+                {x.eventName}
54
+                </Col>
55
+                <Col span={6} offset={6}>
56
+                  {x.intention}
57
+                </Col>
58
+              </Row>
59
+    })}
60
+    <Row>
61
+      <Button type="primary" className={styles.searchBtn} >确定</Button>
62
+    </Row>
63
+    </>
64
+  );
65
+ }
66
+
67
+
68
+
69
+export default Edit