feat
parent
62db095eb5
commit
adb6a79d8f
|
|
@ -1,5 +1,5 @@
|
|||
import React, { useState } from "react";
|
||||
import { Button, Tag, Space, Modal, Select, Input } from "antd";
|
||||
import { Button, Tag, Space, Modal, Select, Input, Form } from "antd";
|
||||
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
|
||||
import { REVIEW_STATUS_MAP } from "~/enumerate/constant";
|
||||
import { MOCK_DETAIL, MOCK_MATERIALS, LEGAL_CHECK_ITEMS, LEGAL_STATUS_STYLE } from "../mockData";
|
||||
|
|
@ -9,22 +9,20 @@ import "./indes.less";
|
|||
const { TextArea } = Input;
|
||||
|
||||
const QualReviewForm = (props) => {
|
||||
const [form] = Form.useForm();
|
||||
const [compliance, setCompliance] = useState({});
|
||||
const [reviewVisible, setReviewVisible] = useState(false);
|
||||
const [reviewResult, setReviewResult] = useState(undefined);
|
||||
const [expert, setExpert] = useState(undefined);
|
||||
const [remark, setRemark] = useState("");
|
||||
const detail = MOCK_DETAIL;
|
||||
const statusConfig = REVIEW_STATUS_MAP[detail.reviewStatus];
|
||||
|
||||
const passCount = Object.values(compliance).filter((v) => v === "pass").length;
|
||||
const failCount = Object.values(compliance).filter((v) => v === "fail").length;
|
||||
const evaluatedCount = passCount + failCount;
|
||||
const unmetCount = MOCK_MATERIALS.length - evaluatedCount;
|
||||
const legalPassCount = LEGAL_CHECK_ITEMS.filter((i) => i.status === "pass").length;
|
||||
const legalFailCount = LEGAL_CHECK_ITEMS.filter((i) => i.status === "fail").length;
|
||||
|
||||
const handleSubmit = (action) => {
|
||||
console.log("审核提交:", { action, reviewResult, expert, remark, compliance });
|
||||
setReviewVisible(false);
|
||||
form.validateFields().then((values) => {
|
||||
console.log("审核提交:", { action, ...values, compliance });
|
||||
setReviewVisible(false);
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
@ -81,35 +79,32 @@ const QualReviewForm = (props) => {
|
|||
<div style={{ background: "#f8fafc", border: "1px solid #d9d9d9", borderRadius: 6, padding: "0.75rem", marginBottom: "1rem" }}>
|
||||
<div style={{ fontSize: "0.88rem", fontWeight: 600, marginBottom: "0.5rem" }}>评价分析</div>
|
||||
<div style={{ display: "grid", gridTemplateColumns: "1fr 1fr 1fr 1fr", gap: "0.4rem" }}>
|
||||
<div style={statStyle}><div style={statLabelStyle}>已核验材料</div><div style={{ fontSize: "1.1rem", fontWeight: 700, color: "#1677ff" }}>{evaluatedCount}</div></div>
|
||||
<div style={statStyle}><div style={statLabelStyle}>符合</div><div style={{ fontSize: "1.1rem", fontWeight: 700, color: "#52c41a" }}>{passCount}</div></div>
|
||||
<div style={statStyle}><div style={statLabelStyle}>不符合</div><div style={{ fontSize: "1.1rem", fontWeight: 700, color: "#ff4d4f" }}>{failCount}</div></div>
|
||||
<div style={statStyle}><div style={statLabelStyle}>条件未满足</div><div style={{ fontSize: "1.1rem", fontWeight: 700, color: "#faad14" }}>{unmetCount}</div></div>
|
||||
<div style={statStyle}><div style={statLabelStyle}>已核验材料</div><div style={{ fontSize: "1.1rem", fontWeight: 700, color: "#1677ff" }}>{legalPassCount+legalFailCount}</div></div>
|
||||
<div style={statStyle}><div style={statLabelStyle}>符合</div><div style={{ fontSize: "1.1rem", fontWeight: 700, color: "#059669" }}>{legalPassCount}</div></div>
|
||||
<div style={statStyle}><div style={statLabelStyle}>不符合</div><div style={{ fontSize: "1.1rem", fontWeight: 700, color: "#dc2626" }}>{legalFailCount}</div></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style={{ display: "grid", gap: "0.6rem" }}>
|
||||
<div>
|
||||
<div style={{ fontSize: "0.8rem", marginBottom: 4 }}>审核结果</div>
|
||||
<Select style={{ width: "100%" }} placeholder="请选择" value={reviewResult} onChange={setReviewResult}>
|
||||
<Form form={form} layout="vertical" style={{ marginTop: "0.5rem" }}>
|
||||
<Form.Item label="审核结果" name="reviewResult" rules={[{ required: true, message: "请选择审核结果" }]}>
|
||||
<Select placeholder="请选择">
|
||||
<Select.Option value="pass">通过</Select.Option>
|
||||
<Select.Option value="pending">待定</Select.Option>
|
||||
<Select.Option value="reject">不通过</Select.Option>
|
||||
</Select>
|
||||
</div>
|
||||
<div>
|
||||
<div style={{ fontSize: "0.8rem", marginBottom: 4 }}>指派专家</div>
|
||||
<Select style={{ width: "100%" }} placeholder="— 请选择 —" value={expert} onChange={setExpert}>
|
||||
</Form.Item>
|
||||
<Form.Item label="指派专家" name="expert" rules={[{ required: true, message: "请选择专家" }]}>
|
||||
<Select placeholder="— 请选择 —">
|
||||
<Select.Option value="chen">陈教授(化工安全)</Select.Option>
|
||||
<Select.Option value="li">李教授(矿山安全)</Select.Option>
|
||||
<Select.Option value="wang">王高工(建筑施工)</Select.Option>
|
||||
</Select>
|
||||
</div>
|
||||
<div>
|
||||
<div style={{ fontSize: "0.8rem", marginBottom: 4 }}>综合审核意见</div>
|
||||
<TextArea rows={3} placeholder="请输入综合审核意见..." value={remark} onChange={(e) => setRemark(e.target.value)} />
|
||||
</div>
|
||||
</div>
|
||||
</Form.Item>
|
||||
<Form.Item label="综合审核意见" name="remark" rules={[{ required: true, message: "请输入综合审核意见" }]}>
|
||||
<TextArea rows={3} placeholder="请输入综合审核意见..." />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
</div>
|
||||
</PageLayout>
|
||||
|
|
|
|||
Loading…
Reference in New Issue