diff --git a/src/pages/Client/Client/Components/ClientImportModal.tsx b/src/pages/Client/Client/Components/ClientImportModal.tsx index 0f42cdb..6dec5b9 100644 --- a/src/pages/Client/Client/Components/ClientImportModal.tsx +++ b/src/pages/Client/Client/Components/ClientImportModal.tsx @@ -6,7 +6,7 @@ import { Button, Form, message } from 'antd'; import { RcFile } from 'antd/es/upload'; import axios from 'axios'; -export default () => { +export default ({ reloadTable }) => { const [form] = Form.useForm(); const [messageApi, contextHolder] = message.useMessage(); const downloadImportTemplate = () => { @@ -59,6 +59,7 @@ export default () => { blobToJson(data).then((dataJson) => { if (dataJson?.result === RESPONSE_CODE.SUCCESS) { message.success(dataJson?.message); + reloadTable(); } else { message.error(dataJson?.message); } diff --git a/src/pages/Client/Client/Components/ClientModal.tsx b/src/pages/Client/Client/Components/ClientModal.tsx index af3072d..948ff65 100644 --- a/src/pages/Client/Client/Components/ClientModal.tsx +++ b/src/pages/Client/Client/Components/ClientModal.tsx @@ -24,6 +24,7 @@ export default ({ data, type, reloadTable }) => { const res = await postAdminClientAddOrModifyClientComunicationInfo({ data: { ...values, + id: '', clientId: data.id, }, }); diff --git a/src/pages/Client/Client/Components/CommunicationHistoryModal.tsx b/src/pages/Client/Client/Components/CommunicationHistoryModal.tsx index 0606572..882ee26 100644 --- a/src/pages/Client/Client/Components/CommunicationHistoryModal.tsx +++ b/src/pages/Client/Client/Components/CommunicationHistoryModal.tsx @@ -31,20 +31,14 @@ export default ({ record }) => { title: '跟进人', width: 50, rules: [{ required: true, message: '请输入跟进人' }], - dataIndex: 'createByName', + dataIndex: 'updateByName', }, - // { - // title: '跟进类型', - // width: 150, - // ellipsis: true, - // dataIndex: 'wayText', - // hideInSearch: true, - // }, { - title: '跟进类型', + title: '跟进方式', width: 50, dataIndex: 'way', rules: [{ required: true, message: '请选择方式' }], + render: (text, record) => record.wayText, // 显示 wayText request: async () => { const res = await postServiceConstClientWay(); return enumToSelect(res.data); diff --git a/src/pages/Client/Client/index.tsx b/src/pages/Client/Client/index.tsx index bfc7232..fa8dca4 100644 --- a/src/pages/Client/Client/index.tsx +++ b/src/pages/Client/Client/index.tsx @@ -449,7 +449,12 @@ export default () => { actionRef.current.reload(); }} ></ClientDrawer>, - <ClientImportModal key="import" />, + <ClientImportModal + key="import" + reloadTable={() => { + actionRef.current.reload(); + }} + />, ]} /> </Space> diff --git a/src/pages/Client/FollowRecord/Components/ClientModal.tsx b/src/pages/Client/FollowRecord/Components/ClientModal.tsx index eb6e45c..5600d69 100644 --- a/src/pages/Client/FollowRecord/Components/ClientModal.tsx +++ b/src/pages/Client/FollowRecord/Components/ClientModal.tsx @@ -25,11 +25,12 @@ export default ({ data, type, reloadTable }) => { }, }); const matchingItem = resSearchId.data.data.find( - (item) => item.name === values.name, + (item) => item.id === values.name, ); let matchedId; if (matchingItem) { matchedId = matchingItem.id; // 匹配成功,取出 id + values.name = matchingItem.name; } else { matchedId = null; // 如果没有匹配项,可以设置为 null 或其他值 } @@ -114,13 +115,22 @@ export default ({ data, type, reloadTable }) => { }, }); console.log(data, '5656data?.nameedit'); - const namesArray = res.data.data.map((item) => item.name); - const formattedObject = namesArray.reduce((acc, name) => { - acc[name] = name; // 将名称作为键和值 + // const namesArray = res.data.data.map((item) => item.name); + // const formattedObject = res.data.data.reduce((acc, name) => { + // acc[name] = name; // 将名称作为键和值 + // return acc; + // }, {}); + // console.log(namesArray, '5656namesArray'); + // const formattedObject = res.data.data.reduce((acc, item) => { + // acc[item.name] = item.name; // 使用 name 作为键,id 作为值 + // return acc; + // }, {}); + // return enumToSelect(formattedObject); + const options = res.data.data.reduce((acc, item) => { + acc.push({ label: item.name, value: item.id }); // 使用 name 作为 label,id 作为 value return acc; - }, {}); - console.log(namesArray, '5656namesArray'); - return enumToSelect(formattedObject); + }, []); + return options; }} rules={[ { diff --git a/src/pages/Client/FollowRecord/index.tsx b/src/pages/Client/FollowRecord/index.tsx index 5d60b1a..2dd0f3c 100644 --- a/src/pages/Client/FollowRecord/index.tsx +++ b/src/pages/Client/FollowRecord/index.tsx @@ -4,7 +4,6 @@ import CommunicationHistoryModal from '@/pages/Client/FollowRecord/Components/Co import { postAdminClientQueryClientComunicationInfo, postAdminClientRemoveClientComunicationInfo, - // postServiceConstClientGroupFilters, postServiceConstClientWay, postServiceConstTradeStatus, } from '@/services'; @@ -64,7 +63,7 @@ export default () => { }, { title: '跟进人员', - dataIndex: 'createByName', + dataIndex: 'updateByName', width: 100, ellipsis: true, hideInSearch: false,