first commit

This commit is contained in:
ylj20011123 2025-08-20 11:48:20 +08:00
parent f0ab72c78b
commit c8f020d72e
6 changed files with 380 additions and 203 deletions

View File

@ -15,6 +15,8 @@
<view class="uni-input">{{ serviceInfo.SERVERPART_NAME ? serviceInfo.SERVERPART_NAME : <view class="uni-input">{{ serviceInfo.SERVERPART_NAME ? serviceInfo.SERVERPART_NAME :
'请选择服务区' }} '请选择服务区' }}
</view> </view>
<p class="area">{{ serviceInfo.SPREGIONTYPE_NAME ? serviceInfo.SPREGIONTYPE_NAME : '' }}
</p>
<image class="rightArrow" <image class="rightArrow"
src="https://eshangtech.com/ShopICO/ahyd-BID/commercial/rightArrow.svg"></image> src="https://eshangtech.com/ShopICO/ahyd-BID/commercial/rightArrow.svg"></image>
</view> </view>
@ -489,6 +491,15 @@ export default {
color: #160002; color: #160002;
} }
.area {
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #786B6C;
line-height: 40px;
margin-left: 4px;
}
.rightArrow { .rightArrow {
width: 12px; width: 12px;
height: 12px; height: 12px;

View File

@ -14,6 +14,8 @@
<view class="uni-input">{{ serviceInfo.SERVERPART_NAME ? serviceInfo.SERVERPART_NAME : <view class="uni-input">{{ serviceInfo.SERVERPART_NAME ? serviceInfo.SERVERPART_NAME :
'' }} '' }}
</view> </view>
<p class="area">{{ serviceInfo.SPREGIONTYPE_NAME ? serviceInfo.SPREGIONTYPE_NAME : '' }}
</p>
<image class="rightArrow" <image class="rightArrow"
src="https://eshangtech.com/ShopICO/ahyd-BID/commercial/rightArrow.svg"></image> src="https://eshangtech.com/ShopICO/ahyd-BID/commercial/rightArrow.svg"></image>
</view> </view>
@ -120,7 +122,7 @@
<view class="onDutyPersonBoxHeader"> <view class="onDutyPersonBoxHeader">
<text class="title">{{ selectTab === 1 ? "👥 当前在岗人员" : selectTab === 2 ? "📋 请假人员列表" : selectTab === 3 <text class="title">{{ selectTab === 1 ? "👥 当前在岗人员" : selectTab === 2 ? "📋 请假人员列表" : selectTab === 3
? "👑 值班经理信息" : "" ? "👑 值班经理信息" : ""
}}</text> }}</text>
<!-- 居中的日历时间 --> <!-- 居中的日历时间 -->

View File

@ -13,6 +13,8 @@
<view class="uni-input">{{ serviceInfo.SERVERPART_NAME ? serviceInfo.SERVERPART_NAME : <view class="uni-input">{{ serviceInfo.SERVERPART_NAME ? serviceInfo.SERVERPART_NAME :
'' }} '' }}
</view> </view>
<p class="area">{{ serviceInfo.SPREGIONTYPE_NAME ? serviceInfo.SPREGIONTYPE_NAME : '' }}
</p>
<image class="rightArrow" <image class="rightArrow"
src="https://eshangtech.com/ShopICO/ahyd-BID/commercial/rightArrow.svg"></image> src="https://eshangtech.com/ShopICO/ahyd-BID/commercial/rightArrow.svg"></image>
</view> </view>
@ -33,7 +35,7 @@
<view class="center"> <view class="center">
<text class="date-text">{{ selectDate ? $util.cutDate(new Date(selectDate), 'YYYY-MM') : <text class="date-text">{{ selectDate ? $util.cutDate(new Date(selectDate), 'YYYY-MM') :
"" ""
}}</text> }}</text>
</view> </view>
<view class="arrowBtn" @tap="handleChangeDate(1)"> <view class="arrowBtn" @tap="handleChangeDate(1)">
<image class="arrowIcon" src="https://eshangtech.com/cyy_DIB/rightArrowIcon.png" /> <image class="arrowIcon" src="https://eshangtech.com/cyy_DIB/rightArrowIcon.png" />
@ -107,7 +109,7 @@
</view> </view>
<view class="calendarGrid"> <view class="calendarGrid">
<view v-for="i in firstDayOfWeek" :key="`empty-${i}`" class="calendarCell empty"></view> <view v-for="(n, index) in firstDayOfWeek" :key="index" class="calendarCell empty"></view>
<view v-for="day in monthDays" :key="day.date" class="calendarCell" :class="{ <view v-for="day in monthDays" :key="day.date" class="calendarCell" :class="{
'weekend': day.isWeekend, 'weekend': day.isWeekend,
@ -522,6 +524,15 @@ export default {
color: #160002; color: #160002;
} }
.area {
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #786B6C;
line-height: 40px;
margin-left: 4px;
}
.rightArrow { .rightArrow {
width: 12px; width: 12px;
height: 12px; height: 12px;

View File

@ -17,7 +17,8 @@
<!-- 月份的轮播框 --> <!-- 月份的轮播框 -->
<view class="monthListBox" :style="{ paddingTop: menu.bottom + 8 + 'px' }"> <view class="monthListBox" :style="{ paddingTop: menu.bottom + 8 + 'px' }">
<swiper class="swiperBox" previous-margin="40rpx" next-margin="40rpx" :current="selectIndex" <swiper class="swiperBox" previous-margin="40rpx" next-margin="40rpx" :current="selectIndex"
@animationfinish="handleChangeSwiper"> @animationfinish="handleChangeSwiper" :disable-programmatic-animation="false" :duration="300"
:easing-function="ease - out">
<swiper-item class="swiperItem" v-for="(item, index) in monthList" :key="index"> <swiper-item class="swiperItem" v-for="(item, index) in monthList" :key="index">
<view class="swiperItemContent" <view class="swiperItemContent"
:class="{ 'is-first': index === 0, 'is-last': index === monthList.length - 1 }"> :class="{ 'is-first': index === 0, 'is-last': index === monthList.length - 1 }">
@ -25,31 +26,26 @@
<!-- 轮播框里面的实际内容 写在这个里面 --> <!-- 轮播框里面的实际内容 写在这个里面 -->
<view class="swiperItemContentMonth"> <view class="swiperItemContentMonth">
{{ selectIndex === index ? item.month || "-" : "-" }}月对客营收 {{ selectIndex === index ? currentMonthData.monthText : '-月对客营收' }}
<span class="swiperItemContentUnit">/万元</span> <span class="swiperItemContentUnit">/万元</span>
</view> </view>
<!-- 月度营收的值 --> <!-- 月度营收的值 -->
<view class="swiperItemContentMonthRevenueBox"> <view class="swiperItemContentMonthRevenueBox">
<view class="leftRevenueValue">{{ selectIndex === index <view class="leftRevenueValue">{{ selectIndex === index ?
? topShowData.MonthRevenueModel.CashPayChange || "-" : "-" }} currentRevenueData.cashPayChange : '-' }}
</view> </view>
<view class="rightRevenueValue"> <view class="rightRevenueValue">
<text v-if="selectIndex === index" class="addValue" :style="{ <text v-if="selectIndex === index && hasCurrentMonthData" class="addValue"
color: :style="revenueChangeStyle">
topShowData.MonthRevenueModel.addNumber > 0 {{ revenueChangeText }}
? '#E83944' </text>
: topShowData.MonthRevenueModel.addNumber < 0
? '#0E9976'
: '',
}">{{ topShowData.MonthRevenueModel.addNumber ?
topShowData.MonthRevenueModel.addNumber : "-" }}%</text>
<text class="rightNav">同比</text> <text class="rightNav">同比</text>
</view> </view>
</view> </view>
<view class="monthRevenueBox" v-if="selectIndex === index"> <view class="monthRevenueBox" v-if="selectIndex === index && hasCurrentMonthData">
<view class="leftBox" @click="handleShowYDModal"> <view class="leftBox" @click="handleShowYDModal">
<view class="rateChartsBox" v-if="moneyRateList && moneyRateList.length > 0"> <view class="rateChartsBox" v-if="moneyRateList && moneyRateList.length > 0">
<rateCharts :success="moneyRateList" <rateCharts :success="moneyRateList"
@ -85,7 +81,7 @@
}"></view> }"></view>
<span class="itemName">{{ <span class="itemName">{{
subItem.name subItem.name
}}</span> }}</span>
</view> </view>
<view class="itemCenter"> <view class="itemCenter">
{{ {{
@ -103,7 +99,7 @@
: '', : '',
}">{{ }">{{
subItem.addQOQ ? `${subItem.addQOQ}` : "" subItem.addQOQ ? `${subItem.addQOQ}` : ""
}}</view> }}</view>
</view> </view>
</view> </view>
</view> </view>
@ -120,7 +116,7 @@
<!-- <view class="itemType">累计</view>--> <!-- <view class="itemType">累计</view>-->
</view> </view>
<view class="itemBottom"> <view class="itemBottom">
<span class="revenueNum" v-if="selectIndex === index">{{ <span class="revenueNum" v-if="selectIndex === index && hasCurrentMonthData">{{
topShowData && topShowData.MonthRevenueModel && topShowData && topShowData.MonthRevenueModel &&
topShowData.MonthRevenueModel.YearRevenueAmount topShowData.MonthRevenueModel.YearRevenueAmount
? $util.getMoney( ? $util.getMoney(
@ -129,7 +125,7 @@
) )
: "" : ""
}}</span> }}</span>
<span class="revenueAdd" v-if="selectIndex === index" :style="{ <span class="revenueAdd" v-if="selectIndex === index && hasCurrentMonthData" :style="{
color: color:
topShowData && topShowData.MonthRevenueModel && topShowData.MonthRevenueModel.YearRevenueAddNumber > 0 topShowData && topShowData.MonthRevenueModel && topShowData.MonthRevenueModel.YearRevenueAddNumber > 0
? '#E83944' ? '#E83944'
@ -155,14 +151,15 @@
}} }}
</span> </span>
<span class="revenueAdd" v-if="selectIndex === index" :style="{ <span class="revenueAdd" v-if="selectIndex === index && hasCurrentMonthData"
color: :style="{
topShowData && topShowData.MonthRevenueModel && topShowData.MonthRevenueModel.YearRevenueAdd > 0 color:
? '#E83944' topShowData && topShowData.MonthRevenueModel && topShowData.MonthRevenueModel.YearRevenueAdd > 0
: topShowData && topShowData.MonthRevenueModel && topShowData.MonthRevenueModel.YearRevenueAdd < 0 ? '#E83944'
? '#0E9976' : topShowData && topShowData.MonthRevenueModel && topShowData.MonthRevenueModel.YearRevenueAdd < 0
: '', ? '#0E9976'
}"><span class="revenueAddNotice">{{ : '',
}"><span class="revenueAddNotice">{{
topShowData && topShowData.MonthRevenueModel && topShowData && topShowData.MonthRevenueModel &&
topShowData.MonthRevenueModel.YearRevenueAdd > 0 topShowData.MonthRevenueModel.YearRevenueAdd > 0
? "增幅" ? "增幅"
@ -219,7 +216,7 @@
src="https://eshangtech.com/ShopICO/ahyd-BID/newIndex3/monthIcon.svg" /> src="https://eshangtech.com/ShopICO/ahyd-BID/newIndex3/monthIcon.svg" />
<text class="dateText">{{ <text class="dateText">{{
$util.handleGetMonthDay(nowDay) $util.handleGetMonthDay(nowDay)
}}</text> }}</text>
<text class="day">/{{ howDay }}</text> <text class="day">/{{ howDay }}</text>
</view> </view>
<view class="revenyeTopRight"> <view class="revenyeTopRight">
@ -350,6 +347,10 @@ export default {
modalRateList: [],// modalRateList: [],//
useInfo: {}, useInfo: {},
isReturn: true, isReturn: true,
//
monthDataCache: {}, //
loadingMap: {}, //
swiperTransition: false, // swiper
} }
}, },
components: { components: {
@ -359,6 +360,58 @@ export default {
}, },
computed: { computed: {
...mapGetters({ user: "getUser" }), ...mapGetters({ user: "getUser" }),
// uniapp使computed
currentMonthData() {
if (this.selectIndex >= 0 && this.monthList[this.selectIndex]) {
return {
month: this.monthList[this.selectIndex].month || "-",
monthText: (this.monthList[this.selectIndex].month || "-") + "月对客营收"
};
}
return {
month: "-",
monthText: "-月对客营收"
};
},
currentRevenueData() {
if (this.topShowData && this.topShowData.MonthRevenueModel) {
return {
cashPayChange: this.topShowData.MonthRevenueModel.CashPayChange || "-",
addNumber: this.topShowData.MonthRevenueModel.addNumber || 0,
hasData: true
};
}
return {
cashPayChange: "-",
addNumber: 0,
hasData: false
};
},
//
revenueChangeStyle() {
const addNumber = this.currentRevenueData.addNumber;
let color = '';
if (addNumber > 0) {
color = '#E83944';
} else if (addNumber < 0) {
color = '#0E9976';
}
return { color: color };
},
//
revenueChangeText() {
const addNumber = this.currentRevenueData.addNumber;
return addNumber ? `${addNumber}%` : "-";
},
//
hasCurrentMonthData() {
return this.topShowData && this.topShowData.MonthRevenueModel;
}
}, },
watch: { watch: {
user: { user: {
@ -443,7 +496,7 @@ export default {
uni.hideTabBar(); uni.hideTabBar();
}, },
onPullDownRefresh: function () { onPullDownRefresh: function () {
let _this = this let _this = this;
let userInfo = JSON.parse(JSON.stringify(this.user)); let userInfo = JSON.parse(JSON.stringify(this.user));
if (userInfo && userInfo.WeChat_UserId && userInfo.AuthorityInfo["89a1f248-2113-4d57-84b1-c2e6edb9e8ee"] === 1) { if (userInfo && userInfo.WeChat_UserId && userInfo.AuthorityInfo["89a1f248-2113-4d57-84b1-c2e6edb9e8ee"] === 1) {
_this.isReturn = false; _this.isReturn = false;
@ -453,7 +506,10 @@ export default {
}); });
} }
if (!_this.isReturn) { if (!_this.isReturn) {
_this.handleGetOnLoad() //
_this.monthDataCache = {};
_this.loadingMap = {};
_this.handleGetOnLoad();
} }
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}, },
@ -461,15 +517,44 @@ export default {
// onLoad // onLoad
async handleGetOnLoad() { async handleGetOnLoad() {
// //
this.handleGetIndexInfo() this.handleGetIndexInfo();
// //
await this.handleGetTopData() const promises = [
this.handleGetTopData(),
this.handleRealRevenue(),
this.handleGetYNRealData()
];
// //
this.handleRealRevenue() const currentIndex = this.selectIndex;
// 尿 if (currentIndex > 0) {
this.handleGetYNRealData() promises.push(this.preloadMonthData(currentIndex - 1));
}
if (currentIndex < this.monthList.length - 1) {
promises.push(this.preloadMonthData(currentIndex + 1));
}
await Promise.allSettled(promises);
},
//
async preloadMonthData(index) {
if (index < 0 || index >= this.monthList.length) return;
const monthKey = this.monthList[index]?.realFull;
if (!monthKey || this.monthDataCache[monthKey] || this.loadingMap[monthKey]) {
return;
}
//
setTimeout(async () => {
try {
await this.handleGetTopData(index);
} catch (error) {
console.log('预加载数据失败:', error);
}
}, 500);
}, },
handleShowYDModal() { handleShowYDModal() {
this.ydModal = !this.ydModal; this.ydModal = !this.ydModal;
@ -557,154 +642,231 @@ export default {
}, },
// //
async handleGetYNRealData() { async handleGetYNRealData() {
let req = { try {
serverPartId: "" let req = {
} serverPartId: ""
const res = await request.$webJava("partner/today/data/statistics", req) };
console.log('handleGetYNRealDatahandleGetYNRealDatahandleGetYNRealData', res); const res = await request.$webJava("partner/today/data/statistics", req);
let list = res.Result_Data console.log('handleGetYNRealDatahandleGetYNRealDatahandleGetYNRealData', res);
let result = [] let list = res.Result_Data;
if (list && list.length > 0) { let result = [];
list.forEach((item) => {
if (item.dataType === 2000) { //
result.push({ const dataTypeMap = {
label: `油品`, 2000: {
value: this.$util.fmoney(item.totalCount), label: '油品',
unit: item.totalCountUnit, icon: 'https://eshangtech.com/cyy_DIB/oilIcon.png',
icon: "https://eshangtech.com/cyy_DIB/oilIcon.png" valueKey: 'totalCount',
}) unitKey: 'totalCountUnit'
} else if (item.dataType === 3000) { },
result.push({ 3000: {
label: `加水`, label: '加水',
value: this.$util.fmoney(item.totalCount), icon: 'https://eshangtech.com/cyy_DIB/addWaterIcon.png',
unit: item.totalCountUnit, valueKey: 'totalCount',
icon: "https://eshangtech.com/cyy_DIB/addWaterIcon.png" unitKey: 'totalCountUnit'
}) },
} else if (item.dataType === 4000) { 4000: {
result.push({ label: '尿素',
label: `尿素`, icon: 'https://eshangtech.com/cyy_DIB/ureaIcon.png',
value: this.$util.fmoney(item.totalCount), valueKey: 'totalCount',
unit: item.totalCountUnit, unitKey: 'totalCountUnit'
icon: "https://eshangtech.com/cyy_DIB/ureaIcon.png" },
}) 5000: {
} else if (item.dataType === 5000) { label: '充电',
result.push({ icon: 'https://eshangtech.com/cyy_DIB/chargeIcon.png',
label: `充电`, valueKey: 'totalTicket',
value: this.$util.fmoney(item.totalTicket), unitKey: 'totalTicketUnit'
unit: item.totalTicketUnit,
icon: "https://eshangtech.com/cyy_DIB/chargeIcon.png"
})
} }
}) };
if (list && list.length > 0) {
list.forEach((item) => {
const config = dataTypeMap[item.dataType];
if (config) {
result.push({
label: config.label,
value: this.$util.fmoney(item[config.valueKey]),
unit: item[config.unitKey],
icon: config.icon
});
}
});
}
this.otherRealData = result;
} catch (error) {
console.error('获取实时数据失败:', error);
this.otherRealData = [];
} }
this.otherRealData = result
}, },
// //
async handleChangeSwiper(e) { async handleChangeSwiper(e) {
console.log('e', e); console.log('e', e);
this.selectIndex = e.target.current const currentIndex = e.target.current;
this.topShowData = null
this.moneyRateList = [] //
this.profitSharingList = [] if (this.swiperTransition) return;
this.modalRateList = [] this.swiperTransition = true;
await this.handleGetTopData(e.target.current)
this.selectIndex = currentIndex;
//
const monthKey = this.monthList[currentIndex]?.realFull;
if (this.monthDataCache[monthKey]) {
// 使
const cachedData = this.monthDataCache[monthKey];
this.topShowData = cachedData.topShowData;
this.moneyRateList = cachedData.moneyRateList;
this.profitSharingList = cachedData.profitSharingList;
this.modalRateList = cachedData.modalRateList;
} else {
//
this.topShowData = null;
this.moneyRateList = [];
this.profitSharingList = [];
this.modalRateList = [];
await this.handleGetTopData(currentIndex);
}
//
setTimeout(() => {
this.swiperTransition = false;
}, 100);
}, },
// //
async handleRealRevenue() { async handleRealRevenue() {
let req = { try {
pushProvinceCode: "530000", let req = {
StatisticsDate: this.nowDay, pushProvinceCode: "530000",
}; StatisticsDate: this.nowDay,
const res = await request.$webGet("CommercialApi/Revenue/GetCurRevenue", req) };
// this.currentMoney = res.Result_Data.CurRevenueAmount.toFixed(2); const res = await request.$webGet("CommercialApi/Revenue/GetCurRevenue", req);
this.currentMoney = res.Result_Data.CurRevenueAmount.toLocaleString('zh-CN') // this.currentMoney = res.Result_Data.CurRevenueAmount.toFixed(2);
this.currentMoney = res.Result_Data.CurRevenueAmount.toLocaleString('zh-CN');
} catch (error) {
console.error('获取实时营收数据失败:', error);
this.currentMoney = '暂无数据';
}
}, },
// //
async handleGetTopData(index) { async handleGetTopData(index) {
let nowMonth = index ? this.monthList[index] : this.monthList[this.selectIndex] let nowMonth = index !== undefined ? this.monthList[index] : this.monthList[this.selectIndex];
const monthKey = nowMonth.realFull;
const req = { //
pushProvinceCode: "530000", if (this.loadingMap[monthKey]) {
StatisticsMonth: nowMonth.realFull, return;
StatisticsDate: this.lastDay
} }
const data = await request.$webGet("CommercialApi/Revenue/GetSummaryRevenueMonth", req)
// //
let dataObj = data.Result_Data if (this.monthDataCache[monthKey]) {
// const cachedData = this.monthDataCache[monthKey];
let resObj = JSON.parse(JSON.stringify(data.Result_Data)) this.topShowData = cachedData.topShowData;
console.log('dataObjdataObjdataObj', dataObj); this.moneyRateList = cachedData.moneyRateList;
// this.profitSharingList = cachedData.profitSharingList;
resObj.MonthRevenueModel.CashPayChange = this.$util.fmoney(this.$util.getMoney(resObj.MonthRevenueModel.CashPay / 10000), 2); this.modalRateList = cachedData.modalRateList;
// return;
let addNumber = resObj.MonthRevenueModel.RevenueYOY ? Number((((resObj.MonthRevenueModel.CashPay - resObj.MonthRevenueModel.RevenueYOY) / resObj.MonthRevenueModel.RevenueYOY) * 100).toFixed(2)) : 0;
resObj.MonthRevenueModel.add = addNumber === 0 ? '' : addNumber > 0 ? "+" + addNumber : addNumber
resObj.MonthRevenueModel.addNumber = addNumber
//
resObj.MonthRevenueModel.YearRevenueAddNumber = resObj.MonthRevenueModel.YearRevenueAmount - resObj.MonthRevenueModel.YearRevenueYOY;
resObj.MonthRevenueModel.YearRevenueAdd = resObj.MonthRevenueModel.YearRevenueYOY ? (((resObj.MonthRevenueModel.YearRevenueAmount - resObj.MonthRevenueModel.YearRevenueYOY) / resObj.MonthRevenueModel.YearRevenueYOY) * 100).toFixed(2) : 0;
//
let shareList = [{}, {}];
//
let sum = 0
resObj.BusinessTypeList.forEach((item) => {
//
if (item.data) {
let number = ((item.value - item.data) / item.data) * 100;
if (number > 0) {
item.add = "+" + number.toFixed(2);
} else if (number < 0) {
item.add = number.toFixed(2);
} else {
item.add = null;
}
}
//
if (item.key) {
let number = ((item.value - item.key) / item.key) * 100;
if (number > 0) {
item.addQOQ = "+" + number.toFixed(2) + "%";
} else if (number < 0) {
item.addQOQ = number.toFixed(2) + "%";
} else {
item.addQOQ = null;
}
}
//
if (item.name === "自营") {
shareList[0] = item;
sum += Number(item.value)
} else if (item.name === "外包") {
shareList[1] = item;
sum += Number(item.value)
}
})
console.log('sum', sum);
console.log('shareListshareListshareList', shareList);
let modalListRate = []
if (shareList && shareList.length > 0) {
shareList.forEach((item) => {
modalListRate.push((Number(item.value) / sum * 100).toFixed(2))
})
} }
this.modalRateList = modalListRate
//
this.loadingMap[monthKey] = true;
this.moneyRateList = [ try {
Number(shareList[0].value), const req = {
Number(shareList[1].value) pushProvinceCode: "530000",
]; StatisticsMonth: nowMonth.realFull,
this.profitSharingList = shareList StatisticsDate: this.lastDay
console.log('profitSharingListprofitSharingListprofitSharingList', this.profitSharingList); };
console.log('moneyRateListmoneyRateListmoneyRateList', this.moneyRateList); const data = await request.$webGet("CommercialApi/Revenue/GetSummaryRevenueMonth", req);
console.log('resObjresObjresObjresObjresObj', resObj);
this.topShowData = resObj //
let dataObj = data.Result_Data;
//
let resObj = JSON.parse(JSON.stringify(data.Result_Data));
console.log('dataObjdataObjdataObj', dataObj);
//
resObj.MonthRevenueModel.CashPayChange = this.$util.fmoney(this.$util.getMoney(resObj.MonthRevenueModel.CashPay / 10000), 2);
//
let addNumber = resObj.MonthRevenueModel.RevenueYOY ? Number((((resObj.MonthRevenueModel.CashPay - resObj.MonthRevenueModel.RevenueYOY) / resObj.MonthRevenueModel.RevenueYOY) * 100).toFixed(2)) : 0;
resObj.MonthRevenueModel.add = addNumber === 0 ? '' : addNumber > 0 ? "+" + addNumber : addNumber;
resObj.MonthRevenueModel.addNumber = addNumber;
//
resObj.MonthRevenueModel.YearRevenueAddNumber = resObj.MonthRevenueModel.YearRevenueAmount - resObj.MonthRevenueModel.YearRevenueYOY;
resObj.MonthRevenueModel.YearRevenueAdd = resObj.MonthRevenueModel.YearRevenueYOY ? (((resObj.MonthRevenueModel.YearRevenueAmount - resObj.MonthRevenueModel.YearRevenueYOY) / resObj.MonthRevenueModel.YearRevenueYOY) * 100).toFixed(2) : 0;
//
let shareList = [{}, {}];
//
let sum = 0;
resObj.BusinessTypeList.forEach((item) => {
//
if (item.data) {
let number = ((item.value - item.data) / item.data) * 100;
if (number > 0) {
item.add = "+" + number.toFixed(2);
} else if (number < 0) {
item.add = number.toFixed(2);
} else {
item.add = null;
}
}
//
if (item.key) {
let number = ((item.value - item.key) / item.key) * 100;
if (number > 0) {
item.addQOQ = "+" + number.toFixed(2) + "%";
} else if (number < 0) {
item.addQOQ = number.toFixed(2) + "%";
} else {
item.addQOQ = null;
}
}
//
if (item.name === "自营") {
shareList[0] = item;
sum += Number(item.value);
} else if (item.name === "外包") {
shareList[1] = item;
sum += Number(item.value);
}
});
console.log('sum', sum);
console.log('shareListshareListshareList', shareList);
let modalListRate = [];
if (shareList && shareList.length > 0) {
shareList.forEach((item) => {
modalListRate.push((Number(item.value) / sum * 100).toFixed(2));
});
}
const moneyRateList = [
Number(shareList[0].value),
Number(shareList[1].value)
];
//
this.monthDataCache[monthKey] = {
topShowData: resObj,
moneyRateList: moneyRateList,
profitSharingList: shareList,
modalRateList: modalListRate
};
//
this.modalRateList = modalListRate;
this.moneyRateList = moneyRateList;
this.profitSharingList = shareList;
console.log('profitSharingListprofitSharingListprofitSharingList', this.profitSharingList);
console.log('moneyRateListmoneyRateListmoneyRateList', this.moneyRateList);
console.log('resObjresObjresObjresObjresObj', resObj);
this.topShowData = resObj;
} catch (error) {
console.error('获取数据失败:', error);
} finally {
//
delete this.loadingMap[monthKey];
}
}, },
// //
handleGetIndexInfo() { handleGetIndexInfo() {
@ -743,7 +905,15 @@ export default {
const data = await request.$webGet('CommercialApi/BaseInfo/GetServerpartList', req) const data = await request.$webGet('CommercialApi/BaseInfo/GetServerpartList', req)
console.log('sdjkajdas', data); console.log('sdjkajdas', data);
let list = data.Result_Data.List let list = data.Result_Data.List
uni.setStorageSync('currentService', list[0]) uni.setStorageSync('currentService', list[0]);
},
// uniapp
getCurrentMonthText(index) {
if (this.selectIndex === index && this.monthList[index]) {
return (this.monthList[index].month || "-") + "月对客营收";
}
return "-月对客营收";
} }
} }
} }

