update
This commit is contained in:
parent
431d95645b
commit
42f254afb9
@ -1,5 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<view :class="'province-theme-' + currentProvinceCode">
|
<view :class="'province-theme-' + currentProvinceCode">
|
||||||
|
<!-- 加载骨架屏 -->
|
||||||
|
<view class="loading-skeleton" v-if="isLoading">
|
||||||
|
<view class="skeleton-header"></view>
|
||||||
|
<view class="skeleton-cards">
|
||||||
|
<view class="skeleton-card" v-for="i in 3" :key="i"></view>
|
||||||
|
</view>
|
||||||
|
<view class="skeleton-list">
|
||||||
|
<view class="skeleton-item" v-for="i in 5" :key="i"></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="page-body" v-if="showPage">
|
<view class="page-body" v-if="showPage">
|
||||||
<AnhHead :today="today" :headMsg="headMsg" :lastDay="lastDay" :groupType="theRequest && theRequest.GroupType"
|
<AnhHead :today="today" :headMsg="headMsg" :lastDay="lastDay" :groupType="theRequest && theRequest.GroupType"
|
||||||
:provinceCode="theRequest && theRequest.ProvinceCode" @bindDateChange="bindDateChange" :isup="isup"
|
:provinceCode="theRequest && theRequest.ProvinceCode" @bindDateChange="bindDateChange" :isup="isup"
|
||||||
@ -277,8 +288,7 @@
|
|||||||
<shopCell v-for="(item, i) in regionList" :key="i" :item='item' @toggleShow="toggleShow" :i='i' />
|
<shopCell v-for="(item, i) in regionList" :key="i" :item='item' @toggleShow="toggleShow" :i='i' />
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
<template
|
<template v-if="theRequest && theRequest.ProvinceCode == '620000' || theRequest.ProvinceCode == '530000'">
|
||||||
v-if="theRequest && theRequest.ProvinceCode == '620000' || theRequest.ProvinceCode == '530000' || theRequest.ProvinceCode == '734100'">
|
|
||||||
<view class="uni-inline-item modle-title">
|
<view class="uni-inline-item modle-title">
|
||||||
<image src="/static/images/revenue/product-ranking.png" mode="aspectFit"></image>
|
<image src="/static/images/revenue/product-ranking.png" mode="aspectFit"></image>
|
||||||
<text class="strong-text">商品销售排行</text>
|
<text class="strong-text">商品销售排行</text>
|
||||||
@ -410,6 +420,133 @@ export default {
|
|||||||
RankContent
|
RankContent
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 解析二维码参数 - uniapp兼容版本
|
||||||
|
parseQRCodeParams: function (qParam) {
|
||||||
|
try {
|
||||||
|
// 解码URL
|
||||||
|
var decodedUrl = decodeURIComponent(qParam)
|
||||||
|
console.log('解码后的URL:', decodedUrl)
|
||||||
|
|
||||||
|
// 提取查询参数部分
|
||||||
|
var urlParts = decodedUrl.split('?')
|
||||||
|
if (urlParts.length < 2) {
|
||||||
|
console.log('二维码URL没有参数,使用默认值')
|
||||||
|
return this.getDefaultParams()
|
||||||
|
}
|
||||||
|
|
||||||
|
var queryString = urlParts[1]
|
||||||
|
var params = {}
|
||||||
|
|
||||||
|
// 解析查询参数
|
||||||
|
var pairs = queryString.split('&')
|
||||||
|
for (var i = 0; i < pairs.length; i++) {
|
||||||
|
var pair = pairs[i]
|
||||||
|
var equalIndex = pair.indexOf('=')
|
||||||
|
if (equalIndex > -1) {
|
||||||
|
var key = pair.substring(0, equalIndex)
|
||||||
|
var value = pair.substring(equalIndex + 1)
|
||||||
|
if (key && value !== '') {
|
||||||
|
try {
|
||||||
|
params[decodeURIComponent(key)] = decodeURIComponent(value)
|
||||||
|
} catch (e) {
|
||||||
|
// 解码失败时使用原值
|
||||||
|
params[key] = value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('解析的参数对象:', params)
|
||||||
|
|
||||||
|
// 确保必需参数存在
|
||||||
|
var finalParams = {
|
||||||
|
ProvinceCode: params.ProvinceCode || '530000', // 默认云南
|
||||||
|
GroupType: params.GroupType || '1000',
|
||||||
|
time: params.time || this.lastDay,
|
||||||
|
ServerpartIds: params.ServerpartIds || ''
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理时间格式
|
||||||
|
if (finalParams.time) {
|
||||||
|
var timeStr = finalParams.time
|
||||||
|
console.log('原始时间字符串:', timeStr)
|
||||||
|
|
||||||
|
// 处理URL编码的+号(空格被编码为+)
|
||||||
|
timeStr = timeStr.replace(/\+/g, ' ')
|
||||||
|
console.log('处理+号后:', timeStr)
|
||||||
|
|
||||||
|
// 分离日期和时间部分
|
||||||
|
var datePart = ''
|
||||||
|
var timePart = ''
|
||||||
|
|
||||||
|
if (timeStr.indexOf(' ') > -1) {
|
||||||
|
var parts = timeStr.split(' ')
|
||||||
|
datePart = parts[0]
|
||||||
|
timePart = parts[1] || ''
|
||||||
|
} else {
|
||||||
|
datePart = timeStr
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理日期部分:2025/9/1 -> 2025/09/01
|
||||||
|
if (datePart.indexOf('/') > -1) {
|
||||||
|
var dateSegments = datePart.split('/')
|
||||||
|
if (dateSegments.length === 3) {
|
||||||
|
var year = dateSegments[0]
|
||||||
|
var month = dateSegments[1].length === 1 ? '0' + dateSegments[1] : dateSegments[1]
|
||||||
|
var day = dateSegments[2].length === 1 ? '0' + dateSegments[2] : dateSegments[2]
|
||||||
|
datePart = year + '/' + month + '/' + day
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理时间部分:确保格式正确
|
||||||
|
if (timePart && timePart.indexOf(':') > -1) {
|
||||||
|
var timeSegments = timePart.split(':')
|
||||||
|
if (timeSegments.length >= 2) {
|
||||||
|
var hour = timeSegments[0].length === 1 ? '0' + timeSegments[0] : timeSegments[0]
|
||||||
|
var minute = timeSegments[1].length === 1 ? '0' + timeSegments[1] : timeSegments[1]
|
||||||
|
var second = '00'
|
||||||
|
if (timeSegments[2]) {
|
||||||
|
second = timeSegments[2].length === 1 ? '0' + timeSegments[2] : timeSegments[2]
|
||||||
|
}
|
||||||
|
timePart = hour + ':' + minute + ':' + second
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 组合最终时间字符串
|
||||||
|
if (timePart) {
|
||||||
|
finalParams.time = datePart + ' ' + timePart
|
||||||
|
} else {
|
||||||
|
finalParams.time = datePart
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('最终时间格式:', finalParams.time)
|
||||||
|
|
||||||
|
// 验证时间格式
|
||||||
|
if (finalParams.time.length < 8) {
|
||||||
|
console.log('时间格式不正确,使用默认时间')
|
||||||
|
finalParams.time = this.lastDay
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('最终参数:', finalParams)
|
||||||
|
return finalParams
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.log('解析二维码参数失败:', error)
|
||||||
|
return this.getDefaultParams()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 获取默认参数 - uniapp兼容版本
|
||||||
|
getDefaultParams: function () {
|
||||||
|
return {
|
||||||
|
ProvinceCode: '530000', // 默认云南
|
||||||
|
GroupType: '1000',
|
||||||
|
time: this.lastDay,
|
||||||
|
ServerpartIds: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 初始化省份代码
|
// 初始化省份代码
|
||||||
initProvinceCode() {
|
initProvinceCode() {
|
||||||
let provinceCode = ''
|
let provinceCode = ''
|
||||||
@ -436,7 +573,7 @@ export default {
|
|||||||
},
|
},
|
||||||
toggleCard(isup) {
|
toggleCard(isup) {
|
||||||
this.isup = !isup
|
this.isup = !isup
|
||||||
this.$forceUpdate()
|
// 移除不必要的$forceUpdate,由Vue自动检测变化
|
||||||
},
|
},
|
||||||
bindDateChange(e) { // 切换日期 加载选中日期的营收数据
|
bindDateChange(e) { // 切换日期 加载选中日期的营收数据
|
||||||
// let nowDate = this.theRequest.time
|
// let nowDate = this.theRequest.time
|
||||||
@ -448,12 +585,17 @@ export default {
|
|||||||
this.$util.cutDate(selectT, 'MM.DD', -7)]
|
this.$util.cutDate(selectT, 'MM.DD', -7)]
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '正在加载...',
|
title: '正在加载...',
|
||||||
mask: true
|
mask: false // 减少遮罩,提升用户体验
|
||||||
})
|
})
|
||||||
this.initData()
|
// 异步并行加载数据
|
||||||
// this.getTender()
|
Promise.all([
|
||||||
this.todayAmount()
|
this.initData(),
|
||||||
this.$forceUpdate()
|
this.todayAmount()
|
||||||
|
]).catch(err => {
|
||||||
|
console.error('数据刷新失败:', err)
|
||||||
|
uni.hideLoading()
|
||||||
|
})
|
||||||
|
// 移除不必要的$forceUpdate
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -472,15 +614,15 @@ export default {
|
|||||||
})
|
})
|
||||||
this.$util.toNextRoute('navigateTo', severpartIndexPath)
|
this.$util.toNextRoute('navigateTo', severpartIndexPath)
|
||||||
|
|
||||||
item.visited = true
|
// 使用Vue.set确保响应式更新
|
||||||
this.$forceUpdate()
|
this.$set(item, 'visited', true)
|
||||||
},
|
},
|
||||||
selectTab(name, index) {
|
selectTab(name, index) {
|
||||||
this[name] = index
|
this[name] = index
|
||||||
},
|
},
|
||||||
toggleRegion(item) {
|
toggleRegion(item) {
|
||||||
item.show = !item.show ? true : false
|
// 使用Vue.set确保响应式更新
|
||||||
this.$forceUpdate()
|
this.$set(item, 'show', !item.show)
|
||||||
},
|
},
|
||||||
// 切换区域展开/收起状态
|
// 切换区域展开/收起状态
|
||||||
toggleRegionCollapse(item) {
|
toggleRegionCollapse(item) {
|
||||||
@ -515,7 +657,7 @@ export default {
|
|||||||
totalTicketCount: res.Data.TOTALTICKET,
|
totalTicketCount: res.Data.TOTALTICKET,
|
||||||
avrticketCount: this.$util.fmoney(avrticket, 2),
|
avrticketCount: this.$util.fmoney(avrticket, 2),
|
||||||
}
|
}
|
||||||
_this.$forceUpdate()
|
// 移除不必要的$forceUpdate
|
||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -616,8 +758,8 @@ export default {
|
|||||||
},
|
},
|
||||||
toggleShow(i) {
|
toggleShow(i) {
|
||||||
let item = this.regionList[i]
|
let item = this.regionList[i]
|
||||||
item.show = !item.show
|
// 使用Vue.set确保响应式更新
|
||||||
this.$forceUpdate()
|
this.$set(item, 'show', !item.show)
|
||||||
},
|
},
|
||||||
defaultMsg() {
|
defaultMsg() {
|
||||||
let option = null
|
let option = null
|
||||||
@ -634,85 +776,127 @@ export default {
|
|||||||
async initData() { // 初始化营收数据
|
async initData() { // 初始化营收数据
|
||||||
let _this = this
|
let _this = this
|
||||||
console.log('this.theRequest1', this.theRequest)
|
console.log('this.theRequest1', this.theRequest)
|
||||||
|
|
||||||
|
// 检查theRequest是否存在,如果不存在则使用默认值
|
||||||
|
if (!this.theRequest) {
|
||||||
|
console.error('theRequest未初始化')
|
||||||
|
this.isLoading = false
|
||||||
|
this.showPage = false
|
||||||
|
uni.hideLoading()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
this.theRequest.GroupType = 1000
|
this.theRequest.GroupType = 1000
|
||||||
this.theRequest.ServerpartIds = ''
|
this.theRequest.ServerpartIds = ''
|
||||||
const [reginList, totalData, busniessTypePie, busniessTradePie, busniessAreaPie, bayonetPie] =
|
|
||||||
await anhuiYestodayRevenueData.getData(this.theRequest) // 获取实时数据
|
|
||||||
|
|
||||||
if (this.theRequest.GroupType !== 1010) {
|
try {
|
||||||
console.log('reginList', reginList)
|
// 异步加载数据,添加错误处理
|
||||||
this.regionList = reginList // 营收上传列表 reginListModel[]
|
const result = await anhuiYestodayRevenueData.getData(this.theRequest)
|
||||||
}
|
|
||||||
// 组合及格式化 头部卡片总营收数据。
|
|
||||||
totalData.tickave = totalData.ticketCount > 0 ? this.$util.fmoney(
|
|
||||||
totalData.cashPay / totalData.ticketCount, 2) : 0
|
|
||||||
totalData.countave = totalData.totalCount > 0 ? this.$util.fmoney(
|
|
||||||
totalData.cashPay / totalData.totalCount, 2) : 0
|
|
||||||
|
|
||||||
totalData.totalMoneyShow = this.$util.fmoney(totalData.cashPay) // 营收总数据格式化
|
if (!result) {
|
||||||
totalData.dayOfShow = this.$util.cutDate(this.theRequest.time, 'MM月DD日') // 当前日期
|
console.error('数据获取失败')
|
||||||
totalData.budgetamoutShow = totalData.budgetAmount ?
|
this.isLoading = false
|
||||||
_this.$util.fmoney(totalData.budgetAmount) : 0.00 // 预算总营收
|
this.showPage = false
|
||||||
|
uni.hideLoading()
|
||||||
busniessTypePie.forEach((n, i) => {
|
return
|
||||||
if (n.name === '自营') {
|
|
||||||
// 预算和实际差额
|
|
||||||
totalData.diffBudgetTotal = Math.abs(totalData.budgetAmount - n.data)
|
|
||||||
// 预算和实际增长额比例
|
|
||||||
totalData.diffBili = totalData.budgetAmount > 0 ?
|
|
||||||
this.$util.fmoney((totalData.diffBudgetTotal /
|
|
||||||
totalData.budgetAmount) * 100, 2) : '100'
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
this.headMsg = totalData
|
|
||||||
// 饼图分析及数据条形分析
|
|
||||||
const [progressList, pieList] = this.getProgressData(busniessTypePie, totalData.cashPay)
|
|
||||||
this.modelProgress = progressList
|
|
||||||
// 经营类型分析
|
|
||||||
var colors1 = ['#FFAC37', '#6B75B8'];
|
|
||||||
// console.log(pieList)
|
|
||||||
this.showPie({
|
|
||||||
id: 'modelCont',
|
|
||||||
data: pieList,
|
|
||||||
colors: colors1,
|
|
||||||
});
|
|
||||||
// 经营业态
|
|
||||||
|
|
||||||
// 饼图分析及数据条形分析
|
const [reginList, totalData, busniessTypePie, busniessTradePie, busniessAreaPie, bayonetPie] = result
|
||||||
const [tprogressList, tpieList] = this.getProgressData(busniessTradePie, totalData.cashPay)
|
|
||||||
|
|
||||||
this.regionProgress = tprogressList
|
if (this.theRequest.GroupType !== 1010) {
|
||||||
// 经营类型分析
|
console.log('reginList', reginList)
|
||||||
var colors2 = ['#5E67B4', '#4E5699', '#75B7AD', '#AFB7E6'];
|
this.regionList = reginList // 营收上传列表 reginListModel[]
|
||||||
this.showPie({
|
}
|
||||||
id: 'businessCont',
|
// 组合及格式化 头部卡片总营收数据。
|
||||||
data: tpieList,
|
totalData.tickave = totalData.ticketCount > 0 ? this.$util.fmoney(
|
||||||
colors: colors2,
|
totalData.cashPay / totalData.ticketCount, 2) : 0
|
||||||
});
|
totalData.countave = totalData.totalCount > 0 ? this.$util.fmoney(
|
||||||
|
totalData.cashPay / totalData.totalCount, 2) : 0
|
||||||
|
|
||||||
// 饼图分析及数据条形分析
|
totalData.totalMoneyShow = this.$util.fmoney(totalData.cashPay) // 营收总数据格式化
|
||||||
const [aprogressList, apieList] = this.getProgressData(busniessAreaPie, totalData.cashPay)
|
totalData.dayOfShow = this.$util.cutDate(this.theRequest.time, 'MM月DD日') // 当前日期
|
||||||
this.areaProgress = aprogressList
|
totalData.budgetamoutShow = totalData.budgetAmount ?
|
||||||
// 区域营收分析
|
_this.$util.fmoney(totalData.budgetAmount) : 0.00 // 预算总营收
|
||||||
var colors3 = ['#FFAC37', '#d8ece9', '#f7f5f6', '#b2b7e3', '#F4B27A', '#F3B1C9', '#e0e3f7', '#FFE886', '#f7f5f6'];
|
|
||||||
this.showPie({
|
|
||||||
id: 'areaCont',
|
|
||||||
data: apieList,
|
|
||||||
colors: colors3,
|
|
||||||
});
|
|
||||||
|
|
||||||
// 安徽省本级显示的内容
|
busniessTypePie.forEach((n, i) => {
|
||||||
if (this.theRequest.GroupType == 1000 && this.theRequest.ProvinceCode == 340000) {
|
if (n.name === '自营') {
|
||||||
// 显示片区车流量数据分析
|
// 预算和实际差额
|
||||||
const [bayonetList] = this.getBayonetData(bayonetPie)
|
totalData.diffBudgetTotal = Math.abs(totalData.budgetAmount - n.data)
|
||||||
this.bayonetProgress = bayonetList
|
// 预算和实际增长额比例
|
||||||
}
|
totalData.diffBili = totalData.budgetAmount > 0 ?
|
||||||
|
this.$util.fmoney((totalData.diffBudgetTotal /
|
||||||
|
totalData.budgetAmount) * 100, 2) : '100'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.headMsg = totalData
|
||||||
|
// 饼图分析及数据条形分析
|
||||||
|
const [progressList, pieList] = this.getProgressData(busniessTypePie, totalData.cashPay)
|
||||||
|
this.modelProgress = progressList
|
||||||
|
// 延迟渲染图表,优化首屏加载
|
||||||
|
this.$nextTick(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
// 经营类型分析
|
||||||
|
var colors1 = ['#FFAC37', '#6B75B8'];
|
||||||
|
if (pieList.length > 0) {
|
||||||
|
this.showPie({
|
||||||
|
id: 'modelCont',
|
||||||
|
data: pieList,
|
||||||
|
colors: colors1,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (reginList.length) {
|
// 饼图分析及数据条形分析
|
||||||
|
const [tprogressList, tpieList] = this.getProgressData(busniessTradePie, totalData.cashPay)
|
||||||
|
this.regionProgress = tprogressList
|
||||||
|
|
||||||
|
// 经营类型分析
|
||||||
|
var colors2 = ['#5E67B4', '#4E5699', '#75B7AD', '#AFB7E6'];
|
||||||
|
if (tpieList.length > 0) {
|
||||||
|
this.showPie({
|
||||||
|
id: 'businessCont',
|
||||||
|
data: tpieList,
|
||||||
|
colors: colors2,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 饼图分析及数据条形分析
|
||||||
|
const [aprogressList, apieList] = this.getProgressData(busniessAreaPie, totalData.cashPay)
|
||||||
|
this.areaProgress = aprogressList
|
||||||
|
|
||||||
|
// 区域营收分析
|
||||||
|
var colors3 = ['#FFAC37', '#d8ece9', '#f7f5f6', '#b2b7e3', '#F4B27A', '#F3B1C9', '#e0e3f7', '#FFE886', '#f7f5f6'];
|
||||||
|
if (apieList.length > 0) {
|
||||||
|
this.showPie({
|
||||||
|
id: 'areaCont',
|
||||||
|
data: apieList,
|
||||||
|
colors: colors3,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, 100);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 安徽省本级显示的内容
|
||||||
|
if (this.theRequest.GroupType == 1000 && this.theRequest.ProvinceCode == 340000) {
|
||||||
|
// 显示片区车流量数据分析
|
||||||
|
const [bayonetList] = this.getBayonetData(bayonetPie)
|
||||||
|
this.bayonetProgress = bayonetList
|
||||||
|
}
|
||||||
|
|
||||||
|
// 数据加载完成后显示页面并隐藏loading
|
||||||
|
// 即使没有数据也要显示页面,避免白屏
|
||||||
this.showPage = true
|
this.showPage = true
|
||||||
|
this.isLoading = false
|
||||||
|
uni.hideLoading()
|
||||||
|
} catch (error) {
|
||||||
|
console.error('initData执行错误:', error)
|
||||||
|
this.isLoading = false
|
||||||
|
this.showPage = false
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.showToast({
|
||||||
|
title: '数据加载失败',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
this.isLoading = false
|
|
||||||
uni.hideLoading()
|
|
||||||
},
|
},
|
||||||
getProgressData(data, total) {
|
getProgressData(data, total) {
|
||||||
var _data1 = [];
|
var _data1 = [];
|
||||||
@ -820,7 +1004,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.wechatPushSalesList = {}
|
this.wechatPushSalesList = {}
|
||||||
}
|
}
|
||||||
this.$forceUpdate()
|
// 移除不必要的$forceUpdate
|
||||||
},
|
},
|
||||||
// 实时营收
|
// 实时营收
|
||||||
handleRealRevenue() {
|
handleRealRevenue() {
|
||||||
@ -855,19 +1039,59 @@ export default {
|
|||||||
this.opacity = (options.scrollTop - 30) / 68
|
this.opacity = (options.scrollTop - 30) / 68
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
|
console.log('AnhuiIndex onLoad 接收参数:', option)
|
||||||
|
|
||||||
|
// 处理扫码进入的情况
|
||||||
|
if (option.q) {
|
||||||
|
console.log('扫码进入,解析二维码参数')
|
||||||
|
option = this.parseQRCodeParams(option.q)
|
||||||
|
console.log('解析后的参数:', option)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 显示更友好的加载提示
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '正在加载...'
|
title: '正在加载...',
|
||||||
|
mask: false // 允许用户操作,避免阻塞感
|
||||||
})
|
})
|
||||||
if (option.ProvinceCode) { // 从推送进入
|
if (option.ProvinceCode) { // 从推送进入或扫码进入
|
||||||
|
console.log('进入页面,参数:', JSON.stringify(option))
|
||||||
this.theRequest = option
|
this.theRequest = option
|
||||||
option.time = this.$util.cutDate(option.time, 'YYYY-MM-DD')
|
|
||||||
option.month = this.$util.cutDate(option.time, 'YYYYMM')
|
// 确保时间格式正确
|
||||||
|
if (option.time) {
|
||||||
|
console.log('处理前的时间:', option.time)
|
||||||
|
// 如果是完整的日期时间格式,提取日期部分用于API调用
|
||||||
|
var dateForApi = option.time
|
||||||
|
if (option.time.indexOf(' ') > -1) {
|
||||||
|
dateForApi = option.time.split(' ')[0]
|
||||||
|
}
|
||||||
|
// 转换为API需要的格式 YYYY-MM-DD
|
||||||
|
option.time = this.$util.cutDate(dateForApi, 'YYYY-MM-DD')
|
||||||
|
option.month = this.$util.cutDate(option.time, 'YYYYMM')
|
||||||
|
console.log('API用时间格式:', option.time, '月份:', option.month)
|
||||||
|
} else {
|
||||||
|
option.time = this.lastDay
|
||||||
|
option.month = this.$util.cutDate(this.lastDay, 'YYYYMM')
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('处理后的theRequest:', JSON.stringify(this.theRequest))
|
||||||
|
|
||||||
// 初始化省份主题
|
// 初始化省份主题
|
||||||
this.initProvinceCode()
|
this.initProvinceCode()
|
||||||
this.initData()
|
// 优化加载顺序:先显示基础界面,再异步加载数据
|
||||||
this.handleRealRevenue()
|
Promise.all([
|
||||||
|
this.initData(),
|
||||||
|
this.handleRealRevenue()
|
||||||
|
]).catch(err => {
|
||||||
|
console.error('数据加载失败:', err)
|
||||||
|
this.isLoading = false
|
||||||
|
this.showPage = false
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.showToast({
|
||||||
|
title: '加载失败,请重试',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
})
|
||||||
} else { // 默认
|
} else { // 默认
|
||||||
|
|
||||||
if (this.PushAuthority.length > 0) {
|
if (this.PushAuthority.length > 0) {
|
||||||
@ -884,8 +1108,20 @@ export default {
|
|||||||
|
|
||||||
// 初始化省份主题
|
// 初始化省份主题
|
||||||
this.initProvinceCode()
|
this.initProvinceCode()
|
||||||
this.initData()
|
// 优化加载顺序:先显示基础界面,再异步加载数据
|
||||||
this.handleRealRevenue()
|
Promise.all([
|
||||||
|
this.initData(),
|
||||||
|
this.handleRealRevenue()
|
||||||
|
]).catch(err => {
|
||||||
|
console.error('数据加载失败:', err)
|
||||||
|
this.isLoading = false
|
||||||
|
this.showPage = false
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.showToast({
|
||||||
|
title: '加载失败,请重试',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
this.theRequest = null
|
this.theRequest = null
|
||||||
@ -902,7 +1138,7 @@ export default {
|
|||||||
this.getDetail(this.theRequest)
|
this.getDetail(this.theRequest)
|
||||||
}
|
}
|
||||||
// 若省份为甘肃,则加载甘肃单品排行
|
// 若省份为甘肃,则加载甘肃单品排行
|
||||||
if (this.theRequest && (this.theRequest.ProvinceCode == "620000" || this.theRequest.ProvinceCode == "530000" || this.theRequest.ProvinceCode == '734100')) {
|
if (this.theRequest && (this.theRequest.ProvinceCode == "620000" || this.theRequest.ProvinceCode == "530000")) {
|
||||||
this.getRankContent()
|
this.getRankContent()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1233,7 +1469,7 @@ text.fs12 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.top-revenue-card .upLoad-text {
|
.top-revenue-card .upLoad-text {
|
||||||
font-size: 28rpx;
|
font-size: 32rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.check-unit {
|
.check-unit {
|
||||||
@ -1257,7 +1493,7 @@ text.fs12 {
|
|||||||
/* end */
|
/* end */
|
||||||
|
|
||||||
.modle-title {
|
.modle-title {
|
||||||
padding: 0 32rpx 0 32rpx;
|
padding: 0 32rpx 24rpx 32rpx;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #333;
|
color: #333;
|
||||||
@ -1933,7 +2169,7 @@ canvas.operation-content {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.ranking-content .ranking-list-unit {
|
.ranking-content .ranking-list-unit {
|
||||||
font-size: 24rpx;
|
font-size: 28rpx;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2051,7 +2287,7 @@ canvas.operation-content {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tab-label {
|
.tab-label {
|
||||||
font-size: 24rpx;
|
font-size: 26rpx;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
}
|
}
|
||||||
@ -2133,7 +2369,7 @@ canvas.operation-content {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.amount {
|
.amount {
|
||||||
font-size: 24rpx;
|
font-size: 32rpx;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
color: #27B25F;
|
color: #27B25F;
|
||||||
font-family: 'DIN Alternate', 'Bahnschrift', monospace;
|
font-family: 'DIN Alternate', 'Bahnschrift', monospace;
|
||||||
@ -2479,7 +2715,7 @@ canvas.operation-content {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.upload-text {
|
.upload-text {
|
||||||
font-size: 28rpx;
|
font-size: 32rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #2c3e50;
|
color: #2c3e50;
|
||||||
}
|
}
|
||||||
@ -2496,7 +2732,7 @@ canvas.operation-content {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.summary-value {
|
.summary-value {
|
||||||
font-size: 24rpx;
|
font-size: 28rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #27B25F;
|
color: #27B25F;
|
||||||
font-family: 'DIN Alternate', 'Bahnschrift', monospace;
|
font-family: 'DIN Alternate', 'Bahnschrift', monospace;
|
||||||
@ -2656,13 +2892,13 @@ canvas.operation-content {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.region-name {
|
.region-name {
|
||||||
font-size: 24rpx;
|
font-size: 30rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #2c3e50;
|
color: #2c3e50;
|
||||||
}
|
}
|
||||||
|
|
||||||
.region-revenue {
|
.region-revenue {
|
||||||
font-size: 28rpx;
|
font-size: 32rpx;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
color: #27B25F;
|
color: #27B25F;
|
||||||
font-family: 'DIN Alternate', 'Bahnschrift', monospace;
|
font-family: 'DIN Alternate', 'Bahnschrift', monospace;
|
||||||
@ -2685,7 +2921,7 @@ canvas.operation-content {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.metric-value {
|
.metric-value {
|
||||||
font-size: 24rpx;
|
font-size: 26rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
font-family: 'DIN Alternate', 'Bahnschrift', monospace;
|
font-family: 'DIN Alternate', 'Bahnschrift', monospace;
|
||||||
}
|
}
|
||||||
@ -2774,4 +3010,59 @@ canvas.operation-content {
|
|||||||
|
|
||||||
/* 微信小程序兼容性修正 - 移除不支持的特性 */
|
/* 微信小程序兼容性修正 - 移除不支持的特性 */
|
||||||
/* 移除 @media 查询,改用 flex 替代 grid */
|
/* 移除 @media 查询,改用 flex 替代 grid */
|
||||||
|
|
||||||
|
/* 加载骨架屏样式 */
|
||||||
|
.loading-skeleton {
|
||||||
|
padding: 20rpx;
|
||||||
|
background-color: #f8f9fa;
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.skeleton-header {
|
||||||
|
height: 300rpx;
|
||||||
|
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
||||||
|
background-size: 200% 100%;
|
||||||
|
animation: loading 1.5s infinite;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
margin-bottom: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.skeleton-cards {
|
||||||
|
display: flex;
|
||||||
|
gap: 16rpx;
|
||||||
|
margin-bottom: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.skeleton-card {
|
||||||
|
flex: 1;
|
||||||
|
height: 120rpx;
|
||||||
|
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
||||||
|
background-size: 200% 100%;
|
||||||
|
animation: loading 1.5s infinite;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.skeleton-list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.skeleton-item {
|
||||||
|
height: 100rpx;
|
||||||
|
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
||||||
|
background-size: 200% 100%;
|
||||||
|
animation: loading 1.5s infinite;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes loading {
|
||||||
|
0% {
|
||||||
|
background-position: 200% 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
background-position: -200% 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -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,64 +14,86 @@ 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
|
||||||
// 营收数据
|
|
||||||
const data = await request.$webGet('CommercialApi/Revenue/GetRevenuePushList', requestParamas)
|
|
||||||
if (data.Result_Code != 100) return
|
|
||||||
|
|
||||||
// 在营门店数量统计
|
try {
|
||||||
const busniessCounts = await request.$webGet('CommercialApi/BaseInfo/GetShopCountList', requestParamas)
|
// 并行请求优化:同时发起所有API请求,减少加载时间
|
||||||
if (busniessCounts.Result_Code != 100) return
|
const [data, busniessCounts, tradeData, budgetAmount, mobileShare, mallDeliver, bayonetCount] = await Promise.all([
|
||||||
|
request.$webGet('CommercialApi/Revenue/GetRevenuePushList', requestParamas),
|
||||||
|
request.$webGet('CommercialApi/BaseInfo/GetShopCountList', requestParamas),
|
||||||
|
request.$webGet('CommercialApi/BaseInfo/GetBusinessTradeList', requestParamas),
|
||||||
|
request.$webGet('CommercialApi/Revenue/GetBudgetExpenseList', requestParamasBudget),
|
||||||
|
request.$webGet('CommercialApi/Revenue/GetMobileShare', requestParamas),
|
||||||
|
request.$webGet('CommercialApi/Revenue/GetMallDeliver', requestParamas),
|
||||||
|
request.$webGet('CommercialApi/Revenue/GetSPBayonetList', requestParamas)
|
||||||
|
])
|
||||||
|
|
||||||
// 业态关系
|
// 检查数据有效性
|
||||||
const tradeData = await request.$webGet('CommercialApi/BaseInfo/GetBusinessTradeList', requestParamas)
|
if (data.Result_Code != 100 ||
|
||||||
if (tradeData.Result_Code != 100) return
|
busniessCounts.Result_Code != 100 ||
|
||||||
|
tradeData.Result_Code != 100 ||
|
||||||
|
budgetAmount.Result_Code != 100 ||
|
||||||
|
mobileShare.Result_Code != 100 ||
|
||||||
|
mallDeliver.Result_Code != 100 ||
|
||||||
|
bayonetCount.Result_Code != 100) {
|
||||||
|
console.error('部分API请求失败', {
|
||||||
|
data: data.Result_Code,
|
||||||
|
busniessCounts: busniessCounts.Result_Code,
|
||||||
|
tradeData: tradeData.Result_Code,
|
||||||
|
budgetAmount: budgetAmount.Result_Code,
|
||||||
|
mobileShare: mobileShare.Result_Code,
|
||||||
|
mallDeliver: mallDeliver.Result_Code,
|
||||||
|
bayonetCount: bayonetCount.Result_Code
|
||||||
|
})
|
||||||
|
// 返回一个默认的空数据结构,而不是undefined
|
||||||
|
return [[], {
|
||||||
|
cashPay: 0,
|
||||||
|
ticketCount: 0,
|
||||||
|
totalCount: 0,
|
||||||
|
uploadState: '0/0'
|
||||||
|
}, [], [], [], []]
|
||||||
|
}
|
||||||
|
|
||||||
// 计划营收金额
|
if (isServerPartDetail) { // 是服务区营收推送页面
|
||||||
const budgetAmount = await request.$webGet('CommercialApi/Revenue/GetBudgetExpenseList', requestParamasBudget)
|
return _this.getSeverpartReginList(data.Result_Data.List, busniessCounts.Result_Data.List,
|
||||||
if (budgetAmount.Result_Code != 100) return
|
tradeData.Result_Data.List, budgetAmount.Result_Data.List)
|
||||||
|
}
|
||||||
// 移动支付分账数据
|
return _this.getReginList(data.Result_Data.List, busniessCounts.Result_Data.List,
|
||||||
const mobileShare = await request.$webGet('CommercialApi/Revenue/GetMobileShare', requestParamas)
|
tradeData.Result_Data.List, budgetAmount.Result_Data.List,
|
||||||
if (mobileShare.Result_Code != 100) return
|
bayonetCount.Result_Data.List, mobileShare.Result_Data, mallDeliver.Result_Data)
|
||||||
|
// [reginList, totalData, busniessTypePie, busniessTradePie]
|
||||||
|
|
||||||
// 万佳商城配送数据
|
} catch (error) {
|
||||||
const mallDeliver = await request.$webGet('CommercialApi/Revenue/GetMallDeliver', requestParamas)
|
console.error('API请求出错:', error)
|
||||||
if (mallDeliver.Result_Code != 100) return
|
// 返回默认空数据结构
|
||||||
|
return [[], {
|
||||||
// 片区车流量
|
cashPay: 0,
|
||||||
const bayonetCount = await request.$webGet('CommercialApi/Revenue/GetSPBayonetList', requestParamas)
|
ticketCount: 0,
|
||||||
if (bayonetCount.Result_Code != 100) return
|
totalCount: 0,
|
||||||
|
uploadState: '0/0'
|
||||||
if (isServerPartDetail) { // 是服务区营收推送页面
|
}, [], [], [], []]
|
||||||
return _this.getSeverpartReginList(data.Result_Data.List, busniessCounts.Result_Data.List,
|
|
||||||
tradeData.Result_Data.List, budgetAmount.Result_Data.List)
|
|
||||||
}
|
}
|
||||||
return _this.getReginList(data.Result_Data.List, busniessCounts.Result_Data.List,
|
|
||||||
tradeData.Result_Data.List, budgetAmount.Result_Data.List,
|
|
||||||
bayonetCount.Result_Data.List, mobileShare.Result_Data, mallDeliver.Result_Data)
|
|
||||||
// [reginList, totalData, busniessTypePie, busniessTradePie]
|
|
||||||
|
|
||||||
},
|
},
|
||||||
getTotalShowData(newData, oldData,index) {
|
getTotalShowData(newData, oldData, index) {
|
||||||
// <TotalModel>
|
// <TotalModel>
|
||||||
/*
|
/*
|
||||||
type TotalModel = {
|
type TotalModel = {
|
||||||
ticketCount: number // 客单数量 ,
|
ticketCount: number // 客单数量 ,
|
||||||
@ -83,23 +105,23 @@ const methods = {
|
|||||||
different_Price_More: number// 长款金额 ,
|
different_Price_More: number// 长款金额 ,
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
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
|
||||||
@ -109,27 +131,27 @@ const methods = {
|
|||||||
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 = 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],
|
||||||
@ -150,7 +172,7 @@ const methods = {
|
|||||||
oldData.MinVehicle_Count = Number((oldData.MinVehicle_Count + item.MinVehicle_Count).toFixed(2))
|
oldData.MinVehicle_Count = Number((oldData.MinVehicle_Count + item.MinVehicle_Count).toFixed(2))
|
||||||
oldData.MediumVehicle_Count = Number((oldData.MediumVehicle_Count + item.MediumVehicle_Count).toFixed(2))
|
oldData.MediumVehicle_Count = Number((oldData.MediumVehicle_Count + item.MediumVehicle_Count).toFixed(2))
|
||||||
oldData.LargeVehicle_Count = Number((oldData.LargeVehicle_Count + item.LargeVehicle_Count).toFixed(2))
|
oldData.LargeVehicle_Count = Number((oldData.LargeVehicle_Count + item.LargeVehicle_Count).toFixed(2))
|
||||||
|
|
||||||
const oldRegion = oldData.regionList.find(o => o.name === item["Serverpart_Region"])
|
const oldRegion = oldData.regionList.find(o => o.name === item["Serverpart_Region"])
|
||||||
if (oldRegion) {
|
if (oldRegion) {
|
||||||
oldRegion.Vehicle_Count = Number((oldRegion.Vehicle_Count + item.Vehicle_Count).toFixed(2))
|
oldRegion.Vehicle_Count = Number((oldRegion.Vehicle_Count + item.Vehicle_Count).toFixed(2))
|
||||||
@ -159,7 +181,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,
|
||||||
@ -209,10 +231,10 @@ 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,31 +244,31 @@ 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 = '其他'
|
||||||
}
|
}
|
||||||
|
|
||||||
busniessTypePie = _this.getBusniessPie('Business_TypeName', n, busniessTypePie)
|
busniessTypePie = _this.getBusniessPie('Business_TypeName', n, busniessTypePie)
|
||||||
busniessTradePie = _this.getBusniessPie('BusinessTrade_Name', n, busniessTradePie)
|
busniessTradePie = _this.getBusniessPie('BusinessTrade_Name', n, busniessTradePie)
|
||||||
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 = {} // 总营收数据统计
|
||||||
@ -258,14 +280,14 @@ const methods = {
|
|||||||
let totalUploadCount = 0
|
let totalUploadCount = 0
|
||||||
data.map(async (n, index) => {
|
data.map(async (n, index) => {
|
||||||
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 +306,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)
|
||||||
@ -342,19 +364,19 @@ const methods = {
|
|||||||
bayonetPie = _this.getBayonetPie('Serverpart_Name', n, bayonetPie)
|
bayonetPie = _this.getBayonetPie('Serverpart_Name', n, bayonetPie)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
||||||
}
|
}
|
||||||
return [list, totalShow, busniessTypePie, busniessTradePie,busniessAreaPie,bayonetPie]
|
return [list, totalShow, busniessTypePie, busniessTradePie, busniessAreaPie, bayonetPie]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default methods ;
|
export default methods;
|
||||||
|
|
||||||
|
|||||||
@ -153,7 +153,7 @@
|
|||||||
<div class="ct01">
|
<div class="ct01">
|
||||||
<text class="strong-text">{{
|
<text class="strong-text">{{
|
||||||
$util.fmoney(item.CASHPAY, 2)
|
$util.fmoney(item.CASHPAY, 2)
|
||||||
}}</text>
|
}}</text>
|
||||||
<text>元</text>
|
<text>元</text>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -195,7 +195,7 @@
|
|||||||
<div class="ct01">
|
<div class="ct01">
|
||||||
<text class="strong-text">{{
|
<text class="strong-text">{{
|
||||||
$util.fmoney(item.CASHPAY, 2)
|
$util.fmoney(item.CASHPAY, 2)
|
||||||
}}</text>
|
}}</text>
|
||||||
<text>元</text>
|
<text>元</text>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -247,7 +247,7 @@
|
|||||||
<div class="ct01">
|
<div class="ct01">
|
||||||
<text class="strong-text">{{
|
<text class="strong-text">{{
|
||||||
$util.fmoney(item.CASHPAY, 2)
|
$util.fmoney(item.CASHPAY, 2)
|
||||||
}}</text>
|
}}</text>
|
||||||
<text>元</text>
|
<text>元</text>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -557,7 +557,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
toggleCard(isup) {
|
toggleCard(isup) {
|
||||||
this.isup = !isup;
|
this.isup = !isup;
|
||||||
this.$forceUpdate();
|
// 移除不必要的$forceUpdate,由Vue自动检测变化
|
||||||
},
|
},
|
||||||
bindDateChange(e) {
|
bindDateChange(e) {
|
||||||
// 切换日期 加载选中日期的营收数据
|
// 切换日期 加载选中日期的营收数据
|
||||||
@ -574,10 +574,16 @@ export default {
|
|||||||
title: "正在加载...",
|
title: "正在加载...",
|
||||||
mask: true,
|
mask: true,
|
||||||
});
|
});
|
||||||
this.getData();
|
// 异步并行加载数据
|
||||||
this.getTender();
|
Promise.all([
|
||||||
this.todayAmount();
|
this.getData(),
|
||||||
this.$forceUpdate();
|
this.getTender(),
|
||||||
|
this.todayAmount()
|
||||||
|
]).catch(err => {
|
||||||
|
console.error('数据刷新失败:', err);
|
||||||
|
uni.hideLoading();
|
||||||
|
});
|
||||||
|
// 移除不必要的$forceUpdate
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
toDetail(item, provinceId) {
|
toDetail(item, provinceId) {
|
||||||
@ -610,15 +616,15 @@ export default {
|
|||||||
"navigateTo",
|
"navigateTo",
|
||||||
canToSeverpartIndex ? severpartIndexPath : serverpartUploadPath
|
canToSeverpartIndex ? severpartIndexPath : serverpartUploadPath
|
||||||
);
|
);
|
||||||
item.visited = true;
|
// 使用Vue.set确保响应式更新
|
||||||
this.$forceUpdate();
|
this.$set(item, 'visited', true);
|
||||||
},
|
},
|
||||||
selectTab(name, index) {
|
selectTab(name, index) {
|
||||||
this[name] = index;
|
this[name] = index;
|
||||||
},
|
},
|
||||||
toggleRegion(item) {
|
toggleRegion(item) {
|
||||||
item.show = !item.show ? true : false;
|
// 使用Vue.set确保响应式更新
|
||||||
this.$forceUpdate();
|
this.$set(item, 'show', !item.show);
|
||||||
},
|
},
|
||||||
touchPie(e, id) {
|
touchPie(e, id) {
|
||||||
rincanvas[id].showToolTip(e, {
|
rincanvas[id].showToolTip(e, {
|
||||||
@ -647,7 +653,7 @@ export default {
|
|||||||
totalTicketCount: res.Data.TOTALTICKET,
|
totalTicketCount: res.Data.TOTALTICKET,
|
||||||
avrticketCount: this.$util.fmoney(avrticket, 2),
|
avrticketCount: this.$util.fmoney(avrticket, 2),
|
||||||
};
|
};
|
||||||
_this.$forceUpdate();
|
// 移除不必要的$forceUpdate,由Vue自动检测变化
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getRankmMap(list) {
|
getRankmMap(list) {
|
||||||
@ -660,7 +666,7 @@ export default {
|
|||||||
});
|
});
|
||||||
return map;
|
return map;
|
||||||
},
|
},
|
||||||
getData() {
|
async getData() {
|
||||||
let _this = this;
|
let _this = this;
|
||||||
let theRequest = _this.theRequest;
|
let theRequest = _this.theRequest;
|
||||||
let provinceCode = _this.theRequest.ProvinceCode;
|
let provinceCode = _this.theRequest.ProvinceCode;
|
||||||
@ -672,7 +678,7 @@ export default {
|
|||||||
Statistics_Date: theRequest.time,
|
Statistics_Date: theRequest.time,
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$request.$get("getRevenuePush", arr).then((res) => {
|
return this.$request.$get("getRevenuePush", arr).then((res) => {
|
||||||
console.log("res", res);
|
console.log("res", res);
|
||||||
_this.isLoading = false;
|
_this.isLoading = false;
|
||||||
if (res.ResultCode != 100) {
|
if (res.ResultCode != 100) {
|
||||||
@ -711,7 +717,7 @@ export default {
|
|||||||
}
|
}
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
_this.showPage = true;
|
_this.showPage = true;
|
||||||
_this.$forceUpdate();
|
// 移除不必要的$forceUpdate,由Vue自动检测变化
|
||||||
});
|
});
|
||||||
|
|
||||||
function sortMount(list) {
|
function sortMount(list) {
|
||||||
@ -1182,8 +1188,8 @@ export default {
|
|||||||
},
|
},
|
||||||
toggleShow(i) {
|
toggleShow(i) {
|
||||||
let item = this.regionList[i];
|
let item = this.regionList[i];
|
||||||
item.show = !item.show;
|
// 使用Vue.set确保响应式更新
|
||||||
this.$forceUpdate();
|
this.$set(item, 'show', !item.show);
|
||||||
},
|
},
|
||||||
|
|
||||||
changeDate(name, index) {
|
changeDate(name, index) {
|
||||||
@ -1200,7 +1206,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
getTender() {
|
async getTender() {
|
||||||
// 营收趋势
|
// 营收趋势
|
||||||
let _this = this;
|
let _this = this;
|
||||||
let obj = this.theRequest;
|
let obj = this.theRequest;
|
||||||
@ -1216,7 +1222,7 @@ export default {
|
|||||||
2: [],
|
2: [],
|
||||||
3: [],
|
3: [],
|
||||||
};
|
};
|
||||||
_this.$request
|
return _this.$request
|
||||||
.$webGet("WeChat/GetRevenueTrends", {
|
.$webGet("WeChat/GetRevenueTrends", {
|
||||||
Statictics_Type: "Week",
|
Statictics_Type: "Week",
|
||||||
Report_Type: Report_Type[typeIndex],
|
Report_Type: Report_Type[typeIndex],
|
||||||
@ -1266,7 +1272,7 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
_this.$forceUpdate();
|
// 移除不必要的$forceUpdate,由Vue自动检测变化
|
||||||
});
|
});
|
||||||
bili.forEach((biliName, i) => {
|
bili.forEach((biliName, i) => {
|
||||||
if (i == 1) {
|
if (i == 1) {
|
||||||
@ -1345,58 +1351,48 @@ export default {
|
|||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
console.log("indexOption", option);
|
console.log("indexOption", option);
|
||||||
uni.showLoading({
|
|
||||||
title: "正在加载...",
|
|
||||||
});
|
|
||||||
const toSnhuiPageProvinceCode = [
|
const toSnhuiPageProvinceCode = [
|
||||||
340000, 520000, 451200, 510000, 530000, 620000, 630000, 330200, 330300, 734100
|
340000, 520000, 451200, 510000, 530000, 620000, 630000, 330200, 330300, 734100
|
||||||
]; // 需要跳转到安徽类型的每日营收推送页面
|
]; // 需要跳转到安徽类型的每日营收推送页面
|
||||||
|
|
||||||
|
// 优化:先判断是否需要跳转,避免不必要的资源加载
|
||||||
if (option.ProvinceCode) {
|
if (option.ProvinceCode) {
|
||||||
// 从推送进入
|
// 从推送进入 - 立即判断跳转,避免资源浪费
|
||||||
console.log(
|
|
||||||
"12321312",
|
|
||||||
toSnhuiPageProvinceCode.indexOf(parseInt(option.ProvinceCode))
|
|
||||||
);
|
|
||||||
if (toSnhuiPageProvinceCode.indexOf(parseInt(option.ProvinceCode)) > -1) {
|
if (toSnhuiPageProvinceCode.indexOf(parseInt(option.ProvinceCode)) > -1) {
|
||||||
// 451200、510000、520000、620000、630000、330200
|
// 直接跳转,不显示loading,不加载当前页面数据
|
||||||
uni.redirectTo({
|
const url = "/pages/everdayRenven/AnhuiIndex?ProvinceCode=" +
|
||||||
url:
|
option.ProvinceCode +
|
||||||
"/pages/everdayRenven/AnhuiIndex?ProvinceCode=" +
|
"&time=" +
|
||||||
option.ProvinceCode +
|
option.time +
|
||||||
"&time=" +
|
"&GroupType=" +
|
||||||
option.time +
|
option.GroupType +
|
||||||
"&GroupType=" +
|
"&ServerpartIds=" +
|
||||||
option.GroupType +
|
option.ServerpartIds;
|
||||||
"&ServerpartIds=" +
|
|
||||||
option.ServerpartIds,
|
console.log('推送跳转到AnhuiIndex,参数:', url);
|
||||||
});
|
uni.redirectTo({ url });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.theRequest = option;
|
|
||||||
option.time = this.$util.cutDate(option.time, "YYYY-MM-DD");
|
|
||||||
|
|
||||||
this.getData();
|
|
||||||
this.getTender();
|
|
||||||
} else {
|
} else {
|
||||||
// 默认
|
// 默认情况 - 也要先判断是否跳转
|
||||||
if (this.PushAuthority.length > 0) {
|
if (this.PushAuthority.length > 0) {
|
||||||
console.log(1);
|
|
||||||
this.theRequest = this.defaultMsg() || {};
|
this.theRequest = this.defaultMsg() || {};
|
||||||
if (
|
if (
|
||||||
toSnhuiPageProvinceCode.indexOf(this.theRequest.ProvinceCode) > -1
|
toSnhuiPageProvinceCode.indexOf(this.theRequest.ProvinceCode) > -1
|
||||||
) {
|
) {
|
||||||
uni.redirectTo({
|
// 直接跳转,传递完整参数
|
||||||
url: "/pages/everdayRenven/AnhuiIndex",
|
const url = "/pages/everdayRenven/AnhuiIndex?" +
|
||||||
});
|
"ProvinceCode=" + this.theRequest.ProvinceCode +
|
||||||
|
"&GroupType=" + (this.theRequest.GroupType || '1000') +
|
||||||
|
"&time=" + this.lastDay +
|
||||||
|
"&ServerpartIds=" + (this.theRequest.ServerpartIds || '');
|
||||||
|
|
||||||
|
console.log('默认跳转到AnhuiIndex,参数:', url);
|
||||||
|
uni.redirectTo({ url });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.theRequest.time = this.lastDay;
|
|
||||||
this.getData();
|
|
||||||
this.getTender();
|
|
||||||
this.nowTab = this.theRequest.ProvinceCode == 340000 ? 4 : 1;
|
|
||||||
} else {
|
} else {
|
||||||
uni.hideLoading();
|
|
||||||
this.theRequest = null;
|
this.theRequest = null;
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
this.showPage = false;
|
this.showPage = false;
|
||||||
@ -1404,11 +1400,37 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 只有确认不需要跳转时,才开始加载数据
|
||||||
|
uni.showLoading({
|
||||||
|
title: "正在加载...",
|
||||||
|
mask: false
|
||||||
|
});
|
||||||
|
|
||||||
|
if (option.ProvinceCode) {
|
||||||
|
this.theRequest = option;
|
||||||
|
option.time = this.$util.cutDate(option.time, "YYYY-MM-DD");
|
||||||
|
} else {
|
||||||
|
this.theRequest.time = this.lastDay;
|
||||||
|
this.nowTab = this.theRequest.ProvinceCode == 340000 ? 4 : 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 并行加载数据,减少等待时间
|
||||||
|
Promise.all([
|
||||||
|
this.getData(),
|
||||||
|
this.getTender(),
|
||||||
|
this.todayAmount()
|
||||||
|
]).catch(err => {
|
||||||
|
console.error('数据加载失败:', err);
|
||||||
|
uni.hideLoading();
|
||||||
|
this.isLoading = false;
|
||||||
|
});
|
||||||
|
|
||||||
this.sevenDate = [
|
this.sevenDate = [
|
||||||
this.$util.cutDate(new Date(this.theRequest.time), "MM.DD", -13),
|
this.$util.cutDate(new Date(this.theRequest.time), "MM.DD", -13),
|
||||||
this.$util.cutDate(new Date(this.theRequest.time), "MM.DD", -7),
|
this.$util.cutDate(new Date(this.theRequest.time), "MM.DD", -7),
|
||||||
];
|
];
|
||||||
this.todayAmount();
|
|
||||||
if (this.theRequest.GroupType == 1010) {
|
if (this.theRequest.GroupType == 1010) {
|
||||||
this.getDetail(this.theRequest);
|
this.getDetail(this.theRequest);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,187 +1,254 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="page-card" v-if="!isLoading">
|
<view class="page-card" v-if="!isLoading">
|
||||||
<view class="head-card" v-show="pageMsg.Serverpart_Name" @tap="toTrend" >
|
<view class="head-card" v-show="pageMsg.Serverpart_Name" @tap="toTrend">
|
||||||
<view class="uni-flex jc-between ai-center text-strong">
|
<view class="uni-flex jc-between ai-center text-strong">
|
||||||
<view class=""> {{pageMsg.Serverpart_Name}} </view>
|
<view class=""> {{ pageMsg.Serverpart_Name }} </view>
|
||||||
<view class=""> ¥{{$util.fmoney(pageMsg.Serverpart_Revenue,2)}} </view>
|
<view class=""> ¥{{ $util.fmoney(pageMsg.Serverpart_Revenue, 2) }} </view>
|
||||||
</view>
|
</view>
|
||||||
<view class="uni-flex jc-between ai-center">
|
<view class="uni-flex jc-between ai-center">
|
||||||
<text class=""> {{pageMsg.Serverpart_S||'南/东区'}} ¥{{$util.fmoney(pageMsg.Serverpart_RevenueS,2)}}</text>
|
<text class=""> {{ pageMsg.Serverpart_S || '南/东区' }}
|
||||||
<text class=""> {{pageMsg.Serverpart_N||'北/西区'}} ¥{{$util.fmoney(pageMsg.Serverpart_RevenueN,2)}}</text>
|
¥{{ $util.fmoney(pageMsg.Serverpart_RevenueS, 2) }}</text>
|
||||||
|
<text class=""> {{ pageMsg.Serverpart_N || '北/西区' }}
|
||||||
|
¥{{ $util.fmoney(pageMsg.Serverpart_RevenueN, 2) }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="page-list">
|
<view class="page-list" v-if="pageMsg.ShopList && pageMsg.ShopList.length > 0">
|
||||||
<view v-for="(dateItem,i) in pageMsg.revenueReportDetilsDates" :key="i">
|
<!-- <view v-for="(dateItem,i) in pageMsg.revenueReportDetilsDates" :key="i">-->
|
||||||
<text class="list-date"> {{$util.cutDate(dateItem.Statistics_Date,'MM.DD')}}</text>
|
<!-- <text class="list-date"> {{// $util.cutDate(dateItem.Statistics_Date,'MM.DD')}}</text>-->
|
||||||
<view class="cell-body uni-flex ai-center" v-for="(item,i) in dateItem.revenueReportDetils" :key="i">
|
<view class="cell-body uni-flex ai-center" v-for="(item, i) in pageMsg.ShopList" :key="i">
|
||||||
<image :src="item.BusinessType_Logo || '/static/images/revenue/operating-shop.png'" mode="aspectFit"></image>
|
<image :src="item.BusinessType_Logo || '/static/images/revenue/operating-shop.png'" mode="aspectFit">
|
||||||
<view class="">
|
</image>
|
||||||
<view class="uni-flex ai-center jc-between">
|
<view class="">
|
||||||
<text>{{item.BusinessType_Name}}</text>
|
<view class="uni-flex ai-center jc-between">
|
||||||
<text class="shop-total">+ ¥{{$util.fmoney(item.BusinessType_Revenue,2)}}</text>
|
<text>{{ item.BusinessType_Name }}</text>
|
||||||
</view>
|
<text class="shop-total">+ ¥{{ $util.fmoney(item.BusinessType_Revenue, 2) }}</text>
|
||||||
<view class="uni-flex ai-center jc-between">
|
</view>
|
||||||
<text class="type-text" :class="{'scan':item.Upload_Type==1,'port':item.Upload_Type==2}">
|
<view class="uni-flex ai-center jc-between">
|
||||||
<template v-if="item.Upload_Type==1">
|
<text style="display: inline-block;width: 20%" class="type-text"
|
||||||
扫码上传
|
:class="{ 'scan': item.Upload_Type == 1, 'port': item.Upload_Type == 2 }">
|
||||||
</template>
|
<template v-if="item.Upload_Type == 1">
|
||||||
<template v-else-if="item.Upload_Type==2" >
|
扫码上传
|
||||||
接口传输
|
</template>
|
||||||
</template>
|
<template v-else-if="item.Upload_Type == 2">
|
||||||
<template v-else>
|
接口传输
|
||||||
自动上传
|
</template>
|
||||||
</template>
|
<template v-else>
|
||||||
<!-- <text class="type-text scan" v-if="item.Upload_Type==1" >扫码上传</text>
|
自动上传
|
||||||
|
</template>
|
||||||
|
<!-- <text class="type-text scan" v-if="item.Upload_Type==1" >扫码上传</text>
|
||||||
<text class="type-text port" >接口传输</text>
|
<text class="type-text port" >接口传输</text>
|
||||||
<text v-else>自动上传</text> -->
|
<text v-else>自动上传</text> -->
|
||||||
</text>
|
</text>
|
||||||
<view class="uni-flex ai-center">
|
<view class="uni-flex ai-center" style="display: inline-block;width: 80%">
|
||||||
<text class="text-coast">{{item.Serverpart_S||'南/东区'}}: ¥{{$util.fmoney(item.Serverpart_RevenueS,2)}}</text>
|
<div style="display: inline-block;width: 48%;text-align: left;margin-right: 4%"
|
||||||
<text class="text-coast">{{item.Serverpart_N||'北/西区'}}: ¥{{$util.fmoney(item.Serverpart_RevenueN,2)}}</text>
|
class="text-coast">
|
||||||
</view>
|
<text style="display: inline-block;width: 40px;text-align: left">
|
||||||
|
{{ item.Serverpart_RevenueS === 0 || item.Serverpart_RevenueS ?
|
||||||
|
`${item.Serverpart_S}:
|
||||||
|
`: '' }}
|
||||||
|
</text>
|
||||||
|
<text style="display: inline-block;width: calc(100% - 50px);margin-left: 10px">
|
||||||
|
{{ item.Serverpart_RevenueS === 0 || item.Serverpart_RevenueS ?
|
||||||
|
`¥${$util.fmoney(item.Serverpart_RevenueS, 2)}` : '' }}
|
||||||
|
</text>
|
||||||
|
</div>
|
||||||
|
<div style="display: inline-block;width: 48%;text-align: right" class="text-coast">
|
||||||
|
<text style="display: inline-block;width: 40px;text-align: left">
|
||||||
|
{{ item.Serverpart_RevenueN === 0 || item.Serverpart_RevenueN ?
|
||||||
|
`${item.Serverpart_N}:
|
||||||
|
`: '' }}
|
||||||
|
</text>
|
||||||
|
<text style="display: inline-block;width: calc(100% - 50px);margin-left: 10px">
|
||||||
|
{{ item.Serverpart_RevenueN === 0 || item.Serverpart_RevenueN ?
|
||||||
|
`¥${$util.fmoney(item.Serverpart_RevenueN, 2)}` : '' }}
|
||||||
|
</text>
|
||||||
|
</div>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- </view>-->
|
||||||
</view>
|
</view>
|
||||||
<view class="" v-if="!isLoading && !pageMsg.Serverpart_Name">
|
<view class="" v-if="!isLoading && !pageMsg.Serverpart_Name">
|
||||||
<noFound nodata="true" :text="noDataText"/>
|
<noFound nodata="true" :text="noDataText" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isLoading: true,
|
isLoading: true,
|
||||||
pageMsg: {},
|
pageMsg: {},
|
||||||
pageOption: {},
|
pageOption: {},
|
||||||
noDataText: '抱歉,没有数据,请稍后重试'
|
noDataText: '抱歉,没有数据,请稍后重试'
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
toTrend(){
|
|
||||||
this.$util.toNextRoute('navigateTo','/pages/operatingStatements/operatingTrend?name='+this.pageMsg.Serverpart_Name+'&time='+this.pageOption.et+'&id='+this.pageOption.id+'&ProvinceCode='+this.pageOption.pcode)
|
|
||||||
},
|
|
||||||
getDetail(obj){
|
|
||||||
let _this = this
|
|
||||||
uni.showLoading({
|
|
||||||
title:'正在加载...',
|
|
||||||
mask:true
|
|
||||||
})
|
|
||||||
_this.$request.$webGet('WeChat/GetRevenueReportDetils',{
|
|
||||||
startTime: obj.st,
|
|
||||||
endTime: obj.et,
|
|
||||||
Serverpart_Id: obj.id,
|
|
||||||
pushProvinceCode: obj.pcode
|
|
||||||
}).then(res=>{
|
|
||||||
|
|
||||||
if(res.Result_Code==100) {
|
|
||||||
_this.pageMsg = res.Result_Data
|
|
||||||
|
|
||||||
}else{
|
|
||||||
_this.noDataText = res.Result_Desc
|
|
||||||
}
|
|
||||||
uni.hideLoading()
|
|
||||||
_this.isLoading = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
|
||||||
onLoad(op) {
|
|
||||||
this.pageOption = op
|
|
||||||
this.getDetail(op)
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
toTrend() {
|
||||||
|
this.$util.toNextRoute('navigateTo', '/pages/operatingStatements/operatingTrend?name=' + this.pageMsg.Serverpart_Name + '&time=' + this.pageOption.et + '&id=' + this.pageOption.id + '&ProvinceCode=' + this.pageOption.pcode)
|
||||||
|
},
|
||||||
|
getDetail(obj) {
|
||||||
|
let _this = this
|
||||||
|
uni.showLoading({
|
||||||
|
title: '正在加载...',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
|
||||||
|
const req = {
|
||||||
|
provinceCode: obj.pcode,
|
||||||
|
serverpartId: obj.id,
|
||||||
|
startTime: obj.st,
|
||||||
|
endTime: obj.et,
|
||||||
|
}
|
||||||
|
|
||||||
|
_this.$request.$webGet('CommercialApi/Revenue/GetRevenueReportDetil', req).then((res) => {
|
||||||
|
console.log('dadasda', res);
|
||||||
|
|
||||||
|
if (res.Result_Code == 100) {
|
||||||
|
_this.pageMsg = res.Result_Data
|
||||||
|
|
||||||
|
} else {
|
||||||
|
_this.noDataText = res.Result_Desc
|
||||||
|
}
|
||||||
|
uni.hideLoading()
|
||||||
|
_this.isLoading = false
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
// _this.$request.$webGet('WeChat/GetRevenueReportDetils',{
|
||||||
|
// startTime: obj.st,
|
||||||
|
// endTime: obj.et,
|
||||||
|
// Serverpart_Id: obj.id,
|
||||||
|
// pushProvinceCode: obj.pcode
|
||||||
|
// }).then(res=>{
|
||||||
|
|
||||||
|
// if(res.Result_Code==100) {
|
||||||
|
// _this.pageMsg = res.Result_Data
|
||||||
|
|
||||||
|
// }else{
|
||||||
|
// _this.noDataText = res.Result_Desc
|
||||||
|
// }
|
||||||
|
// uni.hideLoading()
|
||||||
|
// _this.isLoading = false
|
||||||
|
// })
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
onLoad(op) {
|
||||||
|
this.pageOption = op
|
||||||
|
this.getDetail(op)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
page {
|
page {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
.page-card {
|
|
||||||
margin: 30rpx 20rpx;
|
.page-card {
|
||||||
|
margin: 30rpx 20rpx;
|
||||||
}
|
|
||||||
.head-card {
|
}
|
||||||
padding: 30rpx 35rpx;
|
|
||||||
background: linear-gradient(to left, #f7f6f8 0%, #eceaeb 100%);
|
.head-card {
|
||||||
border-radius: 12rpx 12rpx 0 0 ;
|
padding: 30rpx 35rpx;
|
||||||
}
|
background: linear-gradient(to left, #f7f6f8 0%, #eceaeb 100%);
|
||||||
.head-card > view+view {
|
border-radius: 12rpx 12rpx 0 0;
|
||||||
margin-top: 16rpx;
|
}
|
||||||
}
|
|
||||||
.text-strong {
|
.head-card>view+view {
|
||||||
font-weight: bolder;
|
margin-top: 16rpx;
|
||||||
}
|
}
|
||||||
.head-card > view>text {
|
|
||||||
font-size: 24rpx;
|
.text-strong {
|
||||||
color: #333;
|
font-weight: bolder;
|
||||||
}
|
}
|
||||||
.list-date {
|
|
||||||
font-size: 22rpx;
|
.head-card>view>text {
|
||||||
background-color: #f8f8f8;
|
font-size: 24rpx;
|
||||||
border-radius: 4rpx;
|
color: #333;
|
||||||
padding: 4rpx 12rpx;
|
}
|
||||||
margin-top: 20rpx;
|
|
||||||
}
|
.list-date {
|
||||||
.page-list {
|
font-size: 22rpx;
|
||||||
border: 1rpx solid #F0F0F0;
|
background-color: #f8f8f8;
|
||||||
border-radius: 0 0 12rpx 12rpx;
|
border-radius: 4rpx;
|
||||||
overflow: hidden;
|
padding: 4rpx 12rpx;
|
||||||
|
margin-top: 20rpx;
|
||||||
padding: 30rpx 16rpx 30rpx 16rpx;
|
}
|
||||||
}
|
|
||||||
.cell-body {
|
.page-list {
|
||||||
position: relative;
|
border: 1rpx solid #F0F0F0;
|
||||||
padding: 20rpx 20rpx 20rpx 0;
|
border-radius: 0 0 12rpx 12rpx;
|
||||||
}
|
overflow: hidden;
|
||||||
.cell-body image {
|
|
||||||
width: 60rpx;
|
padding: 30rpx 16rpx 30rpx 16rpx;
|
||||||
height: 60rpx;
|
}
|
||||||
border-radius: 50%;
|
|
||||||
margin-right: 16rpx;
|
.cell-body {
|
||||||
}
|
position: relative;
|
||||||
.cell-body>view {
|
padding: 20rpx 20rpx 20rpx 0;
|
||||||
flex: 1;
|
}
|
||||||
}
|
|
||||||
.page-list text {
|
.cell-body image {
|
||||||
font-size: 22rpx;
|
width: 60rpx;
|
||||||
color: #2E2E2E;
|
height: 60rpx;
|
||||||
}
|
border-radius: 50%;
|
||||||
text.shop-total {
|
margin-right: 16rpx;
|
||||||
font-size: 24rpx;
|
}
|
||||||
}
|
|
||||||
text.type-text {
|
.cell-body>view {
|
||||||
color: #DFBE9F;
|
flex: 1;
|
||||||
display: flex;
|
}
|
||||||
align-items: center;
|
|
||||||
}
|
.page-list text {
|
||||||
text.type-text.scan::before,text.type-text.port::before {
|
font-size: 22rpx;
|
||||||
content: '';
|
color: #2E2E2E;
|
||||||
width: 21rpx;
|
}
|
||||||
height: 23rpx;
|
|
||||||
margin-right: 8rpx;
|
text.shop-total {
|
||||||
}
|
font-size: 24rpx;
|
||||||
text.type-text.scan::before {
|
}
|
||||||
background: url(/static/images/revenue/scan-up.png) no-repeat center;
|
|
||||||
background-size: contain;
|
text.type-text {
|
||||||
}
|
color: #DFBE9F;
|
||||||
text.type-text.port::before {
|
display: flex;
|
||||||
background: url(/static/images/revenue/port.png) no-repeat center;
|
align-items: center;
|
||||||
background-size: contain;
|
}
|
||||||
}
|
|
||||||
text.type-text.port {
|
text.type-text.scan::before,
|
||||||
color: #95BAF2;
|
text.type-text.port::before {
|
||||||
}
|
content: '';
|
||||||
text.text-coast {
|
width: 21rpx;
|
||||||
color: #848484;
|
height: 23rpx;
|
||||||
width: 184rpx;
|
margin-right: 8rpx;
|
||||||
|
}
|
||||||
}
|
|
||||||
text.text-coast + text.text-coast {
|
text.type-text.scan::before {
|
||||||
text-align: right;
|
background: url(/static/images/revenue/scan-up.png) no-repeat center;
|
||||||
}
|
background-size: contain;
|
||||||
|
}
|
||||||
|
|
||||||
|
text.type-text.port::before {
|
||||||
|
background: url(/static/images/revenue/port.png) no-repeat center;
|
||||||
|
background-size: contain;
|
||||||
|
}
|
||||||
|
|
||||||
|
text.type-text.port {
|
||||||
|
color: #95BAF2;
|
||||||
|
}
|
||||||
|
|
||||||
|
text.text-coast {
|
||||||
|
color: #848484;
|
||||||
|
width: 184rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
text.text-coast+text.text-coast {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user