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

+ 10
- 10
config/routes.js 查看文件

512
                 hideInMenu: true,
512
                 hideInMenu: true,
513
                 component: './carouselFigure/editCarousel',
513
                 component: './carouselFigure/editCarousel',
514
               },
514
               },
515
-              // {
516
-              //   path: '/carouselFigure/advertisingList',
517
-              //   name: '开屏广告',
518
-              //   component: './carouselFigure/advertisingList',
519
-              // },
515
+              {
516
+                path: '/carouselFigure/advertisingList',
517
+                name: '开屏广告',
518
+                component: './carouselFigure/advertisingList',
519
+              },
520
               {
520
               {
521
                 path: '/carouselFigure/editAdvertising',
521
                 path: '/carouselFigure/editAdvertising',
522
                 name: '开屏广告编辑',
522
                 name: '开屏广告编辑',
523
                 hideInMenu: true,
523
                 hideInMenu: true,
524
                 component: './carouselFigure/editAdvertising',
524
                 component: './carouselFigure/editAdvertising',
525
               },
525
               },
526
-              // {
527
-              //   path: '/carouselFigure/propagandaList',
528
-              //   name: '宣传位',
529
-              //   component: './carouselFigure/propagandaList',
530
-              // },
526
+              {
527
+                path: '/carouselFigure/propagandaList',
528
+                name: '宣传位',
529
+                component: './carouselFigure/propagandaList',
530
+              },
531
               {
531
               {
532
                 path: '/carouselFigure/propaganda',
532
                 path: '/carouselFigure/propaganda',
533
                 name: '宣传位编辑',
533
                 name: '宣传位编辑',

+ 4
- 0
src/global.less 查看文件

72
 .ant-pro-grid-content .ant-pro-page-header-wrap-children-content {
72
 .ant-pro-grid-content .ant-pro-page-header-wrap-children-content {
73
   margin-top: 8px !important;
73
   margin-top: 8px !important;
74
 }
74
 }
75
+
76
+.ant-steps-vertical .ant-steps-item-content {
77
+  width: calc(100% - 100px) !important;
78
+}
75
  
79
  
76
 .ant-layout{
80
 .ant-layout{
77
 //   .ant-menu-vertical .ant-menu-item,
81
 //   .ant-menu-vertical .ant-menu-item,

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

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 getList = fetch(apis.announcement.listAnnouncement)
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({ id: undefined, announcementTitle: '请选择公告' })
19
+  const getActTitle = val => ((list.filter(x => x.id === val)[0]) || {}).announcementTitle || '请选择公告'
20
+  const setAct = val => setActivity({ id: val, announcementTitle: getActTitle(val) })
21
+
22
+  const buildingId = props.buildingId()
23
+
24
+  useEffect(() => {
25
+    getList({
26
+      data: {
27
+        pageNum: 1,
28
+        pageSize: 999,
29
+        announcementTitle: '',
30
+      }
31
+    }).then((data) => {
32
+      setList(data.list || [])
33
+
34
+      console.log('----', buildingId, value)
35
+
36
+      setAct(buildingId ? undefined : value);
37
+    })
38
+  }, [buildingId]);
39
+
40
+  if (value !== activity.id) {
41
+    setAct(value);
42
+  }
43
+  const searchActivity =(e)=>{
44
+    getList({
45
+      data: {
46
+        pageNum: 1,
47
+        pageSize: 999,
48
+        announcementTitle:e
49
+      }
50
+    }).then((data) => {
51
+      setList(data.list || [])
52
+
53
+      console.log('----', buildingId, value)
54
+
55
+      // setAct(buildingId ? undefined : value);
56
+    })
57
+  }
58
+
59
+  let chooseVal = value
60
+
61
+  const handleChange = val => chooseVal = val
62
+
63
+  const setData = val => {
64
+    setAct(val)
65
+    onChange(val)
66
+    setVisible(false)
67
+  }
68
+
69
+  const columns = [
70
+    {
71
+      title: '标题',
72
+      dataIndex: 'announcementTitle',
73
+      key: 'id',
74
+      align: 'center',
75
+      ellipsis: true,
76
+      render: text => <a>{text}</a>,
77
+    },
78
+    {
79
+      title: '操作',
80
+      dataIndex: 'name',
81
+      align: 'center',
82
+      width: '20%',
83
+      render: (text, record) => (
84
+        <Navigate onClick={() => setData(record.id)}>选择</Navigate>
85
+      ),
86
+    },
87
+  ];
88
+
89
+  return (
90
+
91
+    <div>
92
+      <div ><Navigate onClick={() => setVisible(true)}>{activity.announcementTitle}</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 => searchActivity(value)}
104
+          style={{ marginBottom: '16px' }}
105
+        />
106
+        <Table rowKey={list => list.id} columns={columns} dataSource={list} />
107
+      </Modal>
108
+    </div>
109
+
110
+  );
111
+}

+ 104
- 0
src/pages/carouselFigure/SelectTpNews.jsx 查看文件

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.propNews.getNewsList)
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
+        pageNum: 1,
42
+        pageSize: 999,
43
+        newsName: e
44
+      },
45
+    }).then(data => {
46
+      setList(data.records || [])
47
+
48
+      updateNews(buildingId ? undefined : value);
49
+    })
50
+  }
51
+  if (value !== news.newsId) {
52
+    updateNews(value);
53
+  }
54
+
55
+  const handleChange = val => {
56
+    onChange(val)
57
+  }
58
+
59
+  const setData = val => {
60
+    updateNews(val)
61
+    onChange(val)
62
+    setVisible(false)
63
+  }
64
+
65
+  const columns = [
66
+    {
67
+      title: '标题',
68
+      dataIndex: 'newsName',
69
+      key: 'newsId',
70
+      align: 'center',
71
+      ellipsis: true,
72
+      render: text => <a>{text}</a>,
73
+    },
74
+    {
75
+      title: '操作',
76
+      align: 'center',
77
+      width: '20%',
78
+      render: (text, record) => (
79
+        <Navigate onClick={() => setData(record.newsId)}>选择</Navigate>
80
+      ),
81
+    },
82
+  ];
83
+
84
+  return (
85
+    <div>
86
+      <div ><Navigate onClick={() => setVisible(true)}>{news.newsName}</Navigate></div>
87
+      <Modal
88
+        title="请选择"
89
+        visible={visible}
90
+        onCancel={() => setVisible(false)}
91
+        footer={[]}
92
+      >
93
+        <Search
94
+          placeholder="请输入标题"
95
+          enterButton="搜索"
96
+          size="large"
97
+          onSearch={value => searchActivity(value)}
98
+          style={{ marginBottom: '16px' }}
99
+        />
100
+        <Table rowKey={list => list.newsId} columns={columns} dataSource={list} />
101
+      </Modal>
102
+    </div>
103
+  );
104
+}

