Browse Source

feat:調式代碼

dev
zhaobing 1 year ago
parent
commit
9c7e023eff
  1. 5
      api/app/lib/controllers/report/index.js
  2. 10
      web/client/src/sections/fillion/components/patrolTable.js
  3. 58
      web/client/src/sections/fillion/containers/maintenanceSpotCheck.js

5
api/app/lib/controllers/report/index.js

@ -400,8 +400,9 @@ async function spotCheck (ctx) {
findUsers = userRes.map(item => { findUsers = userRes.map(item => {
return item.id return item.id
}) })
console.log('findUsers', findUsers)
let checkCount = Math.ceil(prepareRes.reportCount * (prepareRes.percentage / 100)) let checkCount = Math.ceil(prepareRes.reportCount * (prepareRes.percentage / 100))
console.log('checkCount', checkCount)
const reportRes = findUsers.length && checkCount ? await models.Report.findAll({ const reportRes = findUsers.length && checkCount ? await models.Report.findAll({
where: { where: {
reportType: 'conserve', reportType: 'conserve',
@ -418,7 +419,7 @@ async function spotCheck (ctx) {
id: previewId id: previewId
} }
}) })
console.log('reportRes', reportRes)
if (reportRes.length) { if (reportRes.length) {
let spotDate = moment().format('YYYY-MM-DD') let spotDate = moment().format('YYYY-MM-DD')
await models.ReportSpotCheck.bulkCreate(reportRes.map(r => { await models.ReportSpotCheck.bulkCreate(reportRes.map(r => {

10
web/client/src/sections/fillion/components/patrolTable.js

@ -111,8 +111,10 @@ const DetailForm = (props) => {
obj.name == 'id' ? obj.name == 'id' ?
moment(data.time).format("YYYYMMDD") * 10000 + data.id moment(data.time).format("YYYYMMDD") * 10000 + data.id
: :
obj.name == 'projectType' || obj.name == 'reportType' ? obj.name == 'reportType' ?
reportTypeText(data[obj.name]) : obj.name == 'inspectionNoException' ? changeBoolean(data[obj.name]) : reportTypeText(data[obj.name])
: obj.name == 'projectType' && data['codeRoad'] ? data['codeRoad'][0] === 'X' ? '县道'
: data['codeRoad'][0] === 'Y' ? '乡道' : '村道' :
data[obj.name] data[obj.name]
} }
disabled disabled
@ -133,7 +135,9 @@ const DetailForm = (props) => {
{ {
data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(videoUrl => { data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(videoUrl => {
return <div style={{ width: '44%', margin: 6 }}> return <div style={{ width: '44%', margin: 6 }}>
<video src={qndmn + '/' + videoUrl} width={'100%'} style={{ marginBottom: 4 }} /> <video width={'100%'} style={{ marginBottom: 4 }} >
<source src={qndmn + '/' + videoUrl} type="video/mp4" />
</video>
</div> </div>
}) : '暂无视频' }) : '暂无视频'
} }

58
web/client/src/sections/fillion/containers/maintenanceSpotCheck.js

@ -35,28 +35,29 @@ const DetailForm = (props) => {
} }
} }
const keyList = [ const keyList = [
{ key: '道路类型', name: 'reportType' }, { key: '路线代码', name: 'codeRoad' },
{ key: '其他', name: 'projectType' }, { key: '其他', name: 'reportType' },
{ key: '道路类型', name: 'projectType' },
{ key: '路线名称', name: 'road' }, { key: '路线名称', name: 'road' },
{ key: '养护路段', name: 'roadSectionStart' }, { key: '养护路段', name: 'roadSectionStart' },
{ key: '具体位置', name: 'address' }, { key: '具体位置', name: 'address' },
{ key: '路面类型', name: 'roadType' }, { key: '路面类型', name: 'roadType' },
{ key: '路面宽度', name: 'roadWidth' }, { key: '路面宽度(米)', name: 'roadWidth' },
{ key: '错车道', name: 'wrongLane' }, { key: '错车道(个)', name: 'wrongLane' },
{ key: '行道树', name: 'roadsideTrees' }, { key: '行道树(棵)', name: 'roadsideTrees' },
{ key: '边沟', name: 'roadsideDitch' }, { key: '边沟(米)', name: 'roadsideDitch' },
{ key: '护栏', name: 'guardrail' }, { key: '护栏(米)', name: 'guardrail' },
{ key: '标线', name: 'roadMarking' }, { key: '标线(米)', name: 'roadMarking' },
{ key: '养护人员人数', name: 'maintenanceStaffCount' }, { key: '养护人员人数(人)', name: 'maintenanceStaffCount' },
{ key: '修整路肩', name: 'shoulderRepair' }, { key: '修整路肩(平方米)', name: 'shoulderRepair' },
{ key: '清理边沟', name: 'ditchCleaning' }, { key: '清理边沟(米)', name: 'ditchCleaning' },
{ key: '修补沥青路面', name: 'asphaltRepair' }, { key: '修补沥青路面(平方米)', name: 'asphaltRepair' },
{ key: '修补水泥路面', name: 'concreteRepair' }, { key: '修补水泥路面(平方米)', name: 'concreteRepair' },
{ key: '除草', name: 'grassMowing' }, { key: '除草(米)', name: 'grassMowing' },
{ key: '树刷白', name: 'treeWhitening' }, { key: '树刷白(株/公里)', name: 'treeWhitening' },
{ key: '桩刷白', name: 'pileWhitening' }, { key: '桩刷白(个)', name: 'pileWhitening' },
{ key: '维护护栏', name: 'guardrailMaintenance' }, { key: '维护护栏(个)', name: 'guardrailMaintenance' },
{ key: '修复端头', name: 'endHeadRepair' }, { key: '修复端头(块)', name: 'endHeadRepair' },
{ key: '其他养护内容', name: 'otherDescription' }, { key: '其他养护内容', name: 'otherDescription' },
{ key: '养护前图片', name: 'conserveBeforePic' }, { key: '养护前图片', name: 'conserveBeforePic' },
{ key: '养护后图片', name: 'conserveAfterPic' }, { key: '养护后图片', name: 'conserveAfterPic' },
@ -85,13 +86,15 @@ const DetailForm = (props) => {
{ {
obj.name != 'conserveBeforePic' && obj.name != 'conserveAfterPic' && obj.name != 'roadSectionStart' && obj.name != 'videoUrl' && obj.name.indexOf('conserve') == -1 ? obj.name != 'conserveBeforePic' && obj.name != 'conserveAfterPic' && obj.name != 'roadSectionStart' && obj.name != 'videoUrl' && obj.name.indexOf('conserve') == -1 ?
<Input <Input
style={{ width: '70%' }} style={{ width: '60%' }}
value={ value={
obj.name == 'id' ? obj.name == 'id' ?
moment(data.time).format("YYYYMMDD") * 10000 + data.id moment(data.time).format("YYYYMMDD") * 10000 + data.id
: :
obj.name == 'projectType' || obj.name == 'reportType' ? obj.name == 'projectType' ?
reportTypeText(data[obj.name]) : obj.name == 'inspectionNoException' ? changeBoolean(data[obj.name]) : reportTypeText(data[obj.name])
: obj.name == 'reportType' && data['codeRoad'] ? data['codeRoad'][0] === 'X' ? '县道'
: data['codeRoad'][0] === 'Y' ? '乡道' : '村道' :
data[obj.name] data[obj.name]
} }
disabled disabled
@ -105,14 +108,16 @@ const DetailForm = (props) => {
</div> </div>
}) : '暂无图片' }) : '暂无图片'
} }
</div> : obj.name != 'videoUrl' ? <div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}> </div> : obj.name != 'videoUrl' ? <div style={{ width: '60%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
<Input style={{ width: '100%' }} disabled value={data[obj.name] + '-' + data['roadSectionEnd']} /> <Input style={{ width: '100%' }} disabled value={data[obj.name] + '-' + data['roadSectionEnd']} />
</div> : <div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}> </div> : <div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
{ {
data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(videoUrl => { data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(videoUrl => {
return <div style={{ width: '44%', margin: 6 }}> return <div style={{ width: '44%', margin: 6 }}>
<video src={qndmn + '/' + videoUrl} width={'100%'} style={{ marginBottom: 4 }} /> <video width={'100%'} style={{ marginBottom: 4 }} >
<source src={qndmn + '/' + videoUrl} type="video/mp4" />
</video>
</div> </div>
}) : '暂无视频' }) : '暂无视频'
} }
@ -291,7 +296,7 @@ const MaintenanceSpotCheck = (props) => {
} }
const columns = [ const columns = [
{ {
title: '编号', title: '抽查日期',
key: 'spotDate', key: 'spotDate',
dataIndex: 'spotDate', dataIndex: 'spotDate',
align: 'center', align: 'center',
@ -393,7 +398,10 @@ const MaintenanceSpotCheck = (props) => {
setDepName(res?.payload.data?.lukyDepartment?.name) setDepName(res?.payload.data?.lukyDepartment?.name)
setPreviewId(res?.payload.data?.previewId) setPreviewId(res?.payload.data?.previewId)
setTotal(((res?.payload.data?.reportCount) * Number(values.percentValue)) / 100) setTotal(((res?.payload.data?.reportCount) * Number(values.percentValue)) / 100)
form.setFieldsValue({ 'result': count, 'village': depName, 'total': total }) form.setFieldsValue({
'result': count, 'village': res?.payload.data?.lukyDepartment?.name,
'total': Math.ceil(((res?.payload.data?.reportCount) * Number(values.percentValue)) / 100)
})
} }
}) })
} }

Loading…
Cancel
Save