This commit is contained in:
ylj20011123 2026-01-09 13:41:48 +08:00
parent b1939995a9
commit abde28cc4d
3 changed files with 125 additions and 104 deletions

View File

@ -122,7 +122,7 @@
</div> </div>
<div class="uni-flex jc-between"> <div class="uni-flex jc-between">
<div style="margin-bottom: 0;"><span style="font-size: 32rpx;">{{ operationModel[0].data <div style="margin-bottom: 0;"><span style="font-size: 32rpx;">{{ operationModel[0].data
}}</span> }}</span>
</div> </div>
<div style="margin-bottom: 0;" v-if="operationModel[1].data"><span <div style="margin-bottom: 0;" v-if="operationModel[1].data"><span
style="font-size: 32rpx;">{{ style="font-size: 32rpx;">{{
@ -166,23 +166,22 @@
<noFound :nodata="'true'" :text="noDataText" /> <noFound :nodata="'true'" :text="noDataText" />
</view> </view>
<cover-view class="uni-mask" :style="showUnUpLoad ? ' display:block;' : 'opacity:0; display: none;'" <view class="uni-mask" :style="showUnUpLoad ? ' display:block;' : 'opacity:0; display: none;'" @click="closePop"
@click="closePop" :catchtouchmove="showUnUpLoad ? 'return' : ''"></cover-view> :catchtouchmove="showUnUpLoad ? 'return' : ''"></view>
<cover-view class="uni-popup uni-popup-middle" :style="showUnUpLoad ? 'display:flex;' : 'display: none;'" <view class="uni-popup uni-popup-middle" :style="showUnUpLoad ? 'display:flex;' : 'display: none;'"
:catchtouchmove="showUnUpLoad ? 'return' : ''"> :catchtouchmove="showUnUpLoad ? 'return' : ''">
<cover-view class="header-top" v-if="unUploadList.length > 0">{{ sMsg.serverpartname }}未上传门店</cover-view> <view class="header-top" v-if="unUploadList.length > 0">{{ sMsg.serverpartname }}未上传门店</view>
<cover-view class="pop-body"> <view class="pop-body">
<cover-view class="uni-flex pop-row" v-for="(c, i) in unUploadList" :key="i"> <view class="uni-flex pop-row" v-for="(c, i) in unUploadList" :key="i">
<cover-view class="uni-flex ai-center"> <view class="uni-flex ai-center">
<cover-view class="pop-index">{{ i > 8 ? i + 1 : '0' + (i + 1) }}</cover-view> <view class="popIndex">{{ i > 8 ? i + 1 : '0' + (i + 1) }}</view>
<cover-view class="inline-item">{{ c.ServerpartShop_Name }}</cover-view> <view class="inline-item">{{ c.ServerpartShop_Name }}</view>
</cover-view> </view>
<cover-view class="pop-row-bottom"></cover-view> <!-- <cover-view class="pop-row-bottom"></cover-view> -->
</cover-view> </view>
</cover-view> </view>
</view>
</cover-view>
</view> </view>
</template> </template>
@ -632,6 +631,7 @@ export default {
this.sMsg = totalData this.sMsg = totalData
// //
const [progressList, pieList] = this.getProgressData(busniessTypePie, totalData.cashPay) const [progressList, pieList] = this.getProgressData(busniessTypePie, totalData.cashPay)
console.log('progressListprogressListprogressList', progressList);
this.operationModel = progressList this.operationModel = progressList
// //
@ -672,8 +672,8 @@ export default {
_data2.push({ _data2.push({
name: n.name, name: n.name,
num: n.data, num: n.data,
data: _this.$util.fmoney(n.data, 2), //+Number(data2[n[0]]) data: n.data ? _this.$util.fmoney(n.data, 2) : "", //+Number(data2[n[0]])
bili: _this.$util.fmoney((n.data / total) * 100, 2) bili: total ? _this.$util.fmoney((n.data / total) * 100, 2) : ""
}); });
}); });
@ -698,6 +698,8 @@ export default {
} }
let _data = res.Result_Data let _data = res.Result_Data
_this.unUploadList = _data.List _this.unUploadList = _data.List
console.log('_this.unUploadList_this.unUploadList', _this.unUploadList);
}) })
}, },
}, },
@ -1247,7 +1249,7 @@ cover-view.page-title {
left: 0; left: 0;
} }
.pop-index { .popIndex {
color: #fff; color: #fff;
background: linear-gradient(135deg, #27B25F, #4CCC7F); background: linear-gradient(135deg, #27B25F, #4CCC7F);
border-radius: 12rpx; border-radius: 12rpx;

View File

@ -1,6 +1,6 @@
import request from '@/util/index.js' import request from '@/util/index.js'
const methods = { const methods = {
async getData(obj,isServerPartDetail) { // 获取远程数据 async getData(obj, isServerPartDetail) { // 获取远程数据
let _this = this let _this = this
/* ts /* ts
type serverpartRegion = { type serverpartRegion = {
@ -14,21 +14,21 @@ const methods = {
} }
*/ */
// let regionList = [] // 营收上传列表 reginListModel[] // let regionList = [] // 营收上传列表 reginListModel[]
this.groupType = obj.GroupType this.groupType = obj.GroupType
const requestParamas = { const requestParamas = {
Statistics_Date: obj.time , Statistics_Date: obj.time,
Statistics_Month: obj.month , Statistics_Month: obj.month,
Province_Code: obj.ProvinceCode , Province_Code: obj.ProvinceCode,
pushProvinceCode: obj.ProvinceCode , pushProvinceCode: obj.ProvinceCode,
Serverpart_ID: obj.GroupType != 1020 ? obj.ServerpartIds : '', Serverpart_ID: obj.GroupType != 1020 ? obj.ServerpartIds : '',
SPRegionType_ID: obj.GroupType == 1020 ? obj.ServerpartIds : '', SPRegionType_ID: obj.GroupType == 1020 ? obj.ServerpartIds : '',
// Revenue_Include: 1 // Revenue_Include: 1
} }
const requestParamasBudget = { const requestParamasBudget = {
Statistics_Date: obj.time , Statistics_Date: obj.time,
Statistics_Month: obj.month , Statistics_Month: obj.month,
Province_Code: obj.ProvinceCode , Province_Code: obj.ProvinceCode,
pushProvinceCode: obj.ProvinceCode , pushProvinceCode: obj.ProvinceCode,
Serverpart_ID: obj.ServerpartIds ? obj.ServerpartIds : '' Serverpart_ID: obj.ServerpartIds ? obj.ServerpartIds : ''
} }
this.provinceCode = obj.ProvinceCode this.provinceCode = obj.ProvinceCode
@ -36,6 +36,17 @@ const methods = {
const data = await request.$webGet('CommercialApi/Revenue/GetRevenuePushList', requestParamas) const data = await request.$webGet('CommercialApi/Revenue/GetRevenuePushList', requestParamas)
if (data.Result_Code != 100) return if (data.Result_Code != 100) return
// 处理一下数据 云南长短款只计算自营的 那么就是data 的营收数据 只拿自营的即可
let newData = []
if (data.Result_Data.List && data.Result_Data.List.length > 0) {
data.Result_Data.List.forEach((item) => {
if (item.Business_TypeName === '自营') {
newData.push(item)
}
})
}
// 在营门店数量统计 // 在营门店数量统计
const busniessCounts = await request.$webGet('CommercialApi/BaseInfo/GetShopCountList', requestParamas) const busniessCounts = await request.$webGet('CommercialApi/BaseInfo/GetShopCountList', requestParamas)
if (busniessCounts.Result_Code != 100) return if (busniessCounts.Result_Code != 100) return
@ -61,16 +72,17 @@ const methods = {
if (bayonetCount.Result_Code != 100) return if (bayonetCount.Result_Code != 100) return
if (isServerPartDetail) { // 是服务区营收推送页面 if (isServerPartDetail) { // 是服务区营收推送页面
return _this.getSeverpartReginList(data.Result_Data.List, busniessCounts.Result_Data.List, return _this.getSeverpartReginList(newData, busniessCounts.Result_Data.List,
tradeData.Result_Data.List, budgetAmount.Result_Data.List) tradeData.Result_Data.List, budgetAmount.Result_Data.List)
} }
return _this.getReginList(data.Result_Data.List, busniessCounts.Result_Data.List,
return _this.getReginList(newData, busniessCounts.Result_Data.List,
tradeData.Result_Data.List, budgetAmount.Result_Data.List, tradeData.Result_Data.List, budgetAmount.Result_Data.List,
bayonetCount.Result_Data.List, mobileShare.Result_Data, mallDeliver.Result_Data) bayonetCount.Result_Data.List, mobileShare.Result_Data, mallDeliver.Result_Data)
// [reginList, totalData, busniessTypePie, busniessTradePie] // [reginList, totalData, busniessTypePie, busniessTradePie]
}, },
getTotalShowData(newData, oldData,index) { getTotalShowData(newData, oldData, index) {
// <TotalModel> // <TotalModel>
/* /*
type TotalModel = { type TotalModel = {
@ -84,22 +96,22 @@ const methods = {
} }
*/ */
if (index>0) { if (index > 0) {
oldData.ticketCount += newData.TicketCount oldData.ticketCount += newData.TicketCount
oldData.totalCount += newData.TotalCount oldData.totalCount += newData.TotalCount
oldData.totalOffAmount += newData.TotalOffAmount oldData.totalOffAmount += newData.TotalOffAmount
oldData.mobilePayment += newData.MobilePayment oldData.mobilePayment += newData.MobilePayment
oldData.cashPay += newData.CashPay oldData.cashPay += newData.CashPay
oldData.diffLessPrice += newData.Different_Price_Less oldData.diffLessPrice += newData.Different_Price_Less
oldData.diffMorePrice += newData.Different_Price_More oldData.diffMorePrice += newData.Different_Price_More
if(newData.BusinessType==1000){ // 商超 if (newData.BusinessType == 1000) { // 商超
oldData.scCount = oldData.scCount ? oldData.scCount + 1 : 1 oldData.scCount = oldData.scCount ? oldData.scCount + 1 : 1
oldData.scCashPay = oldData.scCashPay ? oldData.scCashPay + newData.CashPay : newData.CashPay oldData.scCashPay = oldData.scCashPay ? oldData.scCashPay + newData.CashPay : newData.CashPay
} }
if(newData.BusinessType==3000){ // 餐饮 if (newData.BusinessType == 3000) { // 餐饮
oldData.cyCount = oldData.cyCount ? oldData.cyCount + 1 : 1 oldData.cyCount = oldData.cyCount ? oldData.cyCount + 1 : 1
oldData.cyCashPay = oldData.cyCashPay ? oldData.cyCashPay + newData.CashPay : newData.CashPay oldData.cyCashPay = oldData.cyCashPay ? oldData.cyCashPay + newData.CashPay : newData.CashPay
} }
} else { } else {
oldData.ticketCount = newData.TicketCount oldData.ticketCount = newData.TicketCount
@ -110,26 +122,26 @@ const methods = {
oldData.diffLessPrice = newData.Different_Price_Less oldData.diffLessPrice = newData.Different_Price_Less
oldData.diffMorePrice = newData.Different_Price_More oldData.diffMorePrice = newData.Different_Price_More
if(newData.BusinessType==1000){ // 商超 if (newData.BusinessType == 1000) { // 商超
oldData.scCount = 1 oldData.scCount = 1
oldData.scCashPay = newData.CashPay oldData.scCashPay = newData.CashPay
} }
if(newData.BusinessType==3000){ // 餐饮 if (newData.BusinessType == 3000) { // 餐饮
oldData.cyCount = 1 oldData.cyCount = 1
oldData.cyCashPay = newData.CashPay oldData.cyCashPay = newData.CashPay
} }
} }
return {...oldData} return { ...oldData }
}, },
getBusniessPie(typeName, item, list) { // 经营模式数据 getBusniessPie(typeName, item, list) { // 经营模式数据
const oldData = list.find(m => m.name === item[typeName]) const oldData = list.find(m => m.name === item[typeName])
if (oldData) { if (oldData) {
oldData.data = Number((oldData.data+ item.CashPay).toFixed(2)) oldData.data = Number((oldData.data + item.CashPay).toFixed(2))
oldData.value = Number((oldData.value+ item.CashPay).toFixed(2)) oldData.value = Number((oldData.value + item.CashPay).toFixed(2))
} else { } else {
list.push({ list.push({
name: item[typeName], name: item[typeName],
@ -159,7 +171,7 @@ const methods = {
oldRegion.MediumVehicle_Count = Number((oldRegion.MediumVehicle_Count + item.MediumVehicle_Count).toFixed(2)) oldRegion.MediumVehicle_Count = Number((oldRegion.MediumVehicle_Count + item.MediumVehicle_Count).toFixed(2))
oldRegion.LargeVehicle_Count = Number((oldRegion.LargeVehicle_Count + item.LargeVehicle_Count).toFixed(2)) oldRegion.LargeVehicle_Count = Number((oldRegion.LargeVehicle_Count + item.LargeVehicle_Count).toFixed(2))
} }
else{ else {
oldData.regionList.push({ oldData.regionList.push({
name: item["Serverpart_Region"], name: item["Serverpart_Region"],
Vehicle_Count: item.Vehicle_Count, Vehicle_Count: item.Vehicle_Count,
@ -212,7 +224,7 @@ const methods = {
return [...list] return [...list]
}, },
getSeverpartReginList(data, shopCountList,tradeList,budgetAmount){ getSeverpartReginList(data, shopCountList, tradeList, budgetAmount) {
let _this = this let _this = this
let totalShow = {} // 总营收数据统计 let totalShow = {} // 总营收数据统计
let list = [] // 上传营收列表数据 let list = [] // 上传营收列表数据
@ -222,13 +234,13 @@ const methods = {
data.map(async (n, index) => { data.map(async (n, index) => {
n.show = false n.show = false
totalShow = _this.getTotalShowData(n, totalShow,index); // 总营收数据统计 totalShow = _this.getTotalShowData(n, totalShow, index); // 总营收数据统计
// 寻找门店父业态 // 寻找门店父业态
let trade = tradeList.find(t=>t.BUSINESSTRADE_NAME==n.BusinessTrade_Name) let trade = tradeList.find(t => t.BUSINESSTRADE_NAME == n.BusinessTrade_Name)
if(trade && trade.BUSINESSTRADE_PNAME && trade.BUSINESSTRADE_PNAME.indexOf('其他')==-1 ) { if (trade && trade.BUSINESSTRADE_PNAME && trade.BUSINESSTRADE_PNAME.indexOf('其他') == -1) {
n.tradename = trade.BUSINESSTRADE_PNAME n.tradename = trade.BUSINESSTRADE_PNAME
}else{ } else {
n.tradename = '其他' n.tradename = '其他'
} }
@ -237,16 +249,16 @@ const methods = {
busniessTradeFathPie = _this.getBusniessPie('tradename', n, busniessTradeFathPie) busniessTradeFathPie = _this.getBusniessPie('tradename', n, busniessTradeFathPie)
}) })
totalShow.serverpartname = data[0].Serverpart_Name totalShow.serverpartname = data[0].Serverpart_Name
totalShow.uploadState = data.length+'/'+ (shopCountList.length ? shopCountList[0].SHOP_BUSINESSCOUNT: 0) totalShow.uploadState = data.length + '/' + (shopCountList.length ? shopCountList[0].SHOP_BUSINESSCOUNT : 0)
totalShow.uploadCount = data.filter(n=>n.Revenue_Upload>0).length totalShow.uploadCount = data.filter(n => n.Revenue_Upload > 0).length
totalShow.totalUploadCount = shopCountList.length ? shopCountList[0].SHOP_BUSINESSCOUNT: 0 totalShow.totalUploadCount = shopCountList.length ? shopCountList[0].SHOP_BUSINESSCOUNT : 0
totalShow.budgetAmount = 0 totalShow.budgetAmount = 0
if(budgetAmount.length){ if (budgetAmount.length) {
totalShow.budgetAmount = budgetAmount[0].BUDGET_AMOUNT totalShow.budgetAmount = budgetAmount[0].BUDGET_AMOUNT
} }
return [ totalShow, busniessTypePie, busniessTradePie,busniessTradeFathPie ] return [totalShow, busniessTypePie, busniessTradePie, busniessTradeFathPie]
}, },
getReginList(data, shopCountList,tradeList,budgetAmount,bayonetCount, mobileShare, mallDeliver) { getReginList(data, shopCountList, tradeList, budgetAmount, bayonetCount, mobileShare, mallDeliver) {
let _this = this let _this = this
let totalShow = {} // 总营收数据统计 let totalShow = {} // 总营收数据统计
@ -260,12 +272,12 @@ const methods = {
n.show = false n.show = false
// 寻找门店父业态 // 寻找门店父业态
let trade = tradeList.find(t=>t.BUSINESSTRADE_NAME==n.BusinessTrade_Name) let trade = tradeList.find(t => t.BUSINESSTRADE_NAME == n.BusinessTrade_Name)
if(trade && trade.BUSINESSTRADE_PNAME && trade.BUSINESSTRADE_PNAME.indexOf('其他')==-1 ) { if (trade && trade.BUSINESSTRADE_PNAME && trade.BUSINESSTRADE_PNAME.indexOf('其他') == -1) {
n.tradename = trade.BUSINESSTRADE_PNAME n.tradename = trade.BUSINESSTRADE_PNAME
}else{ } else {
n.tradename = _this.provinceCode==340000? '其他' : (n.BusinessTrade_Name || '其他') n.tradename = _this.provinceCode == 340000 ? '其他' : (n.BusinessTrade_Name || '其他')
} }
// 上传营收情况 // 上传营收情况
let regin = list.find(m => m.name === n.SPRegionType_Name) let regin = list.find(m => m.name === n.SPRegionType_Name)
@ -284,42 +296,42 @@ const methods = {
list.push({ list.push({
name: n.SPRegionType_Name, // 区域名称 name: n.SPRegionType_Name, // 区域名称
cashpay: n.CashPay, cashpay: n.CashPay,
uploadcount: n.Revenue_Upload>0 ? 1: 0, // 区域上传数量 uploadcount: n.Revenue_Upload > 0 ? 1 : 0, // 区域上传数量
totalcount: reginShopCount, totalcount: reginShopCount,
child: [{ child: [{
serverpart_Id: n.Serverpart_ID, serverpart_Id: n.Serverpart_ID,
serverpart_Name: n.Serverpart_Name, serverpart_Name: n.Serverpart_Name,
cashpay: n.CashPay, cashpay: n.CashPay,
uploadcount: n.Revenue_Upload>0 ? 1: 0, uploadcount: n.Revenue_Upload > 0 ? 1 : 0,
totalcount: serverpartShopCount totalcount: serverpartShopCount
}] }]
}) })
} else { } else {
regin.cashpay += n.CashPay regin.cashpay += n.CashPay
regin.uploadcount += n.Revenue_Upload>0 ? 1: 0 regin.uploadcount += n.Revenue_Upload > 0 ? 1 : 0
let serverpart = regin.child.find(m => m.serverpart_Name === n.Serverpart_Name) let serverpart = regin.child.find(m => m.serverpart_Name === n.Serverpart_Name)
if (serverpart) { if (serverpart) {
serverpart.cashpay += n.CashPay serverpart.cashpay += n.CashPay
serverpart.uploadcount += n.Revenue_Upload>0 ? 1: 0 serverpart.uploadcount += n.Revenue_Upload > 0 ? 1 : 0
} else { } else {
regin.child.push({ regin.child.push({
serverpart_Id: n.Serverpart_ID, serverpart_Id: n.Serverpart_ID,
serverpart_Name: n.Serverpart_Name, serverpart_Name: n.Serverpart_Name,
cashpay: n.CashPay, cashpay: n.CashPay,
uploadcount: n.Revenue_Upload>0 ? 1: 0, uploadcount: n.Revenue_Upload > 0 ? 1 : 0,
totalcount: serverpartShopCount totalcount: serverpartShopCount
}) })
} }
regin.child.sort((a, b) => b.cashpay - a.cashpay) regin.child.sort((a, b) => b.cashpay - a.cashpay)
} }
totalShow = _this.getTotalShowData(n, totalShow,index); // 总营收数据统计 totalShow = _this.getTotalShowData(n, totalShow, index); // 总营收数据统计
busniessTypePie = _this.getBusniessPie('Business_TypeName', n, busniessTypePie) busniessTypePie = _this.getBusniessPie('Business_TypeName', n, busniessTypePie)
busniessTradePie = _this.getBusniessPie('tradename', n, busniessTradePie) busniessTradePie = _this.getBusniessPie('tradename', n, busniessTradePie)
if (this.groupType == 1000){ if (this.groupType == 1000) {
busniessAreaPie = _this.getBusniessPie('SPRegionType_Name', n, busniessAreaPie) busniessAreaPie = _this.getBusniessPie('SPRegionType_Name', n, busniessAreaPie)
} }
}) })
list.sort((a, b) => b.cashpay - a.cashpay) list.sort((a, b) => b.cashpay - a.cashpay)
@ -343,19 +355,19 @@ const methods = {
}) })
} }
totalShow.uploadState = data.filter(n=>n.Revenue_Upload>0).length+'/'+totalUploadCount totalShow.uploadState = data.filter(n => n.Revenue_Upload > 0).length + '/' + totalUploadCount
totalShow.budgetAmount = 0 totalShow.budgetAmount = 0
if(_this.provinceCode==620000){ if (_this.provinceCode == 620000) {
const ele = list.find(n=>n.name=="通美公司") const ele = list.find(n => n.name == "通美公司")
totalShow.tmCrashPay = ele ? ele.cashpay :'0.00' totalShow.tmCrashPay = ele ? ele.cashpay : '0.00'
} }
if(budgetAmount.length){ if (budgetAmount.length) {
totalShow.budgetAmount = budgetAmount[0].BUDGET_AMOUNT totalShow.budgetAmount = budgetAmount[0].BUDGET_AMOUNT
} }
console.log('list',list) console.log('list', list)
return [list, totalShow, busniessTypePie, busniessTradePie,busniessAreaPie,bayonetPie] return [list, totalShow, busniessTypePie, busniessTradePie, busniessAreaPie, bayonetPie]
} }
} }
export default methods ; export default methods;

View File

@ -9,7 +9,7 @@
</view> </view>
<view class="topRight" @click="handleGoMap"> <view class="topRight" @click="handleGoMap">
<image class="searchIcon" src="/static/images/home/searchIcon.svg" /> <image class="searchIcon" src="/static/images/home/searchIcon.svg" />
<span class="searchText">请输入服务区</span> <span class="searchText">请输入服务区</span>
</view> </view>
</view> </view>
</view> </view>
@ -696,14 +696,33 @@ export default {
} }
}; };
console.log('listlistlistlist', list); console.log('listlistlistlist', list);
// 尿
const OilData = await request.$apiPost("CommercialApi/BigData/GetEnergyRevenueInfo", { // 尿,
DataType: 2000, const [OilData, addWaterData, UreaData] = await Promise.all([
StatisticsDate: this.nowDay, request.$SamemberApiPost("CommercialApi/BigData/GetEnergyRevenueInfo", {
ShowWY: true, DataType: 2000,
ShowLargeUnit: true, StatisticsDate: this.nowDay,
type: "encryption" ShowWY: true,
}); ShowLargeUnit: true,
type: "encryption"
}),
request.$SamemberApiPost("CommercialApi/BigData/GetEnergyRevenueInfo", {
DataType: 3000,
StatisticsDate: this.nowDay,
ShowWY: true,
ShowLargeUnit: true,
type: "encryption"
}),
request.$SamemberApiPost("CommercialApi/BigData/GetEnergyRevenueInfo", {
DataType: 4000,
StatisticsDate: this.nowDay,
ShowWY: true,
ShowLargeUnit: true,
type: "encryption"
})
]);
//
if (OilData.Result_Data) { if (OilData.Result_Data) {
result.push({ result.push({
label: '油品', label: '油品',
@ -715,13 +734,7 @@ export default {
}); });
} }
const addWaterData = await request.$apiPost("CommercialApi/BigData/GetEnergyRevenueInfo", { //
DataType: 3000,
StatisticsDate: this.nowDay,
ShowWY: true,
ShowLargeUnit: true,
type: "encryption"
});
if (addWaterData.Result_Data) { if (addWaterData.Result_Data) {
result.push({ result.push({
label: '加水', label: '加水',
@ -733,13 +746,7 @@ export default {
}); });
} }
const UreaData = await request.$SamemberApiPost("CommercialApi/BigData/GetEnergyRevenueInfo", { // 尿
DataType: 4000,
StatisticsDate: this.nowDay,
ShowWY: true,
ShowLargeUnit: true,
type: "encryption"
});
if (UreaData.Result_Data) { if (UreaData.Result_Data) {
result.push({ result.push({
label: '尿素', label: '尿素',