import React, { useEffect, useState } from "react"; import { Tag, Button, Card, Form, Input, InputNumber, Select, DatePicker, Row, Col, Flex, message, Spin, } from "antd"; import dayjs from "dayjs"; import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { NS_SAFETY_EVAL_BUSINESS } from "~/enumerate/namespace"; import { district } from "~/enumerate/constant"; import { phoneRule } from "~/utils/validators"; import { tools } from "@cqsjjb/jjb-common-lib"; import AttachmentUpload from "~/components/AttachmentUpload"; const { router } = tools; const { TextArea } = Input; const PROJECT_TYPE_OPTIONS = [ { label: "新建项目", value: "NEW" }, { label: "续评项目", value: "RENEW" }, { label: "变更项目", value: "CHANGE" }, ]; const EVAL_TYPE_OPTIONS = [ { label: "安全预评价", value: "PRE" }, { label: "安全验收评价", value: "ACCEPT" }, { label: "安全现状评价", value: "STATUS" }, ]; const YES_NO_OPTIONS = [ { label: "是", value: 1 }, { label: "否", value: 2 }, ]; const ContractContent = (props) => { const [form] = Form.useForm(); const projectId = router.query?.id; const { safetyEvalBusiness, evalContractGet, evalContractSave, customerDetail, } = props; const { contractLoading, contractSaveLoading, evalProjectDetailData } = safetyEvalBusiness || {}; const fetchData = async () => { if (!projectId) return; const res = await evalContractGet({ projectId }); if (res?.success !== false && res?.data) { form.setFieldsValue({ ...res.data, scanFileUrl: res.data.scanFileUrl? JSON.parse(res.data.scanFileUrl) :undefined, contractStartDate: res.data.contractStartDate ? dayjs(res.data.contractStartDate) : undefined, contractEndDate: res.data.contractEndDate ? dayjs(res.data.contractEndDate) : undefined, }); } else { const orgInfo = JSON.parse(sessionStorage.getItem("orgInfo")); form.setFieldsValue({ orgName: orgInfo?.unitName, projectName: evalProjectDetailData?.projectName, evalTypeCode: evalProjectDetailData?.evalTypeCode, projectRegion: evalProjectDetailData?.districtCode, }); const customerRes = await customerDetail({ id: evalProjectDetailData.customerId, }); if (customerRes?.success && customerRes?.data) { form.setFieldsValue({ enterpriseName: customerRes.data.customerName, officeAddress: customerRes.data.businessAddress, creditCode: customerRes.data.creditCode, legalPerson: customerRes.data.legalRepresentative, contactName: customerRes.data.principalName, contactPhone: customerRes.data.principalPhone, }); } } }; useEffect(() => { if (evalProjectDetailData?.id) { fetchData(); } }, [projectId, evalProjectDetailData?.id]); const handleSave = async () => { try { const values = await form.validateFields(); const { contractStartDate, contractEndDate, ...rest } = values; const res = await evalContractSave({ ...rest, projectId, contractStartDate: contractStartDate ? contractStartDate.format("YYYY-MM-DD") : undefined, contractEndDate: contractEndDate ? contractEndDate.format("YYYY-MM-DD") : undefined, scanFileUrl: rest.scanFileUrl? JSON.stringify(rest.scanFileUrl) :undefined, }); if (res?.success !== false) { message.success("合同保存成功"); props.getDetail(); } } finally { } }; return (
机构管理员 / 项目负责人 按照已批准的风险分析结论录入项目合同和被评价企业信息,上传PDF格式的正式合同扫描件。
合同基本信息} className="pf-section" >