diff --git a/src/pages/business_basic/components/CustomerInfoManagement.js b/src/pages/business_basic/components/CustomerInfoManagement.js index 858604d..51521d2 100644 --- a/src/pages/business_basic/components/CustomerInfoManagement.js +++ b/src/pages/business_basic/components/CustomerInfoManagement.js @@ -1,6 +1,7 @@ import React, { useState, useEffect, useRef } from 'react'; import * as echarts from 'echarts'; import styles from './CustomerInfoManagement.less'; +import CustomerInfoManagementDetail from './CustomerInfoManagementDetail'; const CustomerInfoManagement = () => { const [searchKeyword, setSearchKeyword] = useState(''); @@ -10,6 +11,10 @@ const CustomerInfoManagement = () => { const [selectedRows, setSelectedRows] = useState([]); const [currentPage, setCurrentPage] = useState(1); const [pageSize, setPageSize] = useState(10); + // 新增:详情页面切换状态 + const [showDetail, setShowDetail] = useState(false); + const [detailData, setDetailData] = useState(null); + const [prevScrollY, setPrevScrollY] = useState(0); // 图表引用 const customerTypeChartRef = useRef(null); @@ -273,6 +278,29 @@ const CustomerInfoManagement = () => { // 计算总页数 const totalPages = Math.ceil(85 / pageSize); + // 当进入详情模式时,直接渲染详情页并提供返回按钮 + if (showDetail) { + return ( +
+
+ +
+ +
+ ); + } return (
@@ -402,7 +430,6 @@ const CustomerInfoManagement = () => { 🔍 查询 +
diff --git a/src/pages/business_basic/components/CustomerInfoManagement.less b/src/pages/business_basic/components/CustomerInfoManagement.less index 5249d3e..222c515 100644 --- a/src/pages/business_basic/components/CustomerInfoManagement.less +++ b/src/pages/business_basic/components/CustomerInfoManagement.less @@ -1,5 +1,5 @@ .container { - padding: 20px; + padding: 10px 5px; background: #f5f5f5; min-height: 100vh; diff --git a/src/pages/business_basic/components/second_customer_components/BasicInfo.js b/src/pages/business_basic/components/second_customer_components/BasicInfo.js new file mode 100644 index 0000000..0c11382 --- /dev/null +++ b/src/pages/business_basic/components/second_customer_components/BasicInfo.js @@ -0,0 +1,67 @@ +import React from 'react'; +import styles from './BasicInfo.less'; + +const BasicInfo = ({ data }) => { + const mockData = { + // 基本信息 + companyName: '中国石化销售股份有限公司', + contactName: '张经理', + address: '北京市朝阳区朝阳门北大街22号', + creditCode: '9110000100012345X', + email: 'zhang@sinopec.com', + legalEntity: '中国石油化工股份有限公司', + customerId: 'CUST-001', + phone: '13800138000', + + // 交易信息 + annualPurchase: 15680000, + paymentTerm: '30 天', + cooperationStart: '2020-03-15', + paymentMethod: '银行转账', + lastTransaction: '2023-10-28', + creditRating: 'A+' + } + const safe = (v) => (v ?? '-') + const currency = (n) => { + if (typeof n === 'number') return `¥${n.toLocaleString()}`; + if (typeof n === 'string') return n; + return '-'; + } + + return ( +
+
+
基本信息
+
+
公司名称:{safe(mockData?.companyName)}
+
联系人:{safe(mockData?.contactName)}
+
地址:{safe(mockData?.address)}
+ +
统一信用代码:{safe(mockData?.creditCode)}
+
电子邮箱:{safe(mockData?.email)}
+
法定实体:{safe(mockData?.legalEntity)}
+ +
客户 ID:{safe(mockData?.customerId)}
+
联系电话:{safe(mockData?.phone)}
+
+
+ +
+
交易信息
+
+
年度采购额:{currency(mockData?.annualPurchase)}
+
账期:{safe(mockData?.paymentTerm)}
+
合作起始:{safe(mockData?.cooperationStart)}
+ +
支付方式:{safe(mockData?.paymentMethod)}
+
最近交易:{safe(mockData?.lastTransaction)}
+
信用等级:{safe(mockData?.creditRating)}
+
+
+
+ ); +}; + +export default BasicInfo; + + diff --git a/src/pages/business_basic/components/second_customer_components/BasicInfo.less b/src/pages/business_basic/components/second_customer_components/BasicInfo.less new file mode 100644 index 0000000..562c446 --- /dev/null +++ b/src/pages/business_basic/components/second_customer_components/BasicInfo.less @@ -0,0 +1,54 @@ +.container { + width: 100%; + margin: 0 auto; + padding: 24px 32px; + background: #fff; +} + +.section { + margin-bottom: 24px; +} + +.sectionTitle { + font-size: 16px; + font-weight: 600; + color: #333333; + margin-bottom: 16px; + position: relative; + padding-left: 8px; +} + +.sectionTitle::before { + content: ''; + position: absolute; + left: 0; + top: 50%; + transform: translateY(-50%); + width: 2px; + height: 18px; + background-color: #006665; /* 蓝色竖线 */ + border-radius: 2px; +} + +.grid { + display: grid; + grid-template-columns: 1fr 1fr 1fr; + grid-column-gap: 48px; + grid-row-gap: 16px; +} + +.item { + display: flex; + align-items: baseline; +} + +.label { + color: #666666; + font-size: 12px; + min-width: 96px; +} + +.value { + color: #333333; + font-size: 12px; +}