+ 28
- 22
src/pages/carouselFigure/advertisingList.jsx 查看文件

15
 const { Option } = Select;
15
 const { Option } = Select;
16
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
16
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
17
 
17
 
18
+const ContentTypeDict = {
19
+  'notice': '公告',
20
+  'tpNews': '服务',
21
+  'activity': '活动',
22
+  'news': '资讯'
23
+}
24
+
18
 const header = (props) => {
25
 const header = (props) => {
19
   const [data, setData] = useState({})
26
   const [data, setData] = useState({})
20
   //   const [page, changePage] = useState({})
27
   //   const [page, changePage] = useState({})
50
       align: 'center',
57
       align: 'center',
51
       render: (image,row) => <Navigate onClick={toEdit(row.contentId)}><img src={image} className={styles.imgSmall} /></Navigate>,
58
       render: (image,row) => <Navigate onClick={toEdit(row.contentId)}><img src={image} className={styles.imgSmall} /></Navigate>,
52
     },
59
     },
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
-    },
60
+    // {
61
+    //   title: '发布城市',
62
+    //   dataIndex: 'cityName',
63
+    //   key: 'cityName',
64
+    //   align: 'center',
65
+    // },
66
+    // {
67
+    //   title: '关联项目',
68
+    //   dataIndex: 'buildingName',
69
+    //   key: 'buildingName',
70
+    //   align: 'center',
71
+    //   render: (buildingName) => <span>{buildingName === null ? '无' : buildingName}</span>
72
+    // },
66
     {
73
     {
67
       title: '关联内容类型',
74
       title: '关联内容类型',
68
       dataIndex: 'contentType',
75
       dataIndex: 'contentType',
69
       key: 'contentType',
76
       key: 'contentType',
70
       align: 'center',
77
       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>
78
+      render: x => <span>{ContentTypeDict[x] || '无'}</span>
80
     },
79
     },
