This commit is contained in:
ylj20011123 2025-12-04 16:47:35 +08:00
parent cbcadc63fa
commit f2f2a01bfb
21 changed files with 2743 additions and 35 deletions

View File

@ -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",
},

BIN
src/assets/errorIcon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

BIN
src/assets/normalIcon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

@ -25,9 +25,6 @@ const PageAccess: FC<Props> = (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;

View File

@ -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
}

View File

@ -24,9 +24,27 @@
display: flex;
align-items: center;
.ant-form {
.ant-row {
.noBottom {
.ant-form-item {
margin-bottom: 0 !important;
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;
}
}
}
}
}

View File

@ -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,

View File

@ -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',

View File

@ -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'],
};

View File

@ -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<FormInstance>();
// 文件列表
const [fileList, setFileList] = useState<any>([])
// 预览图片
const [imagePreviewVisible, setImagePreviewVisible] = useState<boolean>(false)
// 预览上传后的图片
const handlePreview = async () => {
setFileList(fileList)
setImagePreviewVisible(true)
};
return (
<div>
<Modal
title={'同步检查内容'}
destroyOnClose
width={1200}
open={onShow}
onCancel={() => {
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([])
}}
>
<ProForm
formRef={AddInspectionContentFormRef}
submitter={false}
layout={'horizontal'}
labelCol={{ style: { width: 120 } }}
>
<Row gutter={8}>
<Col span={24}>
<ProFormSelect
label={'巡检类型'}
name={''}
rules={[{ required: true, message: '请选择巡检类型!' }]}
options={[
{ label: '服务质量监督', value: 1 },
{ label: '运营维护', value: 2 },
{ label: '安全管理', value: 3 },
{ label: '通用', value: 4 },
]}
/>
</Col>
<Col span={24}>
<ProFormTextArea
label={'巡检内容'}
name={'PATROLDETAIL_CONTENT'}
rules={[{ required: true, message: '请输入巡检内容!' }]}
/>
</Col>
<Col span={24}>
<ProFormTextArea
label={'巡检结果'}
name={'PATROLDETAIL_RESULT'}
/>
</Col>
<Col span={24}>
<ProFormTextArea
label={'异常描述'}
name={'EXCEPTION_CONTENT'}
/>
</Col>
<Col span={24}>
<ProFormUploadButton
label={"异常图片"}
name={"EXCEPTIONPHOTO_URL"}
fileList={fileList}
listType="picture-card"
accept="image/*"
fieldProps={{
beforeUpload,
maxCount: 9,
onPreview: handlePreview,
customRequest: async (info) => {
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: <ExclamationCircleOutlined rev={undefined} />,
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)
}
});
}
}
}}
/>
</Col>
</Row>
</ProForm>
</Modal>
</div>
)
}
export default connect(({ user }: ConnectState) => ({
currentUser: user.data
}))(AddInspectionContent);

View File

