Browse Source

feat:抽取列表的展示顺序,巡查的地址换行

dev
zhaobing 1 year ago
parent
commit
e5b0640435
  1. 4
      api/app/lib/controllers/report/index.js
  2. 4
      web/client/src/sections/fillion/components/patrolTable.js

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

@ -477,15 +477,17 @@ async function spotCheckDetail (ctx) {
where: {
checked: 'true'
},
order: [['date', 'DESC']],
include: [{
model: models.Department,
attributes: ['name']
}, {
model: models.ReportSpotCheck,
where: { spotDate: { $between: [moment(startTime).format('YYYY-MM-DD'), moment(endTime).format('YYYY-MM-DD')] } },
order: [['id', 'DESC']],
order: [['spot_date', 'DESC']],
include: [{
model: models.Report,
order: [['date', 'DESC']],
include: [{
model: models.User,
attributes: ['name']

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

@ -140,7 +140,7 @@ const DetailForm = (props) => {
{isPatrol ? <Descriptions title="基础信息" bordered style={{ marginBottom: 20 }}>
{info.map(obj => {
return (
obj.skip ? null : <Descriptions.Item label={obj.key} span={obj.name === 'roadSectionStart' ? 3 : 1}> {obj.name === 'projectType' ?
obj.skip ? null : <Descriptions.Item label={obj.key} span={obj.name === 'roadSectionStart' || obj.name === 'address' ? 3 : 1}> {obj.name === 'projectType' ?
reportTypeText(data[obj.name]) : obj.name === 'reportType' ?
data['codeRoad'] && data['codeRoad'].length ? data['codeRoad'][0] === 'X' ? '县道' : data['codeRoad'][0] === 'Y' ? '乡道' : '村道' : ''
: obj.name === 'roadSectionStart' ? data[obj.name] + '-' + data['roadSectionEnd'] || '' : data[obj.name] || ''}</Descriptions.Item>
@ -170,7 +170,7 @@ const DetailForm = (props) => {
patrolContent.map(obj => {
return (
obj.skip ? null : <Descriptions.Item label={obj.key}>
{obj.name === 'inspectionNoException' ? <Checkbox checked={data['inspectionNoException']} ></Checkbox> : data[obj.name] || ''}
{obj.name === 'inspectionNoException' && data['inspectionNoException'] ? <Checkbox checked={data['inspectionNoException']} ></Checkbox> : data[obj.name] || ''}
</Descriptions.Item>
)
})

Loading…
Cancel
Save