fix(inspection): 修复申辩附件显示和计划状态逻辑问题

- 修复申辩附件名称和下载功能的数据字段映射
- 添加确认模态框隐藏编号状态管理
- 禁用隐患数为0时的申辩选项
- 延长检查表单空闲超时时间至50秒
- 修复检查详情页面部门名称显示逻辑
- 添加检查详情页面打印功能按钮
- 修复计划执行和管理列表的过期状态显示
- 修正计划编辑和删除权限控制逻辑
master
fangjiakai 2025-12-31 09:01:27 +08:00
parent d67393eaa2
commit e2475d5ea1
6 changed files with 21 additions and 19 deletions

View File

@ -258,13 +258,13 @@ function DefenseRecordModalComponent(props) {
</> </>
) }, ) },
{ title: "签字图片", dataIndex: "signature", render: (_, record) => (record.signature && <Image src={getFileUrl() + record.signature} width={100} height={100} />) }, { title: "签字图片", dataIndex: "signature", render: (_, record) => (record.signature && <Image src={getFileUrl() + record.signature} width={100} height={100} />) },
{ title: "申辩附件名称", dataIndex: "name", width: 200 }, { title: "申辩附件名称", dataIndex: "name", width: 200,render: (_, record) => record.files?.[0]?.fileName || "无" },
{ title: "申辩附件", dataIndex: "url", render: (_, record) => ( { title: "申辩附件", dataIndex: "url", render: (_, record) => (
record.url && ( record.files?.[0]?.filePath && (
<Button <Button
type="link" type="link"
onClick={() => { onClick={() => {
downloadFile({ url: record.url, name: record.name }); downloadFile({ url: record.files?.[0]?.filePath, name: record.files?.[0]?.fileName || "无" });
}} }}
> >
下载 下载

View File

@ -20,6 +20,7 @@ import { NS_INSPECTION } from "~/enumerate/namespace";
function List(props) { function List(props) {
const [confirmModalOpen, setConfirmModalOpen] = useState(false); const [confirmModalOpen, setConfirmModalOpen] = useState(false);
const [currentId, setCurrentId] = useState(""); const [currentId, setCurrentId] = useState("");
const [currentHiddenNumber, setCurrentHiddenNumber] = useState(0);
const [form] = Form.useForm(); const [form] = Form.useForm();
const { tableProps, getData } = useTable(props["inspectionList"], { const { tableProps, getData } = useTable(props["inspectionList"], {
form, form,
@ -82,6 +83,7 @@ function List(props) {
onClick={() => { onClick={() => {
setConfirmModalOpen(true); setConfirmModalOpen(true);
setCurrentId(record.inspectionId); setCurrentId(record.inspectionId);
setCurrentHiddenNumber(record.hiddenNumber);
}} }}
> >
确认 确认
@ -96,6 +98,7 @@ function List(props) {
{confirmModalOpen && ( {confirmModalOpen && (
<ConfirmModal <ConfirmModal
id={currentId} id={currentId}
hiddenNumber={currentHiddenNumber}
onCancel={() => { onCancel={() => {
setConfirmModalOpen(false); setConfirmModalOpen(false);
setCurrentId(""); setCurrentId("");
@ -155,6 +158,9 @@ function ConfirmModalComponent(props) {
label: "是否申辩", label: "是否申辩",
render: FORM_ITEM_RENDER_ENUM.RADIO, render: FORM_ITEM_RENDER_ENUM.RADIO,
items: [{ bianma: "2", name: "是" }, { bianma: "1", name: "否" }], items: [{ bianma: "2", name: "是" }, { bianma: "1", name: "否" }],
componentProps:{
disabled: props.hiddenNumber === 0,
}
}, },
{ {
name: "userRemarks", name: "userRemarks",

View File

@ -31,7 +31,7 @@ function Add(props) {
const { loading: getFileLoading, getFile } = useGetFile(); const { loading: getFileLoading, getFile } = useGetFile();
const { loading: uploadFileLoading, uploadFile } = useUploadFile(); const { loading: uploadFileLoading, uploadFile } = useUploadFile();
const { isExistenceDuplicateSelection } = useIsExistenceDuplicateSelection(); const { isExistenceDuplicateSelection } = useIsExistenceDuplicateSelection();
const isIdle = useIdle({ timeout: 5000 }); const isIdle = useIdle({ timeout: 50000 });
const [form] = Form.useForm(); const [form] = Form.useForm();
const personUnderInspectionDepartmentId = Form.useWatch(["personUnderInspection", "departmentId"], form); const personUnderInspectionDepartmentId = Form.useWatch(["personUnderInspection", "departmentId"], form);
@ -74,7 +74,7 @@ function Add(props) {
setSignatureFilePath(currentInspectorUser.signature ? getFileUrl() + currentInspectorUser.signature : ""); setSignatureFilePath(currentInspectorUser.signature ? getFileUrl() + currentInspectorUser.signature : "");
form.setFieldsValue({ form.setFieldsValue({
...data, ...data,
situationList, situationList:situationList.length > 0 ? situationList : [{ content: undefined }],
inspectorList: data.inspectorVerificationList, inspectorList: data.inspectorVerificationList,
personUnderInspection: data.inspectedPartyConfirmation, personUnderInspection: data.inspectedPartyConfirmation,
initiator: { initiator: {

View File

@ -31,7 +31,6 @@ function InspectionView(props) {
const [hiddenUUId, setHiddenUUId] = useState(""); const [hiddenUUId, setHiddenUUId] = useState("");
const [flowModalOpen, setFlowModalOpen] = useState(false); const [flowModalOpen, setFlowModalOpen] = useState(false);
const [currentId, setCurrentId] = useState(""); const [currentId, setCurrentId] = useState("");
const [currentInspectorDepartmentName, setCurrentInspectorDepartmentName] = useState([]);
const [currentInspectorUserName, setCurrentInspectorUserName] = useState([]); const [currentInspectorUserName, setCurrentInspectorUserName] = useState([]);
const contentRef = useRef(null); const contentRef = useRef(null);
const handlePrint = useReactToPrint({ const handlePrint = useReactToPrint({
@ -59,9 +58,6 @@ function InspectionView(props) {
}); });
data.content[i].files = files; data.content[i].files = files;
} }
data.inspector.forEach((item) => {
setCurrentInspectorDepartmentName(prev => [...prev, item.departmentName || ""]);
});
data.inspectorVerificationList.forEach((item) => { data.inspectorVerificationList.forEach((item) => {
setCurrentInspectorUserName(prev => [...prev, item.userName || ""]); setCurrentInspectorUserName(prev => [...prev, item.userName || ""]);
}); });
@ -74,7 +70,7 @@ function InspectionView(props) {
}, []); }, []);
return ( return (
<Page headerTitle="查看"> <Page headerTitle="查看" extraActionButtons={<Button type="primary" onClick={handlePrint}>打印</Button>}>
<Spin spinning={props.inspection.inspectionLoading || getFileLoading}> <Spin spinning={props.inspection.inspectionLoading || getFileLoading}>
<div ref={contentRef}> <div ref={contentRef}>
<Divider orientation="left"> <Divider orientation="left">
@ -88,7 +84,7 @@ function InspectionView(props) {
items={[ items={[
{ label: "被检查单位", children: info.inspectedPartyConfirmation?.departmentName }, { label: "被检查单位", children: info.inspectedPartyConfirmation?.departmentName },
{ label: "被检查单位现场负责人", children: info.inspectedPartyConfirmation?.userName }, { label: "被检查单位现场负责人", children: info.inspectedPartyConfirmation?.userName },
{ label: "牵头检查部门", children: currentInspectorDepartmentName.join("") }, { label: "牵头检查部门", children: info.inspector?.departmentName },
{ label: "检查人", children: currentInspectorUserName.join("") }, { label: "检查人", children: currentInspectorUserName.join("") },
{ label: "检查类型", children: info.typeName }, { label: "检查类型", children: info.typeName },
{ label: "检查时间", children: `${info.timeStart}${info.timeEnd}` }, { label: "检查时间", children: `${info.timeStart}${info.timeEnd}` },
@ -215,12 +211,6 @@ function InspectionView(props) {
]} ]}
/> />
</div> </div>
<div style={{ marginTop: 20, paddingBottom: 20, textAlign: "center" }}>
<Space>
<Button type="primary" onClick={handlePrint}>打印</Button>
{/* {query.isExport !== "0" && <Button type="primary">导出</Button>} */}
</Space>
</div>
</Spin> </Spin>
{hiddenViewModalOpen && ( {hiddenViewModalOpen && (
<HiddenViewModal <HiddenViewModal

View File

@ -77,6 +77,9 @@ function List(props) {
&& (currentTime.isBefore(planEndTime, "day") || currentTime.isSame(planEndTime, "day"))) { && (currentTime.isBefore(planEndTime, "day") || currentTime.isSame(planEndTime, "day"))) {
statusText = "执行中"; statusText = "执行中";
} }
else if (currentTime.isAfter(planEndTime, "day")) {
statusText = "已过期";
}
return statusText; return statusText;
}, },

View File

@ -134,6 +134,9 @@ function List(props) {
&& (currentTime.isBefore(planEndTime, "day") || currentTime.isSame(planEndTime, "day"))) { && (currentTime.isBefore(planEndTime, "day") || currentTime.isSame(planEndTime, "day"))) {
statusText = "执行中"; statusText = "执行中";
} }
else if (currentTime.isAfter(planEndTime, "day")) {
statusText = "已过期";
}
return statusText; return statusText;
}, },
@ -156,7 +159,7 @@ function List(props) {
查看 查看
</Button> </Button>
{ {
(props.permission(props.updatePermissionKey || "inspection-qy-plan-list-edit") && !isBeforeStart && query.entrance !== "statistics") && ( (props.permission(props.updatePermissionKey || "inspection-qy-plan-list-edit") && isBeforeStart && query.entrance !== "statistics") && (
<Button <Button
type="link" type="link"
onClick={() => { onClick={() => {
@ -169,7 +172,7 @@ function List(props) {
) )
} }
{ {
(props.permission(props.deletePermissionKey || "inspection-qy-plan-list-del") && !isBeforeStart && query.entrance !== "statistics") && ( (props.permission(props.deletePermissionKey || "inspection-qy-plan-list-del") && isBeforeStart && query.entrance !== "statistics") && (
<Button <Button
type="link" type="link"
danger danger