feat
parent
d1e73094b0
commit
744093c82f
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import { Form, Button, Flex, Typography, Steps, Tag, Card, Table, message, Popover, Image } from "antd";
|
import { Form, Button, Flex, Typography, Steps, Tag, Card, Table, message, Popover, Image, Checkbox } from "antd";
|
||||||
import { CheckCircleFilled, DownloadOutlined } from "@ant-design/icons";
|
import { CheckCircleFilled, DownloadOutlined } from "@ant-design/icons";
|
||||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
import { NS_SAFETY_EVAL_BUSINESS } from "~/enumerate/namespace";
|
import { NS_SAFETY_EVAL_BUSINESS } from "~/enumerate/namespace";
|
||||||
|
|
@ -153,6 +153,9 @@ const RectificationNoticePanel = ({ readOnly }) => (
|
||||||
<Typography.Paragraph type="secondary" style={{ margin: 0 }}>本节点不在线编制整改通知,只归档机构已出具的《整改通知单》文件;上传成功即完成,后续可替换修改。</Typography.Paragraph>
|
<Typography.Paragraph type="secondary" style={{ margin: 0 }}>本节点不在线编制整改通知,只归档机构已出具的《整改通知单》文件;上传成功即完成,后续可替换修改。</Typography.Paragraph>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<Form.Item name="majorHazardCheckbox" valuePropName="checked" style={{ marginBottom: 16 }}>
|
||||||
|
<Checkbox disabled={readOnly}>是否存在重大隐患</Checkbox>
|
||||||
|
</Form.Item>
|
||||||
<AttachmentUpload
|
<AttachmentUpload
|
||||||
name="RECTIFICATION_NOTICE"
|
name="RECTIFICATION_NOTICE"
|
||||||
label="整改通知单"
|
label="整改通知单"
|
||||||
|
|
@ -235,6 +238,9 @@ const SurveyContent = ({ readOnly, ...props }) => {
|
||||||
STAGES.forEach((s) => {
|
STAGES.forEach((s) => {
|
||||||
values[s.key] = map[s.key] || [];
|
values[s.key] = map[s.key] || [];
|
||||||
});
|
});
|
||||||
|
// 回填整改通知单的 checkbox 字段
|
||||||
|
const rectItem = (res?.data || []).find((item) => item.attachTypeCode === "RECTIFICATION_NOTICE");
|
||||||
|
values.majorHazardCheckbox = rectItem?.checkbox === 1;
|
||||||
form.setFieldsValue(values);
|
form.setFieldsValue(values);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -302,10 +308,15 @@ const SurveyContent = ({ readOnly, ...props }) => {
|
||||||
}
|
}
|
||||||
for (const s of STAGES) {
|
for (const s of STAGES) {
|
||||||
const fileList = values[s.key] || [];
|
const fileList = values[s.key] || [];
|
||||||
|
const validFiles = fileList.filter((f) => f.status === "done" && f.url);
|
||||||
|
if (validFiles.length === 0) continue;
|
||||||
payload.push({
|
payload.push({
|
||||||
projectId,
|
projectId,
|
||||||
attachTypeCode: s.key,
|
attachTypeCode: s.key,
|
||||||
fileUrl: JSON.stringify(fileList),
|
fileUrl: JSON.stringify(fileList),
|
||||||
|
...(s.key === "RECTIFICATION_NOTICE"
|
||||||
|
? { checkbox: values.majorHazardCheckbox ? 1 : 0 }
|
||||||
|
: {}),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const res = await props.evalSurveySaveAttach(payload);
|
const res = await props.evalSurveySaveAttach(payload);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue