Commit 70ada0e3a1f0d87ff66c50532b68a247a0118357
1 parent
0f671707
feat: 客户管理模块开发
Showing
2 changed files
with
20 additions
and
7 deletions
src/pages/Client/Components/ClientDrawer.tsx
@@ -18,12 +18,11 @@ import { | @@ -18,12 +18,11 @@ import { | ||
18 | import { Button, Form, message } from 'antd'; | 18 | import { Button, Form, message } from 'antd'; |
19 | import { useState } from 'react'; | 19 | import { useState } from 'react'; |
20 | 20 | ||
21 | -export default ({ optType, record }) => { | ||
22 | - const [form] = Form.useForm<{ name: string; company: string }>(); | 21 | +export default ({ optType, record, onFinish }) => { |
22 | + const [form] = Form.useForm(); | ||
23 | //省市区 | 23 | //省市区 |
24 | const [province, setProvince] = useState(''); | 24 | const [province, setProvince] = useState(''); |
25 | const [city, setCity] = useState(''); | 25 | const [city, setCity] = useState(''); |
26 | - const [setDistrict] = useState(''); | ||
27 | const optTypeEnum = { | 26 | const optTypeEnum = { |
28 | add: { | 27 | add: { |
29 | text: '新增', | 28 | text: '新增', |
@@ -36,6 +35,7 @@ export default ({ optType, record }) => { | @@ -36,6 +35,7 @@ export default ({ optType, record }) => { | ||
36 | if (res.result === RESPONSE_CODE.SUCCESS) { | 35 | if (res.result === RESPONSE_CODE.SUCCESS) { |
37 | message.success('新增成功'); | 36 | message.success('新增成功'); |
38 | // 不返回不会关闭弹框 | 37 | // 不返回不会关闭弹框 |
38 | + onFinish(); | ||
39 | return true; | 39 | return true; |
40 | } | 40 | } |
41 | }, | 41 | }, |
@@ -51,6 +51,7 @@ export default ({ optType, record }) => { | @@ -51,6 +51,7 @@ export default ({ optType, record }) => { | ||
51 | if (res.result === RESPONSE_CODE.SUCCESS) { | 51 | if (res.result === RESPONSE_CODE.SUCCESS) { |
52 | message.success('编辑成功'); | 52 | message.success('编辑成功'); |
53 | // 不返回不会关闭弹框 | 53 | // 不返回不会关闭弹框 |
54 | + onFinish(); | ||
54 | return true; | 55 | return true; |
55 | } | 56 | } |
56 | }, | 57 | }, |
@@ -214,7 +215,7 @@ export default ({ optType, record }) => { | @@ -214,7 +215,7 @@ export default ({ optType, record }) => { | ||
214 | allowClear={false} | 215 | allowClear={false} |
215 | onChange={(value) => { | 216 | onChange={(value) => { |
216 | if (value !== undefined || value !== null) { | 217 | if (value !== undefined || value !== null) { |
217 | - setDistrict(value); | 218 | + /*setDistrict(value);*/ |
218 | } | 219 | } |
219 | }} | 220 | }} |
220 | disabled={city === ''} | 221 | disabled={city === ''} |
src/pages/Client/index.tsx
@@ -34,7 +34,7 @@ const columns = [ | @@ -34,7 +34,7 @@ const columns = [ | ||
34 | { | 34 | { |
35 | title: '单位地址', | 35 | title: '单位地址', |
36 | width: 250, | 36 | width: 250, |
37 | - dataIndex: 'companyName', | 37 | + dataIndex: 'companyAddressText', |
38 | hideInSearch: true, | 38 | hideInSearch: true, |
39 | }, | 39 | }, |
40 | { | 40 | { |
@@ -177,7 +177,7 @@ const columns = [ | @@ -177,7 +177,7 @@ const columns = [ | ||
177 | valueType: 'option', | 177 | valueType: 'option', |
178 | key: 'option', | 178 | key: 'option', |
179 | width: 150, | 179 | width: 150, |
180 | - render: (text, record) => { | 180 | + render: (text, record, index, action) => { |
181 | console.log(JSON.stringify(record)); | 181 | console.log(JSON.stringify(record)); |
182 | return [ | 182 | return [ |
183 | <CommunicationHistoryModal | 183 | <CommunicationHistoryModal |
@@ -188,11 +188,17 @@ const columns = [ | @@ -188,11 +188,17 @@ const columns = [ | ||
188 | key={'detail'} | 188 | key={'detail'} |
189 | record={record} | 189 | record={record} |
190 | optType={'detail'} | 190 | optType={'detail'} |
191 | + onFinish={() => { | ||
192 | + action.reload(); | ||
193 | + }} | ||
191 | ></ClientDrawer>, | 194 | ></ClientDrawer>, |
192 | <ClientDrawer | 195 | <ClientDrawer |
193 | key={'edit'} | 196 | key={'edit'} |
194 | record={record} | 197 | record={record} |
195 | optType={'edit'} | 198 | optType={'edit'} |
199 | + onFinish={() => { | ||
200 | + action.reload(); | ||
201 | + }} | ||
196 | ></ClientDrawer>, | 202 | ></ClientDrawer>, |
197 | ]; | 203 | ]; |
198 | }, | 204 | }, |
@@ -286,7 +292,13 @@ export default () => { | @@ -286,7 +292,13 @@ export default () => { | ||
286 | dateFormatter="string" | 292 | dateFormatter="string" |
287 | headerTitle="高级表格" | 293 | headerTitle="高级表格" |
288 | toolBarRender={() => [ | 294 | toolBarRender={() => [ |
289 | - <ClientDrawer optType={'add'} key="button"></ClientDrawer>, | 295 | + <ClientDrawer |
296 | + optType={'add'} | ||
297 | + key="button" | ||
298 | + onFinish={() => { | ||
299 | + actionRef.current.reload(); | ||
300 | + }} | ||
301 | + ></ClientDrawer>, | ||
290 | <ClientImportModal key="import" />, | 302 | <ClientImportModal key="import" />, |
291 | ]} | 303 | ]} |
292 | /> | 304 | /> |