paper
parent
c0a0261561
commit
6bfb3c9fd0
|
|
@ -360,6 +360,11 @@ export const evalReportSubmit = declareRequest(
|
|||
"Post > @/safetyEval/institution/eval-report/submit",
|
||||
);
|
||||
|
||||
export const evalReportCompletePreparation = declareRequest(
|
||||
"evalReportCompletePreparationLoading",
|
||||
"Post > @/safetyEval/institution/eval-report/preparation/complete",
|
||||
);
|
||||
|
||||
/**
|
||||
* 机构端报告库-批量报送监管端
|
||||
*
|
||||
|
|
|
|||
|
|
@ -25,7 +25,8 @@ const { router } = tools;
|
|||
|
||||
const App = (props) => {
|
||||
const { onCancel, safetyEvalBusiness, readOnly } = props;
|
||||
const { createDocLoading } = safetyEvalBusiness;
|
||||
const { createDocLoading, evalReportCompletePreparationLoading } =
|
||||
safetyEvalBusiness;
|
||||
const [expandedMap, setExpandedMap] = useState({});
|
||||
const [fileId, setFileId] = useState(props.fileId);
|
||||
const [templateMap, setTemplateMap] = useState([]);
|
||||
|
|
@ -51,12 +52,18 @@ const App = (props) => {
|
|||
}
|
||||
|
||||
await sdkRef.current.save();
|
||||
message.success("保存成功");
|
||||
// 完成报告编制:将 REPORT_PREPARATION 节点置为已完成,提交内审
|
||||
const res = await props.evalReportCompletePreparation({
|
||||
data: { projectId: router.query.id },
|
||||
});
|
||||
if (res?.success !== false) {
|
||||
message.success("报告编制已完成,已提交内审");
|
||||
}
|
||||
};
|
||||
|
||||
const beforeUploadWord = (file) => {
|
||||
if (!/\.(docx?)$/i.test(file.name)) {
|
||||
message.error("仅支持上传 Word 文件(.doc / .docx)");
|
||||
if (!/\.(docx?|pdf)$/i.test(file.name)) {
|
||||
message.error("仅支持上传 Word / PDF 文件(.doc / .docx / .pdf)");
|
||||
return Upload.LIST_IGNORE;
|
||||
}
|
||||
setUploading(true);
|
||||
|
|
@ -190,15 +197,22 @@ const App = (props) => {
|
|||
<Flex gap={12}>
|
||||
{!readOnly && (
|
||||
<Upload
|
||||
accept=".doc,.docx"
|
||||
accept=".doc,.docx,.pdf"
|
||||
showUploadList={false}
|
||||
beforeUpload={beforeUploadWord}
|
||||
disabled={uploading}
|
||||
>
|
||||
<Button loading={uploading}>上传Word文件</Button>
|
||||
<Button loading={uploading}>上传已编制报告</Button>
|
||||
</Upload>
|
||||
)}
|
||||
{!readOnly && <Button onClick={handleSave}>保存</Button>}
|
||||
{!readOnly && (
|
||||
<Button
|
||||
loading={evalReportCompletePreparationLoading}
|
||||
onClick={handleSave}
|
||||
>
|
||||
完成报告编制提交内审
|
||||
</Button>
|
||||
)}
|
||||
<Button onClick={handleDownload}>下载报告</Button>
|
||||
|
||||
</Flex>
|
||||
|
|
|
|||
Loading…
Reference in New Issue