@ -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<FormInstance>();
return (
<div>
<Modal
title={'同步检查项目'}
destroyOnClose
width={1200}
open={onShow}
onCancel={() => {
setOnShow(false)
}}
onOk={async () => { // 提交框内的数据
AddInspectionItemsFormRef.current?.validateFields().then((res: any) => {
if (handleGetNewProjectData) {
handleGetNewProjectData(res)
}
})
setOnShow(false)
}}
>
<ProForm
formRef={AddInspectionItemsFormRef}
submitter={false}
layout={'horizontal'}
labelCol={{ style: { width: 120 } }}
>
<Row gutter={8}>
<Col span={8}>
<ProFormText
label={'巡检项目'}
name={'PATROL_POSITION'}
rules={[{ required: true, message: '请输入巡检项目!' }]}
/>
</Col>
<Col span={8}>
<ProFormText
label={'责任单位编码'}
name={'DUTYUNIT_CODE'}
rules={[{ required: true, message: '请输入单位编码!' }]}
/>
</Col>
<Col span={8}>
<ProFormText
label={'责任单位名称'}
name={'DUTYUNIT_NAME'}
rules={[{ required: true, message: '请输入单位名称!' }]}
/>
</Col>
<Col span={8}>
<ProFormSelect
label={'状态'}
name={'PATROLDETAIL_STATE'}
options={[
{ label: "编辑中", value: 1 },
{ label: "巡查中", value: 2 },
{ label: "待跟进", value: 3 },
{ label: "整改中", value: 4 },
{ label: "已完成", value: 5 },
]}
initialValue={1}
rules={[{ required: true, message: '请选择状态!' }]}
/>
</Col>
{
pageDataType === 3000 ?
<>
<Col span={8}>
<ProFormText
label={'检查人'}
name={'INSPECTION_PERSON'}
/>
</Col>
<Col span={8}>
<ProFormDateTimePicker
width={'100%'}
label={'检查开始时间'}
name={'INSPECTION_STARTTIME'}
/>
</Col>
<Col span={8}>
<ProFormDateTimePicker
width={'100%'}
label={'检查完成时间'}
name={'INSPECTION_ENDTIME'}
/>
</Col>
</> : ""
}
{/* <Col span={8}>
<ProFormSelect
label={'整改期限'}
name={'RECTIFICATION_PERIOD'}
options={[
{ label: "一小时内", value: '一小时内' },
{ label: "半天内", value: '半天内' },
{ label: "一天内", value: '一天内' },
{ label: "三天内", value: '三天内' },
{ label: "一周内", value: '一周内' },
]}
initialValue={"一天内"}
/>
</Col>
<Col span={8}>
<ProFormText
label={'巡检人员'}
name={'INSPECTION_PERSON'}
/>
</Col> */}
</Row>
</ProForm>
</Modal>
</div>
)
}
export default connect(({ user }: ConnectState) => ({
currentUser: user.data
}))(AddInspectionItems);

View File

@ -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<FormInstance>();
// 文件列表
const [fileList, setFileList] = useState<any>([])
// 预览图片
const [imagePreviewVisible, setImagePreviewVisible] = useState<boolean>(false)
// 当前片区下的服务区列表
const [serverPartList, setServerPartList] = useState<any>()
// 预览上传后的图片
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 (
<div>
<Modal
title={'整改情况'}
destroyOnClose
width={900}
open={onShow}
onCancel={() => {
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)
}}
>
<ProForm
formRef={RectificationStatusInfoFormRef}
submitter={false}
layout={'horizontal'}
labelCol={{ style: { width: 80 } }}
request={async () => {
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 {
}
}
}}
>
<Row gutter={8}>
<Col span={12}>
<ProFormSelect
label={'片区'}
name={'SPREGIONTYPE_ID'}
rules={[{ required: true, message: '请选择片区!' }]}
request={async () => {
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}
/>
</Col>
<Col span={12} style={{ display: 'none' }}>
<ProFormText
label={'片区名称'}
name={'SPREGIONTYPE_NAME'}
/>
</Col>
<Col span={12}>
<ProFormSelect
label={'服务区'}
name={'SERVERPART_ID'}
options={serverPartList}
fieldProps={{
onChange: (e: any, option: any) => {
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}
/>
</Col>
<Col span={12} style={{ display: 'none' }}>
<ProFormText
label={'服务区名称'}
name={'SERVERPART_NAME'}
/>
</Col>
<Col span={12}>
<ProFormText
label={'责任单位'}
name={'DUTYUNIT'}
/>
</Col>
<Col span={12}>
<ProFormText
label={'责任人'}
name={'DUTYPSNNAME'}
/>
</Col>
<Col span={12}>
<ProFormText
label={'联系电话'}
name={'PHONE'}
/>
</Col>
<Col span={12}>
<ProFormText
label={'巡检人'}
name={'INSPECTIONPSN'}
/>
</Col>
<Col span={12}>
<ProFormDatePicker
label={'巡检日期'}
name={'INSPECTIONDATE'}
width={'100%'}
/>
</Col>
<Col span={12}></Col>
<Col span={12}>
<ProFormTextArea
label={'巡检问题'}
name={'INSPECTIONQUESTION'}
/>
</Col>
<Col span={12}>
<ProFormTextArea
label={'整改要求'}
name={'RECTIFICATIONREQUEST'}
/>
</Col>
<Col span={24}>
<ProFormUploadButton
label={"现场照片"}
name={"LOCALEPHOTO"}
fileList={fileList}
listType="picture-card"
accept="image/*"
fieldProps={{
beforeUpload,
maxCount: 9,
onPreview: handlePreview,
customRequest: async (info) => {
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: <ExclamationCircleOutlined rev={undefined} />,
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)
}
});
}
}
}}
/>
</Col>
<Col span={24}>
<ProFormTextArea
label={'整改结果'}
name={'RECTIFICATION_RESULT'}
/>
</Col>
</Row>
</ProForm>
</Modal>
</div>
)
}
export default connect(({ user }: ConnectState) => ({
currentUser: user.data
}))(RectificationStatusInfoModal);

