+
+ {customer.customerName}
+
+
+ {loading ? (
+
+ ) : (
+
`共 ${total} 条`,
+ onShowSizeChange: selectChange,
+ onChange: changePage
+ }}
+ />
+ )}
+
+
+
+
+ *上传格式为jpg、png文件
+
+
+
+ 点击上方"选择文件"或将文件拖拽到此区域
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default CustomerRetention;
diff --git a/packages/examination/src/views/statistical/detail.tsx b/packages/examination/src/views/statistical/detail.tsx
index 59b7a9d..192c4b1 100644
--- a/packages/examination/src/views/statistical/detail.tsx
+++ b/packages/examination/src/views/statistical/detail.tsx
@@ -1,34 +1,67 @@
-import React from 'react'
+import React from 'react';
+import { Tabs } from 'antd';
+import type { TabsProps } from 'antd';
+import EnterpriseFile from 'views/statistical/enterpriseFile';
+import CustomerRetention from 'views/statistical/customerRetention';
+
import { useLocation } from 'react-router-dom';
-import {Breadcrumb, Descriptions} from 'antd';
-const Detail = () => {
+const onChange = (key: string) => {
+ console.log(key);
+};
+
+const App: React.FC = () => {
const location = useLocation();
- // @ts-ignore
- const { record } = location.state || {}; // Access the record passed from the previous page
-
- if (!record) {
- return No record found!
;
- }
-
-
- return (
-
- {/**/}
- {/* {breadcrumb.map((item, index) => (*/}
- {/* {item}*/}
- {/* ))}*/}
- {/**/}
-
客户详情
-
- {record.customerNo}
- {record.customerName}
- {record.typePname}
- {record.contacts}
- {record.contactsPhone}
-
-
- );
-}
-
-export default Detail;
+
+ // 提取 record 数据,若没有则设为默认值
+ const { record } = location.state as { record: any } || {};
+
+ console.log("record", record)
+
+ const items: TabsProps['items'] = [
+ {
+ key: '1',
+ label: '基本信息',
+ children: 基本信息,
+ },
+ {
+ key: '2',
+ label: '保单',
+ children: '保单',
+ },
+ {
+ key: '3',
+ label: '事故预防服务',
+ children: '事故预防服务',
+ },
+ {
+ key: '4',
+ label: '风险辨识',
+ children: '风险辨识',
+ },
+ {
+ key: '5',
+ label: '隐患排查',
+ children: '隐患排查',
+ },
+ {
+ key: '6',
+ label: '理赔案件',
+ children: '理赔案件',
+ },
+ {
+ key: '7',
+ label: '一企一档',
+ children: ,
+ },
+ {
+ key: '8',
+ label: '客户留存',
+ children: ,
+ },
+ ];
+
+ return ;
+};
+
+export default App;
diff --git a/packages/examination/src/views/statistical/enterpriseFile.tsx b/packages/examination/src/views/statistical/enterpriseFile.tsx
new file mode 100644
index 0000000..2ce2e01
--- /dev/null
+++ b/packages/examination/src/views/statistical/enterpriseFile.tsx
@@ -0,0 +1,156 @@
+import React, {useState, useEffect} from 'react';
+import {Table, Button, Spin, Descriptions} from 'antd';
+import html2canvas from 'html2canvas';
+import { jsPDF } from 'jspdf';
+
+interface Enterprise {
+ key: string;
+ customerNo: string;
+ customerName: string;
+ industry: string;
+ contacts: string;
+ phone: string;
+}
+
+const EnterpriseFile: React.FC = () => {
+ // State to store data and loading state
+ const [data, setData] = useState([]);
+ const [loading, setLoading] = useState(false);
+
+ // Simulate data fetching on component mount
+ useEffect(() => {
+ setLoading(true);
+ setTimeout(() => {
+ // Simulated response data
+ const fetchedData: Enterprise[] = [
+ { key: '1', customerNo: '001', customerName: 'Company A', industry: 'Technology', contacts: 'John Doe', phone: '123-456-789' },
+ { key: '2', customerNo: '002', customerName: 'Company B', industry: 'Finance', contacts: 'Jane Smith', phone: '987-654-321' },
+ // Add more data as needed
+ ];
+ setData(fetchedData);
+ setLoading(false);
+ }, 1000); // Simulate a delay of 2 seconds
+ }, []);
+
+ const columns = [
+ {
+ title: '客户编号',
+ dataIndex: 'customerNo',
+ key: 'customerNo',
+ },
+ {
+ title: '企业名称',
+ dataIndex: 'customerName',
+ key: 'customerName',
+ },
+ {
+ title: '行业分类',
+ dataIndex: 'industry',
+ key: 'industry',
+ },
+ {
+ title: '企业联系人',
+ dataIndex: 'contacts',
+ key: 'contacts',
+ },
+ {
+ title: '联系电话',
+ dataIndex: 'phone',
+ key: 'phone',
+ },
+ ];
+
+ const items = [
+ {
+ key: '1',
+ label: 'UserName',
+ children: 'Zhou Maomao',
+ },
+ {
+ key: '2',
+ label: 'Telephone',
+ children: '1810000000',
+ },
+ {
+ key: '3',
+ label: 'Live',
+ children: 'Hangzhou, Zhejiang',
+ },
+ {
+ key: '4',
+ label: 'Address',
+ span: 2,
+ children: 'No. 18, Wantang Road, Xihu District, Hangzhou, Zhejiang, China',
+ },
+ {
+ key: '5',
+ label: 'Remark',
+ children: 'empty',
+ },
+ ];
+
+ const handleCapture = () => {
+ const element = document.querySelector('.main-customer-htm');
+ if (element) {
+ html2canvas(element as HTMLElement, {
+ useCORS: true, // Allow CORS for cross-origin resources
+ }).then((canvas) => {
+ // Convert the canvas to image data
+ const imgData = canvas.toDataURL('image/png');
+
+ // Create a new jsPDF instance
+ const pdf = new jsPDF();
+
+ // Add the image to the PDF (at position (10, 10) with size (pdf width - 20, auto))
+ pdf.addImage(imgData, 'PNG', 10, 10, pdf.internal.pageSize.width - 20, canvas.height * (pdf.internal.pageSize.width - 20) / canvas.width);
+
+ // Save the PDF
+ pdf.save('企业档案.pdf');
+ });
+ }
+ }
+
+ return (
+
+
+
+
+
+
+ {items.map(item => (
+
+ {item.children}
+
+ ))}
+
+
+ {loading ? (
+
+ ) : (
+
+ )}
+
+
+
+
+
+
+ );
+};
+
+export default EnterpriseFile;
diff --git a/packages/examination/src/views/statistical/list.tsx b/packages/examination/src/views/statistical/list.tsx
index 778fca4..187d0e6 100644
--- a/packages/examination/src/views/statistical/list.tsx
+++ b/packages/examination/src/views/statistical/list.tsx
@@ -1,14 +1,11 @@
import React from 'react'
-import { Form, Input, Button, DatePicker, Table, Modal, Select, Descriptions} from 'antd'
+import { Form, Input, Button, DatePicker, Table, Select} from 'antd'
import { getList } from 'api/statistical'
-import Detail from 'components/order_manage/promotion_detail'
import { dictionary } from "api/dict/index";
const { Option } = Select
-const { RangePicker } = DatePicker;
-
interface Props {
currentId: number
}
@@ -18,7 +15,7 @@ interface State {
keyword: string,
page: number,
num: number,
- activityName?: string,
+ affiliation?: string,
memberName?: string,
mobile?: number | string,
start?: number,
@@ -83,18 +80,11 @@ class Customer extends React.Component{
}
})
}
- // handleDetail(text: any, record: any) {
- // // console.log(text)
- // // console.log(record)
- // this.setState({
- // detailVisible: true,
- // currentId: text.orderId,
- // showDetail: true
- // })
- // }
+
handleDetail(record: any) {
// @ts-ignore
const { history } = this.props;
+ console.log(record)
history.push({
pathname: '/customerDetail',
state: { record },
@@ -107,7 +97,6 @@ class Customer extends React.Component{
const _listQuery = { ...this.state.listQuery, customerNo, customerName, typePname, contacts, contactsPhone }
this.setState({ listQuery: _listQuery })
this.getListApi(this.state.listQuery)
- // console.log(this.state.listQuery)
}
const onFinishFailed = (errorInfo: object) => {
console.log('failes', errorInfo)
@@ -124,7 +113,6 @@ class Customer extends React.Component{
align: 'center',
fixed: 'right',
width: 100,
- // render: (text: any, record: any) => { this.handleDetail(text, record) }}>查看
,
render: (text: any, record: any) => { this.handleDetail(record) }}>查看
,
}
];
@@ -145,21 +133,11 @@ class Customer extends React.Component{
this.getListApi(query);
}
- // 详情model
- const handleCancel = () => {
- this.setState({ detailVisible: false })
-
- };
-
const onReset = () => {
const form = this.formRef.current;
- // 获取字段的当前值
- const keyword = form.getFieldValue('keyword');
- const affiliation = form.getFieldValue('affiliation');
- const manageType = form.getFieldValue('manageType');
-
- console.log('Current values before reset:', keyword, affiliation, manageType);
-
+ // const keyword = form.getFieldValue('keyword');
+ // const affiliation = form.getFieldValue('affiliation');
+ // const manageType = form.getFieldValue('manageType');
// 清空字段值
form.resetFields();
};
@@ -214,7 +192,7 @@ class Customer extends React.Component{
- {
onShowSizeChange: selectchange,
onChange: changePage
}} />
- {/* 查看详情 */}
-
- 关闭
-
- ]}>
-
-
)
}