feat
parent
744093c82f
commit
d642995237
|
|
@ -15,49 +15,23 @@ import SearchForm from "~/components/SearchForm";
|
|||
import ControlWrapper from "@cqsjjb/jjb-react-admin-component/ControlWrapper";
|
||||
import { AntdTableFuncControl } from "@cqsjjb/jjb-common-decorator/antd";
|
||||
import { tools } from "@cqsjjb/jjb-common-lib";
|
||||
import { PUBLICITY_STATUS_MAP } from "~/enumerate/constant";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { NS_QUAL_REVIEW } from "~/enumerate/namespace";
|
||||
import { REVIEW_STATUS_MAP } from "~/enumerate/constant";
|
||||
import { QUALIFICATION_INDUSTRY_OPTIONS_MAP } from "~/enumerate/enterpriseOptions";
|
||||
import {
|
||||
REVIEW_BUSINESS_SCOPE_OPTIONS,
|
||||
REVIEW_UNIT_TYPE_OPTIONS,
|
||||
} from "../reviewPageQuery";
|
||||
|
||||
const { TextArea } = Input;
|
||||
|
||||
const MOCK_DATA = [
|
||||
{
|
||||
id: 1,
|
||||
orgName: "重庆安评技术研究院有限公司",
|
||||
orgType: "本地机构",
|
||||
certNo: "API-2026-001",
|
||||
businessScope: "化工, 石油加工",
|
||||
reviewDept: "市应急管理局",
|
||||
reviewTime: "2026-06-20",
|
||||
status: "pending",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
orgName: "重庆恒安安全评价有限公司",
|
||||
orgType: "本地机构",
|
||||
certNo: "API-2025-032",
|
||||
businessScope: "化工",
|
||||
reviewDept: "市应急管理局",
|
||||
reviewTime: "2026-05-15",
|
||||
status: "published",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
orgName: "北京中安评价中心(重庆分公司)",
|
||||
orgType: "异地机构",
|
||||
certNo: "API-2026-015",
|
||||
businessScope: "矿山, 建筑施工",
|
||||
reviewDept: "市应急管理局",
|
||||
reviewTime: "2026-06-18",
|
||||
status: "pending",
|
||||
},
|
||||
];
|
||||
|
||||
const { router } = tools;
|
||||
|
||||
const QualPublicity = (props) => {
|
||||
const [form] = Form.useForm();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const { qualReview, queryReviewList } = props;
|
||||
const { qualReviewList, qualReviewTotal, qualReviewLoading } = qualReview || {};
|
||||
const [publicityVisible, setPublicityVisible] = useState(false);
|
||||
const [publicityTarget, setPublicityTarget] = useState(null);
|
||||
const [publicityDept, setPublicityDept] = useState(undefined);
|
||||
|
|
@ -65,6 +39,14 @@ const QualPublicity = (props) => {
|
|||
const [publicityStartDate, setPublicityStartDate] = useState(null);
|
||||
const [publicityEndDate, setPublicityEndDate] = useState(null);
|
||||
|
||||
const loadList = () => {
|
||||
queryReviewList({
|
||||
...router.query,
|
||||
supervision: true,
|
||||
applyTypeCode: 1,
|
||||
});
|
||||
};
|
||||
|
||||
const openPublicity = (record) => {
|
||||
setPublicityTarget(record);
|
||||
setPublicityDept(undefined);
|
||||
|
|
@ -87,44 +69,41 @@ const QualPublicity = (props) => {
|
|||
setPublicityVisible(false);
|
||||
};
|
||||
|
||||
const handleSearch = () => {
|
||||
setLoading(true);
|
||||
setTimeout(() => setLoading(false), 500);
|
||||
};
|
||||
|
||||
const handleReset = (values) => {
|
||||
router.query = {
|
||||
...router.query,
|
||||
...values,
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
size: 10,
|
||||
};
|
||||
handleSearch();
|
||||
loadList();
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
form.setFieldsValue(router.query);
|
||||
loadList();
|
||||
}, []);
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: "序号",
|
||||
dataIndex: "id",
|
||||
width: 60,
|
||||
fixed: "left",
|
||||
render: (text, record, index) => index + 1,
|
||||
render: (_, __, index) => index + 1,
|
||||
},
|
||||
{ title: "机构名称", dataIndex: "orgName", width: 220, ellipsis: true },
|
||||
{ title: "机构类型", dataIndex: "orgType", width: 100 },
|
||||
{ title: "证书编号", dataIndex: "certNo", width: 140, ellipsis: true },
|
||||
{ title: "机构名称", dataIndex: "filingUnitName", width: 220, ellipsis: true },
|
||||
{ title: "机构类型", dataIndex: "filingUnitTypeName", width: 100 },
|
||||
{ title: "证书编号", dataIndex: "filingNo", width: 140, ellipsis: true },
|
||||
{
|
||||
title: "安全评价业务范围",
|
||||
dataIndex: "businessScope",
|
||||
width: 180,
|
||||
ellipsis: true,
|
||||
render: (_, record) => {
|
||||
if(Array.isArray(record.businessScope)){
|
||||
return record.businessScope.map(item => QUALIFICATION_INDUSTRY_OPTIONS_MAP[item]).join("、");
|
||||
if (Array.isArray(record.businessScope)) {
|
||||
return record.businessScope
|
||||
.map((item) => QUALIFICATION_INDUSTRY_OPTIONS_MAP[item] || item)
|
||||
.join("、");
|
||||
}
|
||||
return record.businessScope || "-";
|
||||
},
|
||||
|
|
@ -133,11 +112,11 @@ const QualPublicity = (props) => {
|
|||
{ title: "审核通过时间", dataIndex: "reviewTime", width: 120 },
|
||||
{
|
||||
title: "公示状态",
|
||||
dataIndex: "status",
|
||||
dataIndex: "filingStatusCode",
|
||||
width: 100,
|
||||
render: (status) => {
|
||||
const config = PUBLICITY_STATUS_MAP[status];
|
||||
return config ? <Tag color={config.color}>{config.label}</Tag> : status;
|
||||
render: (_, { filingStatusCode }) => {
|
||||
const config = REVIEW_STATUS_MAP[filingStatusCode];
|
||||
return config ? <Tag color={config.color}>{config.label}</Tag> : "--";
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
@ -149,13 +128,11 @@ const QualPublicity = (props) => {
|
|||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
onClick={() => {
|
||||
// props.history.push(`FilingDetail?id=${record.id}`)
|
||||
}}
|
||||
onClick={() => props.history.push(`FilingDetail?id=${record.id}`)}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
{record.status === "pending" && (
|
||||
{Number(record.filingStatusCode) === 1 && (
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
|
|
@ -177,48 +154,41 @@ const QualPublicity = (props) => {
|
|||
<SearchForm
|
||||
style={{ marginBottom: 24 }}
|
||||
form={form}
|
||||
loading={loading}
|
||||
loading={qualReviewLoading}
|
||||
formLine={[
|
||||
<Form.Item key="orgName" name="orgName">
|
||||
<ControlWrapper.Input
|
||||
label="机构名称"
|
||||
placeholder="请输入"
|
||||
allowClear
|
||||
/>
|
||||
<Form.Item key="filingUnitName" name="filingUnitName">
|
||||
<ControlWrapper.Input label="机构名称" placeholder="请输入" allowClear />
|
||||
</Form.Item>,
|
||||
<Form.Item key="orgType" name="orgType">
|
||||
<Form.Item key="filingUnitTypeName" name="filingUnitTypeName">
|
||||
<ControlWrapper.Select
|
||||
label="机构类型"
|
||||
placeholder="请选择"
|
||||
allowClear
|
||||
style={{ width: "100%" }}
|
||||
>
|
||||
<Select.Option value="本地机构">本地机构</Select.Option>
|
||||
<Select.Option value="异地机构">异地机构</Select.Option>
|
||||
</ControlWrapper.Select>
|
||||
options={REVIEW_UNIT_TYPE_OPTIONS}
|
||||
/>
|
||||
</Form.Item>,
|
||||
<Form.Item key="businessScope" name="businessScope">
|
||||
<ControlWrapper.Select
|
||||
label="安全评价业务范围"
|
||||
placeholder="请选择"
|
||||
allowClear
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
style={{ width: "100%" }}
|
||||
>
|
||||
<Select.Option value="石油加工">石油加工</Select.Option>
|
||||
<Select.Option value="化工">化工</Select.Option>
|
||||
<Select.Option value="矿山">矿山</Select.Option>
|
||||
<Select.Option value="建筑施工">建筑施工</Select.Option>
|
||||
</ControlWrapper.Select>
|
||||
options={REVIEW_BUSINESS_SCOPE_OPTIONS}
|
||||
/>
|
||||
</Form.Item>,
|
||||
<Form.Item key="status" name="status">
|
||||
<Form.Item key="filingStatusCode" name="filingStatusCode">
|
||||
<ControlWrapper.Select
|
||||
label="公示状态"
|
||||
placeholder="请选择"
|
||||
allowClear
|
||||
style={{ width: "100%" }}
|
||||
>
|
||||
<Select.Option value="pending">待公示</Select.Option>
|
||||
<Select.Option value="published">已公示</Select.Option>
|
||||
<Select.Option value={1}>审核通过</Select.Option>
|
||||
<Select.Option value={2}>审核中</Select.Option>
|
||||
<Select.Option value={3}>打回</Select.Option>
|
||||
</ControlWrapper.Select>
|
||||
</Form.Item>,
|
||||
]}
|
||||
|
|
@ -228,32 +198,32 @@ const QualPublicity = (props) => {
|
|||
...router.query,
|
||||
...values,
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
size: 10,
|
||||
};
|
||||
handleSearch();
|
||||
loadList();
|
||||
}}
|
||||
/>
|
||||
|
||||
<Table
|
||||
rowKey="id"
|
||||
columns={columns}
|
||||
dataSource={MOCK_DATA}
|
||||
dataSource={Array.isArray(qualReviewList) ? qualReviewList : []}
|
||||
scroll={{ y: props.scrollY }}
|
||||
loading={loading}
|
||||
loading={qualReviewLoading}
|
||||
pagination={{
|
||||
total: MOCK_DATA.length,
|
||||
total: qualReviewTotal,
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
current: router.query.current,
|
||||
pageSize: router.query.pageSize,
|
||||
current: router.query.current || 1,
|
||||
pageSize: router.query.size || 10,
|
||||
onChange: (page, pageSize) => {
|
||||
router.query = {
|
||||
...router.query,
|
||||
current: page,
|
||||
pageSize,
|
||||
size: pageSize,
|
||||
};
|
||||
handleSearch();
|
||||
loadList();
|
||||
},
|
||||
}}
|
||||
/>
|
||||
|
|
@ -279,7 +249,7 @@ const QualPublicity = (props) => {
|
|||
<div>
|
||||
<div style={{ fontSize: "0.8rem", marginBottom: 4 }}>机构名称</div>
|
||||
<div style={{ fontSize: "0.88rem", fontWeight: 500 }}>
|
||||
{publicityTarget?.orgName || "—"}
|
||||
{publicityTarget?.filingUnitName || "-"}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
|
|
@ -339,4 +309,4 @@ const QualPublicity = (props) => {
|
|||
);
|
||||
};
|
||||
|
||||
export default AntdTableFuncControl(QualPublicity);
|
||||
export default Connect([NS_QUAL_REVIEW], true)(AntdTableFuncControl(QualPublicity));
|
||||
|
|
|
|||
Loading…
Reference in New Issue