fix
parent
4ed3c0e6fe
commit
d78705dc15
|
|
@ -166,9 +166,12 @@ const EvalProjectMonitor = (props) => {
|
|||
{
|
||||
title: "行业",
|
||||
dataIndex: "industryCode",
|
||||
width: 140,
|
||||
width: 180,
|
||||
ellipsis: true,
|
||||
render: (code) => QUALIFICATION_INDUSTRY_OPTIONS_MAP[code] || code,
|
||||
render: (code) => {
|
||||
const arr = code ? code.split(",") : [];
|
||||
return arr.map((code) => QUALIFICATION_INDUSTRY_OPTIONS_MAP[code] || code).join("、") || "-";
|
||||
},
|
||||
},
|
||||
{ title: "负责人", dataIndex: "leaderName", width: 90 },
|
||||
{ title: "计划完成", dataIndex: "planEndDate", width: 120 },
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import React, { useState, useEffect } from "react";
|
||||
import { Form, Button, Flex, Typography, Steps, Tag, Card, Table, message, Popover, Image, Checkbox } from "antd";
|
||||
import { CheckCircleFilled, DownloadOutlined, QuestionOutlined, PictureOutlined } from "@ant-design/icons";
|
||||
import { DownloadOutlined, QuestionOutlined, PictureOutlined } from "@ant-design/icons";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { NS_SAFETY_EVAL_BUSINESS } from "~/enumerate/namespace";
|
||||
import { tools } from "@cqsjjb/jjb-common-lib";
|
||||
|
|
@ -20,6 +20,22 @@ const STAGES = [
|
|||
{ key: "RECTIFICATION_REVIEW", index: "05", label: "整改复查" },
|
||||
];
|
||||
|
||||
/** 各步骤附件必传校验:至少一个文件上传完成;有文件上传中时提示稍后 */
|
||||
const attachRequiredRules = (label) => [
|
||||
{
|
||||
required: true,
|
||||
validator: (_, value) => {
|
||||
const fileList = value || [];
|
||||
if (fileList.some((f) => f.status === "uploading")) {
|
||||
return Promise.reject(new Error("文件上传中,请稍后再操作"));
|
||||
}
|
||||
return fileList.some((f) => f.status === "done" && f.url)
|
||||
? Promise.resolve()
|
||||
: Promise.reject(new Error(`请上传${label}`));
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const downloadTemplate = async () => {
|
||||
try {
|
||||
const res = await fetch("https://test-dragon-yf-pub.oss-cn-hangzhou.aliyuncs.com/jjb/6a6bff3ee4b021a75404adfb.docx");
|
||||
|
|
@ -68,6 +84,7 @@ const NoticePanel = ({ readOnly }) => (
|
|||
maxCount={1}
|
||||
accept=".docx,.pdf"
|
||||
disabled={readOnly}
|
||||
rules={attachRequiredRules("从业告知书")}
|
||||
extra="仅支持上传 Word、PDF 格式文件"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -160,6 +177,7 @@ const InspectionPanel = ({ dataSource = [], evalProjectDetailData = {}, readOnly
|
|||
maxCount={10}
|
||||
accept=".pdf,.doc,.docx,.xls,.xlsx,.png,.jpg,.jpeg"
|
||||
disabled={readOnly}
|
||||
rules={attachRequiredRules("现场检查表")}
|
||||
extra="检查表应包含项目名称、检查日期、检查人员、检查依据、逐项检查结果和不符合项记录;上传后与人员打卡记录共同作为现场踏勘凭证。
|
||||
支持 PDF、Word、Excel、PNG、JPG 格式,最多上传 10 个文件"
|
||||
/>
|
||||
|
|
@ -185,6 +203,7 @@ const RectificationNoticePanel = ({ readOnly }) => (
|
|||
maxCount={10}
|
||||
accept=".pdf,.doc,.docx,.xls,.xlsx,.png,.jpg,.jpeg"
|
||||
disabled={readOnly}
|
||||
rules={attachRequiredRules("整改通知单")}
|
||||
extra="支持 PDF、Word、Excel、PNG、JPG 格式,最多上传 10 个文件"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -205,6 +224,7 @@ const EnterpriseRectificationPanel = ({ readOnly }) => (
|
|||
maxCount={10}
|
||||
accept=".pdf,.doc,.docx,.xls,.xlsx,.png,.jpg,.jpeg"
|
||||
disabled={readOnly}
|
||||
rules={attachRequiredRules("企业整改报告")}
|
||||
extra="支持 PDF、Word、Excel、PNG、JPG 格式,最多上传 10 个文件"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -225,6 +245,7 @@ const RectificationReviewPanel = ({ readOnly }) => (
|
|||
maxCount={10}
|
||||
accept=".pdf,.doc,.docx,.xls,.xlsx,.png,.jpg,.jpeg"
|
||||
disabled={readOnly}
|
||||
rules={attachRequiredRules("整改情况复查单")}
|
||||
extra="支持 PDF、Word、Excel、PNG、JPG 格式,最多上传 10 个文件"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -240,6 +261,12 @@ const SurveyContent = ({ readOnly, ...props }) => {
|
|||
const currentIdx = STAGES.findIndex((s) => s.key === activeStage);
|
||||
const isFirst = currentIdx === 0;
|
||||
const isLast = currentIdx === STAGES.length - 1;
|
||||
/** 各步骤附件表单值(按 STAGES 顺序),用于 Steps 完成态判断;
|
||||
* 注意:useWatch 传数组会被解析为嵌套字段路径,多字段需用函数选择器(入参为表单 values) */
|
||||
const stepFiles = Form.useWatch(
|
||||
(values) => STAGES.map((s) => values?.[s.key]),
|
||||
form,
|
||||
);
|
||||
|
||||
const loadAttachments = async () => {
|
||||
if (!projectId) return;
|
||||
|
|
@ -355,10 +382,16 @@ const SurveyContent = ({ readOnly, ...props }) => {
|
|||
current={currentIdx}
|
||||
onChange={(idx) => setActiveStage(STAGES[idx].key)}
|
||||
style={{ marginBottom: 16 }}
|
||||
items={STAGES.map((s) => ({
|
||||
items={STAGES.map((s, idx) => {
|
||||
const uploaded = (stepFiles?.[idx] || []).some(
|
||||
(f) => f.status === "done" && f.url,
|
||||
);
|
||||
console.log(stepFiles)
|
||||
return {
|
||||
title: s.label,
|
||||
...(readOnly ? { status: "finish" } : {}),
|
||||
}))}
|
||||
...(uploaded ? { status: "finish" } : {}),
|
||||
};
|
||||
})}
|
||||
/>
|
||||
|
||||
<Form form={form} layout="vertical" disabled={readOnly} scrollToFirstError>
|
||||
|
|
|
|||
Loading…
Reference in New Issue