diff --git a/config/router.ts b/config/router.ts index f5a3d5a..dd16ada 100644 --- a/config/router.ts +++ b/config/router.ts @@ -39,9 +39,29 @@ export default [ component: "@/pages/serverpartAssets/index", }, { - path: '/previewFile/index', - name: '预览附件', - component: "@/pages/previewFile/index", + path: '/operationReport/index', + name: '运营报表', + component: "@/pages/operationReport/index", + }, + { + path: '/operationReport/routineInspection', + name: '日常检查记录表', + component: "@/pages/operationReport/routineInspection", + }, + { + path: '/operationReport/onSiteInspection', + name: '现场检查记录表', + component: "@/pages/operationReport/onSiteInspection", + }, + { + path: '/operationReport/securityIssueList', + name: '安全问题记录表', + component: "@/pages/operationReport/securityIssueList", + }, + { + path: '/operationReport/rectificationStatus', + name: '整改情况追踪表', + component: "@/pages/operationReport/rectificationStatus", }, diff --git a/src/assets/errorIcon.png b/src/assets/errorIcon.png new file mode 100644 index 0000000..b13a61c Binary files /dev/null and b/src/assets/errorIcon.png differ diff --git a/src/assets/normalIcon.png b/src/assets/normalIcon.png new file mode 100644 index 0000000..4a6700a Binary files /dev/null and b/src/assets/normalIcon.png differ diff --git a/src/components/PageAccess.tsx b/src/components/PageAccess.tsx index 041af68..a82439d 100644 --- a/src/components/PageAccess.tsx +++ b/src/components/PageAccess.tsx @@ -25,9 +25,6 @@ const PageAccess: FC = (props): ReactElement | null => { //当遇到输入的是菜单组件中可展开的节点的path的时候就没有权限了, 此时可能会报错, //加可选操作符可避免这个报错导致的页面渲染问题 const accessible = authority[pathname]?.some((item: string) => userAuthority.includes(item)); - console.log('authority', authority); - console.log('userAuthority', userAuthority); - console.log('children', children); let res = children; diff --git a/src/components/leftSelectTree/leftSelectTree.tsx b/src/components/leftSelectTree/leftSelectTree.tsx index 8092731..c789f5b 100644 --- a/src/components/leftSelectTree/leftSelectTree.tsx +++ b/src/components/leftSelectTree/leftSelectTree.tsx @@ -38,7 +38,6 @@ const LeftSelectTree = ({ setSelectedId, reload, actionRef, currentUser, width, const { loading: treeLoading, data: treeViews } = useRequest(async () => { const search = window.location.search; const addressParams = Object.fromEntries(new URLSearchParams(search).entries()); - console.log('addressParamsaddressParamsaddressParams', addressParams); const req: any = { UserIdEncrypted: addressParams.UserIdEncrypted } diff --git a/src/components/leftSelectTree/style.less b/src/components/leftSelectTree/style.less index d9608db..e4dda01 100644 --- a/src/components/leftSelectTree/style.less +++ b/src/components/leftSelectTree/style.less @@ -24,9 +24,27 @@ display: flex; align-items: center; - .noBottom { - .ant-form-item { - margin-bottom: 0 !important; + .ant-form { + .ant-row { + .noBottom { + .ant-form-item { + margin-bottom: 0; + } + } + } + } + } + } + + .ant-pro-card-body { + .ant-tree { + .ant-tree-list { + .ant-tree-list-holder { + .ant-tree-list-holder-inner { + .ant-tree-treenode { + margin-bottom: 10px; + } + } } } } diff --git a/src/layouts/index.tsx b/src/layouts/index.tsx index f68fb0b..2f76235 100644 --- a/src/layouts/index.tsx +++ b/src/layouts/index.tsx @@ -47,7 +47,6 @@ const handleGetOpenKeys = (currentLocation: API.MenuItem[] | []): string[] => { const BasicLayout: FC<{ user: UserModelState, global: ProfileModelState, dispatch: any, location: any }> = (props) => { const [collapsed, setCollapsed] = useState(false); const { pathname } = useLocation(); - console.log('pathname', pathname); const { dispatch, diff --git a/src/models/user.ts b/src/models/user.ts index 6b94453..8a71171 100644 --- a/src/models/user.ts +++ b/src/models/user.ts @@ -258,10 +258,34 @@ const UserModel: UserModelType = { component: "@/pages/serverpartAssets/index", }, { - path: '/previewFile/index', + path: '/operationReport/index', redirect: '', - name: '预览附件', - component: "@/pages/previewFile/index", + name: '运营报表', + component: "@/pages/operationReport/index", + }, + { + path: '/operationReport/routineInspection', + redirect: '', + name: '日常巡检记录表', + component: "@/pages/operationReport/routineInspection", + }, + { + path: '/operationReport/onSiteInspection', + redirect: '', + name: '现场巡检记录表', + component: "@/pages/operationReport/onSiteInspection", + }, + { + path: '/operationReport/securityIssueList', + redirect: '', + name: '安全问题记录表', + component: "@/pages/operationReport/securityIssueList", + }, + { + path: '/operationReport/rectificationStatus', + redirect: '', + name: '整改情况追踪表', + component: "@/pages/operationReport/rectificationStatus", }, ] } @@ -338,7 +362,11 @@ const UserModel: UserModelType = { "/redReversal/index", "/InvoiceSearch/index", "/serverpartAssets/index", - "/previewFile/index", + "/operationReport/index", + "/operationReport/routineInspection", + "/operationReport/onSiteInspection", + "/operationReport/securityIssueList", + "/operationReport/rectificationStatus", // '/examine/index', // '/examine/modal', // '/examine/question', diff --git a/src/pages/authority.ts b/src/pages/authority.ts index 16ef436..b7cce4b 100644 --- a/src/pages/authority.ts +++ b/src/pages/authority.ts @@ -6,7 +6,11 @@ const authority: PageAuthority = { '/redReversal/index': ['/redReversal/index'], '/InvoiceSearch/index': ['/InvoiceSearch/index'], '/serverpartAssets/index': ['/serverpartAssets/index'], - '/previewFile/index': ['/previewFile/index'], + '/operationReport/index': ['/operationReport/index'], + '/operationReport/routineInspection': ['/operationReport/routineInspection'], + '/operationReport/onSiteInspection': ['/operationReport/onSiteInspection'], + '/operationReport/securityIssueList': ['/operationReport/securityIssueList'], + '/operationReport/rectificationStatus': ['/operationReport/rectificationStatus'], }; diff --git a/src/pages/operationReport/components/AddInspectionContent.tsx b/src/pages/operationReport/components/AddInspectionContent.tsx new file mode 100644 index 0000000..86ea23f --- /dev/null +++ b/src/pages/operationReport/components/AddInspectionContent.tsx @@ -0,0 +1,193 @@ +// 同步检查项目的悬浮框 +import { uploadAHYDPicture } from "@/pages/serverpartAssets/service"; +import { ExclamationCircleOutlined } from "@ant-design/icons"; +import { ProForm, ProFormDigit, ProFormSelect, ProFormText, ProFormTextArea, ProFormTimePicker, ProFormUploadButton, ProFormUploadDragger } from "@ant-design/pro-components"; +import { Col, FormInstance, message, Modal, Row } from "antd"; +import { useRef, useState } from "react"; +import { connect } from "umi"; + + +const beforeUpload = (file: any) => { + const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'; + if (!isJpgOrPng) { + message.error('请上传JPEG、jpg、png格式的图片文件!'); + } + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + message.error('图片大小不超过 2MB!'); + } + return isJpgOrPng && isLt2M; +} + +type DetailProps = { + onRef: any, + onShow: boolean, + setOnShow: (value: boolean) => void + handleAddInspectionContentData: (formRef: any) => void +} + +const AddInspectionContent = ({ onRef, onShow, setOnShow, handleAddInspectionContentData }: DetailProps) => { + const { confirm } = Modal; + const AddInspectionContentFormRef = useRef(); + + // 文件列表 + const [fileList, setFileList] = useState([]) + // 预览图片 + const [imagePreviewVisible, setImagePreviewVisible] = useState(false) + + // 预览上传后的图片 + const handlePreview = async () => { + setFileList(fileList) + setImagePreviewVisible(true) + }; + + return ( +
+ { + setOnShow(false) + setFileList([]) + }} + onOk={async () => { // 提交框内的数据 + AddInspectionContentFormRef.current?.validateFields().then((res: any) => { + if (handleAddInspectionContentData) { + let str: string = '' + if (fileList && fileList.length > 0) { + fileList.forEach((item: any) => { + if (str) { + str += `,${item.url}` + } else { + str = `${item.url}` + } + }) + } + let obj: any = { + ...res, + EXCEPTIONPHOTO_URL: str + } + handleAddInspectionContentData(obj) + } + }) + setOnShow(false) + setFileList([]) + }} + > + + + + + + + + + + + + + + + + { + const formData = new FormData(); + formData.append('files', info.file); + formData.append('TableType', '1208'); + formData.append('ImageName', typeof info.file !== 'string' ? info.file?.name : ''); + if (info.filename) { + const success = await uploadAHYDPicture(formData) + console.log('successsuccesssuccess', success); + + if (success) { + let list: any = [] + if (fileList && fileList.length > 0) { + list = JSON.parse(JSON.stringify(fileList)) + } + list.push({ + name: success.Result_Data.ImageName, + url: success.Result_Data.ImageUrl, // url 是展示在页面上的绝对链接 + }) + setFileList(list) + } + } else { + message.error("您上传的图片不存在.") + } + }, + onChange: async (info: any) => { + console.log('infoinfoinfo', info); + + if (info.file.status === 'removed') { + confirm({ + title: '确认删除该图片吗?', + icon: , + async onOk() { + let list: any = JSON.parse(JSON.stringify(fileList)) + let res: any = [] + if (list && list.length > 0) { + list.forEach((item: any) => { + if (item.url === info.file.url) { + + } else { + res.push(item) + } + }) + } + setFileList(res) + } + }); + } + } + }} + /> + + + + + + +
+ ) +} + + + +export default connect(({ user }: ConnectState) => ({ + currentUser: user.data +}))(AddInspectionContent); \ No newline at end of file diff --git a/src/pages/operationReport/components/AddInspectionItems.tsx b/src/pages/operationReport/components/AddInspectionItems.tsx new file mode 100644 index 0000000..d553997 --- /dev/null +++ b/src/pages/operationReport/components/AddInspectionItems.tsx @@ -0,0 +1,138 @@ +// 同步检查项目的悬浮框 +import { ProForm, ProFormDateTimePicker, ProFormDigit, ProFormSelect, ProFormText, ProFormTimePicker } from "@ant-design/pro-components"; +import { Col, FormInstance, Modal, Row } from "antd"; +import { useRef } from "react"; +import { connect } from "umi"; + +type DetailProps = { + onRef: any, + onShow: boolean, + setOnShow: (value: boolean) => void + handleGetNewProjectData: (formRef: any) => void + pageDataType: number // 页面类型 1000 是日常巡检 3000 是现场巡检 +} + +const AddInspectionItems = ({ onRef, onShow, setOnShow, handleGetNewProjectData, pageDataType }: DetailProps) => { + const AddInspectionItemsFormRef = useRef(); + + + return ( +
+ { + setOnShow(false) + }} + onOk={async () => { // 提交框内的数据 + AddInspectionItemsFormRef.current?.validateFields().then((res: any) => { + if (handleGetNewProjectData) { + handleGetNewProjectData(res) + } + }) + setOnShow(false) + }} + > + + + + + + + + + + + + + + + { + pageDataType === 3000 ? + <> + + + + + + + + + + : "" + } + {/* + + + + + */} + + + + +
+ ) +} + + + +export default connect(({ user }: ConnectState) => ({ + currentUser: user.data +}))(AddInspectionItems); \ No newline at end of file diff --git a/src/pages/operationReport/components/RectificationStatusInfoModal.tsx b/src/pages/operationReport/components/RectificationStatusInfoModal.tsx new file mode 100644 index 0000000..e23c386 --- /dev/null +++ b/src/pages/operationReport/components/RectificationStatusInfoModal.tsx @@ -0,0 +1,319 @@ +// 同步检查项目的悬浮框 +import { uploadAHYDPicture } from "@/pages/serverpartAssets/service"; +import { ExclamationCircleOutlined } from "@ant-design/icons"; +import { ProForm, ProFormDatePicker, ProFormDigit, ProFormSelect, ProFormText, ProFormTextArea, ProFormTimePicker, ProFormUploadButton } from "@ant-design/pro-components"; +import { Col, FormInstance, message, Modal, Row } from "antd"; +import { useRef, useState } from "react"; +import { connect } from "umi"; +import { handleGetServerpartTree, handleGetSERVERPARTTYPEList } from "../service"; + +type DetailProps = { + onRef: any, + onShow: boolean, + setOnShow: (value: boolean) => void + handleGetRectificationStatusData: any + parentRow: any // 当前的记录详情 +} + + +const beforeUpload = (file: any) => { + const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'; + if (!isJpgOrPng) { + message.error('请上传JPEG、jpg、png格式的图片文件!'); + } + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + message.error('图片大小不超过 2MB!'); + } + return isJpgOrPng && isLt2M; +} + +const RectificationStatusInfoModal = ({ onRef, onShow, setOnShow, handleGetRectificationStatusData, parentRow }: DetailProps) => { + const { confirm } = Modal; + const RectificationStatusInfoFormRef = useRef(); + // 文件列表 + const [fileList, setFileList] = useState([]) + // 预览图片 + const [imagePreviewVisible, setImagePreviewVisible] = useState(false) + // 当前片区下的服务区列表 + const [serverPartList, setServerPartList] = useState() + + // 预览上传后的图片 + const handlePreview = async () => { + setFileList(fileList) + setImagePreviewVisible(true) + }; + + // 根据区域获取到服务区列表 + const handleGetServerPartList = async (id: string) => { + const req: any = { + ProvinceCode: "530000", + SPRegionType_ID: id + } + const data = await handleGetServerpartTree(req) + console.log('dsadasda', data); + if (data && data.length > 0) { + let list = data[0].children + setServerPartList(list) + } else { + setServerPartList([]) + } + } + + return ( +
+ { + setOnShow(false) + }} + onOk={async () => { // 提交框内的数据 + RectificationStatusInfoFormRef.current?.validateFields().then((res: any) => { + if (handleGetRectificationStatusData) { + let str: string = '' + if (fileList && fileList.length > 0) { + fileList.forEach((item: any) => { + if (str) { + str += `,${item.url}` + } else { + str = `${item.url}` + } + }) + } + let obj: any = { + ...res, + LOCALEPHOTO: str + } + handleGetRectificationStatusData(obj) + } + }) + setOnShow(false) + }} + > + { + if (parentRow) { + console.log('parentRowparentRowparentRow', parentRow); + handleGetServerPartList(parentRow?.SPREGIONTYPE_ID) + return { + SERVERPART_ID: parentRow?.SERVERPART_ID, + SERVERPART_NAME: parentRow?.SERVERPART_NAME, + SPREGIONTYPE_ID: parentRow?.SPREGIONTYPE_ID, + SPREGIONTYPE_NAME: parentRow?.SPREGIONTYPE_NAME, + } + } else { + return { + + } + } + }} + > + + + { + const req: any = { + SearchParameter: { + SERVERPARTSTATICTYPE_ID: 1000, + TYPE_STATE: 1, + PROVINCE_CODE: 530000 + }, + PageIndex: 1, + PageSize: 100, + SortStr: "TYPE_INDEX,SERVERPARTTYPE_ID" + } + const data = await handleGetSERVERPARTTYPEList(req) + console.log('datadatadatadata', data); + let list: any = [] + if (data && data.length > 0) { + data.forEach((item: any) => { + list.push({ label: item.TYPE_NAME, value: item.SERVERPARTTYPE_ID }) + }) + } + return list + }} + fieldProps={{ + showSearch: true, + filterOption: (input, option) => + (option?.label ?? '').toLowerCase().includes(input.toLowerCase()), + optionFilterProp: 'label', + onChange: (value: any, option: any) => { + console.log('valuevalue', value); + handleGetServerPartList(value) + if (value) { + RectificationStatusInfoFormRef.current?.setFieldsValue({ SPREGIONTYPE_NAME: option.label }) + } else { + RectificationStatusInfoFormRef.current?.setFieldsValue({ SPREGIONTYPE_NAME: "" }) + } + } + }} + disabled={parentRow} + /> + + + + + + { + console.log('e', e); + if (e) { + RectificationStatusInfoFormRef.current?.setFieldsValue({ SERVERPART_NAME: option.label }) + } else { + RectificationStatusInfoFormRef.current?.setFieldsValue({ SERVERPART_NAME: "" }) + } + } + }} + rules={[{ required: true, message: '请选择服务区!' }]} + disabled={parentRow} + /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + const formData = new FormData(); + formData.append('files', info.file); + formData.append('TableType', '1208'); + formData.append('ImageName', typeof info.file !== 'string' ? info.file?.name : ''); + if (info.filename) { + const success = await uploadAHYDPicture(formData) + console.log('successsuccesssuccess', success); + + if (success) { + let list: any = [] + if (fileList && fileList.length > 0) { + list = JSON.parse(JSON.stringify(fileList)) + } + list.push({ + name: success.Result_Data.ImageName, + url: success.Result_Data.ImageUrl, // url 是展示在页面上的绝对链接 + }) + setFileList(list) + } + } else { + message.error("您上传的图片不存在.") + } + }, + onChange: async (info: any) => { + console.log('infoinfoinfo', info); + + if (info.file.status === 'removed') { + confirm({ + title: '确认删除该图片吗?', + icon: , + async onOk() { + let list: any = JSON.parse(JSON.stringify(fileList)) + let res: any = [] + if (list && list.length > 0) { + list.forEach((item: any) => { + if (item.url === info.file.url) { + + } else { + res.push(item) + } + }) + } + setFileList(res) + } + }); + } + } + }} + /> + + + + + + + + + +
+ ) +} + + + +export default connect(({ user }: ConnectState) => ({ + currentUser: user.data +}))(RectificationStatusInfoModal); \ No newline at end of file diff --git a/src/pages/operationReport/index.tsx b/src/pages/operationReport/index.tsx new file mode 100644 index 0000000..a0ed913 --- /dev/null +++ b/src/pages/operationReport/index.tsx @@ -0,0 +1,757 @@ +// 预览附件的页面 +import { connect } from "umi"; +import { ConnectState } from "@/models/global"; +import './style.less' +import { ActionType, FormInstance, ProForm, ProFormDatePicker, ProFormSelect, ProFormText, ProFormTimePicker, ProTable } from "@ant-design/pro-components"; +import { useEffect, useRef, useState } from "react"; +import { Button, Col, Divider, message, Row, Image } from "antd"; +import { handleGetPATROLList, handleGetSERVERPARTDetail, handleGetServerpartTree, handleGetSERVERPARTTYPEList, handleSynchroPATROL, handleSynchroRECTIFICATION } from "./service"; +import { handleGetPassportInfoById } from "../DigitalElectronics/service"; +import moment from "moment"; +import { encryptAES } from "@/utils/handleAes"; +import AddInspectionItems from "./components/AddInspectionItems"; +import AddInspectionContent from "./components/AddInspectionContent"; +import normalIcon from '../../assets/normalIcon.png' +import errorIcon from '../../assets/errorIcon.png' +import RectificationStatusInfoModal from "./components/RectificationStatusInfoModal"; +import { handleGetServerpartInfo } from "../serverpartAssets/service"; + + +type DetailProps = { + PATROLID: string; //巡检id + currentUser?: any;// 用户明细 +} + + +const OperationReport = ({ PATROLID }: DetailProps) => { + const actionRef = useRef(); + const AddInspectionItemsRef = useRef(); + const AddInspectionContentRef = useRef(); + const formRef = useRef(); + // 选中的行 + const [selectedRowKey, setSelectedRowKey] = useState(); + // 保存数据 + const [saveLoading, setSaveLoading] = useState(false) + // 当前的用户信息 + const [userInfoDetail, setUserInfoDetail] = useState() + // 当前片区下的服务区列表 + const [serverPartList, setServerPartList] = useState() + // 当前服务区下的方位 + const [SERVERPARTREGION, setSERVERPARTREGION] = useState() + // 显示同步巡检项目的悬浮框 + const [showInspectionItemsModal, setShowInspectionItemsModal] = useState(false) + // 巡检项目 表格数据 + const [inspectionItemsTableData, setInspectionItemsTableData] = useState() + // 添加巡检内容的悬浮框 + const [addContentModal, setAddContentModal] = useState(false) + // 根据当前的巡检项目的id 里面包含的巡检内容 + const [inspectionItemObj, setInspectionItemObj] = useState() + // 巡检内容 显示的列表 + const [inspectionContentList, setInspectionContentList] = useState() + // 页面的数据类型 区分日常巡检 和 现场巡检 + const [pageDataType, setPageDataType] = useState(1000) + // 整改情况modal + const [rectificationStatusModal, setRectificationStatusModal] = useState(false) + // 当前的巡检记录 + const [currentRecord, setCurrentRecord] = useState() + + + // 表格字段 + const columns: any = [ + { + title: "序号", + dataIndex: 'index', + valueType: 'index', + hideInSearch: true, + align: 'center', + width: 80, + ellipsis: true + }, + { + title: "状态", + dataIndex: 'PATROLDETAIL_STATE', + valueType: 'select', + hideInSearch: true, + align: 'center', + width: 120, + ellipsis: true, + fieldProps: { + options: [ + { label: "编辑中", value: 1 }, + { label: "巡查中", value: 2 }, + { label: "待跟进", value: 3 }, + { label: "整改中", value: 4 }, + { label: "已完成", value: 5 }, + ] + } + }, + { + title: pageDataType === 3000 ? "检查项目" : "巡检项目", + dataIndex: 'PATROL_POSITION', + hideInSearch: true, + align: 'center', + width: 180, + ellipsis: true + }, + { + title: "合作单位", + dataIndex: 'DUTYUNIT_NAME', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "检查人", + dataIndex: 'PATROL_POSITION', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true, + hideInTable: pageDataType === 3000 ? false : true + }, + { + title: "检查开始时间", + dataIndex: 'INSPECTION_STARTTIME', + hideInSearch: true, + align: 'center', + width: 180, + ellipsis: true, + hideInTable: pageDataType === 3000 ? false : true + }, + { + title: "检查完成时间", + dataIndex: 'INSPECTION_ENDTIME', + hideInSearch: true, + align: 'center', + width: 180, + ellipsis: true, + hideInTable: pageDataType === 3000 ? false : true + }, + ] + + // 数据录入的方法 + const handleAddUpdate = async (obj: any) => { + // 用参数去判断 两个嵌套的子集 是否已经有数据了 没有的话 就提示 + let list: any = [] + console.log('inspectionItemsTableDatainspectionItemsTableData', inspectionItemsTableData); + console.log('inspectionItemObjinspectionItemObjinspectionItemObj', inspectionItemObj); + if (inspectionItemsTableData && inspectionItemsTableData.length > 0) { + list = JSON.parse(JSON.stringify(inspectionItemsTableData)) + list.forEach((item: any) => { + if (inspectionItemObj[`${item?.PATROL_ID}-${item?.rowIndex || item?.PATROLDETAIL_ID}`] && inspectionItemObj[`${item?.PATROL_ID}-${item?.rowIndex || item?.PATROLDETAIL_ID}`].length > 0) { + item.PATROLCONTENTList = inspectionItemObj[`${item?.PATROL_ID}-${item?.rowIndex || item?.PATROLDETAIL_ID}`] + } + }) + } + + + + const req: any = { + ...obj, + INSPECTION_ENDTIME: moment(obj.INSPECTION_ENDTIME).format('YYYY-MM-DD'), + INSPECTION_STARTTIME: moment(obj.INSPECTION_STARTTIME).format('YYYY-MM-DD'), + PATROL_DATE: moment(obj.PATROL_DATE).format('YYYY-MM-DD'), + PATROL_STARTTIME: `${moment(obj.PATROL_DATE).format('YYYY-MM-DD')} ${moment(obj.PATROL_STARTTIME).format('HH:mm:ss')}`, + PATROL_ENDTIME: `${moment(obj.PATROL_DATE).format('YYYY-MM-DD')} ${moment(obj.PATROL_ENDTIME).format('HH:mm:ss')}`, + STAFF_ID: userInfoDetail.ID, + STAFF_NAME: userInfoDetail.Name, + OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'), + PATROL_TYPE: pageDataType || 1000, + PATROLDETAILList: list + } + console.log('reqreqreq', req); + + + + if (req.PATROLDETAILList && req.PATROLDETAILList.length > 0) { + // 只要有一个子集就是 true + let isOk: boolean = false + req.PATROLDETAILList.forEach((item: any) => { + if (item.PATROLCONTENTList && item.PATROLCONTENTList.length > 0) { + isOk = true + } + }) + if (!isOk) { + message.error('巡检内容数据未录入!') + return + } + } else { + message.error('巡检项目数据未录入!') + return + } + + let newReq: any = { + name: "", + value: encryptAES(JSON.stringify(req)) + } + const data = await handleSynchroPATROL(newReq) + console.log('datadadsad', data); + if (data.Result_Code === 100) { + message.success('同步成功!') + + } else { + message.error(data.Result_Desc) + } + setSaveLoading(false) + } + + // 根据区域获取到服务区列表 + const handleGetServerPartList = async (id: string) => { + const req: any = { + ProvinceCode: "530000", + SPRegionType_ID: id + } + const data = await handleGetServerpartTree(req) + console.log('dsadasda', data); + if (data && data.length > 0) { + let list = data[0].children + setServerPartList(list) + } else { + setServerPartList([]) + } + } + + // 拿到新增的巡检项目的内容 假保存的 + const handleGetNewProjectData = async (formData: any) => { + if (inspectionItemsTableData && inspectionItemsTableData.length > 0) { + let list: any = JSON.parse(JSON.stringify(inspectionItemsTableData)) + list.push({ + ...formData, + rowIndex: inspectionItemsTableData.length + 1, + STAFF_ID: userInfoDetail.ID, + STAFF_NAME: userInfoDetail.Name, + OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'), + }) + setInspectionItemsTableData(list) + } else { + let list: any = [{ ...formData, rowIndex: 1 }] + setSelectedRowKey(`${formData?.PATROL_ID}-1`); + setInspectionItemsTableData(list) + } + + setShowInspectionItemsModal(false) + } + + // 拿到添加巡检内容 悬浮框里面的内容 + const handleAddInspectionContentData = async (formData: any) => { + let obj: any = {} + if (inspectionItemObj) { + obj = JSON.parse(JSON.stringify(inspectionItemObj)) + } + let list: any = [] + if (inspectionItemObj && inspectionItemObj[selectedRowKey] && inspectionItemObj[selectedRowKey].length > 0) { + list = JSON.parse(JSON.stringify(inspectionItemObj[selectedRowKey])) + } + + if (list && list.length > 0) { + list.push({ ...formData, rowId: selectedRowKey }) + } else { + list = [{ ...formData, rowId: selectedRowKey }] + } + obj[selectedRowKey] = list + + setInspectionItemObj(obj) + setInspectionContentList(list) + + // setInspectionItemObj + // setInspectionContentList + } + + // 根据传入的行号 切换显示的巡检内容 + const handleChangeContentList = async (id: string) => { + let list: any = [] + if (inspectionItemObj && inspectionItemObj[id] && inspectionItemObj[id].length > 0) { + list = inspectionItemObj[id] + } + setInspectionContentList(list) + } + + // 拿到整改情况的录入数据 + const handleGetRectificationStatusData = async (formData: any) => { + console.log('formDataformData', formData); + const req: any = { + ...formData, + PATROL_ID: PATROLID, + STAFF_ID: userInfoDetail.ID, + STAFF_NAME: userInfoDetail.Name, + OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'), + } + let newReq: any = { + name: "", + value: encryptAES(JSON.stringify(req)) + } + + const data = await handleSynchroRECTIFICATION(newReq) + if (data.Result_Code === 100) { + message.success('同步成功!') + + } else { + message.error(data.Result_Desc) + } + setRectificationStatusModal(false) + } + + // 获取到服务区方位的方法 + const handleGetSERVERPARTREGION = async (id: string) => { + setSERVERPARTREGION([]) + const req: any = { + SERVERPARTId: id + } + const data = await handleGetServerpartInfo(req) + console.log('datadatadata', data); + let list: any = [] + if (data.RegionInfo && data.RegionInfo.length > 0) { + data.RegionInfo.forEach((item: any) => { + list.push({ label: item.SERVERPART_REGIONNAME, value: item.SERVERPART_REGION }) + }) + } + setSERVERPARTREGION(list) + } + + + return ( +
+
+
+
{`${pageDataType === 3000 ? '现场巡检' : '日常巡检'}${PATROLID ? '详情' : '录入'}`}
+
+ { + PATROLID ? '' : + + } + +
+
+ { + // 地址栏传参 UserIdEncrypted 为当前登录用户的加密id + const search = window.location.search; + const addressParams = Object.fromEntries(new URLSearchParams(search).entries()); + console.log('addressParamsaddressParams', addressParams); + const req: any = { + UserIdEncrypted: addressParams.UserIdEncrypted + } + const userInfo = await handleGetPassportInfoById(req) + setUserInfoDetail(userInfo) + + if (addressParams.dataType) { + setPageDataType(Number(addressParams.dataType)) + } + + if (PATROLID) { + const req: any = { + PATROL_IDS: PATROLID + } + let newReq: any = { + name: "", + value: encryptAES(JSON.stringify(req)) + } + const data = await handleGetPATROLList(newReq) + if (data && data.length > 0) { + let detail: any = data[0] + console.log('detaildetail', detail); + + setCurrentRecord(detail) + if (detail.PATROLDETAILList && detail.PATROLDETAILList.length > 0) { + console.log('sdada', detail.PATROLDETAILList); + let list: any = detail.PATROLDETAILList + setInspectionItemsTableData(list) + + let obj: any = {} + + list.forEach((item: any, index: number) => { + obj[`${item?.PATROL_ID}-${item?.rowIndex || item?.PATROLDETAIL_ID}`] = item.PATROLCONTENTList + }) + + setInspectionItemObj(obj) + setInspectionContentList(obj[`${list[0].PATROL_ID}-${list[0].rowIndex || list[0].PATROLDETAIL_ID}`]) + setSelectedRowKey(`${list[0].PATROL_ID}-${list[0].rowIndex || list[0].PATROLDETAIL_ID}`); + } + + handleGetServerPartList(detail.SPREGIONTYPE_ID) + + handleGetSERVERPARTREGION(detail.SERVERPART_ID) + return { + ...detail + } + } + + + + } else { + return { + STAFF_NAME: userInfo.Name, + OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss') + } + } + }} + > + + + + + + + { + const req: any = { + SearchParameter: { + SERVERPARTSTATICTYPE_ID: 1000, + TYPE_STATE: 1, + PROVINCE_CODE: 530000 + }, + PageIndex: 1, + PageSize: 100, + SortStr: "TYPE_INDEX,SERVERPARTTYPE_ID" + } + const data = await handleGetSERVERPARTTYPEList(req) + console.log('datadatadatadata', data); + let list: any = [] + if (data && data.length > 0) { + data.forEach((item: any) => { + list.push({ label: item.TYPE_NAME, value: item.SERVERPARTTYPE_ID }) + }) + } + return list + }} + fieldProps={{ + showSearch: true, + filterOption: (input, option) => + (option?.label ?? '').toLowerCase().includes(input.toLowerCase()), + optionFilterProp: 'label', + onChange: (value: any, option: any) => { + console.log('valuevalue', value); + handleGetServerPartList(value) + if (value) { + formRef.current?.setFieldsValue({ SPREGIONTYPE_NAME: option.label }) + } else { + formRef.current?.setFieldsValue({ SPREGIONTYPE_NAME: "" }) + } + } + }} + rules={[{ + required: true, + message: '请选择所属片区!' + }]} + readonly={PATROLID ? true : false} + /> + + + + + + { + console.log('e', e); + handleGetSERVERPARTREGION(e) + if (e) { + formRef.current?.setFieldsValue({ SERVERPART_NAME: option.label }) + } else { + formRef.current?.setFieldsValue({ SERVERPART_NAME: "" }) + } + } + }} + readonly={PATROLID ? true : false} + /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + pageDataType === 3000 ? + + {/* */} + : + <> + + + + + + + + } + + + + {/* 非表单内容 */} + + + 巡检项目 +
+ { + return `${record?.PATROL_ID}-${record?.rowIndex || record?.PATROLDETAIL_ID}` + }} + search={PATROLID ? false : {}} + options={false} + columns={columns} + bordered + scroll={{ x: "100%", y: 230 }} + dataSource={inspectionItemsTableData} + onRow={(record) => ({ + onClick: () => { + setSelectedRowKey(`${record?.PATROL_ID}-${record?.rowIndex || record?.PATROLDETAIL_ID}`); + handleChangeContentList(`${record?.PATROL_ID}-${record?.rowIndex || record?.PATROLDETAIL_ID}`) + }, + })} + className="leftItemProTable" + rowClassName={(record) => (`${record?.PATROL_ID}-${record?.rowIndex || record?.PATROLDETAIL_ID}` === selectedRowKey ? 'ant-table-row-selected' : '')} + toolbar={{ + actions: PATROLID ? [] : [ + + ] + }} + /> +
+ + + 巡检内容 + +
+ { + selectedRowKey ? + PATROLID ? '' : + : "" + } +
+ +
+ { + inspectionContentList && inspectionContentList.length > 0 ? + inspectionContentList.map((item: any) => { + return
+
+ +
+
+
{item?.PATROLDETAIL_CONTENT || ""}
+ { + item.EXCEPTION_CONTENT ? +
+
异常描述:
+
{item?.EXCEPTION_CONTENT || ""}
+
+ + {item.EXCEPTIONPHOTO_URL && + item.EXCEPTIONPHOTO_URL.split(',').map((url: string, index: number) => ( + + ))} + +
+
: "" + } +
+ +
+
{ + setRectificationStatusModal(true) + }}>整改情况
+
+
+ }) : "" + } +
+ + + +
+ + + + {/* 添加巡检项目 */} + + + {/* 添加巡检内容的悬浮框 */} + + + {/* 整改情况 的录入悬浮框 */} + +
+ + ) +} + + +export default connect(({ user }: ConnectState) => ({ + currentUser: user.data +}))(OperationReport); \ No newline at end of file diff --git a/src/pages/operationReport/onSiteInspection.tsx b/src/pages/operationReport/onSiteInspection.tsx new file mode 100644 index 0000000..d67b1df --- /dev/null +++ b/src/pages/operationReport/onSiteInspection.tsx @@ -0,0 +1,254 @@ +// 服务商现场检查记录表 +import { connect } from "umi"; + +import LeftSelectTree from "@/components/leftSelectTree/leftSelectTree"; +import { ActionType, FormInstance, ProTable } from "@ant-design/pro-components"; +import { useEffect, useRef, useState } from "react"; +import { handleGetPATROLList } from "./service"; +import moment from 'moment' +import { encryptAES } from "@/utils/handleAes"; +import { Drawer } from "antd"; +import OperationReport from './index' + + +const onSiteInspection = () => { + const actionRef = useRef(); + const formRef = useRef(); + const [collapsible, setCollapsible] = useState(false) + // 树相关的属性和方法 + const [selectedId, setSelectedId] = useState() + // 行数据信息 + const [currentRow, setCurrentRow] = useState() + // 显示详情抽屉 + const [showDetailDrawer, setShowDetailDrawer] = useState(false) + + const columns: any = [ + { + title: '巡检时间', + dataIndex: 'search_date', + valueType: 'dateRange', + hideInTable: true, + hideInDescriptions: true, + search: { + transform: (value: any) => { + return { + INSPECTION_STARTTIME_Start: value[0], + INSPECTION_STARTTIME_End: value[1], + }; + }, + }, + fieldProps: { + ranges: { + "本月": [moment().startOf('M'), moment()], + "上月": [moment().subtract(1, 'M').startOf('M'), moment().subtract(1, 'M').endOf('M')], + "近三月": [moment().subtract(3, 'M').startOf('M'), moment().endOf('M')], + "近半年": [moment().subtract(6, 'M').startOf('M'), moment().endOf('M')], + } + }, + initialValue: [moment().startOf('M'), moment()], + }, + { + title: "序号", + dataIndex: 'index', + valueType: 'index', + hideInSearch: true, + align: 'center', + width: 80, + ellipsis: true + }, + { + title: "状态", + dataIndex: 'COMPLETE_STATE', + valueType: 'select', + hideInSearch: true, + align: 'center', + width: 120, + ellipsis: true, + fieldProps: { + options: [ + { label: "编辑中", value: 1 }, + { label: "巡查中", value: 2 }, + { label: "待跟进", value: 3 }, + { label: "整改中", value: 4 }, + { label: "已完成", value: 5 }, + ] + } + }, + { + title: "标题", + dataIndex: 'PATROL_TITLE', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true, + render: (_, record) => { + return { + setCurrentRow(record) + setShowDetailDrawer(true) + }}>{record?.PATROL_TITLE || ""} + } + }, + { + title: "片区名称", + dataIndex: 'SPREGIONTYPE_NAME', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "服务区名称", + dataIndex: 'SERVERPART_NAME', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "检查人", + dataIndex: 'PATROL_PERSON', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "检查日期", + dataIndex: 'PATROL_DATE', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "检查开始时间", + dataIndex: 'PATROL_STARTTIME', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "检查完成时间", + dataIndex: 'PATROL_ENDTIME', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "要求整改时间", + dataIndex: '要求整改时间', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "跟进处理时间", + dataIndex: '跟进处理时间', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "处理完成时间", + dataIndex: '处理完成时间', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "是否逾期", + dataIndex: 'overdueOrNot', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true, + render: (_, record) => { + let type: string = new Date(record?.INSPECTION_ENDTIME).getTime() > new Date(record?.PATROL_ENDTIME).getTime() ? '是' : "否" + return {type} + } + } + ] + + + + return ( +
+ +
+ { + if (!selectedId) { + return { data: [], success: true } + } + + const req: any = { + SearchParameter: { + PATROL_TYPES: 3000, + SERVERPART_IDS: selectedId, + INSPECTION_STARTTIME_Start: params?.INSPECTION_STARTTIME_Start || "", + INSPECTION_STARTTIME_End: params?.INSPECTION_STARTTIME_End || "", + }, + PageIndex: 1, + PageSize: 999999, + } + + let newReq: any = { + name: "", + value: encryptAES(JSON.stringify(req)) + } + const data = await handleGetPATROLList(newReq) + if (data && data.length > 0) { + return { data, success: true } + } + return { data: [], success: true } + }} + toolbar={{ + actions: [ + + ] + }} + /> +
+ + + {/* 详情抽屉 */} + { + setShowDetailDrawer(false); + setCurrentRow(undefined); + }} + bodyStyle={{ padding: '0 24px 24px' }} + destroyOnClose + closable={false} + > + + +
+ ) +} + + + +export default connect(({ user }: ConnectState) => ({ + currentUser: user.data +}))(onSiteInspection); \ No newline at end of file diff --git a/src/pages/operationReport/rectificationStatus.tsx b/src/pages/operationReport/rectificationStatus.tsx new file mode 100644 index 0000000..baa1365 --- /dev/null +++ b/src/pages/operationReport/rectificationStatus.tsx @@ -0,0 +1,254 @@ +// 整改情况追踪表 +import { connect } from "umi"; + +import LeftSelectTree from "@/components/leftSelectTree/leftSelectTree"; +import { ActionType, FormInstance, ProTable } from "@ant-design/pro-components"; +import { useEffect, useRef, useState } from "react"; +import { handleGetPATROLList, handleGetRECTIFICATIONList } from "./service"; +import moment from 'moment' +import { encryptAES } from "@/utils/handleAes"; +import { Drawer } from "antd"; +import OperationReport from './index' + + +const rectificationStatus = () => { + const actionRef = useRef(); + const formRef = useRef(); + const [collapsible, setCollapsible] = useState(false) + // 树相关的属性和方法 + const [selectedId, setSelectedId] = useState() + // 行数据信息 + const [currentRow, setCurrentRow] = useState() + // 显示详情抽屉 + const [showDetailDrawer, setShowDetailDrawer] = useState(false) + + const columns: any = [ + { + title: '巡检时间', + dataIndex: 'search_date', + valueType: 'dateRange', + hideInTable: true, + hideInDescriptions: true, + search: { + transform: (value: any) => { + return { + INSPECTION_STARTTIME_Start: value[0], + INSPECTION_STARTTIME_End: value[1], + }; + }, + }, + fieldProps: { + ranges: { + "本月": [moment().startOf('M'), moment()], + "上月": [moment().subtract(1, 'M').startOf('M'), moment().subtract(1, 'M').endOf('M')], + "近三月": [moment().subtract(3, 'M').startOf('M'), moment().endOf('M')], + "近半年": [moment().subtract(6, 'M').startOf('M'), moment().endOf('M')], + } + }, + initialValue: [moment().startOf('M'), moment()], + }, + { + title: "序号", + dataIndex: 'index', + valueType: 'index', + hideInSearch: true, + align: 'center', + width: 80, + ellipsis: true + }, + { + title: "片区名称", + dataIndex: 'SPREGIONTYPE_NAME', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "服务区名称", + dataIndex: 'SERVERPART_NAME', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "责任单位", + dataIndex: 'DUTYUNIT', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "责任人", + dataIndex: 'DUTYPSNNAME', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "联系电话", + dataIndex: 'PHONE', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "巡检人", + dataIndex: 'INSPECTIONPSN', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "巡检日期", + dataIndex: 'INSPECTIONDATE', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true, + }, + { + title: "巡检问题", + dataIndex: 'INSPECTIONQUESTION', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "整改要求", + dataIndex: 'RECTIFICATIONREQUEST', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "整改期限", + dataIndex: 'DEADLINE', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "整改截止时间", + dataIndex: 'TILLTIME', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "整改完成时间", + dataIndex: 'FINISHTIME', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "整改结果", + dataIndex: 'RECTIFICATION_RESULT', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "现场照片", + dataIndex: 'LOCALEPHOTO', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "整改后照片", + dataIndex: 'RESULTPHOTO', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "状态", + dataIndex: 'COMPLETE_STATE', + valueType: 'select', + hideInSearch: true, + align: 'center', + width: 120, + ellipsis: true, + fieldProps: { + options: [ + { label: "编辑中", value: 1 }, + { label: "巡查中", value: 2 }, + { label: "待跟进", value: 3 }, + { label: "整改中", value: 4 }, + { label: "已完成", value: 5 }, + ] + } + } + ] + + return ( +
+ +
+ { + const req: any = { + SearchParameter: { + INSPECTIONDATE_Start: params?.INSPECTION_STARTTIME_Start || "", + INSPECTIONDATE_End: params?.INSPECTION_STARTTIME_End || "", + }, + PageIndex: 1, + PageSize: 999999, + } + + let newReq: any = { + name: "", + value: encryptAES(JSON.stringify(req)) + } + + const data = await handleGetRECTIFICATIONList(newReq) + if (data && data.length > 0) { + return { data, success: true } + } + return { data: [], success: true } + }} + toolbar={{ + actions: [ + + ] + }} + /> +
+ + +
+ ) +} + + + +export default connect(({ user }: ConnectState) => ({ + currentUser: user.data +}))(rectificationStatus); \ No newline at end of file diff --git a/src/pages/operationReport/routineInspection.tsx b/src/pages/operationReport/routineInspection.tsx new file mode 100644 index 0000000..ba28a88 --- /dev/null +++ b/src/pages/operationReport/routineInspection.tsx @@ -0,0 +1,279 @@ +// 服务商日常检查记录表 +import { connect } from "umi"; + +import LeftSelectTree from "@/components/leftSelectTree/leftSelectTree"; +import { ActionType, FormInstance, ProTable } from "@ant-design/pro-components"; +import { useEffect, useRef, useState } from "react"; +import { handleGetPATROLList } from "./service"; +import moment from 'moment' +import { encryptAES } from "@/utils/handleAes"; +import { Drawer } from "antd"; +import OperationReport from './index' + + +const routineInspection = () => { + const actionRef = useRef(); + const formRef = useRef(); + const [collapsible, setCollapsible] = useState(false) + // 树相关的属性和方法 + const [selectedId, setSelectedId] = useState() + // 行数据信息 + const [currentRow, setCurrentRow] = useState() + // 显示详情抽屉 + const [showDetailDrawer, setShowDetailDrawer] = useState(false) + + const columns: any = [ + { + title: '巡检时间', + dataIndex: 'search_date', + valueType: 'dateRange', + hideInTable: true, + hideInDescriptions: true, + search: { + transform: (value: any) => { + return { + INSPECTION_STARTTIME_Start: value[0], + INSPECTION_STARTTIME_End: value[1], + }; + }, + }, + fieldProps: { + ranges: { + "本月": [moment().startOf('M'), moment()], + "上月": [moment().subtract(1, 'M').startOf('M'), moment().subtract(1, 'M').endOf('M')], + "近三月": [moment().subtract(3, 'M').startOf('M'), moment().endOf('M')], + "近半年": [moment().subtract(6, 'M').startOf('M'), moment().endOf('M')], + } + }, + initialValue: [moment().startOf('M'), moment()], + }, + { + title: "序号", + dataIndex: 'index', + valueType: 'index', + hideInSearch: true, + align: 'center', + width: 80, + ellipsis: true + }, + { + title: "状态", + dataIndex: 'COMPLETE_STATE', + valueType: 'select', + hideInSearch: true, + align: 'center', + width: 120, + ellipsis: true, + fieldProps: { + options: [ + { label: "编辑中", value: 1 }, + { label: "巡查中", value: 2 }, + { label: "待跟进", value: 3 }, + { label: "整改中", value: 4 }, + { label: "已完成", value: 5 }, + ] + } + }, + { + title: "任务标题", + dataIndex: 'PATROL_TITLE', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true, + render: (_, record) => { + return { + setCurrentRow(record) + setShowDetailDrawer(true) + }}>{record?.PATROL_TITLE || ""} + } + }, + { + title: "片区名称", + dataIndex: 'SPREGIONTYPE_NAME', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "服务区名称", + dataIndex: 'SERVERPART_NAME', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "发布人", + dataIndex: 'STAFF_NAME', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "发布时间", + dataIndex: 'OPERATE_DATE', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "巡检日期", + dataIndex: 'PATROL_DATE', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "时段名称", + dataIndex: '时段名称', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "开始时间", + dataIndex: 'PATROL_STARTTIME', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true, + render: (_, record) => { + return record?.PATROL_STARTTIME ? moment(record?.PATROL_STARTTIME).format('YYYY-MM-DD') : "" + } + }, + { + title: "截止时间", + dataIndex: 'PATROL_ENDTIME', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true, + render: (_, record) => { + return record?.PATROL_ENDTIME ? moment(record?.PATROL_ENDTIME).format('YYYY-MM-DD') : "" + } + }, + { + title: "巡检人", + dataIndex: 'PATROL_PERSON', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "巡检开始时间", + dataIndex: 'INSPECTION_STARTTIME', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true, + render: (_, record) => { + return record?.INSPECTION_STARTTIME ? moment(record?.INSPECTION_STARTTIME).format('YYYY-MM-DD') : "" + } + }, + { + title: "巡检完成时间", + dataIndex: 'INSPECTION_ENDTIME', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true, + render: (_, record) => { + return record?.INSPECTION_ENDTIME ? moment(record?.INSPECTION_ENDTIME).format('YYYY-MM-DD') : "" + } + }, + { + title: "是否逾期", + dataIndex: 'overdueOrNot', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true, + render: (_, record) => { + let type: string = new Date(record?.INSPECTION_ENDTIME).getTime() > new Date(record?.PATROL_ENDTIME).getTime() ? '是' : "否" + return {type} + } + } + ] + + return ( +
+ +
+ { + if (!selectedId) { + return { data: [], success: true } + } + const req: any = { + SearchParameter: { + PATROL_TYPES: 1000, + SERVERPART_IDS: selectedId, + INSPECTION_STARTTIME_Start: params?.INSPECTION_STARTTIME_Start || "", + INSPECTION_STARTTIME_End: params?.INSPECTION_STARTTIME_End || "", + }, + PageIndex: 1, + PageSize: 999999, + } + + let newReq: any = { + name: "", + value: encryptAES(JSON.stringify(req)) + } + const data = await handleGetPATROLList(newReq) + if (data && data.length > 0) { + return { data, success: true } + } + return { data: [], success: true } + }} + toolbar={{ + actions: [ + + ] + }} + /> +
+ + + {/* 详情抽屉 */} + { + setShowDetailDrawer(false); + setCurrentRow(undefined); + }} + bodyStyle={{ padding: '0 24px 24px' }} + destroyOnClose + closable={false} + > + + +
+ ) +} + + + +export default connect(({ user }: ConnectState) => ({ + currentUser: user.data +}))(routineInspection); \ No newline at end of file diff --git a/src/pages/operationReport/securityIssueList.tsx b/src/pages/operationReport/securityIssueList.tsx new file mode 100644 index 0000000..7be78a6 --- /dev/null +++ b/src/pages/operationReport/securityIssueList.tsx @@ -0,0 +1,230 @@ +// 安全问题记录表 +import { connect } from "umi"; + +import LeftSelectTree from "@/components/leftSelectTree/leftSelectTree"; +import { ActionType, FormInstance, ProTable } from "@ant-design/pro-components"; +import { useEffect, useRef, useState } from "react"; +import { handleGetPATROLList } from "./service"; +import moment from 'moment' +import { encryptAES } from "@/utils/handleAes"; +import { Drawer } from "antd"; +import OperationReport from './index' + + +const securityIssueList = () => { + const actionRef = useRef(); + const formRef = useRef(); + const [collapsible, setCollapsible] = useState(false) + // 树相关的属性和方法 + const [selectedId, setSelectedId] = useState() + // 行数据信息 + const [currentRow, setCurrentRow] = useState() + // 显示详情抽屉 + const [showDetailDrawer, setShowDetailDrawer] = useState(false) + + const columns: any = [ + { + title: '巡检时间', + dataIndex: 'search_date', + valueType: 'dateRange', + hideInTable: true, + hideInDescriptions: true, + search: { + transform: (value: any) => { + return { + INSPECTION_STARTTIME_Start: value[0], + INSPECTION_STARTTIME_End: value[1], + }; + }, + }, + fieldProps: { + ranges: { + "本月": [moment().startOf('M'), moment()], + "上月": [moment().subtract(1, 'M').startOf('M'), moment().subtract(1, 'M').endOf('M')], + "近三月": [moment().subtract(3, 'M').startOf('M'), moment().endOf('M')], + "近半年": [moment().subtract(6, 'M').startOf('M'), moment().endOf('M')], + } + }, + initialValue: [moment().startOf('M'), moment()], + }, + { + title: "序号", + dataIndex: 'index', + valueType: 'index', + hideInSearch: true, + align: 'center', + width: 80, + ellipsis: true + }, + { + title: "片区名称", + dataIndex: 'SPREGIONTYPE_NAME', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "服务区名称", + dataIndex: 'SERVERPART_NAME', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "发现日期", + dataIndex: '', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "问题类型", + dataIndex: '', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "问题描述", + dataIndex: '', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "风险等级", + dataIndex: '', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "发现人", + dataIndex: '', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true, + }, + { + title: "责任单位", + dataIndex: '', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "临时处置措施", + dataIndex: '', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "是否停业整改", + dataIndex: '', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "上报时间", + dataIndex: '', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "审核人", + dataIndex: '', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "状态", + dataIndex: 'COMPLETE_STATE', + valueType: 'select', + hideInSearch: true, + align: 'center', + width: 120, + ellipsis: true, + fieldProps: { + options: [ + { label: "编辑中", value: 1 }, + { label: "巡查中", value: 2 }, + { label: "待跟进", value: 3 }, + { label: "整改中", value: 4 }, + { label: "已完成", value: 5 }, + ] + } + }, + { + title: "备注", + dataIndex: '', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + }, + { + title: "附件", + dataIndex: '', + hideInSearch: true, + align: 'center', + width: 150, + ellipsis: true + } + ] + + + + return ( +
+ +
+ { + + }} + toolbar={{ + actions: [ + + ] + }} + /> +
+ + +
+ ) +} + + + +export default connect(({ user }: ConnectState) => ({ + currentUser: user.data +}))(securityIssueList); \ No newline at end of file diff --git a/src/pages/operationReport/service.ts b/src/pages/operationReport/service.ts new file mode 100644 index 0000000..f1a0069 --- /dev/null +++ b/src/pages/operationReport/service.ts @@ -0,0 +1,101 @@ +import requestOld from "@/utils/requestOld" + +// 获取日常巡检表列表 +export async function handleGetPATROLList(params: any) { + const data = await requestOld(`/Examine/GetPATROLList`, { + method: 'POST', + data: params + }) + + if (data.Result_Code !== 100) { + return data + } + + return data.Result_Data.List +} + + +// 获得区域列表 +export async function handleGetSERVERPARTTYPEList(params: any) { + const data = await requestOld(`/BasicConfig/GetSERVERPARTTYPEList`, { + method: 'POST', + data: params + }) + + if (data.Result_Code !== 100) { + return data + } + + return data.Result_Data.List +} + +// 同步日常巡检 +export async function handleSynchroPATROL(params: any) { + const data = await requestOld(`/Examine/SynchroPATROL`, { + method: 'POST', + data: params + }) + + if (data.Result_Code !== 100) { + return data + } + + return data +} + +// 获取服务区信息 +export async function handleGetServerpartTree(params: any) { + const data = await requestOld(`/BaseInfo/GetServerpartTree`, { + method: 'GET', + params + }) + + if (data.Result_Code !== 100) { + return data + } + + return data.Result_Data.List +} + +// 同步巡检整改通知表 +export async function handleSynchroRECTIFICATION(params: any) { + const data = await requestOld(`/Examine/SynchroRECTIFICATION`, { + method: 'POST', + data: params + }) + + if (data.Result_Code !== 100) { + return data + } + + return data +} + +// 获取巡检整改通知表列表 +export async function handleGetRECTIFICATIONList(params: any) { + const data = await requestOld(`/Examine/GetRECTIFICATIONList`, { + method: 'POST', + data: params + }) + + if (data.Result_Code !== 100) { + return data + } + + return data.Result_Data.List +} + +// 获取服务区方位的方法 +export async function handleGetSERVERPARTDetail(params: any) { + const data = await requestOld(`/BaseInfo/GetSERVERPARTDetail`, { + method: 'GET', + params + }) + + if (data.Result_Code !== 100) { + return data + } + + return data.Result_Data +} + diff --git a/src/pages/operationReport/style.less b/src/pages/operationReport/style.less new file mode 100644 index 0000000..9376ddb --- /dev/null +++ b/src/pages/operationReport/style.less @@ -0,0 +1,137 @@ +.operationReportMain { + box-sizing: border-box; + background-color: #fff; + padding: 32px 24px; + + + .pageTitle { + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; + box-sizing: border-box; + padding: 0 16px; + + .pageTitleLeft {} + + .pageTitleCenter { + font-size: 30px; + font-weight: bold; + color: #333; + margin-bottom: 24px; + } + + .pageTitleRight {} + + } + + .inspectionItemsTitle { + margin: 0; + } + + .inspectionContentListBox { + width: 100%; + height: 370px; + overflow-y: auto; + + .inspectionContentItem { + width: 100%; + display: flex; + align-items: flex-start; + border-bottom: 1px solid #dadada; + box-sizing: border-box; + padding: 12px; + + .inspectionContentItemLeft { + width: 40px; + margin-right: 10px; + display: flex; + justify-content: center; + + .inspectionContentItemIcon { + width: 25px; + height: 25px; + } + } + + .inspectionContentItemCenter { + width: calc(100% - 150px); + + .inspectionContentText { + font-family: "Microsoft YaHei"; + font-size: 16px; + } + + .errorContentTextBox { + .errorContentTitle { + font-weight: bold; + } + + .errorContentText { + margin-top: 8px; + } + + .errorContentImgList { + width: 100%; + display: flex; + flex-wrap: wrap; + align-items: center; + + .errorContentImg { + width: 80px; + height: 80px; + margin-right: 10px; + } + } + } + } + + .inspectionContentItemRight { + width: 100px; + + .btnText { + color: #1677ff; + cursor: pointer; + } + } + } + + } + + .leftItem { + width: 100%; + height: 420px; + overflow-y: auto; + + + .leftItemProTable { + .ant-pro-card { + .ant-pro-card-body { + .ant-table-wrapper { + .ant-spin-nested-loading { + .ant-spin-container { + .ant-table { + .ant-table-container { + .ant-table-body { + .ant-table-tbody { + .ant-table-row-selected { + td { + background-color: #c4defc; + } + } + } + } + } + } + } + } + } + } + } + } + } + + .leftItem::-webkit-scrollbar { + display: none; + } +} \ No newline at end of file diff --git a/src/pages/previewFile/index.tsx b/src/pages/previewFile/index.tsx deleted file mode 100644 index 91f5e7d..0000000 --- a/src/pages/previewFile/index.tsx +++ /dev/null @@ -1,17 +0,0 @@ -// 预览附件的页面 -import { connect } from "umi"; -import { ConnectState } from "@/models/global"; - -const previewFile = () => { - - return ( -
- 111 -
- ) -} - - -export default connect(({ user }: ConnectState) => ({ - currentUser: user.data -}))(previewFile); \ No newline at end of file diff --git a/src/utils/handleRedirect.ts b/src/utils/handleRedirect.ts index 8034c92..2e2c3e7 100644 --- a/src/utils/handleRedirect.ts +++ b/src/utils/handleRedirect.ts @@ -19,7 +19,6 @@ const handleRedirect = ( new Promise((resolve) => { let routePath = '' const queryString = window.location.search; - console.log('queryString', queryString); let { location: { search, pathname }, @@ -28,7 +27,6 @@ const handleRedirect = ( pathname = pathname.split('/cloudMenu')[1] } routePath = `${pathname}${search}`; - console.log('routePath', routePath); // Object.keys(indexValidMenuItemByPath)[0];