View File

@ -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<ActionType>();
const AddInspectionItemsRef = useRef<any>();
const AddInspectionContentRef = useRef<any>();
const formRef = useRef<FormInstance>();
// 选中的行
const [selectedRowKey, setSelectedRowKey] = useState<any>();
// 保存数据
const [saveLoading, setSaveLoading] = useState<boolean>(false)
// 当前的用户信息
const [userInfoDetail, setUserInfoDetail] = useState<any>()
// 当前片区下的服务区列表
const [serverPartList, setServerPartList] = useState<any>()
// 当前服务区下的方位
const [SERVERPARTREGION, setSERVERPARTREGION] = useState<any>()
// 显示同步巡检项目的悬浮框
const [showInspectionItemsModal, setShowInspectionItemsModal] = useState<boolean>(false)
// 巡检项目 表格数据
const [inspectionItemsTableData, setInspectionItemsTableData] = useState<any>()
// 添加巡检内容的悬浮框
const [addContentModal, setAddContentModal] = useState<boolean>(false)
// 根据当前的巡检项目的id 里面包含的巡检内容
const [inspectionItemObj, setInspectionItemObj] = useState<any>()
// 巡检内容 显示的列表
const [inspectionContentList, setInspectionContentList] = useState<any>()
// 页面的数据类型 区分日常巡检 和 现场巡检
const [pageDataType, setPageDataType] = useState<number>(1000)
// 整改情况modal
const [rectificationStatusModal, setRectificationStatusModal] = useState<boolean>(false)
// 当前的巡检记录
const [currentRecord, setCurrentRecord] = useState<any>()
// 表格字段
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 (
<div className="operationReportMain">
<div className="pageTitle">
<div className="pageTitleLeft"></div>
<div className="pageTitleCenter">{`${pageDataType === 3000 ? '现场巡检' : '日常巡检'}${PATROLID ? '详情' : '录入'}`}</div>
<div className="pageTitleRight">
{
PATROLID ? '' :
<Button type={'primary'} loading={saveLoading} onClick={() => {
formRef.current?.validateFields().then((res: any) => {
if (saveLoading) {
return
}
setSaveLoading(true)
console.log('resres', res);
handleAddUpdate(res)
})
}}></Button>
}
</div>
</div>
<ProForm
formRef={formRef}
submitter={false}
layout={'horizontal'}
labelCol={{ style: { width: 120 } }}
request={async () => {
// 地址栏传参 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')
}
}
}}
>
<Row gutter={8}>
<Col span={24}>
<ProFormText
label={'任务标题'}
name={'PATROL_TITLE'}
rules={[{
required: true,
message: '请输入任务标题!'
}]}
readonly={PATROLID ? true : false}
/>
</Col>
<Col span={8}>
<ProFormSelect
label={'所属片区'}
name={'SPREGIONTYPE_ID'}
request={async () => {
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}
/>
</Col>
<Col span={8} style={{ display: 'none' }}>
<ProFormText
label={'片区名称'}
name={'SPREGIONTYPE_NAME'}
readonly={PATROLID ? true : false}
/>
</Col>
<Col span={8}>
<ProFormSelect
label={'服务区'}
name={'SERVERPART_ID'}
rules={[{
required: true,
message: '请选择服务区!'
}]}
options={serverPartList}
fieldProps={{
onChange: (e: any, option: any) => {
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}
/>
</Col>
<Col span={8} style={{ display: 'none' }}>
<ProFormText
label={'服务区名称'}
name={'SERVERPART_NAME'}
readonly={PATROLID ? true : false}
/>
</Col>
<Col span={8}>
<ProFormSelect
label={'服务区方位'}
name={'SERVERPART_REGION'}
rules={[{
required: true,
message: '请选择服务区方位!'
}]}
options={SERVERPARTREGION}
readonly={PATROLID ? true : false}
/>
</Col>
<Col span={8}>
<ProFormDatePicker
label={'巡检日期'}
name={'PATROL_DATE'}
width={'100%'}
rules={[{
required: true,
message: '请选择巡检日期!'
}]}
readonly={PATROLID ? true : false}
/>
</Col>
<Col span={8}>
<ProFormTimePicker
label={'开始时间'}
name={'PATROL_STARTTIME'}
width={'100%'}
rules={[{
required: true,
message: '请选择开始时间!'
}]}
readonly={PATROLID ? true : false}
/>
</Col>
<Col span={8}>
<ProFormTimePicker
label={'结束时间'}
name={'PATROL_ENDTIME'}
width={'100%'}
rules={[{
required: true,
message: '请选择结束时间!'
}]}
readonly={PATROLID ? true : false}
/>
</Col>
<Col span={8}>
<ProFormDatePicker
label={'发布时间'}
name={'发布时间'}
width={'100%'}
rules={[{
required: true,
message: '请选择发布时间!'
}]}
readonly={PATROLID ? true : false}
/>
</Col>
<Col span={8}>
<ProFormText
label={'创建人'}
name={'STAFF_NAME'}
disabled
readonly={PATROLID ? true : false}
/>
</Col>
<Col span={8}>
<ProFormText
label={'创建时间'}
name={'OPERATE_DATE'}
disabled
readonly={PATROLID ? true : false}
/>
</Col>
<Col span={8}>
<ProFormSelect
label={'状态'}
name={'COMPLETE_STATE'}
options={[
{ label: "编辑中", value: 1 },
{ label: "巡查中", value: 2 },
{ label: "待跟进", value: 3 },
{ label: "整改中", value: 4 },
{ label: "已完成", value: 5 },
]}
initialValue={1}
readonly={PATROLID ? true : false}
/>
</Col>
<Col span={8}>
<ProFormText
label={'检查人'}
name={'PATROL_PERSON'}
readonly={PATROLID ? true : false}
/>
</Col>
{
pageDataType === 3000 ?
<Col span={8}>
{/* <ProFormDatePicker
label={'要求整改时间'}
name={''}
width={'100%'}
/> */}
</Col> :
<>
<Col span={8}>
<ProFormTimePicker
label={'巡检开始时间'}
name={'INSPECTION_STARTTIME'}
width={'100%'}
readonly={PATROLID ? true : false}
/>
</Col>
<Col span={8}>
<ProFormTimePicker
label={'巡检结束时间'}
name={'INSPECTION_ENDTIME'}
width={'100%'}
readonly={PATROLID ? true : false}
/>
</Col>
</>
}
</Row>
</ProForm>
{/* 非表单内容 */}
<Row gutter={8}>
<Col span={12}>
<Divider className="inspectionItemsTitle" orientation="left"></Divider>
<div className="leftItem">
<ProTable
actionRef={actionRef}
rowKey={(record: any) => {
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 ? [] : [
<Button
key="new"
type="primary"
onClick={(e) => {
setShowInspectionItemsModal(true)
}}
>
</Button>
]
}}
/>
</div>
</Col>
<Col span={12}>
<Divider className="inspectionItemsTitle" orientation="left"></Divider>
<div style={{ width: '100%', display: 'flex', justifyContent: 'flex-end' }}>
{
selectedRowKey ?
PATROLID ? '' :
<Button type={'primary'} onClick={() => {
setAddContentModal(true)
}}></Button> : ""
}
</div>
<div className="inspectionContentListBox">
{
inspectionContentList && inspectionContentList.length > 0 ?
inspectionContentList.map((item: any) => {
return <div className="inspectionContentItem">
<div className="inspectionContentItemLeft">
<img className="inspectionContentItemIcon" src={item.EXCEPTION_CONTENT ? errorIcon : normalIcon} />
</div>
<div className="inspectionContentItemCenter">
<div className="inspectionContentText">{item?.PATROLDETAIL_CONTENT || ""}</div>
{
item.EXCEPTION_CONTENT ?
<div className="errorContentTextBox">
<div className="errorContentTitle">:</div>
<div className="errorContentText">{item?.EXCEPTION_CONTENT || ""}</div>
<div className="errorContentImgList">
<Image.PreviewGroup>
{item.EXCEPTIONPHOTO_URL &&
item.EXCEPTIONPHOTO_URL.split(',').map((url: string, index: number) => (
<Image
key={index}
src={url}
className="errorContentImg"
width={80} // 你自己的缩略图尺寸
height={80}
style={{ objectFit: 'cover', borderRadius: 6, marginRight: '10px' }}
preview={{ mask: '预览' }} // 鼠标移入显示遮罩 + "预览" 文案
/>
))}
</Image.PreviewGroup>
</div>
</div> : ""
}
</div>
<div className="inspectionContentItemRight">
<div className="btnText" onClick={() => {
setRectificationStatusModal(true)
}}></div>
</div>
</div>
}) : ""
}
</div>
</Col>
</Row>
{/* 添加巡检项目 */}
<AddInspectionItems onRef={AddInspectionItemsRef} onShow={showInspectionItemsModal} setOnShow={setShowInspectionItemsModal} handleGetNewProjectData={handleGetNewProjectData} pageDataType={pageDataType} />
{/* 添加巡检内容的悬浮框 */}
<AddInspectionContent onRef={AddInspectionContentRef} onShow={addContentModal} setOnShow={setAddContentModal} handleAddInspectionContentData={handleAddInspectionContentData} />
{/* 整改情况 的录入悬浮框 */}
<RectificationStatusInfoModal parentRow={currentRecord} onShow={rectificationStatusModal} setOnShow={setRectificationStatusModal} handleGetRectificationStatusData={handleGetRectificationStatusData} />
</div>
)
}
export default connect(({ user }: ConnectState) => ({
currentUser: user.data
}))(OperationReport);

View File

@ -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<ActionType>();
const formRef = useRef<FormInstance>();
const [collapsible, setCollapsible] = useState<boolean>(false)
// 树相关的属性和方法
const [selectedId, setSelectedId] = useState<string>()
// 行数据信息
const [currentRow, setCurrentRow] = useState<any>()
// 显示详情抽屉
const [showDetailDrawer, setShowDetailDrawer] = useState<boolean>(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 <a onClick={() => {
setCurrentRow(record)
setShowDetailDrawer(true)
}}>{record?.PATROL_TITLE || ""}</a>
}
},
{
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 <span style={{ color: type === '是' ? 'red' : '' }}>{type}</span>
}
}
]
return (
<div style={{ height: 'calc(100vh - 100px)', backgroundColor: '#fff', display: 'flex' }}>
<LeftSelectTree setSelectedId={setSelectedId} setCollapsible={setCollapsible} collapsible={collapsible} />
<div style={{
width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
paddingTop: 0,
paddingBottom: 0,
paddingRight: 0
}}>
<ProTable
actionRef={actionRef}
formRef={formRef}
columns={columns}
bordered
scroll={{ x: '100%', y: 'calc(100vh - 450px)' }}
headerTitle={'现场巡检记录表'}
search={{ span: 6, }}
request={async (params) => {
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: [
]
}}
/>
</div>
{/* 详情抽屉 */}
<Drawer
width="80%"
open={showDetailDrawer}
title="日常巡检详情"
onClose={() => {
setShowDetailDrawer(false);
setCurrentRow(undefined);
}}
bodyStyle={{ padding: '0 24px 24px' }}
destroyOnClose
closable={false}
>
<OperationReport PATROLID={currentRow?.PATROL_ID} />
</Drawer>
</div>
)
}
export default connect(({ user }: ConnectState) => ({
currentUser: user.data
}))(onSiteInspection);

View File

@ -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<ActionType>();
const formRef = useRef<FormInstance>();
const [collapsible, setCollapsible] = useState<boolean>(false)
// 树相关的属性和方法
const [selectedId, setSelectedId] = useState<string>()
// 行数据信息
const [currentRow, setCurrentRow] = useState<any>()
// 显示详情抽屉
const [showDetailDrawer, setShowDetailDrawer] = useState<boolean>(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 (
<div style={{ height: 'calc(100vh - 100px)', backgroundColor: '#fff', display: 'flex' }}>
<LeftSelectTree setSelectedId={setSelectedId} setCollapsible={setCollapsible} collapsible={collapsible} />
<div style={{
width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
paddingTop: 0,
paddingBottom: 0,
paddingRight: 0
}}>
<ProTable
actionRef={actionRef}
formRef={formRef}
columns={columns}
bordered
scroll={{ x: '100%', y: 'calc(100vh - 450px)' }}
headerTitle={'整改情况追踪表'}
search={{ span: 6, }}
request={async (params) => {
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: [
]
}}
/>
</div>
</div>
)
}
export default connect(({ user }: ConnectState) => ({
currentUser: user.data
}))(rectificationStatus);

View File

@ -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<ActionType>();
const formRef = useRef<FormInstance>();
const [collapsible, setCollapsible] = useState<boolean>(false)
// 树相关的属性和方法
const [selectedId, setSelectedId] = useState<string>()
// 行数据信息
const [currentRow, setCurrentRow] = useState<any>()
// 显示详情抽屉
const [showDetailDrawer, setShowDetailDrawer] = useState<boolean>(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 <a onClick={() => {
setCurrentRow(record)
setShowDetailDrawer(true)
}}>{record?.PATROL_TITLE || ""}</a>
}
},
{
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 <span style={{ color: type === '是' ? 'red' : '' }}>{type}</span>
}
}
]
return (
<div style={{ height: 'calc(100vh - 100px)', backgroundColor: '#fff', display: 'flex' }}>
<LeftSelectTree setSelectedId={setSelectedId} setCollapsible={setCollapsible} collapsible={collapsible} />
<div style={{
width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
paddingTop: 0,
paddingBottom: 0,
paddingRight: 0
}}>
<ProTable
actionRef={actionRef}
formRef={formRef}
columns={columns}
bordered
scroll={{ x: '100%', y: 'calc(100vh - 450px)' }}
headerTitle={'日常巡检记录表'}
search={{ span: 6, }}
request={async (params) => {
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: [
]
}}
/>
</div>
{/* 详情抽屉 */}
<Drawer
width="80%"
open={showDetailDrawer}
title="日常巡检详情"
onClose={() => {
setShowDetailDrawer(false);
setCurrentRow(undefined);
}}
bodyStyle={{ padding: '0 24px 24px' }}
destroyOnClose
closable={false}
>
<OperationReport PATROLID={currentRow?.PATROL_ID} />
</Drawer>
</div>
)
}
export default connect(({ user }: ConnectState) => ({
currentUser: user.data
}))(routineInspection);

