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 ?