diff --git a/api/app/lib/controllers/overview/building.js b/api/app/lib/controllers/overview/building.js
index bdc0764a..69ed2d13 100644
--- a/api/app/lib/controllers/overview/building.js
+++ b/api/app/lib/controllers/overview/building.js
@@ -38,7 +38,7 @@ async function roadState(ctx) {
})
//在建工程
const buildingCount = await models.Project.count({
- where: { done: true }
+ where: { done: false }
})
const bridgeRes = await models.Bridge.findAll({})
diff --git a/api/app/lib/controllers/report/index.js b/api/app/lib/controllers/report/index.js
index 2ca58067..1facea74 100644
--- a/api/app/lib/controllers/report/index.js
+++ b/api/app/lib/controllers/report/index.js
@@ -1,7 +1,7 @@
'use strict';
const { QueryTypes } = require('sequelize');
-async function reportList (ctx) {
+async function reportList(ctx) {
try {
const models = ctx.fs.dc.models;
const { limit, page, startTime, endTime, keyword, userId, reportType, isTop, asc, projectType, handleState = '', performerId = '' } = ctx.query
@@ -43,12 +43,15 @@ async function reportList (ctx) {
where: {
},
- attributes: ['id', 'road', 'time', 'projectType', 'roadSectionStart', 'performerId', 'roadSectionEnd', 'reportType', 'content', 'longitude', 'latitude', 'projectName', 'handleState', 'codeRoad'],
+ attributes: ['id', 'road', 'time', 'projectType', 'roadSectionStart', 'performerId', 'roadSectionEnd', 'reportType',
+ 'content', 'longitude', 'latitude', 'projectName', 'handleState', 'codeRoad', 'handleContent', 'handlePic'],
include: [{
model: models.User,
attributes: ['name']
}],
- order: [['time', asc ? 'ASC' : 'DESC']],
+ //order: [['time', asc ? 'ASC' : 'DESC']],
+ order: [['time', 'DESC']],
+
}
if (limit) {
findOption.limit = limit
@@ -114,7 +117,7 @@ async function reportList (ctx) {
}
}
-async function reportPosition (ctx) {
+async function reportPosition(ctx) {
try {
const models = ctx.fs.dc.models;
const { startTime, endTime, userId, reportType } = ctx.query
@@ -164,7 +167,7 @@ async function reportPosition (ctx) {
}
}
-async function reportDetail (ctx) {
+async function reportDetail(ctx) {
try {
const models = ctx.fs.dc.models;
const { reportId } = ctx.params
@@ -186,7 +189,7 @@ async function reportDetail (ctx) {
}
}
-async function reportHandle (ctx) {
+async function reportHandle(ctx) {
try {
const { models } = ctx.fs.dc;
@@ -216,7 +219,7 @@ async function reportHandle (ctx) {
}
}
-async function createReport (ctx) {
+async function createReport(ctx) {
try {
const { userId } = ctx.fs.api
const models = ctx.fs.dc.models;
@@ -238,7 +241,7 @@ async function createReport (ctx) {
}
}
-async function deleteReport (ctx) {
+async function deleteReport(ctx) {
try {
const models = ctx.fs.dc.models;
const { reportId } = ctx.params;
diff --git a/weapp/src/packages/patrol/index.jsx b/weapp/src/packages/patrol/index.jsx
index 31a4ff5a..3b338d99 100644
--- a/weapp/src/packages/patrol/index.jsx
+++ b/weapp/src/packages/patrol/index.jsx
@@ -19,7 +19,7 @@ const Index = () => {
const isSuperAdmin = userInfo && userInfo.username === 'SuperAdmin' ? true : false
const router = useRouter()
- const { params: { type, kind, wait, handle } } = router
+ const { params: { type, kind, wait, handle, videoShow } } = router
const isView = type === 'view' ? true : false
const isPatrol = kind === 'patrol' || kind == 'conserve' ? true : false
const isRoad = kind === 'road' ? true : false
@@ -105,8 +105,10 @@ const Index = () => {
useEffect(() => {
if (isRoad) {
Taro.setNavigationBarTitle({ title: '在建项目' })
- } else if (wait == 'wait' || handle == 'handle') {
+ } else if (wait == 'wait') {
Taro.setNavigationBarTitle({ title: '待办事项' })
+ } else if (handle == 'handle') {
+ Taro.setNavigationBarTitle({ title: '已办事项' })
} else if (isAnomaly) {
Taro.setNavigationBarTitle({ title: '异常反馈' })
} else if (kind == 'conserve') {
@@ -138,6 +140,7 @@ const Index = () => {
setAddress(data.address)
setContent(data.content)
setScenePic(data.scenePic ? data.scenePic.map(item => ({ url: imgUrl + item })) : [])
+ setHandlePic(data.handlePic ? data.handlePic.map(item => ({ url: imgUrl + item })) : [])
setConserveBeforePic(data.conserveBeforePic ? data.conserveBeforePic.map(item => ({ url: imgUrl + item })) : [])
setConserveUnderwayPic(data.conserveUnderwayPic ? data.conserveUnderwayPic.map(item => ({ url: imgUrl + item })) : [])
setConserveAfterPic(data.conserveAfterPic ? data.conserveAfterPic.map(item => ({ url: imgUrl + item })) : [])
@@ -145,9 +148,6 @@ const Index = () => {
if (data.handleContent) {
setHandleCenter(data.handleContent)
}
- if (data.handlePic.length) {
- setHandlePic(data.handlePic)
- }
} else {
Taro.showToast({ title: res.data.message || '请求出错', icon: 'none' })
}
@@ -454,6 +454,9 @@ const Index = () => {
case 'scenePic':
i = scenePic.length
break;
+ case 'wait':
+ i = handlePic.length
+ break;
case 'conserveBeforePic':
i = conserveBeforePic.length
break;
@@ -526,15 +529,9 @@ const Index = () => {
Taro.showToast({ title: '内容字数不能超过50', icon: 'none' })
return
}
- let handlePicList = []
- if (handlePic.length) {
- handlePic.forEach(e => {
- handlePicList.push(e.url)
- })
- }
let data = {
handleContent: str,
- handlePic: handlePicList,
+ handlePic: handlePicPn,
handleState: '已处理'
}
Taro.showModal({
@@ -574,7 +571,6 @@ const Index = () => {
maxDuration: 15,
camera: 'back',
success(res) {
- console.log(res, 'res');
const tempFilePaths = res.tempFiles[0].tempFilePath
let token = getState('token') || Taro.getStorageSync('token')
Taro.uploadFile({
@@ -582,7 +578,6 @@ const Index = () => {
filePath: tempFilePaths,
name: 'file',
success: (ress) => {
- console.log(ress, '上传成功');
Taro.hideLoading();
if (ress.statusCode == 200) {
setVideo(res.tempFiles[0].tempFilePath)
@@ -890,20 +885,23 @@ const Index = () => {
}
}
- {
- video.length ? : ''
- }
+ {/* {
+ videoShow ? '' :
+
+
- 添加视频
+ 添加视频
+
+ } */}
{
isView ?
isSuperAdmin &&
@@ -928,7 +926,7 @@ const Index = () => {
handle == 'handle' ?
{handlePic.map(item => (
- handleImgClicks(undefined, item)} />
+ handleImgClicks(undefined, item)} />
))}
:
{
- Taro.navigateTo({ url: `/packages/patrol/index?type=view&id=${listData[index].id}&kind=${kind == 'wait' || kind == 'handle' ? 'anomaly' : kind}&wait=${kind == 'wait' ? 'wait' : ''}&handle=${kind == 'handle' ? 'handle' : ''}` })
+ Taro.navigateTo({ url: `/packages/patrol/index?type=view&id=${listData[index].id}&kind=${kind == 'wait' || kind == 'handle' ? 'anomaly' : kind}&wait=${kind == 'wait' ? 'wait' : ''}&handle=${kind == 'handle' ? 'handle' : ''}&videoShow=${kind == 'wait' || kind == 'handle' ? 'videoShow' : ''}` })
}
return (
diff --git a/web/client/src/sections/fillion/components/patrolTable.js b/web/client/src/sections/fillion/components/patrolTable.js
index 823f273a..86790550 100644
--- a/web/client/src/sections/fillion/components/patrolTable.js
+++ b/web/client/src/sections/fillion/components/patrolTable.js
@@ -48,13 +48,14 @@ const DetailForm = (props) => {
{ key: '巡查内容', name: 'content' },
{ key: '路线代码', name: 'codeRoad' },
{ key: '现场照片', name: 'scenePic' },
-
+ { key: '处理详情', name: 'handleContent', skip: !isAnomaly },
+ { key: '处理图片', name: 'handlePic', skip: !isAnomaly },
+ { key: '处理人', name: 'performerName', skip: !isAnomaly }
];
const renderContent = (data) => {
if (data) {
// Object.keys(data).map(key => {
-
// })
return keyList.map(obj => {
return (
@@ -73,7 +74,7 @@ const DetailForm = (props) => {
:
obj.name == 'projectType' ?
reportTypeText(data[obj.name]) :
- data[obj.name]
+ data[obj.name] || null
}
disabled
/>
@@ -368,23 +369,19 @@ const PatrolNameList = (props) => {
});
return children;
};
- if (user?.username === 'SuperAdmin') {
- departments = [...new Set(depAllUser)]
- } else {
- let depAllUserCopy = []
- depAllUser.map((item) => {
- if (item.depId === user?.departmentId) {
- depAllUserCopy.push(item)
- }
- })
- departments = [...new Set(depAllUserCopy)]
+ if (depAllUser && depAllUser.length) {
+ if (user?.username === 'SuperAdmin') {
+ departments = [...new Set(depAllUser)]
+ } else {
+ const targetDepartment = depAllUser.find(department => department.users.some(item => item.id === user?.id));
+ departments = [targetDepartment]
+ }
+ const processedData = [];
+ const expandedKeys = generateData(departments, null, processedData);
+ setDefaultData(processedData);
+ setDataList(processedData.map(item => ({ key: item.key, title: item.title.toString(), children: item.children })));
+ setExpandedKeys(expandedKeys);
}
-
- const processedData = [];
- const expandedKeys = generateData(departments, null, processedData);
- setDefaultData(processedData);
- setDataList(processedData.map(item => ({ key: item.key, title: item.title.toString(), children: item.children })));
- setExpandedKeys(expandedKeys);
}, [depAllUser])
useEffect(() => {
@@ -597,7 +594,7 @@ const PatrolTable = (props) => {
const [detailVisible, setDetailVisible] = useState(false)
const [activeTabKey1, setActiveTabKey1] = useState('tab1');
const { RangePicker } = DatePicker;
-
+ const [reportDetailCopy, setReportDetailCopy] = useState({})//匹配执行者的名字
const isRoad = pathname.includes('road')
const isAnomaly = pathname.includes('anomaly')
const isPatrol = !isRoad && !isAnomaly
@@ -608,10 +605,10 @@ const PatrolTable = (props) => {
}, [])
useEffect(() => {
- // if (userList && userList instanceof Array) {
- // setRecord(userList[0]);
- // }
- }, [userList])
+ if (userList && userList instanceof Array && reportDetail && reportDetail instanceof Object) {
+ setReportDetailCopy(Object.assign(reportDetail, { performerName: userList.find(item => item.id === reportDetail.performerId)?.name }))
+ }
+ }, [userList, reportDetail])
useEffect(() => {
queryData();
@@ -756,7 +753,7 @@ const PatrolTable = (props) => {
diff --git a/web/client/src/sections/organization/components/userModal.js b/web/client/src/sections/organization/components/userModal.js
index 01e731a2..4e94e0ff 100644
--- a/web/client/src/sections/organization/components/userModal.js
+++ b/web/client/src/sections/organization/components/userModal.js
@@ -3,14 +3,30 @@ import { connect } from 'react-redux';
import { Spin } from 'antd';
import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect } from '@ant-design/pro-form';
+
+
const UserModal = (props) => {
- const { visible, modalType, depData, onVisibleChange, onConfirm, editData } = props
+ const { visible, modalType, depData, onVisibleChange, onConfirm, editData, depMessagedata } = props
+ const pakData = (dep) => {
+ // console.log(dep);
+ return dep.map((d) => {
+ return {
+ title: d.name,
+ value: d.id,
+ // key: d.id,
+ children: pakData(d.subordinate)
+ }
+ })
+ }
+
+ let depDatas = pakData(depMessagedata || [])
const onFinish = (values) => {
if (onConfirm) {
onConfirm(values);
}
}
+
const checkName = (rule, value, callback) => {
if (value && value.replace(/[^\u4E00-\u9FA5]/g).includes('undefined')) {
callback(new Error('请输入中文!'));
@@ -98,7 +114,7 @@ const UserModal = (props) => {
}}
rules={[{ required: true, message: '请选择所属部门' }]}
request={async () => {
- return depData
+ return depDatas
}}
expandedKeys={["title"]}
/>
diff --git a/web/client/src/sections/organization/containers/user.js b/web/client/src/sections/organization/containers/user.js
index 2a4de927..fde71379 100644
--- a/web/client/src/sections/organization/containers/user.js
+++ b/web/client/src/sections/organization/containers/user.js
@@ -315,14 +315,14 @@ const UserManage = (props) => {
-
+ 新建部门 : null}
+
{
depMessage.length ?
@@ -412,6 +412,7 @@ const UserManage = (props) => {
{
depMessage.length && modalVisible ?