|
|
|
|
@ -55,9 +55,9 @@ |
|
|
|
|
<view class="form_item"> |
|
|
|
|
<view class="form_item_label">航线:</view> |
|
|
|
|
<view class="form_item_input picker"> |
|
|
|
|
<picker :value="routeIndex" :range="shipRouteList" @change="e => changeRoute(e, index)"> |
|
|
|
|
<picker :value="routeIndex" :range="shipRouteList" range-key="route" @change="e => changeRoute(e, index)"> |
|
|
|
|
<text class="picker_select" |
|
|
|
|
:style="item.route?'color:#333;':''">{{item.route?form.route:'请选择'}}</text> |
|
|
|
|
:style="item.route?'color:#333;':''">{{item.route?item.route:'请选择'}}</text> |
|
|
|
|
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons> |
|
|
|
|
</picker> |
|
|
|
|
</view> |
|
|
|
|
@ -65,7 +65,7 @@ |
|
|
|
|
<view class="form_item"> |
|
|
|
|
<view class="form_item_label">航次:</view> |
|
|
|
|
<view class="form_item_input picker"> |
|
|
|
|
<picker :value="voyageIndex" :range="shipVoyageList" @change="e => changeVoyage(e, index)"> |
|
|
|
|
<picker :value="voyageIndex" :range="item.routeIndex ? shipRouteList[item.routeIndex].voyageInfoVOList : []" range-key="voyageCode" @change="e => changeVoyage(e, index)"> |
|
|
|
|
<text class="picker_select" |
|
|
|
|
:style="item.voyage?'color:#333;':''">{{item.voyage?item.voyage:'请选择'}}</text> |
|
|
|
|
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons> |
|
|
|
|
@ -75,7 +75,7 @@ |
|
|
|
|
<view class="form_item"> |
|
|
|
|
<view class="form_item_label">{{item.direction == 1 ? '入青' : item.direction == 2 ? '出青' : ''}}旅客人数:</view> |
|
|
|
|
<view class="form_item_input form_input"> |
|
|
|
|
<uni-easyinput @blur="calcYoyMom" @clear="calcYoyMom" v-model="item.passengerCount" type="number" |
|
|
|
|
<uni-easyinput @blur="calcYoyMom(1,index)" @clear="calcYoyMom(1,index)" v-model="item.passengerCount" type="number" |
|
|
|
|
placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入" maxlength="20"> |
|
|
|
|
</uni-easyinput> |
|
|
|
|
</view> |
|
|
|
|
@ -121,9 +121,9 @@ |
|
|
|
|
<view class="form_item"> |
|
|
|
|
<view class="form_item_label">航线:</view> |
|
|
|
|
<view class="form_item_input picker"> |
|
|
|
|
<picker :value="routeIndex" :range="internationalRouteList" @change="e => changeRoute(e, index)"> |
|
|
|
|
<picker :value="routeIndex" :range="internationalRouteList" range-key="route" @change="e => changeRoute(e, index)"> |
|
|
|
|
<text class="picker_select" |
|
|
|
|
:style="item.route?'color:#333;':''">{{item.route?form.route:'请选择'}}</text> |
|
|
|
|
:style="item.route?'color:#333;':''">{{item.route?item.route:'请选择'}}</text> |
|
|
|
|
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons> |
|
|
|
|
</picker> |
|
|
|
|
</view> |
|
|
|
|
@ -131,7 +131,7 @@ |
|
|
|
|
<view class="form_item"> |
|
|
|
|
<view class="form_item_label">航次:</view> |
|
|
|
|
<view class="form_item_input picker"> |
|
|
|
|
<picker :value="voyageIndex" :range="internationalVoyageList" @change="e => changeVoyage(e, index)"> |
|
|
|
|
<picker :value="voyageIndex" :range="item.routeIndex ? internationalRouteList[item.routeIndex].voyageInfoVOList : []" range-key="voyageCode" @change="e => changeVoyage(e, index)"> |
|
|
|
|
<text class="picker_select" |
|
|
|
|
:style="item.voyage?'color:#333;':''">{{item.voyage?item.voyage:'请选择'}}</text> |
|
|
|
|
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons> |
|
|
|
|
@ -141,7 +141,7 @@ |
|
|
|
|
<view class="form_item"> |
|
|
|
|
<view class="form_item_label">{{item.direction == 1 ? '入青' : item.direction == 2 ? '出青' : ''}}旅客人数:</view> |
|
|
|
|
<view class="form_item_input form_input"> |
|
|
|
|
<uni-easyinput @blur="calcYoyMom" @clear="calcYoyMom" v-model="item.passengerCount" type="number" |
|
|
|
|
<uni-easyinput @blur="calcYoyMom(2,index)" @clear="calcYoyMom(2,index)" v-model="item.passengerCount" type="number" |
|
|
|
|
placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入" maxlength="20"> |
|
|
|
|
</uni-easyinput> |
|
|
|
|
</view> |
|
|
|
|
@ -220,9 +220,7 @@ |
|
|
|
|
stationList: [], //车站列表 |
|
|
|
|
railwayNameIndex: '', |
|
|
|
|
shipRouteList: [], //客班轮航线 |
|
|
|
|
shipVoyageList: [],//客班轮航次 |
|
|
|
|
internationalRouteList: [], //国际邮轮航线 |
|
|
|
|
internationalVoyageList: [],//国际邮轮航次 |
|
|
|
|
array: [], //时段选择列表 |
|
|
|
|
index: 2, //时段选择,默认0-24 |
|
|
|
|
userInfo: {}, |
|
|
|
|
@ -235,7 +233,6 @@ |
|
|
|
|
}, |
|
|
|
|
onLoad(options) { |
|
|
|
|
this.userInfo = uni.getStorageSync('userInfo'); |
|
|
|
|
this.queryStation(); //车展名称列表 |
|
|
|
|
let arr = uni.getStorageSync('deptName'); |
|
|
|
|
this.deptNameList = checkNotEmpty(arr) ? arr : []; |
|
|
|
|
if (options.type == 'add') { |
|
|
|
|
@ -244,21 +241,47 @@ |
|
|
|
|
this.pageType = 'add'; |
|
|
|
|
let now = new Date(); |
|
|
|
|
this.form.statDate = getDateStr(now, -1); //默认前一天 |
|
|
|
|
this.queryTime(); //统计时段 |
|
|
|
|
this.queryTime(); //统计时段 |
|
|
|
|
this.queryRoute(); |
|
|
|
|
} else if (options.id) { |
|
|
|
|
this.btnText = '修改并保存'; |
|
|
|
|
this.$request(getApp().globalData.baseUrl + '/api/biz/railwayRunData/find/' + options.id, {}, "GET").then( |
|
|
|
|
this.$request(getApp().globalData.baseUrl + '/api/biz/internationalPassengerTransport/selectById/' + options.id, {}, "GET").then( |
|
|
|
|
res => { |
|
|
|
|
this.form = res.data; |
|
|
|
|
if (checkNotEmpty(this.deptNameList)) { |
|
|
|
|
let idx = this.deptNameList.findIndex(item => item.deptName = this.form.organizationName); |
|
|
|
|
this.form.organizationNameIndex = idx > -1 ? idx : ''; |
|
|
|
|
} |
|
|
|
|
this.queryTime(); //统计时段 |
|
|
|
|
this.queryTime(); //统计时段 |
|
|
|
|
this.queryRoute(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
methods: { |
|
|
|
|
//航线查询 |
|
|
|
|
queryRoute() { |
|
|
|
|
this.$request(getApp().globalData.baseUrl + '/api/biz/internationalPassengerTransportPermissions/findList', {}, "GET").then(res => { |
|
|
|
|
this.shipRouteList = res.data['客班轮']; |
|
|
|
|
this.internationalRouteList = res.data['国际邮轮']; |
|
|
|
|
console.log(this.shipRouteList) |
|
|
|
|
this.form.passengerShipDTOList.map(item => { |
|
|
|
|
let idx = this.shipRouteList.findIndex(item2 => item2.route == item.route); |
|
|
|
|
item.routeIndex = idx > -1 ? idx : ''; |
|
|
|
|
if(idx > -1) { |
|
|
|
|
let _idx = this.shipRouteList[idx].voyageInfoVOList.findIndex(item2 => item2.voyageCode == item.voyage); |
|
|
|
|
item.voyageIndex = _idx > -1 ? _idx : ''; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.form.internationalCruiseDTOList.map(item => { |
|
|
|
|
let idx = this.shipRouteList.findIndex(item2 => item2.route == item.route); |
|
|
|
|
item.routeIndex = idx > -1 ? idx : ''; |
|
|
|
|
if(idx > -1) { |
|
|
|
|
let _idx = this.shipRouteList[idx].voyageInfoVOList.findIndex(item2 => item2.voyageCode == item.voyage); |
|
|
|
|
item.voyageIndex = _idx > -1 ? _idx : ''; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//切换管理单位 |
|
|
|
|
bindDeptChange(e) { |
|
|
|
|
this.form.organizationNameIndex = e.detail.value; |
|
|
|
|
@ -307,60 +330,107 @@ |
|
|
|
|
queryYoyMom() { |
|
|
|
|
if (this.form.statDate == '' || this.form.statPeriod == '') { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//客班轮 |
|
|
|
|
this.form.passengerShipDTOList.map((item,index) => { |
|
|
|
|
if(checkNotEmpty(item.voyage)) { |
|
|
|
|
this.calcYoyMom(1,index); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
//国际邮轮 |
|
|
|
|
this.form.internationalCruiseDTOList.map((item,index) => { |
|
|
|
|
if(checkNotEmpty(item.voyage)) { |
|
|
|
|
this.calcYoyMom(2,index); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
// let _date = getDateStr(new Date(this.form.statDate), -1); |
|
|
|
|
this.$request(getApp().globalData.baseUrl + '/api/biz/railwayRunData/getYoYMoM?statDate=' + this.form |
|
|
|
|
.statDate + '&statPeriod=' + this.form.statPeriod + '&_t=' + Date.parse(new Date()), {}, 'GET') |
|
|
|
|
.then(res => { |
|
|
|
|
this.yoyMom = res.data; |
|
|
|
|
this.calcYoyMom(); //同步更新环比同比 |
|
|
|
|
}) |
|
|
|
|
// this.$request(getApp().globalData.baseUrl + '/api/biz/internationalPassengerTransport/getYoYAndMoM?statDate=' + this.form |
|
|
|
|
// .statDate + '&statPeriod=' + this.form.statPeriod + '&voyage=' + '&_t=' + Date.parse(new Date()), {}, 'GET') |
|
|
|
|
// .then(res => { |
|
|
|
|
// this.yoyMom = res.data; |
|
|
|
|
// this.calcYoyMom(); //同步更新环比同比 |
|
|
|
|
// }) |
|
|
|
|
}, |
|
|
|
|
//环比同比计算 |
|
|
|
|
calcYoyMom() { |
|
|
|
|
console.log('同比环比计算') |
|
|
|
|
this.form.inRailwayYomDo = this.$calcMom(this.form.inRailwayYomDo,this.yoyMom.yesterdayData.inboundRailwayDo); |
|
|
|
|
this.form.inPepoleYoyDo = this.$calcMom(this.form.inPepole,this.yoyMom.yesterdayData.inPepole); |
|
|
|
|
this.form.outRailwayYomDo = this.$calcMom(this.form.outboundRailwayDo,this.yoyMom.yesterdayData.outboundRailwayDo); |
|
|
|
|
this.form.outPepoleYoyDo = this.$calcMom(this.form.outPepole,this.yoyMom.yesterdayData.outPepole); |
|
|
|
|
this.form.inRailwayMomDo = this.$calcYoy(this.form.inboundRailwayDo,this.yoyMom.lastYearData.inboundRailwayDo); |
|
|
|
|
this.form.inPepoleMomDo = this.$calcYoy(this.form.inPepole,this.yoyMom.lastYearData.inPepole); |
|
|
|
|
this.form.outRailwayMomDo = this.$calcYoy(this.form.outboundRailwayDo,this.yoyMom.lastYearData.outboundRailwayDo); |
|
|
|
|
this.form.outPepoleMomDo = this.$calcYoy(this.form.outPepole,this.yoyMom.lastYearData.outPepole); |
|
|
|
|
}, |
|
|
|
|
//车站权限列表 |
|
|
|
|
queryStation() { |
|
|
|
|
this.$request(getApp().globalData.baseUrl + '/api/biz/railwayRunData/getCurrentSite?_t=' + Date.parse( |
|
|
|
|
new Date()), {}, 'GET').then(res => { |
|
|
|
|
this.stationList = res.data; |
|
|
|
|
if (this.pageType == 'add') { |
|
|
|
|
this.form.railwayName = res.data[0]; |
|
|
|
|
this.railwayNameIndex = 0; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
calcYoyMom(type, index) { |
|
|
|
|
console.log('同比环比计算') |
|
|
|
|
let _voyage = type==1?this.form.passengerShipDTOList[index].voyage : this.form.internationalCruiseDTOList[index].voyage; |
|
|
|
|
this.$request(getApp().globalData.baseUrl + '/api/biz/internationalPassengerTransport/getYoYAndMoM?statDate=' + this.form |
|
|
|
|
.statDate + '&statPeriod=' + this.form.statPeriod + '&voyage=' + _voyage + '&_t=' + Date.parse(new Date()), {}, 'GET') |
|
|
|
|
.then(res => { |
|
|
|
|
if(type == 1) { |
|
|
|
|
//客班轮 |
|
|
|
|
this.form.passengerShipDTOList[index].passengerDod = this.$calcMom(this.form.passengerShipDTOList[index].passengerCount,res.data); |
|
|
|
|
this.form.passengerShipDTOList[index].passengerYoy = this.$calcYoy(this.form.passengerShipDTOList[index].passengerCount,res.data); |
|
|
|
|
}else{ |
|
|
|
|
//国际邮轮 |
|
|
|
|
this.form.internationalCruiseDTOList[index].passengerDod = this.$calcMom(this.form.internationalCruiseDTOList[index].passengerCount,res.data); |
|
|
|
|
this.form.internationalCruiseDTOList[index].passengerYoy = this.$calcYoy(this.form.internationalCruiseDTOList[index].passengerCount,res.data); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//航线选择 |
|
|
|
|
changeRoute(e, index) { |
|
|
|
|
if(this.tabType == 1) { |
|
|
|
|
//客班轮 |
|
|
|
|
this.form.passengerShipDTOList[index].routeIndex = e.detail.value; |
|
|
|
|
this.form.passengerShipDTOList[index].route = this.shipRouteList[e.detail.value].name; |
|
|
|
|
//判断是否重复选择 |
|
|
|
|
let idx = this.form.passengerShipDTOList.findIndex(item => item.routeIndex == e.detail.value); |
|
|
|
|
if (idx > -1 && this.form.passengerShipDTOList[index].routeIndex != idx) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '客班轮航线不能重复选择', |
|
|
|
|
icon: 'none' |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
this.form.passengerShipDTOList[index].routeIndex = e.detail.value; |
|
|
|
|
this.form.passengerShipDTOList[index].route = this.shipRouteList[e.detail.value].route; |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
//国际邮轮 |
|
|
|
|
this.form.internationalCruiseDTOList[index].routeIndex = e.detail.value; |
|
|
|
|
this.form.internationalCruiseDTOList[index].route = this.internationalRouteList[e.detail.value].name; |
|
|
|
|
//判断是否重复选择 |
|
|
|
|
let idx = this.form.internationalCruiseDTOList.findIndex(item => item.routeIndex == e.detail.value); |
|
|
|
|
if (idx > -1 && this.form.internationalCruiseDTOList[index].routeIndex != idx) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '国际邮轮航线不能重复选择', |
|
|
|
|
icon: 'none' |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
this.form.internationalCruiseDTOList[index].routeIndex = e.detail.value; |
|
|
|
|
this.form.internationalCruiseDTOList[index].route = this.internationalRouteList[e.detail.value].route; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
//航次选择 |
|
|
|
|
changeVoyage(e, index) { |
|
|
|
|
if(this.tabType == 1) { |
|
|
|
|
//客班轮 |
|
|
|
|
this.form.passengerShipDTOList[index].voyageIndex = e.detail.value; |
|
|
|
|
this.form.passengerShipDTOList[index].voyage = this.shipVoyageList[e.detail.value].name; |
|
|
|
|
//判断是否重复选择 |
|
|
|
|
let routeIndex = this.form.passengerShipDTOList[index].routeIndex; |
|
|
|
|
let idx = this.form.passengerShipDTOList.findIndex(item => item.voyageIndex == e.detail.value); |
|
|
|
|
if (idx > -1 && this.form.passengerShipDTOList[index].voyageIndex != idx) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '客班轮航次不能重复选择', |
|
|
|
|
icon: 'none' |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
this.form.passengerShipDTOList[index].voyageIndex = e.detail.value; |
|
|
|
|
this.form.passengerShipDTOList[index].voyage = this.shipRouteList[routeIndex].voyageInfoVOList[e.detail.value].voyageCode; |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
//国际邮轮 |
|
|
|
|
//判断是否重复选择 |
|
|
|
|
let routeIndex = this.form.internationalCruiseDTOList[index].routeIndex; |
|
|
|
|
let idx = this.form.internationalCruiseDTOList.findIndex(item => item.voyageIndex == e.detail.value); |
|
|
|
|
if (idx > -1 && this.form.internationalCruiseDTOList[index].voyageIndex != idx) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '国际邮轮航次不能重复选择', |
|
|
|
|
icon: 'none' |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
this.form.internationalCruiseDTOList[index].voyageIndex = e.detail.value; |
|
|
|
|
this.form.internationalCruiseDTOList[index].voyage = this.internationalVoyageList[e.detail.value].name; |
|
|
|
|
this.form.internationalCruiseDTOList[index].voyage = this.internationalRouteList[routeIndex].voyageInfoVOList[e.detail.value].voyageCode; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
//统计时段切换选择 |
|
|
|
|
@ -453,7 +523,7 @@ |
|
|
|
|
title: '提交中...', |
|
|
|
|
mask: true |
|
|
|
|
}) |
|
|
|
|
this.$request(getApp().globalData.baseUrl + '/api/biz/railwayRunData/saveOrUpdate', this.form, |
|
|
|
|
this.$request(getApp().globalData.baseUrl + '/api/biz/internationalPassengerTransport/saveOrUpdate', this.form, |
|
|
|
|
'POST').then(res => { |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
if (res.code == 200) { |