From 7e5a0ded48123f9e79c28f2abab12673e7e5c97d Mon Sep 17 00:00:00 2001 From: xiao-fajia <1665375861@qq.com> Date: Fri, 4 Oct 2024 23:11:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B7=AF=E6=AE=B5=E5=9B=9E?= =?UTF-8?q?=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/orderDetails/details.vue | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pages/orderDetails/details.vue b/pages/orderDetails/details.vue index cc1be9f..3b2b14d 100644 --- a/pages/orderDetails/details.vue +++ b/pages/orderDetails/details.vue @@ -89,7 +89,7 @@ 路段: - {{detailsData.sectionRoad || ''}} {{detailsData.sectionRoad ? getSectionRoadLabel(detailsData.sectionRoad) : ''}} 点击选择 @@ -284,12 +284,20 @@ this.id = option.id this.getrescueDetail(option.id) this.newtwo() + this.getRoadList(false); }, onShow() { - + }, methods: { + // 不改变原来的代码,新增一个查询路段的方法 + getSectionRoadLabel(id){ + if(typeof id === 'string'){ + id = parseInt(id) + } + return this.roadList.find(item => item.id === id)?.label + }, chooseRoad(data) { console.log(data); this.detailsData.sectionRoad = data.value[0].id @@ -299,12 +307,12 @@ this.carNumShow = false this.detailsData.driverCarNum = data.value[0].rescueCarNum }, - getRoadList() { + getRoadList(flag = true) { request({ url: '/system/rescueInfo/getRescueRoad', method: 'get' }).then((res) => { - this.roadShow = true + this.roadShow = flag this.roadList = res.data }) },