tangjie 2026-08-05 17:32:06 +08:00
parent 1d9dc7be62
commit 0a7476358d
3 changed files with 71 additions and 35 deletions

View File

@ -325,3 +325,11 @@ export const evalReportSpotcheckRectify = declareRequest(
"evalReportSpotcheckRectifyLoading",
"Post > @/safetyEval/institution/eval-report-spotcheck/rectify",
);
// ===== 机构备案行业信息 =====
export const orgIndustryCodeList = declareRequest(
"orgIndustryCodeLoading",
"Get > /safetyEval/org-info/select/org/industry/code",
"orgIndustryCodeList: [] | res.data || []",
);

View File

@ -1,6 +1,6 @@
import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { tools } from "@cqsjjb/jjb-common-lib";
import { Button, Form, message, Modal, Space, Spin, Tabs } from "antd";
import { Button, Form, message, Modal, Space, Spin, Table, Tabs } from "antd";
import dayjs from "dayjs";
import { useCallback, useEffect, useRef, useState } from "react";
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
@ -12,9 +12,7 @@ import { FILING_MATERIAL_TEMPLATE } from "../filingMaterialTemplate";
import {
fetchOrgPersonnelOptions,
mapEquipRowToFilingEquipment,
mergeDetailFromForms,
} from "../filingPersist";
import { verifyFilingPrerequisites } from "../filingVerify";
@ -43,6 +41,7 @@ function FilingFormPage(props) {
const [personnelOptions, setPersonnelOptions] = useState([]);
const [verifyOpen, setVerifyOpen] = useState(false);
const [verifyResult, setVerifyResult] = useState(null);
const [verifyFailItems, setVerifyFailItems] = useState([]);
const [basicForm] = Form.useForm();
const [commitmentForm] = Form.useForm();
@ -84,7 +83,9 @@ function FilingFormPage(props) {
const commitment = res?.data?.commitment || {};
commitmentForm.setFieldsValue({
...commitment,
signDate: commitment.signDate ? dayjs(commitment.signDate) : undefined,
signDate: commitment.signDate
? dayjs(commitment.signDate)
: undefined,
});
});
} else {
@ -117,8 +118,6 @@ function FilingFormPage(props) {
[syncCommitmentFromBasic],
);
useEffect(() => {
if (activeStep === "commitment") {
syncCommitmentFromBasic();
@ -157,8 +156,7 @@ function FilingFormPage(props) {
setVerifyOpen(true);
};
const handleVerifyConfirm = async (config={}) => {
const handleVerifyConfirm = async (config = {}) => {
setSubmitting(true);
const currentDetail = collectCurrentDetail();
@ -178,13 +176,15 @@ function FilingFormPage(props) {
delete params.materials;
}
if (params.personnelList) {
body[`qualFilingPersonnel${word}AddCmds`] = params.personnelList.map(item=>{
body[`qualFilingPersonnel${word}AddCmds`] = params.personnelList.map(
(item) => {
return {
...item,
personName: item.userName || item.personName,
sourcePersonnelId: item.sourcePersonnelId || item.id,
};
});
},
);
delete params.personnelList;
}
if (params.equipmentList) {
@ -210,9 +210,13 @@ function FilingFormPage(props) {
if (result?.success) {
setVerifyOpen(false);
if (Array.isArray(result.data) && result.data.length) {
setVerifyFailItems(result.data);
} else {
message.success(config.isSaveDraft ? "暂存成功" : "提交成功");
props.history.goBack();
}
}
setSubmitting(false);
};
@ -334,7 +338,9 @@ function FilingFormPage(props) {
{
key: "basic",
label: "1. 基本信息备案",
children: <BasicInfoStep form={basicForm} disabled={readOnly} mode={mode} />,
children: (
<BasicInfoStep form={basicForm} disabled={readOnly} mode={mode} />
),
forceRender: true,
},
{
@ -398,22 +404,23 @@ function FilingFormPage(props) {
previous
extra={
!readOnly && mode !== FILING_FORM_MODE.CHANGE ? (
<Button loading={submitting} onClick={() => handleVerifyConfirm({ isSaveDraft: true })}>
<Button
loading={submitting}
onClick={() => handleVerifyConfirm({ isSaveDraft: true })}
>
暂存
</Button>
) : null
}
>
<Spin spinning={ submitting}>
<Tabs
activeKey={activeStep}
items={STEP_ITEMS}
onChange={goToStep}
/>
<Spin spinning={submitting}>
<Tabs activeKey={activeStep} items={STEP_ITEMS} onChange={goToStep} />
<Space style={{
marginTop: '12px'
}}>
<Space
style={{
marginTop: "12px",
}}
>
{stepIndex > 0 && (
<Button
onClick={() => {
@ -449,6 +456,25 @@ function FilingFormPage(props) {
onCancel={() => setVerifyOpen(false)}
onConfirm={handleVerifyConfirm}
/>
<Modal
title="校验失败"
open={verifyFailItems.length > 0}
onCancel={() => setVerifyFailItems([])}
footer={<Button onClick={() => setVerifyFailItems([])}>知道了</Button>}
>
<Table
size="small"
rowKey="title"
pagination={false}
dataSource={verifyFailItems}
columns={[
{ title: "检查项", dataIndex: "title", width: 120 },
{ title: "资质要求", dataIndex: "description", width: 280 },
{ title: "当前值", dataIndex: "currentValue", width: 260 },
]}
/>
</Modal>
</PageLayout>
);
}

View File

@ -18,7 +18,7 @@ import { tools } from "@cqsjjb/jjb-common-lib";
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
import { NS_SAFETY_EVAL_BUSINESS } from "~/enumerate/namespace";
import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { QUALIFICATION_INDUSTRY_OPTIONS } from "~/enumerate/enterpriseOptions";
import { QUALIFICATION_INDUSTRY_OPTIONS_MAP } from "~/enumerate/enterpriseOptions";
import BaiduMapPicker from "~/components/BaiduMapPicker";
import { district } from "~/enumerate/constant";
import { phoneRule } from "~/utils/validators";
@ -45,10 +45,12 @@ const EvalProjectCreate = (props) => {
evalProjectSaveLoading,
evalProjectDetailLoading,
customerPage: customerList,
orgIndustryCodeList: industryCodes,
} = props.safetyEvalBusiness;
useEffect(() => {
props.customerPage({ current: 1, size: 999 });
props.orgIndustryCodeList();
}, []);
useEffect(() => {
@ -308,9 +310,9 @@ const EvalProjectCreate = (props) => {
rules={[{ required: true, message: "请选择所属行业" }]}
>
<Select placeholder="请选择" allowClear>
{QUALIFICATION_INDUSTRY_OPTIONS.map((opt) => (
<Select.Option key={opt.value} value={opt.value}>
{opt.label}
{(industryCodes || []).map((code) => (
<Select.Option key={code} value={code}>
{QUALIFICATION_INDUSTRY_OPTIONS_MAP[code] || code}
</Select.Option>
))}
</Select>