Преглед изворни кода

Merge branch 'master' of http://git.ycjcjy.com/xiangsong/xs-manage

Your Name пре 4 година
родитељ
комит
78f18018df

+ 3
- 3
src/pages/news/list/NewsList.jsx Прегледај датотеку

@@ -232,12 +232,12 @@ function body(props) {
232 232
 
233 233
           <p style={{ fontSize: ' 0.106rem', color: '#555', marginBottom: '8px', display: 'flex', alignItems: 'center' }}>
234 234
             <span style={{ display: 'inline-block', width: '50%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>阅读数量:{data.pvNum}</span>
235
-            <span>转发数量:{data.shareNum}</span>
235
+            {/* <span>转发数量:{data.shareNum}</span> */}
236 236
           </p>
237 237
 
238 238
           <p style={{ fontSize: ' 0.106rem', color: '#555', marginBottom: '8px', display: 'flex', alignItems: 'center' }}>
239
-            {/* <span style={{ display: 'inline-block', width: '50%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>点赞数量:{data.favorNum}</span> */}
240
-            <span>收藏数量:{data.saveNum}</span>
239
+            {/* <span style={{ display: 'inline-block', width: '50%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>点赞数量:{data.favorNum}</span>
240
+            <span>收藏数量:{data.saveNum}</span> */}
241 241
           </p>
242 242
 
243 243
           <p style={{ fontSize: ' 0.106rem', color: '#999', marginBottom: '8px' }}>发布时间:{moment(data.createDate).format('YYYY-MM-DD HH:mm:ss')}</p>

+ 3
- 2
src/pages/property/bill/info/index.jsx Прегледај датотеку

@@ -1,5 +1,6 @@
1 1
 import React, { useEffect, useRef, useState } from 'react'
2 2
 import { PageHeader, Button, Descriptions, Typography, Select, Icon, Table, Modal, Form, Input, Popconfirm, Divider, notification } from 'antd'
3
+import moment from 'moment'
3 4
 import { fetch, fetchList, apis } from '@/utils/request'
4 5
 import NavLink from 'umi/navlink'
5 6
 import Prompt from '@/components/Prompt'
@@ -315,9 +316,9 @@ export default props => {
315 316
           <Table.Column title="缴费途径" dataIndex="payType" key="payType" render={t => getDictLabel(PayTypeDict, t)} />
316 317
           <Table.Column title="缴费人" dataIndex="payName" key="payName" />
317 318
           <Table.Column title="缴费时间" dataIndex="payDate" key="payDate" />
318
-          <Table.Column title="新建时间" dataIndex="createDate" key="createDate" />
319
+          <Table.Column title="新建时间" dataIndex="createDate" key="createDate" render={t => moment(t).format('YYYY-MM-DD HH:mm')} />
319 320
           <Table.Column title="新建人" dataIndex="createUserName" key="createUserName" />
320
-          <Table.Column title="修改时间" dataIndex="updateDate" key="updateDate" />
321
+          <Table.Column title="修改时间" dataIndex="updateDate" key="updateDate" render={t => moment(t).format('YYYY-MM-DD HH:mm')}/>
321 322
           <Table.Column title="修改人" dataIndex="updateUserName" key="updateUserName" />
322 323
           <Table.Column
323 324
             title="操作"

+ 16
- 11
src/pages/property/message/event/Editor.jsx Прегледај датотеку

@@ -26,7 +26,7 @@ const tailFormItemLayout = {
26 26
 }
27 27
 
28 28
 export default Form.create()(props => {
29
-  const [evtType, setEvtType] = useState()
29
+  const [evtType, setEvtType] = useState('festival')
30 30
 
31 31
   const handleSubmit = e => {
32 32
     e.preventDefault()
@@ -34,7 +34,8 @@ export default Form.create()(props => {
34 34
       if (!err) {
35 35
         props.onSubmit({
36 36
           ...(props.dataSource || {}),
37
-          ...values
37
+          ...values,
38
+          evtType,
38 39
         })
39 40
       }
40 41
     })
@@ -44,15 +45,15 @@ export default Form.create()(props => {
44 45
     if (props.visible) {
45 46
       const data = props.dataSource || {}
46 47
       props.form.setFieldsValue(data)
47
-      setEvtType(data.evtType)
48
+      // setEvtType(data.evtType)
48 49
     }
49 50
   }, [props.dataSource, props.visible])
50 51
 
51 52
   return (
52 53
     <Modal  footer={null} maskClosable={false} onCancel={props.onCancel} visible={props.visible}>
53 54
       <Form onSubmit={handleSubmit} {...formItemLayout}>
54
-        <Form.Item label="类型">
55
-          {
55
+        <Form.Item label="类型">节日
56
+          {/* {
56 57
             props.form.getFieldDecorator('evtType', {
57 58
               rules: [{required: true, message: '请选择类型'}]
58 59
             })(
@@ -61,7 +62,7 @@ export default Form.create()(props => {
61 62
                 <Select.Option value="birthday">生日</Select.Option>
62 63
               </Select>
63 64
             )
64
-          }
65
+          } */}
65 66
         </Form.Item>
66 67
         <Form.Item label="名称">
67 68
           {
@@ -72,9 +73,11 @@ export default Form.create()(props => {
72 73
         </Form.Item>
73 74
         {
74 75
           evtType === 'festival' &&
75
-          <Form.Item label="发生日" help="mm-dd格式">
76
+          <Form.Item label="发生日" help="格式示例: 06-01">
76 77
             {
77
-              props.form.getFieldDecorator('evtDate')(<Input placeholder="mm-dd格式" />)
78
+              props.form.getFieldDecorator('evtDate', {
79
+                rules: [{required: true, message: '请填写发生日期'}]
80
+              })(<Input placeholder="格式示例: 08-15" />)
78 81
             }
79 82
           </Form.Item>
80 83
         }
@@ -82,7 +85,9 @@ export default Form.create()(props => {
82 85
           evtType === 'festival' &&
83 86
           <Form.Item label="是否阳历">
84 87
             {
85
-              props.form.getFieldDecorator('isSolar')(
88
+              props.form.getFieldDecorator('isSolar', {
89
+                rules: [{required: true, message: '请选择阴阳历'}]
90
+              })(
86 91
                 <Radio.Group>
87 92
                   <Radio value={true}>阳历</Radio>
88 93
                   <Radio value={false}>阴历</Radio>
@@ -91,11 +96,11 @@ export default Form.create()(props => {
91 96
             }
92 97
           </Form.Item>
93 98
         }
94
-        <Form.Item label="祝福语">
99
+        <Form.Item label="祝福语" help="示例: 祝您中秋节快乐">
95 100
           {
96 101
             props.form.getFieldDecorator('wishes', {
97 102
               rules: [{required: true, message: '请填写祝福语'}]
98
-            })(<Input placeholder="建议4-12个字, 比如祝您中秋节快乐" />)
103
+            })(<Input placeholder="建议4-12个字" />)
99 104
           }
100 105
         </Form.Item>
101 106
         <Form.Item {...tailFormItemLayout}>

+ 37
- 0
src/pages/property/message/event/components/Preview.jsx Прегледај датотеку

@@ -0,0 +1,37 @@
1
+import React, { useEffect, useState } from 'react'
2
+import moment from 'moment'
3
+import { Modal } from 'antd'
4
+import Styles from './style.less'
5
+
6
+export default props => {
7
+  const baseURL = props.dataSource.evtType === 'birthday'
8
+    ? 'https://xs.ycjcjy.com/shengrih5.html'
9
+    : 'https://xs.ycjcjy.com/jierih5.html'
10
+
11
+  const queryString = [
12
+    `name=${encodeURIComponent(' 张xx (先生)')}`,
13
+    `date=${moment().format('YYYY-MM-DD')}`,
14
+    `org=${encodeURIComponent(props.dataSource.org || '')}`,
15
+    `festival=${encodeURIComponent(props.dataSource.name || '')}`,
16
+  ].join('&')
17
+
18
+  const url = [baseURL, queryString].join('?')
19
+
20
+  return (
21
+    <Modal
22
+      title="祝福模板预览"
23
+      width={423}
24
+      visible={props.visible}
25
+      footer={null}
26
+      onOk={props.onOk}
27
+      onCancel={props.onCancel}
28
+    >
29
+      <iframe
30
+        src={url}
31
+        frameborder="0"
32
+        scrolling="no"
33
+        className={Styles['message-tpl-preview']}
34
+      />
35
+    </Modal>
36
+  )
37
+}

+ 12
- 0
src/pages/property/message/event/components/style.less Прегледај датотеку

@@ -0,0 +1,12 @@
1
+.message-tpl-preview {
2
+  width: 375px;
3
+  height: 667px;
4
+  top: 0;
5
+  left: 0;
6
+  overflow: hidden;
7
+  scrollbar-width: none;
8
+
9
+  &::-webkit-scrollbar {
10
+    display: none;
11
+  }
12
+}

+ 35
- 14
src/pages/property/message/event/index.jsx Прегледај датотеку

@@ -1,10 +1,12 @@
1 1
 import React, { useState, useEffect, useRef } from 'react'
2 2
 import { Select, Spin, Table, Button, Form, Input, Divider, Tag, Modal,Popconfirm } from 'antd'
3
+import { connect } from 'dva';
3 4
 import NavLink from 'umi/navlink'
4 5
 import { fetch, apis, fetchList } from '@/utils/request'
5 6
 import Search from '../../components/Search'
6 7
 import List from '../../components/List'
7 8
 import Editor from './Editor'
9
+import Preview from './components/Preview'
8 10
 
9 11
 const listMessageEvent = fetchList(apis.announcement.messageEvent.list)
10 12
 const saveMessageEvent = fetch(apis.announcement.messageEvent.save)
@@ -57,12 +59,14 @@ const Condition = props => {
57 59
   )
58 60
 }
59 61
 
60
-export default props => {
62
+export default connect(({user}) => ({user}))(props => {
61 63
   const [loading, setLoading] = useState(false)
62 64
   const [listData, setListData] = useState([])
63 65
   const [pagination, setPagination] = useState({})
64 66
   const [queryParams, setQueryParams] = useState({ pageNum: 1, pageSize: 10 })
65 67
   const [showEditor, setShowEditor] = useState(false)
68
+  const [showPreview, setShowPreview] = useState(false)
69
+  const currentRow = useRef({})
66 70
 
67 71
   const handleSearch = vals => {
68 72
     setQueryParams({
@@ -72,6 +76,14 @@ export default props => {
72 76
     })
73 77
   }
74 78
 
79
+  const handleNameClick = row => {
80
+    currentRow.current = {
81
+      ...row,
82
+      org: props.user.currentUser.orgName
83
+    }
84
+    setShowPreview(true)
85
+  }
86
+
75 87
   const handleSubmit = data => {
76 88
     saveMessageEvent({data}).then(res => {
77 89
       Modal.success({
@@ -90,7 +102,7 @@ export default props => {
90 102
     const data = {...row, status}
91 103
     updateMessageEvent({data, urlData: {id: row.evtId}}).then(res => {
92 104
       Modal.success({
93
-        content: '删除内容成功',
105
+        content: '操作成功',
94 106
         onOk: () => {
95 107
           // 触发数据刷新
96 108
           setQueryParams({...queryParams})
@@ -100,7 +112,7 @@ export default props => {
100 112
   }
101 113
 
102 114
   const handleDeleteRow = row => {
103
-    deleteAnnouncement({urlData: {id: row.evtId}}).then(res => {
115
+    deleteMessageEvent({urlData: {id: row.evtId}}).then(res => {
104 116
       Modal.success({
105 117
         content: '删除内容成功',
106 118
         onOk: () => {
@@ -137,7 +149,9 @@ export default props => {
137 149
       </div>
138 150
       <List dataSource={listData} loading={loading} pagination={pagination} onPageChange={handlePageChange} rowKey="evtId">
139 151
         <Table.Column title="类型" dataIndex="evtType" key="evtType" render={t => EvtTypeDict[t] || ''} />
140
-        <Table.Column title="名称" dataIndex="name" key="name" />
152
+        <Table.Column title="名称" dataIndex="name" key="name" render={(t, row) => {
153
+          return <Button type="link" onClick={() => handleNameClick(row)}>{t}</Button>
154
+        }} />
141 155
         <Table.Column title="发生日" dataIndex="evtDate" key="evtDate" render={(_, row) => {
142 156
           return row.evtDate && (
143 157
             <span>
@@ -156,15 +170,21 @@ export default props => {
156 170
           render={(_, row) => {
157 171
             return (
158 172
               <>
159
-                <Popconfirm
160
-                  title="确认进行作废操作?"
161
-                  onConfirm={() => handleDeleteRow(row)}
162
-                  okText="作废"
163
-                  cancelText="取消"
164
-                >
165
-                  <Button type="link">删除</Button>
166
-                </Popconfirm>
167
-                <Divider type="vertical" />
173
+                {
174
+                  row.evtType !== 'birthday' && (
175
+                    <>
176
+                      <Popconfirm
177
+                        title="确认进行删除操作?"
178
+                        onConfirm={() => handleDeleteRow(row)}
179
+                        okText="删除"
180
+                        cancelText="取消"
181
+                      >
182
+                        <Button type="link">删除</Button>
183
+                      </Popconfirm>
184
+                      <Divider type="vertical" />
185
+                    </>
186
+                  )
187
+                }
168 188
                 <Button type="link" onClick={() => handleEdit(row)}>{row.status === 1 ? '取消发布' : '发布'}</Button>
169 189
               </>
170 190
             )
@@ -172,6 +192,7 @@ export default props => {
172 192
         />
173 193
       </List>
174 194
       <Editor visible={showEditor} onCancel={() => setShowEditor(false)} onSubmit={handleSubmit} />
195
+      <Preview visible={showPreview} dataSource={currentRow.current} onOk={() => setShowPreview(false)} onCancel={() => setShowPreview(false)} />
175 196
     </div>
176 197
   )
177
-}
198
+})

+ 1
- 1
src/pages/property/news/type/NewsType.jsx Прегледај датотеку

@@ -58,7 +58,7 @@ function NewsType(props) {
58 58
 
59 59
 
60 60
   const changeNewsStatus = (row, newsId) => () => {
61
-    request({ ...propNews.newsType.put, urlData: { id: newsId }, data: { ...row, status: -1 } }).then((data) => {
61
+    request({ ...apis.propNews.newsType.put, urlData: { id: newsId }, data: { ...row, status: -1 } }).then((data) => {
62 62
       message.info('操作成功!')
63 63
       getList({ pageNum: 1, pageSize: 10 });
64 64
     }).catch((err) => {

+ 2
- 1
src/pages/property/notice/Edit.jsx Прегледај датотеку

@@ -89,7 +89,8 @@ export default Form.create()(props => {
89 89
         <Form.Item label="类型">
90 90
         {
91 91
           getFieldDecorator('annType')(
92
-            <Select style={{}} allowClear>
92
+            <Select allowClear>
93
+              <Select.Option value={undefined}></Select.Option>
93 94
               <Select.Option value="notice">提醒</Select.Option>
94 95
             </Select>
95 96
           )

+ 15
- 23
src/pages/property/notice/index.jsx Прегледај датотеку

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react'
2
-import { Select, Spin, Table, Button, Form, Input, Divider, Modal,Popconfirm } from 'antd'
2
+import { Select, Spin, Table, Button, Form, Input, Divider, Modal,Popconfirm, notification } from 'antd'
3 3
 import NavLink from 'umi/navlink'
4 4
 import { fetch, apis } from '@/utils/request'
5 5
 import Search from '../components/Search'
@@ -7,6 +7,7 @@ import List from '../components/List'
7 7
 
8 8
 const listAnnouncement = fetch(apis.announcement.listAnnouncement)
9 9
 const deleteAnnouncement = fetch(apis.announcement.deleteAnnouncement)
10
+const updateannouncement = fetch(apis.announcement.updateannouncement)
10 11
 
11 12
 const Condition = props => {
12 13
   return (
@@ -46,7 +47,7 @@ const Condition = props => {
46 47
 }
47 48
 
48 49
 const StatusDict = {
49
-  '0': '已作废',
50
+  '0': '未发布',
50 51
   '1': '已发布',
51 52
   '2': '草稿'
52 53
 }
@@ -65,15 +66,13 @@ export default props => {
65 66
     })
66 67
   }
67 68
 
68
-  const handleDeleteRow = row => {
69
-    deleteAnnouncement({ data: [row.id] }).then(res => {
70
-      Modal.success({
71
-        content: '删除内容成功',
72
-        onOk: () => {
73
-          // 触发数据刷新
74
-          setQueryParams({...queryParams})
75
-        }
76
-      })
69
+  const handleEditRow = row => {
70
+    updateannouncement({data: {
71
+      ...row,
72
+      status: Math.abs(row.status - 1)
73
+    }}).then(res => {
74
+      notification.success({message: '操作成功'})
75
+      setQueryParams({...queryParams})
77 76
     })
78 77
   }
79 78
 
@@ -88,7 +87,6 @@ export default props => {
88 87
   useEffect(() => {
89 88
     setLoading(true)
90 89
     listAnnouncement({ data: queryParams }).then(res => {
91
-      console.log(res,"222")
92 90
       const { list, ...pageInfo } = res || {}
93 91
       setListData(list)
94 92
       setPagination(pageInfo)
@@ -124,13 +122,7 @@ export default props => {
124 122
           title="状态"
125 123
           dataIndex="status"
126 124
           key="status"
127
-          render={(_, row) => {
128
-            if (row.status === '1' && (row.updateDate > row.createDate)) {
129
-              return '已修改'
130
-            }
131
-
132
-            return StatusDict[row.status]
133
-          }}
125
+          render={(_, row) => StatusDict[row.status]}
134 126
         />
135 127
         <Table.Column title="创建时间" dataIndex="createDate" key="createDate" />
136 128
         {/* <Table.Column title="发布人" dataIndex="createUserName" key="createUserName" />
@@ -143,12 +135,12 @@ export default props => {
143 135
             return (
144 136
               <>
145 137
                 <Popconfirm
146
-                  title="确认进行作废操作?"
147
-                  onConfirm={() => handleDeleteRow(row)}
148
-                  okText="作废"
138
+                  title="确认进行当前操作?"
139
+                  onConfirm={() => handleEditRow(row)}
140
+                  okText="确定"
149 141
                   cancelText="取消"
150 142
                 >
151
-                  <Button type="link">删除</Button>
143
+                  <Button type="link">{row.status === '1' ? '取消发布' : '发布'}</Button>
152 144
                 </Popconfirm>
153 145
                 <Divider type="vertical" />
154 146
                 <NavLink to={`/property/notice/edit?id=${row.id}`}>

+ 3
- 2
src/pages/property/proprietor/Add.jsx Прегледај датотеку

@@ -166,7 +166,8 @@ export default Form.create()(props => {
166 166
           }
167 167
         </Form.Item>
168 168
         <Form.Item label="身份">
169
-          {
169
+          户主
170
+          {/* {
170 171
             props.form.getFieldDecorator('roleId')(
171 172
               <Select style={{ minWidth: '120px' }} placeholder="请选择身份">
172 173
                 <Select.Option value="1" disabled={owerExist}>户主</Select.Option>
@@ -174,7 +175,7 @@ export default Form.create()(props => {
174 175
                 <Select.Option value="3">家属</Select.Option>
175 176
               </Select>
176 177
             )
177
-          }
178
+          } */}
178 179
         </Form.Item>
179 180
         <Form.Item label="姓名">
180 181
           {

+ 4
- 4
src/pages/property/ticket/Detail.jsx Прегледај датотеку

@@ -172,7 +172,7 @@ export default props => {
172 172
                 title={(
173 173
                   <Title title={item.statusName}>
174 174
                     {
175
-                      item.status === '0' && (
175
+                      ticketData.status === '0' && (
176 176
                         <>
177 177
                           <Button type="primary" onClick={() => setShowDispatch(true)}>分配工单</Button>
178 178
                           <Button type="danger" style={{marginLeft: '24px'}} onClick={() => setShowReject(true)}>拒绝受理</Button>
@@ -189,9 +189,9 @@ export default props => {
189 189
                     {
190 190
                       item.status - 0 === 5 && (
191 191
                         <Descriptions column={2}>
192
-                          {/* <Descriptions.Item label="评分"><Rate value={item.score}/></Descriptions.Item> */}
193
-                          <Descriptions.Item label="时间"><Rate value={item.createDate}/></Descriptions.Item>
194
-                          <Descriptions.Item label="评语">{item.comment}</Descriptions.Item>
192
+                          <Descriptions.Item label="评分"><Rate disabled value={ticketData.score - 0}/></Descriptions.Item>
193
+                          {/* <Descriptions.Item label="时间"><div>{item.createDate}</div></Descriptions.Item> */}
194
+                          <Descriptions.Item label="评语">{ticketData.comment}</Descriptions.Item>
195 195
                         </Descriptions>
196 196
                       )
197 197
                     }