diff --git a/api/sy.js b/api/sy.js index e228179..a324999 100644 --- a/api/sy.js +++ b/api/sy.js @@ -2,123 +2,129 @@ import request from '@/utils/request' const service_name = "oil-user" const group_name = "sysCustomerInfo" export default { - findOilSiteDesc (data) { - return request({ - url: `/oil-finance/oilOrderInfo/findOilSiteDesc`, - method: 'post', - data:data - }) - }, - findCustomerName (data) { - return request({ - url: `/oil-user/sysCustomerInfo/findCustomerName`, - method: 'post', - data:data - }) - }, - findSiteMovingPinVo (data) { - return request({ - url: `/oil-finance/oilOrderInfo/findSiteMovingPinVo`, - method: 'get', - params:data - }) - }, - findEnterpriSemovingPinVo (data) { - return request({ - url: `/oil-finance/oilOrderInfo/findEnterpriSemovingPinVo`, - method: 'get', - params:data - }) - }, - queryRechargeCompanyFiveDays (data) { - return request({ - url: `/oil-finance/oilCompanyAccountReverse/queryRechargeCompanyFiveDays`, - method: 'get', - params:data - }) - }, - queryTheRevenueContributionOfGasStations (data) { - return request({ - url: `/oil-finance/oilOrderInfo/queryTheRevenueContributionOfGasStations`, - method: 'post', - data:data - }) - }, - queryEnterpriseIncome (data) { - return request({ - url: `/oil-finance/oilOrderInfo/queryEnterpriseIncome`, - method: 'get', - params:data - }) - }, - checkTheFiveDayRechargeAmount (data) { - return request({ - url: `/oil-finance/siteChannelAccountReverse/checkTheFiveDayRechargeAmount`, - method: 'get', - params:data - }) - }, - queryTheOrderOfTheEnterpriseGasStation (data) { - return request({ - url: `/oil-finance/oilOrderInfo/queryTheOrderOfTheEnterpriseGasStation`, - method: 'post', - data:data - }) - }, - queryBusinessIncome (data) { - return request({ - url: `/oil-finance/oilOrderInfo/queryBusinessIncome`, - method: 'get', - params:data - }) - }, - inquireAboutCorporateContributions (data) { - return request({ - url: `/oil-finance/oilOrderInfo/inquireAboutCorporateContributions`, - method: 'post', - data:data - }) - }, - queryGasStationRechargeRecords (data) { - return request({ - url: `/oil-finance/siteChannelAccountReverse/queryGasStationRechargeRecords`, - method: 'post', - data:data - }) - }, - findEnterpriseRechargeRecord (data) { - return request({ - url: `/oil-finance/oilCompanyAccountReverse/findEnterpriseRechargeRecord`, - method: 'post', - data:data - }) - }, - queryGasStationBusinessOrders (data) { - return request({ - url: `/oil-finance/oilOrderInfo/queryGasStationBusinessOrders`, - method: 'post', - data:data - }) - }, - findEnterpriseDesc (data) { - return request({ - url: `/oil-finance/oilOrderInfo/findEnterpriseDesc`, - method: 'post', - data:data - }) - }, - getDistributeCount (data) { - return request({ - url: `/oil-finance/oilCompanyAccountReverse/getDistributeCount`, - method: 'post', - data:data - }) - }, - distributeGetByPage(data) { - return request({ - url: `/oil-finance/oilCompanyDistributeReverse/getByPage`, - method: 'post', - data: data - }) - } + findOilSiteDesc(data) { + return request({ + url: `/oil-finance/oilOrderInfo/findOilSiteDesc`, + method: 'post', + data: data + }) + }, + findCustomerName(data) { + return request({ + url: `/oil-user/sysCustomerInfo/findCustomerName`, + method: 'post', + data: data + }) + }, + findSiteMovingPinVo(data) { + return request({ + url: `/oil-finance/oilOrderInfo/findSiteMovingPinVo`, + method: 'get', + params: data + }) + }, + findEnterpriSemovingPinVo(data) { + return request({ + url: `/oil-finance/oilOrderInfo/findEnterpriSemovingPinVo`, + method: 'get', + params: data + }) + }, + queryRechargeCompanyFiveDays(data) { + return request({ + url: `/oil-finance/oilCompanyAccountReverse/queryRechargeCompanyFiveDays`, + method: 'get', + params: data + }) + }, + queryTheRevenueContributionOfGasStations(data) { + return request({ + url: `/oil-finance/oilOrderInfo/queryTheRevenueContributionOfGasStations`, + method: 'post', + data: data + }) + }, + queryEnterpriseIncome(data) { + return request({ + url: `/oil-finance/oilOrderInfo/queryEnterpriseIncome`, + method: 'get', + params: data + }) + }, + checkTheFiveDayRechargeAmount(data) { + return request({ + url: `/oil-finance/siteChannelAccountReverse/checkTheFiveDayRechargeAmount`, + method: 'get', + params: data + }) + }, + queryTheOrderOfTheEnterpriseGasStation(data) { + return request({ + url: `/oil-finance/oilOrderInfo/queryTheOrderOfTheEnterpriseGasStation`, + method: 'post', + data: data + }) + }, + queryBusinessIncome(data) { + return request({ + url: `/oil-finance/oilOrderInfo/queryBusinessIncome`, + method: 'get', + params: data + }) + }, + inquireAboutCorporateContributions(data) { + return request({ + url: `/oil-finance/oilOrderInfo/inquireAboutCorporateContributions`, + method: 'post', + data: data + }) + }, + queryGasStationRechargeRecords(data) { + return request({ + url: `/oil-finance/siteChannelAccountReverse/queryGasStationRechargeRecords`, + method: 'post', + data: data + }) + }, + findEnterpriseRechargeRecord(data) { + return request({ + url: `/oil-finance/oilCompanyAccountReverse/findEnterpriseRechargeRecord`, + method: 'post', + data: data + }) + }, + queryGasStationBusinessOrders(data) { + return request({ + url: `/oil-finance/oilOrderInfo/queryGasStationBusinessOrders`, + method: 'post', + data: data + }) + }, + findEnterpriseDesc(data) { + return request({ + url: `/oil-finance/oilOrderInfo/findEnterpriseDesc`, + method: 'post', + data: data + }) + }, + findMonthlySiteMovingPinVo(id) { + return request({ + url: `/oil-finance/oilOrderInfo/findMonthlySiteMovingPinVo?siteId=${id}`, + method: 'get' + }) + }, + getDistributeCount (data) { + return request({ + url: `/oil-finance/oilCompanyAccountReverse/getDistributeCount`, + method: 'post', + data:data + }) + }, + distributeGetByPage(data) { + return request({ + url: `/oil-finance/oilCompanyDistributeReverse/getByPage`, + method: 'post', + data: data + }) + } } diff --git a/salesRanking/page/enterpriseDetails/enterpriseDetails.vue b/salesRanking/page/enterpriseDetails/enterpriseDetails.vue index 5fa87cc..a82aa69 100644 --- a/salesRanking/page/enterpriseDetails/enterpriseDetails.vue +++ b/salesRanking/page/enterpriseDetails/enterpriseDetails.vue @@ -4,14 +4,17 @@ - - + + {{routerIndex?dedata.siteName:dedata.companyName}} - {{dedata.id}} + {{dedata.id}} - - {{dedata.parentMark=='0'?'总公司':'子公司'}} + + {{dedata.parentMark=='0'?'总公司':'子公司'}} @@ -24,10 +27,11 @@ - + - + - - - - - - - - 今日 - {{detailsData.todaySalesRose.toFixed(2)}} L - {{detailsData.siteDayBalance|price}} - + + + + + + 今日 + {{detailsData.todaySalesRose.toFixed(2)}} L + {{detailsData.siteDayBalance|price}} + + + + + + + + 今日 + {{chartsData.rechargeAmountOnTheDay|price}} - - - - - - - - 今日 - - {{chartsData.rechargeAmountOnTheDay|price}} - + + + + + + + + 今日 + {{oneMonthData.todaySalesRose.toFixed(2)}} L - - - + {{oneMonthData.siteDayBalance|price}} + + + - {{dedata.startTime|timeProcessing}} - + {{dedata.startTime|timeProcessing}} - {{dedata.endTime|timeProcessing}} @@ -155,16 +162,17 @@ }, data() { return { - routerIndex:true, + routerIndex: true, enterpriseData: null, isShow: { date: false }, dedata: null, chartsData: null, + detailsData: null, + oneMonthData: null, income: 0, quantity: 0, - detailsData: null, chartSeleBarData: [{ lable: '近五日动销', value: 0 @@ -175,43 +183,46 @@ chartSeleIndex: 0, Line: {}, LineTwo: {}, + oneMonthLine: {}, distributeData:{}, totalAmount:0, outTotalAmount:0 } }, onLoad(e) { - + let routes = getCurrentPages(); let routerIndex = routes[(routes.length - 2)].$page.fullPath.indexOf('?') != -1 ? routes[(routes.length - 2)].$page.fullPath.split('?')[0].split('/')[routes[(routes.length - 2)] .$page.fullPath.split('?')[0].split('/').length - 1] : routes[(routes.length - 2)].$page.fullPath.split('/')[routes[(routes.length - 2)].$page .fullPath.split('/').length - 1]; - this.routerIndex= routerIndex =='enterpriseIndex'?false:true; - if (e.jsData) { - this.dedata = JSON.parse(e.jsData); - this.getdata(JSON.parse(e.jsData)); - this.getDistributeCount(JSON.parse(e.jsData)) - } + // 仅用于判断是从油站动销还是企业动销跳入 + this.routerIndex = routerIndex == 'enterpriseIndex' ? false : true; + if (e.jsData) { + this.dedata = JSON.parse(e.jsData); + this.getdata(JSON.parse(e.jsData)); + } }, - filters:{ - timeProcessing(e){ - return e?e.split(' ')[0]:e + filters: { + timeProcessing(e) { + return e ? e.split(' ')[0] : e }, - price(e=0.00){ - // if(!e) e=0.00; + price(e = 0.00) { return convertW.convertW(e) }, - distinguish(e){ - return this.routerIndex ?e.siteName:e.companyName + distinguish(e) { + return this.routerIndex ? e.siteName : e.companyName } }, methods: { + getTouchMove(e) { + // console.log('e',e) + }, datePopupChange(e) { - sy[(this.routerIndex ? 'queryBusinessIncome':'queryEnterpriseIncome')]({ - [((this.routerIndex ? 'siteId':'companyId'))]: this.dedata.id, - endTime: e[1].split(' ')[0]+' 23:59:59', + sy[(this.routerIndex ? 'queryBusinessIncome' : 'queryEnterpriseIncome')]({ + [((this.routerIndex ? 'siteId' : 'companyId'))]: this.dedata.id, + endTime: e[1], startTime: e[0] }).then(res => { this.enterpriseData = res.data @@ -231,9 +242,9 @@ this.outTotalAmount = res.data.outTotalAmount ==null ? 0 : res.data.outTotalAmount }) } - - - + + + }, ishowFn() { this.isShow.date = true @@ -242,13 +253,13 @@ }, getdata(e) { - sy[(this.routerIndex ? 'findSiteMovingPinVo':'findEnterpriSemovingPinVo')]({ - [((this.routerIndex ? 'siteId':'companyId'))]:e.id + sy[(this.routerIndex ? 'findSiteMovingPinVo' : 'findEnterpriSemovingPinVo')]({ + [((this.routerIndex ? 'siteId' : 'companyId'))]: e.id }).then(res => { if (res.code !== 20000) return this.detailsData = res.data let arr = [] - this.detailsData.createTime.forEach((item,index) => { + this.detailsData.createTime.forEach((item, index) => { arr.push(`${item.split('-')[1]}/${item.split('-')[2]}`) this.detailsData.money[index] = this.detailsData.money[index].toFixed(2) }) @@ -260,12 +271,12 @@ }] } }) - sy[(this.routerIndex ? 'checkTheFiveDayRechargeAmount':'queryRechargeCompanyFiveDays')]({ - [((this.routerIndex ? 'siteId':'companyId'))]:e.id + sy[(this.routerIndex ? 'checkTheFiveDayRechargeAmount' : 'queryRechargeCompanyFiveDays')]({ + [((this.routerIndex ? 'siteId' : 'companyId'))]: e.id }).then(res => { this.chartsData = res.data let arrtwo = [] - res.data.createTime.forEach((item,index) => { + res.data.createTime.forEach((item, index) => { arrtwo.push(`${item.split('-')[1]}/${item.split('-')[2]}`) res.data.money[index] = res.data.money[index].toFixed(2) }) @@ -276,10 +287,11 @@ data: res.data.money }] } - }).catch(e=>{ + }).catch(e => { + console.log(e, '///') }) - sy[(this.routerIndex ? 'queryBusinessIncome':'queryEnterpriseIncome')]({ - [((this.routerIndex ? 'siteId':'companyId'))]: e.id, + sy[(this.routerIndex ? 'queryBusinessIncome' : 'queryEnterpriseIncome')]({ + [((this.routerIndex ? 'siteId' : 'companyId'))]: e.id, endTime: e.endTime, startTime: e.startTime }).then(res => { @@ -298,17 +310,44 @@ this.totalAmount = res.data.totalAmount ==null ? 0 : res.data.totalAmount this.outTotalAmount = res.data.outTotalAmount ==null ? 0 : res.data.outTotalAmount }) + if (this.routerIndex) { + this.chartSeleBarData.push({ + lable: '当月动销', + value: 2 + }) + // 近一个月动销 仅油站动销展示 + 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]}`) + let money = (item.money + '').includes('.') ? item.money.toFixed(2) : item + .money + moneyArr.push(money) + }) + this.oneMonthData = res.data + this.oneMonthLine = { + categories: dateArr, + series: [{ + name: "金额", + data: moneyArr + }] + } + }) + } }, jump(e) { - this.dedata.routerIndex=this.routerIndex; + this.dedata.routerIndex = this.routerIndex; switch (e) { case 1: uni.navigateTo({ url: '../contribution/contribution?jsData=' + JSON.stringify(Object.assign(this .dedata, { - liters: this.enterpriseData.liters, - enterpriseContributionAmount: this.enterpriseData.enterpriseContributionAmount, - ...this.detailsData + liters: this.enterpriseData.liters, + enterpriseContributionAmount: this.enterpriseData + .enterpriseContributionAmount, + ...this.detailsData })) }) break; @@ -316,7 +355,7 @@ uni.navigateTo({ url: '../rechargeRecord/rechargeRecord?jsData=' + JSON.stringify(Object.assign(this .dedata, { - routerIndex:this.routerIndex, + routerIndex: this.routerIndex, gasStationBalance: this.detailsData.gasStationBalance, amountYesterday: this.detailsData.amountYesterday, ...this.detailsData @@ -345,7 +384,7 @@ }, swiperChange(e) { - this.chartSeleIndex = e.detail.current + // this.chartSeleIndex = e.detail.current }, chartSeleBarFn(item, index) { this.chartSeleIndex = index @@ -356,15 +395,21 @@