傅行帆 5 yıl önce
ebeveyn
işleme
a7f1ed53c0
3 değiştirilmiş dosya ile 70 ekleme ve 33 silme
  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 Dosyayı Görüntüle

@@ -249,6 +249,11 @@ export default [
249 249
                 name: '联系人列表',
250 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 Dosyayı Görüntüle

@@ -20,7 +20,7 @@ function header(props) {
20 20
     // 查询列表
21 21
 
22 22
     const getList = params => {
23
-        request({ ...apis.officenews.list, params: { ...params } }).then(data => {
23
+        request({ ...apis.promote.list, params: { ...params } }).then(data => {
24 24
             setData(data)
25 25
         })
26 26
     }
@@ -97,33 +97,50 @@ function header(props) {
97 97
 
98 98
     const columns = [
99 99
         {
100
-            title: '资讯主图',
101
-            dataIndex: 'thumb',
102
-            key: 'thumb',
100
+            title: '表单编号',
101
+            dataIndex: 'serialNo',
102
+            key: 'serialNo',
103 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 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 128
             align: 'center',
118
-            render: (x, row) => <><span>{row.status === 1 ? '是' :'否'}</span></>
119 129
         },
120 130
         {
121
-            title: '创建时间',
131
+            title: '提交时间',
122 132
             dataIndex: 'createDate',
123 133
             key: 'createDate',
124 134
             align: 'center',
125 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 145
             title: '操作',
129 146
             dataIndex: 'handle',
@@ -132,16 +149,10 @@ function header(props) {
132 149
             render: (x, row) => (
133 150
                 <>
134 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 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 156
                     </span>
146 157
                 </>
147 158
             ),
@@ -163,21 +174,37 @@ function header(props) {
163 174
             <div>
164 175
                 <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
165 176
                     <Form.Item>
166
-                        {getFieldDecorator('title')(
177
+                        {getFieldDecorator('company')(
167 178
                             <Input
168 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 199
                     </Form.Item>
173 200
                     <Form.Item>
174 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 208
                             </Select>,
182 209
 
183 210
                         )}
@@ -194,8 +221,6 @@ function header(props) {
194 221
                     </Form.Item>
195 222
                 </Form>
196 223
 
197
-                <Button type="danger" className={styles.addBtn} onClick={toEditResource()}>新增</Button>
198
-
199 224
                 <Table id='noticeTable' rowKey={r => r.newsId} dataSource={data.records} columns={columns} pagination={false} />
200 225
 
201 226
                 <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>

+ 8
- 1
src/services/apis.js Dosyayı Görüntüle

@@ -432,7 +432,14 @@ const apis = {
432 432
       method: 'POST',
433 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 445
 export default apis;