Commit c5ccb53facd3efcd68b35575579cbe2a7c87672d
Merge remote-tracking branch 'origin/master' into zgt
# Conflicts: # src/services/definition.ts # src/services/request.ts
Showing
3 changed files
with
113 additions
and
47 deletions
src/pages/ResearchGroup/components/AuditModal.tsx
@@ -5,7 +5,7 @@ import { Button, Form, message } from 'antd'; | @@ -5,7 +5,7 @@ import { Button, Form, message } from 'antd'; | ||
5 | import { cloneDeep } from 'lodash'; | 5 | import { cloneDeep } from 'lodash'; |
6 | 6 | ||
7 | // import { cloneDeep } from 'lodash'; | 7 | // import { cloneDeep } from 'lodash'; |
8 | -export default ({ setVisible, ids, onClose }) => { | 8 | +export default ({ setVisible, ids, onClose, auditType }) => { |
9 | const [form] = Form.useForm(); | 9 | const [form] = Form.useForm(); |
10 | let auditIds = cloneDeep(ids); | 10 | let auditIds = cloneDeep(ids); |
11 | 11 | ||
@@ -15,7 +15,7 @@ export default ({ setVisible, ids, onClose }) => { | @@ -15,7 +15,7 @@ export default ({ setVisible, ids, onClose }) => { | ||
15 | }; | 15 | }; |
16 | 16 | ||
17 | const doAudit = async (values: any) => { | 17 | const doAudit = async (values: any) => { |
18 | - values.type = 'research_group_member_request_audit'; | 18 | + values.type = auditType; |
19 | let res = await postCommonAudit({ data: values }); | 19 | let res = await postCommonAudit({ data: values }); |
20 | if (res && res.result === RESPONSE_CODE.SUCCESS) { | 20 | if (res && res.result === RESPONSE_CODE.SUCCESS) { |
21 | message.success(res.message); | 21 | message.success(res.message); |
src/pages/ResearchGroup/constant.tsx
1 | -import { enumToProTableEnumValue } from '@/utils'; | 1 | +import { postServiceConstListResearchGroupsStatus } from '@/services'; |
2 | +import { enumToProTableEnumValue, enumToSelect } from '@/utils'; | ||
3 | +import { MessageTwoTone } from '@ant-design/icons'; | ||
4 | +import { Space, Tooltip } from 'antd'; | ||
2 | export const AUDIT_STATUS_OPTIONS = { | 5 | export const AUDIT_STATUS_OPTIONS = { |
3 | CREATED: '未审核', | 6 | CREATED: '未审核', |
4 | AUDIT_PASS: '审核通过', | 7 | AUDIT_PASS: '审核通过', |
@@ -37,12 +40,53 @@ export const RESEARCH_GROUP_COLUMNS = [ | @@ -37,12 +40,53 @@ export const RESEARCH_GROUP_COLUMNS = [ | ||
37 | hideInSearch: true, | 40 | hideInSearch: true, |
38 | }, | 41 | }, |
39 | { | 42 | { |
43 | + title: '单位名称', | ||
44 | + dataIndex: 'companyNameLike', | ||
45 | + key: 'companyNameLike', | ||
46 | + fieldProps: { | ||
47 | + placeholder: '请输入单位名称', | ||
48 | + }, | ||
49 | + hideInTable: true, | ||
50 | + }, | ||
51 | + { | ||
40 | title: '预存账号', | 52 | title: '预存账号', |
41 | dataIndex: 'accounts', | 53 | dataIndex: 'accounts', |
42 | key: 'accounts', | 54 | key: 'accounts', |
43 | hideInSearch: true, | 55 | hideInSearch: true, |
44 | }, | 56 | }, |
45 | { | 57 | { |
58 | + title: '状态', | ||
59 | + dataIndex: 'statusText', | ||
60 | + key: 'statusText', | ||
61 | + hideInSearch: true, | ||
62 | + render: (_, record) => { | ||
63 | + console.log('1111' + JSON.stringify(record)); | ||
64 | + return ( | ||
65 | + <> | ||
66 | + <Space> | ||
67 | + {record.statusText} | ||
68 | + {record.statusNotes && ( | ||
69 | + <Tooltip title={record.statusNotes}> | ||
70 | + <MessageTwoTone /> | ||
71 | + </Tooltip> | ||
72 | + )} | ||
73 | + </Space> | ||
74 | + </> | ||
75 | + ); | ||
76 | + }, | ||
77 | + }, | ||
78 | + { | ||
79 | + title: '状态', | ||
80 | + dataIndex: 'status', | ||
81 | + key: 'status', | ||
82 | + valueType: 'select', | ||
83 | + request: async () => { | ||
84 | + const groupStatus = await postServiceConstListResearchGroupsStatus(); | ||
85 | + return enumToSelect(groupStatus.data); | ||
86 | + }, | ||
87 | + hideInTable: true, | ||
88 | + }, | ||
89 | + { | ||
46 | title: '预存手机号', | 90 | title: '预存手机号', |
47 | dataIndex: 'accountPhone', | 91 | dataIndex: 'accountPhone', |
48 | key: 'accountPhone', | 92 | key: 'accountPhone', |
src/pages/ResearchGroup/index.tsx
@@ -48,6 +48,7 @@ const PrepaidPage = () => { | @@ -48,6 +48,7 @@ const PrepaidPage = () => { | ||
48 | researchGroupMemberRequestAddModalVisible, | 48 | researchGroupMemberRequestAddModalVisible, |
49 | setResearchGroupMemberRequestAddModalVisible, | 49 | setResearchGroupMemberRequestAddModalVisible, |
50 | ] = useState(false); | 50 | ] = useState(false); |
51 | + const [auditType, setAuditType] = useState(''); | ||
51 | // const [checkVisible, setCheckVisible] = useState(false); | 52 | // const [checkVisible, setCheckVisible] = useState(false); |
52 | const [accountInfo, setAccountInfo] = useState({ | 53 | const [accountInfo, setAccountInfo] = useState({ |
53 | realName: '', | 54 | realName: '', |
@@ -244,55 +245,57 @@ const PrepaidPage = () => { | @@ -244,55 +245,57 @@ const PrepaidPage = () => { | ||
244 | let columns = RESEARCH_GROUP_COLUMNS.map((item) => { | 245 | let columns = RESEARCH_GROUP_COLUMNS.map((item) => { |
245 | let newItem = { ...item }; | 246 | let newItem = { ...item }; |
246 | let dataIndex = item.dataIndex; | 247 | let dataIndex = item.dataIndex; |
248 | + if (!newItem.render) { | ||
249 | + newItem.render = (text, record, index) => { | ||
250 | + let textValue = record[dataIndex]; | ||
251 | + if (dataIndex.endsWith('Time')) { | ||
252 | + textValue = formatDateTime(textValue); | ||
253 | + } | ||
247 | 254 | ||
248 | - newItem.render = (text, record, index) => { | ||
249 | - let textValue = record[dataIndex]; | ||
250 | - | ||
251 | - if (dataIndex.endsWith('Time')) { | ||
252 | - textValue = formatDateTime(textValue); | ||
253 | - } | ||
254 | - | ||
255 | - if (dataIndex === 'members') { | ||
256 | - return renderMembersCell(textValue); | ||
257 | - } | 255 | + if (dataIndex === 'members') { |
256 | + return renderMembersCell(textValue); | ||
257 | + } | ||
258 | 258 | ||
259 | - if (dataIndex === 'accounts') { | ||
260 | - return renderAccountsCell(textValue); | ||
261 | - } | 259 | + if (dataIndex === 'accounts') { |
260 | + return renderAccountsCell(textValue); | ||
261 | + } | ||
262 | 262 | ||
263 | - if (dataIndex === 'index') { | ||
264 | - textValue = index + 1; | ||
265 | - } | 263 | + if (dataIndex === 'index') { |
264 | + textValue = index + 1; | ||
265 | + } | ||
266 | 266 | ||
267 | - if ( | ||
268 | - dataIndex === 'proofImages' && | ||
269 | - textValue !== null && | ||
270 | - textValue !== undefined | ||
271 | - ) { | ||
272 | - return ( | ||
273 | - <Image.PreviewGroup | ||
274 | - className="mr-10" | ||
275 | - preview={{ | ||
276 | - onChange: (current, prev) => | ||
277 | - console.log(`current index: ${current}, prev index: ${prev}`), | ||
278 | - }} | ||
279 | - > | ||
280 | - {textValue.map((item, index) => ( | ||
281 | - <React.Fragment key={index}> | ||
282 | - {index > 0 ? <Divider type="vertical" /> : ''} | ||
283 | - <Image | ||
284 | - className="max-h-[35px] max-w-[45px]" | ||
285 | - src={item} | ||
286 | - title={item} | ||
287 | - />{' '} | ||
288 | - </React.Fragment> | ||
289 | - ))} | ||
290 | - </Image.PreviewGroup> | ||
291 | - ); | ||
292 | - } | 267 | + if ( |
268 | + dataIndex === 'proofImages' && | ||
269 | + textValue !== null && | ||
270 | + textValue !== undefined | ||
271 | + ) { | ||
272 | + return ( | ||
273 | + <Image.PreviewGroup | ||
274 | + className="mr-10" | ||
275 | + preview={{ | ||
276 | + onChange: (current, prev) => | ||
277 | + console.log( | ||
278 | + `current index: ${current}, prev index: ${prev}`, | ||
279 | + ), | ||
280 | + }} | ||
281 | + > | ||
282 | + {textValue.map((item, index) => ( | ||
283 | + <React.Fragment key={index}> | ||
284 | + {index > 0 ? <Divider type="vertical" /> : ''} | ||
285 | + <Image | ||
286 | + className="max-h-[35px] max-w-[45px]" | ||
287 | + src={item} | ||
288 | + title={item} | ||
289 | + />{' '} | ||
290 | + </React.Fragment> | ||
291 | + ))} | ||
292 | + </Image.PreviewGroup> | ||
293 | + ); | ||
294 | + } | ||
293 | 295 | ||
294 | - return <EllipsisDiv text={textValue} />; | ||
295 | - }; | 296 | + return <EllipsisDiv text={textValue} />; |
297 | + }; | ||
298 | + } | ||
296 | 299 | ||
297 | return newItem; | 300 | return newItem; |
298 | }); | 301 | }); |
@@ -334,6 +337,22 @@ const PrepaidPage = () => { | @@ -334,6 +337,22 @@ const PrepaidPage = () => { | ||
334 | />, | 337 | />, |
335 | ); | 338 | ); |
336 | } | 339 | } |
340 | + if (record.paths?.includes('ADD_AUDIT')) { | ||
341 | + btns.push( | ||
342 | + <Button | ||
343 | + key="audit" | ||
344 | + className="p-0" | ||
345 | + type="link" | ||
346 | + onClick={async () => { | ||
347 | + setAuditIds([record.id]); | ||
348 | + setAuditModalVisible(true); | ||
349 | + setAuditType('research_groups_add_audit'); | ||
350 | + }} | ||
351 | + > | ||
352 | + 审核 | ||
353 | + </Button>, | ||
354 | + ); | ||
355 | + } | ||
337 | return btns; | 356 | return btns; |
338 | }, | 357 | }, |
339 | }); | 358 | }); |
@@ -447,6 +466,7 @@ const PrepaidPage = () => { | @@ -447,6 +466,7 @@ const PrepaidPage = () => { | ||
447 | type="link" | 466 | type="link" |
448 | onClick={async () => { | 467 | onClick={async () => { |
449 | setAuditIds([record.id]); | 468 | setAuditIds([record.id]); |
469 | + setAuditType('research_group_member_request_audit'); | ||
450 | setAuditModalVisible(true); | 470 | setAuditModalVisible(true); |
451 | }} | 471 | }} |
452 | > | 472 | > |
@@ -732,7 +752,9 @@ const PrepaidPage = () => { | @@ -732,7 +752,9 @@ const PrepaidPage = () => { | ||
732 | setAuditModalVisible(false); | 752 | setAuditModalVisible(false); |
733 | setAuditIds([]); | 753 | setAuditIds([]); |
734 | reloadMemberApplyTable(); | 754 | reloadMemberApplyTable(); |
755 | + researchGroupActionRef.current?.reload(); | ||
735 | }} | 756 | }} |
757 | + auditType={auditType} | ||
736 | /> | 758 | /> |
737 | )} | 759 | )} |
738 | 760 |