diff --git a/src/components/AttachmentUpload/index.js b/src/components/AttachmentUpload/index.js index 729fe00..1b1b507 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 ,rules }) { +export default function AttachmentUpload({ name, label, disabled = false, maxCount, accept, extra ,rules, style }) { const [previewImage, setPreviewImage] = useState(""); return ( @@ -13,6 +13,7 @@ export default function AttachmentUpload({ name, label, disabled = false, maxCou name={name} label={label} extra={extra} + style={style} valuePropName="fileList" rules={rules} getValueProps={(value) => { @@ -90,7 +91,7 @@ export default function AttachmentUpload({ name, label, disabled = false, maxCou - + />} ); } diff --git a/src/pages/Container/SafetyEvalBusiness/EvalProject/Create/index.js b/src/pages/Container/SafetyEvalBusiness/EvalProject/Create/index.js index 271d8dc..cb93079 100644 --- a/src/pages/Container/SafetyEvalBusiness/EvalProject/Create/index.js +++ b/src/pages/Container/SafetyEvalBusiness/EvalProject/Create/index.js @@ -103,7 +103,7 @@ const EvalProjectCreate = (props) => { name: item.userName, deptName: item.deptName, posName: item.postName, - capacity: '龟派气功波', + capacity: '', })), }; if (isView) { diff --git a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ContractContent.js b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ContractContent.js index a59e6c1..4259301 100644 --- a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ContractContent.js +++ b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ContractContent.js @@ -501,10 +501,12 @@ const ContractContent = (props) => { - diff --git a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/RiskAnalysisContent.js b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/RiskAnalysisContent.js index 58d9acd..d7c228a 100644 --- a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/RiskAnalysisContent.js +++ b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/RiskAnalysisContent.js @@ -21,6 +21,7 @@ import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { NS_SAFETY_EVAL_BUSINESS } from "~/enumerate/namespace"; import { QUALIFICATION_INDUSTRY_OPTIONS } from "~/enumerate/enterpriseOptions"; import { tools } from "@cqsjjb/jjb-common-lib"; +import AttachmentUpload from "~/components/AttachmentUpload"; const { router } = tools; const { TextArea } = Input; @@ -64,6 +65,7 @@ const RiskAnalysisContent = (props) => { if (res?.success !== false && res?.data) { form.setFieldsValue({ ...res.data, + riskFileUrl: res.data.riskFileUrl? JSON.parse(res.data.riskFileUrl) :undefined, analysisDate: res.data.analysisDate ? dayjs(res.data.analysisDate) : undefined, @@ -96,6 +98,7 @@ const RiskAnalysisContent = (props) => { ...rest, projectId, statusCode, + riskFileUrl: rest.riskFileUrl? JSON.stringify(rest.riskFileUrl) :undefined, analysisDate: analysisDate ? analysisDate.format("YYYY-MM-DD") : undefined, @@ -325,7 +328,7 @@ const RiskAnalysisContent = (props) => { - + {(fields, { add, remove }) => { addParticipantRef.current = add; @@ -463,55 +466,14 @@ const RiskAnalysisContent = (props) => { - setParticipantModalOpen(false)} - onOk={() => { - const selected = ( - evalProjectDetailData?.participants || [] - ).filter((p) => selectedParticipantIds.includes(p.id)); - selected.forEach((p) => { - addParticipantRef.current?.({ - personnelId: p.id, - personnelName: p.name, - deptName: p.deptName, - opinion: "", - projectId, - }); - }); - setParticipantModalOpen(false); - }} - > - { - const existing = ( - form.getFieldValue("participants") || [] - ).map((p) => p.personnelName); - return (evalProjectDetailData?.participants || []).filter( - (p) => !existing.includes(p.name), - ); - })()} - rowKey="id" - rowSelection={{ - type: "checkbox", - selectedRowKeys: selectedParticipantIds, - onChange: (keys) => setSelectedParticipantIds(keys), - getCheckboxProps: (record) => ({ - disabled: false, - }), - }} - columns={[ - { title: "姓名", dataIndex: "name", width: 100 }, - { title: "部门", dataIndex: "deptName", width: 120 }, - { title: "岗位", dataIndex: "posName", width: 120 }, - { title: "能力", dataIndex: "capacity", width: 120 }, - ]} - pagination={false} - size="small" - locale={{ emptyText: "所有人员均已添加" }} - /> - + @@ -558,6 +520,56 @@ const RiskAnalysisContent = (props) => { + setParticipantModalOpen(false)} + onOk={() => { + const selected = (evalProjectDetailData?.participants || []).filter( + (p) => selectedParticipantIds.includes(p.id), + ); + selected.forEach((p) => { + addParticipantRef.current?.({ + personnelId: p.id, + personnelName: p.name, + deptName: p.deptName, + opinion: "", + projectId, + }); + }); + setParticipantModalOpen(false); + }} + > +
{ + const existing = (form.getFieldValue("participants") || []).map( + (p) => p.personnelName, + ); + return (evalProjectDetailData?.participants || []).filter( + (p) => !existing.includes(p.name), + ); + })()} + rowKey="id" + rowSelection={{ + type: "checkbox", + selectedRowKeys: selectedParticipantIds, + onChange: (keys) => setSelectedParticipantIds(keys), + getCheckboxProps: (record) => ({ + disabled: false, + }), + }} + columns={[ + { title: "姓名", dataIndex: "name", width: 100 }, + { title: "部门", dataIndex: "deptName", width: 120 }, + { title: "岗位", dataIndex: "posName", width: 120 }, + { title: "能力", dataIndex: "capacity", width: 120 }, + ]} + pagination={false} + size="small" + locale={{ emptyText: "所有人员均已添加" }} + /> + + - +