fix(inspection): 修复检查模块中的状态码和时间显示问题

- 将暂存状态码从 -1 修改为 98
- 统一检查时间显示格式为 自xx至xx止
- 修复检查人信息显示逻辑,支持多检查人显示
- 添加导出功能的加载状态和参数处理
- 修复签字图片显示和导出按钮逻辑
- 为人员选择组件添加额外参数配置
master
fangjiakai 2025-12-29 10:19:29 +08:00
parent 3721cc4801
commit f600f90b06
13 changed files with 61 additions and 41 deletions

View File

@ -18,7 +18,7 @@ export const INSPECTION_STATE_ENUM = [
{ bianma: "500", name: "检查归档" },
{ bianma: "600", name: "检查核实打回" },
{ bianma: "700", name: "被检查人申辩" },
{ bianma: "-1", name: "暂存" },
{ bianma: "98", name: "暂存" },
];
export const PLAN_ENUM = [

View File

@ -50,7 +50,7 @@ function List(props) {
{ title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" },
{ title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 },
{ title: "检查类型", dataIndex: "typeName" },
{ title: "检查时间", width: 200, render: (_, record) => (`${record.timeStart}${record.timeEnd}`) },
{ title: "检查时间", width: 200, render: (_, record) => (`${record.timeStart}${record.timeEnd}`) },
{ title: "检查状态", dataIndex: "status", render: () => "待验收" },
{ title: "发现隐患数", dataIndex: "hiddenNumber" },
{

View File

@ -50,7 +50,7 @@ function List(props) {
{ title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" },
{ title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 },
{ title: "检查类型", dataIndex: "typeName" },
{ title: "检查时间", width: 200, render: (_, record) => (`${record.timeStart}${record.timeEnd}`) },
{ title: "检查时间", width: 200, render: (_, record) => (`${record.timeStart}${record.timeEnd}`) },
{ title: "检查状态", dataIndex: "status", render: () => "待指派" },
{ title: "发现隐患数", dataIndex: "hiddenNumber" },
{

View File

@ -62,7 +62,7 @@ function List(props) {
{ title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" },
{ title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 },
{ title: "检查类型", dataIndex: "typeName" },
{ title: "检查时间", width: 200, render: (_, record) => (`${record.timeStart}${record.timeEnd}`) },
{ title: "检查时间", width: 200, render: (_, record) => (`${record.timeStart}${record.timeEnd}`) },
{ title: "检查状态", dataIndex: "status", render: () => "被检查单位负责人申辩" },
{ title: "发现隐患数", dataIndex: "hiddenNumber" },
{

View File

@ -58,7 +58,7 @@ function List(props) {
{ title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" },
{ title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 },
{ title: "检查类型", dataIndex: "typeName" },
{ title: "检查时间", width: 200, render: (_, record) => (`${record.timeStart}${record.timeEnd}`) },
{ title: "检查时间", width: 200, render: (_, record) => (`${record.timeStart}${record.timeEnd}`) },
{ title: "检查状态", dataIndex: "status", render: () => "待确认" },
{ title: "发现隐患数", dataIndex: "hiddenNumber" },
{

View File

@ -384,6 +384,7 @@ function Add(props) {
onGetLabel={label => form.setFieldValue(["personUnderInspection", "userName"], label)}
/>
),
formItemProps: { labelCol: { span: 8 } },
},
{ name: ["personUnderInspection", "userName"], label: "被检查单位现场负责人名称", onlyForLabel: true },
{ name: "place", label: "检查场所", span: 24 },

View File

@ -78,7 +78,7 @@ function List(props) {
{ title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" },
{ title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 },
{ title: "检查类型", dataIndex: "typeName" },
{ title: "检查时间", width: 200, render: (_, record) => (`${record.timeStart}${record.timeEnd}`) },
{ title: "检查时间", width: 200, render: (_, record) => (record.timeStart && record.timeEnd ? `${record.timeStart}${record.timeEnd}` : "") },
{
title: "检查状态",
dataIndex: "status",
@ -92,7 +92,7 @@ function List(props) {
width: 200,
render: (_, record) => (
<Space>
{(props.permission(props.updatePermissionKey || "inspection-qy-check-edit") && (record.status === -1 || record.status === 600)) && (
{(props.permission(props.updatePermissionKey || "inspection-qy-check-edit") && (record.status === 98 || record.status === 600)) && (
<Button
type="link"
onClick={() => {

View File

@ -57,7 +57,7 @@ function List(props) {
{ title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" },
{ title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 },
{ title: "检查类型", dataIndex: "typeName" },
{ title: "检查时间", width: 200, render: (_, record) => (`${record.timeStart}${record.timeEnd}`) },
{ title: "检查时间", width: 200, render: (_, record) => (`${record.timeStart}${record.timeEnd}`) },
{ title: "检查状态", dataIndex: "status", render: () => "待核实" },
{ title: "发现隐患数", dataIndex: "hiddenNumber" },
{
@ -79,7 +79,7 @@ function List(props) {
type="link"
onClick={() => {
setVerifyModalOpen(true);
setCurrentId(record.id);
setCurrentId(record.inspectionId);
}}
>
核实

View File

@ -10,6 +10,8 @@ import DictionarySelectTree from "zy-react-library/components/SelectTree/Diction
import Table from "zy-react-library/components/Table";
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
import useUrlQueryCriteria from "zy-react-library/hooks/useUrlQueryCriteria";
import useDownloadBlob from "zy-react-library/hooks/useDownloadBlob";
import useTable from "zy-react-library/hooks/useTable";
import { getLabelName } from "zy-react-library/utils";
import InspectionFlowModal from "~/components/InspectionFlowModal";
@ -22,6 +24,8 @@ function List(props) {
const [flowModalOpen, setFlowModalOpen] = useState(false);
const [currentId, setCurrentId] = useState("");
const { getUrlCriteriaQuery } = useUrlQueryCriteria();
const { loading, downloadBlob } = useDownloadBlob();
const [count, setCount] = useState({
inspectCount: 0,
hiddenCount: 0,
@ -142,8 +146,12 @@ function List(props) {
{(props.permission(props.exportPermissionKey || "inspection-qy-list-dc") && query.entrance !== "statistics") && (
<Button
type="primary"
loading={loading}
icon={<ExportIcon />}
onClick={() => {
onClick={async () => {
const exportParams = getUrlCriteriaQuery("searchFormKeys", "searchFormValues");
await downloadBlob("/accident/accident/export", { params: { ...exportParams, eqType: props.type } })
}}
>
导出
@ -159,7 +167,7 @@ function List(props) {
{ title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" },
{ title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 },
{ title: "检查类型", dataIndex: "typeName" },
{ title: "检查时间", width: 200, render: (_, record) => (`${record.timeStart}${record.timeEnd}`) },
{ title: "检查时间", width: 200, render: (_, record) => (`${record.timeStart}${record.timeEnd}`) },
{
title: "检查状态",
dataIndex: "status",

View File

@ -33,6 +33,8 @@ 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({
contentRef,
@ -60,7 +62,12 @@ function InspectionView(props) {
});
data.content[i].files = files;
}
data.currentInspectorUser = data.inspectorVerificationList.filter(item => item.userId === userInfo.id)[0];
data.inspector.forEach(item => {
setCurrentInspectorDepartmentName(prev => [...prev, item.departmentName || ""])
})
data.inspectorVerificationList.forEach(item => {
setCurrentInspectorUserName(prev => [...prev, item.userName || ""])
})
setInfo(data);
const { data: hiddenList } = await props["hiddenList"]({ foreignKey: query.inspectionId, pageIndex: 1, pageSize: 999 });
setHiddenList(hiddenList);
@ -85,8 +92,8 @@ function InspectionView(props) {
items={[
{ label: "被检查单位", children: info.inspectedPartyConfirmation?.departmentName },
{ label: "被检查单位现场负责人", children: info.inspectedPartyConfirmation?.userName },
{ label: "牵头检查部门", children: info.currentInspectorUser?.departmentName },
{ label: "检查人", children: info.currentInspectorUser?.userName },
{ label: "牵头检查部门", children: currentInspectorDepartmentName.join("") },
{ label: "检查人", children: currentInspectorUserName.join("") },
{ label: "检查类型", children: info.typeName },
{ label: "检查时间", children: `${info.timeStart}${info.timeEnd}` },
{ label: "检查场所", children: info.place, span: 2 },
@ -119,29 +126,31 @@ function InspectionView(props) {
columns={[
{ title: "隐患描述", dataIndex: "hiddenDesc" },
{ title: "隐患部位", dataIndex: "hiddenPartName" },
{ title: "操作", render: (_, record) => (
<Space>
<Button
type="link"
onClick={() => {
setHiddenViewModalOpen(true);
setHiddenId(record.id);
setHiddenUUId(record.hiddenId);
}}
>
查看
</Button>
<Button
type="link"
onClick={() => {
setFlowModalOpen(true);
setCurrentId(record.id);
}}
>
流程图
</Button>
</Space>
) },
{
title: "操作", render: (_, record) => (
<Space>
<Button
type="link"
onClick={() => {
setHiddenViewModalOpen(true);
setHiddenId(record.id);
setHiddenUUId(record.hiddenId);
}}
>
查看
</Button>
<Button
type="link"
onClick={() => {
setFlowModalOpen(true);
setCurrentId(record.id);
}}
>
流程图
</Button>
</Space>
)
},
]}
/>
<table className="print-table">
@ -205,14 +214,14 @@ function InspectionView(props) {
bordered
styles={{ label: { width: 200 } }}
items={[
{ label: "被检查单位现场负责人(签字)", children: (<PreviewImg files={[]} />) },
{ label: "被检查单位现场负责人(签字)", children: (<PreviewImg files={[info.inspectedPartyConfirmation.signature]} />) },
]}
/>
</div>
<div style={{ marginTop: 20, paddingBottom: 20, textAlign: "center" }}>
<Space>
<Button type="primary" onClick={handlePrint}>打印</Button>
{query.isExport !== "0" && <Button type="primary">导出</Button>}
{/* {query.isExport !== "0" && <Button type="primary">导出</Button>} */}
</Space>
</div>
</Spin>

View File

@ -358,12 +358,14 @@ const AddModalComponent = (props) => {
params={{ corpinfoId: corpId }}
isNeedCorpInfoId={true}
isNeedDepartmentId={false}
extraParams={{ noMain: 1 }}
{...commonProps}
/>
)
: (
<PersonnelSelect
params={{ departmentId: userInfo.departmentId }}
extraParams={{ noMain: 1 }}
{...commonProps}
/>
);

View File

@ -30,7 +30,7 @@ function PersonnelExecutionDetails(props) {
{ title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" },
{ title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 },
{ title: "检查类型", dataIndex: "typeName" },
{ title: "检查时间", width: 200, render: (_, record) => (`${record.timeStart}${record.timeEnd}`) },
{ title: "检查时间", width: 200, render: (_, record) => (`${record.timeStart}${record.timeEnd}`) },
{
title: "检查状态",
dataIndex: "status",

View File

@ -31,7 +31,7 @@ function PlanExecutionDetails(props) {
{ title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" },
{ title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 },
{ title: "检查类型", dataIndex: "typeName" },
{ title: "检查时间", width: 200, render: (_, record) => (`${record.timeStart}${record.timeEnd}`) },
{ title: "检查时间", width: 200, render: (_, record) => (`${record.timeStart}${record.timeEnd}`) },
{
title: "检查状态",
dataIndex: "status",