feat
parent
b34263d79d
commit
fe52f2286c
|
|
@ -1,8 +1,8 @@
|
|||
import React, { useState, useEffect } from "react";
|
||||
import { Button, Select, Tag, Space, Input } from "antd";
|
||||
import React, { useEffect } from "react";
|
||||
import { Button, Form, Input, Select, Tag, Space, message } from "antd";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { tools } from "@cqsjjb/jjb-common-lib";
|
||||
import { NS_QUAL_REVIEW } from "~/enumerate/namespace";
|
||||
import { NS_QUAL_REVIEW, NS_QUAL_EXPERT } from "~/enumerate/namespace";
|
||||
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
|
||||
|
||||
import "./indes.less";
|
||||
|
|
@ -10,23 +10,28 @@ import "./indes.less";
|
|||
const { TextArea } = Input;
|
||||
|
||||
const QualConfirmForm = (props) => {
|
||||
const [result, setResult] = useState(undefined);
|
||||
const [opinion, setOpinion] = useState("");
|
||||
|
||||
const {router}=tools;
|
||||
const { qualReview, fetchQualFilingDetail } = props;
|
||||
const { fetchQualFilingDetailLoading, qualFilingDetail } = qualReview;
|
||||
|
||||
const [form] = Form.useForm();
|
||||
const { router } = tools;
|
||||
const { qualReview, fetchQualFilingDetail, reviewSubmit } = props;
|
||||
const { fetchQualFilingDetailLoading, qualReviewLoading, qualFilingDetail } = qualReview || {};
|
||||
|
||||
useEffect(() => {
|
||||
fetchQualFilingDetail({
|
||||
id: router.query.id,
|
||||
});
|
||||
fetchQualFilingDetail({ id: router.query.id });
|
||||
}, []);
|
||||
|
||||
const handleSubmit = () => {
|
||||
console.log("确认提交:", { result, opinion });
|
||||
// TODO: 调用接口
|
||||
const handleSubmit = async () => {
|
||||
const values = await form.validateFields();
|
||||
const params = {
|
||||
filingId: router.query.id,
|
||||
reviewResult: values.reviewResult,
|
||||
reviewResultRemark: values.reviewResult === "passed" ? "确认通过" : "打回",
|
||||
reviewOpinion: values.reviewOpinion,
|
||||
};
|
||||
const res = await reviewSubmit(params);
|
||||
if (res?.success !== false) {
|
||||
message.success("确认提交成功");
|
||||
router.goBack();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
@ -67,34 +72,30 @@ const {router}=tools;
|
|||
{/* 确认意见 */}
|
||||
<div className="opinion-card">
|
||||
<div className="summary-card-title">确认意见</div>
|
||||
<div className="opinion-grid">
|
||||
<div>
|
||||
<div className="opinion-label">确认结果</div>
|
||||
<Select
|
||||
style={{ width: "100%" }}
|
||||
placeholder="请选择"
|
||||
value={result}
|
||||
onChange={setResult}
|
||||
<Form form={form} layout="vertical">
|
||||
<Form.Item
|
||||
label="确认结果"
|
||||
name="reviewResult"
|
||||
rules={[{ required: true, message: "请选择确认结果" }]}
|
||||
>
|
||||
<Select.Option value="passed">确认通过</Select.Option>
|
||||
<Select.Option value="rejected">打回</Select.Option>
|
||||
<Select placeholder="请选择">
|
||||
<Select.Option value="1">确认通过</Select.Option>
|
||||
<Select.Option value="3">打回</Select.Option>
|
||||
</Select>
|
||||
</div>
|
||||
<div>
|
||||
<div className="opinion-label">确认意见</div>
|
||||
<TextArea
|
||||
rows={4}
|
||||
placeholder="请输入确认意见..."
|
||||
value={opinion}
|
||||
onChange={(e) => setOpinion(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="确认意见"
|
||||
name="reviewOpinion"
|
||||
rules={[{ required: true, message: "请输入确认意见" }]}
|
||||
>
|
||||
<TextArea rows={4} placeholder="请输入确认意见..." />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</div>
|
||||
|
||||
{/* 操作按钮 */}
|
||||
<div className="footer-bar">
|
||||
<Button type="primary" onClick={handleSubmit} loading={fetchQualFilingDetailLoading}>
|
||||
<Button type="primary" onClick={handleSubmit} loading={qualReviewLoading}>
|
||||
提交确认
|
||||
</Button>
|
||||
</div>
|
||||
|
|
@ -105,6 +106,6 @@ const {router}=tools;
|
|||
|
||||
|
||||
export default Connect(
|
||||
[NS_QUAL_REVIEW],
|
||||
[NS_QUAL_REVIEW, NS_QUAL_EXPERT],
|
||||
true,
|
||||
)(QualConfirmForm);
|
||||
|
|
|
|||
Loading…
Reference in New Issue