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 }) },