20230907会议变更内容

main
zhangqun 2 years ago
parent 0628017fc7
commit 5e62dcd3cf
  1. 13
      common/util.js
  2. 3
      main.js
  3. 162
      pages/airport/airport-runData/form.vue
  4. 15
      pages/airport/airport-runStatus/form.vue
  5. 216
      pages/highWay/runData/form.vue
  6. 42
      pages/highWay/runStatusData/form.vue
  7. 2
      pages/login/login.vue
  8. 46
      pages/railway/railwayRunData/form.vue
  9. 15
      pages/railway/runStatus/form.vue
  10. 28
      pages/water/transportation/form.vue
  11. 315
      pages/water/waterWay/form.vue

@ -100,6 +100,15 @@ function getDay(d, num) {
return `${year}-${month}-${day}`
}
// 计算环比
function calcMom(cur, data) {
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) {
return !checkNotEmpty(cur) || !checkNotEmpty(data) ? '' : data === 0 && parseInt(cur) === 0 ? 0 : data === 0 && parseInt(cur) > 0 ? 100 : (parseInt(cur) - data) / data * 100;
}
// 是否是闰年
function isLeap(year){
return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0
@ -125,5 +134,7 @@ export {
getDateStr,
dateUtils,
checkNotEmpty,
lastYearDate
lastYearDate,
calcMom,
calcYoy
}

@ -1,6 +1,7 @@
import App from './App'
import store from './store'
import { request, request1 } from "./util/request.js";
import { calcMom, calcYoy } from "./common/util.js";
// #ifndef VUE3
import Vue from 'vue'
@ -23,6 +24,8 @@ app.$mount()
//挂在request
Vue.prototype.$request = request;
Vue.prototype.$request1 = request1;
Vue.prototype.$calcMom = calcMom;
Vue.prototype.$calcYoy = calcYoy;
// #ifdef VUE3
import {

@ -45,16 +45,16 @@
<view class="form_item_rate">
<view class="rate_item">
<view class="rate_item_label">
入青航班架次环比(%)</view>
入青航班架次环比</view>
<view class="rate_item_input">
{{form.inFlightsMomDo === 0 ? form.inFlightsMomDo : form.inFlightsMomDo ? form.inFlightsMomDo.toFixed(2) : ''}}
{{form.inFlightsMomDo === 0 ? form.inFlightsMomDo : form.inFlightsMomDo ? formatDigit(form.inFlightsMomDo) : '--'}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">入青航班架次同比(%)</view>
<view class="rate_item_label">入青航班架次同比</view>
<view class="rate_item_input">
{{form.inFlightsYoyDo === 0 ? form.inFlightsYoyDo : form.inFlightsYoyDo ? form.inFlightsYoyDo.toFixed(2) : ''}}
{{form.inFlightsYoyDo === 0 ? form.inFlightsYoyDo : form.inFlightsYoyDo ? formatDigit(form.inFlightsYoyDo) : '--'}}%
</view>
</view>
</view>
@ -70,16 +70,16 @@
<view class="form_item_rate">
<view class="rate_item">
<view class="rate_item_label">
出青航班架次环比(%)</view>
出青航班架次环比</view>
<view class="rate_item_input">
{{form.outFlightsMomDo === 0 ? form.outFlightsMomDo : form.outFlightsMomDo ? form.outFlightsMomDo.toFixed(2) : ''}}
{{form.outFlightsMomDo === 0 ? form.outFlightsMomDo : form.outFlightsMomDo ? formatDigit(form.outFlightsMomDo) : '--'}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">出青航班架次同比(%)</view>
<view class="rate_item_label">出青航班架次同比</view>
<view class="rate_item_input">
{{form.outFlightsYoyDo === 0 ? form.outFlightsYoyDo : form.outFlightsYoyDo ? form.outFlightsYoyDo.toFixed(2) : ''}}
{{form.outFlightsYoyDo === 0 ? form.outFlightsYoyDo : form.outFlightsYoyDo ? formatDigit(form.outFlightsYoyDo) : '--'}}%
</view>
</view>
</view>
@ -95,16 +95,16 @@
<view class="form_item_rate">
<view class="rate_item">
<view class="rate_item_label">
入青航班旅客环比(%)</view>
入青航班旅客环比</view>
<view class="rate_item_input">
{{form.inPassengersMomDo === 0 ? form.inPassengersMomDo : form.inPassengersMomDo ? form.inPassengersMomDo.toFixed(2) : ''}}
{{form.inPassengersMomDo === 0 ? form.inPassengersMomDo : form.inPassengersMomDo ? formatDigit(form.inPassengersMomDo) : '--'}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">入青航班旅客同比(%)</view>
<view class="rate_item_label">入青航班旅客同比</view>
<view class="rate_item_input">
{{form.inPassengersYoyDo === 0 ? form.inPassengersYoyDo : form.inPassengersYoyDo ? form.inPassengersYoyDo.toFixed(2) : ''}}
{{form.inPassengersYoyDo === 0 ? form.inPassengersYoyDo : form.inPassengersYoyDo ? formatDigit(form.inPassengersYoyDo) : '--'}}%
</view>
</view>
</view>
@ -120,16 +120,16 @@
<view class="form_item_rate">
<view class="rate_item">
<view class="rate_item_label">
出青航班旅客环比(%)</view>
出青航班旅客环比</view>
<view class="rate_item_input">
{{form.outPassengersMomDo === 0 ? form.outPassengersMomDo : form.outPassengersMomDo ? form.outPassengersMomDo.toFixed(2) : ''}}
{{form.outPassengersMomDo === 0 ? form.outPassengersMomDo : form.outPassengersMomDo ? formatDigit(form.outPassengersMomDo) : '--'}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">出青航班旅客同比(%)</view>
<view class="rate_item_label">出青航班旅客同比</view>
<view class="rate_item_input">
{{form.outPassengersYoyDo === 0 ? form.outPassengersYoyDo : form.outPassengersYoyDo ? form.outPassengersYoyDo.toFixed(2) : ''}}
{{form.outPassengersYoyDo === 0 ? form.outPassengersYoyDo : form.outPassengersYoyDo ? formatDigit(form.outPassengersYoyDo) : '--'}}%
</view>
</view>
</view>
@ -154,16 +154,16 @@
<view class="form_item_rate">
<view class="rate_item">
<view class="rate_item_label">
入青航班架次环比(%)</view>
入青航班架次环比</view>
<view class="rate_item_input">
{{form.inFlightsMomIn === 0 ? form.inFlightsMomIn : form.inFlightsMomIn ? form.inFlightsMomIn.toFixed(2) : ''}}
{{form.inFlightsMomIn === 0 ? form.inFlightsMomIn : form.inFlightsMomIn ? formatDigit(form.inFlightsMomIn) : '--'}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">入青航班架次同比(%)</view>
<view class="rate_item_label">入青航班架次同比</view>
<view class="rate_item_input">
{{form.inFlightsYoyIn === 0 ? form.inFlightsYoyIn : form.inFlightsYoyIn ? form.inFlightsYoyIn.toFixed(2) : ''}}
{{form.inFlightsYoyIn === 0 ? form.inFlightsYoyIn : form.inFlightsYoyIn ? formatDigit(form.inFlightsYoyIn) : '--'}}%
</view>
</view>
</view>
@ -179,16 +179,16 @@
<view class="form_item_rate">
<view class="rate_item">
<view class="rate_item_label">
出青航班架次环比(%)</view>
出青航班架次环比</view>
<view class="rate_item_input">
{{form.outFlightsMomIn === 0 ? form.outFlightsMomIn : form.outFlightsMomIn ? form.outFlightsMomIn.toFixed(2) : ''}}
{{form.outFlightsMomIn === 0 ? form.outFlightsMomIn : form.outFlightsMomIn ? formatDigit(form.outFlightsMomIn) : '--'}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">出青航班架次同比(%)</view>
<view class="rate_item_label">出青航班架次同比</view>
<view class="rate_item_input">
{{form.outFlightsYoyIn === 0 ? form.outFlightsYoyIn : form.outFlightsYoyIn ? form.outFlightsYoyIn.toFixed(2) : ''}}
{{form.outFlightsYoyIn === 0 ? form.outFlightsYoyIn : form.outFlightsYoyIn ? formatDigit(form.outFlightsYoyIn) : '--'}}%
</view>
</view>
</view>
@ -204,16 +204,16 @@
<view class="form_item_rate">
<view class="rate_item">
<view class="rate_item_label">
入青航班旅客环比(%)</view>
入青航班旅客环比</view>
<view class="rate_item_input">
{{form.inPassengersMomIn === 0 ? form.inPassengersMomIn : form.inPassengersMomIn ? form.inPassengersMomIn.toFixed(2) : ''}}
{{form.inPassengersMomIn === 0 ? form.inPassengersMomIn : form.inPassengersMomIn ? formatDigit(form.inPassengersMomIn) : '--'}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">入青航班旅客同比(%)</view>
<view class="rate_item_label">入青航班旅客同比</view>
<view class="rate_item_input">
{{form.inPassengersYoyIn === 0 ? form.inPassengersYoyIn : form.inPassengersYoyIn ? form.inPassengersYoyIn.toFixed(2) : ''}}
{{form.inPassengersYoyIn === 0 ? form.inPassengersYoyIn : form.inPassengersYoyIn ? formatDigit(form.inPassengersYoyIn) : '--'}}%
</view>
</view>
</view>
@ -229,16 +229,16 @@
<view class="form_item_rate">
<view class="rate_item">
<view class="rate_item_label">
出青航班旅客环比(%)</view>
出青航班旅客环比</view>
<view class="rate_item_input">
{{form.outPassengersMomIn === 0 ? form.outPassengersMomIn : form.outPassengersMomIn ? form.outPassengersMomIn.toFixed(2) : ''}}
{{form.outPassengersMomIn === 0 ? form.outPassengersMomIn : form.outPassengersMomIn ? formatDigit(form.outPassengersMomIn) : '--'}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">出青航班旅客同比(%)</view>
<view class="rate_item_label">出青航班旅客同比</view>
<view class="rate_item_input">
{{form.outPassengersYoyIn === 0 ? form.outPassengersYoyIn : form.outPassengersYoyIn ? form.outPassengersYoyIn.toFixed(2) : ''}}
{{form.outPassengersYoyIn === 0 ? form.outPassengersYoyIn : form.outPassengersYoyIn ? formatDigit(form.outPassengersYoyIn) : '--'}}%
</view>
</view>
</view>
@ -248,7 +248,7 @@
<view class="form_item_box" style="margin-top: 30rpx;">
<view class="form_item_li">
<view class="form_item" style="font-size: 30rpx;color:#333;font-weight: bold;">
合计
合计
</view>
<view class="form_item">
<view class="form_item_label">入青航班架次</view>
@ -260,16 +260,16 @@
<view class="form_item_rate">
<view class="rate_item">
<view class="rate_item_label">
入青航班架次环比(%)</view>
入青航班架次环比</view>
<view class="rate_item_input">
{{form.inFlightsMomTo === 0 ? form.inFlightsMomTo : form.inFlightsMomTo ? form.inFlightsMomTo.toFixed(2) : ''}}
{{form.inFlightsMomTo === 0 ? form.inFlightsMomTo : form.inFlightsMomTo ? formatDigit(form.inFlightsMomTo) : '--'}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">入青航班架次同比(%)</view>
<view class="rate_item_label">入青航班架次同比</view>
<view class="rate_item_input">
{{form.inFlightsYoyTo === 0 ? form.inFlightsYoyTo : form.inFlightsYoyTo ? form.inFlightsYoyTo.toFixed(2) : ''}}
{{form.inFlightsYoyTo === 0 ? form.inFlightsYoyTo : form.inFlightsYoyTo ? formatDigit(form.inFlightsYoyTo) : '--'}}%
</view>
</view>
</view>
@ -283,16 +283,16 @@
<view class="form_item_rate">
<view class="rate_item">
<view class="rate_item_label">
出青航班架次环比(%)</view>
出青航班架次环比</view>
<view class="rate_item_input">
{{form.outFlightsMomTo === 0 ? form.outFlightsMomTo : form.outFlightsMomTo ? form.outFlightsMomTo.toFixed(2) : ''}}
{{form.outFlightsMomTo === 0 ? form.outFlightsMomTo : form.outFlightsMomTo ? formatDigit(form.outFlightsMomTo) : '--'}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">出青航班架次同比(%)</view>
<view class="rate_item_label">出青航班架次同比</view>
<view class="rate_item_input">
{{form.outFlightsYoyTo === 0 ? form.outFlightsYoyTo : form.outFlightsYoyTo ? form.outFlightsYoyTo.toFixed(2) : ''}}
{{form.outFlightsYoyTo === 0 ? form.outFlightsYoyTo : form.outFlightsYoyTo ? formatDigit(form.outFlightsYoyTo) : '--'}}%
</view>
</view>
</view>
@ -306,16 +306,16 @@
<view class="form_item_rate">
<view class="rate_item">
<view class="rate_item_label">
入青航班旅客环比(%)</view>
入青航班旅客环比</view>
<view class="rate_item_input">
{{form.inPassengersMomTo === 0 ? form.inPassengersMomTo : form.inPassengersMomTo ? form.inPassengersMomTo.toFixed(2) : ''}}
{{form.inPassengersMomTo === 0 ? form.inPassengersMomTo : form.inPassengersMomTo ? formatDigit(form.inPassengersMomTo) : '--'}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">入青航班旅客同比(%)</view>
<view class="rate_item_label">入青航班旅客同比</view>
<view class="rate_item_input">
{{form.inPassengersYoyTo === 0 ? form.inPassengersYoyTo : form.inPassengersYoyTo ? form.inPassengersYoyTo.toFixed(2) : ''}}
{{form.inPassengersYoyTo === 0 ? form.inPassengersYoyTo : form.inPassengersYoyTo ? formatDigit(form.inPassengersYoyTo) : '--'}}%
</view>
</view>
</view>
@ -329,16 +329,16 @@
<view class="form_item_rate">
<view class="rate_item">
<view class="rate_item_label">
出青航班旅客环比(%)</view>
出青航班旅客环比</view>
<view class="rate_item_input">
{{form.outPassengersMomTo === 0 ? form.outPassengersMomTo : form.outPassengersMomTo ? form.outPassengersMomTo.toFixed(2) : ''}}
{{form.outPassengersMomTo === 0 ? form.outPassengersMomTo : form.outPassengersMomTo ? formatDigit(form.outPassengersMomTo) : '--'}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">出青航班旅客同比(%)</view>
<view class="rate_item_label">出青航班旅客同比</view>
<view class="rate_item_input">
{{form.outPassengersYoyTo === 0 ? form.outPassengersYoyTo : form.outPassengersYoyTo ? form.outPassengersYoyTo.toFixed(2) : ''}}
{{form.outPassengersYoyTo === 0 ? form.outPassengersYoyTo : form.outPassengersYoyTo ? formatDigit(form.outPassengersYoyTo) : '--'}}%
</view>
</view>
</view>
@ -346,8 +346,8 @@
</view>
<!-- 底部按钮 -->
<view class="foot_btn">
<view class="act_btn" @click="doCancel">取消</view>
<view class="act_btn blue" @click="doSubmit">确认</view>
<!-- <view class="act_btn" @click="doCancel">取消</view> -->
<view class="act_btn blue" @click="doSubmit">{{btnText}}</view>
</view>
</view>
</template>
@ -403,7 +403,8 @@
index: 2, //,0-24
userInfo: {},
pageType: '',
yoyMom: {}
yoyMom: {},
btnText: '保存'
}
},
onLoad(options) {
@ -414,10 +415,12 @@
this.form.affiliatedUnit = this.userInfo.organizationName ? this.userInfo.organizationName : '';
this.form.statDate = getDateStr(now, -1); //
this.queryTime(); //
} else if(options.item) {
} else if(options.item) {
this.btnText = '修改并保存';
this.form = JSON.parse(options.item);
this.queryTime();
} else if (options.id) {
this.btnText = '修改并保存';
this.$request(getApp().globalData.baseUrl + '/api/biz/watertransportRunData/find/' + options.id, {}, "GET")
.then(
res => {
@ -427,6 +430,9 @@
}
},
methods: {
formatDigit(data) {
return (data+'').indexOf('.') > -1 && (data+'').substring((data+'').indexOf('.')).length > 2 ? data.toFixed(2) : data;
},
//
queryYoyMom() {
if (this.form.statDate == '' || this.form.statPeriod == '') {
@ -446,39 +452,39 @@
let yesterdayData = this.yoyMom.yesterdayData;
let lastYearData = this.yoyMom.lastYearData;
//-
this.form.inFlightsMomDo = !checkNotEmpty(this.form.inboundFlightsDo) ? '' : yesterdayData.inboundFlightsDo === 0 ? 100 : checkNotEmpty(yesterdayData.inboundFlightsDo) ? (parseInt(this.form.inboundFlightsDo) - yesterdayData.inboundFlightsDo) / yesterdayData.inboundFlightsDo * 100 : '';
this.form.inFlightsYoyDo = !checkNotEmpty(this.form.inboundFlightsDo) ? '' : lastYearData.inboundFlightsDo === 0 ? 100 : checkNotEmpty(lastYearData.inboundFlightsDo) ? (parseInt(this.form.inboundFlightsDo) - lastYearData.inboundFlightsDo) / lastYearData.inboundFlightsDo * 100 : '';
this.form.inPassengersMomDo = !checkNotEmpty(this.form.inboundPassengersDo) ? '' : yesterdayData.inboundPassengersDo === 0 ? 100 : checkNotEmpty(yesterdayData.inboundPassengersDo) ? (parseInt(this.form.inboundPassengersDo) - yesterdayData.inboundFlightsDo) / yesterdayData.inboundPassengersDo * 100 : '';
this.form.inPassengersYoyDo = !checkNotEmpty(this.form.inboundPassengersDo) ? '' : lastYearData.inboundPassengersDo === 0 ? 100 : checkNotEmpty(lastYearData.inboundPassengersDo) ? (parseInt(this.form.inboundPassengersDo) - lastYearData.inboundFlightsDo) / lastYearData.inboundPassengersDo * 100 : '';
this.form.inFlightsMomDo = this.$calcMom(this.form.inboundFlightsDo,yesterdayData.inboundFlightsDo);
this.form.inFlightsYoyDo = this.$calcYoy(this.form.inboundFlightsDo,lastYearData.inboundFlightsDo);
this.form.inPassengersMomDo = this.$calcMom(this.form.inboundPassengersDo,yesterdayData.inboundPassengersDo);
this.form.inPassengersYoyDo =this.$calcYoy(this.form.inboundPassengersDo,lastYearData.inboundPassengersDo);
//-
this.form.outFlightsMomDo = !checkNotEmpty(this.form.outboundFlightsDo) ? '' : yesterdayData.outboundFlightsDo === 0 ? 100 : checkNotEmpty(yesterdayData.outboundFlightsDo) ? (parseInt(this.form.outboundFlightsDo) - yesterdayData.outboundFlightsDo) / yesterdayData.outboundFlightsDo * 100 : '';
this.form.outFlightsYoyDo = !checkNotEmpty(this.form.outboundFlightsDo) ? '' : lastYearData.outboundFlightsDo === 0 ? 100 : checkNotEmpty(lastYearData.outboundFlightsDo) ? (parseInt(this.form.outboundFlightsDo) - lastYearData.outboundFlightsDo) / lastYearData.outboundFlightsDo * 100 : '';
this.form.outPassengersMomDo = !checkNotEmpty(this.form.outboundPassengersDo) ? '' : yesterdayData.outboundPassengersDo === 0 ? 100 : checkNotEmpty(yesterdayData.outboundPassengersDo) ? (parseInt(this.form.outboundPassengersDo) - yesterdayData.outboundPassengersDo) / yesterdayData.outboundPassengersDo * 100 : '';
this.form.outPassengersYoyDo = !checkNotEmpty(this.form.outboundPassengersDo) ? '' : lastYearData.outboundPassengersDo === 0 ? 100 : checkNotEmpty(lastYearData.outboundPassengersDo) ? (parseInt(this.form.outboundPassengersDo) - lastYearData.outboundPassengersDo) / lastYearData.outboundPassengersDo * 100 : '';
this.form.outFlightsMomDo = this.$calcMom(this.form.outboundFlightsDo,yesterdayData.outboundFlightsDo);
this.form.outFlightsYoyDo =this.$calcYoy(this.form.outboundFlightsDo,lastYearData.outboundFlightsDo);
this.form.outPassengersMomDo = this.$calcMom(this.form.outboundPassengersDo,yesterdayData.outboundPassengersDo);
this.form.outPassengersYoyDo =this.$calcYoy(this.form.outboundPassengersDo,lastYearData.outboundPassengersDo);
//-
this.form.inFlightsMomIn = !checkNotEmpty(this.form.inboundFlightsIn) ? '' : yesterdayData.inboundFlightsIn === 0 ? 100 : checkNotEmpty(yesterdayData.inboundFlightsIn) ? (parseInt(this.form.inboundFlightsIn) - yesterdayData.inboundFlightsIn) / yesterdayData.inboundFlightsIn * 100 : '';
this.form.inFlightsYoyIn = !checkNotEmpty(this.form.inboundFlightsIn) ? '' : lastYearData.inboundFlightsIn === 0 ? 100 : checkNotEmpty(lastYearData.inboundFlightsIn) ? (parseInt(this.form.inboundFlightsIn) - lastYearData.inboundFlightsIn) / lastYearData.inboundFlightsIn * 100 : '';
this.form.inPassengersMomIn = !checkNotEmpty(this.form.inboundPassengersIn) ? '' : yesterdayData.inboundPassengersIn === 0 ? 100 : checkNotEmpty(yesterdayData.inboundPassengersIn) ? (parseInt(this.form.inboundPassengersIn) - yesterdayData.inboundPassengersIn) / yesterdayData.inboundPassengersIn * 100 : '';
this.form.inPassengersYoyIn = !checkNotEmpty(this.form.inboundPassengersIn) ? '' : lastYearData.inboundPassengersIn === 0 ? 100 : checkNotEmpty(lastYearData.inboundPassengersIn) ? (parseInt(this.form.inboundPassengersIn) - lastYearData.inboundPassengersIn) / lastYearData.inboundPassengersIn * 100 : '';
this.form.inFlightsMomIn = this.$calcMom(this.form.inboundFlightsIn,yesterdayData.inboundFlightsIn);
this.form.inFlightsYoyIn =this.$calcYoy(this.form.inboundFlightsIn,lastYearData.inboundFlightsIn);
this.form.inPassengersMomIn = this.$calcMom(this.form.inboundPassengersIn,yesterdayData.inboundPassengersIn);
this.form.inPassengersYoyIn =this.$calcYoy(this.form.inboundPassengersIn,lastYearData.inboundPassengersIn);
//-
this.form.outFlightsMomIn = !checkNotEmpty(this.form.outboundFlightsIn) ? '' : yesterdayData.outboundFlightsIn === 0 ? 100 : checkNotEmpty(yesterdayData.outboundFlightsIn) ? (parseInt(this.form.outboundFlightsIn) - yesterdayData.outboundFlightsIn) / yesterdayData.outboundFlightsIn * 100 : '';
this.form.outFlightsYoyIn = !checkNotEmpty(this.form.outboundFlightsIn) ? '' : lastYearData.outboundFlightsIn === 0 ? 100 : checkNotEmpty(lastYearData.outboundFlightsIn) ? (parseInt(this.form.outboundFlightsIn) - lastYearData.outboundFlightsIn) / lastYearData.outboundFlightsIn * 100 : '';
this.form.outPassengersMomIn = !checkNotEmpty(this.form.outboundPassengersIn) ? '' : yesterdayData.outboundPassengersIn === 0 ? 100 : checkNotEmpty(yesterdayData.outboundPassengersIn) ? (parseInt(this.form.outboundPassengersIn) - yesterdayData.outboundPassengersIn) / yesterdayData.outboundPassengersIn * 100 : '';
this.form.outPassengersYoyIn = !checkNotEmpty(this.form.outboundPassengersIn) ? '' : lastYearData.outboundPassengersIn === 0 ? 100 : checkNotEmpty(lastYearData.outboundPassengersIn) ? (parseInt(this.form.outboundPassengersIn) - lastYearData.outboundPassengersIn) / lastYearData.outboundPassengersIn * 100 : '';
this.form.outFlightsMomIn = this.$calcMom(this.form.outboundFlightsIn,yesterdayData.outboundFlightsIn);
this.form.outFlightsYoyIn =this.$calcYoy(this.form.outboundFlightsIn,lastYearData.outboundFlightsIn);
this.form.outPassengersMomIn = this.$calcMom(this.form.outboundPassengersIn,yesterdayData.outboundPassengersIn);
this.form.outPassengersYoyIn =this.$calcYoy(this.form.outboundPassengersIn,lastYearData.outboundPassengersIn);
//-
this.form.inboundFlightsTo = (checkNotEmpty(this.form.inboundFlightsDo) ? parseInt(this.form.inboundFlightsDo) : 0) + (checkNotEmpty(this.form.inboundFlightsIn) ? parseInt(this.form.inboundFlightsIn) : 0);//-
this.form.inboundPassengersTo = (checkNotEmpty(this.form.inboundPassengersDo) ? parseInt(this.form.inboundPassengersDo) : 0) + (checkNotEmpty(this.form.inboundPassengersIn) ? parseInt(this.form.inboundPassengersIn) : 0);//-
this.form.inFlightsMomTo = !checkNotEmpty(this.form.inboundFlightsTo) ? '' : yesterdayData.inboundFlightsTo === 0 ? 100 : checkNotEmpty(yesterdayData.inboundFlightsTo) ? (parseInt(this.form.inboundFlightsTo) - yesterdayData.inboundFlightsTo) / yesterdayData.inboundFlightsTo * 100 : '';
this.form.inFlightsYoyTo = !checkNotEmpty(this.form.inboundFlightsTo) ? '' : lastYearData.inboundFlightsTo === 0 ? 100 : checkNotEmpty(lastYearData.inboundFlightsTo) ? (parseInt(this.form.inboundFlightsTo) - lastYearData.inboundFlightsTo) / lastYearData.inboundFlightsTo * 100 : '';
this.form.inPassengersMomTo = !checkNotEmpty(this.form.inboundPassengersTo) ? '' : yesterdayData.inboundPassengersTo === 0 ? 100 : checkNotEmpty(yesterdayData.inboundPassengersTo) ? (parseInt(this.form.inboundPassengersTo) - yesterdayData.inboundPassengersTo) / yesterdayData.inboundPassengersTo * 100 : '';
this.form.inPassengersYoyTo = !checkNotEmpty(this.form.inboundPassengersTo) ? '' : lastYearData.inboundPassengersTo === 0 ? 100 : checkNotEmpty(lastYearData.inboundPassengersTo) ? (parseInt(this.form.inboundPassengersTo) - lastYearData.inboundPassengersTo) / lastYearData.inboundPassengersTo * 100 : '';
this.form.inFlightsMomTo = this.$calcMom(this.form.inboundFlightsTo,yesterdayData.inboundFlightsTo);
this.form.inFlightsYoyTo =this.$calcYoy(this.form.inboundFlightsTo,lastYearData.inboundFlightsTo);
this.form.inPassengersMomTo = this.$calcMom(this.form.inboundPassengersTo,yesterdayData.inboundPassengersTo);
this.form.inPassengersYoyTo =this.$calcYoy(this.form.inboundPassengersTo,lastYearData.inboundPassengersTo);
//-
this.form.outboundFlightsTo = (checkNotEmpty(this.form.outboundFlightsDo) ? parseInt(this.form.outboundFlightsDo) : 0) + (checkNotEmpty(this.form.outboundFlightsIn) ? parseInt(this.form.outboundFlightsIn) : 0);//-
this.form.outboundPassengersTo = (checkNotEmpty(this.form.outboundPassengersDo) ? parseInt(this.form.outboundPassengersDo) : 0) + (checkNotEmpty(this.form.outboundPassengersIn) ? parseInt(this.form.outboundPassengersIn) : 0);//-
this.form.outFlightsMomTo = !checkNotEmpty(this.form.outboundFlightsTo) ? '' : yesterdayData.outboundFlightsTo === 0 ? 100 : checkNotEmpty(yesterdayData.outboundFlightsTo) ? (parseInt(this.form.outboundFlightsTo) - yesterdayData.outboundFlightsTo) / yesterdayData.outboundFlightsTo * 100 : '';
this.form.outFlightsYoyTo = !checkNotEmpty(this.form.outboundFlightsTo) ? '' : lastYearData.outboundFlightsTo === 0 ? 100 : checkNotEmpty(lastYearData.outboundFlightsTo) ? (parseInt(this.form.outboundFlightsTo) - lastYearData.outboundFlightsTo) / lastYearData.outboundFlightsTo * 100 : '';
this.form.outPassengersMomTo = !checkNotEmpty(this.form.outboundPassengersTo) ? '' : yesterdayData.outboundPassengersTo === 0 ? 100 : checkNotEmpty(yesterdayData.outboundPassengersTo) ? (parseInt(this.form.outboundPassengersTo) - yesterdayData.outboundPassengersTo) / yesterdayData.outboundPassengersTo * 100 : '';
this.form.outPassengersYoyTo = !checkNotEmpty(this.form.outboundPassengersTo) ? '' : lastYearData.outboundPassengersTo === 0 ? 100 : checkNotEmpty(lastYearData.outboundPassengersTo) ? (parseInt(this.form.outboundPassengersTo) - lastYearData.outboundPassengersTo) / lastYearData.outboundPassengersTo * 100 : '';
this.form.outFlightsMomTo = this.$calcMom(this.form.outboundFlightsTo,yesterdayData.outboundFlightsTo);
this.form.outFlightsYoyTo =this.$calcYoy(this.form.outboundFlightsTo,lastYearData.outboundFlightsTo);
this.form.outPassengersMomTo = this.$calcMom(this.form.outboundPassengersTo,yesterdayData.outboundPassengersTo);
this.form.outPassengersYoyTo =this.$calcYoy(this.form.outboundPassengersTo,lastYearData.outboundPassengersTo);
},
//
changeStatPeriod(e) {
@ -808,7 +814,7 @@
z-index: 11;
.act_btn {
width: 329rpx;
width: 690rpx;
height: 90rpx;
color: #666666;
font-size: 28rpx;

@ -52,8 +52,8 @@
</view>
<!-- 底部按钮 -->
<view class="foot_btn">
<view class="act_btn" @click="doCancel">取消</view>
<view class="act_btn blue" @click="doSubmit">确认</view>
<!-- <view class="act_btn" @click="doCancel">取消</view> -->
<view class="act_btn blue" @click="doSubmit">{{btnText}}</view>
</view>
</view>
</template>
@ -76,7 +76,8 @@
array: [], //
index: 2, //,0-24
userInfo: {},
pageType: ''
pageType: '',
btnText: '保存'
}
},
onLoad(options) {
@ -86,10 +87,12 @@
let now = new Date();
this.form.statDate = getDateStr(now, -1); //
this.queryTime(); //
} if (options.item) {
} if (options.item) {
this.btnText = '修改并保存';
this.form = JSON.parse(options.item);
this.queryTime(); //
} if (options.id) {
} if (options.id) {
this.btnText = '修改并保存';
this.$request(getApp().globalData.baseUrl+'/api/biz/railwayRunSituation/find//'+options.id,{},"GET").then(res => {
this.form = res.data;
this.queryTime(); //
@ -423,7 +426,7 @@
z-index: 11;
.act_btn {
width: 329rpx;
width: 690rpx;
height: 90rpx;
color: #666666;
font-size: 28rpx;

@ -9,11 +9,12 @@
<view class="form_item">
<view class="form_item_label">管理单位名称</view>
<view class="form_item_input picker">
<picker v-if="pageType == 'add'" :value="form.organizationNameIndex" @change="bindDeptChange">
<picker v-if="pageType == 'add'" :value="form.organizationNameIndex" :range="deptNameList"
range-key="deptName" @change="bindDeptChange">
<text class="picker_select"
:style="form.organizationName?'color:#333;':''">{{form.organizationName?form.organizationName:'请选择'}}</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
</picker>
</picker>
<text v-else>{{form.organizationName}}</text>
</view>
</view>
@ -38,54 +39,54 @@
</view>
</view>
<view class="form_item">
<view class="form_item_label">收费站入口车辆数汇总</view>
<view class="form_item_label">收费站驶入车辆数统计</view>
<view class="form_item_input">
{{form.entranceVehicleCount === 0 ? form.entranceVehicleCount : form.entranceVehicleCount || ''}}
</view>
</view>
<!-- 同比环比 -->
<view class="form_item_rate"
:class="form.entranceVehicleCount && form.entranceVehicleCount == yoyMom.minusDaysEntranceVehicleSum ? 'danger' : ''">
:class="checkNotEmpty(form.entranceVehicleCount) && form.entranceVehicleCount === yoyMom.minusDaysEntranceVehicleSum ? 'danger' : ''">
<view class="rate_item">
<view class="rate_item_label"
:style="form.entranceVehicleCount && form.entranceVehicleCount == yoyMom.minusDaysEntranceVehicleSum ?'color: #EB4747':''">
收费站入口车辆数汇总环比(%)</view>
:style="checkNotEmpty(form.entranceVehicleCount) && form.entranceVehicleCount === yoyMom.minusDaysEntranceVehicleSum ?'color: #EB4747':''">
驶入车辆数统计环比</view>
<view class="rate_item_input"
:style="form.entranceVehicleCount && form.entranceVehicleCount == yoyMom.minusDaysEntranceVehicleSum ?'color: #EB4747':''">
{{form.entranceVehicleCountMom === 0 ? form.entranceVehicleCountMom : form.entranceVehicleCountMom ? form.entranceVehicleCountMom.toFixed(2) : ''}}
:style="checkNotEmpty(form.entranceVehicleCount) && form.entranceVehicleCount === yoyMom.minusDaysEntranceVehicleSum ?'color: #EB4747':''">
{{form.entranceVehicleCountMom === 0 ? form.entranceVehicleCountMom : checkNotEmpty(form.entranceVehicleCountMom) ? formatDigit(form.entranceVehicleCountMom) : '--'}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">收费站入口车辆数汇总同比(%)</view>
<view class="rate_item_label">驶入车辆数统计同比</view>
<view class="rate_item_input">
{{form.entranceVehicleCountYoy === 0 ? form.entranceVehicleCountYoy : form.entranceVehicleCountYoy ? form.entranceVehicleCountYoy.toFixed(2) : ''}}
{{form.entranceVehicleCountYoy === 0 ? form.entranceVehicleCountYoy : checkNotEmpty(form.entranceVehicleCountYoy) ? formatDigit(form.entranceVehicleCountYoy) : '--'}}%
</view>
</view>
</view>
<view class="form_item">
<view class="form_item_label">收费站出口车辆数汇总</view>
<view class="form_item_label">收费站驶出车辆数统计</view>
<view class="form_item_input">
{{form.exitVehicleCount === 0 ? form.exitVehicleCount : form.exitVehicleCount || ''}}
</view>
</view>
<!-- 同比环比 -->
<view class="form_item_rate"
:class="form.exitVehicleCount === yoyMom.minusDaysExitVehicleSum ? 'danger' : ''">
:class="checkNotEmpty(form.exitVehicleCount) && form.exitVehicleCount === yoyMom.minusDaysExitVehicleSum ? 'danger' : ''">
<view class="rate_item">
<view class="rate_item_label"
:style="form.exitVehicleCount == yoyMom.minusDaysExitVehicleSum ?'color: #EB4747':''">
收费站入口车辆数汇总环比(%)</view>
:style="checkNotEmpty(form.exitVehicleCount) && form.exitVehicleCount === yoyMom.minusDaysExitVehicleSum ?'color: #EB4747':''">
驶出车辆数统计环比</view>
<view class="rate_item_input"
:style="form.exitVehicleCount == yoyMom.minusDaysExitVehicleSum ?'color: #EB4747':''">
{{form.exitVehicleCountMom === 0 ? form.exitVehicleCountMom : form.exitVehicleCountMom ? form.exitVehicleCountMom.toFixed(2) : ''}}
:style="checkNotEmpty(form.exitVehicleCount) && form.exitVehicleCount === yoyMom.minusDaysExitVehicleSum ?'color: #EB4747':''">
{{form.exitVehicleCountMom === 0 ? form.exitVehicleCountMom : checkNotEmpty(form.exitVehicleCountMom) ? formatDigit(form.exitVehicleCountMom) : '--'}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">收费站出口车辆数汇总同比(%)</view>
<view class="rate_item_label">驶出车辆数统计同比</view>
<view class="rate_item_input">
{{form.exitVehicleCountYoy === 0 ? form.exitVehicleCountYoy : form.exitVehicleCountYoy ? form.exitVehicleCountYoy.toFixed(2) : ''}}
{{form.exitVehicleCountYoy === 0 ? form.exitVehicleCountYoy : checkNotEmpty(form.exitVehicleCountYoy) ? formatDigit(form.exitVehicleCountYoy) : '--'}}%
</view>
</view>
</view>
@ -126,7 +127,7 @@
<view class="form_item_input text">{{form.highwaySubDataList[stationIndex].highwayName}}</view>
</view>
<view class="form_item">
<view class="form_item_label">收费站入车辆数</view>
<view class="form_item_label">收费站入车辆数</view>
<view class="form_item_input form_input">
<uni-easyinput @blur="checkStationInfo(stationIndex)"
v-model="form.highwaySubDataList[stationIndex].entranceVehicleCount"
@ -136,26 +137,26 @@
</view>
<!-- 同比环比 -->
<view class="form_item_rate"
:class="form.highwaySubDataList[stationIndex].entranceVehicleCountMom === 0 ? 'danger' : '' ">
:class="form.highwaySubDataList.length == 0 ? '' : checkNotEmpty(form.highwaySubDataList[stationIndex].entranceVehicleCount) && (form.highwaySubDataList[stationIndex].entranceVehicleCountMom === 0 || (form.highwaySubDataList[stationIndex].entranceVehicleCount === form.highwaySubDataList[stationIndex].exitVehicleCount)) ? 'danger' : '' ">
<view class="rate_item">
<view class="rate_item_label"
:style="form.highwaySubDataList[stationIndex].entranceVehicleCountMom === 0 ? 'color: #EB4747' : ''">
收费站入口车辆数环比(%)</view>
:style="form.highwaySubDataList.length == 0 ? '' : checkNotEmpty(form.highwaySubDataList[stationIndex].entranceVehicleCount) && (form.highwaySubDataList[stationIndex].entranceVehicleCountMom === 0 || (form.highwaySubDataList[stationIndex].entranceVehicleCount === form.highwaySubDataList[stationIndex].exitVehicleCount)) ? 'color: #EB4747' : ''">
驶入车辆数环比</view>
<view class="rate_item_input"
:style="form.highwaySubDataList[stationIndex].entranceVehicleCountMom === 0 ? 'color: #EB4747' : ''">
{{form.highwaySubDataList.length == 0 ? '' : form.highwaySubDataList[stationIndex].entranceVehicleCountMom === 0 ? form.highwaySubDataList[stationIndex].entranceVehicleCountMom : form.highwaySubDataList[stationIndex].entranceVehicleCountMom ? form.highwaySubDataList[stationIndex].entranceVehicleCountMom.toFixed(2) : ''}}
:style="form.highwaySubDataList.length == 0 ? '' : checkNotEmpty(form.highwaySubDataList[stationIndex].entranceVehicleCount) && (form.highwaySubDataList[stationIndex].entranceVehicleCountMom === 0 || (form.highwaySubDataList[stationIndex].entranceVehicleCount === form.highwaySubDataList[stationIndex].exitVehicleCount)) ? 'color: #EB4747' : ''">
{{form.highwaySubDataList.length == 0 ? '--' : form.highwaySubDataList[stationIndex].entranceVehicleCountMom === 0 ? form.highwaySubDataList[stationIndex].entranceVehicleCountMom : form.highwaySubDataList[stationIndex].entranceVehicleCountMom ? formatDigit(form.highwaySubDataList[stationIndex].entranceVehicleCountMom) : '--'}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">收费站入口车辆数同比(%)</view>
<view class="rate_item_label">驶入车辆数同比</view>
<view class="rate_item_input">
{{form.highwaySubDataList.length == 0 ? '' : form.highwaySubDataList[stationIndex].entranceVehicleCountYoy === 0 ? form.highwaySubDataList[stationIndex].entranceVehicleCountYoy : form.highwaySubDataList[stationIndex].entranceVehicleCountYoy ? form.highwaySubDataList[stationIndex].entranceVehicleCountYoy.toFixed(2) : ''}}
{{form.highwaySubDataList.length == 0 ? '--' : form.highwaySubDataList[stationIndex].entranceVehicleCountYoy === 0 ? form.highwaySubDataList[stationIndex].entranceVehicleCountYoy : form.highwaySubDataList[stationIndex].entranceVehicleCountYoy ? formatDigit(form.highwaySubDataList[stationIndex].entranceVehicleCountYoy) : '--'}}%
</view>
</view>
</view>
<view class="form_item">
<view class="form_item_label">收费站出车辆数</view>
<view class="form_item_label">收费站出车辆数</view>
<view class="form_item_input form_input">
<uni-easyinput @blur="checkStationInfo(stationIndex)"
v-model="form.highwaySubDataList[stationIndex].exitVehicleCount"
@ -165,21 +166,21 @@
</view>
<!-- 同比环比 -->
<view class="form_item_rate"
:class="form.highwaySubDataList[stationIndex].exitVehicleCountMom === 0 ? 'danger' : '' ">
:class="form.highwaySubDataList.length == 0 ? '' : checkNotEmpty(form.highwaySubDataList[stationIndex].exitVehicleCount) && (form.highwaySubDataList[stationIndex].exitVehicleCountMom === 0 || (form.highwaySubDataList[stationIndex].entranceVehicleCount === form.highwaySubDataList[stationIndex].exitVehicleCount)) ? 'danger' : '' ">
<view class="rate_item">
<view class="rate_item_label"
:style="form.highwaySubDataList[stationIndex].exitVehicleCountMom === 0 ? 'color: #EB4747' : ''">
收费站出口车辆数环比(%)</view>
:style="form.highwaySubDataList.length == 0 ? '' : checkNotEmpty(form.highwaySubDataList[stationIndex].exitVehicleCount) && (form.highwaySubDataList[stationIndex].exitVehicleCountMom === 0 || (form.highwaySubDataList[stationIndex].entranceVehicleCount === form.highwaySubDataList[stationIndex].exitVehicleCount)) ? 'color: #EB4747' : ''">
驶出车辆数环比</view>
<view class="rate_item_input"
:style="form.highwaySubDataList[stationIndex].exitVehicleCountMom === 0 ? 'color: #EB4747' : ''">
{{form.highwaySubDataList.length == 0 ? '' : form.highwaySubDataList[stationIndex].exitVehicleCountMom === 0 ? form.highwaySubDataList[stationIndex].exitVehicleCountMom : form.highwaySubDataList[stationIndex].exitVehicleCountMom ? form.highwaySubDataList[stationIndex].exitVehicleCountMom.toFixed(2) : ''}}
:style="form.highwaySubDataList.length == 0 ? '' : checkNotEmpty(form.highwaySubDataList[stationIndex].exitVehicleCount) && (form.highwaySubDataList[stationIndex].exitVehicleCountMom === 0 || (form.highwaySubDataList[stationIndex].entranceVehicleCount === form.highwaySubDataList[stationIndex].exitVehicleCount)) ? 'color: #EB4747' : ''">
{{form.highwaySubDataList.length == 0 ? '--' : form.highwaySubDataList[stationIndex].exitVehicleCountMom === 0 ? formatDigit(form.highwaySubDataList[stationIndex].exitVehicleCountMom) : form.highwaySubDataList[stationIndex].exitVehicleCountMom ? formatDigit(form.highwaySubDataList[stationIndex].exitVehicleCountMom) : '--'}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">收费站出口车辆数同比(%)</view>
<view class="rate_item_label">驶出车辆数同比</view>
<view class="rate_item_input">
{{form.highwaySubDataList.length == 0 ? '' : form.highwaySubDataList[stationIndex].exitVehicleCountYoy === 0 ? form.highwaySubDataList[stationIndex].exitVehicleCountYoy : form.highwaySubDataList[stationIndex].exitVehicleCountYoy ? form.highwaySubDataList[stationIndex].exitVehicleCountYoy.toFixed(2) : ''}}
{{form.highwaySubDataList.length == 0 ? '--' : form.highwaySubDataList[stationIndex].exitVehicleCountYoy === 0 ? form.highwaySubDataList[stationIndex].exitVehicleCountYoy : form.highwaySubDataList[stationIndex].exitVehicleCountYoy ? formatDigit(form.highwaySubDataList[stationIndex].exitVehicleCountYoy) : '--'}}%
</view>
</view>
</view>
@ -214,15 +215,15 @@
<view class="form_item_label">备注</view>
<view class="form_item_input">
<uni-easyinput v-model="form.highwaySubDataList[stationIndex].mark"
placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入备注信息" type="textarea"
maxlength="200" autoHeight></uni-easyinput>
placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入备注信息" type="textarea" maxlength="200"
autoHeight></uni-easyinput>
</view>
</view>
</view>
<!-- 底部按钮 -->
<view class="foot_btn">
<view class="act_btn" @click="doCancel">取消</view>
<view class="act_btn blue" @click="doSubmit">确认</view>
<!-- <view class="act_btn" @click="doCancel">取消</view> -->
<view class="act_btn blue" @click="doSubmit">{{btnText}}</view>
</view>
</view>
</template>
@ -254,16 +255,17 @@
userInfo: {},
yoyMom: {}, //
showStaion: false, //
pageType: '',
deptNameList: [],//
pageType: '',
deptNameList: [], //
btnText: '保存'
}
},
onLoad(options) {
this.userInfo = uni.getStorageSync('userInfo');
let arr = uni.getStorageSync('deptName');
this.userInfo = uni.getStorageSync('userInfo');
let arr = uni.getStorageSync('deptName');
this.deptNameList = checkNotEmpty(arr) ? arr : [];
if (options.type == 'add') {
this.form.organizationName = this.deptNameList.length > 0 ? this.deptNameList[0] : '';
this.form.organizationName = this.deptNameList.length > 0 ? this.deptNameList[0].deptName : '';
this.form.organizationNameIndex = this.deptNameList.length > 0 ? 0 : '';
this.pageType = 'add';
let now = new Date();
@ -272,21 +274,29 @@
this.queryTime(); //
}
if (options.id) {
this.btnText = '修改并保存';
this.queryDetailInfo(options.id);
}
this.queryPerson();
},
methods: {
checkNotEmpty(data) {
return checkNotEmpty(data);
},
//
formatDigit(data) {
return (data+'').indexOf('.') > -1 && (data+'').substring((data+'').indexOf('.')).length > 2 ? data.toFixed(2) : data;
},
//id
queryDetailInfo(id) {
this.$request(getApp().globalData.baseUrl + '/api/biz/highwayParentDataController/selectById/' + id, {},
'GET').then(res => {
this.form = res.data;
this.queryTime();
this.queryStation();
if(checkNotEmpty(this.deptNameList)) {
let idx = this.deptNameList.findIndex(item => item = this.form.organizationName);
this.form.organizationNameIndex = idx > -1 ? idx : '';
this.queryStation();
if (checkNotEmpty(this.deptNameList)) {
let idx = this.deptNameList.findIndex(item => item.deptName = this.form.organizationName);
this.form.organizationNameIndex = idx > -1 ? idx : '';
}
})
},
@ -296,15 +306,15 @@
this.$request(getApp().globalData.baseUrl +
'/api/biz/highwayParentDataController/getYoYAndMoM?statDate=' + this.form.statDate +
'&statPeriod=' + this.form.statPeriod + '&_t=' + Date.parse(new Date()), {}, "GET").then(
res => {
this.yoyMom = res.data;
//
if (this.highwaySubDataList.length > 0 && this.form.highwaySubDataList.length > 0) {
this.highwaySubDataList.map((item, index) => {
this.checkStationInfo(index);
})
}
})
res => {
this.yoyMom = res.data;
//
if (this.highwaySubDataList.length > 0 && this.form.highwaySubDataList.length > 0) {
this.highwaySubDataList.map((item, index) => {
this.checkStationInfo(index);
})
}
})
}
},
//
@ -335,31 +345,49 @@
checkStationInfo(index) {
this.highwaySubDataList[index].isFinish = this.form.highwaySubDataList[index].entranceVehicleCount != '' &&
this.form.highwaySubDataList[index].exitVehicleCount != '';
//
//
let entranceVehicleCount = 0,
exitVehicleCount = 0;
this.form.highwaySubDataList.map(item => {
entranceVehicleCount = entranceVehicleCount + (item.entranceVehicleCount ? parseInt(item
entranceVehicleCount = entranceVehicleCount + (checkNotEmpty(item.entranceVehicleCount) ? parseInt(item
.entranceVehicleCount) : 0);
exitVehicleCount = exitVehicleCount + (item.exitVehicleCount ? parseInt(item
exitVehicleCount = exitVehicleCount + (checkNotEmpty(item.exitVehicleCount) ? parseInt(item
.exitVehicleCount) : 0);
})
this.form.entranceVehicleCount = entranceVehicleCount;
this.form.exitVehicleCount = exitVehicleCount;
//
this.form.entranceVehicleCountMom = this.form.entranceVehicleCount && this.yoyMom
.minusDaysEntranceVehicleSum ? (parseInt(this.form.entranceVehicleCount) - this.yoyMom
.minusDaysEntranceVehicleSum) / this.yoyMom.minusDaysEntranceVehicleSum * 100 : '';
this.form.entranceVehicleCountYoy = this.form.entranceVehicleCount && this.yoyMom
.minusYearsEntranceVehicleSum ? (parseInt(this.form.entranceVehicleCount) - this.yoyMom
.minusYearsEntranceVehicleSum) / this.yoyMom.minusYearsEntranceVehicleSum * 100 : ''; //
//
this.form.exitVehicleCountMom = this.form.exitVehicleCount && this.yoyMom.minusDaysExitVehicleSum ? (
parseInt(this.form.exitVehicleCount) - this.yoyMom.minusDaysExitVehicleSum) / this.yoyMom
.minusDaysExitVehicleSum * 100 : '';
this.form.exitVehicleCountYoy = this.form.exitVehicleCount && this.yoyMom.minusYearsExitVehicleSum ? (
parseInt(this.form.exitVehicleCount) - this.yoyMom.minusYearsExitVehicleSum) / this.yoyMom
.minusYearsExitVehicleSum * 100 : ''; //
// ifelseifelseif===0===00esleif00100,else(-)/*100
//
this.form.entranceVehicleCountMom = !checkNotEmpty(this.form.entranceVehicleCount) ? '' : !checkNotEmpty(this
.form.minusDaysEntranceVehicleSum) ? '' : this.form.minusDaysEntranceVehicleSum === 0 && parseInt(this
.form.entranceVehicleCount) === 0 ? 0 : this.form.minusDaysEntranceVehicleSum === 0 && parseInt(this
.form.entranceVehicleCount) > 0 ? 100 : (parseInt(this
.form.entranceVehicleCount) - this.yoyMom.minusDaysEntranceVehicleSum) / this.yoyMom
.minusDaysEntranceVehicleSum * 100;
this.form.entranceVehicleCountYoy = !checkNotEmpty(this.form
.entranceVehicleCount) ? '' : !checkNotEmpty(this
.form.minusYearsEntranceVehicleSum) ? '' : this.form.minusYearsEntranceVehicleSum === 0 && parseInt(
this.form.entranceVehicleCount) === 0 ? 0 : this.form.minusYearsEntranceVehicleSum === 0 && parseInt(
this.form.entranceVehicleCount) > 0 ? 100 : (parseInt(
this.form.entranceVehicleCount) - this.yoyMom.minusYearsEntranceVehicleSum) / this.yoyMom
.minusYearsEntranceVehicleSum * 100;
//
this.form.exitVehicleCountMom = !checkNotEmpty(this.form.exitVehicleCount) ? '' : !checkNotEmpty(this
.form
.minusDaysExitVehicleSum) ? '' : this.form.minusDaysExitVehicleSum === 0 && parseInt(this.form
.exitVehicleCount) === 0 ? 0 : this.form.minusDaysExitVehicleSum === 0 && parseInt(this.form
.exitVehicleCount) > 0 ? 100 : (parseInt(this.form
.exitVehicleCount) - this.yoyMom.minusDaysExitVehicleSum) / this.yoyMom.minusDaysExitVehicleSum *
100;
this.form.exitVehicleCountYoy = !checkNotEmpty(this.form.exitVehicleCount) ? '' : !checkNotEmpty(
this.form
.minusYearsExitVehicleSum) ? '' : this.form.minusYearsExitVehicleSum === 0 && parseInt(this.form
.exitVehicleCount) === 0 ? 0 : this.form.minusYearsExitVehicleSum === 0 && parseInt(this.form
.exitVehicleCount) > 0 ? 100 : (parseInt(this.form
.exitVehicleCount) - this.yoyMom.minusYearsExitVehicleSum) / this.yoyMom.minusYearsExitVehicleSum *
100;
//
// if(this.form.highwaySubDataList[index].entranceVehicleCount != '' || this.form.highwaySubDataList[index].exitVehicleCount != ''){
let idx = this.yoyMom.minusDaysList.findIndex(item => {
@ -375,11 +403,12 @@
console.log(obj)
this.form.highwaySubDataList[index].entranceVehicleCountMom = !checkNotEmpty(this.form
.highwaySubDataList[index].entranceVehicleCount) ? '' : !checkNotEmpty(obj
.entranceVehicleCount) || obj.entranceVehicleCount === 0 ? 100 : (parseInt(this.form
.entranceVehicleCount) ? '' : obj.entranceVehicleCount === 0 ? 100 : (parseInt(this.form
.highwaySubDataList[index].entranceVehicleCount) - obj.entranceVehicleCount) / obj
.entranceVehicleCount * 100;
this.form.highwaySubDataList[index].exitVehicleCountMom = !checkNotEmpty(this.form.highwaySubDataList[
index].exitVehicleCount) ? '' : !checkNotEmpty(obj.exitVehicleCount) || obj
this.form.highwaySubDataList[index].exitVehicleCountMom = !checkNotEmpty(this.form
.highwaySubDataList[
index].exitVehicleCount) ? '' : !checkNotEmpty(obj.exitVehicleCount) ? '' : obj
.exitVehicleCount === 0 ? 100 : (parseInt(this.form.highwaySubDataList[index].exitVehicleCount) -
obj.exitVehicleCount) / obj.exitVehicleCount * 100;
} else {
@ -392,12 +421,13 @@
console.log(obj)
this.form.highwaySubDataList[index].entranceVehicleCountYoy = !checkNotEmpty(this.form
.highwaySubDataList[index].entranceVehicleCount) ? '' : !checkNotEmpty(obj
.entranceVehicleCount) || obj.entranceVehicleCount === 0 ? 100 : (parseInt(this.form
.entranceVehicleCount) ? '' : obj.entranceVehicleCount === 0 ? 100 : (parseInt(this.form
.highwaySubDataList[index].entranceVehicleCount) - obj.entranceVehicleCount) / obj
.entranceVehicleCount * 100;
this.form.highwaySubDataList[index].exitVehicleCountYoy = !checkNotEmpty(this.form.highwaySubDataList[
index].exitVehicleCount) ? this.form.highwaySubDataList[index].exitVehicleCount : !
checkNotEmpty(obj.exitVehicleCount) || obj.exitVehicleCount === 0 ? 100 : (parseInt(this.form
this.form.highwaySubDataList[index].exitVehicleCountYoy = !checkNotEmpty(this.form
.highwaySubDataList[
index].exitVehicleCount) ? '' : !
checkNotEmpty(obj.exitVehicleCount) ? '' : obj.exitVehicleCount === 0 ? 100 : (parseInt(this.form
.highwaySubDataList[index].exitVehicleCount) - obj.exitVehicleCount) / obj.exitVehicleCount *
100;
} else {
@ -408,8 +438,9 @@
},
//
queryStation(type) {
this.$request(getApp().globalData.baseUrl + '/api/biz/HighSpeedPermissionsInfo/findList?_t=' + Date.parse(
new Date()), {}, 'GET').then(res => {
this.$request(getApp().globalData.baseUrl + '/api/biz/HighSpeedPermissionsInfo/findList?_t=' + Date
.parse(
new Date()), {}, 'GET').then(res => {
this.highwaySubDataList = res.data;
if (type == 'add') {
this.highwaySubDataList.map(item => {
@ -530,20 +561,6 @@
})
return;
}
//0
let checkRemark = true;
if (this.form.highwaySubDataList.length > 0) {
checkRemark = this.form.highwaySubDataList.every(item => {
return item.entranceVehicleCountMom !== 0 && item.exitVehicleCountMom !== 0;
})
}
if (!checkRemark) {
uni.showToast({
title: '环比持平预警请填写备注原因',
icon: 'none'
})
return;
}
uni.showModal({
title: '提示',
content: this.form.id == undefined ? '您确认提交该条报送数据?' : '您确认将该条数据进行修改?',
@ -559,7 +576,8 @@
title: '提交中...',
mask: true
})
this.$request(getApp().globalData.baseUrl + '/api/biz/highwayParentDataController/saveOrUpdate', this.form,
this.$request(getApp().globalData.baseUrl + '/api/biz/highwayParentDataController/saveOrUpdate', this
.form,
'POST').then(res => {
uni.hideLoading();
if (res.code == 200) {
@ -804,7 +822,7 @@
z-index: 99;
.act_btn {
width: 329rpx;
width: 690rpx;
height: 90rpx;
color: #666666;
font-size: 28rpx;
@ -828,4 +846,4 @@
background-color: #007aff;
color: #ffffff;
}
</style>
</style>

@ -69,13 +69,19 @@
</view>
</view>
<view class="form_item">
<view class="form_item_label">是否有伤亡</view>
<view class="form_item_input form_input">
<uni-data-checkbox v-model="form.isHas" :localdata="[{text: '无', value: 0 }, { text: '有', value: 1 }]" @change="changeIsHas" />
</view>
</view>
<view class="form_item" v-if="form.isHas == 1">
<view class="form_item_label">伤者人数</view>
<view class="form_item_input form_input">
<uni-easyinput v-model="form.injuredCount" placeholderStyle="color: #D4D4D4;font-size:28rpx;"
placeholder="请输入" type="number" maxlength="30"></uni-easyinput>
</view>
</view>
<view class="form_item">
<view class="form_item" v-if="form.isHas == 1">
<view class="form_item_label">亡者人数</view>
<view class="form_item_input form_input">
<uni-easyinput v-model="form.deceasedCount" placeholderStyle="color: #D4D4D4;font-size:28rpx;"
@ -111,7 +117,7 @@
<view class="form_item">
<view class="form_item_label">拥堵发生时间</view>
<view class="form_item_input picker">
<uni-datetime-picker type="datetime" v-model="item.congestionStartTime" :border="false">
<uni-datetime-picker type="datetime" v-model="item.congestionStartTime" :border="false" :hide-second="true" >
<text class="picker_select"
:style="item.congestionStartTime?'color:#333;':''">{{item.congestionStartTime?formatdate(item.congestionStartTime):'请选择'}}</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
@ -121,7 +127,7 @@
<view class="form_item">
<view class="form_item_label">拥堵处理结束时间</view>
<view class="form_item_input picker">
<uni-datetime-picker type="datetime" v-model="item.congestionEndTime" :border="false">
<uni-datetime-picker type="datetime" v-model="item.congestionEndTime" :border="false" :hide-second="true" >
<text class="picker_select"
:style="item.congestionEndTime?'color:#333;':''">{{item.congestionEndTime?formatdate(item.congestionEndTime):'请选择'}}</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
@ -196,7 +202,7 @@
<view class="form_item">
<view class="form_item_label">事故发生时间</view>
<view class="form_item_input picker">
<uni-datetime-picker type="datetime" v-model="item.accidentStartTime" :border="false">
<uni-datetime-picker type="datetime" v-model="item.accidentStartTime" :border="false" :hide-second="true" >
<text class="picker_select"
:style="item.accidentStartTime?'color:#333;':''">{{item.accidentStartTime?formatdate(item.accidentStartTime):'请选择'}}</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
@ -206,7 +212,7 @@
<view class="form_item">
<view class="form_item_label">事故处理结束时间</view>
<view class="form_item_input picker">
<uni-datetime-picker type="datetime" v-model="item.accidentEndTime" :border="false">
<uni-datetime-picker type="datetime" v-model="item.accidentEndTime" :border="false" :hide-second="true" >
<text class="picker_select"
:style="item.accidentEndTime?'color:#333;':''">{{item.accidentEndTime?formatdate(item.accidentEndTime):'请选择'}}</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
@ -274,8 +280,8 @@
</view>
<!-- 底部按钮 -->
<view class="foot_btn">
<view class="act_btn" @click="doCancel">取消</view>
<view class="act_btn blue" @click="doSubmit">确认</view>
<!-- <view class="act_btn" @click="doCancel">取消</view> -->
<view class="act_btn blue" @click="doSubmit">{{btnText}}</view>
</view>
</view>
</template>
@ -337,7 +343,9 @@
userInfo: {},
tabType: 1, //
accidentLevel: [], //
pageType: ''
pageType: '',
isHas: 0,//
btnText: '保存'
}
},
onLoad(options) {
@ -351,12 +359,22 @@
this.queryAccidentLevel(); //
this.queryTime(); //
} else if (options.id) {
this.btnText = '修改并保存';
this.queryDetailInfo(options.id);
}
},
methods: {
methods: {
//
changeIsHas(e) {
this.form.isHas = e.detail.value;
if(e.detail.value === 0) {
//
this.form.injuredCount = 0;
this.form.deceasedCount = 0;
}
},
formatdate(date) {
return date.length < 12 ? date + '00:00:00' : date;
return date.length < 12 ? date + '00:00' : date;
},
//id
queryDetailInfo(id) {
@ -374,7 +392,7 @@
queryHighway() {
this.$request(getApp().globalData.baseUrl + '/api/biz/roadInfo/all?page=0&pageSize=0&_t=' + Date.parse(
new Date()), {}, 'GET').then(res => {
this.highwayDataList = res.data;
this.highwayDataList = res.data.list;
this.form.highwayAccidentDetailDTOS.map(item => {
let idx = this.highwayDataList.findIndex(item2 => item2.stdName == item.highwayName);
item.highwayNameIndex = idx > -1 ? idx : '';
@ -807,7 +825,7 @@
z-index: 11;
.act_btn {
width: 329rpx;
width: 690rpx;
height: 90rpx;
color: #666666;
font-size: 28rpx;

@ -95,7 +95,7 @@
getDeptName() {
this.$request(getApp().globalData.baseUrl + '/api/user/getDeptName', {}, 'GET').then(res => {
if(res.code == 200) {
// uni.setStorageSync('deptName', res.data);
uni.setStorageSync('deptName', res.data);
}
}).catch(() => {
})

@ -66,17 +66,17 @@
<view class="rate_item">
<view class="rate_item_label"
:style="form.inboundRailwayDo && form.inboundRailwayDo == yoyMom.yesterdayData.inboundRailwayDo ? 'color: #EB4747' : ''">
终到车次环比(%)</view>
终到车次环比</view>
<view class="rate_item_input"
:style="form.inboundRailwayDo && form.inboundRailwayDo == yoyMom.yesterdayData.inboundRailwayDo ? 'color: #EB4747' : ''">
{{form.inRailwayYomDo ? form.inRailwayYomDo.toFixed(2) : ''}}
{{form.inRailwayYomDo ? formatDigit(form.inRailwayYomDo) : '--'}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">终到车次同比(%)</view>
<view class="rate_item_label">终到车次同比</view>
<view class="rate_item_input">
{{form.inRailwayMomDo ? form.inRailwayMomDo.toFixed(2) : ''}}
{{form.inRailwayMomDo ? formatDigit(form.inRailwayMomDo) : '--'}}%
</view>
</view>
</view>
@ -93,18 +93,18 @@
:class="form.inPepole && form.inPepole == yoyMom.yesterdayData.inPepole ? 'danger' : '' ">
<view class="rate_item">
<view class="rate_item_label"
:style="form.inPepole && form.inPepole == yoyMom.yesterdayData.inPepole ? 'color: #EB4747' : ''">人数环比(%)
:style="form.inPepole && form.inPepole == yoyMom.yesterdayData.inPepole ? 'color: #EB4747' : ''">人数环比
</view>
<view class="rate_item_input"
:style="form.inPepole && form.inPepole == yoyMom.yesterdayData.inPepole ? 'color: #EB4747' : ''">
{{form.inPepoleYoyDo ? form.inPepoleYoyDo.toFixed(2) : ''}}
{{form.inPepoleYoyDo ? formatDigit(form.inPepoleYoyDo) : '--'}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">人数同比(%)</view>
<view class="rate_item_label">人数同比</view>
<view class="rate_item_input">
{{form.inPepoleMomDo ? form.inPepoleMomDo.toFixed(2) : ''}}
{{form.inPepoleMomDo ? formatDigit(form.inPepoleMomDo) : '--'}}%
</view>
</view>
</view>
@ -144,17 +144,17 @@
<view class="rate_item">
<view class="rate_item_label"
:style="form.outboundRailwayDo && form.outboundRailwayDo == yoyMom.yesterdayData.outboundRailwayDo ? 'color: #EB4747' : ''">
始发车次环比(%)</view>
始发车次环比</view>
<view class="rate_item_input"
:style="form.outboundRailwayDo && form.outboundRailwayDo == yoyMom.yesterdayData.outboundRailwayDo ? 'color: #EB4747' : ''">
{{form.outRailwayYomDo ? form.outRailwayYomDo.toFixed(2) : ''}}
{{form.outRailwayYomDo ? formatDigit(form.outRailwayYomDo) : '--'}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">始发车次同比(%)</view>
<view class="rate_item_label">始发车次同比</view>
<view class="rate_item_input">
{{form.outRailwayMomDo ? form.outRailwayMomDo.toFixed(2) : ''}}
{{form.outRailwayMomDo ? formatDigit(form.outRailwayMomDo) : '--'}}%
</view>
</view>
</view>
@ -170,18 +170,18 @@
<view class="form_item_rate" :class="form.outPepole && form.outPepole == yoyMom.yesterdayData.outPeople ? 'danger' : '' ">
<view class="rate_item">
<view class="rate_item_label"
:style="form.outPepole && form.outPepole == yoyMom.yesterdayData.outPeople ? 'color: #EB4747' : ''">人数环比(%)
:style="form.outPepole && form.outPepole == yoyMom.yesterdayData.outPeople ? 'color: #EB4747' : ''">人数环比
</view>
<view class="rate_item_input"
:style="form.outPepole && form.outPepole == yoyMom.yesterdayData.outPeople ? 'color: #EB4747' : ''">
{{form.outPepoleYoyDo ? form.outPepoleYoyDo.toFixed(2) : ''}}
{{form.outPepoleYoyDo ? formatDigit(form.outPepoleYoyDo) : '--'}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">人数同比(%)</view>
<view class="rate_item_label">人数同比</view>
<view class="rate_item_input">
{{form.outPepoleMomDo ? form.outPepoleMomDo.toFixed(2) : ''}}
{{form.outPepoleMomDo ? formatDigit(form.outPepoleMomDo) : '--'}}%
</view>
</view>
</view>
@ -197,8 +197,8 @@
</view>
<!-- 底部按钮 -->
<view class="foot_btn">
<view class="act_btn" @click="doCancel">取消</view>
<view class="act_btn blue" @click="doSubmit">确认</view>
<!-- <view class="act_btn" @click="doCancel">取消</view> -->
<view class="act_btn blue" @click="doSubmit">{{btnText}}</view>
</view>
</view>
</template>
@ -239,7 +239,8 @@
array: [], //
index: 2, //,0-24
userInfo: {},
pageType: ''
pageType: '',
btnText: '保存'
}
},
onLoad(options) {
@ -251,6 +252,7 @@
this.form.statDate = getDateStr(now, -1); //
this.queryTime(); //
} else if (options.id) {
this.btnText = '修改并保存';
this.$request(getApp().globalData.baseUrl + '/api/biz/railwayRunData/find/' + options.id, {}, "GET").then(
res => {
this.form = res.data;
@ -259,6 +261,10 @@
}
},
methods: {
//
formatDigit(data) {
return (data+'').indexOf('.') > -1 && (data+'').substring((data+'').indexOf('.')).length > 2 ? data.toFixed(2) : data;
},
//
queryYoyMom() {
if (this.form.statDate == '' || this.form.statPeriod == '') {
@ -712,7 +718,7 @@
z-index: 11;
.act_btn {
width: 329rpx;
width: 690rpx;
height: 90rpx;
color: #666666;
font-size: 28rpx;

@ -9,11 +9,12 @@
<view class="form_item">
<view class="form_item_label">车站名称</view>
<view class="form_item_input picker">
<picker :value="railwayNameIndex" :range="stationList" @change="changeRailway">
<picker v-if="pageType == 'add'" :value="railwayNameIndex" :range="stationList" @change="changeRailway">
<text class="picker_select"
:style="form.carName?'color:#333;':''">{{form.carName?form.carName:'请选择'}}</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
</picker>
<text v-else>{{form.carName}}</text>
</view>
</view>
<view class="form_item">
@ -62,8 +63,8 @@
</view>
<!-- 底部按钮 -->
<view class="foot_btn">
<view class="act_btn" @click="doCancel">取消</view>
<view class="act_btn blue" @click="doSubmit">确认</view>
<!-- <view class="act_btn" @click="doCancel">取消</view> -->
<view class="act_btn blue" @click="doSubmit">{{btnText}}</view>
</view>
</view>
</template>
@ -88,7 +89,8 @@
array: [], //
index: 2, //,0-24
userInfo: {},
pageType: ''
pageType: '',
btnText: '保存'
}
},
onLoad(options) {
@ -99,7 +101,8 @@
this.form.statDate = getDateStr(now, -1); //
this.queryTime(); //
this.queryStation(); //
} if (options.id) {
} if (options.id) {
this.btnText = '修改并保存';
this.$request(getApp().globalData.baseUrl+'/api/biz/railwayRunSituation/find//'+options.id,{},"GET").then(res => {
this.form = res.data;
this.queryTime(); //
@ -457,7 +460,7 @@
z-index: 11;
.act_btn {
width: 329rpx;
width: 690rpx;
height: 90rpx;
color: #666666;
font-size: 28rpx;

@ -52,7 +52,7 @@
<view class="form_item">
<view class="form_item_label">事故发生时间</view>
<view class="form_item_input picker">
<uni-datetime-picker type="datetime" v-model="item.accidentHappened" :border="false">
<uni-datetime-picker type="datetime" v-model="item.accidentHappened" :border="false" :hide-second="true" >
<text class="picker_select"
:style="item.accidentHappened?'color:#333;':''">{{item.accidentHappened?formatdate(item.accidentHappened):'请选择'}}</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
@ -66,7 +66,7 @@
placeholder="请输入" maxlength="200"></uni-easyinput>
</view>
</view>
<view class="form_item">
<!-- <view class="form_item">
<view class="form_item_label">事故等级</view>
<view class="form_item_input picker">
<picker :value="item.gradeAccidentslIndex" :range="accidentLevel" range-key="dictLabel"
@ -76,7 +76,7 @@
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
</picker>
</view>
</view>
</view> -->
<view class="form_item">
<view class="form_item_label">事故内容</view>
<view class="form_item_input form_input">
@ -95,7 +95,7 @@
<view class="form_item">
<view class="form_item_label">事故处理结束时间</view>
<view class="form_item_input picker">
<uni-datetime-picker type="datetime" v-model="item.endTime" :border="false">
<uni-datetime-picker type="datetime" v-model="item.endTime" :border="false" :hide-second="true" >
<text class="picker_select"
:style="item.endTime?'color:#333;':''">{{item.endTime?formatdate(item.endTime):'请选择'}}</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
@ -109,8 +109,8 @@
</view>
<!-- 底部按钮 -->
<view class="foot_btn">
<view class="act_btn" @click="doCancel">取消</view>
<view class="act_btn blue" @click="doSubmit">确认</view>
<!-- <view class="act_btn" @click="doCancel">取消</view> -->
<view class="act_btn blue" @click="doSubmit">{{btnText}}</view>
</view>
</view>
</template>
@ -130,7 +130,7 @@
"dataDetails" : "",
"disposalWork" : "",
"endTime" : "",
"gradeAccidents" : "",
// "gradeAccidents" : "",
"occurrenceLocation" : "",
"parentId" : "",
"rowKey" : 0
@ -143,8 +143,9 @@
index: 2, //,0-24
userInfo: {},
tabType: 1, //
accidentLevel: [], //
pageType: ''
// accidentLevel: [], //
pageType: '',
btnText: '保存'
}
},
onLoad(options) {
@ -154,22 +155,23 @@
this.form.affiliatedUnit = this.userInfo.organizationName ? this.userInfo.organizationName : '';
let now = new Date();
this.form.statDate = getDateStr(now, -1); //
this.queryAccidentLevel(); //
// this.queryAccidentLevel(); //
this.queryTime(); //
} else if (options.id) {
this.btnText = '修改并保存';
this.queryDetailInfo(options.id);
}
},
methods: {
formatdate(date) {
return date.length < 12 ? date + '00:00:00' : date;
return date.length < 12 ? date + '00:00' : date;
},
//id
queryDetailInfo(id) {
this.$request(getApp().globalData.baseUrl + '/api/biz/watertransportRunSituation/find/' + id, {},
'GET').then(res => {
this.form = res.data;
this.queryAccidentLevel(); //
// this.queryAccidentLevel(); //
this.queryTime(); //
})
},
@ -532,7 +534,7 @@
z-index: 11;
.act_btn {
width: 329rpx;
width: 690rpx;
height: 90rpx;
color: #666666;
font-size: 28rpx;

@ -12,6 +12,12 @@
{{form.affiliatedUnit}}
</view>
</view> -->
<view class="form_item" v-if="form.bizWaterwayIslandDataSaveOrUpdateDTOList.length == 1">
<view class="form_item_label">陆岛名称</view>
<view class="form_item_input select">
{{form.bizWaterwayIslandDataSaveOrUpdateDTOList.length > 0 ? form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].landName : ''}}
</view>
</view>
<view class="form_item">
<view class="form_item_label">统计日期</view>
<view class="form_item_input picker">
@ -33,113 +39,110 @@
</view>
</view>
</view>
<view class="form_item_box" style="margin-top: 30rpx;">
<!-- 陆岛 -->
<view class="form_item_li" v-for="(item,index) in form.bizWaterwayIslandDataSaveOrUpdateDTOList"
:key="index">
<view class="form_item"
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(index)" size="18"></uni-icons>
<!-- 陆岛权限 -->
<view class="station_box">
<view v-if="index < 9" :style="(index+1)%3 == 0 ? 'margin-right:0;':''" @click="changeLandNameIndex(index)"
class="station_item" :class="[item.isFinish ? 'active' : '',index == landNameIndex ? 'choosed' : '']"
v-for="(item, index) in landList" :key="item.id">
<view v-if='item.isFinish' class="tag">
<uni-icons type="checkmarkempty" color="#fff" size="12"></uni-icons>
</view>
<view class="form_item">
{{item.stationId || ''}}
</view>
<view v-if="index >= 9 && showLand" :style="(index+1)%3 == 0 ? 'margin-right:0;':''"
@click="changeLandNameIndex(index)" class="station_item"
:class="[item.isFinish ? 'active' : '',index == landNameIndex ? 'choosed' : '']"
v-for="(item, index) in landList" :key="item.id">
<view v-if='item.isFinish' class="tag">
<uni-icons type="checkmarkempty" color="#fff" size="12"></uni-icons>
</view>
{{item.stationId || ''}}
</view>
</view>
<view class="form_item_box"
:style="form.bizWaterwayIslandDataSaveOrUpdateDTOList.length == 0 ? 'margin-top: 30rpx;' : ''">
<!-- 陆岛 -->
<view class="form_item_li">
<view class="form_item" v-if="form.bizWaterwayIslandDataSaveOrUpdateDTOList.length > 1">
<view class="form_item_label">水路(陆岛)</view>
<view class="form_item_input picker">
<picker :value="item.landNameIndex" :range="landList" @change="e => changeLandName(e, index)">
<!-- <picker :value="item.landNameIndex" :range="landList" @change="e => changeLandName(e, index)">
<text class="picker_select"
:style="item.landName?'color:#333;':''">{{item.landName ? item.landName : '请选择'}}</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
</picker>
</picker> -->
{{form.bizWaterwayIslandDataSaveOrUpdateDTOList.length >= 0 ? form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].landName : ''}}
</view>
</view>
<view class="form_item">
<view class="form_item_label">航次</view>
<view class="form_item_input form_input">
<uni-easyinput @blur="calcYoyMom(index)" type="number" v-model="item.voyage"
<uni-easyinput @blur="calcYoyMom(landNameIndex)" type="number"
v-model="form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].voyage"
placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入" maxlength="20">
</uni-easyinput>
</view>
</view>
<!-- 同比环比 -->
<view class="form_item_rate" :class="item.voyage && item.voyage == item.yesterdayVoyage ? 'danger' : '' ">
<view class="form_item_rate"
:class="form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].voyage && form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].voyage == form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].yesterdayVoyage ? 'danger' : '' ">
<view class="rate_item">
<view class="rate_item_label"
:style="item.voyage && item.voyage == item.yesterdayVoyage ? 'color: #EB4747' : ''">航次环比(%)
:style="form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].voyage && form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].voyage == form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].yesterdayVoyage ? 'color: #EB4747' : ''">
航次环比
</view>
<view class="rate_item_input"
:style="item.voyage && item.voyage == item.yesterdayVoyage ? 'color: #EB4747' : ''">
{{item.voyageRingRatio === 0 ? item.voyageRingRatio : item.voyageRingRatio ? item.voyageRingRatio.toFixed(2) : ''}}
:style="form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].voyage && item.voyage == form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].yesterdayVoyage ? 'color: #EB4747' : ''">
{{form.bizWaterwayIslandDataSaveOrUpdateDTOList.length == 0 ? '' : form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].voyageRingRatio === 0 ? form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].voyageRingRatio : form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].voyageRingRatio ? formatDigit(form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].voyageRingRatio) : '--'}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">航次同比(%)</view>
<view class="rate_item_label">航次同比</view>
<view class="rate_item_input">
{{item.voyageYearOnYear === 0 ? item.voyageYearOnYear : item.voyageYearOnYear ? item.voyageYearOnYear.toFixed(2) : ''}}
{{form.bizWaterwayIslandDataSaveOrUpdateDTOList.length == 0 ? '' : form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].voyageYearOnYear === 0 ? form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].voyageYearOnYear : form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].voyageYearOnYear ? formatDigit(form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].voyageYearOnYear) : '--'}}%
</view>
</view>
</view>
<view class="form_item">
<view class="form_item_label">人数</view>
<view class="form_item_input form_input">
<uni-easyinput @blur="calcYoyMom(index)" type="number" v-model="item.numberOfPeople"
<uni-easyinput @blur="calcYoyMom(landNameIndex)" type="number"
v-model="form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].numberOfPeople"
placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入" maxlength="20">
</uni-easyinput>
</view>
</view>
<!-- 同比环比 -->
<view class="form_item_rate"
:class="item.numberOfPeople && item.numberOfPeople == item.yesterdayNumberOfPeople ? 'danger' : '' ">
:class="form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].numberOfPeople && form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].numberOfPeople == form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].yesterdayNumberOfPeople ? 'danger' : '' ">
<view class="rate_item">
<view class="rate_item_label"
:style="item.numberOfPeople && item.numberOfPeople == item.yesterdayNumberOfPeople ? 'color: #EB4747' : ''">人数环比(%)
:style="form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].numberOfPeople && form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].numberOfPeople == form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].yesterdayNumberOfPeople ? 'color: #EB4747' : ''">
人数环比
</view>
<view class="rate_item_input"
:style="item.numberOfPeople && item.numberOfPeople == item.yesterdayNumberOfPeople ? 'color: #EB4747' : ''">
{{item.peopleRingRatio === 0 ? item.peopleRingRatio : item.peopleRingRatio ? item.peopleRingRatio.toFixed(2) : ''}}
:style="form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].numberOfPeople && form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].numberOfPeople == form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].yesterdayNumberOfPeople ? 'color: #EB4747' : ''">
{{form.bizWaterwayIslandDataSaveOrUpdateDTOList.length == 0 ? '' : form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].peopleRingRatio === 0 ? form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].peopleRingRatio : form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].peopleRingRatio ? formatDigit(form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].peopleRingRatio) : '--'}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">人数同比(%)</view>
<view class="rate_item_label">人数同比</view>
<view class="rate_item_input">
{{item.peopleYearOnYear === 0 ? item.peopleYearOnYear : item.peopleYearOnYear ? item.peopleYearOnYear.toFixed(2) : ''}}
{{form.bizWaterwayIslandDataSaveOrUpdateDTOList.length == 0 ? '' : form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].peopleYearOnYear === 0 ? form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].peopleYearOnYear : form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].peopleYearOnYear ? formatDigit(form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].peopleYearOnYear) : '--'}}%
</view>
</view>
</view>
<view class="form_item">
<view class="form_item_label">昨日航次</view>
<view class="form_item_input form_input">
{{item.yesterdayVoyage}}
</view>
</view>
<view class="form_item">
<view class="form_item_label">去年航次</view>
<view class="form_item_input form_input">
{{item.lastYearVoyage}}
</view>
</view>
<view class="form_item">
<view class="form_item_label">昨日人数</view>
<view class="form_item_input form_input">
{{item.yesterdayNumberOfPeople}}
</view>
</view>
<view class="form_item">
<view class="form_item_label">去年人数</view>
<view class="form_item_input form_input">
{{item.lastYearNumberOfPeople}}
</view>
</view>
<view class="line"></view>
<!-- <view class="line"></view> -->
</view>
<view class="add_btn" @click="addRow()">增行</view>
<!-- <view class="add_btn" @click="addRow()">增行</view> -->
</view>
<!-- 底部按钮 -->
<view class="foot_btn">
<view class="act_btn" @click="doCancel">取消</view>
<view class="act_btn blue" @click="doSubmit">确认</view>
<!-- <view class="act_btn" @click="doCancel">取消</view> -->
<view class="act_btn blue" @click="doSubmit">{{btnText}}</view>
</view>
</view>
</template>
@ -152,27 +155,18 @@
data() {
return {
form: {
"bizWaterwayIslandDataSaveOrUpdateDTOList": [{
"landNameIndex":"",
"landName": "",
"lastYearNumberOfPeople": 0,
"lastYearVoyage": 0,
"numberOfPeople": 0,
"peopleRingRatio": 0.0,
"peopleYearOnYear": 0.0,
"voyage": 0,
"voyageRingRatio": 0.0,
"voyageYearOnYear": 0.0,
"yesterdayNumberOfPeople": 0,
"yesterdayVoyage": 0
}],
"reportDate": ""
"bizWaterwayIslandDataSaveOrUpdateDTOList": [],
"reportDate": "",
"statPeriod": ""
}, //form
array: [], //
index: 2, //,0-24
userInfo: {},
landList: ['灵山岛', '斋堂岛', '青黄线', '竹岔', '田横'], //
pageType: ''
landList: ['灵山岛', '斋堂岛', '青黄线', '竹岔', '田横'],
landNameIndex: 0,
showLand: false,
pageType: '',
btnText: '保存'
}
},
onLoad(options) {
@ -181,37 +175,84 @@
this.pageType = 'add';
let now = new Date();
this.form.reportDate = getDateStr(now, -1); //
this.queryTime(); //
this.queryLandList();//
this.queryTime(); //
this.queryLandList(); //
} else if (options.item) {
this.btnText = '修改并保存';
this.form = JSON.parse(options.item);
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList = this.form.bizWaterwayIslandDataVOList;
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList.map(item => {
let idx = this.landList.findIndex(item2 => item2 == item.landName);
item.landNameIndex = idx > -1 ? idx : '';
})
this.queryLandList(); //
this.queryTime();
} else if (options.id) {
this.btnText = '修改并保存';
this.queryDetailInfo(options.id);
}
},
methods: {
formatdate(date) {
return date.length < 12 ? date + ' 00:00:00' : date;
},
//
queryLandList() {
this.$request(getApp().globalData.baseUrl + '/api/biz/bizWaterwayIslandAuthority/list', {}, 'GET').then(res => {
let arr = [];
res.data.map(item => {
arr.push(item.stationId);
})
this.landList = arr;
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList.map(item => {
let idx = this.landList.findIndex(item2 => item2 == item.landName);
item.landNameIndex = idx > -1 ? idx : '';
})
})
formatDigit(data) {
return (data+'').indexOf('.') > -1 && (data+'').substring((data+'').indexOf('.')).length > 2 ? data.toFixed(2) : data;
},
//
changeLandNameIndex(index) {
if (this.form.bizWaterwayIslandDataSaveOrUpdateDTOList[this.landNameIndex].voyage != '' && this.form
.bizWaterwayIslandDataSaveOrUpdateDTOList[this.landNameIndex].numberOfPeople != '') {
this.landList[this.landNameIndex].isFinish = true;
} else {
this.landList[this.landNameIndex].isFinish = false;
}
this.landNameIndex = index;
console.log('landNameIndex', index)
},
//
queryLandList() {
this.$request(getApp().globalData.baseUrl + '/api/biz/bizWaterwayIslandAuthority/list', {}, 'GET').then(res => {
this.landList = res.data;
if (this.pageType == 'add') {
this.landList.map(item => {
item.isFinish = false;
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList.push({
"landName": item.stationId,
"lastYearNumberOfPeople": '',
"lastYearVoyage": '',
"numberOfPeople": '',
"peopleRingRatio": '',
"peopleYearOnYear": '',
"voyage": '',
"voyageRingRatio": '',
"voyageYearOnYear": '',
"yesterdayNumberOfPeople": '',
"yesterdayVoyage": '',
})
})
} else {
let arr = JSON.parse(JSON.stringify(this.form.bizWaterwayIslandDataSaveOrUpdateDTOList));
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList = [];
this.landList.map(item => {
let idx = arr.findIndex(item2 => item2.landName == item.stationId);
console.log(idx)
if (idx > -1) {
item.isFinish = checkNotEmpty(arr[idx].numberOfPeople) && checkNotEmpty(arr[idx].voyage) ? true :
false;
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList.push(arr[idx]);
} else {
item.isFinish = false;
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList.push({
"landName": item.stationId,
"lastYearNumberOfPeople": '',
"lastYearVoyage": '',
"numberOfPeople": '',
"peopleRingRatio": '',
"peopleYearOnYear": '',
"voyage": '',
"voyageRingRatio": '',
"voyageYearOnYear": '',
"yesterdayNumberOfPeople": '',
"yesterdayVoyage": '',
})
}
})
}
})
},
//
changeLandName(e, index) {
@ -223,45 +264,67 @@
title: '水运(陆岛)不能重复选择',
icon: 'none'
});
}else{
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList[index].landNameIndex = e.detail.value;
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList[index].landName = this.landList[e.detail.value];
this.calcYoyMom(index);
} else {
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList[index].landNameIndex = e.detail.value;
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList[index].landName = this.landList[e.detail.value];
this.calcYoyMom(index);
}
},
//
calcYoyMom(index) {
calcYoyMom(landNameIndex) {
if (this.form.reportDate == '' || this.form.statPeriod == '' || this.form
.bizWaterwayIslandDataSaveOrUpdateDTOList[index].landName == '') {
.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].landName == '') {
return;
}
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].isFinish = checkNotEmpty(this.form
.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].voyage) && checkNotEmpty(this.form
.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].numberOfPeople) ? true : false;
this.$request(getApp().globalData.baseUrl + '/api/biz/waterwayIslandData/getYoyMom?statDate=' + this.form
.reportDate + '&statPeriod=' + this.form.statPeriod + '&landName=' + this.form
.bizWaterwayIslandDataSaveOrUpdateDTOList[index].landName + '&_t=' + Date.parse(new Date()), {},
.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].landName + '&_t=' + Date.parse(new Date()), {},
'GET')
.then(res => {
let yesterdayData = res.data.yesterdayData;
let lastYearData = res.data.lastYearData;
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList[index].yesterdayVoyage = checkNotEmpty(yesterdayData.voyage) ? yesterdayData.voyage : 0;
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList[index].lastYearVoyage = checkNotEmpty(lastYearData.voyage) ? lastYearData.voyage : 0;
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList[index].yesterdayNumberOfPeople = checkNotEmpty(yesterdayData.numberOfPeople) ? yesterdayData.numberOfPeople : 0;
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList[index].lastYearNumberOfPeople = checkNotEmpty(lastYearData.numberOfPeople) ? lastYearData.numberOfPeople : 0;
//-
let obj = this.form.bizWaterwayIslandDataSaveOrUpdateDTOList[index];
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList[index].voyageRingRatio = !checkNotEmpty(obj.voyage) ? '' : !checkNotEmpty(yesterdayData.voyage) || yesterdayData.voyage === 0 ? 100 : (parseInt(obj.voyage) - yesterdayData.voyage) / yesterdayData.voyage * 100 ;
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList[index].voyageYearOnYear = !checkNotEmpty(obj.voyage) ? '' : !checkNotEmpty(lastYearData.voyage) || lastYearData.voyage === 0 ? 100 : (parseInt(obj.voyage) - lastYearData.voyage) / lastYearData.voyage * 100;
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList[index].peopleRingRatio = !checkNotEmpty(obj.numberOfPeople) ? '' : !checkNotEmpty(yesterdayData.numberOfPeople) || yesterdayData.numberOfPeople === 0 ? 100 : (parseInt(obj.numberOfPeople) - yesterdayData.numberOfPeople) / yesterdayData.numberOfPeople * 100;
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList[index].peopleYearOnYear = !checkNotEmpty(obj.numberOfPeople) ? '' : !checkNotEmpty(lastYearData.numberOfPeople) || lastYearData.numberOfPeople === 0 ? 100 : (parseInt(obj.numberOfPeople) - lastYearData.numberOfPeople) / lastYearData.numberOfPeople * 100;
console.log('环比同比', this.form.bizWaterwayIslandDataSaveOrUpdateDTOList[index])
.then(res => {
let yesterdayData = res.data.yesterdayData;
let lastYearData = res.data.lastYearData;
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].yesterdayVoyage = checkNotEmpty(
yesterdayData.voyage) ? yesterdayData.voyage : 0;
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].lastYearVoyage = checkNotEmpty(
lastYearData.voyage) ? lastYearData.voyage : 0;
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].yesterdayNumberOfPeople = checkNotEmpty(
yesterdayData.numberOfPeople) ? yesterdayData.numberOfPeople : 0;
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].lastYearNumberOfPeople = checkNotEmpty(
lastYearData.numberOfPeople) ? lastYearData.numberOfPeople : 0;
//-
// ifelseifelseif===0===00esleif00100,else(-)/*100
let obj = this.form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex];
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].voyageRingRatio = !checkNotEmpty(obj
.voyage) ? '' : !checkNotEmpty(yesterdayData.voyage) ? '' : yesterdayData.voyage === 0 && parseInt(obj
.voyage) === 0 ? 0 : yesterdayData.voyage === 0 && parseInt(obj.voyage) > 0 ? 100 : (parseInt(obj
.voyage) - yesterdayData.voyage) / yesterdayData.voyage * 100;
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].voyageYearOnYear = !checkNotEmpty(obj
.voyage) ? '' : !checkNotEmpty(lastYearData.voyage) ? '' : lastYearData.voyage === 0 && parseInt(obj
.voyage) === 0 ? 0 : lastYearData.voyage === 0 && parseInt(obj.voyage) > 0 ? 100 : (parseInt(obj
.voyage) - lastYearData.voyage) / lastYearData.voyage * 100;
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].peopleRingRatio = !checkNotEmpty(obj
.numberOfPeople) ? '' : !checkNotEmpty(yesterdayData.numberOfPeople) ? '' : yesterdayData
.numberOfPeople === 0 && parseInt(obj.numberOfPeople) === 0 ? 0 : yesterdayData.numberOfPeople === 0 &&
parseInt(obj.numberOfPeople) > 0 ? 100 : (parseInt(obj.numberOfPeople) - yesterdayData.numberOfPeople) /
yesterdayData.numberOfPeople * 100;
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex].peopleYearOnYear = !checkNotEmpty(obj
.numberOfPeople) ? '' : !checkNotEmpty(lastYearData.numberOfPeople) ? '' : lastYearData
.numberOfPeople === 0 && parseInt(obj.numberOfPeople) === 0 ? 0 : lastYearData.numberOfPeople === 0 &&
parseInt(obj.numberOfPeople) > 0 ? 100 : (parseInt(obj.numberOfPeople) - lastYearData.numberOfPeople) /
lastYearData.numberOfPeople * 100;
console.log('环比同比', this.form.bizWaterwayIslandDataSaveOrUpdateDTOList[landNameIndex])
})
},
//id
queryDetailInfo(id) {
this.$request(getApp().globalData.baseUrl + '/api/biz/waterwayIslandData/getById/' + id, {},
'GET').then(res => {
this.form = res.data;
this.form = res.data;
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList = this.form.bizWaterwayIslandDataVOList;
this.queryTime(); //
this.queryTime(); //
this.queryLandList();
})
},
@ -316,7 +379,7 @@
},
//
addRow() {
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList.push({
this.form.bizWaterwayIslandDataSaveOrUpdateDTOList.push({
"landNameIndex": "",
"landName": "",
"lastYearNumberOfPeople": 0,
@ -385,10 +448,10 @@
icon: 'none',
success: () => {
if (this.form.id == undefined) {
setTimeout(() => {
uni.redirectTo({
url: '/pages/water/waterWay/list'
})
setTimeout(() => {
uni.redirectTo({
url: '/pages/water/waterWay/list'
})
}, 300)
} else {
uni.navigateBack();
@ -567,12 +630,14 @@
margin-top: 40rpx;
.station_item {
width: 175rpx;
height: 60rpx;
color: #666666;
line-height: 60rpx;
font-size: 26rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
text-align: center;
border-radius: 20rpx;
border: 1rpx solid #C1C1C1;
padding: 0 20rpx;
@ -591,11 +656,17 @@
right: 0;
width: 34rpx;
height: 23rpx;
color: #fff;
line-height: 23rpx;
background: #1ECE5F;
border-radius: 0rpx 20rpx 0rpx 5rpx;
text-align: center;
}
}
&.choosed {
border-color: #2D8CF0 !important;
}
}
}
@ -611,7 +682,7 @@
z-index: 11;
.act_btn {
width: 329rpx;
width: 690rpx;
height: 90rpx;
color: #666666;
font-size: 28rpx;
@ -687,4 +758,4 @@
background-color: #007aff;
color: #ffffff;
}
</style>
</style>
Loading…
Cancel
Save