+ {selectedRows.length === 0 && (
+
+ 请从左侧勾选人员
+
+ )}
+ {selectedRows.map((item) => (
+
+
+
{item.userName}
+
+
+
}
+ onClick={() => handleRemoveSelected(item)}
+ />
+
+ ))}
+
+
+
+
+ );
+};
+
+export default Connect(
+ [NS_STAFF_INFO, NS_ORG_DEPARTMENT],
+ true,
+)(StaffPickerModal);
\ No newline at end of file
diff --git a/src/pages/Container/SafetyEvalBusiness/EvalProject/Create/index.js b/src/pages/Container/SafetyEvalBusiness/EvalProject/Create/index.js
new file mode 100644
index 0000000..c8c23c9
--- /dev/null
+++ b/src/pages/Container/SafetyEvalBusiness/EvalProject/Create/index.js
@@ -0,0 +1,340 @@
+import React, { useState, useEffect } from "react";
+import {
+ Form,
+ Button,
+ Input,
+ Select,
+ Row,
+ Col,
+ Card,
+ message,
+ DatePicker,
+ Flex,
+ Tag,
+} from "antd";
+import dayjs from "dayjs";
+import {tools} from "@cqsjjb/jjb-common-lib";
+import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
+import { NS_SAFETY_EVAL_BUSINESS } from "~/enumerate/namespace";
+import { Connect } from "@cqsjjb/jjb-dva-runtime";
+import BaiduMapPicker from "~/components/BaiduMapPicker";
+import { district } from "~/enumerate/constant";
+import { phoneRule } from "~/utils/validators";
+import StaffPickerModal from "./StaffPickerModal";
+
+import {
+ EVAL_TYPE_OPTIONS,
+ CHECKIN_RADIUS_OPTIONS,
+} from "~/enumerate/constant";
+
+const { router } = tools;
+
+const EvalProjectCreate = (props) => {
+ const [form] = Form.useForm();
+ const [mapPickerVisible, setMapPickerVisible] = useState(false);
+ const [staffPickerVisible, setStaffPickerVisible] = useState(false);
+ const [selectedParticipants, setSelectedParticipants] = useState([]);
+ const [detailLoading, setDetailLoading] = useState(false);
+
+ const projectId = router.query?.id;
+ const isView = projectId;
+
+ const { evalProjectSaveLoading, evalProjectDetailLoading, customerPage: customerList } = props.safetyEvalBusiness;
+
+ useEffect(() => {
+ props.customerPage({ current: 1, size: 999 });
+ }, []);
+
+ useEffect(() => {
+ if (!projectId) return;
+ (async () => {
+ setDetailLoading(true);
+ try {
+ const res = await props.evalProjectDetail({ id: projectId });
+ if (res?.success !== false && res?.data) {
+ const data = res.data;
+ form.setFieldsValue({
+ ...data,
+ planStartDate: data.planStartDate ? dayjs(data.planStartDate) : undefined,
+ planEndDate: data.planEndDate ? dayjs(data.planEndDate) : undefined,
+ });
+ if (data.participants?.length) {
+ setSelectedParticipants(
+ data.participants.map((p) => ({ id: p.id, userName: p.name, ...p })),
+ );
+ }
+ }
+ } finally {
+ setDetailLoading(false);
+ }
+ })();
+ }, [projectId]);
+
+ const handleMapConfirm = (location) => {
+ const { lng, lat, address } = location;
+ form.setFieldsValue({
+ longitude: lng,
+ latitude: lat,
+ customerAddress: address,
+ });
+ setMapPickerVisible(false);
+ };
+
+ const handleSubmit = () => {
+ form.validateFields().then(async (values) => {
+ const { planStartDate, planEndDate, ...rest } = values;
+ const params = {
+ ...rest,
+ planStartDate: planStartDate?.format("YYYY-MM-DD"),
+ planEndDate: planEndDate?.format("YYYY-MM-DD"),
+ participants: selectedParticipants.map((item) => ({
+ id: item.id,
+ name: item.userName,
+ })),
+ };
+ if (isView) {
+ params.id = projectId;
+ await props.evalProjectSave(params);
+ message.success("修改成功");
+ } else {
+ await props.evalProjectSave(params);
+ message.success("创建成功");
+ }
+ props.history.goBack();
+ });
+ };
+
+ const handleStaffConfirm = (rows) => {
+ setSelectedParticipants(rows);
+ setStaffPickerVisible(false);
+ };
+
+ return (
+