国际客运逻辑开发

main
zhangqun 3 years ago
parent 59cf31786d
commit a4f42fc712
  1. 3
      common/util.js
  2. 4
      pages/highWay/runData/form.vue
  3. 325
      pages/portShipping/internationalTransport/form.vue

@ -102,11 +102,12 @@ function getDay(d, num) {
// 计算环比 // 计算环比
function calcMom(cur, data) { function calcMom(cur, data) {
console.log(cur,"环比==========",data);
return !checkNotEmpty(cur) || !checkNotEmpty(data) ? '' : data === 0 && parseInt(cur) === 0 ? 0 : data === 0 && parseInt(cur) > 0 ? 100 : (parseInt(cur) - data) / data * 100; return !checkNotEmpty(cur) || !checkNotEmpty(data) ? '' : data === 0 && parseInt(cur) === 0 ? 0 : data === 0 && parseInt(cur) > 0 ? 100 : (parseInt(cur) - data) / data * 100;
} }
// 计算同比 // 计算同比
function calcYoy(cur, data) { function calcYoy(cur, data) {
console.log(cur,"==========",data); console.log(cur,"同比==========",data);
return !checkNotEmpty(cur) || !checkNotEmpty(data) ? '' : data === 0 && parseInt(cur) === 0 ? 0 : data === 0 && parseInt(cur) > 0 ? 100 : (parseInt(cur) - data) / data * 100; return !checkNotEmpty(cur) || !checkNotEmpty(data) ? '' : data === 0 && parseInt(cur) === 0 ? 0 : data === 0 && parseInt(cur) > 0 ? 100 : (parseInt(cur) - data) / data * 100;
} }

@ -402,7 +402,7 @@
if (idx > -1) { if (idx > -1) {
// //
let obj = this.yoyMom.minusDaysList[idx]; let obj = this.yoyMom.minusDaysList[idx];
// console.log(obj) // console.log(this.form.highwaySubDataList[index],obj)
this.form.highwaySubDataList[index].entranceVehicleCountMom = this.$calcMom(this.form this.form.highwaySubDataList[index].entranceVehicleCountMom = this.$calcMom(this.form
.highwaySubDataList[index].entranceVehicleCount, obj.entranceVehicleCount); .highwaySubDataList[index].entranceVehicleCount, obj.entranceVehicleCount);
this.form.highwaySubDataList[index].exitVehicleCountMom = this.$calcMom(this.form.highwaySubDataList[index].exitVehicleCount,obj.exitVehicleCount); this.form.highwaySubDataList[index].exitVehicleCountMom = this.$calcMom(this.form.highwaySubDataList[index].exitVehicleCount,obj.exitVehicleCount);
@ -414,7 +414,7 @@
if (idx2 > -1) { if (idx2 > -1) {
// //
let obj = this.yoyMom.minusYearsList[idx2]; let obj = this.yoyMom.minusYearsList[idx2];
console.log(obj) // console.log(obj)
this.form.highwaySubDataList[index].entranceVehicleCountYoy = this.$calcYoy(this.form this.form.highwaySubDataList[index].entranceVehicleCountYoy = this.$calcYoy(this.form
.highwaySubDataList[index].entranceVehicleCount,obj.entranceVehicleCount); .highwaySubDataList[index].entranceVehicleCount,obj.entranceVehicleCount);

@ -9,11 +9,13 @@
<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">
<picker :value="railwayNameIndex" :range="stationList" @change="changeRailway"> <picker v-if="pageType == 'add' && deptNameList.length > 1" :value="form.organizationNameIndex"
:range="deptNameList" range-key="deptName" @change="bindDeptChange">
<text class="picker_select" <text class="picker_select"
:style="form.railwayName?'color:#333;':''">{{form.railwayName?form.railwayName:'请选择'}}</text> :style="form.organizationName?'color:#333;':''">{{form.organizationName?form.organizationName:'请选择'}}</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons> <uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
</picker> </picker>
<text v-else>{{form.organizationName}}</text>
</view> </view>
</view> </view>
<view class="form_item"> <view class="form_item">
@ -44,18 +46,18 @@
<view class="tab_nav" :class="tabType == 2 ? 'active' : ''" @click="tabType = 2">国际邮轮</view> <view class="tab_nav" :class="tabType == 2 ? 'active' : ''" @click="tabType = 2">国际邮轮</view>
</view> </view>
<!-- 客班轮 --> <!-- 客班轮 -->
<view class="form_item_li" v-show="tabType == 1"> <view class="form_item_li" v-show="tabType == 1" v-for="(item,index) in form.passengerShipDTOList" :key="index">
<view class="form_item" <view class="form_item"
style="display:flex; justify-content: space-between; font-size: 30rpx;color:#333;font-weight: bold;margin-top: 30rpx;"> style="display:flex; justify-content: space-between; font-size: 30rpx;color:#333;font-weight: bold;margin-top: 30rpx;">
运输数据 客班轮-{{ index+1 }}
<uni-icons type="trash" color="red" @click="delRow(0)" size="18"></uni-icons> <uni-icons type="trash" color="red" @click="deleteRow(index)" size="18"></uni-icons>
</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">
<picker :value="railwayNameIndex" :range="stationList" @change="changeRailway"> <picker :value="routeIndex" :range="shipRouteList" @change="e => changeRoute(e, index)">
<text class="picker_select" <text class="picker_select"
:style="form.railwayName?'color:#333;':''">{{form.railwayName?form.railwayName:'请选择'}}</text> :style="item.route?'color:#333;':''">{{item.route?form.route:'请选择'}}</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons> <uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
</picker> </picker>
</view> </view>
@ -63,65 +65,65 @@
<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">
<picker :value="railwayNameIndex" :range="stationList" @change="changeRailway"> <picker :value="voyageIndex" :range="shipVoyageList" @change="e => changeVoyage(e, index)">
<text class="picker_select" <text class="picker_select"
:style="form.railwayName?'color:#333;':''">{{form.railwayName?form.railwayName:'请选择'}}</text> :style="item.voyage?'color:#333;':''">{{item.voyage?item.voyage:'请选择'}}</text>
<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> </view>
<view class="form_item"> <view class="form_item">
<view class="form_item_label">入青旅客人数</view> <view class="form_item_label">{{item.direction == 1 ? '入青' : item.direction == 2 ? '出青' : ''}}旅客人数</view>
<view class="form_item_input form_input"> <view class="form_item_input form_input">
<uni-easyinput @blur="calcYoyMom" @clear="calcYoyMom" v-model="form.inboundPassengersDo" type="number" <uni-easyinput @blur="calcYoyMom" @clear="calcYoyMom" v-model="item.passengerCount" type="number"
placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入" maxlength="20"> placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入" maxlength="20">
</uni-easyinput> </uni-easyinput>
</view> </view>
</view> </view>
<!-- 同比环比 --> <!-- 同比环比 -->
<view class="form_item_rate" <view class="form_item_rate"
:class="form.inboundRailwayDo === 0 ? 'danger' : '' "> :class="item.passengerDod === 0 ? 'danger' : '' ">
<view class="rate_item"> <view class="rate_item">
<view class="rate_item_label" <view class="rate_item_label"
:style="form.inboundRailwayDo === 0 ? 'color: #EB4747' : ''"> :style="item.passengerDod === 0 ? 'color: #EB4747' : ''">
入青旅客人数环比</view> {{item.direction == 1 ? '入青' : item.direction == 2 ? '出青' : ''}}旅客人数环比</view>
<view class="rate_item_input" <view class="rate_item_input"
:style="form.inboundRailwayDo === 0 ? 'color: #EB4747' : ''"> :style="item.passengerDod === 0 ? 'color: #EB4747' : ''">
{{formatDigit(form.inRailwayYomDo)}}% {{formatDigit(form.passengerDod)}}%
</view> </view>
</view> </view>
<view class="line"></view> <view class="line"></view>
<view class="rate_item"> <view class="rate_item">
<view class="rate_item_label">入青旅客人数同比</view> <view class="rate_item_label">{{item.direction == 1 ? '入青' : item.direction == 2 ? '出青' : ''}}旅客人数同比</view>
<view class="rate_item_input"> <view class="rate_item_input">
{{formatDigit(form.inRailwayMomDo)}}% {{formatDigit(item.passengerYoy)}}%
</view> </view>
</view> </view>
</view> </view>
<view class="form_item_remark"> <view class="form_item_remark">
<view class="form_item_label">备注</view> <view class="form_item_label">备注</view>
<view class="form_item_input"> <view class="form_item_input">
<uni-easyinput v-model="form.inMark" <uni-easyinput v-model="item.remarks"
placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入备注信息" type="textarea" maxlength="200" placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入备注信息" type="textarea" maxlength="200"
autoHeight></uni-easyinput> autoHeight></uni-easyinput>
</view> </view>
</view> </view>
<view class="line"></view> <view class="line" v-if="form.passengerShipDTOList.length > 1"></view>
</view> </view>
<!-- 国际邮轮 --> <!-- 国际邮轮 -->
<view class="form_item_li" v-show="tabType == 2"> <view class="form_item_li" v-show="tabType == 2" v-for="(item,index) in form.internationalCruiseDTOList" :key="index">
<view class="form_item" <view class="form_item"
style="display:flex; justify-content: space-between; font-size: 30rpx;color:#333;font-weight: bold;margin-top: 30rpx;"> style="display:flex; justify-content: space-between; font-size: 30rpx;color:#333;font-weight: bold;margin-top: 30rpx;">
运输数据 国际邮轮-{{ index+1 }}
<uni-icons type="trash" color="red" @click="delRow(0)" size="18"></uni-icons> <uni-icons type="trash" color="red" @click="deleteRow(index)" size="18"></uni-icons>
</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">
<picker :value="railwayNameIndex" :range="stationList" @change="changeRailway"> <picker :value="routeIndex" :range="internationalRouteList" @change="e => changeRoute(e, index)">
<text class="picker_select" <text class="picker_select"
:style="form.railwayName?'color:#333;':''">{{form.railwayName?form.railwayName:'请选择'}}</text> :style="item.route?'color:#333;':''">{{item.route?form.route:'请选择'}}</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons> <uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
</picker> </picker>
</view> </view>
@ -129,56 +131,55 @@
<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">
<picker :value="railwayNameIndex" :range="stationList" @change="changeRailway"> <picker :value="voyageIndex" :range="internationalVoyageList" @change="e => changeVoyage(e, index)">
<text class="picker_select" <text class="picker_select"
:style="form.railwayName?'color:#333;':''">{{form.railwayName?form.railwayName:'请选择'}}</text> :style="item.voyage?'color:#333;':''">{{item.voyage?item.voyage:'请选择'}}</text>
<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> </view>
<view class="form_item"> <view class="form_item">
<view class="form_item_label">入青旅客人数</view> <view class="form_item_label">{{item.direction == 1 ? '入青' : item.direction == 2 ? '出青' : ''}}旅客人数</view>
<view class="form_item_input form_input"> <view class="form_item_input form_input">
<uni-easyinput @blur="calcYoyMom" @clear="calcYoyMom" v-model="form.inboundPassengersDo" type="number" <uni-easyinput @blur="calcYoyMom" @clear="calcYoyMom" v-model="item.passengerCount" type="number"
placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入" maxlength="20"> placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入" maxlength="20">
</uni-easyinput> </uni-easyinput>
</view> </view>
</view> </view>
<!-- 同比环比 --> <!-- 同比环比 -->
<view class="form_item_rate" <view class="form_item_rate"
:class="form.inboundRailwayDo === 0 ? 'danger' : '' "> :class="item.passengerDod === 0 ? 'danger' : '' ">
<view class="rate_item"> <view class="rate_item">
<view class="rate_item_label" <view class="rate_item_label"
:style="form.inboundRailwayDo === 0 ? 'color: #EB4747' : ''"> :style="item.passengerDod === 0 ? 'color: #EB4747' : ''">
入青旅客人数环比</view> {{item.direction == 1 ? '入青' : item.direction == 2 ? '出青' : ''}}旅客人数环比</view>
<view class="rate_item_input" <view class="rate_item_input"
:style="form.inboundRailwayDo === 0 ? 'color: #EB4747' : ''"> :style="item.passengerDod === 0 ? 'color: #EB4747' : ''">
{{formatDigit(form.inRailwayYomDo)}}% {{formatDigit(form.passengerDod)}}%
</view> </view>
</view> </view>
<view class="line"></view> <view class="line"></view>
<view class="rate_item"> <view class="rate_item">
<view class="rate_item_label">入青旅客人数同比</view> <view class="rate_item_label">{{item.direction == 1 ? '入青' : item.direction == 2 ? '出青' : ''}}旅客人数同比</view>
<view class="rate_item_input"> <view class="rate_item_input">
{{formatDigit(form.inRailwayMomDo)}}% {{formatDigit(item.passengerYoy)}}%
</view> </view>
</view> </view>
</view> </view>
<view class="form_item_remark"> <view class="form_item_remark">
<view class="form_item_label">备注</view> <view class="form_item_label">备注</view>
<view class="form_item_input"> <view class="form_item_input">
<uni-easyinput v-model="form.outMark" <uni-easyinput v-model="item.remarks"
placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入备注信息" type="textarea" maxlength="200" placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入备注信息" type="textarea" maxlength="200"
autoHeight></uni-easyinput> autoHeight></uni-easyinput>
</view> </view>
</view> </view>
<view class="line"></view> <view class="line" v-if="form.internationalCruiseDTOList.length > 1"></view>
</view> </view>
<view class="add_btn" @click="addRow()">增行</view> <view class="add_btn" @click="addRow">增行</view>
</view> </view>
<!-- 底部按钮 --> <!-- 底部按钮 -->
<view class="foot_btn"> <view class="foot_btn">
<!-- <view class="act_btn" @click="doCancel">取消</view> -->
<view class="act_btn blue" @click="doSubmit">{{btnText}}</view> <view class="act_btn blue" @click="doSubmit">{{btnText}}</view>
</view> </view>
</view> </view>
@ -192,44 +193,54 @@
data() { data() {
return { return {
form: { form: {
"inMark": "", "internationalCruiseDTOList": [{
"inPepole": '', "route": "",
"inPepoleMomDo": '', "routeIndex": "",
"inPepoleYoyDo": '', "voyage": "",
"inRailwayMomDo": '', "voyageIndex": "",
"inRailwayYomDo": '', "direction": "",
"inboundPassengersDo": '', "passengerCount": "",
"inboundRailwayDo": '', "passengerDod": "",//
"isHoliday": "", "passengerYoy": "",//
"outMark": "", }],//
"outPepole": '', "passengerShipDTOList":[{
"outPepoleMomDo": '', "route": "",
"outPepoleYoyDo": '', "routeIndex": "",
"outRailwayMomDo": '', "voyage": "",
"outRailwayYomDo": '', "voyageIndex": "",
"outboundPassengersDo": '', "direction": "",
"outboundRailwayDo": '', "passengerCount": "",
"railwayName": "", "passengerDod": "",//
"passengerYoy": "",//
}],//
"organizationName": "",
"statDate": "", "statDate": "",
"statPeriod": "" "statPeriod": ""
}, //form }, //form
stationList: [], // stationList: [], //
railwayNameIndex: '', railwayNameIndex: '',
submitPerson: [], // shipRouteList: [], //线
submitPersonIndex: -1, // shipVoyageList: [],//
internationalRouteList: [], //线
internationalVoyageList: [],//
array: [], // array: [], //
index: 2, //,0-24 index: 2, //,0-24
userInfo: {}, userInfo: {},
pageType: '', pageType: '',
btnText: '保存', btnText: '保存',
tabType: 1, tabType: 1,
deptNameList: [], //
mobile: getApp().globalData.mobile mobile: getApp().globalData.mobile
} }
}, },
onLoad(options) { onLoad(options) {
this.userInfo = uni.getStorageSync('userInfo'); this.userInfo = uni.getStorageSync('userInfo');
this.queryStation(); // this.queryStation(); //
let arr = uni.getStorageSync('deptName');
this.deptNameList = checkNotEmpty(arr) ? arr : [];
if (options.type == 'add') { if (options.type == 'add') {
this.form.organizationName = this.deptNameList.length > 0 ? this.deptNameList[0].deptName : '';
this.form.organizationNameIndex = this.deptNameList.length > 0 ? 0 : '';
this.pageType = 'add'; this.pageType = 'add';
let now = new Date(); let now = new Date();
this.form.statDate = getDateStr(now, -1); // this.form.statDate = getDateStr(now, -1); //
@ -239,20 +250,55 @@
this.$request(getApp().globalData.baseUrl + '/api/biz/railwayRunData/find/' + options.id, {}, "GET").then( this.$request(getApp().globalData.baseUrl + '/api/biz/railwayRunData/find/' + options.id, {}, "GET").then(
res => { res => {
this.form = res.data; 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(); //
}); });
} }
}, },
methods: { methods: {
//
bindDeptChange(e) {
this.form.organizationNameIndex = e.detail.value;
this.form.organizationName = this.deptNameList[e.detail.value].deptName;
},
call(tel) { call(tel) {
uni.makePhoneCall({ uni.makePhoneCall({
phoneNumber: tel phoneNumber: tel
}); });
}, },
// //
addRow() {}, addRow() {
let obj = {
route: "",
routeIndex: "",
voyage: "",
voyageIndex: "",
direction: "",
passengerCount: "",
passengerDod: "",//
passengerYoy: "",//
};
if(this.tabType == 1) {
//
this.form.passengerShipDTOList.push(obj);
}else{
//
this.form.internationalCruiseDTOList.push(obj);
}
},
// //
deleteRow(index) {}, deleteRow(index) {
if(this.tabType == 1) {
//
this.form.passengerShipDTOList.splice(index, 1);
}else{
//
this.form.internationalCruiseDTOList.splice(index, 1);
}
},
// //
formatDigit(data) { formatDigit(data) {
return !checkNotEmpty(data) ? '--' : (data+'').indexOf('.') > -1 && (data+'').substring((data+'').indexOf('.')).length > 2 ? data.toFixed(2) : data; return !checkNotEmpty(data) ? '--' : (data+'').indexOf('.') > -1 && (data+'').substring((data+'').indexOf('.')).length > 2 ? data.toFixed(2) : data;
@ -281,87 +327,6 @@
this.form.inPepoleMomDo = this.$calcYoy(this.form.inPepole,this.yoyMom.lastYearData.inPepole); 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.outRailwayMomDo = this.$calcYoy(this.form.outboundRailwayDo,this.yoyMom.lastYearData.outboundRailwayDo);
this.form.outPepoleMomDo = this.$calcYoy(this.form.outPepole,this.yoyMom.lastYearData.outPepole); this.form.outPepoleMomDo = this.$calcYoy(this.form.outPepole,this.yoyMom.lastYearData.outPepole);
return;
if (this.yoyMom.yesterdayData) {
//
if (checkNotEmpty(this.form.inboundRailwayDo)) {
this.form.inRailwayYomDo = !checkNotEmpty(this.yoyMom.yesterdayData.inboundRailwayDo) || this
.yoyMom.yesterdayData.inboundRailwayDo === 0 ? 100 : (
parseInt(this.form.inboundRailwayDo) - this.yoyMom.yesterdayData.inboundRailwayDo) / this
.yoyMom.yesterdayData.inboundRailwayDo * 100;
}else{
this.form.inRailwayYomDo = '';
}
if (this.form.inPepole) {
this.form.inPepoleYoyDo = !checkNotEmpty(this.yoyMom.yesterdayData.inPepole) || this.yoyMom
.yesterdayData.inPepole === 0 ? 100 : (parseInt(this
.form.inPepole) - this.yoyMom.yesterdayData.inPepole) / this.yoyMom.yesterdayData
.inPepole *
100;
}else{
this.form.inPepoleYoyDo = '';
}
if (checkNotEmpty(this.form.outboundRailwayDo)) {
this.form.outRailwayYomDo = !checkNotEmpty(this.yoyMom.yesterdayData.outboundRailwayDo) || this
.yoyMom.yesterdayData.outboundRailwayDo === 0 ? 100 : (parseInt(this.form.outboundRailwayDo) -
this.yoyMom.yesterdayData
.outboundRailwayDo) / this.yoyMom.yesterdayData.outboundRailwayDo * 100;
}else{
this.form.outRailwayYomDo = '';
}
if (checkNotEmpty(this.form.outPepole)) {
this.form.outPepoleYoyDo = !checkNotEmpty(this.yoyMom.yesterdayData.outPepole) || this.yoyMom
.yesterdayData.outPepole === 0 ? 100 : (parseInt(this
.form.outPepole) - this.yoyMom.yesterdayData.outPepole) / this.yoyMom.yesterdayData
.outPepole *
100;
}else{
this.form.outPepoleYoyDo = '';
}
}
if (this.yoyMom.lastYearData) {
//
if (checkNotEmpty(this.form.inboundRailwayDo)) {
this.form.inRailwayMomDo = !checkNotEmpty(this.yoyMom.lastYearData.inboundRailwayDo) || this.yoyMom
.lastYearData.inboundRailwayDo === 0 ? 100 : (
parseInt(this.form.inboundRailwayDo) - this.yoyMom.lastYearData.inboundRailwayDo) / this
.yoyMom
.lastYearData.inboundRailwayDo * 100;
}else{
this.form.inRailwayMomDo = '';
}
if (checkNotEmpty(this.form.inPepole)) {
this.form.inPepoleMomDo = !checkNotEmpty(this.yoyMom.lastYearData.inPepole) || this.yoyMom
.lastYearData
.inPepole === 0 ? 100 : (parseInt(this.form
.inPepole) - this.yoyMom.lastYearData.inPepole) / this.yoyMom.lastYearData.inPepole * 100;
}else{
this.form.inPepoleMomDo = '';
}
if (checkNotEmpty(this.form.outboundRailwayDo)) {
this.form.outRailwayMomDo = !checkNotEmpty(this.yoyMom.lastYearData.outboundRailwayDo) || this
.yoyMom
.lastYearData.outboundRailwayDo === 0 ? 100 :
(parseInt(this.form.outboundRailwayDo) - this.yoyMom.lastYearData.outboundRailwayDo) / this
.yoyMom
.lastYearData.outboundRailwayDo * 100;
}else{
this.form.outRailwayMomDo = '';
}
if (checkNotEmpty(this.form.outPepole)) {
this.form.outPepoleMomDo = !checkNotEmpty(this.yoyMom.lastYearData.outPepole) || this.yoyMom
.lastYearData.outPepole === 0 ? 100 : (parseInt(this
.form.outPepole) - this.yoyMom.lastYearData.outPepole) / this.yoyMom.lastYearData
.outPepole *
100;
}else{
this.form.outPepoleMomDo = '';
}
}
}, },
// //
queryStation() { queryStation() {
@ -374,10 +339,29 @@
} }
}) })
}, },
// //线
changeRailway(e) { changeRoute(e, index) {
this.railwayNameIndex = e.detail.value; if(this.tabType == 1) {
this.form.railwayName = this.stationList[e.detail.value]; //
this.form.passengerShipDTOList[index].routeIndex = e.detail.value;
this.form.passengerShipDTOList[index].route = this.shipRouteList[e.detail.value].name;
}else{
//
this.form.internationalCruiseDTOList[index].routeIndex = e.detail.value;
this.form.internationalCruiseDTOList[index].route = this.internationalRouteList[e.detail.value].name;
}
},
//
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;
}else{
//
this.form.internationalCruiseDTOList[index].voyageIndex = e.detail.value;
this.form.internationalCruiseDTOList[index].voyage = this.internationalVoyageList[e.detail.value].name;
}
}, },
// //
changeStatPeriod(e) { changeStatPeriod(e) {
@ -386,10 +370,6 @@
console.log('change 时段', this.form); console.log('change 时段', this.form);
this.queryYoyMom(); this.queryYoyMom();
}, },
//
doCancel() {
uni.navigateBack();
},
// //
bindDateChange(e) { bindDateChange(e) {
this.form.statDate = e.detail.value; this.form.statDate = e.detail.value;
@ -425,13 +405,6 @@
}, },
// //
doSubmit() { doSubmit() {
if (!checkNotEmpty(this.form.railwayName)) {
uni.showToast({
title: '车站名称不能为空',
icon: 'none'
})
return;
}
if (!checkNotEmpty(this.form.statDate) || !checkNotEmpty(this.form.statPeriod)) { if (!checkNotEmpty(this.form.statDate) || !checkNotEmpty(this.form.statPeriod)) {
uni.showToast({ uni.showToast({
title: '报送日期和时段不能为空', title: '报送日期和时段不能为空',
@ -439,36 +412,32 @@
}) })
return; return;
} }
if (!checkNotEmpty(this.form.inboundRailwayDo) || !checkNotEmpty(this.form.inboundPassengersDo) || ! let checkList = true;
checkNotEmpty(this.form.inPepole)) { if (this.form.passengerShipDTOList.length > 0) {
checkList = this.form.passengerShipDTOList.every(item => {
return checkNotEmpty(item.route) && checkNotEmpty(item.voyage) && checkNotEmpty(item.passengerCount)
})
}
if (!checkList) {
uni.showToast({ uni.showToast({
title: '入青终到车次、过站车次、人数不能为空', title: '客班轮信息请填写完整',
icon: 'none' icon: 'none'
}) })
return; return;
} }
if (!checkNotEmpty(this.form.outboundRailwayDo) || !checkNotEmpty(this.form.outboundPassengersDo) || ! let checkList2 = true;
checkNotEmpty(this.form.outPepole)) { if (this.form.internationalCruiseDTOList.length > 0) {
checkList2 = this.form.internationalCruiseDTOList.every(item => {
return checkNotEmpty(item.route) && checkNotEmpty(item.voyage) && checkNotEmpty(item.passengerCount)
})
}
if (!checkList2) {
uni.showToast({ uni.showToast({
title: '出青终到车次、过站车次、人数不能为空', title: '国际邮轮信息请填写完整',
icon: 'none' icon: 'none'
}) })
return; return;
} }
// if (this.form.inPepole == this.yoyMom.yesterdayData.inPepole && this.form.inMark) {
// uni.showToast({
// title: '',
// icon: 'none'
// })
// return;
// }
// if (this.form.outPepole == this.yoyMom.yesterdayData.outPepole && this.form.outRemark) {
// uni.showToast({
// title: '',
// icon: 'none'
// })
// return;
// }
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: this.form.id == undefined ? '您确认提交该条报送数据?' : '您确认将该条数据进行修改?', content: this.form.id == undefined ? '您确认提交该条报送数据?' : '您确认将该条数据进行修改?',

Loading…
Cancel
Save