tangjie 2026-07-07 18:12:11 +08:00
commit 9169ad5599
10 changed files with 267 additions and 169 deletions

View File

@ -128,17 +128,68 @@ export function fromFilingCommitmentForm(values = {}, filingId) {
// ─── 字段映射:人员 / 装备 ─── // ─── 字段映射:人员 / 装备 ───
export function toFilingPersonnelRow(data = {}) { export function toFilingPersonnelRow(data = {}) {
const personName = data.personName || data.userName || data.staffName;
return { return {
id: asId(data.id), id: asId(data.id),
filingId: asId(data.filingId), filingId: asId(data.filingId),
sourcePersonnelId: asId(data.sourcePersonnelId), sourcePersonnelId: asId(data.sourcePersonnelId),
personName: data.personName, personName,
userName: personName,
personTypeCode: data.personTypeCode,
personTypeName: data.personTypeName, personTypeName: data.personTypeName,
positionName: data.positionName, positionName: data.positionName,
titleName: data.titleName, titleName: data.titleName,
genderCode: data.genderCode,
genderName: data.genderName,
birthDate: data.birthDate,
joinWorkDate: data.joinWorkDate,
idCardNo: data.idCardNo,
currentAddress: data.currentAddress,
officeAddress: data.officeAddress,
educationCode: data.educationCode,
educationName: data.educationName,
graduateSchool: data.graduateSchool,
major: data.major,
qualScope: data.qualScope,
publications: data.publications,
professionalLevelCert: data.professionalLevelCert,
registerEngineerFlag: data.registerEngineerFlag,
abilityDeclaration: data.abilityDeclaration,
workExperience: data.workExperience,
proofMaterialUrl: data.proofMaterialUrl,
}; };
} }
export function fromFilingPersonnelAddCmd(item = {}) {
const row = toFilingPersonnelRow(item);
return normalizeQueryIds({
sourcePersonnelId: row.sourcePersonnelId,
personName: row.personName,
personTypeCode: row.personTypeCode,
personTypeName: row.personTypeName,
positionName: row.positionName,
titleName: row.titleName,
genderCode: row.genderCode,
genderName: row.genderName,
birthDate: row.birthDate,
joinWorkDate: row.joinWorkDate,
idCardNo: row.idCardNo,
currentAddress: row.currentAddress,
officeAddress: row.officeAddress,
educationCode: row.educationCode,
educationName: row.educationName,
graduateSchool: row.graduateSchool,
major: row.major,
qualScope: row.qualScope,
publications: row.publications,
professionalLevelCert: row.professionalLevelCert,
registerEngineerFlag: row.registerEngineerFlag,
abilityDeclaration: row.abilityDeclaration,
workExperience: row.workExperience,
proofMaterialUrl: row.proofMaterialUrl,
});
}
export function toFilingEquipmentRow(data = {}) { export function toFilingEquipmentRow(data = {}) {
return { return {
id: asId(data.id), id: asId(data.id),
@ -168,6 +219,25 @@ export function toChangeHistory(data = {}) {
// ─── 分页查询参数映射 ───
function toFilingPageQuery(params = {}) {
const { filingTerritoryName, filingTerritoryCode, filingStatus, ...rest } = params;
const query = toPageQuery(rest, {
filingUnitName: "filingUnitName",
filingNo: "filingNo",
applyTypeCode: "applyTypeCode",
});
const territory = filingTerritoryCode || filingTerritoryName;
if (territory) {
query.filingTerritoryCode = territory;
}
if (filingStatus !== undefined && filingStatus !== null && filingStatus !== "") {
query.filingStatusCode = Number(filingStatus);
}
return query;
}
// ═══════════════════════════════════════════════════ // ═══════════════════════════════════════════════════
// 接口 Action // 接口 Action
// ═══════════════════════════════════════════════════ // ═══════════════════════════════════════════════════
@ -190,14 +260,12 @@ export async function fetchQualFilingChangeHistory(filingId) {
} }
export const qualFilingPage = declareRequest("qualFilingLoading", safePageResult(async (params) => { export const qualFilingPage = declareRequest("qualFilingLoading", safePageResult(async (params) => {
const res = await apiGet("/safetyEval/qual-filing/page", toFilingPageQuery(params));
const res = await apiGet("/safetyEval/qual-filing/page", params);
return fromPageResponse(res, toFilingListRow); return fromPageResponse(res, toFilingListRow);
})); }));
export const qualFilingFiledPage = declareRequest("qualFilingLoading", safePageResult(async (params) => { export const qualFilingFiledPage = declareRequest("qualFilingLoading", safePageResult(async (params) => {
const res = await apiGet("/safetyEval/qual-filing/filed/page", toFilingPageQuery(params));
const res = await apiGet("/safetyEval/qual-filing/filed/page", params);
return fromPageResponse(res, toFilingListRow); return fromPageResponse(res, toFilingListRow);
})); }));

View File

@ -72,9 +72,12 @@ function FilingApplicationListPage(props) {
cancelText: "否", cancelText: "否",
onOk: async () => { onOk: async () => {
const res = await props.qualFilingDelete({ id: record.id }); const res = await props.qualFilingDelete({ id: record.id });
if (res?.success !== false) {
message.success("删除成功"); message.success("删除成功");
getData(); getData();
} else {
message.error(res?.message || res?.errMessage || "删除失败");
}
}, },
}); });
}; };

