xiaozy_当月动销
xiaozhiyong 2 years ago
parent 054f945b8a
commit 5ec7e9d36e
  1. 216
      api/sy.js
  2. 164
      salesRanking/page/enterpriseDetails/enterpriseDetails.vue

@ -2,109 +2,115 @@ import request from '@/utils/request'
const service_name = "oil-user" const service_name = "oil-user"
const group_name = "sysCustomerInfo" const group_name = "sysCustomerInfo"
export default { export default {
findOilSiteDesc (data) { findOilSiteDesc(data) {
return request({ return request({
url: `/oil-finance/oilOrderInfo/findOilSiteDesc`, url: `/oil-finance/oilOrderInfo/findOilSiteDesc`,
method: 'post', method: 'post',
data:data data: data
}) })
}, },
findCustomerName (data) { findCustomerName(data) {
return request({ return request({
url: `/oil-user/sysCustomerInfo/findCustomerName`, url: `/oil-user/sysCustomerInfo/findCustomerName`,
method: 'post', method: 'post',
data:data data: data
}) })
}, },
findSiteMovingPinVo (data) { findSiteMovingPinVo(data) {
return request({ return request({
url: `/oil-finance/oilOrderInfo/findSiteMovingPinVo`, url: `/oil-finance/oilOrderInfo/findSiteMovingPinVo`,
method: 'get', method: 'get',
params:data params: data
}) })
}, },
findEnterpriSemovingPinVo (data) { findEnterpriSemovingPinVo(data) {
return request({ return request({
url: `/oil-finance/oilOrderInfo/findEnterpriSemovingPinVo`, url: `/oil-finance/oilOrderInfo/findEnterpriSemovingPinVo`,
method: 'get', method: 'get',
params:data params: data
}) })
}, },
queryRechargeCompanyFiveDays (data) { queryRechargeCompanyFiveDays(data) {
return request({ return request({
url: `/oil-finance/oilCompanyAccountReverse/queryRechargeCompanyFiveDays`, url: `/oil-finance/oilCompanyAccountReverse/queryRechargeCompanyFiveDays`,
method: 'get', method: 'get',
params:data params: data
}) })
}, },
queryTheRevenueContributionOfGasStations (data) { queryTheRevenueContributionOfGasStations(data) {
return request({ return request({
url: `/oil-finance/oilOrderInfo/queryTheRevenueContributionOfGasStations`, url: `/oil-finance/oilOrderInfo/queryTheRevenueContributionOfGasStations`,
method: 'post', method: 'post',
data:data data: data
}) })
}, },
queryEnterpriseIncome (data) { queryEnterpriseIncome(data) {
return request({ return request({
url: `/oil-finance/oilOrderInfo/queryEnterpriseIncome`, url: `/oil-finance/oilOrderInfo/queryEnterpriseIncome`,
method: 'get', method: 'get',
params:data params: data
}) })
}, },
checkTheFiveDayRechargeAmount (data) { checkTheFiveDayRechargeAmount(data) {
return request({ return request({
url: `/oil-finance/siteChannelAccountReverse/checkTheFiveDayRechargeAmount`, url: `/oil-finance/siteChannelAccountReverse/checkTheFiveDayRechargeAmount`,
method: 'get', method: 'get',
params:data params: data
}) })
}, },
queryTheOrderOfTheEnterpriseGasStation (data) { queryTheOrderOfTheEnterpriseGasStation(data) {
return request({ return request({
url: `/oil-finance/oilOrderInfo/queryTheOrderOfTheEnterpriseGasStation`, url: `/oil-finance/oilOrderInfo/queryTheOrderOfTheEnterpriseGasStation`,
method: 'post', method: 'post',
data:data data: data
}) })
}, },
queryBusinessIncome (data) { queryBusinessIncome(data) {
return request({ return request({
url: `/oil-finance/oilOrderInfo/queryBusinessIncome`, url: `/oil-finance/oilOrderInfo/queryBusinessIncome`,
method: 'get', method: 'get',
params:data params: data
}) })
}, },
inquireAboutCorporateContributions (data) { inquireAboutCorporateContributions(data) {
return request({ return request({
url: `/oil-finance/oilOrderInfo/inquireAboutCorporateContributions`, url: `/oil-finance/oilOrderInfo/inquireAboutCorporateContributions`,
method: 'post', method: 'post',
data:data data: data
}) })
}, },
queryGasStationRechargeRecords (data) { queryGasStationRechargeRecords(data) {
return request({ return request({
url: `/oil-finance/siteChannelAccountReverse/queryGasStationRechargeRecords`, url: `/oil-finance/siteChannelAccountReverse/queryGasStationRechargeRecords`,
method: 'post', method: 'post',
data:data data: data
}) })
}, },
findEnterpriseRechargeRecord (data) { findEnterpriseRechargeRecord(data) {
return request({ return request({
url: `/oil-finance/oilCompanyAccountReverse/findEnterpriseRechargeRecord`, url: `/oil-finance/oilCompanyAccountReverse/findEnterpriseRechargeRecord`,
method: 'post', method: 'post',
data:data data: data
}) })
}, },
queryGasStationBusinessOrders (data) { queryGasStationBusinessOrders(data) {
return request({ return request({
url: `/oil-finance/oilOrderInfo/queryGasStationBusinessOrders`, url: `/oil-finance/oilOrderInfo/queryGasStationBusinessOrders`,
method: 'post', method: 'post',
data:data data: data
}) })
}, },
findEnterpriseDesc (data) { findEnterpriseDesc(data) {
return request({ return request({
url: `/oil-finance/oilOrderInfo/findEnterpriseDesc`, url: `/oil-finance/oilOrderInfo/findEnterpriseDesc`,
method: 'post', method: 'post',
data:data data: data
}) })
} },
findMonthlySiteMovingPinVo(id) {
return request({
url: `/oil-finance/oilOrderInfo/findMonthlySiteMovingPinVo?siteId=${id}`,
method: 'get'
})
}
} }

