@@ -138,8 +127,8 @@ const InspectionPanel = ({ dataSource = [], evalProjectDetailData = {}, readOnly
{ title: "项目角色", dataIndex: "role", render: (v) => Array.isArray(v) ? v.map(item => ROLE_DEFINITIONS_MAP[item]).join('、') : v, ellipsis: true },
{ title: "人脸识别", dataIndex: "faceState", render: (v) =>
{v === 1 ? "通过" : "未通过"} },
{ title: "GPS定位", dataIndex: "gpsState", render: (v) =>
{v === 1 ? "正常" : "异常"} },
- { title: "签到时间", dataIndex: "singInTime" , render: (time, record)=>{return renderTimeWithFace(time, record, 0);}},
- { title: "签退时间", dataIndex: "signOutTime" , render: (time, record)=>{return renderTimeWithFace(time, record, 1);}},
+ { title: "签到时间", dataIndex: "singInTime", render: (time, record) => { return renderTimeWithFace(time, record, 0); } },
+ { title: "签退时间", dataIndex: "signOutTime", render: (time, record) => { return renderTimeWithFace(time, record, 1); } },
{ title: "在场时长", render: (_, r) => calcDuration(r.singInTime, r.signOutTime) },
{
title: "现场照片", dataIndex: "sceneUrl", render: (v) => {
@@ -256,7 +245,7 @@ const SurveyContent = ({ readOnly, ...props }) => {
const [activeStage, setActiveStage] = useState("PRACTICE_NOTIFICATION");
const [attachMap, setAttachMap] = useState({});
const [surveyPersonnel, setSurveyPersonnel] = useState([]);
- const { evalSurveyListLoading, evalSurveySaveAttachLoading, evalProjectDetailData } = props.safetyEvalBusiness;
+ const { evalSurveySaveAttachLoading, evalProjectDetailData } = props.safetyEvalBusiness;
const projectId = router.query?.id;
const currentIdx = STAGES.findIndex((s) => s.key === activeStage);
const isFirst = currentIdx === 0;
@@ -295,6 +284,57 @@ const SurveyContent = ({ readOnly, ...props }) => {
}
};
+ const downloadTemplate = async () => {
+ const orgInfo = JSON.parse(sessionStorage.getItem('orgInfo'));
+ const industryText = String(evalProjectDetailData.industryCode || "")
+ .split(",")
+ .map((code) => QUALIFICATION_INDUSTRY_OPTIONS_MAP[code])
+ .join("、");
+ // 项目组成员(同项目组 tab 页数据):姓名/专业/工作任务
+ const memberRes = await props.evalProjectMemberPage({ projectId });
+ const members = (memberRes?.data || []).map((item) => ({
+ name: item.personnelName,
+ major: item.capacity || "",
+ task:
+ item.responsibility ||
+ (item.role || [])
+ .map((r) => ROLE_DEFINITIONS.find((d) => d.value === r)?.summary)
+ .filter(Boolean)
+ .join("、"),
+ isLeader: (item.role || []).includes("PROJECT_LEAD"),
+ }));
+ // 项目组组长取自项目组成员中的 PROJECT_LEAD,展示同 namesByRole:如"张三(化工)"
+ const projectLeader = members
+ .filter((m) => m.isLeader)
+ .map((m) => `${m.name}${m.major ? `(${m.major})` : ""}`)
+ .join("、");
+ const data = {
+ account: orgInfo.account,
+ qualificationCertNo: orgInfo.qualificationCertNo,
+ infoDisclosureUrl: orgInfo.infoDisclosureUrl,
+ businessAddress: orgInfo.businessAddress,
+ legalRepresentative: orgInfo.legalRepresentative,
+ contactName: orgInfo.contactName,
+ contactPhone: orgInfo.contactPhone,
+ projectName: evalProjectDetailData.projectName,
+ projectAddress: evalProjectDetailData.customerAddress || "",
+ industryText,
+ projectLeader,
+ members,
+ };
+ try {
+ await fillDocxTemplate(
+ 'https://gbs-cqaqpj.oss-cn-beijing.aliyuncs.com/jjb/6a913235e4b0b3767a78622d.docx',
+ data,
+ `安全评价检测检验机构从业告知书.docx`,
+ { download: true },
+ );
+ message.success("导出成功");
+ } catch {
+ message.error("导出失败,请重试");
+ }
+ };
+
useEffect(() => {
loadAttachments();
}, []);
@@ -388,14 +428,14 @@ const SurveyContent = ({ readOnly, ...props }) => {
);
return {
title: s.label,
- ...(uploaded ? { status: "finish" } : {status: "wait"}),
+ ...(uploaded ? { status: "finish" } : { status: "wait" }),
};
})}
/>