View File

@ -13,8 +13,7 @@ export default function PersonnelStep({
const [selectOpen, setSelectOpen] = useState(false); const [selectOpen, setSelectOpen] = useState(false);
const [viewId, setViewId] = useState(""); const [viewId, setViewId] = useState("");
const existingIds = personnelList.map((item) => String(item.id || "")); const existingIds = personnelList.map((item) => String(item.sourcePersonnelId || item.id || ""));
console.log(personnelList);
return ( return (
<> <>
@ -36,7 +35,7 @@ export default function PersonnelStep({
dataSource={personnelList} dataSource={personnelList}
columns={[ columns={[
{ title: "序号", width: 60, render: (_, __, index) => index + 1 }, { title: "序号", width: 60, render: (_, __, index) => index + 1 },
{ title: "人员姓名", dataIndex: "userName" }, { title: "人员姓名", dataIndex: "userName", render: (_, record) => record.userName || record.personName },
{ title: "类型", dataIndex: "personTypeName" }, { title: "类型", dataIndex: "personTypeName" },
{ title: "职称", dataIndex: "titleName" }, { title: "职称", dataIndex: "titleName" },

View File

@ -3,7 +3,7 @@ import { tools } from "@cqsjjb/jjb-common-lib";
import { Button, Form, message, Modal, Space, Spin, Tabs } from "antd"; import { Button, Form, message, Modal, Space, Spin, Tabs } from "antd";
import { useCallback, useEffect, useRef, useState } from "react"; import { useCallback, useEffect, useRef, useState } from "react";
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout"; import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
import { fetchQualFilingDetail, fetchQualChangeDetail } from "~/api/qualFiling"; import { fetchQualFilingDetail, fetchQualChangeDetail, fromFilingPersonnelAddCmd } from "~/api/qualFiling";
import { NS_QUAL_FILING } from "~/enumerate/namespace"; import { NS_QUAL_FILING } from "~/enumerate/namespace";
import { FILING_FORM_MODE } from "~/enumerate/qualFilingOptions"; import { FILING_FORM_MODE } from "~/enumerate/qualFilingOptions";
import { FILING_MATERIAL_TEMPLATE } from "../filingMaterialTemplate"; import { FILING_MATERIAL_TEMPLATE } from "../filingMaterialTemplate";
@ -97,6 +97,46 @@ function FilingFormPage(props) {
}); });
}, [basicForm, commitmentForm, detail]); }, [basicForm, commitmentForm, detail]);
const syncCommitmentFromBasic = useCallback(() => {
const filingUnitName =
basicForm.getFieldValue("filingUnitName") || detail?.filingUnitName || "";
const legalRepName = commitmentForm.getFieldValue("legalRepName") || "";
commitmentForm.setFieldsValue({ filingUnitName, legalRepName });
}, [basicForm, commitmentForm, detail?.filingUnitName]);
const goToStep = useCallback(
(key) => {
if (key === "commitment") {
syncCommitmentFromBasic();
}
setActiveStep(key);
},
[syncCommitmentFromBasic],
);
const handleSaveDraft = async () => {
if (readOnly) {
return;
}
setSubmitting(true);
try {
const currentDetail = collectCurrentDetail();
await persistFilingToBackend(props, currentDetail, mode);
message.success("暂存成功");
props.history.goBack();
} catch (err) {
message.error(err?.message || "暂存失败");
} finally {
setSubmitting(false);
}
};
useEffect(() => {
if (activeStep === "commitment") {
syncCommitmentFromBasic();
}
}, [activeStep, syncCommitmentFromBasic]);
const handleSubmitRequest = async () => { const handleSubmitRequest = async () => {
if (readOnly) { if (readOnly) {
return; return;
@ -151,10 +191,7 @@ function FilingFormPage(props) {
delete params.materials; delete params.materials;
} }
if (params.personnelList) { if (params.personnelList) {
body[`qualFilingPersonnel${word}AddCmds`] = params.personnelList.map((item) => ({ body[`qualFilingPersonnel${word}AddCmds`] = params.personnelList.map(fromFilingPersonnelAddCmd);
...item,
personName: item.userName,
}));
delete params.personnelList; delete params.personnelList;
} }
if (params.equipmentList) { if (params.equipmentList) {
@ -202,7 +239,7 @@ function FilingFormPage(props) {
const handlePersonnelAdd = (sourcePersonnelIds, rows = []) => { const handlePersonnelAdd = (sourcePersonnelIds, rows = []) => {
const existing = new Set( const existing = new Set(
(detailRef.current?.personnelList || []).map((item) => (detailRef.current?.personnelList || []).map((item) =>
String(item.sourcePersonnelId), String(item.sourcePersonnelId || item.id),
), ),
); );
const idsToAdd = sourcePersonnelIds.filter( const idsToAdd = sourcePersonnelIds.filter(
@ -214,7 +251,7 @@ function FilingFormPage(props) {
const rowMap = new Map((rows || []).map((row) => [String(row.id), row])); const rowMap = new Map((rows || []).map((row) => [String(row.id), row]));
const newRows = idsToAdd.map((id) => { const newRows = idsToAdd.map((id) => {
const row = rowMap.get(String(id)); const row = rowMap.get(String(id));
return row; return row ? mapStaffRowToFilingPersonnel(row) : mapStaffRowToFilingPersonnel({ id });
}); });
setDetail((prev) => ({ setDetail((prev) => ({
...prev, ...prev,
@ -226,7 +263,7 @@ function FilingFormPage(props) {
const handlePersonnelRemove = (record) => { const handlePersonnelRemove = (record) => {
Modal.confirm({ Modal.confirm({
title: "提示", title: "提示",
content: `确认删除人员「${record.userName}」?`, content: `确认删除人员「${record.userName || record.personName}」?`,
onOk: () => { onOk: () => {
setDetail((prev) => ({ setDetail((prev) => ({
...prev, ...prev,
@ -358,23 +395,14 @@ function FilingFormPage(props) {
<Tabs <Tabs
activeKey={activeStep} activeKey={activeStep}
items={STEP_ITEMS} items={STEP_ITEMS}
onChange={async (key) => { onChange={goToStep}
if (key === "commitment") {
commitmentForm.setFieldsValue({
filingUnitName:
basicForm.getFieldValue("filingUnitName") ||
detail?.filingUnitName,
});
}
setActiveStep(key);
}}
/> />
<Space> <Space>
{stepIndex > 0 && ( {stepIndex > 0 && (
<Button <Button
onClick={async () => { onClick={() => {
setActiveStep(STEP_ITEMS[stepIndex - 1].key); goToStep(STEP_ITEMS[stepIndex - 1].key);
}} }}
> >
上一步 上一步
@ -383,8 +411,8 @@ function FilingFormPage(props) {
{!isLastStep && ( {!isLastStep && (
<Button <Button
type="primary" type="primary"
onClick={async () => { onClick={() => {
setActiveStep(STEP_ITEMS[stepIndex + 1].key); goToStep(STEP_ITEMS[stepIndex + 1].key);
}} }}
> >
下一步 下一步
@ -393,9 +421,7 @@ function FilingFormPage(props) {
{!readOnly && isLastStep && ( {!readOnly && isLastStep && (
<> <>
{mode !== FILING_FORM_MODE.FILED && ( {mode !== FILING_FORM_MODE.FILED && (
<Button <Button loading={submitting} onClick={handleSaveDraft}>
onClick={() => handleVerifyConfirm({ isSaveDraft: true })}
>
暂存 暂存
</Button> </Button>
)} )}

View File

@ -29,6 +29,7 @@ export function mapStaffRowToFilingPersonnel(row = {}) {
id: `local-person-${id}`, id: `local-person-${id}`,
sourcePersonnelId: id, sourcePersonnelId: id,
personName: row.staffName, personName: row.staffName,
userName: row.staffName,
personTypeName: row.personType, personTypeName: row.personType,
positionName: row.positionName, positionName: row.positionName,
titleName: row.titleName, titleName: row.titleName,
@ -188,6 +189,10 @@ async function syncEquipment(props, filingId, localList = [], backendList = [])
/** /**
* 将本地表单全量同步到后端暂存 / 提交确认时调用 * 将本地表单全量同步到后端暂存 / 提交确认时调用
*/ */
function getApiErrorMessage(res, fallback) {
return res?.message || res?.errMessage || fallback;
}
export async function persistFilingToBackend(props, detail, mode) { export async function persistFilingToBackend(props, detail, mode) {
let filingId = detail.id; let filingId = detail.id;
const basicValues = collectBasicValues(detail); const basicValues = collectBasicValues(detail);
@ -198,7 +203,7 @@ export async function persistFilingToBackend(props, detail, mode) {
: props.qualFilingDraft; : props.qualFilingDraft;
const draftRes = await createDraft(); const draftRes = await createDraft();
if (draftRes?.success === false || !draftRes?.data?.id) { if (draftRes?.success === false || !draftRes?.data?.id) {
throw new Error(draftRes?.message || "创建草稿失败"); throw new Error(getApiErrorMessage(draftRes, "创建草稿失败"));
} }
filingId = draftRes.data.id; filingId = draftRes.data.id;
basicValues.id = filingId; basicValues.id = filingId;
@ -206,7 +211,7 @@ export async function persistFilingToBackend(props, detail, mode) {
const saveRes = await props.qualFilingSaveDraft({ ...basicValues, id: filingId }); const saveRes = await props.qualFilingSaveDraft({ ...basicValues, id: filingId });
if (saveRes?.success === false) { if (saveRes?.success === false) {
throw new Error(saveRes?.message || "暂存基本信息失败"); throw new Error(getApiErrorMessage(saveRes, "暂存基本信息失败"));
} }
if (detail.attachmentUrl) { if (detail.attachmentUrl) {
@ -230,7 +235,7 @@ export async function persistFilingToBackend(props, detail, mode) {
buildCommitmentPayload({ ...detail, id: filingId }), buildCommitmentPayload({ ...detail, id: filingId }),
); );
if (commitmentRes?.success === false) { if (commitmentRes?.success === false) {
throw new Error(commitmentRes?.message || "暂存承诺书失败"); throw new Error(getApiErrorMessage(commitmentRes, "暂存承诺书失败"));
} }
} }

View File

@ -1,104 +1,70 @@
import React, { useState, useEffect } from "react"; import React, { useEffect } from "react";
import { Button, Form, Select, Space, Table, Tag } from "antd"; import { Button, Form, Select, Table, Tag } from "antd";
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 TableAction from "@cqsjjb/jjb-react-admin-component/TableAction";
import ControlWrapper from "@cqsjjb/jjb-react-admin-component/ControlWrapper"; import ControlWrapper from "@cqsjjb/jjb-react-admin-component/ControlWrapper";
import { AntdTableFuncControl } from "@cqsjjb/jjb-common-decorator/antd"; import { AntdTableFuncControl } from "@cqsjjb/jjb-common-decorator/antd";
import {tools} from '@cqsjjb/jjb-common-lib' import { tools } from "@cqsjjb/jjb-common-lib";
import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { NS_QUAL_REVIEW } from "~/enumerate/namespace";
import { VERIFY_STATUS_MAP } from "~/enumerate/constant"; import { VERIFY_STATUS_MAP } from "~/enumerate/constant";
import {
FILING_CODE_TO_CONFIRM,
REVIEW_BUSINESS_SCOPE_OPTIONS,
REVIEW_UNIT_TYPE_OPTIONS,
toQualReviewPageQuery,
} from "../reviewPageQuery";
const { router } = tools;
// 静态模拟数据
const MOCK_DATA = [
{
id: 1,
orgName: "重庆安评技术研究院有限公司",
orgType: "本地机构",
certNo: "API-2026-001",
businessScope: "化工, 石油加工",
confirmStatus: "pending",
},
{
id: 2,
orgName: "北京中安评价中心(重庆分公司)",
orgType: "异地机构",
certNo: "API-2026-015",
businessScope: "矿山",
confirmStatus: "passed",
},
{
id: 3,
orgName: "重庆华安评价有限公司",
orgType: "异地机构",
certNo: "API-2025-088",
businessScope: "石油加工",
confirmStatus: "pending",
},
{
id: 4,
orgName: "重庆安评科技有限公司",
orgType: "本地机构",
certNo: "API-2024-056",
businessScope: "化工",
confirmStatus: "rejected",
},
{
id: 5,
orgName: "重庆恒安安全评价有限公司",
orgType: "本地机构",
certNo: "API-2025-032",
businessScope: "矿山, 石油加工",
confirmStatus: "passed",
},
];
const {router} = tools;
const ExpertVerification = (props) => { const ExpertVerification = (props) => {
const [form] = Form.useForm(); const [form] = Form.useForm();
const [loading, setLoading] = useState(false); const { qualReview, queryReviewList } = props;
const { qualReviewList, qualReviewTotal, qualReviewLoading } = qualReview || {};
const handleSearch = () => { const handleSearch = () => {
setLoading(true); queryReviewList({
console.log(router.query); ...toQualReviewPageQuery(router.query),
setTimeout(() => setLoading(false), 500); supervision: true,
applyTypeCode: 1,
});
}; };
const handleReset = (values) => { const handleReset = (values) => {
setLoading(true); router.query = {
router.query={
...router.query, ...router.query,
...values, ...values,
current: 1, current: 1,
pageSize: 10, size: 10,
} };
handleSearch(); handleSearch();
}; };
useEffect(() => { useEffect(() => {
form.setFieldsValue(router.query); form.setFieldsValue(router.query);
handleSearch();
}, []); }, []);
const columns = [ const columns = [
{ {
title: "序号", title: "序号",
dataIndex: "id",
width: 60, width: 60,
fixed: "left", fixed: "left",
render: (text, record, index) => index + 1, render: (_, __, index) => index + 1,
}, },
{ title: "机构名称", dataIndex: "orgName", width: 220, ellipsis: true }, { title: "机构名称", dataIndex: "filingUnitName", width: 220, ellipsis: true },
{ title: "机构类型", dataIndex: "orgType", width: 100 }, { title: "机构类型", dataIndex: "filingUnitTypeName", width: 100 },
{ title: "证书编号", dataIndex: "certNo", width: 140, ellipsis: true }, { title: "证书编号", dataIndex: "filingNo", width: 140, ellipsis: true },
{ title: "安全评价业务范围", dataIndex: "businessScope", width: 180, ellipsis: true }, { title: "安全评价业务范围", dataIndex: "businessScope", width: 180, ellipsis: true },
{ {
title: "确认状态", title: "确认状态",
dataIndex: "confirmStatus", dataIndex: "filingStatusCode",
width: 100, width: 100,
render: (status) => { render: (code) => {
const status = FILING_CODE_TO_CONFIRM[code];
const config = VERIFY_STATUS_MAP[status]; const config = VERIFY_STATUS_MAP[status];
return config ? <Tag color={config.color}>{config.label}</Tag> : status; return config ? <Tag color={config.color}>{config.label}</Tag> : "--";
}, },
}, },
{ {
@ -106,61 +72,54 @@ const ExpertVerification = (props) => {
width: 140, width: 140,
fixed: "right", fixed: "right",
render: (_, record) => ( render: (_, record) => (
<Space> <TableAction>
<Button type="link" size="small" onClick={() => props.history.push(`FilingDetail?id=${record.id}`)}> <Button type="link" size="small" onClick={() => props.history.push(`FilingDetail?id=${record.id}`)}>
查看 查看
</Button> </Button>
{record.confirmStatus === "pending" && ( {record.filingStatusCode === 2 && (
<Button type="link" size="small" onClick={() => props.history.push(`QualReviewForm?id=${record.id}`)}> <Button type="link" size="small" onClick={() => props.history.push(`QualReviewForm?id=${record.id}`)}>
核验 核验
</Button> </Button>
)} )}
</Space> </TableAction>
), ),
}, },
]; ];
return ( return (
<PageLayout title="专家资料核验"> <PageLayout title="专家资料核验">
<SearchForm <SearchForm
style={{ marginBottom: 24 }} style={{ marginBottom: 24 }}
form={form} form={form}
loading={loading} loading={qualReviewLoading}
formLine={[ formLine={[
<Form.Item key="orgName" name="orgName"> <Form.Item key="filingUnitName" name="filingUnitName">
<ControlWrapper.Input label="机构名称" placeholder="请输入" allowClear /> <ControlWrapper.Input label="机构名称" placeholder="请输入" allowClear />
</Form.Item>, </Form.Item>,
<Form.Item key="orgType" name="orgType"> <Form.Item key="filingUnitTypeName" name="filingUnitTypeName">
<ControlWrapper.Select <ControlWrapper.Select
label="机构类型" label="机构类型"
placeholder="请输入" placeholder="请选择"
allowClear allowClear
style={{ width: "100%" }} style={{ width: "100%" }}
> options={REVIEW_UNIT_TYPE_OPTIONS}
<Select.Option value="本地机构">本地机构</Select.Option> />
<Select.Option value="异地机构">异地机构</Select.Option>
</ControlWrapper.Select>
</Form.Item>, </Form.Item>,
<Form.Item <Form.Item key="businessScope" name="businessScope">
key="businessScope"
name="businessScope"
>
<ControlWrapper.Select <ControlWrapper.Select
label="安全评价业务范围" label="安全评价业务范围"
placeholder="请输入" placeholder="请选择"
allowClear allowClear
showSearch
optionFilterProp="label"
style={{ width: "100%" }} style={{ width: "100%" }}
> options={REVIEW_BUSINESS_SCOPE_OPTIONS}
<Select.Option value="石油加工">石油加工</Select.Option> />
<Select.Option value="化工">化工</Select.Option>
<Select.Option value="矿山">矿山</Select.Option>
</ControlWrapper.Select>
</Form.Item>, </Form.Item>,
<Form.Item key="confirmStatus" name="confirmStatus"> <Form.Item key="confirmStatus" name="confirmStatus">
<ControlWrapper.Select <ControlWrapper.Select
label="确认状态" label="确认状态"
placeholder="请输入" placeholder="请选择"
allowClear allowClear
style={{ width: "100%" }} style={{ width: "100%" }}
> >
@ -172,12 +131,12 @@ const ExpertVerification = (props) => {
]} ]}
onReset={handleReset} onReset={handleReset}
onFinish={(values) => { onFinish={(values) => {
router.query={ router.query = {
...router.query, ...router.query,
...values, ...values,
current: 1, current: 1,
pageSize: 10, size: 10,
} };
handleSearch(); handleSearch();
}} }}
/> />
@ -185,22 +144,21 @@ const ExpertVerification = (props) => {
<Table <Table
rowKey="id" rowKey="id"
columns={columns} columns={columns}
dataSource={MOCK_DATA} dataSource={qualReviewList}
scroll={{ y: props.scrollY }} scroll={{ y: props.scrollY }}
loading={loading} loading={qualReviewLoading}
pagination={{ pagination={{
total: MOCK_DATA.length, total: qualReviewTotal,
showSizeChanger: true, showSizeChanger: true,
showQuickJumper: true, showQuickJumper: true,
showTotal: (total) => `${total}`, showTotal: (total) => `${total}`,
current: router.query.current, current: router.query.current || 1,
pageSize: router.query.pageSize, pageSize: router.query.size || 10,
onChange: (page, pageSize) => { onChange: (page, pageSize) => {
router.query = {
router.query={
...router.query, ...router.query,
current: page, current: page,
pageSize, size: pageSize,
}; };
handleSearch(); handleSearch();
}, },
@ -210,4 +168,4 @@ const ExpertVerification = (props) => {
); );
}; };
export default AntdTableFuncControl(ExpertVerification); export default Connect([NS_QUAL_REVIEW], true)(AntdTableFuncControl(ExpertVerification));

View File

@ -9,6 +9,11 @@ import { tools } from "@cqsjjb/jjb-common-lib";
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { NS_QUAL_REVIEW } from "~/enumerate/namespace"; import { NS_QUAL_REVIEW } from "~/enumerate/namespace";
import { FILING_STATUS_MAP } from "~/enumerate/constant"; import { FILING_STATUS_MAP } from "~/enumerate/constant";
import {
REVIEW_BUSINESS_SCOPE_OPTIONS,
REVIEW_UNIT_TYPE_OPTIONS,
toQualReviewPageQuery,
} from "../reviewPageQuery";
const { router } = tools; const { router } = tools;
@ -19,7 +24,7 @@ const QualConfirm = (props) => {
const handleSearch = () => { const handleSearch = () => {
queryReviewList({ queryReviewList({
...router.query, ...toQualReviewPageQuery(router.query),
supervision: true, supervision: true,
applyTypeCode: 2, applyTypeCode: 2,
}); });
@ -89,31 +94,27 @@ const QualConfirm = (props) => {
<Form.Item key="filingUnitName" name="filingUnitName"> <Form.Item key="filingUnitName" name="filingUnitName">
<ControlWrapper.Input label="机构名称" placeholder="请输入" allowClear /> <ControlWrapper.Input label="机构名称" placeholder="请输入" allowClear />
</Form.Item>, </Form.Item>,
<Form.Item key="filingUnitTypeName" name="orgType"> <Form.Item key="filingUnitTypeName" name="filingUnitTypeName">
<ControlWrapper.Select <ControlWrapper.Select
label="机构类型" label="机构类型"
placeholder="请选择" placeholder="请选择"
allowClear allowClear
style={{ width: "100%" }} style={{ width: "100%" }}
> options={REVIEW_UNIT_TYPE_OPTIONS}
<Select.Option value="本地机构">本地机构</Select.Option> />
<Select.Option value="异地机构">异地机构</Select.Option>
</ControlWrapper.Select>
</Form.Item>, </Form.Item>,
<Form.Item key="businessScope" name="businessScope"> <Form.Item key="businessScope" name="businessScope">
<ControlWrapper.Select <ControlWrapper.Select
label="安全评价业务范围" label="安全评价业务范围"
placeholder="请选择" placeholder="请选择"
allowClear allowClear
showSearch
optionFilterProp="label"
style={{ width: "100%" }} style={{ width: "100%" }}
> options={REVIEW_BUSINESS_SCOPE_OPTIONS}
<Select.Option value="石油加工">石油加工</Select.Option> />
<Select.Option value="化工">化工</Select.Option>
<Select.Option value="矿山">矿山</Select.Option>
<Select.Option value="建筑施工">建筑施工</Select.Option>
</ControlWrapper.Select>
</Form.Item>, </Form.Item>,
<Form.Item key="filingStatusCode" name="filingStatusCode"> <Form.Item key="confirmStatus" name="confirmStatus">
<ControlWrapper.Select <ControlWrapper.Select
label="确认状态" label="确认状态"
placeholder="请选择" placeholder="请选择"

View File

@ -10,6 +10,11 @@ import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { NS_QUAL_REVIEW } from "~/enumerate/namespace"; import { NS_QUAL_REVIEW } from "~/enumerate/namespace";
import { REVIEW_STATUS_MAP, EXPERT_STATUS_MAP } from "~/enumerate/constant"; import { REVIEW_STATUS_MAP, EXPERT_STATUS_MAP } from "~/enumerate/constant";
import {
REVIEW_BUSINESS_SCOPE_OPTIONS,
REVIEW_UNIT_TYPE_OPTIONS,
toQualReviewPageQuery,
} from "../reviewPageQuery";
const { router } = tools; const { router } = tools;
@ -23,11 +28,10 @@ const QualReview = (props) => {
const handleSearch = () => { const handleSearch = () => {
queryReviewList({ queryReviewList({
...router.query, ...toQualReviewPageQuery(router.query),
supervision: true, supervision: true,
applyTypeCode: 1, applyTypeCode: 1,
}); });
}; };
const handleReset = (values) => { const handleReset = (values) => {
@ -104,29 +108,25 @@ const QualReview = (props) => {
<Form.Item key="filingUnitName" name="filingUnitName"> <Form.Item key="filingUnitName" name="filingUnitName">
<ControlWrapper.Input label="机构名称" placeholder="请输入" allowClear /> <ControlWrapper.Input label="机构名称" placeholder="请输入" allowClear />
</Form.Item>, </Form.Item>,
<Form.Item key="filingUnitTypeName" name="orgType"> <Form.Item key="filingUnitTypeName" name="filingUnitTypeName">
<ControlWrapper.Select <ControlWrapper.Select
label="机构类型" label="机构类型"
placeholder="请选择" placeholder="请选择"
allowClear allowClear
style={{ width: "100%" }} style={{ width: "100%" }}
> options={REVIEW_UNIT_TYPE_OPTIONS}
<Select.Option value="本地机构">本地机构</Select.Option> />
<Select.Option value="异地机构">异地机构</Select.Option>
</ControlWrapper.Select>
</Form.Item>, </Form.Item>,
<Form.Item key="businessScope" name="businessScope"> <Form.Item key="businessScope" name="businessScope">
<ControlWrapper.Select <ControlWrapper.Select
label="安全评价业务范围" label="安全评价业务范围"
placeholder="请选择" placeholder="请选择"
allowClear allowClear
showSearch
optionFilterProp="label"
style={{ width: "100%" }} style={{ width: "100%" }}
> options={REVIEW_BUSINESS_SCOPE_OPTIONS}
<Select.Option value="石油加工">石油加工</Select.Option> />
<Select.Option value="化工">化工</Select.Option>
<Select.Option value="矿山">矿山</Select.Option>
<Select.Option value="建筑施工">建筑施工</Select.Option>
</ControlWrapper.Select>
</Form.Item>, </Form.Item>,
<Form.Item key="needExpertCheck" name="needExpertCheck"> <Form.Item key="needExpertCheck" name="needExpertCheck">
<ControlWrapper.Select <ControlWrapper.Select

View File

@ -0,0 +1,39 @@
import { QUALIFICATION_INDUSTRY_OPTIONS } from "~/enumerate/enterpriseOptions";
import { FILING_UNIT_TYPE_OPTIONS } from "~/enumerate/qualFilingOptions";
/** 确认状态筛选值 -> 备案状态编码 */
const CONFIRM_STATUS_TO_FILING_CODE = {
pending: 2,
passed: 1,
rejected: 3,
};
/** 备案状态编码 -> 确认状态展示 */
export const FILING_CODE_TO_CONFIRM = {
2: "pending",
1: "passed",
3: "rejected",
};
/** 专家核验/确认列表筛选项(与备案申请表单保持一致) */
export const REVIEW_UNIT_TYPE_OPTIONS = FILING_UNIT_TYPE_OPTIONS;
export const REVIEW_BUSINESS_SCOPE_OPTIONS = QUALIFICATION_INDUSTRY_OPTIONS;
/** 资质审核列表查询参数映射 */
export function toQualReviewPageQuery(query = {}) {
const { confirmStatus, orgType, filingUnitTypeName, filingStatusCode, ...rest } = query;
const params = { ...rest };
const unitType = filingUnitTypeName || orgType;
if (unitType) {
params.filingUnitTypeName = unitType;
}
const statusKey = confirmStatus || filingStatusCode;
if (statusKey && CONFIRM_STATUS_TO_FILING_CODE[statusKey] != null) {
params.filingStatusCode = CONFIRM_STATUS_TO_FILING_CODE[statusKey];
} else if (filingStatusCode !== undefined && filingStatusCode !== null && filingStatusCode !== "") {
params.filingStatusCode = Number(filingStatusCode);
}
delete params.confirmStatus;
delete params.orgType;
return params;
}

View File

@ -56,9 +56,8 @@ export async function apiPost(path, data = {}, headers = {}, options = {}) {
} }
export async function apiPostDelete(path, id, options = {}) { export async function apiPostDelete(path, id, options = {}) {
const url = `${path}?id=${encodeURIComponent(asId(id) ?? "")}`;
try { try {
return await Post(url, {}, buildRequestHeaders({}, options)); return await Post(`@${path}`, { data: asId(id) }, buildRequestHeaders({}, options));
} }
catch (err) { catch (err) {
return parseHttpError(err); return parseHttpError(err);
@ -85,7 +84,7 @@ export function safeAction(mapper) {
if (res && res.success === false) { if (res && res.success === false) {
return { return {
success: false, success: false,
message: res.message || res.msg || "操作失败", message: res.message || res.msg || res.errMessage || "操作失败",
code: res.code, code: res.code,
}; };
} }