fix(inspection): 修复申辩附件显示和计划状态逻辑问题
- 修复申辩附件名称和下载功能的数据字段映射 - 添加确认模态框隐藏编号状态管理 - 禁用隐患数为0时的申辩选项 - 延长检查表单空闲超时时间至50秒 - 修复检查详情页面部门名称显示逻辑 - 添加检查详情页面打印功能按钮 - 修复计划执行和管理列表的过期状态显示 - 修正计划编辑和删除权限控制逻辑master
parent
d67393eaa2
commit
e2475d5ea1
|
|
@ -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: "name", width: 200 },
|
||||
{ title: "申辩附件名称", dataIndex: "name", width: 200,render: (_, record) => record.files?.[0]?.fileName || "无" },
|
||||
{ title: "申辩附件", dataIndex: "url", render: (_, record) => (
|
||||
record.url && (
|
||||
record.files?.[0]?.filePath && (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
downloadFile({ url: record.url, name: record.name });
|
||||
downloadFile({ url: record.files?.[0]?.filePath, name: record.files?.[0]?.fileName || "无" });
|
||||
}}
|
||||
>
|
||||
下载
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import { NS_INSPECTION } from "~/enumerate/namespace";
|
|||
function List(props) {
|
||||
const [confirmModalOpen, setConfirmModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const [currentHiddenNumber, setCurrentHiddenNumber] = useState(0);
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["inspectionList"], {
|
||||
form,
|
||||
|
|
@ -82,6 +83,7 @@ function List(props) {
|
|||
onClick={() => {
|
||||
setConfirmModalOpen(true);
|
||||
setCurrentId(record.inspectionId);
|
||||
setCurrentHiddenNumber(record.hiddenNumber);
|
||||
}}
|
||||
>
|
||||
确认
|
||||
|
|
@ -96,6 +98,7 @@ function List(props) {
|
|||
{confirmModalOpen && (
|
||||
<ConfirmModal
|
||||
id={currentId}
|
||||
hiddenNumber={currentHiddenNumber}
|
||||
onCancel={() => {
|
||||
setConfirmModalOpen(false);
|
||||
setCurrentId("");
|
||||
|
|
@ -155,6 +158,9 @@ function ConfirmModalComponent(props) {
|
|||
label: "是否申辩",
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: [{ bianma: "2", name: "是" }, { bianma: "1", name: "否" }],
|
||||
componentProps:{
|
||||
disabled: props.hiddenNumber === 0,
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "userRemarks",
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ function Add(props) {
|
|||
const { loading: getFileLoading, getFile } = useGetFile();
|
||||
const { loading: uploadFileLoading, uploadFile } = useUploadFile();
|
||||
const { isExistenceDuplicateSelection } = useIsExistenceDuplicateSelection();
|
||||
const isIdle = useIdle({ timeout: 5000 });
|
||||
const isIdle = useIdle({ timeout: 50000 });
|
||||
|
||||
const [form] = Form.useForm();
|
||||
const personUnderInspectionDepartmentId = Form.useWatch(["personUnderInspection", "departmentId"], form);
|
||||
|
|
@ -74,7 +74,7 @@ function Add(props) {
|
|||
setSignatureFilePath(currentInspectorUser.signature ? getFileUrl() + currentInspectorUser.signature : "");
|
||||
form.setFieldsValue({
|
||||
...data,
|
||||
situationList,
|
||||
situationList:situationList.length > 0 ? situationList : [{ content: undefined }],
|
||||
inspectorList: data.inspectorVerificationList,
|
||||
personUnderInspection: data.inspectedPartyConfirmation,
|
||||
initiator: {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ function InspectionView(props) {
|
|||
const [hiddenUUId, setHiddenUUId] = useState("");
|
||||
const [flowModalOpen, setFlowModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const [currentInspectorDepartmentName, setCurrentInspectorDepartmentName] = useState([]);
|
||||
const [currentInspectorUserName, setCurrentInspectorUserName] = useState([]);
|
||||
const contentRef = useRef(null);
|
||||
const handlePrint = useReactToPrint({
|
||||
|
|
@ -59,9 +58,6 @@ function InspectionView(props) {
|
|||
});
|
||||
data.content[i].files = files;
|
||||
}
|
||||
data.inspector.forEach((item) => {
|
||||
setCurrentInspectorDepartmentName(prev => [...prev, item.departmentName || ""]);
|
||||
});
|
||||
data.inspectorVerificationList.forEach((item) => {
|
||||
setCurrentInspectorUserName(prev => [...prev, item.userName || ""]);
|
||||
});
|
||||
|
|
@ -74,7 +70,7 @@ function InspectionView(props) {
|
|||
}, []);
|
||||
|
||||
return (
|
||||
<Page headerTitle="查看">
|
||||
<Page headerTitle="查看" extraActionButtons={<Button type="primary" onClick={handlePrint}>打印</Button>}>
|
||||
<Spin spinning={props.inspection.inspectionLoading || getFileLoading}>
|
||||
<div ref={contentRef}>
|
||||
<Divider orientation="left">
|
||||
|
|
@ -88,7 +84,7 @@ function InspectionView(props) {
|
|||
items={[
|
||||
{ label: "被检查单位", children: info.inspectedPartyConfirmation?.departmentName },
|
||||
{ label: "被检查单位现场负责人", children: info.inspectedPartyConfirmation?.userName },
|
||||
{ label: "牵头检查部门", children: currentInspectorDepartmentName.join(",") },
|
||||
{ label: "牵头检查部门", children: info.inspector?.departmentName },
|
||||
{ label: "检查人", children: currentInspectorUserName.join(",") },
|
||||
{ label: "检查类型", children: info.typeName },
|
||||
{ label: "检查时间", children: `${info.timeStart}至${info.timeEnd}` },
|
||||
|
|
@ -215,12 +211,6 @@ function InspectionView(props) {
|
|||
]}
|
||||
/>
|
||||
</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>
|
||||
{hiddenViewModalOpen && (
|
||||
<HiddenViewModal
|
||||
|
|
|
|||
|
|
@ -77,6 +77,9 @@ function List(props) {
|
|||
&& (currentTime.isBefore(planEndTime, "day") || currentTime.isSame(planEndTime, "day"))) {
|
||||
statusText = "执行中";
|
||||
}
|
||||
else if (currentTime.isAfter(planEndTime, "day")) {
|
||||
statusText = "已过期";
|
||||
}
|
||||
|
||||
return statusText;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -134,6 +134,9 @@ function List(props) {
|
|||
&& (currentTime.isBefore(planEndTime, "day") || currentTime.isSame(planEndTime, "day"))) {
|
||||
statusText = "执行中";
|
||||
}
|
||||
else if (currentTime.isAfter(planEndTime, "day")) {
|
||||
statusText = "已过期";
|
||||
}
|
||||
|
||||
return statusText;
|
||||
},
|
||||
|
|
@ -156,7 +159,7 @@ function List(props) {
|
|||
查看
|
||||
</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
|
||||
type="link"
|
||||
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
|
||||
type="link"
|
||||
danger
|
||||
|
|
|
|||
Loading…
Reference in New Issue