Browse Source

细节优化

dev
liujiangyong 1 year ago
parent
commit
2911823934
  1. 30
      weapp/src/packages/patrol/index.jsx

30
weapp/src/packages/patrol/index.jsx

@ -399,10 +399,6 @@ const Index = () => {
}
}, [])
useEffect(() => {
setRoadStartSel(sourceRoadStartSel)
setRoadEndSel(sourceRoadEndSel)
}, [sourceRoadStartSel, sourceRoadEndSel])
useEffect(() => {
setTypeList([
{
@ -576,12 +572,23 @@ const Index = () => {
case "roadCodeEnd":
setRoadCodeEnd(value)
if (value.length >= 9) {
let routeCode = ''
let roadStart = []
let roadEnd = []
let routeName = ''
for (const r of roadList) {
if (r.routeCode === roadCodeHead + value) {
setRoad(r.routeName)
setRoadSectionStart(r.startingPlaceName)
setRoadSectionEnd(r.stopPlaceName)
request.get(getReportList(), { limit: 1, page: 0, codeRoad: r.routeCode }).then(res => {
roadStart.push(r.startingPlaceName)
roadEnd.push(r.stopPlaceName)
routeCode = r.routeCode
routeName = r.routeName
}
}
setRoadStartSel(roadStart)
setRoadEndSel(roadEnd)
if (routeName) setRoad(routeName)
if (kind === 'conserve' && routeCode) {
request.get(getReportList(), { limit: 1, page: 0, codeRoad: routeCode }).then(res => {
if (res.statusCode === 200 && res.data.length) {
request.get(getReportDetail(res.data[0].id)).then(detailRes => {
if (res.statusCode === 200) {
@ -599,8 +606,6 @@ const Index = () => {
setPatrolContentEdit(true)
}
})
break;
}
}
}
break;
@ -611,6 +616,11 @@ const Index = () => {
break;
case "conserveContent":
let nextContent = { ...conserveContent }
if (value.split('.')[1] && value.split('.')[1].length > 3) {
setConserveContent(nextContent)
Taro.showToast({ title: '最多输入三位小数', icon: 'none', duration: 1500 })
return;
}
nextContent[key].value = value
setConserveContent(nextContent)
break;

Loading…
Cancel
Save