bug修改

master
LiuJiaNan 2025-12-17 08:37:29 +08:00
parent c78332278e
commit 7e63e3b5f6
31 changed files with 804 additions and 591 deletions

View File

@ -9,7 +9,7 @@ module.exports = {
// 应用后端分支名称,部署上线需要 // 应用后端分支名称,部署上线需要
javaGitBranch: "<branch-name>", javaGitBranch: "<branch-name>",
// 接口服务地址 // 接口服务地址
API_HOST: "http://192.168.20.100:30140", API_HOST: "https://gbs-gateway.qhdsafety.com",
}, },
production: { production: {
// 应用后端分支名称,部署上线需要 // 应用后端分支名称,部署上线需要
@ -24,7 +24,8 @@ module.exports = {
contextInject: { contextInject: {
// 应用Key // 应用Key
appKey: "", appKey: "",
fileUrl: "http://192.168.20.240:9787/mnt/", // fileUrl: "http://192.168.20.240:9787/mnt/",
fileUrl: "https://jpfz.qhdsafety.com/gbsFileTest/",
}, },
// public/index.html注入全局变量 // public/index.html注入全局变量
windowInject: { windowInject: {
@ -39,9 +40,7 @@ module.exports = {
}, },
}, },
// 注入js链接集合 // 注入js链接集合
scripts: [ scripts: [],
"https://api.map.baidu.com/api?v=1.0&type=webgl&ak=OElqFYoKiAH8KFtph8ftLKF5NlNrbCUr",
],
}, },
// 开发服务 // 开发服务
server: { server: {

View File

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

View File

@ -2,7 +2,7 @@ import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
export const confirmUserList = declareRequest( export const confirmUserList = declareRequest(
"confirmUserLoading", "confirmUserLoading",
`Post > @/hidden/hiddenConfirmUser/listAll`, `Post > @/hidden/hiddenConfirmUser/list`,
); );
export const confirmUserDelete = declareRequest( export const confirmUserDelete = declareRequest(
"confirmUserLoading", "confirmUserLoading",
@ -12,7 +12,15 @@ export const confirmUserAdd = declareRequest(
"confirmUserLoading", "confirmUserLoading",
`Post > @/hidden/hiddenConfirmUser/save`, `Post > @/hidden/hiddenConfirmUser/save`,
); );
export const confirmUserUpdate = declareRequest(
"confirmUserLoading",
`Put > @/hidden/hiddenConfirmUser/edit`,
);
export const confirmUserView = declareRequest(
"confirmUserLoading",
`Get > /hidden/hiddenConfirmUser/{id}`,
);
export const confirmUserAllList = declareRequest( export const confirmUserAllList = declareRequest(
"confirmUserLoading", "confirmUserLoading",
`Post > @/hidden/hiddenConfirmUser/list`, `Post > @/hidden/hiddenConfirmUser/listAll`,
); );

View File

@ -21,5 +21,5 @@ export const evaluationTeamConfigChangeLog = declareRequest(
`Post > @/hidden/evaluateConfigUpdateRecord/list`, `Post > @/hidden/evaluateConfigUpdateRecord/list`,
); );
export const corpInfoList = declareRequest( export const corpInfoList = declareRequest(
`Post > @/basic-info/corpInfo/list`, `Post > @/basicInfo/corpInfo/list`,
); );

View File

@ -2,4 +2,6 @@
* 全局常量定义 * 全局常量定义
*/ */
export const IS_RELATED_ENUM = [{ bianma: "1", name: "是" }, { bianma: "0", name: "否" }];
export {}; export {};

View File

@ -1,3 +1,4 @@
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Form, Space } from "antd"; import { Button, Form, Space } from "antd";
import dayjs from "dayjs"; import dayjs from "dayjs";
@ -5,12 +6,12 @@ import Search from "zy-react-library/components/Search";
import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj"; import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
import DictionarySelectTree from "zy-react-library/components/SelectTree/Dictionary"; import DictionarySelectTree from "zy-react-library/components/SelectTree/Dictionary";
import HiddenLevelSelectTree from "zy-react-library/components/SelectTree/HiddenLevel/Gwj"; import HiddenLevelSelectTree from "zy-react-library/components/SelectTree/HiddenLevel/Gwj";
import HiddenPartSelectTree from "zy-react-library/components/SelectTree/HiddenPart/Gwj";
import Table from "zy-react-library/components/Table"; import Table from "zy-react-library/components/Table";
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
import { HIDDEN_RECTIFICATION_TYPE_ENUM, HIDDEN_SOURCE_ENUM } from "zy-react-library/enum/hidden/gwj"; import { HIDDEN_RECTIFICATION_TYPE_ENUM, HIDDEN_SOURCE_ENUM } from "zy-react-library/enum/hidden/gwj";
import useTable from "zy-react-library/hooks/useTable"; import useTable from "zy-react-library/hooks/useTable";
import { getLabelName } from "zy-react-library/utils"; import { getLabelName } from "zy-react-library/utils";
import { IS_RELATED_ENUM } from "~/enumerate/constant";
import { NS_ACCEPTANCE } from "~/enumerate/namespace"; import { NS_ACCEPTANCE } from "~/enumerate/namespace";
function List(props) { function List(props) {
@ -37,11 +38,6 @@ function List(props) {
label: "隐患类型", label: "隐患类型",
render: <DictionarySelectTree dictValue="hiddenType" onlyLastLevel />, render: <DictionarySelectTree dictValue="hiddenType" onlyLastLevel />,
}, },
{
name: "hiddenPart",
label: "隐患部位",
render: <HiddenPartSelectTree />,
},
{ {
name: "hiddenLevel", name: "hiddenLevel",
label: "隐患级别", label: "隐患级别",
@ -56,7 +52,7 @@ function List(props) {
name: "isRelated", name: "isRelated",
label: "是否相关方", label: "是否相关方",
render: FORM_ITEM_RENDER_ENUM.SELECT, render: FORM_ITEM_RENDER_ENUM.SELECT,
items: [{ bianma: 1, name: "是" }, { bianma: 2, name: "否" }], items: IS_RELATED_ENUM,
}, },
]} ]}
form={form} form={form}
@ -72,13 +68,12 @@ function List(props) {
{ title: "隐患描述", dataIndex: "hiddenDesc" }, { title: "隐患描述", dataIndex: "hiddenDesc" },
{ title: "隐患级别", dataIndex: "hiddenLevelName", width: 100 }, { title: "隐患级别", dataIndex: "hiddenLevelName", width: 100 },
{ title: "隐患类型", dataIndex: "hiddenTypeName" }, { title: "隐患类型", dataIndex: "hiddenTypeName" },
{ title: "隐患部位", dataIndex: "hiddenPartName" },
{ title: "隐患发现部门", dataIndex: "hiddenFindDeptName" }, { title: "隐患发现部门", dataIndex: "hiddenFindDeptName" },
{ title: "隐患发现人", dataIndex: "createName", width: 130 }, { title: "隐患发现人", dataIndex: "createName", width: 130 },
{ {
title: "隐患发现时间", title: "隐患发现时间",
dataIndex: "hiddenFindTime", dataIndex: "hiddenFindTime",
render: (_, record) => record.hiddenFindTime ? dayjs(record.hiddenFindTime).format("YYYY-MM-DD hh:mm:ss") : "", render: (_, record) => record.hiddenFindTime ? dayjs(record.hiddenFindTime).format("YYYY-MM-DD HH:mm:ss") : "",
}, },
{ {
title: "整改类型", title: "整改类型",
@ -87,32 +82,36 @@ function List(props) {
render: (_, record) => getLabelName({ list: HIDDEN_RECTIFICATION_TYPE_ENUM, status: record.rectificationType }), render: (_, record) => getLabelName({ list: HIDDEN_RECTIFICATION_TYPE_ENUM, status: record.rectificationType }),
}, },
{ title: "确认人", dataIndex: "confirmUserName", width: 100 }, { title: "确认人", dataIndex: "confirmUserName", width: 100 },
{ title: "整改人", dataIndex: "rectificationUserName", width: 100 }, { title: "整改人", dataIndex: "rectifyUserName", width: 100 },
{ title: "整改时间", dataIndex: "rectificationTime" }, { title: "整改时间", dataIndex: "rectificationTime" },
{ title: "验收人", dataIndex: "hiddenYUserName", width: 100 }, { title: "验收人", dataIndex: "hiddenYUserName", width: 100 },
{ title: "隐患状态", dataIndex: "state", render: () => "待验收" }, { title: "隐患状态", dataIndex: "state", render: () => "已整改" },
{ {
title: "操作", title: "操作",
width: 150, width: 150,
fixed: "right", fixed: "right",
render: (_, record) => ( render: (_, record) => (
<Space> <Space>
<Button {props.permission("fgs-yhys-ck") && (
type="link" <Button
onClick={() => { type="link"
props.history.push(`../HiddenView?id=${record.id}&hiddenId=${record.hiddenId}`); onClick={() => {
}} props.history.push(`../HiddenView?id=${record.id}&hiddenId=${record.hiddenId}`);
> }}
查看 >
</Button> 查看
<Button </Button>
type="link" )}
onClick={() => { {props.permission("fgs-yhys-ys") && (
props.history.push(`./review?id=${record.id}&hiddenId=${record.hiddenId}`); <Button
}} type="link"
> onClick={() => {
验收 props.history.push(`./review?id=${record.id}&hiddenId=${record.hiddenId}`);
</Button> }}
>
验收
</Button>
)}
</Space> </Space>
), ),
}, },
@ -123,4 +122,4 @@ function List(props) {
); );
} }
export default Connect([NS_ACCEPTANCE], true)(List); export default Connect([NS_ACCEPTANCE], true)(Permission(List));

View File

