Browse Source

需求3.0

傅行帆 5 years ago
parent
commit
a7f1ed53c0
3 changed files with 70 additions and 33 deletions
  1. 5
    0
      config/routes.js
  2. 57
    32
      src/pages/promote/index.jsx
  3. 8
    1
      src/services/apis.js

+ 5
- 0
config/routes.js View File

249
                 name: '联系人列表',
249
                 name: '联系人列表',
250
                 component: './promote/contact',
250
                 component: './promote/contact',
251
               },
251
               },
252
+              {
253
+                path: '/promote/detail',
254
+                name: '查看详情',
255
+                component: './promote/detail',
256
+              },
252
             ],
257
             ],
253
           },
258
           },
254
 
259
 

+ 57
- 32
src/pages/promote/index.jsx View File

20
     // 查询列表
20
     // 查询列表
21
 
21
 
22
     const getList = params => {
22
     const getList = params => {
23
-        request({ ...apis.officenews.list, params: { ...params } }).then(data => {
23
+        request({ ...apis.promote.list, params: { ...params } }).then(data => {
24
             setData(data)
24
             setData(data)
25
         })
25
         })
26
     }
26
     }
97
 
97
 
98
     const columns = [
98
     const columns = [
99
         {
99
         {
100
-            title: '资讯主图',
101
-            dataIndex: 'thumb',
102
-            key: 'thumb',
100
+            title: '表单编号',
101
+            dataIndex: 'serialNo',
102
+            key: 'serialNo',
103
             align: 'center',
103
             align: 'center',
104
-            render: (text, record) => <img style={{width:'140px',height:'92px'}} src={record.thumb} className={styles.touxiang} />,
104
+            render:  (x, row) => <Navigate to={`/promote/detail?id=${row.serialNo}`}>{row.serialNo}</Navigate>,
105
         },
105
         },
106
         {
106
         {
107
-            title: '资讯标题',
108
-            dataIndex: 'title',
109
-            key: 'title',
107
+            title: '公司名称',
108
+            dataIndex: 'company',
109
+            key: 'company',
110
             align: 'center',
110
             align: 'center',
111
-            render:  (x, row) => <Navigate to={`/officenews/detail?id=${row.newsId}`}>{row.title}</Navigate>,
112
         },
111
         },
113
         {
112
         {
114
-            title: '发布状态',
115
-            dataIndex: 'status',
116
-            key: 'status',
113
+            title: '联系人',
114
+            dataIndex: 'name',
115
+            key: 'name',
116
+            align: 'center',
117
+        },
118
+        {
119
+            title: '手机号',
120
+            dataIndex: 'phone',
121
+            key: 'phone',
122
+            align: 'center',
123
+        },
124
+        {
125
+            title: '邮箱',
126
+            dataIndex: 'email',
127
+            key: 'email',
117
             align: 'center',
128
             align: 'center',
118
-            render: (x, row) => <><span>{row.status === 1 ? '是' :'否'}</span></>
119
         },
129
         },
120
         {
130
         {
121
-            title: '创建时间',
131
+            title: '提交时间',
122
             dataIndex: 'createDate',
132
             dataIndex: 'createDate',
123
             key: 'createDate',
133
             key: 'createDate',
124
             align: 'center',
134
             align: 'center',
125
             render: (x, row) => <><span>{row.createDate?`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`:''}</span></>,
135
             render: (x, row) => <><span>{row.createDate?`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`:''}</span></>,
126
         },
136
         },
137
+        {
138
+            title: '状态',
139
+            dataIndex: 'status',
140
+            key: 'status',
141
+            align: 'center',
142
+            render: (x, row) => <><span>{row.status === 1 ? '有效' : row.status === 2 ? "待跟进" : '无效'}</span></>
143
+        },
127
         {
144
         {
128
             title: '操作',
145
             title: '操作',
129
             dataIndex: 'handle',
146
             dataIndex: 'handle',
132
             render: (x, row) => (
149
             render: (x, row) => (
133
                 <>
150
                 <>
134
                     <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={publishNew(row)}>
151
                     <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={publishNew(row)}>
135
-                        {row.status === 1 ? '取消发布' :'发布'}<Icon type="form" className={styles.edit} />
136
-                    </span>
137
-                    <span style={{ color: '#FF925C', cursor: 'pointer', marginLeft: '20px' }} onClick={toEditResource(row.newsId)}>
138
-                        编辑<Icon type="form" className={styles.edit} />
139
-                    </span>
140
-                    <span style={{ color: '#FF925C', cursor: 'pointer', marginLeft: '20px' }} onClick={deleteRow(row)}>
141
-                        删除<Icon type="form" className={styles.edit} />
152
+                        {row.status === 2 ? "立即跟进" : '添加备注'}<Icon type="form" className={styles.edit} />
142
                     </span>
153
                     </span>
143
-                    <span style={{ color: '#FF925C', cursor: 'pointer', marginLeft: '20px' }} onClick={topNew(row)}>
144
-                        {row.weight === 1 ? '取消置顶' :'置顶'}<Icon type="form" className={styles.edit} />
154
+                    <span style={{ color: '#FF925C', cursor: 'pointer', marginLeft: '20px'  }} onClick={publishNew(row)}>
155
+                        {row.status === 0 ? "删除" : ''}<Icon type="form" className={styles.edit} />
145
                     </span>
156
                     </span>
146
                 </>
157
                 </>
147
             ),
158
             ),
163
             <div>
174
             <div>
164
                 <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
175
                 <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
165
                     <Form.Item>
176
                     <Form.Item>
166
-                        {getFieldDecorator('title')(
177
+                        {getFieldDecorator('company')(
167
                             <Input
178
                             <Input
168
                                 prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
179
                                 prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
169
-                                placeholder="标题名称"
180
+                                placeholder="公司名称"
181
+                            />,
182
+                        )}
183
+                    </Form.Item>
184
+                    <Form.Item>
185
+                        {getFieldDecorator('name')(
186
+                            <Input
187
+                                prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
188
+                                placeholder="联系人"
189
+                            />,
190
+                        )}
191
+                    </Form.Item>
192
+                    <Form.Item>
193
+                        {getFieldDecorator('phone')(
194
+                            <Input
195
+                                prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
196
+                                placeholder="手机号"
170
                             />,
197
                             />,
171
                         )}
198
                         )}
172
                     </Form.Item>
199
                     </Form.Item>
173
                     <Form.Item>
200
                     <Form.Item>
174
                         {getFieldDecorator('status')(
201
                         {getFieldDecorator('status')(
175
 
202
 
176
-                            <Select style={{ width: '180px' }} placeholder="发布状态">
177
-                                 <Option value="">全部</Option>
178
-                                <Option value="0">已发布</Option>
179
-                                <Option value="1">未发布</Option>
180
-
203
+                            <Select style={{ width: '180px' }} placeholder="表单状态">
204
+                                <Option value="">全部</Option>
205
+                                <Option value="2">待跟进</Option>
206
+                                <Option value="1">有效</Option>
207
+                                <Option value="0">无效</Option>
181
                             </Select>,
208
                             </Select>,
182
 
209
 
183
                         )}
210
                         )}
194
                     </Form.Item>
221
                     </Form.Item>
195
                 </Form>
222
                 </Form>
196
 
223
 
197
-                <Button type="danger" className={styles.addBtn} onClick={toEditResource()}>新增</Button>
198
-
199
                 <Table id='noticeTable' rowKey={r => r.newsId} dataSource={data.records} columns={columns} pagination={false} />
224
                 <Table id='noticeTable' rowKey={r => r.newsId} dataSource={data.records} columns={columns} pagination={false} />
200
 
225
 
201
                 <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
226
                 <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>

+ 8
- 1
src/services/apis.js View File

432
       method: 'POST',
432
       method: 'POST',
433
       action: 'channel',
433
       action: 'channel',
434
     },
434
     },
435
-  }
435
+  },
436
+  promote: {
437
+    list: {
438
+      url: `${prefix}/taOfficeContact`,
439
+      method: 'GET',
440
+      action: 'channel',
441
+    },
442
+  },
436
 }
443
 }
437
 
444
 
438
 export default apis;
445
 export default apis;