|
|
|
|
@ -12,10 +12,15 @@ |
|
|
|
|
<view class="edit_item"> |
|
|
|
|
<p class="left">填报日期</p> |
|
|
|
|
<view class="right"> |
|
|
|
|
<uni-datetime-picker type="date" v-model="synthData.reportDate"> |
|
|
|
|
<!-- <uni-datetime-picker type="date" v-model="synthData.reportDate"> |
|
|
|
|
<p class="right_txt">{{synthData.reportDate ? synthData.reportDate : '请选择日期'}}</p> |
|
|
|
|
<uni-icons type="right" size="16"></uni-icons> |
|
|
|
|
</uni-datetime-picker> |
|
|
|
|
</uni-datetime-picker> --> |
|
|
|
|
<picker mode="date" :value="synthData.reportDate" @change="bindDateChange"> |
|
|
|
|
<text class="picker_select" |
|
|
|
|
:style="synthData.reportDate?'color:#333;':''">{{synthData.reportDate?synthData.reportDate:'请选择'}}</text> |
|
|
|
|
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons> |
|
|
|
|
</picker> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
@ -24,7 +29,7 @@ |
|
|
|
|
<view class="edit_item input"> |
|
|
|
|
<p class="left">班次</p> |
|
|
|
|
<view class="right"> |
|
|
|
|
<uni-easyinput v-model="synthData.shifts" placeholder="请输入" placeholderStyle="color:#d4d4d4;"></uni-easyinput> |
|
|
|
|
<uni-easyinput @blur="calcYoyMom" v-model="synthData.shifts" placeholder="请输入" placeholderStyle="color:#d4d4d4;"></uni-easyinput> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="per_con" v-if="pageType == 'edit'"> |
|
|
|
|
@ -40,7 +45,7 @@ |
|
|
|
|
<view class="edit_item input"> |
|
|
|
|
<p class="left">人数</p> |
|
|
|
|
<view class="right"> |
|
|
|
|
<uni-easyinput v-model="synthData.people" placeholder="请输入" placeholderStyle="color:#d4d4d4;"></uni-easyinput> |
|
|
|
|
<uni-easyinput @blur="calcYoyMom" v-model="synthData.people" placeholder="请输入" placeholderStyle="color:#d4d4d4;"></uni-easyinput> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="per_con" v-if="pageType == 'edit'"> |
|
|
|
|
@ -76,31 +81,59 @@ |
|
|
|
|
reportDate:'', //填报日期 |
|
|
|
|
people:'' //人数 |
|
|
|
|
}, |
|
|
|
|
pageType:'' |
|
|
|
|
pageType:'', |
|
|
|
|
yoymom:{}, |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onLoad(options) { |
|
|
|
|
// this.getRoadTime() |
|
|
|
|
// this.getDetail() |
|
|
|
|
if(options.pageFrom == 'edit'){ |
|
|
|
|
if(options.type == 'edit'){ |
|
|
|
|
this.pageType = 'edit' |
|
|
|
|
let row = JSON.parse(options.item); |
|
|
|
|
this.synthData = row; |
|
|
|
|
this.synthData.reportDatetime = this.synthData.reportDatetime ? this.synthData.reportDatetime.substring(0,10) : '' |
|
|
|
|
}else if(options.pageFrom == 'add'){ |
|
|
|
|
this.pageType = 'add' |
|
|
|
|
this.getYoYMoM(); |
|
|
|
|
// this.synthData.reportDate = this.synthData.reportDate ? this.synthData.reportDate.substring(0,10) : '' |
|
|
|
|
}else if(options.type == 'add'){ |
|
|
|
|
this.pageType = 'add' |
|
|
|
|
let now = new Date(); |
|
|
|
|
this.synthData.reportDate = getDateStr(now, -1);//默认前一天 |
|
|
|
|
this.getYoYMoM(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
getDetail(){ |
|
|
|
|
this.$request1(getApp().globalData.baseUrl + '/api/biz/roadtransport/road/find/89D260E420000001F70FB937A7F7088C',{},"GET").then(res =>{ |
|
|
|
|
console.log(res) |
|
|
|
|
//选择统计日期 |
|
|
|
|
bindDateChange(e) { |
|
|
|
|
this.synthData.reportDate = e.detail.value; |
|
|
|
|
this.getYoYMoM(); |
|
|
|
|
}, |
|
|
|
|
// 获取同比环比 |
|
|
|
|
getYoYMoM(){ |
|
|
|
|
this.$request(getApp().globalData.baseUrl + '/api/biz/bizTransportData/getYoyMom?statDate=' + this.synthData.reportDate + '&_t=' + Date.parse(new Date()),"GET").then(res =>{ |
|
|
|
|
console.log('同比环比===>',res) |
|
|
|
|
this.yoymom = res.data; |
|
|
|
|
this.calcYoyMom(); //同步更新环比同比 |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 计算同比环比 |
|
|
|
|
calcYoyMom(){ |
|
|
|
|
console.log('计算同比环比') |
|
|
|
|
// 环比 |
|
|
|
|
if(this.yoymom.yesterdayData){ |
|
|
|
|
this.synthData.shiftMom = this.yoymom.yesterdayData.shifts && this.synthData.shifts ? ( |
|
|
|
|
parseInt(this.synthData.shifts) - this.yoymom.yesterdayData.shifts) / this.yoymom.yesterdayData.shifts * 100 : ''; |
|
|
|
|
this.synthData.peopleMom = this.yoymom.yesterdayData.people && this.synthData.people ? ( |
|
|
|
|
this.synthData.people - this.yoymom.yesterdayData.people) / this.yoymom.yesterdayData.people * 100 : '' |
|
|
|
|
} |
|
|
|
|
// 同比 |
|
|
|
|
if(this.yoymom.lastYearData){ |
|
|
|
|
this.synthData.shiftYoy = this.yoymom.lastYearData.shifts && this.synthData.shifts ? ( |
|
|
|
|
parseInt(this.synthData.shifts) - this.yoymom.lastYearData.shifts) / this.yoymom.lastYearData.shifts * 100 : ''; |
|
|
|
|
this.synthData.peopleYoy = this.yoymom.lastYearData.people && this.synthData.people ? ( |
|
|
|
|
this.synthData.people - this.yoymom.lastYearData.people) / this.yoymom.lastYearData.people * 100 : '' |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 获取时段 |
|
|
|
|
getRoadTime(){ |
|
|
|
|
this.$request(getApp().globalData.baseUrl + '/api/dict/dictList?dictType=airport_time&_t=1693372307694',"GET").then(res =>{ |
|
|
|
|
@ -124,6 +157,7 @@ |
|
|
|
|
// 点击确认按钮 |
|
|
|
|
confirmRoad(){ |
|
|
|
|
let params = this.synthData; |
|
|
|
|
console.log(params) |
|
|
|
|
if(params.reportDate == ''){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
title:"请选择填报日期", |
|
|
|
|
@ -154,13 +188,6 @@ |
|
|
|
|
cancelEdit(){ |
|
|
|
|
uni.navigateBack() |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
onchange(e){ |
|
|
|
|
console.log('确定===》',e) |
|
|
|
|
}, |
|
|
|
|
onnodeclick(e){ |
|
|
|
|
console.log('点击===》',e) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
|