From f4c354bd41ca3c1cdb04aa8d0bd4360e6b95dff1 Mon Sep 17 00:00:00 2001 From: liujiangyong Date: Thu, 14 Dec 2023 17:12:45 +0800 Subject: [PATCH] fix bug --- weapp/src/packages/patrol/index.jsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/weapp/src/packages/patrol/index.jsx b/weapp/src/packages/patrol/index.jsx index a0a9cfe7..120343d1 100644 --- a/weapp/src/packages/patrol/index.jsx +++ b/weapp/src/packages/patrol/index.jsx @@ -783,9 +783,14 @@ const Index = () => { } if (nextValue.routeName && nextValue.routeCode && nextValue.sectionNo) { - nextValue.startingPlaceName = data[0]?.startingPlaceName - nextValue.stopPlaceName = data[0]?.stopPlaceName - setRoadCodeHead(data[0]?.routeCode?.charAt(0)) + let find = roadList?.find( + s => nextValue.routeName == s.routeName + && nextValue.routeCode == s.routeCode + && nextValue.sectionNo == s.sectionNo + ) + nextValue.startingPlaceName = find?.startingPlaceName + nextValue.stopPlaceName = find?.stopPlaceName + setRoadCodeHead(find?.routeCode?.charAt(0)) } else { nextValue.startingPlaceName = '' nextValue.stopPlaceName = ''