修改路段回显
This commit is contained in:
parent
7960eb6a90
commit
7e5a0ded48
@ -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
|
||||
})
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user