@ -1,5 +1,6 @@
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Divider, Form, message } from "antd"; import { Divider, Form, message } from "antd";
import { useState } from "react";
import FormBuilder from "zy-react-library/components/FormBuilder"; import FormBuilder from "zy-react-library/components/FormBuilder";
import HeaderBack from "zy-react-library/components/HeaderBack"; import HeaderBack from "zy-react-library/components/HeaderBack";
import HiddenInfo from "zy-react-library/components/HiddenInfo/gwj"; import HiddenInfo from "zy-react-library/components/HiddenInfo/gwj";
@ -8,6 +9,7 @@ import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj"; import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
import useUploadFile from "zy-react-library/hooks/useUploadFile"; import useUploadFile from "zy-react-library/hooks/useUploadFile";
import { validatorEndTime } from "zy-react-library/utils";
import { NS_ACCEPTANCE } from "~/enumerate/namespace"; import { NS_ACCEPTANCE } from "~/enumerate/namespace";
function Rectification(props) { function Rectification(props) {
@ -15,8 +17,15 @@ function Rectification(props) {
const [form] = Form.useForm(); const [form] = Form.useForm();
const status = Form.useWatch("status", form); const status = Form.useWatch("status", form);
const { loading: uploadFileLoading, uploadFile } = useUploadFile(); const { loading: uploadFileLoading, uploadFile } = useUploadFile();
const [data, setData] = useState({});
const onSubmit = async (values) => { const onSubmit = async (values) => {
await uploadFile({ single: false, files: values.files, params: { type: UPLOAD_FILE_TYPE_ENUM["5"], foreignKey: query.hiddenId } }); await uploadFile({
single: false,
files: values.files,
params: { type: UPLOAD_FILE_TYPE_ENUM["5"], foreignKey: query.hiddenId },
});
const { success } = await props["acceptanceReview"]({ const { success } = await props["acceptanceReview"]({
id: query.id, id: query.id,
hiddenId: query.hiddenId, hiddenId: query.hiddenId,
@ -30,7 +39,12 @@ function Rectification(props) {
return ( return (
<div> <div>
<HeaderBack title="隐患验收" /> <HeaderBack title="隐患验收" />
<HiddenInfo isShowHeaderBack={false} /> <HiddenInfo
isShowHeaderBack={false}
onGetData={(data) => {
setData(data);
}}
/>
<Divider orientation="left">隐患验收</Divider> <Divider orientation="left">隐患验收</Divider>
<div style={{ paddingBottom: 20 }}> <div style={{ paddingBottom: 20 }}>
<FormBuilder <FormBuilder
@ -60,7 +74,12 @@ function Rectification(props) {
status === 1 status === 1
? [ ? [
{ name: "descr", label: "验收描述" }, { name: "descr", label: "验收描述" },
{ name: "rectificationTime", label: "验收时间", render: FORM_ITEM_RENDER_ENUM.DATETIME }, {
name: "rectificationTime",
label: "验收时间",
render: FORM_ITEM_RENDER_ENUM.DATETIME,
rules: [validatorEndTime(data.rectificationTime, "验收时间不能早于整改时间")],
},
{ name: "files", label: "验收图片", required: false, render: <Upload /> }, { name: "files", label: "验收图片", required: false, render: <Upload /> },
] ]
: [] : []

View File

@ -1,3 +1,4 @@
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Form, Space } from "antd"; import { Button, Form, Space } from "antd";
import dayjs from "dayjs"; import dayjs from "dayjs";
@ -10,6 +11,7 @@ import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
import { HIDDEN_RECTIFICATION_TYPE_ENUM, HIDDEN_SOURCE_ENUM } from "zy-react-library/enum/hidden/gwj"; import { HIDDEN_RECTIFICATION_TYPE_ENUM, HIDDEN_SOURCE_ENUM } from "zy-react-library/enum/hidden/gwj";
import useTable from "zy-react-library/hooks/useTable"; import useTable from "zy-react-library/hooks/useTable";
import { getLabelName } from "zy-react-library/utils"; import { getLabelName } from "zy-react-library/utils";
import { IS_RELATED_ENUM } from "~/enumerate/constant";
import { NS_CONFIRM } from "~/enumerate/namespace"; import { NS_CONFIRM } from "~/enumerate/namespace";
function List(props) { function List(props) {
@ -46,7 +48,7 @@ function List(props) {
name: "isRelated", name: "isRelated",
label: "是否相关方", label: "是否相关方",
render: FORM_ITEM_RENDER_ENUM.SELECT, render: FORM_ITEM_RENDER_ENUM.SELECT,
items: [{ bianma: 1, name: "是" }, { bianma: 2, name: "否" }], items: IS_RELATED_ENUM,
}, },
]} ]}
form={form} form={form}
@ -67,7 +69,7 @@ function List(props) {
{ {
title: "隐患发现时间", title: "隐患发现时间",
dataIndex: "hiddenFindTime", dataIndex: "hiddenFindTime",
render: (_, record) => record.hiddenFindTime ? dayjs(record.hiddenFindTime).format("YYYY-MM-DD hh:mm:ss") : "", render: (_, record) => record.hiddenFindTime ? dayjs(record.hiddenFindTime).format("YYYY-MM-DD HH:mm:ss") : "",
}, },
{ {
title: "整改类型", title: "整改类型",
@ -83,22 +85,26 @@ function List(props) {
fixed: "right", fixed: "right",
render: (_, record) => ( render: (_, record) => (
<Space> <Space>
<Button {props.permission("fgs-yhqr-ck") && (
type="link" <Button
onClick={() => { type="link"
props.history.push(`../HiddenView?id=${record.id}&hiddenId=${record.hiddenId}`); onClick={() => {
}} props.history.push(`../HiddenView?id=${record.id}&hiddenId=${record.hiddenId}`);
> }}
查看 >
</Button> 查看
<Button </Button>
type="link" )}
onClick={() => { {props.permission("fgs-yhqr-qr") && (
props.history.push(`./review?id=${record.id}&hiddenId=${record.hiddenId}`); <Button
}} type="link"
> onClick={() => {
确认 props.history.push(`./review?id=${record.id}&hiddenId=${record.hiddenId}`);
</Button> }}
>
确认
</Button>
)}
</Space> </Space>
), ),
}, },
@ -109,4 +115,4 @@ function List(props) {
); );
} }
export default Connect([NS_CONFIRM], true)(List); export default Connect([NS_CONFIRM], true)(Permission(List));

View File

@ -12,6 +12,8 @@ import { NS_CONFIRM } from "~/enumerate/namespace";
function Confirm(props) { function Confirm(props) {
const [data, setData] = useState({}); const [data, setData] = useState({});
// 是否来自安全环保检查
const [isFromInspection, setIsFromInspection] = useState(false);
const [form] = Form.useForm(); const [form] = Form.useForm();
const hiddenLevel = Form.useWatch("hiddenLevel", form); const hiddenLevel = Form.useWatch("hiddenLevel", form);
const deptId = Form.useWatch("deptId", form); const deptId = Form.useWatch("deptId", form);
@ -45,6 +47,16 @@ function Confirm(props) {
isShowHeaderBack={false} isShowHeaderBack={false}
onGetData={(data) => { onGetData={(data) => {
setData(data); setData(data);
setIsFromInspection(data.source === 4 || data.source === 5);
const hiddenUserPresetsCO = data.hiddenUserPresetsCO || {};
form.setFieldValue("deptId", hiddenUserPresetsCO.rectifyDeptId || data.hiddenFindDept);
form.setFieldValue("deptName", hiddenUserPresetsCO.rectifyDeptName || data.hiddenFindDeptName);
form.setFieldValue("userId", hiddenUserPresetsCO.rectifyUserId || data.creatorId);
form.setFieldValue("userName", hiddenUserPresetsCO.rectifyUserName || data.creatorName);
form.setFieldValue("checkDeptId", hiddenUserPresetsCO.rectifyDeptId || data.hiddenFindDept);
form.setFieldValue("checkDeptName", hiddenUserPresetsCO.rectifyDeptName || data.hiddenFindDeptName);
form.setFieldValue("checkUserId", hiddenUserPresetsCO.rectifyUserId || data.creatorId);
form.setFieldValue("checkUserName", hiddenUserPresetsCO.rectifyUserName || data.creatorName);
}} }}
/> />
<Divider orientation="left">隐患确认</Divider> <Divider orientation="left">隐患确认</Divider>
@ -56,31 +68,36 @@ function Confirm(props) {
submitButtonText="通过" submitButtonText="通过"
onFinish={onSubmit} onFinish={onSubmit}
extraActionButtons={[ extraActionButtons={[
<Button key="reject" type="primary" danger onClick={() => setRejectModalOpen(true)}>打回</Button>, !isFromInspection && <Button key="reject" type="primary" danger onClick={() => setRejectModalOpen(true)}>打回</Button>,
]} ]}
options={[ options={[
{ ...(!isFromInspection
name: "hiddenLevel", ? [
label: "隐患级别", {
span: 24, name: "hiddenLevel",
render: ( label: "隐患级别",
<HiddenLevelSelectTree span: 24,
isShowMajor={false} render: (
isShowLarger={false} <HiddenLevelSelectTree
onChange={() => { isShowMajor={false}
form.setFieldValue("deptName", ""); isShowLarger={false}
form.setFieldValue("userName", ""); isShowNeglect={data.rectificationType === 1}
form.setFieldValue("deptName", ""); onChange={() => {
form.setFieldValue("userName", ""); form.setFieldValue("deptName", "");
form.setFieldValue("checkDeptName", ""); form.setFieldValue("userName", "");
form.setFieldValue("checkUserName", ""); form.setFieldValue("deptName", "");
}} form.setFieldValue("userName", "");
onGetLabel={(label) => { form.setFieldValue("checkDeptName", "");
form.setFieldValue("hiddenLevelName", label); form.setFieldValue("checkUserName", "");
}} }}
/> onGetLabel={(label) => {
), form.setFieldValue("hiddenLevelName", label);
}, }}
/>
),
},
]
: []),
{ name: "hiddenLevelName", label: "隐患级别名称", onlyForLabel: true }, { name: "hiddenLevelName", label: "隐患级别名称", onlyForLabel: true },
...( ...(
hiddenLevel !== "hiddenLevel1001" hiddenLevel !== "hiddenLevel1001"

View File

@ -1,6 +1,7 @@
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Form, message, Modal } from "antd"; import { Button, Form, message, Modal, Space } from "antd";
import { useState } from "react"; import { useEffect, useState } from "react";
import FormBuilder from "zy-react-library/components/FormBuilder"; import FormBuilder from "zy-react-library/components/FormBuilder";
import AddIcon from "zy-react-library/components/Icon/AddIcon"; import AddIcon from "zy-react-library/components/Icon/AddIcon";
import Search from "zy-react-library/components/Search"; import Search from "zy-react-library/components/Search";
@ -13,6 +14,7 @@ import { NS_CONFIRM_USER } from "~/enumerate/namespace";
function HiddenConfirmUser(props) { function HiddenConfirmUser(props) {
const [form] = Form.useForm(); const [form] = Form.useForm();
const [addModalOpen, setAddModalOpen] = useState(false); const [addModalOpen, setAddModalOpen] = useState(false);
const [currentId, setCurrentId] = useState("");
const { tableProps, getData } = useTable(props["confirmUserList"], { const { tableProps, getData } = useTable(props["confirmUserList"], {
form, form,
transform: formData => ({ transform: formData => ({
@ -40,7 +42,6 @@ function HiddenConfirmUser(props) {
<Search <Search
labelCol={{ span: 4 }} labelCol={{ span: 4 }}
options={[ options={[
{ name: "likeName", label: "用户名" },
{ name: "likeUserName", label: "姓名" }, { name: "likeUserName", label: "姓名" },
{ name: "eqDeptId", label: "部门", render: <DepartmentSelectTree /> }, { name: "eqDeptId", label: "部门", render: <DepartmentSelectTree /> },
]} ]}
@ -50,34 +51,58 @@ function HiddenConfirmUser(props) {
<Table <Table
toolBarRender={() => ( toolBarRender={() => (
<> <>
<Button {props.permission("fgs-yhqrr-xz") && (
type="primary" <Button
icon={<AddIcon />} type="primary"
onClick={() => { icon={<AddIcon />}
setAddModalOpen(true); onClick={() => {
}} setAddModalOpen(true);
> }}
新增 >
</Button> 新增
</Button>
)}
</> </>
)} )}
columns={[ columns={[
{ title: "用户名", dataIndex: "name" },
{ title: "姓名", dataIndex: "userName" },
{ title: "部门", dataIndex: "deptName" }, { title: "部门", dataIndex: "deptName" },
{ title: "岗位", dataIndex: "postName" }, { title: "岗位", dataIndex: "postName" },
{ title: "姓名", dataIndex: "name" },
{ title: "手机号", dataIndex: "userName" },
{ {
title: "操作", title: "操作",
width: 100, width: 120,
fixed: "right", fixed: "right",
render: (_, record) => ( render: (_, record) => (
<Button type="link" danger onClick={() => onDelete(record.id)}>删除</Button> <Space>
{props.permission("fgs-yhqrr-bj") && (
<Button
type="link"
onClick={() => {
setAddModalOpen(true);
setCurrentId(record.id);
}}
>
编辑
</Button>
)}
{props.permission("fgs-yhqrr-sc") && <Button type="link" danger onClick={() => onDelete(record.id)}>删除</Button>}
</Space>
), ),
}, },
]} ]}
{...tableProps} {...tableProps}
/> />
{addModalOpen && <AddModal onCancel={() => setAddModalOpen(false)} getData={getData} />} {addModalOpen && (
<AddModal
id={currentId}
onCancel={() => {
setAddModalOpen(false);
setCurrentId("");
}}
getData={getData}
/>
)}
</div> </div>
); );
} }
@ -85,8 +110,24 @@ function HiddenConfirmUser(props) {
const AddModalComponent = (props) => { const AddModalComponent = (props) => {
const [form] = Form.useForm(); const [form] = Form.useForm();
const deptId = Form.useWatch("deptId", form); const deptId = Form.useWatch("deptId", form);
const getData = async () => {
const { data } = await props["confirmUserView"]({ id: props.id });
form.setFieldsValue({
...data,
confirmRange: data.confirmRange.split(","),
confirmRangeName: data.confirmRangeName.split(","),
});
};
useEffect(() => {
props.id && getData();
}, []);
const onSubmit = async (values) => { const onSubmit = async (values) => {
const { success } = await props["confirmUserAdd"]({ ...values }); const { success } = await props[!props.id ? "confirmUserAdd" : "confirmUserUpdate"]({
...values,
confirmRange: values.confirmRange.join(","),
confirmRangeName: values.confirmRangeName.join(","),
id: props.id,
});
if (success) { if (success) {
message.success("操作成功"); message.success("操作成功");
props.onCancel(); props.onCancel();
@ -107,7 +148,7 @@ const AddModalComponent = (props) => {
<FormBuilder <FormBuilder
form={form} form={form}
span={24} span={24}
labelCol={{ span: 8 }} labelCol={{ span: 10 }}
showActionButtons={false} showActionButtons={false}
onFinish={onSubmit} onFinish={onSubmit}
options={[ options={[
@ -116,6 +157,7 @@ const AddModalComponent = (props) => {
label: "部门", label: "部门",
render: ( render: (
<DepartmentSelectTree <DepartmentSelectTree
disabled={props.id}
onChange={() => { onChange={() => {
form.setFieldValue("userId", []); form.setFieldValue("userId", []);
form.setFieldValue("confirmUsers", []); form.setFieldValue("confirmUsers", []);
@ -132,21 +174,35 @@ const AddModalComponent = (props) => {
label: "隐患确认人", label: "隐患确认人",
render: ( render: (
<PersonnelSelect <PersonnelSelect
mode="multiple" disabled={props.id}
params={{ departmentId: deptId }} params={{ departmentId: deptId }}
onGetOption={(option) => { onGetOption={(option) => {
form.setFieldValue("confirmUsers", option.map(item => ({ form.setFieldValue("name", option.name);
name: item.name, form.setFieldValue("userName", option.username);
userName: item.username, form.setFieldValue("postName", option.postName);
userId: item.id, form.setFieldValue("postId", option.postId);
postName: item.postName,
postId: item.postId,
})));
}} }}
/> />
), ),
}, },
{ name: "confirmUsers", label: "确认人信息", onlyForLabel: true }, { name: "name", label: "确认人", onlyForLabel: true },
{ name: "userName", label: "确认人", onlyForLabel: true },
{ name: "postName", label: "确认人", onlyForLabel: true },
{ name: "postId", label: "确认人", onlyForLabel: true },
{
name: "confirmRange",
label: "确认范围(部门)",
render: (
<DepartmentSelectTree
treeCheckable
treeCheckStrictly
onGetLabel={(label) => {
form.setFieldValue("confirmRangeName", label);
}}
/>
),
},
{ name: "confirmRangeName", label: "确认范围(部门)", onlyForLabel: true },
]} ]}
/> />
</Modal> </Modal>
@ -154,4 +210,4 @@ const AddModalComponent = (props) => {
}; };
const AddModal = Connect([NS_CONFIRM_USER], true)(AddModalComponent); const AddModal = Connect([NS_CONFIRM_USER], true)(AddModalComponent);
export default Connect([NS_CONFIRM_USER], true)(HiddenConfirmUser); export default Connect([NS_CONFIRM_USER], true)(Permission(HiddenConfirmUser));

View File

@ -1,3 +1,4 @@
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Form, Space } from "antd"; import { Button, Form, Space } from "antd";
import dayjs from "dayjs"; import dayjs from "dayjs";
@ -10,6 +11,7 @@ import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
import { HIDDEN_SOURCE_ENUM } from "zy-react-library/enum/hidden/gwj"; import { HIDDEN_SOURCE_ENUM } from "zy-react-library/enum/hidden/gwj";
import useTable from "zy-react-library/hooks/useTable"; import useTable from "zy-react-library/hooks/useTable";
import { getLabelName } from "zy-react-library/utils"; import { getLabelName } from "zy-react-library/utils";
import { IS_RELATED_ENUM } from "~/enumerate/constant";
import { NS_IGNORE } from "~/enumerate/namespace"; import { NS_IGNORE } from "~/enumerate/namespace";
function List(props) { function List(props) {
@ -46,7 +48,7 @@ function List(props) {
name: "isRelated", name: "isRelated",
label: "是否相关方", label: "是否相关方",
render: FORM_ITEM_RENDER_ENUM.SELECT, render: FORM_ITEM_RENDER_ENUM.SELECT,
items: [{ bianma: 1, name: "是" }, { bianma: 2, name: "否" }], items: IS_RELATED_ENUM,
}, },
]} ]}
form={form} form={form}
@ -67,13 +69,13 @@ function List(props) {
{ {
title: "隐患发现时间", title: "隐患发现时间",
dataIndex: "hiddenFindTime", dataIndex: "hiddenFindTime",
render: (_, record) => record.hiddenFindTime ? dayjs(record.hiddenFindTime).format("YYYY-MM-DD hh:mm:ss") : "", render: (_, record) => record.hiddenFindTime ? dayjs(record.hiddenFindTime).format("YYYY-MM-DD HH:mm:ss") : "",
}, },
{ title: "确认人", dataIndex: "confirmUserName", width: 100 }, { title: "确认人", dataIndex: "confirmUserName", width: 100 },
{ {
title: "确认时间", title: "确认时间",
dataIndex: "confirmTime", dataIndex: "confirmTime",
render: (_, record) => record.confirmTime ? dayjs(record.confirmTime).format("YYYY-MM-DD hh:mm:ss") : "", render: (_, record) => record.confirmTime ? dayjs(record.confirmTime).format("YYYY-MM-DD HH:mm:ss") : "",
}, },
{ title: "隐患状态", dataIndex: "state", render: () => "已忽略" }, { title: "隐患状态", dataIndex: "state", render: () => "已忽略" },
{ {
@ -82,14 +84,16 @@ function List(props) {
fixed: "right", fixed: "right",
render: (_, record) => ( render: (_, record) => (
<Space> <Space>
<Button {props.permission("fgs-lhyh-ck") && (
type="link" <Button
onClick={() => { type="link"
props.history.push(`../HiddenView?id=${record.id}&hiddenId=${record.hiddenId}`); onClick={() => {
}} props.history.push(`../HiddenView?id=${record.id}&hiddenId=${record.hiddenId}`);
> }}
查看 >
</Button> 查看
</Button>
)}
</Space> </Space>
), ),
}, },
@ -100,4 +104,4 @@ function List(props) {
); );
} }
export default Connect([NS_IGNORE], true)(List); export default Connect([NS_IGNORE], true)(Permission(List));

View File

@ -19,8 +19,9 @@ import useGetFile from "zy-react-library/hooks/useGetFile";
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
import useGetUserInfo from "zy-react-library/hooks/useGetUserInfo"; import useGetUserInfo from "zy-react-library/hooks/useGetUserInfo";
import useUploadFile from "zy-react-library/hooks/useUploadFile"; import useUploadFile from "zy-react-library/hooks/useUploadFile";
import { createGuid, getFileUrl, getLabelName } from "zy-react-library/utils"; import { createGuid, getLabelName } from "zy-react-library/utils";
import ai_recognize from "~/assets/images/ai_recognize.png"; import ai_recognize from "~/assets/images/ai_recognize.png";
import { IS_RELATED_ENUM } from "~/enumerate/constant";
import { NS_CONFIRM_USER, NS_LEDGER, NS_PART } from "~/enumerate/namespace"; import { NS_CONFIRM_USER, NS_LEDGER, NS_PART } from "~/enumerate/namespace";
function Add(props) { function Add(props) {
@ -31,7 +32,7 @@ function Add(props) {
const checkDeptId = Form.useWatch("checkDeptId", form); const checkDeptId = Form.useWatch("checkDeptId", form);
const isAi = Form.useWatch("isAi", form); const isAi = Form.useWatch("isAi", form);
const isRelated = Form.useWatch("isRelated", form); const isRelated = Form.useWatch("isRelated", form);
const defaultValues = { isRelated: 2, rectificationType: 2 }; const defaultValues = { isRelated: "0", rectificationType: 2 };
const [aiHiddens, setAiHiddens] = useState([]); const [aiHiddens, setAiHiddens] = useState([]);
const [aiHiddenModalOpen, setAiHiddenModalOpen] = useState(false); const [aiHiddenModalOpen, setAiHiddenModalOpen] = useState(false);
@ -50,6 +51,8 @@ function Add(props) {
const deleteHiddenVideoFiles = useRef([]); const deleteHiddenVideoFiles = useRef([]);
const deleteAfterRectificationImageFiles = useRef([]); const deleteAfterRectificationImageFiles = useRef([]);
const hiddenUserId = useRef("");
const { getUserInfo } = useGetUserInfo(); const { getUserInfo } = useGetUserInfo();
const { loading: deleteFileLoading, deleteFile } = useDeleteFile(); const { loading: deleteFileLoading, deleteFile } = useDeleteFile();
const { loading: uploadFileLoading, uploadFile } = useUploadFile(); const { loading: uploadFileLoading, uploadFile } = useUploadFile();
@ -60,27 +63,34 @@ function Add(props) {
const { data } = await props["hiddenView"]({ id: query.id }); const { data } = await props["hiddenView"]({ id: query.id });
const hiddenImageFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["3"], eqForeignKey: query.hiddenId }); const hiddenImageFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["3"], eqForeignKey: query.hiddenId });
const hiddenVideoFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["102"], eqForeignKey: query.hiddenId }); const hiddenVideoFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["102"], eqForeignKey: query.hiddenId });
const afterRectificationImageFiles = await getFile({ const hiddenRectifyUserCO = data?.hiddenRectifyUserCO?.[0] || {};
eqType: UPLOAD_FILE_TYPE_ENUM["4"], const hiddenAcceptUserCO = data?.hiddenAcceptUserCO?.[0] || {};
eqForeignKey: query.hiddenId, const hiddenConfirmUserCO = data?.hiddenConfirmUserCO?.[0] || {};
}); let afterRectificationImageFiles = [];
const values = { if (hiddenRectifyUserCO.hiddenUserId) {
afterRectificationImageFiles = await getFile({
eqType: UPLOAD_FILE_TYPE_ENUM["4"],
eqForeignKey: hiddenRectifyUserCO.hiddenUserId,
});
}
form.setFieldsValue({
...data,
hiddenImageFiles, hiddenImageFiles,
hiddenVideoFiles, hiddenVideoFiles,
afterRectificationImageFiles, afterRectificationImageFiles,
confirmUserId: data.confirmUserCO?.userId, confirmUserId: hiddenConfirmUserCO.userId,
rectificationDeptId: data.hiddenUserPresetsCO?.rectifyDeptId, rectificationDeptId: hiddenRectifyUserCO.deptId,
rectificationUserId: data.hiddenUserPresetsCO?.rectifyUserId, rectificationDeptName: hiddenRectifyUserCO.deptName,
...data, rectificationUserId: hiddenRectifyUserCO.userId,
}; rectificationUserName: hiddenRectifyUserCO.userName,
form.setFieldsValue({ rectificationDescr: hiddenRectifyUserCO.descr,
...values, checkDeptId: hiddenAcceptUserCO.deptId,
confirmUserName: data.confirmUserCO?.userName, checkDeptName: hiddenAcceptUserCO.deptName,
confirmDeptName: data.confirmUserCO?.deptName, checkUserId: hiddenAcceptUserCO.userId,
confirmDeptId: data.confirmUserCO?.deptId, checkUserName: hiddenAcceptUserCO.userName,
rectificationDeptName: data.hiddenUserPresetsCO?.rectifyDeptName, isRelated: data.isRelated.toString(),
rectificationUserName: data.hiddenUserPresetsCO?.rectifyUserName,
}); });
hiddenUserId.current = hiddenRectifyUserCO.hiddenUserId;
} }
else { else {
const userInfo = await getUserInfo(); const userInfo = await getUserInfo();
@ -114,15 +124,15 @@ function Add(props) {
}; };
const getAIHiddenImageRecognize = async (imageToProcess) => { const getAIHiddenImageRecognize = async (imageToProcess) => {
const { filePath } = await uploadFile({ files: [imageToProcess], params: { type: UPLOAD_FILE_TYPE_ENUM["3"] } }); // const { filePath } = await uploadFile({ files: [imageToProcess], params: { type: UPLOAD_FILE_TYPE_ENUM["3"] } });
// const { data } = await props["hiddenAiRecognize"]({ hiddenUrl: "https://pic.rmb.bdstatic.com/bjh/news/0a68c2681805fcaea506d922f024420c.png" }); const { data } = await props["hiddenAiRecognize"]({ hiddenUrl: "https://pic.rmb.bdstatic.com/bjh/news/0a68c2681805fcaea506d922f024420c.png" });
const { data } = await props["hiddenAiRecognize"]({ hiddenUrl: getFileUrl() + filePath }); // const { data } = await props["hiddenAiRecognize"]({ hiddenUrl: getFileUrl() + filePath });
if (data?.aiHiddens) { if (data?.aiHiddens) {
processedImageUids.current.push(imageToProcess.uid); processedImageUids.current.push(imageToProcess.uid);
setAiHiddens(data?.aiHiddens.map(item => ({ ...JSON.parse(item), id: createGuid() }))); setAiHiddens(data?.aiHiddens.map(item => ({ ...JSON.parse(item), id: createGuid() })));
setAiHiddenModalOpen(true); setAiHiddenModalOpen(true);
clearHiddenRecognizeState(); clearHiddenRecognizeState();
await deleteFile({ files: [{ filePath }] }); // await deleteFile({ files: [{ filePath }] });
} }
}; };
@ -198,13 +208,15 @@ function Add(props) {
files: values.hiddenVideoFiles, files: values.hiddenVideoFiles,
params: { type: UPLOAD_FILE_TYPE_ENUM["102"], foreignKey: id }, params: { type: UPLOAD_FILE_TYPE_ENUM["102"], foreignKey: id },
}); });
await uploadFile({ const { id: afterRectificationImageId } = await uploadFile({
single: false, single: false,
files: values.afterRectificationImageFiles, files: values.afterRectificationImageFiles,
params: { type: UPLOAD_FILE_TYPE_ENUM["4"], foreignKey: id }, params: { type: UPLOAD_FILE_TYPE_ENUM["4"], foreignKey: hiddenUserId.current },
}); });
let hiddenPart = values.hiddenPart;
if (hiddenPartType === "input") { if (hiddenPartType === "input") {
await props["partAdd"]({ hiddenregion: values.hiddenPart }); const { data } = await props["partAdd"]({ hiddenregion: values.hiddenPart });
hiddenPart = data;
} }
const hiddenImageFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["3"], eqForeignKey: id }); const hiddenImageFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["3"], eqForeignKey: id });
const { success } = await props[!query.id ? "hiddenAdd" : "hiddenEdit"]({ const { success } = await props[!query.id ? "hiddenAdd" : "hiddenEdit"]({
@ -220,6 +232,8 @@ function Add(props) {
extension: 1, // 延期 0否1是 extension: 1, // 延期 0否1是
}), }),
hiddenImgAddCmds: hiddenImageFiles.map(item => ({ url: item.url })), hiddenImgAddCmds: hiddenImageFiles.map(item => ({ url: item.url })),
hiddenUserId: afterRectificationImageId,
hiddenPart,
}); });
if (success) { if (success) {
message.success("操作成功"); message.success("操作成功");
@ -235,12 +249,12 @@ function Add(props) {
form.setFieldsValue({ form.setFieldsValue({
...resetValues, ...resetValues,
...defaultValues, ...defaultValues,
isAi: 1,
hiddenImageFiles, hiddenImageFiles,
hiddenDesc: selectHiddens[currentProcessHiddenIndex + 1].hiddenDescr,
legalBasis: selectHiddens[currentProcessHiddenIndex + 1].legalBasis,
rectificationDescr: selectHiddens[currentProcessHiddenIndex + 1].rectificationSuggestions,
}); });
form.setFieldValue("isAi", 1);
form.setFieldValue("hiddenDesc", selectHiddens[currentProcessHiddenIndex + 1].hiddenDescr);
form.setFieldValue("legalBasis", selectHiddens[currentProcessHiddenIndex + 1].legalBasis);
form.setFieldValue("rectificationDescr", selectHiddens[currentProcessHiddenIndex + 1].rectificationSuggestions);
} }
else { else {
props.history.goBack(); props.history.goBack();
@ -315,8 +329,9 @@ function Add(props) {
render: FORM_ITEM_RENDER_ENUM.TEXTAREA, render: FORM_ITEM_RENDER_ENUM.TEXTAREA,
span: 24, span: 24,
required: false, required: false,
useConstraints: false,
hidden: !(isAi === 1), hidden: !(isAi === 1),
componentProps: { disabled: true }, componentProps: { disabled: true, maxLength: 9999 },
}, },
{ {
name: "hiddenLevel", name: "hiddenLevel",
@ -351,7 +366,7 @@ function Add(props) {
name: "isRelated", name: "isRelated",
label: "是否相关方", label: "是否相关方",
render: FORM_ITEM_RENDER_ENUM.RADIO, render: FORM_ITEM_RENDER_ENUM.RADIO,
items: [{ bianma: 1, name: "是" }, { bianma: 2, name: "否" }], items: IS_RELATED_ENUM,
componentProps: { componentProps: {
onChange: () => { onChange: () => {
form.setFieldValue("projectName", ""); form.setFieldValue("projectName", "");
@ -360,9 +375,9 @@ function Add(props) {
form.setFieldValue("rectificationUserId", ""); form.setFieldValue("rectificationUserId", "");
form.setFieldValue("rectificationUserName", ""); form.setFieldValue("rectificationUserName", "");
form.setFieldValue("checkDeptId", ""); form.setFieldValue("checkDeptId", "");
form.setFieldValue("hiddenYDeptName", ""); form.setFieldValue("checkDeptName", "");
form.setFieldValue("checkUserId", ""); form.setFieldValue("checkUserId", "");
form.setFieldValue("hiddenYUserName", ""); form.setFieldValue("checkUserName", "");
}, },
}, },
}, },
@ -370,7 +385,7 @@ function Add(props) {
name: "projectId", name: "projectId",
label: "相关方项目", label: "相关方项目",
dependencies: ["isRelated"], dependencies: ["isRelated"],
hidden: formValues => !(formValues.isRelated === 1), hidden: formValues => !(formValues.isRelated === "1"),
render: FORM_ITEM_RENDER_ENUM.SELECT, render: FORM_ITEM_RENDER_ENUM.SELECT,
items: [{ bianma: 1, name: "相关方未做" }, { bianma: 2, name: "后期补全" }], // TODO items: [{ bianma: 1, name: "相关方未做" }, { bianma: 2, name: "后期补全" }], // TODO
componentProps: { componentProps: {
@ -388,13 +403,12 @@ function Add(props) {
span: 24, span: 24,
customizeRender: true, customizeRender: true,
render: ( render: (
<Form.Item label="隐患部位" required labelCol={{ span: 2 }} wrapperCol={{ span: 22 }}> <Form.Item label="隐患部位" labelCol={{ span: 2 }} wrapperCol={{ span: 22 }}>
<div style={{ display: "flex", gap: 10 }}> <div style={{ display: "flex", gap: 10 }}>
<Form.Item <Form.Item
name="hiddenPart" name="hiddenPart"
noStyle noStyle
rules={[ rules={[
{ required: true, message: "请选择隐患部位" },
...(hiddenPartType === "input" ? [{ max: 50, message: "最多输入50字符" }] : []), ...(hiddenPartType === "input" ? [{ max: 50, message: "最多输入50字符" }] : []),
]} ]}
> >
@ -469,11 +483,11 @@ function Add(props) {
label: "隐患确认人", label: "隐患确认人",
render: FORM_ITEM_RENDER_ENUM.SELECT, render: FORM_ITEM_RENDER_ENUM.SELECT,
items: confirmUserList, items: confirmUserList,
itemsField: { valueKey: "userId", labelKey: "userName" }, itemsField: { valueKey: "userId", labelKey: "name" },
componentProps: { componentProps: {
onChange: (value) => { onChange: (value) => {
const findItem = confirmUserList.find(item => item.userId === value); const findItem = confirmUserList.find(item => item.userId === value);
form.setFieldValue("confirmUserName", findItem.userName); form.setFieldValue("confirmUserName", findItem.name);
form.setFieldValue("confirmDeptName", findItem.deptName); form.setFieldValue("confirmDeptName", findItem.deptName);
form.setFieldValue("confirmDeptId", findItem.deptId); form.setFieldValue("confirmDeptId", findItem.deptId);
}, },
@ -490,13 +504,16 @@ function Add(props) {
span: 24, span: 24,
componentProps: { componentProps: {
onChange: (value) => { onChange: (value) => {
if (isAi === 1) {
form.setFieldValue("rectificationDescr", selectHiddens[currentProcessHiddenIndex + 1].rectificationSuggestions);
}
if (value.target.value === 2) { if (value.target.value === 2) {
form.setFieldValue("rectificationDeptId", ""); form.setFieldValue("rectificationDeptId", "");
form.setFieldValue("rectificationUserId", ""); form.setFieldValue("rectificationUserId", "");
form.setFieldValue("rectificationDeptName", ""); form.setFieldValue("rectificationDeptName", "");
form.setFieldValue("rectificationUserName", ""); form.setFieldValue("rectificationUserName", "");
form.setFieldValue("hiddenYDeptName", ""); form.setFieldValue("checkDeptName", "");
form.setFieldValue("hiddenYUserName", ""); form.setFieldValue("checkUserName", "");
} }
else { else {
const hiddenFindDept = form.getFieldValue("hiddenFindDept"); const hiddenFindDept = form.getFieldValue("hiddenFindDept");
@ -509,8 +526,8 @@ function Add(props) {
form.setFieldValue("checkUserId", creatorId); form.setFieldValue("checkUserId", creatorId);
form.setFieldValue("rectificationDeptName", hiddenFindDeptName); form.setFieldValue("rectificationDeptName", hiddenFindDeptName);
form.setFieldValue("rectificationUserName", creatorName); form.setFieldValue("rectificationUserName", creatorName);
form.setFieldValue("hiddenYDeptName", hiddenFindDeptName); form.setFieldValue("checkDeptName", hiddenFindDeptName);
form.setFieldValue("hiddenYUserName", creatorName); form.setFieldValue("checkUserName", creatorName);
} }
}, },
}, },
@ -547,10 +564,10 @@ function Add(props) {
}, },
{ {
name: "rectificationDeptId", name: "rectificationDeptId",
label: isRelated === 2 ? "整改部门" : "整改单位", label: isRelated === "0" ? "整改部门" : "整改单位",
required: false, required: false,
render: ( render: (
isRelated === 2 && ( isRelated === "0" && (
<DepartmentSelectTree <DepartmentSelectTree
onChange={() => { onChange={() => {
form.setFieldValue("rectificationUserId", ""); form.setFieldValue("rectificationUserId", "");
@ -563,7 +580,7 @@ function Add(props) {
) )
), ),
componentProps: { componentProps: {
disabled: isRelated === 1, disabled: isRelated === "1",
}, },
}, },
{ name: "rectificationDeptName", label: "整改部门名称", onlyForLabel: true }, { name: "rectificationDeptName", label: "整改部门名称", onlyForLabel: true },
@ -572,7 +589,7 @@ function Add(props) {
label: "整改人", label: "整改人",
required: false, required: false,
render: ( render: (
isRelated === 2 && ( isRelated === "0" && (
<PersonnelSelect <PersonnelSelect
params={{ departmentId: rectificationDeptId }} params={{ departmentId: rectificationDeptId }}
onGetLabel={label => form.setFieldValue("rectificationUserName", label)} onGetLabel={label => form.setFieldValue("rectificationUserName", label)}
@ -580,53 +597,53 @@ function Add(props) {
) )
), ),
componentProps: { componentProps: {
disabled: isRelated === 1, disabled: isRelated === "1",
}, },
}, },
{ name: "rectificationUserName", label: "整改人名称", onlyForLabel: true }, { name: "rectificationUserName", label: "整改人名称", onlyForLabel: true },
{ {
name: "checkDeptId", name: "checkDeptId",
label: isRelated === 2 ? "验收部门" : "验收单位", label: isRelated === "0" ? "验收部门" : "验收单位",
required: false, required: false,
render: ( render: (
isRelated === 2 && ( isRelated === "0" && (
<DepartmentSelectTree <DepartmentSelectTree
onChange={() => { onChange={() => {
form.setFieldValue("checkUserId", ""); form.setFieldValue("checkUserId", "");
form.setFieldValue("hiddenYUserName", ""); form.setFieldValue("checkUserName", "");
}} }}
onGetLabel={(label) => { onGetLabel={(label) => {
form.setFieldValue("hiddenYDeptName", label); form.setFieldValue("checkDeptName", label);
}} }}
/> />
) )
), ),
componentProps: { componentProps: {
disabled: isRelated === 1, disabled: isRelated === "1",
}, },
dependencies: ["rectificationType"], dependencies: ["rectificationType"],
hidden: formValues => !(formValues.rectificationType === 1), hidden: formValues => !(formValues.rectificationType === 1),
}, },
{ name: "hiddenYDeptName", label: "验收部门名称", onlyForLabel: true }, { name: "checkDeptName", label: "验收部门名称", onlyForLabel: true },
{ {
name: "checkUserId", name: "checkUserId",
label: "验收人", label: "验收人",
required: false, required: false,
render: ( render: (
isRelated === 2 && ( isRelated === "0" && (
<PersonnelSelect <PersonnelSelect
params={{ departmentId: checkDeptId }} params={{ departmentId: checkDeptId }}
onGetLabel={label => form.setFieldValue("hiddenYUserName", label)} onGetLabel={label => form.setFieldValue("checkUserName", label)}
/> />
) )
), ),
componentProps: { componentProps: {
disabled: isRelated === 1, disabled: isRelated === "1",
}, },
dependencies: ["rectificationType"], dependencies: ["rectificationType"],
hidden: formValues => !(formValues.rectificationType === 1), hidden: formValues => !(formValues.rectificationType === 1),
}, },
{ name: "hiddenYUserName", label: "验收人名称", onlyForLabel: true }, { name: "checkUserName", label: "验收人名称", onlyForLabel: true },
]} ]}
/> />
</div> </div>
@ -689,7 +706,9 @@ const AiHiddenModal = (props) => {
title: "合并隐患", title: "合并隐患",
content: "确定要合并所选的隐患吗?", content: "确定要合并所选的隐患吗?",
onOk: () => { onOk: () => {
props.onConfirm(selectedRowKeys); props.onMergeHidden(selectedRowKeys);
setSelectedRowKeys([]);
setSelectedRows([]);
}, },
}); });
}} }}

View File

@ -1,3 +1,4 @@
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Form, message, Modal, Space, Spin } from "antd"; import { Button, Form, message, Modal, Space, Spin } from "antd";
import dayjs from "dayjs"; import dayjs from "dayjs";
@ -11,13 +12,13 @@ import Search from "zy-react-library/components/Search";
import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj"; import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
import DictionarySelectTree from "zy-react-library/components/SelectTree/Dictionary"; import DictionarySelectTree from "zy-react-library/components/SelectTree/Dictionary";
import HiddenLevelSelectTree from "zy-react-library/components/SelectTree/HiddenLevel/Gwj"; import HiddenLevelSelectTree from "zy-react-library/components/SelectTree/HiddenLevel/Gwj";
import HiddenPartSelectTree from "zy-react-library/components/SelectTree/HiddenPart/Gwj";
import Table from "zy-react-library/components/Table"; import Table from "zy-react-library/components/Table";
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
import { HIDDEN_RECTIFICATION_TYPE_ENUM, HIDDEN_SOURCE_ENUM, HIDDEN_STATE_ENUM } from "zy-react-library/enum/hidden/gwj"; import { HIDDEN_RECTIFICATION_TYPE_ENUM, HIDDEN_SOURCE_ENUM, HIDDEN_STATE_ENUM } from "zy-react-library/enum/hidden/gwj";
import useDownloadBlob from "zy-react-library/hooks/useDownloadBlob"; import useDownloadBlob from "zy-react-library/hooks/useDownloadBlob";
import useTable from "zy-react-library/hooks/useTable"; import useTable from "zy-react-library/hooks/useTable";
import { getLabelName } from "zy-react-library/utils"; import { getLabelName } from "zy-react-library/utils";
import { IS_RELATED_ENUM } from "~/enumerate/constant";
import { NS_LEDGER } from "~/enumerate/namespace"; import { NS_LEDGER } from "~/enumerate/namespace";
import "./index.less"; import "./index.less";
@ -86,11 +87,6 @@ function List(props) {
label: "隐患类型", label: "隐患类型",
render: <DictionarySelectTree dictValue="hiddenType" onlyLastLevel />, render: <DictionarySelectTree dictValue="hiddenType" onlyLastLevel />,
}, },
{
name: "hiddenPart",
label: "隐患部位",
render: <HiddenPartSelectTree />,
},
{ {
name: "hiddenLevel", name: "hiddenLevel",
label: "隐患级别", label: "隐患级别",
@ -108,7 +104,13 @@ function List(props) {
name: "isRelated", name: "isRelated",
label: "是否相关方", label: "是否相关方",
render: FORM_ITEM_RENDER_ENUM.SELECT, render: FORM_ITEM_RENDER_ENUM.SELECT,
items: [{ bianma: 1, name: "是" }, { bianma: 2, name: "否" }], items: IS_RELATED_ENUM,
},
{
name: "isAi",
label: "是否使用AI",
render: FORM_ITEM_RENDER_ENUM.SELECT,
items: [{ bianma: "1", name: "是" }, { bianma: "0", name: "否" }],
}, },
]} ]}
form={form} form={form}
@ -124,56 +126,64 @@ function List(props) {
}} }}
toolBarRender={() => ( toolBarRender={() => (
<> <>
<Button {props.permission("fgs-tz-add") && (
type="primary" <Button
icon={<AddIcon />} type="primary"
onClick={() => { icon={<AddIcon />}
props.history.push("./add"); onClick={() => {
}} props.history.push("./add");
> }}
新增 >
</Button> 新增
<Button </Button>
type="primary" )}
icon={<PrintIcon />} {props.permission("fgs-tz-dy") && (
onClick={() => { <Button
if (selectedRowKeys.length === 0) { type="primary"
message.error("请选中要打印的数据"); icon={<PrintIcon />}
return; onClick={() => {
} if (selectedRowKeys.length === 0) {
setPrintModalOpen(true); message.error("请选中要打印的数据");
setPrintData(tableProps.dataSource.filter(item => selectedRowKeys.includes(item.id))); return;
}} }
> setPrintModalOpen(true);
打印 setPrintData(tableProps.dataSource.filter(item => selectedRowKeys.includes(item.id)));
</Button> }}
<Button >
type="primary" 打印
icon={<ExportIcon />} </Button>
onClick={() => { )}
onExportExcel(); {props.permission("fgs-tz-dc") && (
}} <Button
> type="primary"
导出 icon={<ExportIcon />}
</Button> onClick={() => {
<Button onExportExcel();
type="primary" }}
icon={<ExportIcon />} >
onClick={() => { 导出
const hiddenFindTime = form.getFieldValue("hiddenFindTime"); </Button>
if (!hiddenFindTime) { )}
message.error("请选择隐患发现时间"); {props.permission("fgs-tz-aldc") && (
return; <Button
} type="primary"
if (hiddenFindTime.filter(Boolean).length === 0) { icon={<ExportIcon />}
message.error("请选择隐患发现时间"); onClick={() => {
return; const hiddenFindTime = form.getFieldValue("hiddenFindTime");
} if (!hiddenFindTime) {
setExportByColumnModalOpen(true); message.error("请选择隐患发现时间");
}} return;
> }
按列导出 if (hiddenFindTime.filter(Boolean).length === 0) {
</Button> message.error("请选择隐患发现时间");
return;
}
setExportByColumnModalOpen(true);
}}
>
按列导出
</Button>
)}
</> </>
)} )}
columns={[ columns={[
@ -185,14 +195,13 @@ function List(props) {
{ title: "隐患描述", dataIndex: "hiddenDesc" }, { title: "隐患描述", dataIndex: "hiddenDesc" },
{ title: "隐患级别", dataIndex: "hiddenLevelName", width: 100 }, { title: "隐患级别", dataIndex: "hiddenLevelName", width: 100 },
{ title: "隐患类型", dataIndex: "hiddenTypeName" }, { title: "隐患类型", dataIndex: "hiddenTypeName" },
{ title: "隐患部位", dataIndex: "hiddenPartName" },
{ title: "隐患发现部门", dataIndex: "hiddenFindDeptName", width: 180 }, { title: "隐患发现部门", dataIndex: "hiddenFindDeptName", width: 180 },
{ title: "隐患发现人", dataIndex: "createName", width: 130 }, { title: "隐患发现人", dataIndex: "createName", width: 130 },
{ {
title: "隐患发现时间", title: "隐患发现时间",
dataIndex: "hiddenFindTime", dataIndex: "hiddenFindTime",
width: 180, width: 180,
render: (_, record) => record.hiddenFindTime ? dayjs(record.hiddenFindTime).format("YYYY-MM-DD hh:mm:ss") : "", render: (_, record) => record.hiddenFindTime ? dayjs(record.hiddenFindTime).format("YYYY-MM-DD HH:mm:ss") : "",
}, },
{ {
title: "整改类型", title: "整改类型",
@ -204,15 +213,20 @@ function List(props) {
}), }),
}, },
{ title: "确认人", dataIndex: "confirmUserName", width: 100 }, { title: "确认人", dataIndex: "confirmUserName", width: 100 },
{ title: "整改人", dataIndex: "rectificationUserName", width: 100 }, { title: "整改人", dataIndex: "rectifyUserName", width: 100 },
{ title: "整改时间", dataIndex: "rectificationTime" }, {
title: "整改时间",
dataIndex: "rectificationTime",
width: 180,
render: (_, record) => record.rectificationTime ? dayjs(record.rectificationTime).format("YYYY-MM-DD HH:mm:ss") : "",
},
{ title: "验收人", dataIndex: "hiddenYUserName", width: 100 }, { title: "验收人", dataIndex: "hiddenYUserName", width: 100 },
{ {
title: "是否相关方", title: "是否相关方",
dataIndex: "isRelated", dataIndex: "isRelated",
width: 150, width: 150,
render: (_, record) => getLabelName({ render: (_, record) => getLabelName({
list: [{ bianma: 1, name: "是" }, { bianma: 2, name: "否" }], list: IS_RELATED_ENUM,
status: record.isRelated, status: record.isRelated,
}), }),
}, },
@ -236,7 +250,7 @@ function List(props) {
查看 查看
</Button> </Button>
{ {
record.state === 201 && ( (props.permission("fgs-tz-bj") && record.state === 201) && (
<Button <Button
type="link" type="link"
onClick={() => { onClick={() => {
@ -247,15 +261,21 @@ function List(props) {
</Button> </Button>
) )
} }
{record.state === 100 && <Button type="link" danger onClick={() => onDelete(record.id)}>删除</Button>} {
<Button (props.permission("fgs-tz-sc") && record.state === 100) && (
type="link" <Button type="link" danger onClick={() => onDelete(record.id)}>删除</Button>
onClick={() => { )
props.history.push(`../HiddenView?id=${record.id}&hiddenId=${record.hiddenId}&history=1`); }
}} {props.permission("fgs-tz-gcjl") && (
> <Button
过程记录 type="link"
</Button> onClick={() => {
props.history.push(`../HiddenView?id=${record.id}&hiddenId=${record.hiddenId}&history=1`);
}}
>
过程记录
</Button>
)}
</Space> </Space>
), ),
}, },
@ -356,9 +376,9 @@ const PrintModal = (props) => {
documentTitle: "", documentTitle: "",
}); });
const getIsQualified = (isQualified) => { const getIsQualified = (isQualified) => {
if (isQualified === 1) if (isQualified === "1")
return "合格"; return "合格";
else if (isQualified === 0) else if (isQualified === "0")
return "不合格"; return "不合格";
return ""; return "";
}; };
@ -381,7 +401,7 @@ const PrintModal = (props) => {
{ {
title: "排查时间", title: "排查时间",
dataIndex: "hiddenFindTime", dataIndex: "hiddenFindTime",
render: (_, record) => dayjs(record.hiddenFindTime).format("YYYY-MM-DD hh:mm:ss"), render: (_, record) => dayjs(record.hiddenFindTime).format("YYYY-MM-DD HH:mm:ss"),
}, },
{ title: "检查人", dataIndex: "createName" }, { title: "检查人", dataIndex: "createName" },
{ title: "责任部门", dataIndex: "hiddenFindDeptName" }, { title: "责任部门", dataIndex: "hiddenFindDeptName" },
@ -391,15 +411,19 @@ const PrintModal = (props) => {
{ {
title: "完成时限", title: "完成时限",
dataIndex: "rectificationDeadline", dataIndex: "rectificationDeadline",
render: (_, record) => record.rectificationDeadline && dayjs(record.rectificationDeadline).format("YYYY-MM-DD hh:mm:ss"), render: (_, record) => record.rectificationDeadline && dayjs(record.rectificationDeadline).format("YYYY-MM-DD HH:mm:ss"),
}, },
{ title: "整改责任人", dataIndex: "rectificationUserName" }, { title: "整改责任人", dataIndex: "rectifyUserName" },
{ {
title: "验收人员", title: "验收人员",
dataIndex: "hiddenYUserName", dataIndex: "hiddenYUserName",
render: (_, record) => record.state === 301 ? record.hiddenYUserName : "", render: (_, record) => record.state === 301 ? record.hiddenYUserName : "",
}, },
{ title: "验收时间", dataIndex: "hiddenYTime" }, {
title: "验收时间",
dataIndex: "hiddenYTime",
render: (_, record) => record.hiddenYTime && dayjs(record.hiddenYTime).format("YYYY-MM-DD HH:mm:ss"),
},
{ {
title: "验收结果", title: "验收结果",
dataIndex: "isQualified", dataIndex: "isQualified",
@ -427,17 +451,17 @@ const PrintModal = (props) => {
<tbody> <tbody>
{(props.data || []).map(item => ( {(props.data || []).map(item => (
<tr key={item.id}> <tr key={item.id}>
<td>{dayjs(item.hiddenFindTime).format("YYYY-MM-DD hh:mm:ss")}</td> <td>{item.hiddenFindTime ? dayjs(item.hiddenFindTime).format("YYYY-MM-DD HH:mm:ss") : ""}</td>
<td>{item.createName}</td> <td>{item.createName}</td>
<td>{item.hiddenFindDeptName}</td> <td>{item.hiddenFindDeptName}</td>
<td>{item.hiddenDesc}</td> <td>{item.hiddenDesc}</td>
<td>{item.hiddenLevelName}</td> <td>{item.hiddenLevelName}</td>
<td>{item.RECTIFYDESCR}</td> <td>{item.tempSafeMeasure}</td>
<td>{dayjs(item.rectificationDeadline).format("YYYY-MM-DD hh:mm:ss")}</td> <td>{item.rectificationDeadline ? dayjs(item.rectificationDeadline).format("YYYY-MM-DD HH:mm:ss") : ""}</td>
<td>{item.rectificationUserName}</td> <td>{item.rectifyUserName}</td>
<td>{item.state === 301 ? item.hiddenYUserName : ""}</td> <td>{item.state === 301 ? item.hiddenYUserName : ""}</td>
<td>{item.hiddenYTime}</td> <td>{item.hiddenYTime ? dayjs(item.hiddenYTime).format("YYYY-MM-DD HH:mm:ss") : ""}</td>
<td>{item.state === 301 ? getIsQualified(item.isSuccess) : ""}</td> <td>{item.state === 301 ? getIsQualified(item.isQualified) : ""}</td>
</tr> </tr>
))} ))}
</tbody> </tbody>
@ -448,4 +472,4 @@ const PrintModal = (props) => {
}; };
const ExportByColumnModal = Connect([NS_LEDGER], true)(ExportByColumnModalComponent); const ExportByColumnModal = Connect([NS_LEDGER], true)(ExportByColumnModalComponent);
export default Connect([NS_LEDGER], true)(List); export default Connect([NS_LEDGER], true)(Permission(List));

View File

@ -1,4 +1,5 @@
import { RightOutlined } from "@ant-design/icons"; import { RightOutlined } from "@ant-design/icons";
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Form, message, Modal, Space, Spin, Tag } from "antd"; import { Button, Form, message, Modal, Space, Spin, Tag } from "antd";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
@ -91,15 +92,17 @@ function Part(props) {
<Table <Table
toolBarRender={() => ( toolBarRender={() => (
<> <>
<Button {props.permission("fgs-yhqy-xz") && (
type="primary" <Button
icon={<AddIcon />} type="primary"
onClick={() => { icon={<AddIcon />}
setAddModalOpen(true); onClick={() => {
}} setAddModalOpen(true);
> }}
新增 >
</Button> 新增
</Button>
)}
{ {
parentId && ( parentId && (
<Button <Button
@ -142,16 +145,18 @@ function Part(props) {
fixed: "right", fixed: "right",
render: (_, record) => ( render: (_, record) => (
<Space> <Space>
<Button {props.permission("fgs-yhqy-bj") && (
type="link" <Button
onClick={() => { type="link"
setAddModalOpen(true); onClick={() => {
setCurrentId(record.id); setAddModalOpen(true);
}} setCurrentId(record.id);
> }}
编辑 >
</Button> 编辑
<Button type="link" danger onClick={() => onDelete(record.id)}>删除</Button> </Button>
)}
{props.permission("fgs-yhqy-sc") && <Button type="link" danger onClick={() => onDelete(record.id)}>删除</Button>}
</Space> </Space>
), ),
}, },
@ -257,4 +262,4 @@ const AddModalComponent = (props) => {
}; };
const AddModal = Connect([NS_PART], true)(AddModalComponent); const AddModal = Connect([NS_PART], true)(AddModalComponent);
export default Connect([NS_PART], true)(Part); export default Connect([NS_PART], true)(Permission(Part));

View File

@ -1,3 +1,4 @@
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Form, Space } from "antd"; import { Button, Form, Space } from "antd";
import dayjs from "dayjs"; import dayjs from "dayjs";
@ -11,6 +12,7 @@ import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
import { HIDDEN_RECTIFICATION_TYPE_ENUM, HIDDEN_SOURCE_ENUM, HIDDEN_STATE_ENUM } from "zy-react-library/enum/hidden/gwj"; import { HIDDEN_RECTIFICATION_TYPE_ENUM, HIDDEN_SOURCE_ENUM, HIDDEN_STATE_ENUM } from "zy-react-library/enum/hidden/gwj";
import useTable from "zy-react-library/hooks/useTable"; import useTable from "zy-react-library/hooks/useTable";
import { getLabelName } from "zy-react-library/utils"; import { getLabelName } from "zy-react-library/utils";
import { IS_RELATED_ENUM } from "~/enumerate/constant";
import { NS_SPECIAL_DISPOSAL } from "~/enumerate/namespace"; import { NS_SPECIAL_DISPOSAL } from "~/enumerate/namespace";
function List(props) { function List(props) {
@ -55,7 +57,7 @@ function List(props) {
name: "isRelated", name: "isRelated",
label: "是否相关方", label: "是否相关方",
render: FORM_ITEM_RENDER_ENUM.SELECT, render: FORM_ITEM_RENDER_ENUM.SELECT,
items: [{ bianma: 1, name: "是" }, { bianma: 2, name: "否" }], items: IS_RELATED_ENUM,
}, },
]} ]}
form={form} form={form}
@ -77,7 +79,7 @@ function List(props) {
{ {
title: "隐患发现时间", title: "隐患发现时间",
dataIndex: "hiddenFindTime", dataIndex: "hiddenFindTime",
render: (_, record) => record.hiddenFindTime ? dayjs(record.hiddenFindTime).format("YYYY-MM-DD hh:mm:ss") : "", render: (_, record) => record.hiddenFindTime ? dayjs(record.hiddenFindTime).format("YYYY-MM-DD HH:mm:ss") : "",
}, },
{ {
title: "整改类型", title: "整改类型",
@ -86,7 +88,7 @@ function List(props) {
render: (_, record) => getLabelName({ list: HIDDEN_RECTIFICATION_TYPE_ENUM, status: record.rectificationType }), render: (_, record) => getLabelName({ list: HIDDEN_RECTIFICATION_TYPE_ENUM, status: record.rectificationType }),
}, },
{ title: "确认人", dataIndex: "confirmUserName", width: 100 }, { title: "确认人", dataIndex: "confirmUserName", width: 100 },
{ title: "整改人", dataIndex: "rectificationUserName", width: 100 }, { title: "整改人", dataIndex: "rectifyUserName", width: 100 },
{ title: "隐患状态", dataIndex: "state", render: (_, record) => getLabelName({ list: HIDDEN_STATE_ENUM, status: record.state }) }, { title: "隐患状态", dataIndex: "state", render: (_, record) => getLabelName({ list: HIDDEN_STATE_ENUM, status: record.state }) },
{ {
title: "操作", title: "操作",
@ -94,22 +96,26 @@ function List(props) {
fixed: "right", fixed: "right",
render: (_, record) => ( render: (_, record) => (
<Space> <Space>
<Button {props.permission("fgs-yqsh-ck") && (
type="link" <Button
onClick={() => { type="link"
props.history.push(`../HiddenView?id=${record.id}&hiddenId=${record.hiddenId}`); onClick={() => {
}} props.history.push(`../HiddenView?id=${record.id}&hiddenId=${record.hiddenId}`);
> }}
查看 >
</Button> 查看
<Button </Button>
type="link" )}
onClick={() => { {props.permission("fgs-yqsh-sh") && (
props.history.push(`./review?id=${record.id}&hiddenId=${record.hiddenId}`); <Button
}} type="link"
> onClick={() => {
审核 props.history.push(`./review?id=${record.id}&hiddenId=${record.hiddenId}`);
</Button> }}
>
审核
</Button>
)}
</Space> </Space>
), ),
}, },
@ -120,4 +126,4 @@ function List(props) {
); );
} }
export default Connect([NS_SPECIAL_DISPOSAL], true)(List); export default Connect([NS_SPECIAL_DISPOSAL], true)(Permission(List));

View File

@ -1,3 +1,4 @@
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Form, message, Modal, Space } from "antd"; import { Button, Form, message, Modal, Space } from "antd";
import dayjs from "dayjs"; import dayjs from "dayjs";
@ -16,6 +17,7 @@ import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
import useTable from "zy-react-library/hooks/useTable"; import useTable from "zy-react-library/hooks/useTable";
import useUploadFile from "zy-react-library/hooks/useUploadFile"; import useUploadFile from "zy-react-library/hooks/useUploadFile";
import { getLabelName } from "zy-react-library/utils"; import { getLabelName } from "zy-react-library/utils";
import { IS_RELATED_ENUM } from "~/enumerate/constant";
import { NS_RECTIFICATION } from "~/enumerate/namespace"; import { NS_RECTIFICATION } from "~/enumerate/namespace";
function List(props) { function List(props) {
@ -62,7 +64,7 @@ function List(props) {
name: "isRelated", name: "isRelated",
label: "是否相关方", label: "是否相关方",
render: FORM_ITEM_RENDER_ENUM.SELECT, render: FORM_ITEM_RENDER_ENUM.SELECT,
items: [{ bianma: 1, name: "是" }, { bianma: 2, name: "否" }], items: IS_RELATED_ENUM,
}, },
]} ]}
form={form} form={form}
@ -84,7 +86,7 @@ function List(props) {
{ {
title: "隐患发现时间", title: "隐患发现时间",
dataIndex: "hiddenFindTime", dataIndex: "hiddenFindTime",
render: (_, record) => record.hiddenFindTime ? dayjs(record.hiddenFindTime).format("YYYY-MM-DD hh:mm:ss") : "", render: (_, record) => record.hiddenFindTime ? dayjs(record.hiddenFindTime).format("YYYY-MM-DD HH:mm:ss") : "",
}, },
{ {
title: "整改类型", title: "整改类型",
@ -93,7 +95,7 @@ function List(props) {
render: (_, record) => getLabelName({ list: HIDDEN_RECTIFICATION_TYPE_ENUM, status: record.rectificationType }), render: (_, record) => getLabelName({ list: HIDDEN_RECTIFICATION_TYPE_ENUM, status: record.rectificationType }),
}, },
{ title: "确认人", dataIndex: "confirmUserName", width: 100 }, { title: "确认人", dataIndex: "confirmUserName", width: 100 },
{ title: "整改人", dataIndex: "rectificationUserName", width: 100 }, { title: "整改人", dataIndex: "rectifyUserName", width: 100 },
{ title: "隐患状态", dataIndex: "state", render: () => "未整改" }, { title: "隐患状态", dataIndex: "state", render: () => "未整改" },
{ {
title: "操作", title: "操作",
@ -101,40 +103,48 @@ function List(props) {
fixed: "right", fixed: "right",
render: (_, record) => ( render: (_, record) => (
<Space> <Space>
<Button {props.permission("fgs-yqzg-ck") && (
type="link" <Button
onClick={() => { type="link"
props.history.push(`../HiddenView?id=${record.id}&hiddenId=${record.hiddenId}`); onClick={() => {
}} props.history.push(`../HiddenView?id=${record.id}&hiddenId=${record.hiddenId}`);
> }}
查看 >
</Button> 查看
<Button </Button>
type="link" )}
onClick={() => { {props.permission("fgs-yqzg-zg") && (
props.history.push(`./review?id=${record.id}&hiddenId=${record.hiddenId}`); <Button
}} type="link"
> onClick={() => {
整改 props.history.push(`./review?id=${record.id}&hiddenId=${record.hiddenId}`);
</Button> }}
<Button >
type="link" 整改
onClick={() => { </Button>
setTemporarySafetyMeasuresModalOpen(true); )}
setCurrentId(record.id); {props.permission("fgs-yqzg-lsaqcs") && (
}} <Button
> type="link"
临时安全措施 onClick={() => {
</Button> setTemporarySafetyMeasuresModalOpen(true);
<Button setCurrentId(record.id);
type="link" }}
onClick={() => { >
setRequestAnExtensionModalOpen(true); 临时安全措施
setCurrentId(record.hiddenId); </Button>
}} )}
> {props.permission("fgs-yqzg-sqyq") && (
申请延期 <Button
</Button> type="link"
onClick={() => {
setRequestAnExtensionModalOpen(true);
setCurrentId(record.hiddenId);
}}
>
申请延期
</Button>
)}
</Space> </Space>
), ),
}, },
@ -241,4 +251,4 @@ const RequestAnExtensionModalComponent = (props) => {
const TemporarySafetyMeasuresModal = Connect([NS_RECTIFICATION], true)(TemporarySafetyMeasuresModalComponent); const TemporarySafetyMeasuresModal = Connect([NS_RECTIFICATION], true)(TemporarySafetyMeasuresModalComponent);
const RequestAnExtensionModal = Connect([NS_RECTIFICATION], true)(RequestAnExtensionModalComponent); const RequestAnExtensionModal = Connect([NS_RECTIFICATION], true)(RequestAnExtensionModalComponent);
export default Connect([NS_RECTIFICATION], true)(List); export default Connect([NS_RECTIFICATION], true)(Permission(List));

View File

@ -1,5 +1,5 @@
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Col, Divider, Form, message, Row } from "antd"; import { Divider, Form, message } from "antd";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { useState } from "react"; import { useState } from "react";
import FormBuilder from "zy-react-library/components/FormBuilder"; import FormBuilder from "zy-react-library/components/FormBuilder";
@ -23,11 +23,21 @@ function Rectification(props) {
const { loading: uploadFileLoading, uploadFile } = useUploadFile(); const { loading: uploadFileLoading, uploadFile } = useUploadFile();
const [data, setData] = useState({}); const [data, setData] = useState({});
const onSubmit = async (values) => { const onSubmit = async (values) => {
await uploadFile({ single: false, files: values.afterRectificationImageFiles, params: { type: UPLOAD_FILE_TYPE_ENUM["4"], foreignKey: query.hiddenId } }); const { id: afterRectificationImageId } = await uploadFile({
await uploadFile({ single: false, files: values.rectificationPlanImageFiles, params: { type: UPLOAD_FILE_TYPE_ENUM["8"], foreignKey: query.hiddenId } }); single: false,
files: values.afterRectificationImageFiles,
params: { type: UPLOAD_FILE_TYPE_ENUM["4"], foreignKey: "" },
});
const { id: rectificationPlanImageId } = await uploadFile({
single: false,
files: values.rectificationPlanImageFiles,
params: { type: UPLOAD_FILE_TYPE_ENUM["8"], foreignKey: "" },
});
const { success } = await props["rectificationSave"]({ const { success } = await props["rectificationSave"]({
id: query.id, id: query.id,
hiddenId: query.hiddenId, hiddenId: query.hiddenId,
hiddenUserId: afterRectificationImageId,
hiddenSchemeId: rectificationPlanImageId,
...values, ...values,
}); });
if (success) { if (success) {
@ -78,9 +88,10 @@ function Rectification(props) {
values={{ values={{
status: 1, status: 1,
hiddenUserAddCmds: [ hiddenUserAddCmds: [
{ deptId: undefined, deptName: undefined, userId: undefined, userName: undefined, type: 300 }, { type: 300 },
], ],
}} }}
span={24}
form={form} form={form}
loading={uploadFileLoading || props.rectification.rectificationLoading} loading={uploadFileLoading || props.rectification.rectificationLoading}
onFinish={onSubmit} onFinish={onSubmit}
@ -88,18 +99,22 @@ function Rectification(props) {
{ {
name: "status", name: "status",
label: "是否正常整改", label: "是否正常整改",
span: 24,
render: FORM_ITEM_RENDER_ENUM.RADIO, render: FORM_ITEM_RENDER_ENUM.RADIO,
items: [{ bianma: 1, name: "是" }, { bianma: 0, name: "否" }], items: [{ bianma: 1, name: "是" }, { bianma: 0, name: "否" }],
}, },
...( ...(
status === 0 status === 0
? [ ? [
{ name: "repulseCause", span: 24, label: "无法正常整改原因", render: FORM_ITEM_RENDER_ENUM.TEXTAREA }, { name: "repulseCause", label: "无法正常整改原因", render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
] ]
: [ : [
{ name: "descr", label: "整改描述" }, { name: "descr", label: "整改描述" },
{ name: "investmentFunds", label: "投入资金", render: FORM_ITEM_RENDER_ENUM.NUMBER, componentProps: { addonAfter: "元" } }, {
name: "investmentFunds",
label: "投入资金",
render: FORM_ITEM_RENDER_ENUM.NUMBER,
componentProps: { addonAfter: "元" },
},
{ {
name: "rectificationTime", name: "rectificationTime",
label: "整改时间", label: "整改时间",
@ -109,87 +124,67 @@ function Rectification(props) {
disabledTime, disabledTime,
}, },
}, },
{ name: "tempSafeMeasure", label: "临时安全措施" }, { name: "tempSafeMeasure", label: "临时安全措施", render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
{ name: "afterRectificationImageFiles", label: "整改后图片", span: 24, render: <Upload /> }, { name: "afterRectificationImageFiles", label: "整改后图片", render: <Upload /> },
{ {
key: "acceptance", name: "hiddenUserAddCmds",
customizeRender: true, render: FORM_ITEM_RENDER_ENUM.FORM_LIST,
span: 24, formListUniqueProps: {
render: ( addDefaultValue: { type: 300 },
<> options: field => ([
<Form.List name="hiddenUserAddCmds"> {
{(fields, { add, remove }) => ( name: [field.name, "deptId"],
<> label: "验收部门",
{fields.map((field, index) => ( span: 12,
<Row gutter={24} key={field.key}> render: (
<Col span={12}> <DepartmentSelectTree
<Form.Item label="验收部门" rules={[{ required: true, message: "请选择验收部门" }]} name={[field.name, "deptId"]}> onChange={() => {
<DepartmentSelectTree form.setFieldValue(["hiddenUserAddCmds", field.name, "userId"], "");
onChange={() => { form.setFieldValue(["hiddenUserAddCmds", field.name, "userName"], "");
form.setFieldValue(["hiddenUserAddCmds", field.name, "userId"], ""); }}
form.setFieldValue(["hiddenUserAddCmds", field.name, "userName"], ""); onGetLabel={(label) => {
}} form.setFieldValue(["hiddenUserAddCmds", field.name, "deptName"], label);
onGetLabel={(label) => { }}
form.setFieldValue(["hiddenUserAddCmds", field.name, "deptName"], label); />
}} ),
/> },
</Form.Item> { name: [field.name, "deptName"], deptName: "验收部门名称", onlyForLabel: true },
<Form.Item label="验收部门名称" noStyle name={[field.name, "deptName"]}> { name: [field.name, "type"], deptName: "用户类型", onlyForLabel: true },
<input type="hidden" /> { name: [field.name, "userName"], deptName: "验收人名称", onlyForLabel: true },
</Form.Item> {
</Col> name: [field.name, "userId"],
<Col span={12}> deptName: "验收人",
<Form.Item label="验收人" required> span: 12,
<div style={{ display: "flex", gap: 10 }}> rules: [{
<Form.Item validator: (_, value) => {
noStyle // 获取已存在的用户名
rules={ const confirmUserName = data?.hiddenConfirmUserCO?.rectifyUserId;
[ const presetUserName = data?.hiddenUserPresetsCO?.rectifyUserId;
{ required: true, message: "请选择验收人" },
{ validator: (_, value) => {
// 获取已存在的用户名
const confirmUserName = data?.hiddenConfirmUserCO?.rectifyUserId;
const presetUserName = data?.hiddenUserPresetsCO?.rectifyUserId;
// 验证是否与已有用户名相同 // 验证是否与已有用户名相同
if (value && (value === confirmUserName || value === presetUserName)) { if (value && (value === confirmUserName || value === presetUserName)) {
return Promise.reject(new Error("验收人不能与整改人相同")); return Promise.reject(new Error("验收人不能与整改人相同"));
} }
return Promise.resolve(); return Promise.resolve();
} }, },
] }],
} render: (
name={[field.name, "userId"]} <PersonnelSelect
> params={{ departmentId: hiddenUserAddCmds?.[field.name]?.deptId || "" }}
<PersonnelSelect onGetLabel={label => form.setFieldValue(["hiddenUserAddCmds", field.name, "userName"], label)}
params={{ departmentId: hiddenUserAddCmds?.[field.name]?.deptId || "" }} />
onGetLabel={label => form.setFieldValue(["hiddenUserAddCmds", field.name, "userName"], label)} ),
/> },
</Form.Item> ]),
{ },
index >= 1 },
? <Button type="primary" danger onClick={() => remove(field.name)}>删除</Button> {
: <Button type="primary" onClick={() => add({ deptId: undefined, deptName: undefined, userId: undefined, userName: undefined, type: 300 })}>新增</Button> name: "isRectificationScheme",
} label: "整改方案",
</div> render: FORM_ITEM_RENDER_ENUM.RADIO,
</Form.Item> items: [{ bianma: 1, name: "是" }, { bianma: 0, name: "否" }],
<Form.Item label="验收人名称" noStyle name={[field.name, "userName"]}>
<input type="hidden" />
</Form.Item>
<Form.Item label="用户类型" noStyle name={[field.name, "type"]}>
<input type="hidden" />
</Form.Item>
</Col>
</Row>
))}
</>
)}
</Form.List>
</>
),
}, },
{ name: "isRectificationScheme", label: "整改方案", span: 24, render: FORM_ITEM_RENDER_ENUM.RADIO, items: [{ bianma: 1, name: "是" }, { bianma: 0, name: "否" }] },
...( ...(
isRectificationScheme !== undefined isRectificationScheme !== undefined
? ( ? (
@ -203,7 +198,7 @@ function Rectification(props) {
{ name: "timeLimitFor", label: "时限要求" }, { name: "timeLimitFor", label: "时限要求" },
{ name: "jobRequireMent", label: "工作要求" }, { name: "jobRequireMent", label: "工作要求" },
{ name: "otherBusiness", label: "其他事项" }, { name: "otherBusiness", label: "其他事项" },
{ name: "rectificationPlanImageFiles", label: "方案图片", span: 24, render: <Upload /> }, { name: "rectificationPlanImageFiles", label: "方案图片", render: <Upload /> },
] ]
: [] : []
) )

View File

@ -1,3 +1,4 @@
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Form, Space } from "antd"; import { Button, Form, Space } from "antd";
import dayjs from "dayjs"; import dayjs from "dayjs";
@ -11,6 +12,7 @@ import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
import { HIDDEN_RECTIFICATION_TYPE_ENUM, HIDDEN_SOURCE_ENUM } from "zy-react-library/enum/hidden/gwj"; import { HIDDEN_RECTIFICATION_TYPE_ENUM, HIDDEN_SOURCE_ENUM } from "zy-react-library/enum/hidden/gwj";
import useTable from "zy-react-library/hooks/useTable"; import useTable from "zy-react-library/hooks/useTable";
import { getLabelName } from "zy-react-library/utils"; import { getLabelName } from "zy-react-library/utils";
import { IS_RELATED_ENUM } from "~/enumerate/constant";
import { NS_SPECIAL_DISPOSAL } from "~/enumerate/namespace"; import { NS_SPECIAL_DISPOSAL } from "~/enumerate/namespace";
function List(props) { function List(props) {
@ -55,7 +57,7 @@ function List(props) {
name: "isRelated", name: "isRelated",
label: "是否相关方", label: "是否相关方",
render: FORM_ITEM_RENDER_ENUM.SELECT, render: FORM_ITEM_RENDER_ENUM.SELECT,
items: [{ bianma: 1, name: "是" }, { bianma: 2, name: "否" }], items: IS_RELATED_ENUM,
}, },
]} ]}
form={form} form={form}
@ -77,7 +79,7 @@ function List(props) {
{ {
title: "隐患发现时间", title: "隐患发现时间",
dataIndex: "hiddenFindTime", dataIndex: "hiddenFindTime",
render: (_, record) => record.hiddenFindTime ? dayjs(record.hiddenFindTime).format("YYYY-MM-DD hh:mm:ss") : "", render: (_, record) => record.hiddenFindTime ? dayjs(record.hiddenFindTime).format("YYYY-MM-DD HH:mm:ss") : "",
}, },
{ {
title: "整改类型", title: "整改类型",
@ -86,7 +88,7 @@ function List(props) {
render: (_, record) => getLabelName({ list: HIDDEN_RECTIFICATION_TYPE_ENUM, status: record.rectificationType }), render: (_, record) => getLabelName({ list: HIDDEN_RECTIFICATION_TYPE_ENUM, status: record.rectificationType }),
}, },
{ title: "确认人", dataIndex: "confirmUserName", width: 100 }, { title: "确认人", dataIndex: "confirmUserName", width: 100 },
{ title: "整改人", dataIndex: "rectificationUserName", width: 100 }, { title: "整改人", dataIndex: "rectifyUserName", width: 100 },
{ title: "隐患状态", dataIndex: "state", render: () => "待处理特殊隐患" }, { title: "隐患状态", dataIndex: "state", render: () => "待处理特殊隐患" },
{ {
title: "操作", title: "操作",
@ -94,22 +96,26 @@ function List(props) {
fixed: "right", fixed: "right",
render: (_, record) => ( render: (_, record) => (
<Space> <Space>
<Button {props.permission("fgs-tsczsh-ck") && (
type="link" <Button
onClick={() => { type="link"
props.history.push(`../HiddenView?id=${record.id}&hiddenId=${record.hiddenId}`); onClick={() => {
}} props.history.push(`../HiddenView?id=${record.id}&hiddenId=${record.hiddenId}`);
> }}
查看 >
</Button> 查看
<Button </Button>
type="link" )}
onClick={() => { {props.permission("fgs-tsczsh-sh") && (
props.history.push(`./review?id=${record.id}&hiddenId=${record.hiddenId}`); <Button
}} type="link"
> onClick={() => {
审核 props.history.push(`./review?id=${record.id}&hiddenId=${record.hiddenId}`);
</Button> }}
>
审核
</Button>
)}
</Space> </Space>
), ),
}, },
@ -120,4 +126,4 @@ function List(props) {
); );
} }
export default Connect([NS_SPECIAL_DISPOSAL], true)(List); export default Connect([NS_SPECIAL_DISPOSAL], true)(Permission(List));

View File

@ -43,7 +43,7 @@ function Review(props) {
<div style={{ paddingBottom: 20 }}> <div style={{ paddingBottom: 20 }}>
<FormBuilder <FormBuilder
values={{ values={{
state: 2, state: 3,
}} }}
form={form} form={form}
loading={uploadFileLoading || props.specialDisposal.specialDisposalLoading} loading={uploadFileLoading || props.specialDisposal.specialDisposalLoading}
@ -54,7 +54,7 @@ function Review(props) {
label: "是否通过", label: "是否通过",
span: 24, span: 24,
render: FORM_ITEM_RENDER_ENUM.RADIO, render: FORM_ITEM_RENDER_ENUM.RADIO,
items: [{ bianma: 2, name: "通过" }, { bianma: 1, name: "不通过" }], items: [{ bianma: 3, name: "通过" }, { bianma: 4, name: "不通过" }],
componentProps: { componentProps: {
onChange: () => { onChange: () => {
form.setFieldValue("modifyRectifyPerson", 0); form.setFieldValue("modifyRectifyPerson", 0);
@ -71,7 +71,7 @@ function Review(props) {
span: 24, span: 24,
render: FORM_ITEM_RENDER_ENUM.TEXTAREA, render: FORM_ITEM_RENDER_ENUM.TEXTAREA,
dependencies: ["state"], dependencies: ["state"],
hidden: formValues => !(formValues.state === 2), hidden: formValues => !(formValues.state === 3),
}, },
{ {
name: "files", name: "files",
@ -79,7 +79,7 @@ function Review(props) {
span: 24, span: 24,
render: <Upload fileType="document" maxCount={1} />, render: <Upload fileType="document" maxCount={1} />,
dependencies: ["state"], dependencies: ["state"],
hidden: formValues => !(formValues.state === 2), hidden: formValues => !(formValues.state === 3),
}, },
{ {
name: "modifyRectifyPerson", name: "modifyRectifyPerson",
@ -96,7 +96,7 @@ function Review(props) {
}, },
}, },
dependencies: ["state"], dependencies: ["state"],
hidden: formValues => !(formValues.state === 1), hidden: formValues => !(formValues.state === 4),
}, },
{ {
name: "deptId", name: "deptId",
@ -113,7 +113,7 @@ function Review(props) {
/> />
), ),
dependencies: ["state", "modifyRectifyPerson"], dependencies: ["state", "modifyRectifyPerson"],
hidden: formValues => !(formValues.state === 1 && formValues.modifyRectifyPerson === 1), hidden: formValues => !(formValues.state === 4 && formValues.modifyRectifyPerson === 1),
}, },
{ name: "deptName", label: "整改负责人部门名称", onlyForLabel: true }, { name: "deptName", label: "整改负责人部门名称", onlyForLabel: true },
{ {
@ -126,7 +126,7 @@ function Review(props) {
/> />
), ),
dependencies: ["state", "modifyRectifyPerson"], dependencies: ["state", "modifyRectifyPerson"],
hidden: formValues => !(formValues.state === 1 && formValues.modifyRectifyPerson === 1), hidden: formValues => !(formValues.state === 4 && formValues.modifyRectifyPerson === 1),
}, },
{ name: "rectifyPersonName", label: "整改负责人名称", onlyForLabel: true }, { name: "rectifyPersonName", label: "整改负责人名称", onlyForLabel: true },
]} ]}

View File

@ -1,3 +1,4 @@
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Form, Space } from "antd"; import { Button, Form, Space } from "antd";
import Table from "zy-react-library/components/Table"; import Table from "zy-react-library/components/Table";
@ -22,14 +23,16 @@ function List(props) {
fixed: "right", fixed: "right",
render: (_, record) => ( render: (_, record) => (
<Space> <Space>
<Button {props.permission("jgd-aiyh-ck") && (
type="link" <Button
onClick={() => { type="link"
props.history.push(`./ListView?corpName=${record.corpName}&id=${record.corpId}`); onClick={() => {
}} props.history.push(`./ListView?corpName=${record.corpName}&id=${record.corpId}`);
> }}
查看 >
</Button> 查看
</Button>
)}
</Space> </Space>
), ),
}, },
@ -42,4 +45,4 @@ function List(props) {
); );
} }
export default Connect([NS_AVERAGE], true)(List); export default Connect([NS_AVERAGE], true)(Permission(List));

View File

@ -1,3 +1,4 @@
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Form, Space } from "antd"; import { Button, Form, Space } from "antd";
import Search from "zy-react-library/components/Search"; import Search from "zy-react-library/components/Search";
@ -31,14 +32,16 @@ function CorpInfoList(props) {
fixed: "right", fixed: "right",
render: (_, record) => ( render: (_, record) => (
<Space> <Space>
<Button {props.permission("jgd-yb-ck") && (
type="link" <Button
onClick={() => { type="link"
props.history.push(`./HiddenList?corpName=${record.corpName}&corpId=${record.corpId}`); onClick={() => {
}} props.history.push(`./HiddenList?corpName=${record.corpName}&corpId=${record.corpId}`);
> }}
查看 >
</Button> 查看
</Button>
)}
</Space> </Space>
), ),
}, },
@ -49,4 +52,4 @@ function CorpInfoList(props) {
); );
} }
export default Connect([NS_AVERAGE], true)(CorpInfoList); export default Connect([NS_AVERAGE], true)(Permission(CorpInfoList));

View File

@ -18,6 +18,7 @@ import useDownloadBlob from "zy-react-library/hooks/useDownloadBlob";
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
import useTable from "zy-react-library/hooks/useTable"; import useTable from "zy-react-library/hooks/useTable";
import { getLabelName } from "zy-react-library/utils"; import { getLabelName } from "zy-react-library/utils";
import { IS_RELATED_ENUM } from "~/enumerate/constant";
import { NS_AVERAGE } from "~/enumerate/namespace"; import { NS_AVERAGE } from "~/enumerate/namespace";
import "../../../../BranchCompany/Average/Ledger/List/index.less"; import "../../../../BranchCompany/Average/Ledger/List/index.less";
@ -92,7 +93,7 @@ function HiddenList(props) {
name: "isRelated", name: "isRelated",
label: "是否相关方", label: "是否相关方",
render: FORM_ITEM_RENDER_ENUM.SELECT, render: FORM_ITEM_RENDER_ENUM.SELECT,
items: [{ bianma: 1, name: "是" }, { bianma: 2, name: "否" }], items: IS_RELATED_ENUM,
}, },
]} ]}
form={form} form={form}
@ -106,7 +107,7 @@ function HiddenList(props) {
setSelectedRowKeys(selectedRowKeys); setSelectedRowKeys(selectedRowKeys);
}, },
}} }}
headerTitle={query.corpName} headerTitle={`公司名称:${query.corpName}`}
toolBarRender={() => ( toolBarRender={() => (
<Space> <Space>
<Button <Button
@ -149,7 +150,7 @@ function HiddenList(props) {
{ {
title: "隐患发现时间", title: "隐患发现时间",
dataIndex: "hiddenFindTime", dataIndex: "hiddenFindTime",
render: (_, record) => record.hiddenFindTime ? dayjs(record.hiddenFindTime).format("YYYY-MM-DD hh:mm:ss") : "", render: (_, record) => record.hiddenFindTime ? dayjs(record.hiddenFindTime).format("YYYY-MM-DD HH:mm:ss") : "",
}, },
{ {
title: "整改类型", title: "整改类型",
@ -158,7 +159,7 @@ function HiddenList(props) {
render: (_, record) => getLabelName({ list: HIDDEN_RECTIFICATION_TYPE_ENUM, status: record.rectificationType }), render: (_, record) => getLabelName({ list: HIDDEN_RECTIFICATION_TYPE_ENUM, status: record.rectificationType }),
}, },
{ title: "确认人", dataIndex: "confirmUserName", width: 100 }, { title: "确认人", dataIndex: "confirmUserName", width: 100 },
{ title: "整改人", dataIndex: "rectificationUserName", width: 100 }, { title: "整改人", dataIndex: "rectifyUserName", width: 100 },
{ title: "整改时间", dataIndex: "rectificationTime" }, { title: "整改时间", dataIndex: "rectificationTime" },
{ title: "验收人", dataIndex: "hiddenYUserName", width: 100 }, { title: "验收人", dataIndex: "hiddenYUserName", width: 100 },
{ {
@ -244,7 +245,7 @@ const PrintModal = (props) => {
{ {
title: "隐患发现时间", title: "隐患发现时间",
dataIndex: "hiddenFindTime", dataIndex: "hiddenFindTime",
render: (_, record) => record.hiddenFindTime ? dayjs(record.hiddenFindTime).format("YYYY-MM-DD hh:mm:ss") : "", render: (_, record) => record.hiddenFindTime ? dayjs(record.hiddenFindTime).format("YYYY-MM-DD HH:mm:ss") : "",
}, },
{ title: "确认人", dataIndex: "confirmUserName" }, { title: "确认人", dataIndex: "confirmUserName" },
{ title: "整改负责人", dataIndex: "rectificationUserName" }, { title: "整改负责人", dataIndex: "rectificationUserName" },
@ -272,7 +273,7 @@ const PrintModal = (props) => {
<td>{getLabelName({ list: HIDDEN_SOURCE_ENUM, status: item.source })}</td> <td>{getLabelName({ list: HIDDEN_SOURCE_ENUM, status: item.source })}</td>
<td>{item.hiddenDesc}</td> <td>{item.hiddenDesc}</td>
<td>{item.createName}</td> <td>{item.createName}</td>
<td>{item.hiddenFindTime ? dayjs(item.hiddenFindTime).format("YYYY-MM-DD hh:mm:ss") : ""}</td> <td>{item.hiddenFindTime ? dayjs(item.hiddenFindTime).format("YYYY-MM-DD HH:mm:ss") : ""}</td>
<td>{item.confirmUserName}</td> <td>{item.confirmUserName}</td>
<td>{item.rectificationUserName}</td> <td>{item.rectificationUserName}</td>
<td>{getLabelName({ list: HIDDEN_STATE_ENUM, status: item.state })}</td> <td>{getLabelName({ list: HIDDEN_STATE_ENUM, status: item.state })}</td>

View File

@ -1,3 +1,4 @@
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Form, Space } from "antd"; import { Button, Form, Space } from "antd";
import Table from "zy-react-library/components/Table"; import Table from "zy-react-library/components/Table";
@ -22,14 +23,16 @@ function List(props) {
fixed: "right", fixed: "right",
render: (_, record) => ( render: (_, record) => (
<Space> <Space>
<Button {props.permission("jgd-cfyh-ck") && (
type="link" <Button
onClick={() => { type="link"
props.history.push(`./ListView?corpName=${record.corpName}&id=${record.corpId}`); onClick={() => {
}} props.history.push(`./ListView?corpName=${record.corpName}&id=${record.corpId}`);
> }}
查看重复隐患 >
</Button> 查看重复隐患
</Button>
)}
</Space> </Space>
), ),
}, },
@ -42,4 +45,4 @@ function List(props) {
); );
} }
export default Connect([NS_AVERAGE], true)(List); export default Connect([NS_AVERAGE], true)(Permission(List));

View File

@ -1,3 +1,4 @@
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Form, Space } from "antd"; import { Button, Form, Space } from "antd";
import Search from "zy-react-library/components/Search"; import Search from "zy-react-library/components/Search";
@ -28,14 +29,16 @@ function CorpInfoList(props) {
fixed: "right", fixed: "right",
render: (_, record) => ( render: (_, record) => (
<Space> <Space>
<Button {props.permission("jgd-hl-ck") && (
type="link" <Button
onClick={() => { type="link"
props.history.push(`./HiddenList?corpName=${record.corpName}&corpId=${record.corpId}`); onClick={() => {
}} props.history.push(`./HiddenList?corpName=${record.corpName}&corpId=${record.corpId}`);
> }}
查看 >
</Button> 查看
</Button>
)}
</Space> </Space>
), ),
}, },
@ -46,4 +49,4 @@ function CorpInfoList(props) {
); );
} }
export default Connect([NS_IGNORE], true)(CorpInfoList); export default Connect([NS_IGNORE], true)(Permission(CorpInfoList));

View File

@ -15,6 +15,7 @@ import useDownloadBlob from "zy-react-library/hooks/useDownloadBlob";
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
import useTable from "zy-react-library/hooks/useTable"; import useTable from "zy-react-library/hooks/useTable";
import { getLabelName } from "zy-react-library/utils"; import { getLabelName } from "zy-react-library/utils";
import { IS_RELATED_ENUM } from "~/enumerate/constant";
import { NS_IGNORE } from "~/enumerate/namespace"; import { NS_IGNORE } from "~/enumerate/namespace";
function HiddenList(props) { function HiddenList(props) {
@ -77,7 +78,7 @@ function HiddenList(props) {
name: "isRelated", name: "isRelated",
label: "是否相关方", label: "是否相关方",
render: FORM_ITEM_RENDER_ENUM.SELECT, render: FORM_ITEM_RENDER_ENUM.SELECT,
items: [{ bianma: 1, name: "是" }, { bianma: 2, name: "否" }], items: IS_RELATED_ENUM,
}, },
]} ]}
form={form} form={form}
@ -91,7 +92,7 @@ function HiddenList(props) {
setSelectedRowKeys(selectedRowKeys); setSelectedRowKeys(selectedRowKeys);
}, },
}} }}
headerTitle={query.corpName} headerTitle={`公司名称:${query.corpName}`}
toolBarRender={() => ( toolBarRender={() => (
<Button <Button
type="primary" type="primary"
@ -117,13 +118,13 @@ function HiddenList(props) {
{ {
title: "隐患发现时间", title: "隐患发现时间",
dataIndex: "hiddenFindTime", dataIndex: "hiddenFindTime",
render: (_, record) => record.hiddenFindTime ? dayjs(record.hiddenFindTime).format("YYYY-MM-DD hh:mm:ss") : "", render: (_, record) => record.hiddenFindTime ? dayjs(record.hiddenFindTime).format("YYYY-MM-DD HH:mm:ss") : "",
}, },
{ title: "确认人", dataIndex: "confirmUserName", width: 100 }, { title: "确认人", dataIndex: "confirmUserName", width: 100 },
{ {
title: "确认时间", title: "确认时间",
dataIndex: "confirmTime", dataIndex: "confirmTime",
render: (_, record) => record.confirmTime ? dayjs(record.confirmTime).format("YYYY-MM-DD hh:mm:ss") : "", render: (_, record) => record.confirmTime ? dayjs(record.confirmTime).format("YYYY-MM-DD HH:mm:ss") : "",
}, },
{ title: "隐患状态", dataIndex: "state", render: () => "已忽略" }, { title: "隐患状态", dataIndex: "state", render: () => "已忽略" },
{ {

View File

@ -1,3 +1,4 @@
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Form, Space } from "antd"; import { Button, Form, Space } from "antd";
import Search from "zy-react-library/components/Search"; import Search from "zy-react-library/components/Search";
@ -31,14 +32,16 @@ function CorpInfoList(props) {
fixed: "right", fixed: "right",
render: (_, record) => ( render: (_, record) => (
<Space> <Space>
<Button {props.permission("jgd-ts-ck") && (
type="link" <Button
onClick={() => { type="link"
props.history.push(`./HiddenList?corpName=${record.corpName}&corpId=${record.corpId}`); onClick={() => {
}} props.history.push(`./HiddenList?corpName=${record.corpName}&corpId=${record.corpId}`);
> }}
查看 >
</Button> 查看
</Button>
)}
</Space> </Space>
), ),
}, },
@ -49,4 +52,4 @@ function CorpInfoList(props) {
); );
} }
export default Connect([NS_SPECIAL_DISPOSAL], true)(CorpInfoList); export default Connect([NS_SPECIAL_DISPOSAL], true)(Permission(CorpInfoList));

View File

@ -16,6 +16,7 @@ import useDownloadBlob from "zy-react-library/hooks/useDownloadBlob";
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
import useTable from "zy-react-library/hooks/useTable"; import useTable from "zy-react-library/hooks/useTable";
import { getLabelName } from "zy-react-library/utils"; import { getLabelName } from "zy-react-library/utils";
import { IS_RELATED_ENUM } from "~/enumerate/constant";
import { NS_SPECIAL_DISPOSAL } from "~/enumerate/namespace"; import { NS_SPECIAL_DISPOSAL } from "~/enumerate/namespace";
function HiddenList(props) { function HiddenList(props) {
@ -85,7 +86,7 @@ function HiddenList(props) {
name: "isRelated", name: "isRelated",
label: "是否相关方", label: "是否相关方",
render: FORM_ITEM_RENDER_ENUM.SELECT, render: FORM_ITEM_RENDER_ENUM.SELECT,
items: [{ bianma: 1, name: "是" }, { bianma: 2, name: "否" }], items: IS_RELATED_ENUM,
}, },
]} ]}
form={form} form={form}
@ -99,7 +100,7 @@ function HiddenList(props) {
setSelectedRowKeys(selectedRowKeys); setSelectedRowKeys(selectedRowKeys);
}, },
}} }}
headerTitle={query.corpName} headerTitle={`公司名称:${query.corpName}`}
toolBarRender={() => ( toolBarRender={() => (
<Button <Button
type="primary" type="primary"
@ -126,7 +127,7 @@ function HiddenList(props) {
{ {
title: "隐患发现时间", title: "隐患发现时间",
dataIndex: "hiddenFindTime", dataIndex: "hiddenFindTime",
render: (_, record) => record.hiddenFindTime ? dayjs(record.hiddenFindTime).format("YYYY-MM-DD hh:mm:ss") : "", render: (_, record) => record.hiddenFindTime ? dayjs(record.hiddenFindTime).format("YYYY-MM-DD HH:mm:ss") : "",
}, },
{ {
title: "整改类型", title: "整改类型",
@ -135,7 +136,7 @@ function HiddenList(props) {
render: (_, record) => getLabelName({ list: HIDDEN_RECTIFICATION_TYPE_ENUM, status: record.rectificationType }), render: (_, record) => getLabelName({ list: HIDDEN_RECTIFICATION_TYPE_ENUM, status: record.rectificationType }),
}, },
{ title: "确认人", dataIndex: "confirmUserName", width: 100 }, { title: "确认人", dataIndex: "confirmUserName", width: 100 },
{ title: "整改人", dataIndex: "rectificationUserName", width: 100 }, { title: "整改人", dataIndex: "rectifyUserName", width: 100 },
{ title: "隐患状态", dataIndex: "state", render: () => "待处理特殊隐患" }, { title: "隐患状态", dataIndex: "state", render: () => "待处理特殊隐患" },
{ {
title: "操作", title: "操作",

View File

@ -1,3 +1,4 @@
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Form, Space } from "antd"; import { Button, Form, Space } from "antd";
import Search from "zy-react-library/components/Search"; import Search from "zy-react-library/components/Search";
@ -51,14 +52,16 @@ function List(props) {
fixed: "right", fixed: "right",
render: (_, record) => ( render: (_, record) => (
<Space> <Space>
<Button {props.permission("fgs-kp-kp") && (
type="link" <Button
onClick={() => { type="link"
props.history.push(`./hiddenList?hiddenType=${record.hiddenType}&corpinfoId=${record.corpinfoId}`); onClick={() => {
}} props.history.push(`./hiddenList?hiddenType=${record.hiddenType}&corpinfoId=${record.corpinfoId}`);
> }}
考评 >
</Button> 考评
</Button>
)}
</Space> </Space>
), ),
}, },
@ -70,4 +73,4 @@ function List(props) {
); );
} }
export default Connect([NS_HIDDEN_EVALUATION], true)(List); export default Connect([NS_HIDDEN_EVALUATION], true)(Permission(List));

View File

@ -1,3 +1,4 @@
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Col, Descriptions, Form, message, Modal, Row, Space } from "antd"; import { Button, Col, Descriptions, Form, message, Modal, Row, Space } from "antd";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
@ -48,15 +49,17 @@ function List(props) {
/> />
<Table <Table
toolBarRender={() => ( toolBarRender={() => (
<Button props.permission("jgd-yhkp-kpz-tjqy") && (
type="primary" <Button
icon={<AddIcon />} type="primary"
onClick={() => { icon={<AddIcon />}
setAddModalOpen(true); onClick={() => {
}} setAddModalOpen(true);
> }}
新增 >
</Button> 新增
</Button>
)
)} )}
columns={[ columns={[
{ title: "分公司名称", dataIndex: "corpinfoName" }, { title: "分公司名称", dataIndex: "corpinfoName" },
@ -80,44 +83,52 @@ function List(props) {
fixed: "right", fixed: "right",
render: (_, record) => ( render: (_, record) => (
<Space> <Space>
<Button {props.permission("jgd-yhkp-kpz-ck") && (
type="link" <Button
onClick={() => { type="link"
setViewModalOpen(true); onClick={() => {
setCurrentData(record); setViewModalOpen(true);
}} setCurrentData(record);
> }}
查看 >
</Button> 查看
<Button </Button>
type="link" )}
onClick={() => { {props.permission("jgd-yhkp-kpz-aqz") && (
setConfigModalOpen(true); <Button
setConfigType("safety"); type="link"
setCurrentData(record); onClick={() => {
}} setConfigModalOpen(true);
> setConfigType("safety");
安全类组分配 setCurrentData(record);
</Button> }}
<Button >
type="link" 安全类组分配
onClick={() => { </Button>
setConfigModalOpen(true); )}
setConfigType("environmental"); {props.permission("jgd-yhkp-kpz-hbz") && (
setCurrentData(record); <Button
}} type="link"
> onClick={() => {
环保类组分配 setConfigModalOpen(true);
</Button> setConfigType("environmental");
<Button setCurrentData(record);
type="link" }}
onClick={() => { >
setChangeLogModalOpen(true); 环保类组分配
setCurrentData(record); </Button>
}} )}
> {props.permission("jgd-yhkp-kpz-bgjl") && (
变更记录 <Button
</Button> type="link"
onClick={() => {
setChangeLogModalOpen(true);
setCurrentData(record);
}}
>
变更记录
</Button>
)}
</Space> </Space>
), ),
}, },
@ -472,4 +483,4 @@ const ConfigModal = Connect([NS_EVALUATION_TEAM_CONFIG], true)(ConfigModalCompon
const AddModal = Connect([NS_EVALUATION_TEAM_CONFIG], true)(AddModalComponent); const AddModal = Connect([NS_EVALUATION_TEAM_CONFIG], true)(AddModalComponent);
const ViewModal = Connect([NS_EVALUATION_TEAM_CONFIG], true)(ViewModalComponent); const ViewModal = Connect([NS_EVALUATION_TEAM_CONFIG], true)(ViewModalComponent);
const ChangeLogModal = Connect([NS_EVALUATION_TEAM_CONFIG], true)(ChangeLogModalComponent); const ChangeLogModal = Connect([NS_EVALUATION_TEAM_CONFIG], true)(ChangeLogModalComponent);
export default Connect([NS_EVALUATION_TEAM_CONFIG], true)(List); export default Connect([NS_EVALUATION_TEAM_CONFIG], true)(Permission(List));

View File

@ -1,3 +1,4 @@
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Form, Space } from "antd"; import { Button, Form, Space } from "antd";
import Search from "zy-react-library/components/Search"; import Search from "zy-react-library/components/Search";
@ -51,14 +52,16 @@ function List(props) {
fixed: "right", fixed: "right",
render: (_, record) => ( render: (_, record) => (
<Space> <Space>
<Button {props.permission("jgd-yhkp-kp") && (
type="link" <Button
onClick={() => { type="link"
props.history.push(`./hiddenList?hiddenType=${record.hiddenType}&corpinfoId=${record.corpinfoId}`); onClick={() => {
}} props.history.push(`./hiddenList?hiddenType=${record.hiddenType}&corpinfoId=${record.corpinfoId}`);
> }}
考评 >
</Button> 考评
</Button>
)}
</Space> </Space>
), ),
}, },
@ -70,4 +73,4 @@ function List(props) {
); );
} }
export default Connect([NS_HIDDEN_EVALUATION], true)(List); export default Connect([NS_HIDDEN_EVALUATION], true)(Permission(List));

View File

@ -1,3 +1,4 @@
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Form, Space } from "antd"; import { Button, Form, Space } from "antd";
import Search from "zy-react-library/components/Search"; import Search from "zy-react-library/components/Search";
@ -42,14 +43,16 @@ function List(props) {
fixed: "right", fixed: "right",
render: (_, record) => ( render: (_, record) => (
<Space> <Space>
<Button {props.permission("permission") && (
type="link" <Button
onClick={() => { type="link"
props.history.push(`./userExchangeList?corpinfoId=${record.corpinfoId}`); onClick={() => {
}} props.history.push(`./userExchangeList?corpinfoId=${record.corpinfoId}`);
> }}
查看 >
</Button> 查看
</Button>
)}
</Space> </Space>
), ),
}, },
@ -61,4 +64,4 @@ function List(props) {
); );
} }
export default Connect([NS_PERSONNEL_EVALUATION], true)(List); export default Connect([NS_PERSONNEL_EVALUATION], true)(Permission(List));