From 160be8ae9c0c4927b22aa1b9153cc426b5813aa5 Mon Sep 17 00:00:00 2001 From: tangjie <122778500@qq.com> Date: Thu, 2 Jul 2026 13:50:07 +0800 Subject: [PATCH] feat --- jjb.config.js | 2 +- src/enumerate/constant/index.js | 4 +- src/enumerate/qualFilingOptions.js | 2 +- .../QualApplication/FilingForm/index.js | 194 +++++++++--------- .../QualificationReview/QualReview/index.js | 26 ++- 5 files changed, 113 insertions(+), 115 deletions(-) diff --git a/jjb.config.js b/jjb.config.js index 77a0273..3c08271 100644 --- a/jjb.config.js +++ b/jjb.config.js @@ -20,7 +20,7 @@ module.exports = { }, }, // 应用唯一标识符 - appIdentifier: "safety-eval", + appIdentifier: "safetyEval", // 应用上下文注入全局变量 contextInject: { // 应用Key diff --git a/src/enumerate/constant/index.js b/src/enumerate/constant/index.js index 08de1bb..a88c442 100644 --- a/src/enumerate/constant/index.js +++ b/src/enumerate/constant/index.js @@ -19,8 +19,8 @@ export const VERIFY_STATUS_MAP = { /** 审核状态 */ export const REVIEW_STATUS_MAP = { pending: { label: "待审核", color: "warning" }, - reviewing: { label: "审核中", color: "processing" }, - rejected: { label: "打回", color: "error" }, + 2: { label: "审核中", color: "processing" }, + 3: { label: "打回", color: "error" }, }; /** 专家核验状态 */ diff --git a/src/enumerate/qualFilingOptions.js b/src/enumerate/qualFilingOptions.js index f051213..3466782 100644 --- a/src/enumerate/qualFilingOptions.js +++ b/src/enumerate/qualFilingOptions.js @@ -69,7 +69,7 @@ export const FILING_BUSINESS_SCOPE_OPTIONS = [ ]; export const FILING_FORM_MODE = { - APPLICATION: "safety-eval", + APPLICATION: "application", FILED: "filed", CHANGE: "change", }; diff --git a/src/pages/Container/QualApplication/FilingForm/index.js b/src/pages/Container/QualApplication/FilingForm/index.js index bb8d4d8..4471a94 100644 --- a/src/pages/Container/QualApplication/FilingForm/index.js +++ b/src/pages/Container/QualApplication/FilingForm/index.js @@ -27,14 +27,6 @@ import PrerequisiteVerifyModal from "./components/PrerequisiteVerifyModal"; const router = tools.router; -const STEP_ITEMS = [ - { key: "basic", label: "1. 备案基本信息" }, - { key: "materials", label: "2. 备案材料上传" }, - { key: "commitment", label: "3. 法定代表人承诺书" }, - { key: "personnel", label: "4. 备案人员管理" }, - { key: "equipment", label: "5. 装备清单" }, -]; - const MODE_TITLE = { [FILING_FORM_MODE.APPLICATION]: "资质备案申请", [FILING_FORM_MODE.FILED]: "资质备案填报", @@ -89,38 +81,13 @@ function FilingFormPage(props) { setDetail((prev) => ({ ...prev, ...(res?.data || {}) })); console.log(res?.data, "res.data"); basicForm.setFieldsValue(res?.data || {}); + commitmentForm.setFieldsValue(res?.data?.commitment || {}); }); } else { setDetail((prev) => ({ ...prev, materials: FILING_MATERIAL_TEMPLATE })); } }, []); - useEffect(() => { - if (!personnelOptions.length) { - return; - } - const data = detailRef.current; - const commitment = data?.commitment || {}; - if (commitment.legalRepPersonnelId) { - commitmentForm.setFieldValue( - "legalRepPersonnelId", - String(commitment.legalRepPersonnelId), - ); - return; - } - if (commitment.legalRepName) { - const matched = personnelOptions.find( - (item) => item.staffName === commitment.legalRepName, - ); - if (matched) { - commitmentForm.setFieldsValue({ - legalRepPersonnelId: matched.value, - legalRepName: matched.staffName || matched.label, - }); - } - } - }, [commitmentForm, personnelOptions]); - const collectCurrentDetail = useCallback(() => { const current = detailRef.current || detail; return mergeDetailFromForms(current, { @@ -129,37 +96,39 @@ function FilingFormPage(props) { }); }, [basicForm, commitmentForm, detail]); - const handleSaveDraft = async () => { - if (readOnly) { - return; - } - setSubmitting(true); - try { - const currentDetail = collectCurrentDetail(); - await persistFilingToBackend(props, currentDetail, mode); - clearLocalDraft(mode); - message.success("已暂存"); - props.history.push("qualApplication/filingApplication/list"); - } catch (err) { - message.error(err?.message || "暂存失败"); - } finally { - setSubmitting(false); - } - }; - const handleSubmitRequest = async () => { if (readOnly) { return; } - - + try { + await basicForm.validateFields(); + } catch (err) { + setActiveStep("basic"); + return; + } + try { + await commitmentForm.validateFields(); + } catch (err) { + setActiveStep("commitment"); + return; + } const currentDetail = collectCurrentDetail(); + if (!currentDetail?.personnelList?.length) { + message.warning("请至少添加一位备案人员"); + setActiveStep("personnel"); + return; + } + if (!currentDetail?.equipmentList?.length) { + message.warning("请至少添加一条装备清单"); + setActiveStep("equipment"); + return; + } const result = verifyFilingPrerequisites(currentDetail); setVerifyResult(result); setVerifyOpen(true); }; - const handleVerifyConfirm = async () => { + const handleVerifyConfirm = async (config) => { if (!verifyResult?.passed) { return; } @@ -167,7 +136,11 @@ function FilingFormPage(props) { const currentDetail = collectCurrentDetail(); const body = { - qualFilingAddCmd: { ...currentDetail }, + qualFilingAddCmd: { + ...currentDetail, + filingStatusCode: config.isSaveDraft ? 5 : 2, + applyTypeCode: mode === "application" ? 1 : 2, + }, }; const params = body.qualFilingAddCmd; if (params.materials) { @@ -189,15 +162,15 @@ function FilingFormPage(props) { if (router.query.id) { body.qualFilingAddCmd.id = router.query.id; } - debugger; + const result = await props.submitQualFiling(body); if (result?.success) { setVerifyOpen(false); - message.success("提交成功"); + message.success(isSaveDraft ? "暂存成功" : "提交成功"); props.history.push("filingApplication/list"); } else { - message.error(result?.message || "提交失败"); + message.error(result?.message || (isSaveDraft ? "暂存失败" : "提交失败")); } setSubmitting(false); }; @@ -326,6 +299,57 @@ function FilingFormPage(props) { })); }; + const STEP_ITEMS = [ + { + key: "basic", + label: "1. 备案基本信息", + children: , + forceRender: true, + }, + { + key: "materials", + label: "2. 备案材料上传", + children: ( + + ), + }, + { + key: "commitment", + label: "3. 法定代表人承诺书", + children: , + forceRender: true, + }, + { + key: "personnel", + label: "4. 备案人员管理", + children: ( + + ), + }, + { + key: "equipment", + label: "5. 装备清单", + children: ( + + ), + }, + ]; + const stepIndex = STEP_ITEMS.findIndex((item) => item.key === activeStep); const isLastStep = stepIndex === STEP_ITEMS.length - 1; @@ -354,7 +378,7 @@ function FilingFormPage(props) { { + onChange={async (key) => { if (key === "commitment") { commitmentForm.setFieldsValue({ filingUnitName: @@ -365,43 +389,7 @@ function FilingFormPage(props) { setActiveStep(key); }} /> -
- {activeStep === "basic" && ( - - )} - {activeStep === "materials" && ( - - )} - {activeStep === "commitment" && ( - - )} - {activeStep === "personnel" && ( - - )} - {activeStep === "equipment" && ( - - )} -
+
{stepIndex > 0 && ( @@ -437,7 +427,7 @@ function FilingFormPage(props) { {!isLastStep && ( + )}