第一次提交
This commit is contained in:
@@ -8,19 +8,23 @@
|
||||
<view class="header_footer">
|
||||
<view>
|
||||
<view class="flex jc">负责人</view>
|
||||
<view
|
||||
@click="chargeOpen"
|
||||
style="border-bottom-left-radius:0px;border-top-left-radius: 0px;width:164rpx;"class="header_footer_item flex ac jc">
|
||||
<text style="width: 100%;white-space:nowrap;overflow:hidden;text-overflow: ellipsis;">{{getData.params.customerName}}</text>
|
||||
</view>
|
||||
<view @click="chargeOpen"
|
||||
style="border-bottom-left-radius:0px;border-top-left-radius: 0px;width:164rpx;"
|
||||
class="header_footer_item flex ac jc">
|
||||
<text
|
||||
style="width: 100%;white-space:nowrap;overflow:hidden;text-overflow: ellipsis;">{{getData.params.customerName}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view style="flex: 1;display: flex;flex-direction: column;justify-content: center;align-items: center;">
|
||||
<view
|
||||
style="flex: 1;display: flex;flex-direction: column;justify-content: center;align-items: center;">
|
||||
<view class="flex js ae">
|
||||
<text>统计日期</text>
|
||||
<text style="font-size: 18rpx;visibility: hidden;">01/25 16:08 </text>
|
||||
</view>
|
||||
<view style="padding: 0 20rpx; width: fit-content;" class="header_footer_item flex ac jc">
|
||||
<text style="font-size: 27rpx;" @click="isShow.date=true"> {{ getData.params.startTime.split(' ')[0] }} 至 {{getData.params.endTime.split(' ')[0] }} </text>
|
||||
<text style="font-size: 27rpx;" @click="isShow.date=true">
|
||||
{{ getData.params.startTime.split(' ')[0] }} 至 {{getData.params.endTime.split(' ')[0] }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="header_footer_item_right">
|
||||
@@ -34,15 +38,23 @@
|
||||
</view>
|
||||
</topBar>
|
||||
<view class="sale_list">
|
||||
<scroll-view v-if="dataList.length!==0" :refresher-triggered='isShow.refresherTriggered' @refresherrefresh='refresherrefresh' :refresher-enabled='true' @scrolltolower='scrolltolower' scroll-y="true" class="list_scroll">
|
||||
<scroll-view v-if="dataList.length!==0" :refresher-triggered='isShow.refresherTriggered'
|
||||
@refresherrefresh='refresherrefresh' :refresher-enabled='true' @scrolltolower='scrolltolower'
|
||||
scroll-y="true" class="list_scroll">
|
||||
<view v-for="(item,index) in dataList">
|
||||
<view @click="jump(item)" class="list_item flex jb">
|
||||
<text :style="{color:item.rankingNum==1?'#E5920E':item.rankingNum==2?'#9495AD':item.rankingNum==3?'#BC853B':'',fontWeight:item.rankingNum>3?'':'600'}" class="flex ac ranking">No.{{item.rankingNum}}</text>
|
||||
<view style="min-width: 80rpx; height: 100%; display: flex;flex-direction: column;align-items: center;" class="tc">
|
||||
<view @click="jump(item)" class="list_item flex jb">
|
||||
<text
|
||||
:style="{color:item.rankingNum==1?'#E5920E':item.rankingNum==2?'#9495AD':item.rankingNum==3?'#BC853B':'',fontWeight:item.rankingNum>3?'':'600'}"
|
||||
class="flex ac ranking">No.{{item.rankingNum}}</text>
|
||||
<view
|
||||
style="min-width: 80rpx; height: 100%; display: flex;flex-direction: column;align-items: center;"
|
||||
class="tc">
|
||||
<view class="t-icon">
|
||||
<image v-if="item.siteImages" style="width: 100%; height: 100%;" :src="item.siteImages"></image>
|
||||
<image v-if="item.siteImages" style="width: 100%; height: 100%;" :src="item.siteImages">
|
||||
</image>
|
||||
<view v-else>
|
||||
<uni-icons color="#2866ff" custom-prefix="iconfont" type="iconjiayou" size="25"></uni-icons>
|
||||
<uni-icons color="#2866ff" custom-prefix="iconfont" type="iconjiayou" size="25">
|
||||
</uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
@@ -50,7 +62,8 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex list_item_lable_right">
|
||||
<view style="white-space:nowrap;overflow:hidden;text-overflow: ellipsis;">{{item.siteName}}</view>
|
||||
<view style="white-space:nowrap;overflow:hidden;text-overflow: ellipsis;">{{item.siteName}}
|
||||
</view>
|
||||
<view class="flex jb">
|
||||
<text>{{item.volume.toFixed(2)}}L</text>
|
||||
<text>{{item.realPrice|price}}¥</text>
|
||||
@@ -58,7 +71,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="moreif(index)">
|
||||
<moreFillend @moreFilledFn='moreFilledFn' :isShow='isShow.moreFilled'/>
|
||||
<moreFillend @moreFilledFn='moreFilledFn' :isShow='isShow.moreFilled' />
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
@@ -67,7 +80,7 @@
|
||||
<image src="@/static/qx.png" style="width: 536rpx; height: 399rpx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
<charge @chargeChange='chargeChange' v-model="isShow.charge" />
|
||||
<charge @chargeChange='chargeChange' v-model="isShow.charge" />
|
||||
<datePopup @datePopupChange='datePopupChange' v-model="isShow.date" />
|
||||
<filters @filtersChange='filtersChange' v-model="isShow.filters" />
|
||||
</view>
|
||||
@@ -100,27 +113,27 @@
|
||||
charge: false,
|
||||
date: false,
|
||||
filters: false,
|
||||
refresherTriggered:false
|
||||
refresherTriggered: false
|
||||
},
|
||||
seleBarData: [{
|
||||
lable: '柴油',
|
||||
value: 'DIESEL',
|
||||
open:true
|
||||
open: true
|
||||
},
|
||||
{
|
||||
lable: '汽油',
|
||||
value: 'PETROL',
|
||||
open:true
|
||||
open: true
|
||||
},
|
||||
{
|
||||
lable: 'LNG',
|
||||
value: 'GAS',
|
||||
open:true
|
||||
open: true
|
||||
}
|
||||
],
|
||||
permission:false,
|
||||
permission: false,
|
||||
getData: {
|
||||
pageSize:5,
|
||||
pageSize: 5,
|
||||
currentPage: 1,
|
||||
params: {
|
||||
endTime: '',
|
||||
@@ -128,79 +141,82 @@
|
||||
productType: 'DIESEL',
|
||||
dataArrangement: 'desc',
|
||||
customerId: '',
|
||||
customerName:'全部'
|
||||
customerName: '全部'
|
||||
}
|
||||
},
|
||||
dataList: [],
|
||||
endDate: null,
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
"isShow.charge":{
|
||||
handler:function(n,o){
|
||||
if(!n){
|
||||
watch: {
|
||||
"isShow.charge": {
|
||||
handler: function(n, o) {
|
||||
if (!n) {
|
||||
this.getData.currentPage = 1
|
||||
this.getlist()
|
||||
}
|
||||
},
|
||||
deep:true
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
created() {
|
||||
let date = new Date
|
||||
let yesterday = new Date(date.getTime()-86400000)
|
||||
this.getData.params.endTime =`${yesterday.getFullYear()}-${yesterday.getMonth()+1<10?'0'+(yesterday.getMonth()+1):yesterday.getMonth()+1}-${yesterday.getDate()<10?'0'+yesterday.getDate():yesterday.getDate()}`
|
||||
this.getData.params.startTime =`${yesterday.getFullYear()}-${yesterday.getMonth()+1<10?'0'+(yesterday.getMonth()+1):yesterday.getMonth()+1}-${yesterday.getDate()<10?'0'+yesterday.getDate():yesterday.getDate()}`
|
||||
},
|
||||
onShow() {
|
||||
},
|
||||
onLoad() {
|
||||
let yesterday = new Date(date.getTime() - 86400000)
|
||||
this.getData.params.endTime =
|
||||
`${yesterday.getFullYear()}-${yesterday.getMonth()+1<10?'0'+(yesterday.getMonth()+1):yesterday.getMonth()+1}-${yesterday.getDate()<10?'0'+yesterday.getDate():yesterday.getDate()}`
|
||||
this.getData.params.startTime =
|
||||
`${yesterday.getFullYear()}-${yesterday.getMonth()+1<10?'0'+(yesterday.getMonth()+1):yesterday.getMonth()+1}-${yesterday.getDate()<10?'0'+yesterday.getDate():yesterday.getDate()}`
|
||||
},
|
||||
onShow() {},
|
||||
onLoad() {},
|
||||
mounted() {
|
||||
this.getlist()
|
||||
},
|
||||
filters:{
|
||||
price(e){
|
||||
filters: {
|
||||
price(e) {
|
||||
return convertW.convertW(e)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
refresherrefresh(){
|
||||
refresherrefresh() {
|
||||
this.getData.currentPage = 1
|
||||
this.isShow.refresherTriggered = true
|
||||
this.getlist()
|
||||
},
|
||||
moreif(index){
|
||||
if(!this.seleBarData[this.index].open) return false
|
||||
if(String(this.dataList.length/2).indexOf('.')!=-1){
|
||||
return index+1 == (this.dataList.length+1)/2
|
||||
}else{
|
||||
return index+1 == this.dataList.length/2
|
||||
moreif(index) {
|
||||
if (!this.seleBarData[this.index].open) return false
|
||||
if (String(this.dataList.length / 2).indexOf('.') != -1) {
|
||||
return index + 1 == (this.dataList.length + 1) / 2
|
||||
} else {
|
||||
return index + 1 == this.dataList.length / 2
|
||||
}
|
||||
},
|
||||
jump(e){
|
||||
|
||||
jump(e) {
|
||||
|
||||
uni.navigateTo({
|
||||
url:'../enterpriseDetails/enterpriseDetails?jsData='+JSON.stringify(Object.assign(e,{endTime:this.getData.params.endTime,startTime:this.getData.params.startTime}))
|
||||
url: '../enterpriseDetails/enterpriseDetails?jsData=' + JSON.stringify(Object.assign(e, {
|
||||
endTime: this.getData.params.endTime,
|
||||
startTime: this.getData.params.startTime
|
||||
}))
|
||||
})
|
||||
},
|
||||
//获取列表方法
|
||||
getlist() {
|
||||
this.getData.pageSize = this.seleBarData[this.index].open? 5:10
|
||||
sy.findOilSiteDesc(this.getData).then(res=>{
|
||||
this.getData.pageSize = this.seleBarData[this.index].open ? 5 : 10
|
||||
sy.findOilSiteDesc(this.getData).then(res => {
|
||||
this.isShow.refresherTriggered = false
|
||||
if (res.code !== 20000) return
|
||||
this.permission = Number(res.data.params.permission)==0?false:true
|
||||
this.permission = Number(res.data.params.permission) == 0 ? false : true
|
||||
if (res.data.list.length == 0) {
|
||||
uni.showToast({
|
||||
title: '没有数据了哦',
|
||||
icon: 'none'
|
||||
})
|
||||
if(this.getData.currentPage==1) this.dataList = []
|
||||
if (this.getData.currentPage == 1) this.dataList = []
|
||||
return
|
||||
}
|
||||
if(this.seleBarData[this.index].open && res.data.list.length < 10){
|
||||
this.seleBarData[this.index].open = false
|
||||
if (this.seleBarData[this.index].open && res.data.list.length < 10) {
|
||||
this.seleBarData[this.index].open = false
|
||||
}
|
||||
if (this.getData.currentPage !== 1) {
|
||||
this.dataList = this.dataList.concat(res.data.list);
|
||||
@@ -215,8 +231,8 @@
|
||||
title: '到底了',
|
||||
icon: 'none'
|
||||
})
|
||||
if(this.seleBarData[this.index].open) return
|
||||
this.getData.currentPage+=1
|
||||
if (this.seleBarData[this.index].open) return
|
||||
this.getData.currentPage += 1
|
||||
this.getlist()
|
||||
},
|
||||
// 排序组件选中触发的函数 e当前所选值
|
||||
@@ -230,20 +246,20 @@
|
||||
this.getData.currentPage = 1
|
||||
this.getData.params.startTime = e[0]
|
||||
this.getData.params.endTime = e[1]
|
||||
console.log(e,this.getData,this.seleBarData[this.index].open,'datePopupChange')
|
||||
console.log(e, this.getData, this.seleBarData[this.index].open, 'datePopupChange')
|
||||
this.getlist()
|
||||
|
||||
|
||||
},
|
||||
//负责人选择组件选中触发的函数 e选中的值
|
||||
chargeChange(e) {
|
||||
this.getData.params.customerId = e.id
|
||||
this.getData.params.customerName = e.userName
|
||||
console.log(e)
|
||||
console.log(e, '****************')
|
||||
},
|
||||
//打开charge组件
|
||||
chargeOpen() {
|
||||
console.log(this.permission,'****************')
|
||||
if(!this.permission) return
|
||||
console.log(this.permission, '****************')
|
||||
if (!this.permission) return
|
||||
this.isShow.charge = true;
|
||||
},
|
||||
//点击moreFilled组件 回调事件
|
||||
@@ -260,14 +276,14 @@
|
||||
return a
|
||||
},
|
||||
//顶部选择器值变化时触发的函数 e 当前的值
|
||||
seleBarFn(e,w) {
|
||||
seleBarFn(e, w) {
|
||||
console.log('%c 当前选择项↓', 'color:red;font-size:50px')
|
||||
console.log(e,w)
|
||||
console.log(e, w)
|
||||
this.dataList = []
|
||||
this.getData.currentPage = 1
|
||||
this.index = w
|
||||
this.getData.params.productType = e.value
|
||||
this.isShow.moreFilled = this.seleBarData[this.index].open
|
||||
this.isShow.moreFilled = this.seleBarData[this.index].open
|
||||
this.getlist()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user