fix
parent
c3a5f1f75f
commit
bb6f4595d8
|
|
@ -12,9 +12,9 @@ module.exports = {
|
|||
// 可通过环境变量覆盖: SAFETY_EVAL_API_HOST=http://192.168.x.x:8095
|
||||
//API_HOST: "http://localhost:80",
|
||||
|
||||
API_HOST: "http://192.168.0.134",
|
||||
// API_HOST: "http://192.168.0.134",
|
||||
// API_HOST: "http://192.168.0.150", //太浅
|
||||
// API_HOST: "https://gbs-gateway.qhdsafety.com",
|
||||
API_HOST: "https://gbs-gateway.qhdsafety.com",
|
||||
//API_HOST: "http://192.168.0.103", //huwei
|
||||
},
|
||||
production: {
|
||||
|
|
|
|||
|
|
@ -28,6 +28,9 @@ import { NS_SAFETY_EVAL_BUSINESS } from "~/enumerate/namespace";
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { tools } from "@cqsjjb/jjb-common-lib";
|
||||
import dayjs from "dayjs";
|
||||
import {EVAL_TYPE_OPTIONS} from '~/enumerate/constant';
|
||||
import {QUALIFICATION_INDUSTRY_OPTIONS} from '~/enumerate/enterpriseOptions';
|
||||
|
||||
import "./index.less";
|
||||
|
||||
/**
|
||||
|
|
@ -44,23 +47,7 @@ const { TextArea } = Input;
|
|||
|
||||
const UPLOAD_ACTION = `${window.process?.env?.app?.API_HOST || ""}/safetyEval/file/upload`;
|
||||
|
||||
/** 评价类型(对齐原型文案;编码对齐 OpenAPI PRE/ACCEPT/STATUS) */
|
||||
const REPORT_EVAL_TYPE_OPTIONS = [
|
||||
{ label: "安全预评价", value: "PRE" },
|
||||
{ label: "安全验收评价", value: "ACCEPT" },
|
||||
{ label: "安全现状评价", value: "STATUS" },
|
||||
];
|
||||
|
||||
/** 所属行业(原型选项;编码仅 OpenAPI 示例给出 HAZCHEM,其余按命名约定) */
|
||||
const REPORT_INDUSTRY_OPTIONS = [
|
||||
{ label: "危险化学品", value: "HAZCHEM" },
|
||||
{ label: "金属非金属矿山", value: "METAL_NONMETAL_MINE" },
|
||||
{ label: "金属冶炼", value: "METAL_SMELTING" },
|
||||
{ label: "烟花爆竹", value: "FIREWORKS" },
|
||||
{ label: "城镇燃气", value: "URBAN_GAS" },
|
||||
{ label: "工贸", value: "INDUSTRY_TRADE" },
|
||||
{ label: "其他", value: "OTHER" },
|
||||
];
|
||||
|
||||
/** 保密属性(OpenAPI 仅示例 NORMAL) */
|
||||
const SECRET_LEVEL_OPTIONS = [
|
||||
|
|
@ -231,7 +218,7 @@ const EvalReportLibrary = (props) => {
|
|||
uploadForm.setFieldsValue({
|
||||
reportYear: dayjs().year(),
|
||||
evalTypeCode: "PRE",
|
||||
industryCode: "HAZCHEM",
|
||||
|
||||
secretLevelCode: "NORMAL",
|
||||
issueDate: dayjs(),
|
||||
submitToRegulator: 0,
|
||||
|
|
@ -311,12 +298,12 @@ const EvalReportLibrary = (props) => {
|
|||
reportYear: values.reportYear,
|
||||
evalTypeCode: values.evalTypeCode,
|
||||
evalTypeName: getOptionLabel(
|
||||
REPORT_EVAL_TYPE_OPTIONS,
|
||||
EVAL_TYPE_OPTIONS,
|
||||
values.evalTypeCode,
|
||||
),
|
||||
industryCode: values.industryCode,
|
||||
industryName: getOptionLabel(
|
||||
REPORT_INDUSTRY_OPTIONS,
|
||||
QUALIFICATION_INDUSTRY_OPTIONS,
|
||||
values.industryCode,
|
||||
),
|
||||
evaluatedUnitName: values.evaluatedUnitName?.trim(),
|
||||
|
|
@ -609,14 +596,14 @@ const EvalReportLibrary = (props) => {
|
|||
dataIndex: "evalTypeName",
|
||||
width: 120,
|
||||
render: (val, record) =>
|
||||
val || getOptionLabel(REPORT_EVAL_TYPE_OPTIONS, record.evalTypeCode),
|
||||
val || getOptionLabel(EVAL_TYPE_OPTIONS, record.evalTypeCode),
|
||||
},
|
||||
{
|
||||
title: "所属行业",
|
||||
dataIndex: "industryName",
|
||||
width: 120,
|
||||
render: (val, record) =>
|
||||
val || getOptionLabel(REPORT_INDUSTRY_OPTIONS, record.industryCode),
|
||||
val || getOptionLabel(QUALIFICATION_INDUSTRY_OPTIONS, record.industryCode),
|
||||
},
|
||||
{
|
||||
title: "被评价单位",
|
||||
|
|
@ -838,7 +825,7 @@ const EvalReportLibrary = (props) => {
|
|||
label="评价类型"
|
||||
placeholder="全部"
|
||||
allowClear
|
||||
options={REPORT_EVAL_TYPE_OPTIONS}
|
||||
options={EVAL_TYPE_OPTIONS}
|
||||
/>
|
||||
</Form.Item>,
|
||||
<Form.Item key="industryCode" name="industryCode">
|
||||
|
|
@ -846,7 +833,7 @@ const EvalReportLibrary = (props) => {
|
|||
label="所属行业"
|
||||
placeholder="全部"
|
||||
allowClear
|
||||
options={REPORT_INDUSTRY_OPTIONS}
|
||||
options={QUALIFICATION_INDUSTRY_OPTIONS}
|
||||
/>
|
||||
</Form.Item>,
|
||||
<Form.Item key="displayStatus" name="displayStatus">
|
||||
|
|
@ -1006,12 +993,12 @@ const EvalReportLibrary = (props) => {
|
|||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="evalTypeCode" label="评价类型">
|
||||
<Select options={REPORT_EVAL_TYPE_OPTIONS} />
|
||||
<Select options={EVAL_TYPE_OPTIONS} />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="industryCode" label="所属行业">
|
||||
<Select options={REPORT_INDUSTRY_OPTIONS} />
|
||||
<Select options={QUALIFICATION_INDUSTRY_OPTIONS} placeholder="请选择所属行业" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
|
|
@ -1199,7 +1186,7 @@ const EvalReportLibrary = (props) => {
|
|||
<span>
|
||||
{detailData.evalTypeName ||
|
||||
getOptionLabel(
|
||||
REPORT_EVAL_TYPE_OPTIONS,
|
||||
EVAL_TYPE_OPTIONS,
|
||||
detailData.evalTypeCode,
|
||||
)}
|
||||
</span>
|
||||
|
|
@ -1211,7 +1198,7 @@ const EvalReportLibrary = (props) => {
|
|||
<span>
|
||||
{detailData.industryName ||
|
||||
getOptionLabel(
|
||||
REPORT_INDUSTRY_OPTIONS,
|
||||
QUALIFICATION_INDUSTRY_OPTIONS,
|
||||
detailData.industryCode,
|
||||
)}
|
||||
</span>
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
|||
import { tools } from "@cqsjjb/jjb-common-lib";
|
||||
import { renderDocxBlob, fillDocxTemplate } from "~/utils/fillDocxTemplate";
|
||||
import SpotCheckDetailModal from "./components/SpotCheckDetailModal";
|
||||
import PreviewUrlButton from "~/components/PreviewUrlButton";
|
||||
import dayjs from "dayjs";
|
||||
import "./index.less";
|
||||
|
||||
|
|
@ -487,19 +488,6 @@ const EvalReportDatabase = (props) => {
|
|||
getData(pagination);
|
||||
};
|
||||
|
||||
/** 下载指定 URL 的文件 */
|
||||
const handleFileDownload = (fileUrl, fileName) => {
|
||||
if (!fileUrl) {
|
||||
message.warning("文件地址不存在");
|
||||
return;
|
||||
}
|
||||
const hide = message.loading("正在下载...", 0);
|
||||
downloadFileByUrl(fileUrl, fileName)
|
||||
.then(() => message.success("下载已开始"))
|
||||
.catch(() => message.error("下载失败,请稍后重试"))
|
||||
.finally(() => hide());
|
||||
};
|
||||
|
||||
const handleViewDetail = async (record) => {
|
||||
setDetailData(null);
|
||||
setDetailVisible(true);
|
||||
|
|
@ -955,7 +943,7 @@ const EvalReportDatabase = (props) => {
|
|||
open={detailVisible}
|
||||
onCancel={() => setDetailVisible(false)}
|
||||
width={980}
|
||||
destroyOnClose
|
||||
destroyOnHide
|
||||
className="redb-modal"
|
||||
footer={
|
||||
<Space>
|
||||
|
|
@ -1026,21 +1014,13 @@ const EvalReportDatabase = (props) => {
|
|||
headers={["文件名称", "文件类型", "版本"]}
|
||||
rows={[
|
||||
[
|
||||
<span
|
||||
style={{ color: "#1677ff", cursor: "pointer" }}
|
||||
onClick={() =>
|
||||
handleFileDownload(
|
||||
detailData.fileUrl,
|
||||
detailData.fileName ||
|
||||
detailData.reportName ||
|
||||
"正式安全评价报告.pdf",
|
||||
)
|
||||
}
|
||||
<PreviewUrlButton
|
||||
url={detailData.fileUrl}
|
||||
>
|
||||
{detailData.fileName ||
|
||||
detailData.reportName ||
|
||||
"正式安全评价报告.pdf"}
|
||||
</span>,
|
||||
</PreviewUrlButton>,
|
||||
getFileExtLabel(detailData.fileName),
|
||||
"V1.0",
|
||||
],
|
||||
|
|
@ -1051,15 +1031,9 @@ const EvalReportDatabase = (props) => {
|
|||
<ProtoTable
|
||||
headers={["文件名称", "文件类型"]}
|
||||
rows={parseFileList(detailData.contractFileUrls).map((f) => [
|
||||
<span
|
||||
key={f.url}
|
||||
style={{ color: "#1677ff", cursor: "pointer" }}
|
||||
onClick={() =>
|
||||
handleFileDownload(f.url, f.name || "未命名文件")
|
||||
}
|
||||
>
|
||||
<PreviewUrlButton key={f.url} url={f.url}>
|
||||
{f.name || "未命名文件"}
|
||||
</span>,
|
||||
</PreviewUrlButton>,
|
||||
getFileExtLabel(f.name || f.url),
|
||||
])}
|
||||
/>
|
||||
|
|
@ -1068,15 +1042,9 @@ const EvalReportDatabase = (props) => {
|
|||
<ProtoTable
|
||||
headers={["文件名称", "文件类型"]}
|
||||
rows={parseFileList(detailData.processDocUrls).map((f) => [
|
||||
<span
|
||||
key={f.url}
|
||||
style={{ color: "#1677ff", cursor: "pointer" }}
|
||||
onClick={() =>
|
||||
handleFileDownload(f.url, f.name || "未命名文件")
|
||||
}
|
||||
>
|
||||
<PreviewUrlButton key={f.url} url={f.url}>
|
||||
{f.name || "未命名文件"}
|
||||
</span>,
|
||||
</PreviewUrlButton>,
|
||||
getFileExtLabel(f.name || f.url),
|
||||
])}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue