Merge branch 'dev' of http://47.92.113.182:3000/cq_anquan/safety-eval-service-frontend into dev
commit
9169ad5599
|
|
@ -128,17 +128,68 @@ export function fromFilingCommitmentForm(values = {}, filingId) {
|
|||
// ─── 字段映射:人员 / 装备 ───
|
||||
|
||||
export function toFilingPersonnelRow(data = {}) {
|
||||
const personName = data.personName || data.userName || data.staffName;
|
||||
return {
|
||||
id: asId(data.id),
|
||||
filingId: asId(data.filingId),
|
||||
sourcePersonnelId: asId(data.sourcePersonnelId),
|
||||
personName: data.personName,
|
||||
personName,
|
||||
userName: personName,
|
||||
personTypeCode: data.personTypeCode,
|
||||
personTypeName: data.personTypeName,
|
||||
positionName: data.positionName,
|
||||
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 = {}) {
|
||||
return {
|
||||
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
|
||||
// ═══════════════════════════════════════════════════
|
||||
|
|
@ -190,14 +260,12 @@ export async function fetchQualFilingChangeHistory(filingId) {
|
|||
}
|
||||
|
||||
export const qualFilingPage = declareRequest("qualFilingLoading", safePageResult(async (params) => {
|
||||
|
||||
const res = await apiGet("/safetyEval/qual-filing/page", params);
|
||||
const res = await apiGet("/safetyEval/qual-filing/page", toFilingPageQuery(params));
|
||||
return fromPageResponse(res, toFilingListRow);
|
||||
}));
|
||||
|
||||
export const qualFilingFiledPage = declareRequest("qualFilingLoading", safePageResult(async (params) => {
|
||||
|
||||
const res = await apiGet("/safetyEval/qual-filing/filed/page", params);
|
||||
const res = await apiGet("/safetyEval/qual-filing/filed/page", toFilingPageQuery(params));
|
||||
return fromPageResponse(res, toFilingListRow);
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -72,9 +72,12 @@ function FilingApplicationListPage(props) {
|
|||
cancelText: "否",
|
||||
onOk: async () => {
|
||||
const res = await props.qualFilingDelete({ id: record.id });
|
||||
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
if (res?.success !== false) {
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
} else {
|
||||
message.error(res?.message || res?.errMessage || "删除失败");
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ export default function PersonnelStep({
|
|||
const [selectOpen, setSelectOpen] = useState(false);
|
||||
const [viewId, setViewId] = useState("");
|
||||
|
||||
const existingIds = personnelList.map((item) => String(item.id || ""));
|
||||
console.log(personnelList);
|
||||
const existingIds = personnelList.map((item) => String(item.sourcePersonnelId || item.id || ""));
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
@ -36,7 +35,7 @@ export default function PersonnelStep({
|
|||
dataSource={personnelList}
|
||||
columns={[
|
||||
{ title: "序号", width: 60, render: (_, __, index) => index + 1 },
|
||||
{ title: "人员姓名", dataIndex: "userName" },
|
||||
{ title: "人员姓名", dataIndex: "userName", render: (_, record) => record.userName || record.personName },
|
||||
{ title: "类型", dataIndex: "personTypeName" },
|
||||
|
||||
{ title: "职称", dataIndex: "titleName" },
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { tools } from "@cqsjjb/jjb-common-lib";
|
|||
import { Button, Form, message, Modal, Space, Spin, Tabs } from "antd";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
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 { FILING_FORM_MODE } from "~/enumerate/qualFilingOptions";
|
||||
import { FILING_MATERIAL_TEMPLATE } from "../filingMaterialTemplate";
|
||||
|
|
@ -97,6 +97,46 @@ function FilingFormPage(props) {
|
|||
});
|
||||
}, [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 () => {
|
||||
if (readOnly) {
|
||||
return;
|
||||
|
|
@ -151,10 +191,7 @@ function FilingFormPage(props) {
|
|||
delete params.materials;
|
||||
}
|
||||
if (params.personnelList) {
|
||||
body[`qualFilingPersonnel${word}AddCmds`] = params.personnelList.map((item) => ({
|
||||
...item,
|
||||
personName: item.userName,
|
||||
}));
|
||||
body[`qualFilingPersonnel${word}AddCmds`] = params.personnelList.map(fromFilingPersonnelAddCmd);
|
||||
delete params.personnelList;
|
||||
}
|
||||
if (params.equipmentList) {
|
||||
|
|
@ -202,7 +239,7 @@ function FilingFormPage(props) {
|
|||
const handlePersonnelAdd = (sourcePersonnelIds, rows = []) => {
|
||||
const existing = new Set(
|
||||
(detailRef.current?.personnelList || []).map((item) =>
|
||||
String(item.sourcePersonnelId),
|
||||
String(item.sourcePersonnelId || item.id),
|
||||
),
|
||||
);
|
||||
const idsToAdd = sourcePersonnelIds.filter(
|
||||
|
|
@ -214,7 +251,7 @@ function FilingFormPage(props) {
|
|||
const rowMap = new Map((rows || []).map((row) => [String(row.id), row]));
|
||||
const newRows = idsToAdd.map((id) => {
|
||||
const row = rowMap.get(String(id));
|
||||
return row;
|
||||
return row ? mapStaffRowToFilingPersonnel(row) : mapStaffRowToFilingPersonnel({ id });
|
||||
});
|
||||
setDetail((prev) => ({
|
||||
...prev,
|
||||
|
|
@ -226,7 +263,7 @@ function FilingFormPage(props) {
|
|||
const handlePersonnelRemove = (record) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: `确认删除人员「${record.userName}」?`,
|
||||
content: `确认删除人员「${record.userName || record.personName}」?`,
|
||||
onOk: () => {
|
||||
setDetail((prev) => ({
|
||||
...prev,
|
||||
|
|
@ -358,23 +395,14 @@ function FilingFormPage(props) {
|
|||
<Tabs
|
||||
activeKey={activeStep}
|
||||
items={STEP_ITEMS}
|
||||
onChange={async (key) => {
|
||||
if (key === "commitment") {
|
||||
commitmentForm.setFieldsValue({
|
||||
filingUnitName:
|
||||
basicForm.getFieldValue("filingUnitName") ||
|
||||
detail?.filingUnitName,
|
||||
});
|
||||
}
|
||||
setActiveStep(key);
|
||||
}}
|
||||
onChange={goToStep}
|
||||
/>
|
||||
|
||||
<Space>
|
||||
{stepIndex > 0 && (
|
||||
<Button
|
||||
onClick={async () => {
|
||||
setActiveStep(STEP_ITEMS[stepIndex - 1].key);
|
||||
onClick={() => {
|
||||
goToStep(STEP_ITEMS[stepIndex - 1].key);
|
||||
}}
|
||||
>
|
||||
上一步
|
||||
|
|
@ -383,8 +411,8 @@ function FilingFormPage(props) {
|
|||
{!isLastStep && (
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={async () => {
|
||||
setActiveStep(STEP_ITEMS[stepIndex + 1].key);
|
||||
onClick={() => {
|
||||
goToStep(STEP_ITEMS[stepIndex + 1].key);
|
||||
}}
|
||||
>
|
||||
下一步
|
||||
|
|
@ -393,9 +421,7 @@ function FilingFormPage(props) {
|
|||
{!readOnly && isLastStep && (
|
||||
<>
|
||||
{mode !== FILING_FORM_MODE.FILED && (
|
||||
<Button
|
||||
onClick={() => handleVerifyConfirm({ isSaveDraft: true })}
|
||||
>
|
||||
<Button loading={submitting} onClick={handleSaveDraft}>
|
||||
暂存
|
||||
</Button>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ export function mapStaffRowToFilingPersonnel(row = {}) {
|
|||
id: `local-person-${id}`,
|
||||
sourcePersonnelId: id,
|
||||
personName: row.staffName,
|
||||
userName: row.staffName,
|
||||
personTypeName: row.personType,
|
||||
positionName: row.positionName,
|
||||
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) {
|
||||
let filingId = detail.id;
|
||||
const basicValues = collectBasicValues(detail);
|
||||
|
|
@ -198,7 +203,7 @@ export async function persistFilingToBackend(props, detail, mode) {
|
|||
: props.qualFilingDraft;
|
||||
const draftRes = await createDraft();
|
||||
if (draftRes?.success === false || !draftRes?.data?.id) {
|
||||
throw new Error(draftRes?.message || "创建草稿失败");
|
||||
throw new Error(getApiErrorMessage(draftRes, "创建草稿失败"));
|
||||
}
|
||||
filingId = draftRes.data.id;
|
||||
basicValues.id = filingId;
|
||||
|
|
@ -206,7 +211,7 @@ export async function persistFilingToBackend(props, detail, mode) {
|
|||
|
||||
const saveRes = await props.qualFilingSaveDraft({ ...basicValues, id: filingId });
|
||||
if (saveRes?.success === false) {
|
||||
throw new Error(saveRes?.message || "暂存基本信息失败");
|
||||
throw new Error(getApiErrorMessage(saveRes, "暂存基本信息失败"));
|
||||
}
|
||||
|
||||
if (detail.attachmentUrl) {
|
||||
|
|
@ -230,7 +235,7 @@ export async function persistFilingToBackend(props, detail, mode) {
|
|||
buildCommitmentPayload({ ...detail, id: filingId }),
|
||||
);
|
||||
if (commitmentRes?.success === false) {
|
||||
throw new Error(commitmentRes?.message || "暂存承诺书失败");
|
||||
throw new Error(getApiErrorMessage(commitmentRes, "暂存承诺书失败"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,104 +1,70 @@
|
|||
import React, { useState, useEffect } from "react";
|
||||
import { Button, Form, Select, Space, Table, Tag } from "antd";
|
||||
import React, { useEffect } from "react";
|
||||
import { Button, Form, Select, Table, Tag } from "antd";
|
||||
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
|
||||
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 { 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 {
|
||||
FILING_CODE_TO_CONFIRM,
|
||||
REVIEW_BUSINESS_SCOPE_OPTIONS,
|
||||
REVIEW_UNIT_TYPE_OPTIONS,
|
||||
toQualReviewPageQuery,
|
||||
} from "../reviewPageQuery";
|
||||
|
||||
|
||||
|
||||
// 静态模拟数据
|
||||
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 { router } = tools;
|
||||
|
||||
const ExpertVerification = (props) => {
|
||||
const [form] = Form.useForm();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const { qualReview, queryReviewList } = props;
|
||||
const { qualReviewList, qualReviewTotal, qualReviewLoading } = qualReview || {};
|
||||
|
||||
const handleSearch = () => {
|
||||
setLoading(true);
|
||||
console.log(router.query);
|
||||
setTimeout(() => setLoading(false), 500);
|
||||
queryReviewList({
|
||||
...toQualReviewPageQuery(router.query),
|
||||
supervision: true,
|
||||
applyTypeCode: 1,
|
||||
});
|
||||
};
|
||||
|
||||
const handleReset = (values) => {
|
||||
setLoading(true);
|
||||
router.query={
|
||||
router.query = {
|
||||
...router.query,
|
||||
...values,
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
}
|
||||
size: 10,
|
||||
};
|
||||
handleSearch();
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
form.setFieldsValue(router.query);
|
||||
handleSearch();
|
||||
}, []);
|
||||
|
||||
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 },
|
||||
{
|
||||
title: "确认状态",
|
||||
dataIndex: "confirmStatus",
|
||||
dataIndex: "filingStatusCode",
|
||||
width: 100,
|
||||
render: (status) => {
|
||||
render: (code) => {
|
||||
const status = FILING_CODE_TO_CONFIRM[code];
|
||||
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,
|
||||
fixed: "right",
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<TableAction>
|
||||
<Button type="link" size="small" onClick={() => props.history.push(`FilingDetail?id=${record.id}`)}>
|
||||
查看
|
||||
</Button>
|
||||
{record.confirmStatus === "pending" && (
|
||||
{record.filingStatusCode === 2 && (
|
||||
<Button type="link" size="small" onClick={() => props.history.push(`QualReviewForm?id=${record.id}`)}>
|
||||
核验
|
||||
</Button>
|
||||
)}
|
||||
</Space>
|
||||
</TableAction>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<PageLayout title="专家资料核验">
|
||||
|
||||
<SearchForm
|
||||
style={{ marginBottom: 24 }}
|
||||
form={form}
|
||||
loading={loading}
|
||||
loading={qualReviewLoading}
|
||||
formLine={[
|
||||
<Form.Item key="orgName" name="orgName">
|
||||
<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="请输入"
|
||||
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"
|
||||
>
|
||||
<Form.Item key="businessScope" name="businessScope">
|
||||
<ControlWrapper.Select
|
||||
label="安全评价业务范围"
|
||||
placeholder="请输入"
|
||||
placeholder="请选择"
|
||||
allowClear
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
style={{ width: "100%" }}
|
||||
>
|
||||
<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="confirmStatus" name="confirmStatus">
|
||||
<ControlWrapper.Select
|
||||
label="确认状态"
|
||||
placeholder="请输入"
|
||||
placeholder="请选择"
|
||||
allowClear
|
||||
style={{ width: "100%" }}
|
||||
>
|
||||
|
|
@ -172,12 +131,12 @@ const ExpertVerification = (props) => {
|
|||
]}
|
||||
onReset={handleReset}
|
||||
onFinish={(values) => {
|
||||
router.query={
|
||||
router.query = {
|
||||
...router.query,
|
||||
...values,
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
}
|
||||
size: 10,
|
||||
};
|
||||
handleSearch();
|
||||
}}
|
||||
/>
|
||||
|
|
@ -185,22 +144,21 @@ const ExpertVerification = (props) => {
|
|||
<Table
|
||||
rowKey="id"
|
||||
columns={columns}
|
||||
dataSource={MOCK_DATA}
|
||||
dataSource={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 = {
|
||||
...router.query,
|
||||
current: page,
|
||||
pageSize,
|
||||
size: pageSize,
|
||||
};
|
||||
handleSearch();
|
||||
},
|
||||
|
|
@ -210,4 +168,4 @@ const ExpertVerification = (props) => {
|
|||
);
|
||||
};
|
||||
|
||||
export default AntdTableFuncControl(ExpertVerification);
|
||||
export default Connect([NS_QUAL_REVIEW], true)(AntdTableFuncControl(ExpertVerification));
|
||||
|
|
|
|||
|
|
@ -9,6 +9,11 @@ import { tools } from "@cqsjjb/jjb-common-lib";
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { NS_QUAL_REVIEW } from "~/enumerate/namespace";
|
||||
import { FILING_STATUS_MAP } from "~/enumerate/constant";
|
||||
import {
|
||||
REVIEW_BUSINESS_SCOPE_OPTIONS,
|
||||
REVIEW_UNIT_TYPE_OPTIONS,
|
||||
toQualReviewPageQuery,
|
||||
} from "../reviewPageQuery";
|
||||
|
||||
const { router } = tools;
|
||||
|
||||
|
|
@ -19,7 +24,7 @@ const QualConfirm = (props) => {
|
|||
|
||||
const handleSearch = () => {
|
||||
queryReviewList({
|
||||
...router.query,
|
||||
...toQualReviewPageQuery(router.query),
|
||||
supervision: true,
|
||||
applyTypeCode: 2,
|
||||
});
|
||||
|
|
@ -89,31 +94,27 @@ const QualConfirm = (props) => {
|
|||
<Form.Item key="filingUnitName" name="filingUnitName">
|
||||
<ControlWrapper.Input label="机构名称" placeholder="请输入" allowClear />
|
||||
</Form.Item>,
|
||||
<Form.Item key="filingUnitTypeName" 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="filingStatusCode" name="filingStatusCode">
|
||||
<Form.Item key="confirmStatus" name="confirmStatus">
|
||||
<ControlWrapper.Select
|
||||
label="确认状态"
|
||||
placeholder="请选择"
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@ import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
|||
import { NS_QUAL_REVIEW } from "~/enumerate/namespace";
|
||||
|
||||
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;
|
||||
|
|
@ -23,11 +28,10 @@ const QualReview = (props) => {
|
|||
|
||||
const handleSearch = () => {
|
||||
queryReviewList({
|
||||
...router.query,
|
||||
...toQualReviewPageQuery(router.query),
|
||||
supervision: true,
|
||||
applyTypeCode: 1,
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
const handleReset = (values) => {
|
||||
|
|
@ -104,29 +108,25 @@ const QualReview = (props) => {
|
|||
<Form.Item key="filingUnitName" name="filingUnitName">
|
||||
<ControlWrapper.Input label="机构名称" placeholder="请输入" allowClear />
|
||||
</Form.Item>,
|
||||
<Form.Item key="filingUnitTypeName" 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="needExpertCheck" name="needExpertCheck">
|
||||
<ControlWrapper.Select
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -56,9 +56,8 @@ export async function apiPost(path, data = {}, headers = {}, options = {}) {
|
|||
}
|
||||
|
||||
export async function apiPostDelete(path, id, options = {}) {
|
||||
const url = `${path}?id=${encodeURIComponent(asId(id) ?? "")}`;
|
||||
try {
|
||||
return await Post(url, {}, buildRequestHeaders({}, options));
|
||||
return await Post(`@${path}`, { data: asId(id) }, buildRequestHeaders({}, options));
|
||||
}
|
||||
catch (err) {
|
||||
return parseHttpError(err);
|
||||
|
|
@ -85,7 +84,7 @@ export function safeAction(mapper) {
|
|||
if (res && res.success === false) {
|
||||
return {
|
||||
success: false,
|
||||
message: res.message || res.msg || "操作失败",
|
||||
message: res.message || res.msg || res.errMessage || "操作失败",
|
||||
code: res.code,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue