{
listData && listData.length > 0 ? listData && listData.map((e, index) => {
return (
diff --git a/weapp/src/pages/home/index.jsx b/weapp/src/pages/home/index.jsx
index 18db4a91..e6a155d2 100644
--- a/weapp/src/pages/home/index.jsx
+++ b/weapp/src/pages/home/index.jsx
@@ -45,8 +45,9 @@ const Index = () => {
return (
+
- 巡 查 养 护
+ 巡 查 上 报
toPatrolView('patrol')
@@ -55,6 +56,18 @@ const Index = () => {
{isSuperAdmin ? '查看' : '填报'}
+
+
+ 养 护 上 报
+ toPatrolView('conserve')
+ : () => toPatrol('conserve')
+ }>
+ {isSuperAdmin ? '查看' : '填报'}
+
+
+
在 建 道 路
{
{isSuperAdmin ? '查看' : '填报'}
+
异 常 反 馈
{
{isSuperAdmin ? '查看' : '填报'}
+
{/* {
isSuperAdmin &&
@@ -82,6 +97,7 @@ const Index = () => {
查看
} */}
+
);
}
diff --git a/weapp/src/pages/user/index.jsx b/weapp/src/pages/user/index.jsx
index 14b73fd2..83c5c9c2 100644
--- a/weapp/src/pages/user/index.jsx
+++ b/weapp/src/pages/user/index.jsx
@@ -67,7 +67,15 @@ const Index = ({ ...props }) => {
toPatrolReport('patrol') : () => toMyReport('patrol')}>
- {isSuperAdmin ? '巡查上报' : '我的上报'}
+ {isSuperAdmin ? '巡查上报' : '巡查上报'}
+
+
+
+
+ toPatrolReport('conserve') : () => toMyReport('conserve')}>
+
+
+ {isSuperAdmin ? '养护上报' : '养护上报'}
diff --git a/web/client/src/sections/fillion/components/maintenanceTable.js b/web/client/src/sections/fillion/components/maintenanceTable.js
index c26c6c8d..45adec67 100644
--- a/web/client/src/sections/fillion/components/maintenanceTable.js
+++ b/web/client/src/sections/fillion/components/maintenanceTable.js
@@ -272,8 +272,12 @@ const PatrolNameList = (props) => {
return {
onClick: () => {
if (record) {
- setSelectRoad(record.id);
- onChange(record);
+ let id = record.id
+ if (selectRoad == record.id) {
+ id = null
+ }
+ setSelectRoad(id);
+ onChange(id ? record : null);
}
},
};
@@ -294,28 +298,35 @@ const MaintenanceTable = (props) => {
const { RangePicker } = DatePicker;
useEffect(() => {
- if (userList && userList instanceof Array) {
- let users = userList.filter(user => user.remark != 'sp');
+ queryData()
+ }, [])
- setRecord(users[0]);
- }
+ useEffect(() => {
+ // if (userList && userList instanceof Array) {
+ // let users = userList.filter(user => user.remark != 'sp');
+ // setRecord(users[0]);
+ // }
}, [userList])
useEffect(() => {
- if (record) {
- let query = {
- userId: record.id,
- reportType: 'conserve',
- asc: true
- }
- if ((dateRange && dateRange instanceof Array && dateRange[0] != '')) {
- query.startTime = moment(dateRange[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss')
- query.endTime = moment(dateRange[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss')
- }
- dispatch(getReportList(query));
- }
+ // if (record) {
+ queryData()
+ // }
}, [record, dateRange])
+ const queryData = () => {
+ let query = {
+ userId: record?.id,
+ reportType: 'conserve',
+ asc: true
+ }
+ if ((dateRange && dateRange instanceof Array && dateRange[0] != '')) {
+ query.startTime = moment(dateRange[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss')
+ query.endTime = moment(dateRange[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss')
+ }
+ dispatch(getReportList(query));
+ }
+
const handleClose = () => {
setDetailVisible(false)
}
diff --git a/web/client/src/sections/fillion/components/patrolTable.js b/web/client/src/sections/fillion/components/patrolTable.js
index 2bb587ce..c1333337 100644
--- a/web/client/src/sections/fillion/components/patrolTable.js
+++ b/web/client/src/sections/fillion/components/patrolTable.js
@@ -1,6 +1,6 @@
import { connect } from 'react-redux';
import './protable.less'
-import { Card, Button, Popconfirm, Badge, Col, Row, DatePicker, Input, Modal, Spin, Image, message, Popover } from 'antd';
+import { Card, Button, Popconfirm, Badge, Col, Row, DatePicker, Input, Modal, Spin, Image, message, Popover, Select } from 'antd';
import ProTable from '@ant-design/pro-table';
import { getReportList, getReportDetail, handleReport } from '../actions/patrol';
import React, { useEffect, useState } from 'react';
@@ -19,6 +19,7 @@ const DetailForm = (props) => {
const keyList = [
// { key: '编号', name: 'id' },
{ key: '工程类型', name: 'projectType', skip: !isPatrol },
+ { key: '反馈类型', name: 'projectType', skip: !isAnomaly },
{ key: '工程名称', name: 'projectName', skip: !isRoad },
{ key: '所在路段', name: 'road', skip: isRoad },
{ key: '具体位置', name: 'address' },
@@ -128,9 +129,9 @@ const DetailList = (props) => {
return moment(record.time).format("YYYYMMDD") * 10000 + counter;
}
} : '',
- isPatrol ?
+ isPatrol || isAnomaly ?
{
- title: '工程类型',
+ title: isPatrol ? '工程类型' : '反馈类型',
key: 'projectType',
dataIndex: 'projectType',
align: 'center',
@@ -140,6 +141,9 @@ const DetailList = (props) => {
case 'bridge': return '桥梁';
case 'culvert': return '涵洞';
case 'other': return '其他';
+ case 'conserve': return '养护';
+ case 'patrol': return '巡查';
+ case 'construction': return '在建';
default: return text;
}
}
@@ -268,9 +272,8 @@ const PatrolNameList = (props) => {
useEffect(() => {
-
if (userList && userList instanceof Array && userList.length) {
- setSelectRoad(userList[0].id)
+ // setSelectRoad(userList[0].id)
// onChange(userList[0]);
}
if (activeTabKey1 == 'tab2') {
@@ -333,7 +336,7 @@ const PatrolNameList = (props) => {
id = null
}
setSelectRoad(id);
- onChange(record);
+ onChange(id ? record : null);
}
},
};
@@ -349,6 +352,7 @@ const PatrolTable = (props) => {
const { userList, reportList, dispatch, reportListLoading, reportDetail, reportDetailLoading, userLoading, exports, pathname } = props;
const [record, setRecord] = useState();
const [dateRange, setDateRange] = useState();
+ const [selectProjectType, setSelectProjectType] = useState('');
const [detailVisible, setDetailVisible] = useState(false)
const [activeTabKey1, setActiveTabKey1] = useState('tab1');
@@ -360,19 +364,21 @@ const PatrolTable = (props) => {
const reportType = isRoad ? 'road' : isAnomaly ? 'anomaly' : 'patrol';
useEffect(() => {
- if (userList && userList instanceof Array) {
- setRecord(userList[0]);
- }
+ queryData();
+ }, [])
+
+ useEffect(() => {
+ // if (userList && userList instanceof Array) {
+ // setRecord(userList[0]);
+ // }
}, [userList])
useEffect(() => {
- if (record) {
- queryData();
- }
- }, [record, dateRange])
+ queryData();
+ }, [record, dateRange, selectProjectType])
const queryData = () => {
- let query = { userId: record.id, reportType: reportType, asc: true }
+ let query = { userId: record?.id, reportType: reportType, projectType: selectProjectType, asc: true }
if ((dateRange && dateRange instanceof Array && dateRange[0] != '')) {
query.startTime = moment(dateRange[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss')
query.endTime = moment(dateRange[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss')
@@ -384,7 +390,7 @@ const PatrolTable = (props) => {
if (activeTabKey1 && activeTabKey1 == 'tab2') {
setRecord(null);
} else if (activeTabKey1 && activeTabKey1 == 'tab1') {
- setRecord(userList[0]);
+ // setRecord(userList[0]);
}
}, [activeTabKey1])
@@ -428,7 +434,7 @@ const PatrolTable = (props) => {
const handleChangeRecord = (newRecord) => {
let target = null;
- if (!record || newRecord.id != record.id) {
+ if (!record || (newRecord && newRecord.id != record.id)) {
target = newRecord;
}
setRecord(target);
@@ -463,6 +469,25 @@ const PatrolTable = (props) => {
activeTabKey1 == 'tab1' ?
{ setDateRange(dateString) }} />
+ {
+ isAnomaly ?
+
: ''