Browse Source

(*) 调整功能优化

dev
peng.peng 1 year ago
parent
commit
e0d6dd0140
  1. 19
      api/app/lib/controllers/report/index.js
  2. 1
      web/client/src/sections/fillion/containers/maintenanceSpotCheck-new.js

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

@ -3,6 +3,7 @@ const { QueryTypes } = require('sequelize');
const moment = require('moment');
const xlsxDownload = require('../../../../utils/xlsxDownload.js');
const fs = require('fs');
const data = require('../../routes/data/index.js');
async function reportList(ctx) {
try {
const models = ctx.fs.dc.models;
@ -1074,6 +1075,24 @@ async function roadSpotChange (ctx) {
let content = ''
let curOriginRoad = roadRes.find(item => item.id == originRoadId)
let curChangeRoad = roadRes.find(item => item.id == changeRoadId)
const level = curChangeRoad.level;
let milData = {}
if (level == '县') {
milData = { countryMil: previewRes.countryMil + parseFloat(curChangeRoad.chainageMileage) - parseFloat(curOriginRoad.chainageMileage) }
} else if (level == '乡') {
milData = { townMil: previewRes.townMil + parseFloat(curChangeRoad.chainageMileage) - parseFloat(curOriginRoad.chainageMileage) }
} else if (level == '村') {
milData = { villageMil: previewRes.villageMil + parseFloat(curChangeRoad.chainageMileage) - parseFloat(curOriginRoad.chainageMileage) }
}
await models.RoadSpotCheckPreview.update({
...milData
}, {
where: {
id: previewId
},
transaction
})
content = `${curOriginRoad.routeName}${curOriginRoad.startingPlaceName}${curOriginRoad.stopPlaceName}改为${curChangeRoad.routeName}${curChangeRoad.startingPlaceName}${curChangeRoad.stopPlaceName}`

1
web/client/src/sections/fillion/containers/maintenanceSpotCheck-new.js

@ -345,6 +345,7 @@ const MaintenanceSpotCheck = (props) => {
}}
onOk={() => {
detailData({ previewId: expandedRowKeys[0], keyword: keyword })
queryData()
}}
/>
}

Loading…
Cancel
Save