@ -4,14 +4,17 @@
<view class="flex jb ac"> <view class="flex jb ac">
<view> <view>
<view class="flex "> <view class="flex ">
<uni-icons v-if="routerIndex" color="#2866ff" custom-prefix="iconfont" type="iconjiayou" size="20"></uni-icons> <uni-icons v-if="routerIndex" color="#2866ff" custom-prefix="iconfont" type="iconjiayou"
<image v-if="!routerIndex" style="width: 60rpx; height: 60rpx;" src="../../../static/selegs.png"></image> size="20"></uni-icons>
<image v-if="!routerIndex" style="width: 60rpx; height: 60rpx;"
src="../../../static/selegs.png"></image>
<view class="header_text_left"> <view class="header_text_left">
<view class="text_ov">{{routerIndex?dedata.siteName:dedata.companyName}}</view> <view class="text_ov">{{routerIndex?dedata.siteName:dedata.companyName}}</view>
<view class="small_text text_ov ">{{dedata.id}}</view> <view class="small_text text_ov ">{{dedata.id}}</view>
</view> </view>
<view v-if="!routerIndex" :style="{background:dedata.parentMark=='0'?'':'#BC853B'}" class="list_item_tip"> <view v-if="!routerIndex" :style="{background:dedata.parentMark=='0'?'':'#BC853B'}"
{{dedata.parentMark=='0'?'总公司':'子公司'}} class="list_item_tip">
{{dedata.parentMark=='0'?'总公司':'子公司'}}
</view> </view>
</view> </view>
<view class="flex header_text_top "> <view class="flex header_text_top ">
@ -24,10 +27,11 @@
</view> </view>
</view> </view>
<view v-if="routerIndex" class="t-icon"> <view v-if="routerIndex" class="t-icon">
<image style="width: 100%;height: 100%;" :src="dedata.siteImages?dedata.siteImages: '../../../static/selegs.png' " mode=""></image> <image style="width: 100%;height: 100%;"
:src="dedata.siteImages?dedata.siteImages: '../../../static/selegs.png' " mode=""></image>
</view> </view>
</view> </view>
<view @click="jump(2)" class="account"> <view @click="jump(2)" class="account" v-if="detailsData">
<view class="yuan"></view> <view class="yuan"></view>
<view> <view>
<view style="text-align: center;">账户余额</view> <view style="text-align: center;">账户余额</view>
@ -50,14 +54,14 @@
<view class="chart_scoll"> <view class="chart_scoll">
<swiper @change="swiperChange" :current='chartSeleIndex' class="swiper" :interval="1000" <swiper @change="swiperChange" :current='chartSeleIndex' class="swiper" :interval="1000"
:duration="1000"> :duration="1000">
<swiper-item @tap.stop=''> <!-- <swiper-item @tap.stop=''>
<view class="swiper-item"> <view class="swiper-item">
<view style="height:75%;"> <view style="height:75%;">
<qiunDataCharts :canvas2d='true' canvasId='canvasIdw' inScrollView="true" type="area" <qiunDataCharts :canvas2d='true' canvasId='canvasIdw' inScrollView="true" type="area"
:opts="{extra:{area:{type:'curve',addLine:true,gradient:true}}}" :opts="{extra:{area:{type:'curve',addLine:true,gradient:true}}}"
:chartData="Line" /> :chartData="Line" />
</view> </view>
<view <view v-if="detailsData"
style="height: 25%; display: flex; justify-content: space-around; align-items: center;"> style="height: 25%; display: flex; justify-content: space-around; align-items: center;">
<view class="swiper-item_table">今日</view> <view class="swiper-item_table">今日</view>
<view> <text class="numberoli">{{detailsData.todaySalesRose.toFixed(2)}}</text> L</view> <view> <text class="numberoli">{{detailsData.todaySalesRose.toFixed(2)}}</text> L</view>
@ -72,21 +76,42 @@
:opts="{extra:{area:{type:'curve',addLine:true,gradient:true}}}" :opts="{extra:{area:{type:'curve',addLine:true,gradient:true}}}"
:chartData="LineTwo" /> :chartData="LineTwo" />
</view> </view>
<view <view v-if="chartsData"
style="height: 25%; display: flex; justify-content: space-around; align-items: center;"> style="height: 25%; display: flex; justify-content: space-around; align-items: center;">
<view class="swiper-item_table">今日</view> <view class="swiper-item_table">今日</view>
<!-- <view> <text class="numberoli">2987.5</text> L</view> --> <view> <text class="numberoli">{{chartsData.rechargeAmountOnTheDay|price}}</text>
<view> <text class="numberoli">{{chartsData.rechargeAmountOnTheDay|price}}</text> </view> </view>
</view> </view>
</view> </view>
</swiper-item> -->
<swiper-item>
</swiper-item> </swiper-item>
</swiper> </swiper>
<!-- <view style="height: 70%;width: 100%; padding: 20rpx 0;"> <!-- <view style="height: 70%;width: 100%; padding: 20rpx 0;">
<qiun-data-charts type="area" :opts="{extra:{area:{type:'curve',addLine:true,gradient:true}}}" :chartData="Line" /> <qiun-data-charts type="area" :opts="{extra:{area:{type:'curve',addLine:true,gradient:true}}}" :chartData="Line" />
</view> --> </view> -->
</view> </view>
<view class="swiper-item">
<view style="height:75%;">
<qiunDataCharts :canvas2d='true' canvasId='canvasIdt' inScrollView="true" type="area"
:opts="{extra:{area:{type:'curve',addLine:true,gradient:true}}}"
:chartData="oneMonthLine" />
</view>
<view
style="height: 25%; display: flex; justify-content: space-around; align-items: center;">
<view class="swiper-item_table">今日</view>
<view> <text class="numberoli">{{}}</text> L</view>
<view> <text class="numberoli">{{}}</text> </view>
</view>
</view>
<view class="footer"> <view class="footer">
<view @click="ishowFn()" class="footer_title">{{dedata.startTime|timeProcessing}} - <view @click="ishowFn()" class="footer_title" v-if="dedata">{{dedata.startTime|timeProcessing}} -
{{dedata.endTime|timeProcessing}} {{dedata.endTime|timeProcessing}}
</view> </view>
<view @click="jump(1)" class="footer_item"> <view @click="jump(1)" class="footer_item">
@ -131,7 +156,7 @@
}, },
data() { data() {
return { return {
routerIndex:true, routerIndex: true,
enterpriseData: null, enterpriseData: null,
isShow: { isShow: {
date: false date: false
@ -147,14 +172,17 @@
}, { }, {
lable: '近五次充值', lable: '近五次充值',
value: 1 value: 1
},{
lable: '近一月动销',
value: 2
}], }],
chartSeleIndex: 0, chartSeleIndex: 0,
Line: {}, Line: {},
LineTwo: {} LineTwo: {},
oneMonthLine:{}
} }
}, },
onLoad(e) { onLoad(e) {
console.log(e)
let routes = getCurrentPages(); let routes = getCurrentPages();
let routerIndex = routes[(routes.length - 2)].$page.fullPath.indexOf('?') != -1 ? let routerIndex = routes[(routes.length - 2)].$page.fullPath.indexOf('?') != -1 ?
@ -162,30 +190,28 @@
.$page.fullPath.split('?')[0].split('/').length - 1] : .$page.fullPath.split('?')[0].split('/').length - 1] :
routes[(routes.length - 2)].$page.fullPath.split('/')[routes[(routes.length - 2)].$page routes[(routes.length - 2)].$page.fullPath.split('/')[routes[(routes.length - 2)].$page
.fullPath.split('/').length - 1]; .fullPath.split('/').length - 1];
this.routerIndex= routerIndex =='enterpriseIndex'?false:true; //
console.log(routerIndex) this.routerIndex = routerIndex == 'enterpriseIndex' ? false : true;
console.log(this.routerIndex) if (e.jsData) {
if (e.jsData) { this.dedata = JSON.parse(e.jsData);
this.dedata = JSON.parse(e.jsData); this.getdata(JSON.parse(e.jsData));
this.getdata(JSON.parse(e.jsData)); }
}
}, },
filters:{ filters: {
timeProcessing(e){ timeProcessing(e) {
return e?e.split(' ')[0]:e return e ? e.split(' ')[0] : e
}, },
price(e=0.00){ price(e = 0.00) {
// if(!e) e=0.00;
return convertW.convertW(e) return convertW.convertW(e)
}, },
distinguish(e){ distinguish(e) {
return this.routerIndex ?e.siteName:e.companyName return this.routerIndex ? e.siteName : e.companyName
} }
}, },
methods: { methods: {
datePopupChange(e) { datePopupChange(e) {
sy[(this.routerIndex ? 'queryBusinessIncome':'queryEnterpriseIncome')]({ sy[(this.routerIndex ? 'queryBusinessIncome' : 'queryEnterpriseIncome')]({
[((this.routerIndex ? 'siteId':'companyId'))]: this.dedata.id, [((this.routerIndex ? 'siteId' : 'companyId'))]: this.dedata.id,
endTime: e[1], endTime: e[1],
startTime: e[0] startTime: e[0]
}).then(res => { }).then(res => {
@ -204,13 +230,13 @@
}, },
getdata(e) { getdata(e) {
sy[(this.routerIndex ? 'findSiteMovingPinVo':'findEnterpriSemovingPinVo')]({ sy[(this.routerIndex ? 'findSiteMovingPinVo' : 'findEnterpriSemovingPinVo')]({
[((this.routerIndex ? 'siteId':'companyId'))]:e.id [((this.routerIndex ? 'siteId' : 'companyId'))]: e.id
}).then(res => { }).then(res => {
if (res.code !== 20000) return if (res.code !== 20000) return
this.detailsData = res.data this.detailsData = res.data
let arr = [] let arr = []
this.detailsData.createTime.forEach((item,index) => { this.detailsData.createTime.forEach((item, index) => {
arr.push(`${item.split('-')[1]}/${item.split('-')[2]}`) arr.push(`${item.split('-')[1]}/${item.split('-')[2]}`)
this.detailsData.money[index] = this.detailsData.money[index].toFixed(2) this.detailsData.money[index] = this.detailsData.money[index].toFixed(2)
}) })
@ -222,12 +248,12 @@
}] }]
} }
}) })
sy[(this.routerIndex ? 'checkTheFiveDayRechargeAmount':'queryRechargeCompanyFiveDays')]({ sy[(this.routerIndex ? 'checkTheFiveDayRechargeAmount' : 'queryRechargeCompanyFiveDays')]({
[((this.routerIndex ? 'siteId':'companyId'))]:e.id [((this.routerIndex ? 'siteId' : 'companyId'))]: e.id
}).then(res => { }).then(res => {
this.chartsData = res.data this.chartsData = res.data
let arrtwo = [] let arrtwo = []
res.data.createTime.forEach((item,index) => { res.data.createTime.forEach((item, index) => {
arrtwo.push(`${item.split('-')[1]}/${item.split('-')[2]}`) arrtwo.push(`${item.split('-')[1]}/${item.split('-')[2]}`)
res.data.money[index] = res.data.money[index].toFixed(2) res.data.money[index] = res.data.money[index].toFixed(2)
}) })
@ -238,11 +264,11 @@
data: res.data.money data: res.data.money
}] }]
} }
}).catch(e=>{ }).catch(e => {
console.log(e,'///') console.log(e, '///')
}) })
sy[(this.routerIndex ? 'queryBusinessIncome':'queryEnterpriseIncome')]({ sy[(this.routerIndex ? 'queryBusinessIncome' : 'queryEnterpriseIncome')]({
[((this.routerIndex ? 'siteId':'companyId'))]: e.id, [((this.routerIndex ? 'siteId' : 'companyId'))]: e.id,
endTime: e.endTime, endTime: e.endTime,
startTime: e.startTime startTime: e.startTime
}).then(res => { }).then(res => {
@ -251,26 +277,46 @@
this.quantity = res.data.orderNumber this.quantity = res.data.orderNumber
console.log(res, '收入') console.log(res, '收入')
}) })
if(this.routerIndex) {
//
sy.findMonthlySiteMovingPinVo(e.id).then(res => {
let dateArr = []
let moneyArr = []
res.data.siteMovingPins.forEach(item => {
let date = item.createTime.split('-')
dateArr.push(`${date[1]}-${date[2]}`)
moneyArr.push(item.money.toFixed(2))
})
this.oneMonthLine = {
categories: dateArr,
series: [{
name: "金额",
data: moneyArr
}]
}
})
}
}, },
jump(e) { jump(e) {
this.dedata.routerIndex=this.routerIndex; this.dedata.routerIndex = this.routerIndex;
switch (e) { switch (e) {
case 1: case 1:
uni.navigateTo({ uni.navigateTo({
url: '../contribution/contribution?jsData=' + JSON.stringify(Object.assign(this url: '../contribution/contribution?jsData=' + JSON.stringify(Object.assign(this
.dedata, { .dedata, {
liters: this.enterpriseData.liters, liters: this.enterpriseData.liters,
enterpriseContributionAmount: this.enterpriseData.enterpriseContributionAmount, enterpriseContributionAmount: this.enterpriseData
...this.detailsData .enterpriseContributionAmount,
...this.detailsData
})) }))
}) })
break; break;
case 2: case 2:
console.log(this.dedata,'rechargeRecordrechargeRecordrechargeRecordrechargeRecord') console.log(this.dedata, 'rechargeRecordrechargeRecordrechargeRecordrechargeRecord')
uni.navigateTo({ uni.navigateTo({
url: '../rechargeRecord/rechargeRecord?jsData=' + JSON.stringify(Object.assign(this url: '../rechargeRecord/rechargeRecord?jsData=' + JSON.stringify(Object.assign(this
.dedata, { .dedata, {
routerIndex:this.routerIndex, routerIndex: this.routerIndex,
gasStationBalance: this.detailsData.gasStationBalance, gasStationBalance: this.detailsData.gasStationBalance,
amountYesterday: this.detailsData.amountYesterday, amountYesterday: this.detailsData.amountYesterday,
...this.detailsData ...this.detailsData
@ -298,15 +344,17 @@
<style scoped> <style scoped>
@import url("./enterpriseDetails.css"); @import url("./enterpriseDetails.css");
.list_item_tip{
padding: 11rpx 14rpx; .list_item_tip {
background-color:#9F43CC; padding: 11rpx 14rpx;
color: #FFFFFF; background-color: #9F43CC;
font-size: 16rpx; color: #FFFFFF;
width: fit-content; font-size: 16rpx;
margin: 0 auto; width: fit-content;
height: fit-content; margin: 0 auto;
} height: fit-content;
}
.t-icon { .t-icon {
width: 95rpx !important; width: 95rpx !important;
height: 95rpx !important; height: 95rpx !important;

Loading…
Cancel
Save