80
+    // {
81
+    //   title: '发布位置',
82
+    //   dataIndex: 'showPosition',
83
+    //   key: 'showPosition',
84
+    //   align: 'center',
85
+    //   render: (showPosition) => <span>{ showPosition === 'index' ? '首页' : showPosition === 'building' ? '项目' : '' }</span>
86
+    // },
81
     {
87
     {
82
       title: '发布时间',
88
       title: '发布时间',
83
       dataIndex: 'createDate',
89
       dataIndex: 'createDate',

+ 217
- 183
src/pages/carouselFigure/editAdvertising.jsx 查看文件

15
 import SelectHelp from './SelectHelp';
15
 import SelectHelp from './SelectHelp';
16
 import SelectGroup from './SelectGroup';
16
 import SelectGroup from './SelectGroup';
17
 import SelectH5 from './SelectH5';
17
 import SelectH5 from './SelectH5';
18
+import SelectNotice from './SelectNotice';
19
+import SelectTpNews from './SelectTpNews';
18
 import SalesBatchGroup from './SalesBatchGroup';
20
 import SalesBatchGroup from './SalesBatchGroup';
19
 import LiveGroup from './LiveGroup';
21
 import LiveGroup from './LiveGroup';
20
 /**
22
 /**
32
   let salesBatchVisible = false
34
   let salesBatchVisible = false
33
   let liveVisible = false
35
   let liveVisible = false
34
   let h5Visible = false
36
   let h5Visible = false
37
+  let noticeVisible = false
38
+  let tpNewsVisible = false
35
   let buildingId = ''
39
   let buildingId = ''
36
   let cityId = ''
40
   let cityId = ''
37
   let isHaveActive = false
41
   let isHaveActive = false
68
     salesBatchVisible = data.contentType === 'salesBatch';
72
     salesBatchVisible = data.contentType === 'salesBatch';
69
     liveVisible = data.contentType === 'live';
73
     liveVisible = data.contentType === 'live';
70
     h5Visible = data.contentType === 'h5';
74
     h5Visible = data.contentType === 'h5';
75
+    noticeVisible = data.contentType === 'notice';
76
+    tpNewsVisible = data.contentType === 'tpNews';
71
 
77
 
72
     cityId = data.cityId
78
     cityId = data.cityId
73
     // console.log(data.buildingId, ' data.buildingId')
79
     // console.log(data.buildingId, ' data.buildingId')
78
     console.log(data, "data.buildingIddata.buildingId2")
84
     console.log(data, "data.buildingIddata.buildingId2")
79
     islet = data.isHaveActive
85
     islet = data.isHaveActive
80
 
86
 
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
-    }
87
+    // if ((data.contentType === 'h5' && data.buildingId == null) || data.contentType === '' || data.contentType === 'nothing' || (data.contentType === 'live' && data.buildingId == null)) {
88
+    //   isHaveActive = false
89
+    // } else {
90
+    //   isHaveActive = true
91
+    // }
86
     // if (!isHaveActivea && data.contentType === 'h5') {
92
     // if (!isHaveActivea && data.contentType === 'h5') {
87
     //   // data.contentType=null
93
     //   // data.contentType=null
88
     //   data.buildingId = null
94
     //   data.buildingId = null
95
     //     data.buildingId = null
101
     //     data.buildingId = null
96
     //   }
102
     //   }
97
     // }
103
     // }
98
-    if (data.showPosition == 'index') {
99
-      isHavePosition = true;
100
-    } else {
101
-      isHavePosition = false;
102
-    }
104
+    // if (data.showPosition == 'index') {
105
+    //   isHavePosition = true;
106
+    // } else {
107
+    //   isHavePosition = false;
108
+    // }
103
 
109
 
104
     contentVisible = data.contentType === 'other';
110
     contentVisible = data.contentType === 'other';
105
     activityVisible = data.contentType === 'activity';
111
     activityVisible = data.contentType === 'activity';
109
     salesBatchVisible = data.contentType === 'salesBatch';
115
     salesBatchVisible = data.contentType === 'salesBatch';
110
     liveVisible = data.contentType === 'live';
116
     liveVisible = data.contentType === 'live';
111
     h5Visible = data.contentType === 'h5';
117
     h5Visible = data.contentType === 'h5';
118
+    noticeVisible = data.contentType === 'notice';
119
+    tpNewsVisible = data.contentType === 'tpNews';
112
 
120
 
113
     console.log(data.buildingId, ' data.buildingId')
121
     console.log(data.buildingId, ' data.buildingId')
114
     buildingId = data.buildingId
122
     buildingId = data.buildingId
150
     }
158
     }
151
 
159
 
152
     const fields = [
160
     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
-      },
161
+      // {
162
+      //   label: '是否关联项目',
163
+      //   name: 'isHaveActive',
164
+      //   type: FieldTypes.Switch,
165
+      //   value: isHaveActive,
166
+      //   hidden: () => !isCanChoose,
167
+      //   props: {
168
+      //     onChange: () => {
169
+      //       const type = formRef.current.props.form.getFieldValue('contentType')
170
+      //       if (formRef.current && (type !== 'live' && type !== 'h5')) {
171
+      //         console.log(formRef.current.props.form.getFieldValue('contentType'), '2222')
172
+      //         formRef.current.props.form.resetFields(['contentType', []]);
173
+      //       }
174
+      //     },
175
+      //   },
176
+      //   rules: [
177
+      //     { required: true, message: '是否城市活动' },
178
+      //   ],
179
+      // },
180
+      // {
181
+      //   label: '发布位置',
182
+      //   name: 'showPosition',
183
+      //   type: FieldTypes.Select,
184
+      //   value: isHaveActive,
185
+      //   dict: [{
186
+      //     label: '首页',
187
+      //     value: 'index',
188
+      //   },
189
+      //   {
190
+      //     label: '项目',
191
+      //     value: 'building',
192
+      //   }],
193
+      //   value: data.showPosition,
194
+      //   rules: [
195
+      //     { required: true, message: '请选择发布位置' },
196
+      //   ],
197
+      // },
198
+      // {
199
+      //   label: '所属项目',
200
+      //   name: 'buildingId',
201
+      //   render: <BuildSelect />,
202
+      //   value: data.buildingId,
203
+      //   hidden: () => !isHaveActive && isHavePosition,
204
+      //   rules: [
205
+      //     { required: true, message: '请选择所属项目' },
206
+      //   ],
207
+      // },
208
+      // {
209
+      //   label: '展示城市',
210
+      //   name: 'cityId',
211
+      //   render: <CitySelect />,
212
+      //   hidden: () => !isHavePosition || isHaveActive,
213
+      //   value: data.cityId,
214
+      //   rules: [
215
+      //     { required: true, message: '请选择展示城市' },
216
+      //   ],
217
+      // },
210
       {
218
       {
211
         label: '开屏广告',
219
         label: '开屏广告',
212
         name: 'image',
220
         name: 'image',
217
           { required: true, message: '请上传图片' },
225
           { required: true, message: '请上传图片' },
218
         ],
226
         ],
219
       },
227
       },
228
+      // {
229
+      //   label: '类型',
230
+      //   name: 'contentType',
231
+      //   type: FieldTypes.Select,
232
+      //   hidden: () => isHaveActive,
233
+      //   dict: [{
234
+      //     label: 'H5活动详情',
235
+      //     value: 'h5',
236
+      //   },
237
+      //   {
238
+      //     label: '直播活动详情',
239
+      //     value: 'live',
240
+      //   },
241
+      //   {
242
+      //     label: '其它',
243
+      //     value: 'others',
244
+      //   }],
245
+      //   value: data.contentType,
246
+      //   rules: [
247
+      //     { required: true, message: '请选择类型' },
248
+      //   ],
249
+      // },
250
+      // {
251
+      //   label: '标题',
252
+      //   name: 'title',
253
+      //   type: FieldTypes.Text,
254
+      //   hidden: true,
255
+      //   value: data.title,
256
+      //   rules: [
257
+      //     { required: true, message: '请输入标题' },
258
+      //   ],
259
+      // },
220
       {
260
       {
221
         label: '类型',
261
         label: '类型',
222
         name: 'contentType',
262
         name: 'contentType',
263
+        // hidden: () => !isHaveActive,
223
         type: FieldTypes.Select,
264
         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: '请输入标题' },
265
+        dict: [
266
+          {
267
+            label: '公告',
268
+            value: 'notice'
269
+          },
270
+          {
271
+            label: '服务',
272
+            value: 'tpNews'
273
+          },
274
+          {
275
+            label: '活动',
276
+            value: 'activity'
277
+          },
278
+          // {
279
+          //   label: '项目详情',
280
+          //   value: 'project'
281
+          // },
282
+          {
283
+            label: '资讯',
284
+            value: 'news'
285
+          },
286
+          // {
287
+          //   label: '拼团活动详情',
288
+          //   value: 'group'
289
+          // },
290
+          // {
291
+          //   label: '助力活动详情',
292
+          //   value: 'help'
293
+          // },
294
+          // {
295
+          //   label: 'H5活动详情',
296
+          //   value: 'h5',
297
+          // },
298
+          // {
299
+          //   label: '在线选房详情',
300
+          //   value: 'salesBatch',
301
+          // },
302
+          // {
303
+          //   label: '直播活动详情',
304
+          //   value: 'live',
305
+          // }
250
         ],
306
         ],
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,
307
         value: data.contentType,
294
         rules: [
308
         rules: [
295
           { required: true, message: '请选择类型' },
309
           { required: true, message: '请选择类型' },
296
         ],
310
         ],
297
       },
311
       },
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
-      },
312
+      // {
313
+      //   label: '发布H5活动',
314
+      //   name: 'targetId',
315
+      //   render: <SelectH5 buildingId={() => islet ? buildingId : ''} />,
316
+      //   hidden: () => !h5Visible,
317
+      //   value: data.targetId,
318
+      //   rules: [
319
+      //     { required: true, message: '请选择发布H5' },
320
+      //   ],
321
+      // },
308
       {
322
       {
309
         label: '发布活动',
323
         label: '发布活动',
310
         name: 'targetId',
324
         name: 'targetId',
326
         ],
340
         ],
327
       },
341
       },
328
       {
342
       {
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: '发布销售批次',
343
+        label: '发布公告',
360
         name: 'targetId',
344
         name: 'targetId',
361
-        render: <SalesBatchGroup buildingId={() => buildingId} />,
362
-        hidden: () => !salesBatchVisible,
345
+        render: <SelectNotice buildingId={() => buildingId} />,
346
+        hidden: () => !noticeVisible,
363
         value: data.targetId,
347
         value: data.targetId,
364
         rules: [
348
         rules: [
365
-          { required: true, message: '请选择发布销售批次' },
349
+          { required: true, message: '请选择发布公告' },
366
         ],
350
         ],
367
       },
351
       },
368
       {
352
       {
369
-        label: '发布直播活动',
353
+        label: '发布服务',
370
         name: 'targetId',
354
         name: 'targetId',
371
-        render: <LiveGroup buildingId={() => islet ? buildingId : ''} />,
372
-        hidden: () => !liveVisible,
355
+        render: <SelectTpNews buildingId={() => buildingId} />,
356
+        hidden: () => !tpNewsVisible,
373
         value: data.targetId,
357
         value: data.targetId,
374
         rules: [
358
         rules: [
375
-          { required: true, message: '请选择发布直播活动' },
359
+          { required: true, message: '请选择发布服务' },
376
         ],
360
         ],
377
       },
361
       },
362
+      // {
363
+      //   label: '发布内容',
364
+      //   name: 'content',
365
+      //   render: <Wangedit />,
366
+      //   value: data.content,
367
+      //   hidden: () => !contentVisible,
368
+      //   rules: [
369
+      //     { required: true, message: '请选择发布内容' },
370
+      //   ],
371
+      // },
372
+      // {
373
+      //   label: '发布助力',
374
+      //   name: 'targetId',
375
+      //   render: <SelectHelp buildingId={() => buildingId} />,
376
+      //   hidden: () => !helpVisible,
377
+      //   value: data.targetId,
378
+      //   rules: [
379
+      //     { required: true, message: '请选择发布助力' },
380
+      //   ],
381
+      // },
382
+      // {
383
+      //   label: '发布拼团',
384
+      //   name: 'targetId',
385
+      //   render: <SelectGroup buildingId={() => buildingId} />,
386
+      //   hidden: () => !groupVisible,
387
+      //   value: data.targetId,
388
+      //   rules: [
389
+      //     { required: true, message: '请选择发布拼团' },
390
+      //   ],
391
+      // },
392
+      // {
393
+      //   label: '发布销售批次',
394
+      //   name: 'targetId',
395
+      //   render: <SalesBatchGroup buildingId={() => buildingId} />,
396
+      //   hidden: () => !salesBatchVisible,
397
+      //   value: data.targetId,
398
+      //   rules: [
399
+      //     { required: true, message: '请选择发布销售批次' },
400
+      //   ],
401
+      // },
402
+      // {
403
+      //   label: '发布直播活动',
404
+      //   name: 'targetId',
405
+      //   render: <LiveGroup buildingId={() => islet ? buildingId : ''} />,
406
+      //   hidden: () => !liveVisible,
407
+      //   value: data.targetId,
408
+      //   rules: [
409
+      //     { required: true, message: '请选择发布直播活动' },
410
+      //   ],
411
+      // },
378
       {
412
       {
379
         label: '状态',
413
         label: '状态',
380
         name: 'status',
414
         name: 'status',

+ 84
- 33
src/pages/property/ticket/Detail.jsx 查看文件

1
 import React, { useEffect, useState } from 'react'
1
 import React, { useEffect, useState } from 'react'
2
-import { PageHeader, Descriptions, List, Steps, Row, Col, Rate, Button, Statistic } from 'antd'
2
+import { PageHeader, Descriptions, List, Steps, Row, Col, Rate, Button, Statistic, Modal } from 'antd'
3
 import { fetch, fetchList, apis } from '@/utils/request'
3
 import { fetch, fetchList, apis } from '@/utils/request'
4
+import router from 'umi/router'
4
 import Prompt from '@/components/Prompt'
5
 import Prompt from '@/components/Prompt'
6
+import Title from './components/Title'
7
+import Dispatch from './components/Dispatch'
5
 
8
 
6
 const TicketTypeDict = {
9
 const TicketTypeDict = {
7
   '0': '投诉',
10
   '0': '投诉',
26
 }
29
 }
27
 
30
 
28
 const getTicketDetail = fetch(apis.ticket.ticketEdit)
31
 const getTicketDetail = fetch(apis.ticket.ticketEdit)
32
+const addDispatch = fetch(apis.ticket.addRecord)
33
+const rejectTicket = fetch(apis.ticket.updateTicketStatus)
29
 
34
 
30
 export default props => {
35
 export default props => {
31
   const [loading, setLoading] = useState(false)
36
   const [loading, setLoading] = useState(false)
32
   const [showPrompt, setShowPrompt] = useState(false)
37
   const [showPrompt, setShowPrompt] = useState(false)
38
+  const [showDispatch, setShowDispatch] = useState(false)
39
+  const [showReject, setShowReject] = useState(false)
33
   const [ticketData, setTicketData] = useState({})
40
   const [ticketData, setTicketData] = useState({})
34
   const [approvalProcessList, setApprovalProcessList] = useState([])
41
   const [approvalProcessList, setApprovalProcessList] = useState([])
35
 
42
 
40
 
47
 
41
   const { id } = props.location.query
48
   const { id } = props.location.query
42
 
49
 
50
+  const handleDispatchTicket = ({ userId }) => {
51
+    addDispatch({data: {ticketId: id, id: userId}}).then(res => {
52
+      Modal.success({
53
+        content: '分配人员成功',
54
+        onOk: () => window.location.reload()
55
+      })
56
+    })
57
+
58
+    setShowDispatch(false)
59
+  }
60
+
61
+  const handleReject = textContent => {
62
+    rejectTicket({data:{ticketId: id, textContent}}).then(res => {
63
+      Modal.success({
64
+        content: '拒绝受理成功',
65
+        onOk: () => router.go(-1)
66
+      })
67
+    })
68
+  }
69
+
43
   useEffect(() => {
70
   useEffect(() => {
44
     getTicketDetail({data: {id}}).then(res => {
71
     getTicketDetail({data: {id}}).then(res => {
45
       const { recordList } = res || {}
72
       const { recordList } = res || {}
69
             </Descriptions>
96
             </Descriptions>
70
           </div>
97
           </div>
71
           <div style={{minWidth: '150px'}}>
98
           <div style={{minWidth: '150px'}}>
72
-            <Statistic title={<b>费用</b>} prefix="¥" value={125.60} precision={2} />
73
-            <Button onClick={() => setShowPrompt(true)}>设置费用</Button>
99
+            {
100
+              !ticketData.billInvoiceId || !ticketData.isPay ?
101
+                <Button onClick={() => setShowPrompt(true)}>设置费用</Button> :
102
+                <Statistic title={<b>费用</b>} prefix="¥" value={ticketData.price || 0} precision={2} />
103
+            }
74
             <Prompt visible={showPrompt} onCancel={() => setShowPrompt(false)} placeholder="请填写金额比如: 100.00"></Prompt>
104
             <Prompt visible={showPrompt} onCancel={() => setShowPrompt(false)} placeholder="请填写金额比如: 100.00"></Prompt>
75
           </div>
105
           </div>
76
         </div>
106
         </div>
89
         {
119
         {
90
           (approvalProcessList || []).map(item => {
120
           (approvalProcessList || []).map(item => {
91
             return (
121
             return (
92
-              <Steps.Step key={item.id} title={item.statusName} subTitle={item.createDate} description={(
93
-                <div>
94
-                  {
95
-                    item.status - 0 === 5 && (
96
-                      <Descriptions column={2}>
97
-                        <Descriptions.Item label="评分"><Rate value={item.score}/></Descriptions.Item>
98
-                        <Descriptions.Item label="时间"><Rate value={item.createDate}/></Descriptions.Item>
99
-                        <Descriptions.Item label="评语">{item.comment}</Descriptions.Item>
100
-                      </Descriptions>
101
-                    )
102
-                  }
103
-                  {
104
-                    item.statusContent && item.statusContent.length && (
105
-                      item.statusContent.map(ctt => {
106
-                        return (
107
-                          <div>
108
-                            <div>{ `${ctt.userName} : ${ctt.content}` }</div>
109
-                            {
110
-                              ctt.imgURL && ctt.imgURL.length && (
111
-                                <List dataSource={ctt.imgURL} grid={imgGrid} renderItem={it => (
112
-                                  <List.Item><img src={it.imageUrl} alt="" style={{width: '100%'}} /></List.Item>
113
-                                )} />
114
-                              )
115
-                            }
116
-                          </div>
117
-                        )
118
-                      })
119
-                    )
120
-                  }
121
-                </div>
122
+              <Steps.Step
123
+                key={item.id}
124
+                style={{width: '100%'}}
125
+                title={(
126
+                  <Title title={item.statusName}>
127
+                    {
128
+                      ticketData.status === '0' && (
129
+                        <>
130
+                          <Button type="primary" onClick={() => setShowDispatch(true)}>分配工单</Button>
131
+                          <Button type="danger" style={{marginLeft: '24px'}} onClick={() => setShowReject(true)}>拒绝受理</Button>
132
+                        </>
133
+                      )
134
+                    }
135
+                  </Title>
136
+                )}
137
+                subTitle={item.createDate}
138
+                description={(
139
+                  <div>
140
+                    {
141
+                      item.status - 0 === 5 && (
142
+                        <Descriptions column={2}>
143
+                          {/* <Descriptions.Item label="评分"><Rate value={item.score}/></Descriptions.Item> */}
144
+                          <Descriptions.Item label="时间"><Rate value={item.createDate}/></Descriptions.Item>
145
+                          <Descriptions.Item label="评语">{item.comment}</Descriptions.Item>
146
+                        </Descriptions>
147
+                      )
148
+                    }
149
+                    {
150
+                      item.statusContent && item.statusContent.length > 0 && (
151
+                        item.statusContent.map(ctt => {
152
+                          return (
153
+                            <div>
154
+                              <div>{ `${ctt.userName} : ${ctt.content}` }</div>
155
+                              {
156
+                                ctt.imgURL && ctt.imgURL.length > 0 && (
157
+                                  <List dataSource={ctt.imgURL} grid={imgGrid} renderItem={it => (
158
+                                    <List.Item><img src={it.imageUrl} alt="" style={{width: '100%'}} /></List.Item>
159
+                                  )} />
160
+                                )
161
+                              }
162
+                            </div>
163
+                          )
164
+                        })
165
+                      )
166
+                    }
167
+                  </div>
122
               )}/>
