fix
parent
6f1a2134d3
commit
6d3c2e6c6b
|
|
@ -1,10 +1,9 @@
|
|||
import { Button, Card, Col, Descriptions, Form, Modal, Row, Statistic, Tag } from "antd";
|
||||
import { Button, Card, Col, Descriptions, Form, Modal, Row, Statistic, Table, Tag } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import SearchForm from "@cqsjjb/jjb-react-admin-component/SearchForm";
|
||||
import ControlWrapper from "@cqsjjb/jjb-react-admin-component/ControlWrapper";
|
||||
import { AntdTableFuncControl } from "@cqsjjb/jjb-common-decorator/antd";
|
||||
import { CHONGQING_DISTRICTS } from "~/enumerate/enterpriseOptions";
|
||||
import {
|
||||
ACCOUNT_SOURCE_OPTIONS,
|
||||
|
|
@ -24,16 +23,36 @@ const SCORE_RING_COLOR = {
|
|||
"C级": "#faad14",
|
||||
};
|
||||
|
||||
function EnterprisePortraitPage() {
|
||||
function EnterprisePortraitPage(props) {
|
||||
const [searchForm] = Form.useForm();
|
||||
const [viewOpen, setViewOpen] = useState(false);
|
||||
const [detail, setDetail] = useState(null);
|
||||
const [detailLoading, setDetailLoading] = useState(false);
|
||||
const [dataSource, setDataSource] = useState([]);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [pageIndex, setPageIndex] = useState(1);
|
||||
const [pageSize, setPageSize] = useState(10);
|
||||
|
||||
const { tableProps, getData } = useTable(queryEnterprisePortraitPage, { form: searchForm });
|
||||
const fetchData = async (page = 1, size = 10) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const formData = searchForm.getFieldsValue();
|
||||
const res = await queryEnterprisePortraitPage({ ...formData, pageIndex: page, pageSize: size });
|
||||
setDataSource(res?.data || []);
|
||||
setTotal(res?.totalCount || 0);
|
||||
}
|
||||
catch {
|
||||
setDataSource([]);
|
||||
setTotal(0);
|
||||
}
|
||||
finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
getData();
|
||||
fetchData();
|
||||
}, []);
|
||||
|
||||
const openProfile = async (id) => {
|
||||
|
|
@ -60,27 +79,41 @@ function EnterprisePortraitPage() {
|
|||
</div>
|
||||
}
|
||||
>
|
||||
<Search
|
||||
<SearchForm
|
||||
form={searchForm}
|
||||
options={[
|
||||
{ name: "enterpriseName", label: "企业名称", placeholder: "关键字搜索" },
|
||||
{
|
||||
name: "district",
|
||||
label: "属地",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
options: CHONGQING_DISTRICTS,
|
||||
},
|
||||
{
|
||||
name: "accountSource",
|
||||
label: "开户来源",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
options: ACCOUNT_SOURCE_OPTIONS,
|
||||
},
|
||||
loading={loading}
|
||||
formLine={[
|
||||
<Form.Item key="enterpriseName" name="enterpriseName">
|
||||
<ControlWrapper.Input label="企业名称" allowClear placeholder="关键字搜索" />
|
||||
</Form.Item>,
|
||||
<Form.Item key="district" name="district">
|
||||
<ControlWrapper.Select label="属地" allowClear placeholder="请选择" options={CHONGQING_DISTRICTS} />
|
||||
</Form.Item>,
|
||||
<Form.Item key="accountSource" name="accountSource">
|
||||
<ControlWrapper.Select label="开户来源" allowClear placeholder="请选择" options={ACCOUNT_SOURCE_OPTIONS} />
|
||||
</Form.Item>,
|
||||
]}
|
||||
onFinish={getData}
|
||||
onFinish={() => fetchData(1, 10)}
|
||||
style={{
|
||||
marginBottom: '16px'
|
||||
}}
|
||||
/>
|
||||
<Table
|
||||
{...tableProps}
|
||||
dataSource={dataSource}
|
||||
loading={loading}
|
||||
pagination={{
|
||||
current: pageIndex,
|
||||
pageSize,
|
||||
total,
|
||||
showSizeChanger: true,
|
||||
showTotal: (t) => `共 ${t} 条`,
|
||||
}}
|
||||
onChange={(pag) => {
|
||||
setPageIndex(pag.current);
|
||||
setPageSize(pag.pageSize);
|
||||
fetchData(pag.current, pag.pageSize);
|
||||
}}
|
||||
scroll={{ y: props.scrollY }}
|
||||
columns={[
|
||||
{ title: "企业名称", dataIndex: "enterpriseName", ellipsis: true },
|
||||
{ title: "项目按时完成", dataIndex: "projectOnTime", width: 120 },
|
||||
|
|
@ -206,4 +239,4 @@ function EnterprisePortraitPage() {
|
|||
);
|
||||
}
|
||||
|
||||
export default EnterprisePortraitPage;
|
||||
export default AntdTableFuncControl(EnterprisePortraitPage);
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { Button, Descriptions, Form, Modal, Tag, Tooltip } from "antd";
|
||||
import { Table as AntTable } from "antd";
|
||||
import { Button, Descriptions, Form, Modal, Tag, Tooltip, Table } from "antd";
|
||||
import { AntdTableFuncControl } from "@cqsjjb/jjb-common-decorator/antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import ControlWrapper from "@cqsjjb/jjb-react-admin-component/ControlWrapper";
|
||||
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
|
||||
import SearchForm from "@cqsjjb/jjb-react-admin-component/SearchForm";
|
||||
import Table from "@cqsjjb/jjb-react-admin-component/Table";
|
||||
|
||||
import { getEvaluatorDetail, queryEvaluatorPage } from "~/mock/regulator/basicInfo";
|
||||
|
||||
const YES_NO_OPTIONS = [
|
||||
|
|
@ -23,7 +23,7 @@ const CERT_STATUS_COLOR = {
|
|||
expired: "error",
|
||||
};
|
||||
|
||||
function EvaluatorInfoPage() {
|
||||
function EvaluatorInfoPage(props) {
|
||||
const [searchForm] = Form.useForm();
|
||||
const [viewOpen, setViewOpen] = useState(false);
|
||||
const [detail, setDetail] = useState(null);
|
||||
|
|
@ -102,6 +102,9 @@ function EvaluatorInfoPage() {
|
|||
</Form.Item>,
|
||||
]}
|
||||
onFinish={() => fetchData(1, 10)}
|
||||
style={{
|
||||
marginBottom: '16px'
|
||||
}}
|
||||
/>
|
||||
<Table
|
||||
dataSource={dataSource}
|
||||
|
|
@ -118,6 +121,7 @@ function EvaluatorInfoPage() {
|
|||
setPageSize(pag.pageSize);
|
||||
fetchData(pag.current, pag.pageSize);
|
||||
}}
|
||||
scroll={{ y: props.scrollY }}
|
||||
columns={[
|
||||
{ title: "机构名称", dataIndex: "orgName", ellipsis: true },
|
||||
{ title: "评价师名称", dataIndex: "evaluatorName", width: 120 },
|
||||
|
|
@ -177,7 +181,7 @@ function EvaluatorInfoPage() {
|
|||
<Descriptions.Item label="账号">{detail.account}</Descriptions.Item>
|
||||
</Descriptions>
|
||||
<div style={{ marginBottom: 8, fontWeight: 600 }}>资质证照</div>
|
||||
<AntTable
|
||||
<Table
|
||||
size="small"
|
||||
bordered
|
||||
rowKey="id"
|
||||
|
|
@ -238,4 +242,4 @@ function EvaluatorInfoPage() {
|
|||
);
|
||||
}
|
||||
|
||||
export default EvaluatorInfoPage;
|
||||
export default AntdTableFuncControl(EvaluatorInfoPage);
|
||||
|
|
|
|||
Loading…
Reference in New Issue