From d1ca41a53091fa16e60942536f6a2684235d99a3 Mon Sep 17 00:00:00 2001 From: tangjie <122778500@qq.com> Date: Wed, 22 Jul 2026 09:49:21 +0800 Subject: [PATCH] feat --- src/api/safetyEvalBusiness/index.js | 15 + src/components/AttachmentUpload/index.js | 3 +- src/enumerate/constant/index.js | 20 +- src/pages/Container/Layout/menuConfig.js | 5 + .../CustomerManage/index.js | 159 ++++---- .../EvalProject/List/index.js | 26 +- .../EvalProject/ProjectDocLibrary/index.js | 347 ++++++++++++++++++ 7 files changed, 498 insertions(+), 77 deletions(-) create mode 100644 src/pages/Container/SafetyEvalBusiness/EvalProject/ProjectDocLibrary/index.js diff --git a/src/api/safetyEvalBusiness/index.js b/src/api/safetyEvalBusiness/index.js index 8b69ffa..0132085 100644 --- a/src/api/safetyEvalBusiness/index.js +++ b/src/api/safetyEvalBusiness/index.js @@ -62,4 +62,19 @@ export const evalProjectSave = declareRequest( export const evalProjectDetail = declareRequest( "evalProjectDetailLoading", "Get > /safetyEval/institution/eval-project/get", +); + +export const evalProjectDelete = declareRequest( + "evalProjectDeleteLoading", + "Post > @/safetyEval/institution/eval-project/delete", +); + +export const evalProjectDocPage = declareRequest( + "evalProjectDocLoading", + "Get > /safetyEval/institution/eval-project-doc/page", +); + +export const evalProjectDocSave = declareRequest( + "evalProjectDocSaveLoading", + "Post > @/safetyEval/institution/eval-project-doc/save", ); \ No newline at end of file diff --git a/src/components/AttachmentUpload/index.js b/src/components/AttachmentUpload/index.js index 16f6684..729fe00 100644 --- a/src/components/AttachmentUpload/index.js +++ b/src/components/AttachmentUpload/index.js @@ -4,7 +4,7 @@ import { PlusOutlined } from "@ant-design/icons"; const isImage = (url) => /\.(png|jpe?g|gif|bmp|webp|svg)(\?.*)?$/i.test(url || ""); -export default function AttachmentUpload({ name, label, disabled = false, maxCount, accept, extra }) { +export default function AttachmentUpload({ name, label, disabled = false, maxCount, accept, extra ,rules }) { const [previewImage, setPreviewImage] = useState(""); return ( @@ -14,6 +14,7 @@ export default function AttachmentUpload({ name, label, disabled = false, maxCou label={label} extra={extra} valuePropName="fileList" + rules={rules} getValueProps={(value) => { if (Array.isArray(value)) { return { fileList: value }; diff --git a/src/enumerate/constant/index.js b/src/enumerate/constant/index.js index 9757976..9c9fb4f 100644 --- a/src/enumerate/constant/index.js +++ b/src/enumerate/constant/index.js @@ -307,10 +307,28 @@ export const EVAL_TYPE_OPTIONS = [ { label: "安全现状评价", value: "STATUS" }, ]; +export const EVAL_TYPE_MAP = EVAL_TYPE_OPTIONS.reduce((acc, cur) => { + acc[cur.value] = cur.label; + return acc; +}, {}); + /** 登记半径选项 */ export const CHECKIN_RADIUS_OPTIONS = [ { label: "100 米", value: 100 }, { label: "200 米", value: 200 }, { label: "300 米", value: 300 }, { label: "500 米", value: 500 }, -]; \ No newline at end of file +]; + +/** 项目规则 — 资料类别枚举 */ +export const MATERIAL_TYPE_OPTIONS = [ + { label: "现场踏勘资料", value: "SITE_SURVEY" }, + { label: "报告资料", value: "REPORT" }, + { label: "整改资料", value: "RECTIFICATION" }, + { label: "其他项目资料", value: "OTHER" }, +]; + +export const MATERIAL_TYPE_MAP = MATERIAL_TYPE_OPTIONS.reduce((acc, cur) => { + acc[cur.value] = cur.label; + return acc; +}, {}); \ No newline at end of file diff --git a/src/pages/Container/Layout/menuConfig.js b/src/pages/Container/Layout/menuConfig.js index 3fd1035..ffcc75a 100644 --- a/src/pages/Container/Layout/menuConfig.js +++ b/src/pages/Container/Layout/menuConfig.js @@ -211,6 +211,11 @@ const menuItems = [ label: "安评项目管理", icon: , }, + { + key: "/safetyEval/container/SafetyEvalBusiness/EvalProject/ProjectDocLibrary", + label: "项目资料管理", + icon: , + }, { key: "/safetyEval/container/SafetyEvalBusiness/CustomerManage", label: "安评客户管理", diff --git a/src/pages/Container/SafetyEvalBusiness/CustomerManage/index.js b/src/pages/Container/SafetyEvalBusiness/CustomerManage/index.js index ba92b40..944552a 100644 --- a/src/pages/Container/SafetyEvalBusiness/CustomerManage/index.js +++ b/src/pages/Container/SafetyEvalBusiness/CustomerManage/index.js @@ -13,10 +13,7 @@ import { Flex, Space, } from "antd"; -import { - PlusOutlined, - -} from "@ant-design/icons"; +import { PlusOutlined } from "@ant-design/icons"; import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout"; import SearchForm from "@cqsjjb/jjb-react-admin-component/SearchForm"; import ControlWrapper from "@cqsjjb/jjb-react-admin-component/ControlWrapper"; @@ -29,6 +26,7 @@ import { district, ENTERPRISE_STATUS_OPTIONS, ENTERPRISE_SCALE_OPTIONS, + EVAL_TYPE_MAP, } from "~/enumerate/constant"; import { QUALIFICATION_INDUSTRY_OPTIONS } from "~/enumerate/enterpriseOptions"; import { phoneRule, creditCodeRule } from "~/utils/validators"; @@ -45,25 +43,30 @@ const CustomerManage = (props) => { const [detailOpen, setDetailOpen] = useState(false); const [currentDetail, setCurrentDetail] = useState(null); const [editingId, setEditingId] = useState(null); - const {customerLoading, customerModifyLoading, customerSaveLoading}= props.safetyEvalBusiness; + const { customerLoading, customerModifyLoading, customerSaveLoading } = + props.safetyEvalBusiness; const getData = async (pagination) => { - const params = { - ...router.query, - current: pagination?.current || router.query.current || 1, - size: pagination?.size || router.query.size || 10, - }; - const res = await props.customerPage(params); - if (res?.success !== false) { - setDataSource(res?.data || []); - setTotal(res?.total || 0); - } + const params = { + ...router.query, + current: pagination?.current || router.query.current || 1, + size: pagination?.size || router.query.size || 10, + }; + const res = await props.customerPage(params); + if (res?.success !== false) { + setDataSource(res?.data || []); + setTotal(res?.total || 0); + } }; const handleMapConfirm = (location) => { const { lng, lat, address } = location; - - modalForm.setFieldsValue({ longitude: lng, latitude: lat, businessAddress: address }); + + modalForm.setFieldsValue({ + longitude: lng, + latitude: lat, + businessAddress: address, + }); setMapPickerVisible(false); }; @@ -100,21 +103,21 @@ const CustomerManage = (props) => { }; const handleOpenEdit = async (record) => { - const res = await props.customerDetail({ id: record.id }); - if (res?.success !== false) { - setEditingId(record.id); - setCurrentDetail(res?.data || {}); - modalForm.setFieldsValue(res?.data || {}); - setModalOpen(true); - } + const res = await props.customerDetail({ id: record.id }); + if (res?.success !== false) { + setEditingId(record.id); + setCurrentDetail(res?.data || {}); + modalForm.setFieldsValue(res?.data || {}); + setModalOpen(true); + } }; const handleViewDetail = async (record) => { - const res = await props.customerDetail({ id: record.id }); - if (res?.success !== false) { - setCurrentDetail(res?.data || {}); - setDetailOpen(true); - } + const res = await props.customerDetail({ id: record.id }); + if (res?.success !== false) { + setCurrentDetail(res?.data || {}); + setDetailOpen(true); + } }; const handleDelete = async (record) => { @@ -122,29 +125,34 @@ const CustomerManage = (props) => { title: "确认删除", content: "确定要删除这个客户吗?", onOk: async () => { - await props.customerDelete({ data: record.id }); - message.success("删除成功"); - getData(); + await props.customerDelete({ data: record.id }); + message.success("删除成功"); + getData(); }, }); }; const handleCreateSubmit = () => { modalForm.validateFields().then(async (values) => { - if (editingId) { - await props.customerModify({ ...values, id: editingId }); - } else { - await props.customerSave(values); - } - message.success(editingId ? "修改成功" : "创建成功"); - setModalOpen(false); - getData(); + if (editingId) { + await props.customerModify({ ...values, id: editingId }); + } else { + await props.customerSave(values); + } + message.success(editingId ? "修改成功" : "创建成功"); + setModalOpen(false); + getData(); }); }; const columns = [ { title: "序号", width: 60, render: (_, __, index) => index + 1 }, - { title: "客户名称", dataIndex: "customerName", ellipsis: true, width: 220 }, + { + title: "客户名称", + dataIndex: "customerName", + ellipsis: true, + width: 220, + }, { title: "统一社会信用代码", dataIndex: "creditCode", width: 220 }, { title: "客户联系人", dataIndex: "principalName", width: 150 }, { title: "联系人电话", dataIndex: "principalPhone", width: 160 }, @@ -183,7 +191,7 @@ const CustomerManage = (props) => {