168
               )}/>
123
             )
169
             )
124
           })
170
           })
125
         }
171
         }
126
         </Steps>
172
         </Steps>
127
       </div>
173
       </div>
174
+
175
+      {/* 工单分配 */}
176
+      <Dispatch visible={showDispatch} userList={ticketData.tpUsersList} onSubmit={handleDispatchTicket} onCancel={() => setShowDispatch(false)} />
177
+      {/* 拒绝原因 */}
178
+      <Prompt visible={showReject} onCancel={() => setShowReject(false)} onOk={handleReject} placeholder="请填写拒绝原因"></Prompt>
128
     </div>
179
     </div>
129
   )
180
   )
130
 }
181
 }

+ 35
- 0
src/pages/property/ticket/components/Dispatch.jsx 查看文件

1
+import React, { useEffect, useState } from 'react'
2
+import { Form, Modal, Select, Button } from 'antd'
3
+
4
+export default Form.create()(props => {
5
+  const [userId, setUserId] = useState()
6
+
7
+  const handleSubmit = e => {
8
+    e.preventDefault()
9
+    props.onSubmit({userId})
10
+    // props.form.validateFields((err, values) => {
11
+    //   if (!err) {
12
+    //     props.onSubmit(...values)
13
+    //   }
14
+    // })
15
+  }
16
+
17
+
18
+  return (
19
+    <Modal  footer={null} maskClosable={false} onCancel={props.onCancel} visible={props.visible}>
20
+      <Form onSubmit={handleSubmit}>
21
+        <Form.Item label="选择受理人">
22
+          <Select onChange={e => setUserId(e)}>
23
+            {
24
+              (props.userList || []).map(user => (<Select.Option key={user.userId} value={user.userId}>{user.userName}</Select.Option>))
25
+            }
26
+          </Select>
27
+        </Form.Item>
28
+        <Form.Item>
29
+          <Button type="primary" htmlType="submit">确定</Button>
30
+          <Button onClick={props.onCancel} style={{ marginLeft: '48px' }}>取消</Button>
31
+        </Form.Item>
32
+      </Form>
33
+    </Modal>
34
+  )
35
+})

+ 10
- 0
src/pages/property/ticket/components/Title.jsx 查看文件

1
+import React, { useEffect, useState } from 'react'
2
+
3
+export default props => {
4
+  return (
5
+    <div style={{display: 'flex', minWidth: '100%'}}>
6
+      <div>{props.title}</div>
7
+      <div style={{flex: 1, padding: '0 16px'}}>{props.children}</div>
8
+    </div>
9
+  )
10
+}