张延森 4 年前
父节点
当前提交
a3b0ef7c05

+ 11
- 0
config/routes.js 查看文件

@@ -203,6 +203,17 @@ export default [
203 203
                 name: '联系方式',
204 204
                 component: './property/contact'
205 205
               },
206
+              {
207
+                path: 'life-consultant',
208
+                name: '管家评分',
209
+                component: './property/lifeConsultant'
210
+              },
211
+              {
212
+                path: 'life-consultant/score',
213
+                name: '打分详情',
214
+                component: './property/lifeConsultant/Score',
215
+                hideInMenu: true,
216
+              },
206 217
             ]
207 218
           },
208 219
           {

+ 4
- 1
src/pages/property/components/Search.jsx 查看文件

@@ -25,13 +25,16 @@ export default Form.create()(props => {
25 25
         <div style={{ flex: 'none', maxWidth: 'calc(100% - 180px)' }}>
26 26
           {props.render(props.form)}
27 27
         </div>
28
-        <div style={{ flex: 'none', width: '180px' }}>
28
+        <div style={{ flex: 'none', minWidth: '180px' }}>
29 29
           <Form.Item>
30 30
             <Button type="primary" htmlType="submit">搜索</Button>
31 31
           </Form.Item>
32 32
           <Form.Item>
33 33
             <Button onClick={handleReset}>重置</Button>
34 34
           </Form.Item>
35
+          {
36
+            (props.actions || []).map((Act, inx) => (<Form.Item key={inx}>{Act}</Form.Item>))
37
+          }
35 38
         </div>
36 39
       </div>
37 40
     </Form>

+ 87
- 0
src/pages/property/lifeConsultant/Score.jsx 查看文件

@@ -0,0 +1,87 @@
1
+import React, { useState, useEffect } from 'react'
2
+import { Select, Spin, Table, Button, Form, Input, Divider, Modal, Rate, Popconfirm } from 'antd'
3
+import NavLink from 'umi/navlink'
4
+import router from 'umi/router'
5
+import { fetchList, apis, fetch } from '@/utils/request'
6
+import Search from '../components/Search'
7
+import List from '../components/List'
8
+
9
+const lifeConsultantEvaluate = fetchList(apis.propUser.lifeConsultantEvaluate)
10
+
11
+const Condition = props => {
12
+  return (
13
+    <Search
14
+      onSearch={props.onSearch}
15
+      onReset={props.onReset}
16
+      render={form => {
17
+        const { getFieldDecorator } = form
18
+        
19
+        return (
20
+          <>
21
+            <Form.Item label="月份">
22
+            {
23
+              getFieldDecorator('evaluateTime')(<Input placeholder="月份-格式202006" />)
24
+            }
25
+            </Form.Item>
26
+          </>
27
+        )
28
+      }}
29
+      actions={[
30
+        <Button onClick={() => router.go(-1)}>返回</Button>
31
+      ]}
32
+    />
33
+  )
34
+}
35
+
36
+export default props => {
37
+  const [loading, setLoading] = useState(false)
38
+  const [listData, setListData] = useState([])
39
+  const [pagination, setPagination] = useState({})
40
+  const [queryParams, setQueryParams] = useState({ pageNum: 1, pageSize: 10 })
41
+
42
+  const { userId } = props.location.query
43
+
44
+  const handleSearch = vals => {
45
+    setQueryParams({
46
+      ...queryParams,
47
+      ...vals,
48
+      pageNum: 1,
49
+    })
50
+  }
51
+
52
+  const handlePageChange = (pageNum, pageSize) => {
53
+    setQueryParams({
54
+      ...queryParams,      
55
+      pageNum,
56
+      pageSize,
57
+    })
58
+  }
59
+
60
+  useEffect(() => {
61
+    setLoading(true)
62
+    lifeConsultantEvaluate({...queryParams, userId}).then(res => {
63
+      const [list, pageInfo] = res || {}
64
+      setListData(list)
65
+      setPagination(pageInfo)
66
+      setLoading(false)
67
+    }).catch(() => setLoading(false))
68
+  }, [queryParams])
69
+
70
+  return (
71
+    <div>
72
+      <Condition onSearch={handleSearch} onReset={handleSearch} />
73
+      <div style={{ margin: '24px 0' }}>
74
+        {/* <NavLink to={`/staff/editStaff`}>
75
+          <Button type="primary">添加管家</Button>
76
+        </NavLink> */}
77
+      </div>
78
+      <List dataSource={listData} loading={loading} pagination={pagination} onPageChange={handlePageChange} rowKey="id">
79
+        <Table.Column title="评价人" dataIndex="personName" key="personName" />
80
+        <Table.Column title="月份" dataIndex="evaluateTime" key="evaluateTime" />
81
+        <Table.Column title="评分" dataIndex="score" key="score" render={t => <Rate disabled value={t} />} />
82
+        <Table.Column title="评分时间" dataIndex="createDate" key="createDate" />
83
+      </List>
84
+
85
+    </div>
86
+  )
87
+}

+ 99
- 0
src/pages/property/lifeConsultant/index.jsx 查看文件

@@ -0,0 +1,99 @@
1
+import React, { useState, useEffect } from 'react'
2
+import { Select, Spin, Table, Button, Form, Input, Divider, Modal, Rate, Popconfirm } from 'antd'
3
+import NavLink from 'umi/navlink'
4
+import { fetchList, apis, fetch } from '@/utils/request'
5
+import Search from '../components/Search'
6
+import List from '../components/List'
7
+
8
+const lifeConsultant = fetchList(apis.propUser.lifeConsultant)
9
+
10
+const Condition = props => {
11
+  return (
12
+    <Search
13
+      onSearch={props.onSearch}
14
+      onReset={props.onReset}
15
+      render={form => {
16
+        const { getFieldDecorator } = form
17
+        
18
+        return (
19
+          <>
20
+            <Form.Item label="管家名称">
21
+            {
22
+              getFieldDecorator('userName')(<Input placeholder="管家名称" />)
23
+            }
24
+            </Form.Item>
25
+            <Form.Item label="手机号">
26
+            {
27
+              getFieldDecorator('phone')(<Input placeholder="手机号" />)
28
+            }
29
+            </Form.Item>
30
+          </>
31
+        )
32
+      }}
33
+    />
34
+  )
35
+}
36
+
37
+export default props => {
38
+  const [loading, setLoading] = useState(false)
39
+  const [listData, setListData] = useState([])
40
+  const [pagination, setPagination] = useState({})
41
+  const [queryParams, setQueryParams] = useState({ pageNum: 1, pageSize: 10 })
42
+
43
+  const handleSearch = vals => {
44
+    setQueryParams({
45
+      ...queryParams,
46
+      ...vals,
47
+      pageNum: 1,
48
+    })
49
+  }
50
+
51
+  const handlePageChange = (pageNum, pageSize) => {
52
+    setQueryParams({
53
+      ...queryParams,      
54
+      pageNum,
55
+      pageSize,
56
+    })
57
+  }
58
+
59
+  useEffect(() => {
60
+    setLoading(true)
61
+    lifeConsultant(queryParams).then(res => {
62
+      const [list, pageInfo] = res || {}
63
+      setListData(list)
64
+      setPagination(pageInfo)
65
+      setLoading(false)
66
+    }).catch(() => setLoading(false))
67
+  }, [queryParams])
68
+
69
+  return (
70
+    <div>
71
+      <Condition onSearch={handleSearch} onReset={handleSearch} />
72
+      <div style={{ margin: '24px 0' }}>
73
+        {/* <NavLink to={`/staff/editStaff`}>
74
+          <Button type="primary">添加管家</Button>
75
+        </NavLink> */}
76
+      </div>
77
+      <List dataSource={listData} loading={loading} pagination={pagination} onPageChange={handlePageChange} rowKey="id">
78
+        <Table.Column title="管家名称" dataIndex="userName" key="userName" />
79
+        <Table.Column title="电话" dataIndex="phone" key="phone" />
80
+        <Table.Column title="说明" dataIndex="description" key="description" />
81
+        <Table.Column title="月评分" dataIndex="averageScore" key="averageScore" render={t => <Rate disabled value={t} />} />
82
+        <Table.Column
83
+          title="操作"
84
+          key="action"
85
+          render={(_, row) => {
86
+            return (
87
+              <>
88
+                <NavLink to={`/property/life-consultant/score?userId=${row.userId}`}>
89
+                  <Button type="link">评分详情</Button>
90
+                </NavLink>
91
+              </>
92
+            )
93
+          }}
94
+        />
95
+      </List>
96
+
97
+    </div>
98
+  )
99
+}

+ 3
- 3
src/pages/property/notice/index.jsx 查看文件

@@ -121,10 +121,10 @@ export default props => {
121 121
             return StatusDict[row.status]
122 122
           }}
123 123
         />
124
-        <Table.Column title="发布时间" dataIndex="createDate" key="createDate" />
125
-        <Table.Column title="发布人" dataIndex="createUserName" key="createUserName" />
124
+        <Table.Column title="创建时间" dataIndex="createDate" key="createDate" />
125
+        {/* <Table.Column title="发布人" dataIndex="createUserName" key="createUserName" />
126 126
         <Table.Column title="修改时间" dataIndex="updateDate" key="updateDate" />
127
-        <Table.Column title="修改人" dataIndex="updateDateName" key="updateDateName" />
127
+        <Table.Column title="修改人" dataIndex="updateDateName" key="updateDateName" /> */}
128 128
         <Table.Column
129 129
           title="操作"
130 130
           key="action"

+ 4
- 4
src/pages/staff/list/editStaff.jsx 查看文件

@@ -220,10 +220,10 @@ const Edit = (props) => {
220 220
           label: '物业相关',
221 221
           value: 'prop'
222 222
         },
223
-        {
224
-          label: '维修工人',
225
-          value: 'worker'
226
-        },
223
+        // {
224
+        //   label: '维修工人',
225
+        //   value: 'worker'
226
+        // },
227 227
       ]
228 228
     },
229 229
     {

+ 13
- 1
src/services/prop_user_api.js 查看文件

@@ -29,6 +29,18 @@ export default prefix => {
29 29
       url: `${prefix}/${moduleName}/hasOwner`,
30 30
       method: 'get',
31 31
       action: `admin.${moduleName}.hasOwner`
32
-    }
32
+    },
33
+
34
+    lifeConsultant: {
35
+      url: `${prefix}/life-consultant/list`,
36
+      method: 'get',
37
+      action: `admin.lifeConsultant.get`
38
+    },
39
+
40
+    lifeConsultantEvaluate: {
41
+      url: `${prefix}/tpLifeConsultantEvaluate`,
42
+      method: 'get',
43
+      action: `admin.lifeConsultantEvaluate.get`
44
+    },
33 45
   }
34 46
 }

+ 1
- 0
src/utils/request.js 查看文件

@@ -8,6 +8,7 @@ import { AMapAPIPrefix } from './constant'
8 8
 import apis from '../services/apis';
9 9
 import mixStr from './mixStr';
10 10
 
11
+
11 12
 const codeMessage = {
12 13
   200: '服务器成功返回请求的数据。',
13 14
   201: '新建或修改数据成功。',