申辩处理增加缺少字段

master
LiuJiaNan 2026-01-19 13:42:28 +08:00
parent e839798cd6
commit f97808963c
2 changed files with 43 additions and 8 deletions

View File

@ -32,7 +32,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-to-print": "^3.2.0",
"zy-react-library": "^1.1.23"
"zy-react-library": "^1.1.30"
},
"devDependencies": {
"@antfu/eslint-config": "^5.4.1",

View File

@ -16,9 +16,9 @@ import useGetFile from "zy-react-library/hooks/useGetFile";
import useTable from "zy-react-library/hooks/useTable";
import useUploadFile from "zy-react-library/hooks/useUploadFile";
import { getFileUrl } from "zy-react-library/utils";
import { formatDate } from "~/utils/dateFormat";
import { INSPECTION_QUESTION_ENUM } from "~/enumerate/constant";
import { NS_INSPECTION } from "~/enumerate/namespace";
import { formatDate } from "~/utils/dateFormat";
function List(props) {
const [defenseHandlingModalOpen, setDefenseHandlingModalOpen] = useState(false);
@ -29,8 +29,8 @@ function List(props) {
const { tableProps, getData } = useTable(props["inspectionList"], {
form,
transform: formData => ({
checkStartTime: formData.checkTime?.[0] ? (formData.checkTime[0] + " 00:00:00") : "",
checkEndTime: formData.checkTime?.[1] ? (formData.checkTime[1] + " 23:59:59") : "",
checkStartTime: formData.checkTime?.[0] ? (`${formData.checkTime[0]} 00:00:00`) : "",
checkEndTime: formData.checkTime?.[1] ? (`${formData.checkTime[1]} 23:59:59`) : "",
}),
params: { status: "700" },
});
@ -135,9 +135,24 @@ function List(props) {
}
function DefenseHandlingModalComponent(props) {
const [signature, setSignature] = useState("");
const [form] = Form.useForm();
const { loading: uploadFileLoading, uploadFile } = useUploadFile();
const getData = async () => {
const { data } = await props["defenseRecordList"]({ id: props.inspectionId, pageIndex: 1, pageSize: 999 });
setSignature(data.at(-1).signature);
form.setFieldsValue({
createTime: data.at(-1).createTime,
content: data.at(-1).content,
});
};
useEffect(() => {
getData();
}, []);
const onSubmit = async (values) => {
if (values.status === "1") {
props.history.push(`./edit?id=${props.id}&inspectionId=${props.inspectionId}`);
@ -180,6 +195,22 @@ function DefenseHandlingModalComponent(props) {
}}
onFinish={onSubmit}
options={[
{
name: "defendantSignature",
label: "申辩人",
render: (signature && <Image src={getFileUrl() + signature} width={100} height={100} />),
componentProps: { disabled: true },
},
{
name: "createTime",
label: "申请时间",
componentProps: { disabled: true },
},
{
name: "content",
label: "申请说明",
componentProps: { disabled: true },
},
{
name: "status",
label: "申辩是否成立",
@ -265,18 +296,22 @@ function DefenseRecordModalComponent(props) {
{ title: "申辩时间", dataIndex: "createTime", width: 200 },
{ title: "申辩描述", dataIndex: "content" },
{
title: "申辩状态", dataIndex: "isPass", render: (_, record) => (
title: "申辩状态",
dataIndex: "isPass",
render: (_, record) => (
<>
<div>{record.isPass === 0 && "未审批"}</div>
<div>{record.isPass === 1 && "通过"}</div>
<div>{record.isPass === 2 && "未通过"}</div>
</>
)
),
},
{ title: "签字图片", dataIndex: "signature", render: (_, record) => (record.signature && <Image src={getFileUrl() + record.signature} width={100} height={100} />) },
{ title: "申辩附件名称", dataIndex: "name", width: 200, render: (_, record) => record.files?.[0]?.fileName || "无" },
{
title: "申辩附件", dataIndex: "url", render: (_, record) => (
title: "申辩附件",
dataIndex: "url",
render: (_, record) => (
record.files?.[0]?.filePath && (
<Button
type="link"
@ -287,7 +322,7 @@ function DefenseRecordModalComponent(props) {
下载
</Button>
)
)
),
},
{ title: "检查人签字", dataIndex: "checkSign", render: (_, record) => (record.checkSign && <Image src={getFileUrl() + record.checkSign} width={100} height={100} />) },
{ title: "检查人意见", dataIndex: "checkRemarks" },