dev_1.0.1
tangjie 2026-07-02 13:50:07 +08:00
parent 65abc7ee66
commit 160be8ae9c
5 changed files with 113 additions and 115 deletions

View File

@ -20,7 +20,7 @@ module.exports = {
},
},
// 应用唯一标识符
appIdentifier: "safety-eval",
appIdentifier: "safetyEval",
// 应用上下文注入全局变量
contextInject: {
// 应用Key

View File

@ -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" },
};
/** 专家核验状态 */

View File

@ -69,7 +69,7 @@ export const FILING_BUSINESS_SCOPE_OPTIONS = [
];
export const FILING_FORM_MODE = {
APPLICATION: "safety-eval",
APPLICATION: "application",
FILED: "filed",
CHANGE: "change",
};

View File

@ -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: <BasicInfoStep form={basicForm} disabled={readOnly} />,
forceRender: true,
},
{
key: "materials",
label: "2. 备案材料上传",
children: (
<MaterialStep
materials={detail?.materials || []}
disabled={readOnly}
onUpload={handleMaterialUpload}
/>
),
},
{
key: "commitment",
label: "3. 法定代表人承诺书",
children: <CommitmentStep form={commitmentForm} disabled={readOnly} />,
forceRender: true,
},
{
key: "personnel",
label: "4. 备案人员管理",
children: (
<PersonnelStep
personnelList={detail?.personnelList || []}
disabled={readOnly}
onAdd={handlePersonnelAdd}
onRemove={handlePersonnelRemove}
/>
),
},
{
key: "equipment",
label: "5. 装备清单",
children: (
<EquipmentStep
equipmentList={detail?.equipmentList || []}
disabled={readOnly}
onAdd={handleEquipmentAdd}
onRemove={handleEquipmentRemove}
onCalibration={handleEquipmentCalibration}
/>
),
},
];
const stepIndex = STEP_ITEMS.findIndex((item) => item.key === activeStep);
const isLastStep = stepIndex === STEP_ITEMS.length - 1;
@ -354,7 +378,7 @@ function FilingFormPage(props) {
<Tabs
activeKey={activeStep}
items={STEP_ITEMS}
onChange={(key) => {
onChange={async (key) => {
if (key === "commitment") {
commitmentForm.setFieldsValue({
filingUnitName:
@ -365,43 +389,7 @@ function FilingFormPage(props) {
setActiveStep(key);
}}
/>
<div style={{ marginTop: 16 }}>
{activeStep === "basic" && (
<BasicInfoStep form={basicForm} disabled={readOnly} />
)}
{activeStep === "materials" && (
<MaterialStep
materials={detail?.materials || []}
disabled={readOnly}
onUpload={handleMaterialUpload}
/>
)}
{activeStep === "commitment" && (
<CommitmentStep
form={commitmentForm}
disabled={readOnly}
personnelOptions={personnelOptions}
onSignatureChange={handleSignatureChange}
/>
)}
{activeStep === "personnel" && (
<PersonnelStep
personnelList={detail?.personnelList || []}
disabled={readOnly}
onAdd={handlePersonnelAdd}
onRemove={handlePersonnelRemove}
/>
)}
{activeStep === "equipment" && (
<EquipmentStep
equipmentList={detail?.equipmentList || []}
disabled={readOnly}
onAdd={handleEquipmentAdd}
onRemove={handleEquipmentRemove}
onUploadCalibration={handleEquipmentCalibration}
/>
)}
</div>
<div
style={{
display: "flex",
@ -429,7 +417,9 @@ function FilingFormPage(props) {
<Space>
{stepIndex > 0 && (
<Button
onClick={() => setActiveStep(STEP_ITEMS[stepIndex - 1].key)}
onClick={async () => {
setActiveStep(STEP_ITEMS[stepIndex - 1].key);
}}
>
上一步
</Button>
@ -437,7 +427,7 @@ function FilingFormPage(props) {
{!isLastStep && (
<Button
type="primary"
onClick={() => {
onClick={async () => {
setActiveStep(STEP_ITEMS[stepIndex + 1].key);
}}
>
@ -447,7 +437,11 @@ function FilingFormPage(props) {
{!readOnly && isLastStep && (
<>
{mode !== FILING_FORM_MODE.FILED && (
<Button onClick={handleSaveDraft}>暂存</Button>
<Button
onClick={() => handleVerifyConfirm({ isSaveDraft: true })}
>
暂存
</Button>
)}
<Button type="primary" onClick={handleSubmitRequest}>
{mode === FILING_FORM_MODE.FILED ? "提交填报" : "提交申请"}

View File

@ -16,12 +16,16 @@ const { router } = tools;
const QualReview = (props) => {
const [form] = Form.useForm();
const { qualApplication, queryReviewList } = props;
const {qualReviewList, qualReviewTotal,qualReviewLoading}= qualApplication || {};
const { qualReview, queryReviewList } = props;
const {qualReviewList, qualReviewTotal,qualReviewLoading}= qualReview || {};
const handleSearch = () => {
queryReviewList(router.query);
queryReviewList({
...router.query,
supervision: true,
});
};
@ -48,7 +52,7 @@ const QualReview = (props) => {
fixed: "left",
render: (text, record, index) => index + 1,
},
{ title: "机构名称", dataIndex: "filingUnitName", width: 220, ellipsis: true },
{ title: "机构名称", dataIndex: "orgName", width: 220, ellipsis: true },
{ title: "机构类型", dataIndex: "filingUnitTypeName", width: 100 },
{ title: "证书编号", dataIndex: "filingNo", width: 140, ellipsis: true },
{ title: "安全评价业务范围", dataIndex: "businessScope", width: 180, ellipsis: true },
@ -63,10 +67,10 @@ const QualReview = (props) => {
},
{
title: "审核状态",
dataIndex: "reviewStatus",
dataIndex: "filingStatusCode",
width: 100,
render: (status) => {
const config = REVIEW_STATUS_MAP[pending];
render: (_, {filingStatusCode}) => {
const config = REVIEW_STATUS_MAP[filingStatusCode];
return config ? <Tag color={config.color}>{config.label}</Tag> : '--';
},
},
@ -134,16 +138,16 @@ const QualReview = (props) => {
<Select.Option value="no"></Select.Option>
</ControlWrapper.Select>
</Form.Item>,
<Form.Item key="reviewStatus" name="reviewStatus">
<Form.Item key="filingStatusCode" name="filingStatusCode">
<ControlWrapper.Select
label="审核状态"
placeholder="请选择"
allowClear
style={{ width: "100%" }}
>
<Select.Option value="pending">待审核</Select.Option>
<Select.Option value="reviewing">审核中</Select.Option>
<Select.Option value="rejected">打回</Select.Option>
<Select.Option value="2">审核中</Select.Option>
<Select.Option value="3">打回</Select.Option>
</ControlWrapper.Select>
</Form.Item>,
]}