修改路段回显

This commit is contained in:
xiao-fajia 2024-10-04 23:11:37 +08:00
parent 7960eb6a90
commit 7e5a0ded48

View File

@ -89,7 +89,7 @@
<view class="dix">
<text class="huiy">路段:</text>
<text>{{detailsData.sectionRoad || ''}}</text> <text @click="getRoadList()"
<text>{{detailsData.sectionRoad ? getSectionRoadLabel(detailsData.sectionRoad) : ''}}</text> <text @click="getRoadList()"
style="margin-left: 20px;color:blue;font-size: 12px;">
点击选择</text>
</view>
@ -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
})
},