修改国际客运航次展示逻辑

dev201310
jinna 2 years ago
parent 5c5094f802
commit 52f80cf3c1
  1. 60
      pages/portShipping/waterInternational/form.vue

@ -70,7 +70,7 @@
</view> </view>
<view class="form_item"> <view class="form_item">
<view class="form_item_label">航次</view> <view class="form_item_label">航次</view>
<view class="form_item_input picker"> <!-- <view class="form_item_input picker" v-if="item.routeIndex !== ''">
<picker :value="item.voyageIndex" <picker :value="item.voyageIndex"
:range="item.routeIndex > -1 ? shipRouteList[item.routeIndex].voyageInfoVOList : []" :range="item.routeIndex > -1 ? shipRouteList[item.routeIndex].voyageInfoVOList : []"
range-key="voyageCode" @change="e => changeVoyage(e, index)"> range-key="voyageCode" @change="e => changeVoyage(e, index)">
@ -78,6 +78,14 @@
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons> <uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
</picker> </picker>
</view> </view>
<view class="form_item_input picker disabled" v-else @click="clickVoyage">
<text>请选择</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
</view> -->
<view class="form_item_input form_input">
<uni-easyinput v-model="item.voyage" placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入" maxlength="20">
</uni-easyinput>
</view>
</view> </view>
<view class="form_item"> <view class="form_item">
<view class="form_item_label">航次数</view> <view class="form_item_label">航次数</view>
@ -164,7 +172,7 @@
</view> </view>
<view class="form_item"> <view class="form_item">
<view class="form_item_label">航次</view> <view class="form_item_label">航次</view>
<view class="form_item_input picker"> <!-- <view class="form_item_input picker" v-if="item.routeIndex !== ''">
<picker :value="item.voyageIndex" <picker :value="item.voyageIndex"
:range="item.routeIndex > -1 ? internationalRouteList[item.routeIndex].voyageInfoVOList : []" :range="item.routeIndex > -1 ? internationalRouteList[item.routeIndex].voyageInfoVOList : []"
range-key="voyageCode" @change="e => changeVoyage(e, index)"> range-key="voyageCode" @change="e => changeVoyage(e, index)">
@ -172,6 +180,14 @@
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons> <uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
</picker> </picker>
</view> </view>
<view class="form_item_input picker disabled" v-else @click="clickVoyage">
<text>请选择</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
</view> -->
<view class="form_item_input form_input">
<uni-easyinput v-model="item.voyage" placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入" maxlength="20">
</uni-easyinput>
</view>
</view> </view>
<view class="form_item"> <view class="form_item">
<view class="form_item_label">航次数</view> <view class="form_item_label">航次数</view>
@ -423,24 +439,26 @@
this.$request(getApp().globalData.baseUrl + '/api/biz/internationalPassengerTransportPermissions/findList', {}, this.$request(getApp().globalData.baseUrl + '/api/biz/internationalPassengerTransportPermissions/findList', {},
"GET").then(res => { "GET").then(res => {
this.shipRouteList = res.data['客班轮']; this.shipRouteList = res.data['客班轮'];
this.internationalRouteList = res.data['国际邮轮']; this.internationalRouteList = res.data['国际邮轮'];
this.form.passengerShipDTOList.map(item => { this.form.passengerShipDTOList.map(item => {
let idx = this.shipRouteList.findIndex(item2 => item2.route == item.route); let idx = this.shipRouteList.findIndex(item2 => item2.route == item.route);
item.routeIndex = idx > -1 ? idx : ''; item.routeIndex = idx > -1 ? idx : '';
if (idx > -1) { // console.log('routeIndex ===>',typeof item.routeIndex)
let _idx = this.shipRouteList[idx].voyageInfoVOList.findIndex(item2 => item2.voyageCode == item // if (idx > -1) {
.voyage); // let _idx = this.shipRouteList[idx].voyageInfoVOList.findIndex(item2 => item2.voyageCode == item
item.voyageIndex = _idx > -1 ? _idx : ''; // .voyage);
} // item.voyageIndex = _idx > -1 ? _idx : '';
// }
}) })
this.form.internationalCruiseDTOList.map(item => { this.form.internationalCruiseDTOList.map(item => {
let idx = this.internationalRouteList.findIndex(item2 => item2.route == item.route); let idx = this.internationalRouteList.findIndex(item2 => item2.route == item.route);
item.routeIndex = idx > -1 ? idx : ''; item.routeIndex = idx > -1 ? idx : '';
if (idx > -1) { // if (idx > -1) {
let _idx = this.internationalRouteList[idx].voyageInfoVOList.findIndex(item2 => item2.voyageCode == // let _idx = this.internationalRouteList[idx].voyageInfoVOList.findIndex(item2 => item2.voyageCode ==
item.voyage); // item.voyage);
item.voyageIndex = _idx > -1 ? _idx : ''; // item.voyageIndex = _idx > -1 ? _idx : '';
} // }
}) })
console.log(this.form) console.log(this.form)
}) })
@ -626,6 +644,20 @@
this.form.internationalCruiseDTOList[index].direction = this.internationalRouteList[e.detail.value].direction; this.form.internationalCruiseDTOList[index].direction = this.internationalRouteList[e.detail.value].direction;
} }
}, },
clickVoyage(){
if (this.tabType == 1) {
uni.showToast({
title:"请先选择航线",
icon:"none"
})
}else{
uni.showToast({
title:"请先选择国际邮轮",
icon:"none"
})
}
},
// //
changeVoyage(e, index) { changeVoyage(e, index) {
if (this.tabType == 1) { if (this.tabType == 1) {
@ -907,6 +939,10 @@
text-align: right; text-align: right;
} }
} }
&.disabled{
color: #D4D4D4;
}
// //
&.text { &.text {

Loading…
Cancel
Save