View File

@ -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<ActionType>();
const formRef = useRef<FormInstance>();
const [collapsible, setCollapsible] = useState<boolean>(false)
// 树相关的属性和方法
const [selectedId, setSelectedId] = useState<string>()
// 行数据信息
const [currentRow, setCurrentRow] = useState<any>()
// 显示详情抽屉
const [showDetailDrawer, setShowDetailDrawer] = useState<boolean>(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 (
<div style={{ height: 'calc(100vh - 100px)', backgroundColor: '#fff', display: 'flex' }}>
<LeftSelectTree setSelectedId={setSelectedId} setCollapsible={setCollapsible} collapsible={collapsible} />
<div style={{
width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
paddingTop: 0,
paddingBottom: 0,
paddingRight: 0
}}>
<ProTable
actionRef={actionRef}
formRef={formRef}
columns={columns}
bordered
scroll={{ x: '100%', y: 'calc(100vh - 450px)' }}
headerTitle={'安全问题记录表'}
search={{ span: 6, }}
request={async (params) => {
}}
toolbar={{
actions: [
]
}}
/>
</div>
</div>
)
}
export default connect(({ user }: ConnectState) => ({
currentUser: user.data
}))(securityIssueList);

View File

@ -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
}

View File

@ -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;
}
}

View File

@ -1,17 +0,0 @@
// 预览附件的页面
import { connect } from "umi";
import { ConnectState } from "@/models/global";
const previewFile = () => {
return (
<div>
111
</div>
)
}
export default connect(({ user }: ConnectState) => ({
currentUser: user.data
}))(previewFile);

View File

@ -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];