View File

@ -43,7 +43,7 @@
<image v-else class="img_normal" :src="item.imagePath"></image> <image v-else class="img_normal" :src="item.imagePath"></image>
<span class="name">{{ item.name }}</span> <span class="name">{{ item.name }}</span>
<span v-if="item.notice !== 0 && item.isNotice" class="notice" style="{ background: red }">{{ item.notice <span v-if="item.notice !== 0 && item.isNotice" class="notice" style="{ background: red }">{{ item.notice
}}</span> }}</span>
</view> </view>
</view> </view>
</view> </view>
@ -77,20 +77,6 @@ export default {
methods: { methods: {
// //
handleGoFirst(item) { handleGoFirst(item) {
if (this.isReturn) {
let _this = this
uni.showModal({
title: '温馨提示',
content: '请您授权登录后再操作。',
success(res) {
if (res.confirm) {
_this.$util.toNextRoute('redirectTo', '/pages/register/register')
}
}
})
return
}
if (item.isNotice) { if (item.isNotice) {
this.$util.toNextRoute('navigateTo', item.homeUrl) this.$util.toNextRoute('navigateTo', item.homeUrl)
} else { } else {
@ -122,17 +108,16 @@ export default {
}, },
// //
handleGoFourth(item) { handleGoFourth(item) {
if (this.isReturn) { //
let _this = this let userInfo = uni.getStorageSync("vuex");
uni.showModal({ userInfo = userInfo ? JSON.parse(userInfo) : ""
title: '温馨提示', console.log('userInfouserInfouserInfo', userInfo);
content: '请您授权登录后再操作。', if (!userInfo.userData || !userInfo.userData.WeChat_UserId) {
success(res) { this.$util.toNextRoute('redirectTo', '/pages/register/register')
if (res.confirm) { } else if (userInfo.userData && userInfo.userData.WeChat_UserId && userInfo.userData.AuthorityInfo["89a1f248-2113-4d57-84b1-c2e6edb9e8ee"] !== 1) {
_this.$util.toNextRoute('redirectTo', '/pages/register/register') uni.redirectTo({
} url: `/pages/commercialBI/noData?type=homeIndex`,
} });
})
return return
} }

View File

@ -264,14 +264,12 @@ export default {
// //
let userInfo = uni.getStorageSync("vuex"); let userInfo = uni.getStorageSync("vuex");
if ( if (userInfo && userInfo.WeChat_UserId && userInfo.AuthorityInfo["89a1f248-2113-4d57-84b1-c2e6edb9e8ee"] === 1) {
userInfo.userData &&
userInfo.userData.WeChat_UserId &&
userInfo.userData.AuthorityInfo[
"89a1f248-2113-4d57-84b1-c2e6edb9e8ee"
] === 1
) {
this.isReturn = false; this.isReturn = false;
} else if (userInfo && userInfo.WeChat_UserId && userInfo.AuthorityInfo["89a1f248-2113-4d57-84b1-c2e6edb9e8ee"] !== 1) {
uni.redirectTo({
url: `/pages/commercialBI/noData?type=homeIndex`,
});
} }