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