Compare commits

...

2 Commits

Author SHA1 Message Date
zhaohengkun
e56315291c Merge remote-tracking branch 'origin/main' 2024-11-05 14:50:52 +08:00
zhaohengkun
04b7e4e7df bug修改 2024-11-05 14:50:47 +08:00
2 changed files with 168 additions and 149 deletions

View File

@ -166,7 +166,7 @@
<span v-else-if="scope.row.type=='3'">储值卡</span>
<span v-else-if="scope.row.type=='4'">积分</span>
<span v-else-if="scope.row.type=='5'">囤油卡</span>
<span v-else-if="scope.row.type=='6'">油品加商品(收银台订单)</span>
<span v-else-if="scope.row.type=='6'">收银台订单</span>
<span v-else-if="scope.row.type=='7'">挂账订单</span>
<span v-else="">其他</span>
</template>

View File

@ -66,7 +66,7 @@
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
@blur="getStoreAmount">
>
</el-date-picker>
</div>
</div>
@ -277,6 +277,11 @@ export default
props: ["accountId"],
data() {
return {
//
chart:null,
chart1:null,
chart2:null,
amountList: [
// "" ,
// "" ,
@ -345,15 +350,20 @@ export default
dataShows: {},
}
},
watch: {
value1: function (newValue, oldValue) {
this.getDataAnalysis()
this.getStoreAmount()
},
},
created() {
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000)
this.value1 = [parseTime(oneWeekAgo), parseTime(nowDate)]
this.countValue = [parseTime(oneWeekAgo), parseTime(nowDate)]
this.showValue = [parseTime(oneWeekAgo), parseTime(nowDate)]
this.getStoreTotal()
// this.selectChildByDeptIdApi()
this.getStoreAmount()
this.selectBannerList()
let start = new Date();
start.setHours(0)
@ -365,13 +375,17 @@ export default
this.getHardwareList()
this.getNoticeList()
this.getEmployeList()
//
this.getStoreAmount()
this.getDataAnalysis()
//
this.getDataShow()
this.getDataCount()
},
mounted() {
setTimeout(() => {
this.initChart();
this.initChartPieChart();
}, 2000);
},
@ -407,8 +421,6 @@ export default
} else if (command == '自定义') {
this.disabled = false
}
this.getStoreAmount()
this.getDataAnalysis()
},
goList() {
this.$router.push('/notificationList/index')
@ -608,29 +620,38 @@ export default
}
})
},
//
//
getStoreAmount() {
let data = {
startTime: this.value1[0],
endTime: this.value1[1]
}
getDataBoardNew(data).then(res => {
this.storeAmount = res.data
})
},
//
getDataAnalysis() {
let data = {
startTime: this.value1[0],
endTime: this.value1[1]
}
//
getOilPercentage(data).then(res => {
this.dataAnalysisOilNumberList = res.data
console.log("饼状图一数据",this.dataAnalysisOilNumberList )
})
//
getOilAndGoodsPercentage(data).then(res => {
this.dataAnalysisIfOilList = res.data
console.log("饼状图二数据",this.dataAnalysisIfOilList)
})
//
getOilAndGoodsAndVipAndPoints(data).then(res => {
this.dataAnalysisAllList = res.data
console.log("饼状图三数据",this.dataAnalysisAllList )
})
//
// this.initChart()
Promise.all([
getOilPercentage(data),
getOilAndGoodsPercentage(data),
getOilAndGoodsAndVipAndPoints(data)
]).then(([res1, res2, res3]) => {
this.dataAnalysisOilNumberList = res1.data;
this.dataAnalysisIfOilList = res2.data;
this.dataAnalysisAllList = res3.data;
this.initChartPieChartUpdate();
}).catch(error => {
console.error('Error fetching data:', error);
});
},
//
getDataShow() {
@ -687,7 +708,7 @@ export default
this.queryParams.ancestors = item.ancestors
}
})
this.getStoreAmount()
this.getDataAnalysis()
},
// banner
selectBannerList() {
@ -713,27 +734,13 @@ export default
this.storeTotal = res.data
})
},
getStoreAmount() {
let data = {
startTime: this.value1[0],
endTime: this.value1[1]
}
getDataBoardNew(data).then(res => {
this.storeAmount = res.data
this.getDataAnalysis()
this.initChart()
})
},
countPercentage(upNum, downNum) {
let percentage = 0;
percentage = (upNum / downNum) * 100
return percentage.toFixed(2)
},
initChart() {
const chart = echarts.init(document.getElementById('ccc'))
const chart1 = echarts.init(document.getElementById('cccc'))
const chart2 = echarts.init(document.getElementById('ccct'))
const chart3 = echarts.init(document.getElementById('ctct'))
const chart4 = echarts.init(document.getElementById('cccf'))
let dataList = []
@ -801,6 +808,124 @@ export default
showCount.push(a)
})
const option3 = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
}
},
legend: {
data: this.dataCount.oilNames,
left: 'right'
},
xAxis: [
{
type: 'category',
// data: ['广1', '广2', '广3', '广4', '广5', '广6', '广7'],
data: times,
axisPointer: {
type: 'shadow'
},
axisLabel: {
interval: 0,
// rotate: 30
}
}
],
yAxis: [
{
type: 'value',
name: '金额(元)',
// min: 0,
// max: 10000,
// interval: 2000,
axisLabel: {
formatter: '{value}'
}
}
],
dataset: {
source: count
},
series: countType,
grid: {
left: '3%',
right: '3%',
bottom: '3%',
containLabel: true
}
};
const option4 = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
}
},
legend: {
data: this.dataShows.oilNames,
left: 'right'
},
xAxis: [
{
type: 'category',
data: showTimes,
axisPointer: {
type: 'shadow'
},
axisLabel: {
interval: 0,
// rotate: 30
}
}
],
yAxis: [
{
type: 'value',
name: '金额(元)',
axisLabel: {
formatter: '{value}'
}
}
],
dataset: {
source: showCount
},
series: showCountType,
grid: {
left: '3%',
right: '3%',
bottom: '5%',
containLabel: true
}
};
chart3.setOption(option3)
chart4.setOption(option4)
},
// ECharts
initChartPieChart(){
this.chart = echarts.init(document.getElementById('ccc'))
this.chart1 = echarts.init(document.getElementById('cccc'))
this.chart2 = echarts.init(document.getElementById('ccct'))
this.initChartPieChartUpdate()
},
// ECharts
initChartPieChartUpdate(){
const option = {
color: [
'#36b713',
@ -922,115 +1047,9 @@ export default
}
]
};
const option3 = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
}
},
legend: {
data: this.dataCount.oilNames,
left: 'right'
},
xAxis: [
{
type: 'category',
// data: ['广1', '广2', '广3', '广4', '广5', '广6', '广7'],
data: times,
axisPointer: {
type: 'shadow'
},
axisLabel: {
interval: 0,
// rotate: 30
}
}
],
yAxis: [
{
type: 'value',
name: '金额(元)',
// min: 0,
// max: 10000,
// interval: 2000,
axisLabel: {
formatter: '{value}'
}
}
],
dataset: {
source: count
},
series: countType,
grid: {
left: '3%',
right: '3%',
bottom: '3%',
containLabel: true
}
};
const option4 = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
}
},
legend: {
data: this.dataShows.oilNames,
left: 'right'
},
xAxis: [
{
type: 'category',
data: showTimes,
axisPointer: {
type: 'shadow'
},
axisLabel: {
interval: 0,
// rotate: 30
}
}
],
yAxis: [
{
type: 'value',
name: '金额(元)',
axisLabel: {
formatter: '{value}'
}
}
],
dataset: {
source: showCount
},
series: showCountType,
grid: {
left: '3%',
right: '3%',
bottom: '5%',
containLabel: true
}
};
chart.setOption(option)
chart1.setOption(option1)
chart2.setOption(option2)
chart3.setOption(option3)
chart4.setOption(option4)
if (this.chart) this.chart.setOption(option);
if (this.chart1) this.chart1.setOption(option1);
if (this.chart2) this.chart2.setOption(option2);
},