Commit f794b05d1f8b6472c3383de592a50d1fadfeb58c
1 parent
6714814c
fix: 修改客户管理课题组类型
Showing
1 changed file
with
19 additions
and
11 deletions
src/pages/Client/Client/Components/ClientDrawer.tsx
@@ -345,31 +345,39 @@ export default ({ optType, record, onFinish }) => { | @@ -345,31 +345,39 @@ export default ({ optType, record, onFinish }) => { | ||
345 | name="institutionContactName" | 345 | name="institutionContactName" |
346 | rules={[{ required: true, message: '请输入课题组名称!' }]} | 346 | rules={[{ required: true, message: '请输入课题组名称!' }]} |
347 | request={async (value) => { | 347 | request={async (value) => { |
348 | - const keywords = value.keyWords; | 348 | + const keywords = value.keyWords || ''; |
349 | const res = await postResearchGroupsNameSet({ | 349 | const res = await postResearchGroupsNameSet({ |
350 | data: { | 350 | data: { |
351 | status: 'ADD_AUDIT_PASS', | 351 | status: 'ADD_AUDIT_PASS', |
352 | groupName: keywords, | 352 | groupName: keywords, |
353 | }, | 353 | }, |
354 | }); | 354 | }); |
355 | - let options = res?.data?.map((c: any) => { | ||
356 | - return { | ||
357 | - label: c, | ||
358 | - value: c, | ||
359 | - key: c, | ||
360 | - }; | ||
361 | - }); | ||
362 | - return options; | 355 | + return Object.entries(res?.data || {}).map( |
356 | + ([researchGroupsId, researchGroupsName]) => ({ | ||
357 | + label: researchGroupsName, | ||
358 | + value: researchGroupsName, // 使用 researchGroupsId 作为 value | ||
359 | + key: researchGroupsId, | ||
360 | + id: researchGroupsId, | ||
361 | + }), | ||
362 | + ); | ||
363 | }} | 363 | }} |
364 | fieldProps={{ | 364 | fieldProps={{ |
365 | - filterOption() { | ||
366 | - return true; | 365 | + filterOption: () => true, |
366 | + onChange: (_, option) => { | ||
367 | + form.setFieldsValue({ | ||
368 | + researchGroupId: option?.id || '', | ||
369 | + }); | ||
367 | }, | 370 | }, |
368 | }} | 371 | }} |
369 | debounceTime={1000} | 372 | debounceTime={1000} |
370 | label="课题组名称" | 373 | label="课题组名称" |
371 | placeholder="请输入名称" | 374 | placeholder="请输入名称" |
372 | /> | 375 | /> |
376 | + <ProFormText | ||
377 | + hidden={true} | ||
378 | + key="researchGroupId" | ||
379 | + name="researchGroupId" | ||
380 | + ></ProFormText> | ||
373 | <Form.Item label="关联销售" name="affiliateSales"> | 381 | <Form.Item label="关联销售" name="affiliateSales"> |
374 | <ProFormSelect | 382 | <ProFormSelect |
375 | name="affiliateSales" | 383 | name="affiliateSales" |