数据总览页面修改

This commit is contained in:
zzyuan 2025-07-24 10:29:39 +08:00
parent 8d356872a7
commit 85f970da9e
7 changed files with 100 additions and 58 deletions

View File

@ -0,0 +1,29 @@
import request from '@/utils/request'
// 实时查询供应商评分-排名
export function supplierScorePageApi(data) {
return request({
url: '/smart-canteen/ims-supplier-score-rule/page',
method: 'get',
headers: {
//"merchant-id":"378915229716713472",
},
params:data
})
}

View File

@ -200,8 +200,8 @@ export default {
<style lang="scss" scoped>
.panel-group {
// margin-top: 5px;
padding-left: 10px;
padding-right: 10px;
padding-left: 20px;
padding-right: 20px;
.card-panel-col {
margin-bottom: 10px;

View File

@ -1,6 +1,16 @@
<template>
<div class="dashboard-editor-container">
<h3 style="font-weight: 600;">数据总览</h3>
<div style="display: flex;justify-content: space-between;align-items: center;margin-bottom: 10px;padding: 0 10px;">
<h3 style="font-weight: 600;">数据总览</h3>
<div style="background: #fff;">
<el-tabs v-model="activeName" @tab-click="handleTabClick" type="card">
<el-tab-pane label="本周" name="1"></el-tab-pane>
<el-tab-pane label="本月" name="2"></el-tab-pane>
<el-tab-pane label="累计" name="3"></el-tab-pane>
</el-tabs>
</div>
</div>
<panel-group :topData="topAreaOptions"/>
<el-row>
<el-col :span="12">
@ -66,6 +76,10 @@ import { getDataScreeningModelApi,
getThisMonthSDishSalesRankingApi,
getProportionOfOrderTypesApi
} from "@/api/index";
import {
supplierScorePageApi
} from "@/api/foodManage/index";
export default {
name: 'Index',
components: {
@ -125,6 +139,7 @@ export default {
type1:1,
type2:1,
type3:1,
activeName:'1',
myCharts1:null,
myCharts2:null,
myCharts3:null,
@ -157,16 +172,14 @@ export default {
}, 500);
}
},
handleTabClick(){
console.log(this.activeName)
},
getTopData(){
getDataScreeningModelApi({}).then((response) => {
this.topAreaOptions = response.data.data;
});
},
changType1(e){
console.log(this.type1)
this.InitEChartsOne()
this.myCharts1.resize();
},
InitEChartsOne() {
let chartData=[]
// let weekDate=["","","","","","",""]
@ -286,12 +299,7 @@ export default {
this.myCharts1 = echarts.init(document.querySelector('#lineChartOne'));
this.myCharts1.setOption(option)
});
},
changType2(e){
console.log(this.type2)
this.InitEChartsTwo()
this.myCharts2.resize();
},
},
InitEChartsTwo() {
let chartData=[]
// let weekDate=["","","","","","",""]
@ -412,6 +420,11 @@ export default {
this.myCharts2.setOption(option)
});
},
changType3(e){
console.log(this.type3)
this.InitEChartsThree()
this.myCharts3.resize();
},
InitEChartsThree() {
var getName = [];
var getValue = [];
@ -430,7 +443,7 @@ export default {
var option = {
backgroundColor: "#fff",
grid: {
left: "10%",
left: "2%",
right: "2%",
bottom: "2%",
top: "10%",
@ -465,6 +478,7 @@ export default {
var str = "";
var no = "NO.";
num = index + 1;
value = value.length > 7 ? value.slice(0, 7) + '...' : value
if (index === 0) {
str = " {num1|" + num + "} {title1|" + value + "}";
} else if (index === 1) {
@ -583,7 +597,7 @@ export default {
zlevel: 1,
itemStyle: {
normal: {
barBorderRadius: 30,
barBorderRadius: 20,
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [
{
offset: 0,
@ -596,19 +610,19 @@ export default {
]),
},
},
barWidth: 14,
barWidth: 12,
data: getValue,
},
{
name: "背景",
type: "bar",
barWidth: 14,
barWidth: 12,
barGap: "-100%",
data: getMax,
itemStyle: {
normal: {
color: "rgba(224, 233, 255, 1)",
barBorderRadius: 30,
barBorderRadius: 20,
},
},
},
@ -622,11 +636,6 @@ export default {
// });
});
},
changType3(e){
console.log(this.type3)
this.InitEChartsFour()
this.myCharts4.resize();
},
InitEChartsFour() {
var chartData=[]
getProportionOfOrderTypesApi({type:this.type3}).then((response) => {
@ -737,7 +746,7 @@ export default {
name: "标题",
type: "pie",
center: ["35%", "50%"],
radius: ["65%", "90%"],
radius: ["60%", "80%"],
clockwise: false, //
avoidLabelOverlap: false,
label: {
@ -772,11 +781,11 @@ export default {
var getName = [];
var getValue = [];
var chartData=[]
getThisMonthSDishSalesRankingApi().then((response) => {
chartData = response.data.slice(0, 10);
supplierScorePageApi({"pageNum": 1,"pageSize": 10}).then((response) => {
chartData = response.rows.slice(0, 10);
chartData.forEach((item,index)=>{
getName.push(item.name)
getValue.push(item.num)
getName.push(item.supplierName)
getValue.push(item.totalScore)
})
var max = Math.max.apply(null, getValue);
var getMax = [];
@ -786,7 +795,7 @@ export default {
var option = {
backgroundColor: "#fff",
grid: {
left: "10%",
left: "2%",
right: "2%",
bottom: "2%",
top: "10%",
@ -812,7 +821,7 @@ export default {
offset: 100,
axisLabel: {
show: true,
align: "left",
align: "left",
textStyle: {
color: "#66cc00",
},
@ -821,6 +830,7 @@ export default {
var str = "";
var no = "NO.";
num = index + 1;
value = value.length > 7 ? value.slice(0, 7) + '...' : value
if (index === 0) {
str = " {num1|" + num + "} {title1|" + value + "}";
} else if (index === 1) {
@ -829,7 +839,7 @@ export default {
str = " {num3|" + num + "} {title3|" + value + "}";
} else {
str = " {num|" + num + "} {title|" + value + "}";
}
}
return str;
},
rich: {
@ -913,7 +923,7 @@ export default {
{
type: "category",
inverse: true,
offset: -20,
offset: -10,
axisTick: "none",
axisLine: "none",
show: true,
@ -939,7 +949,7 @@ export default {
zlevel: 1,
itemStyle: {
normal: {
barBorderRadius: 30,
barBorderRadius: 20,
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [
{
offset: 0,
@ -952,19 +962,19 @@ export default {
]),
},
},
barWidth: 14,
barWidth: 12,
data: getValue,
},
{
name: "背景",
type: "bar",
barWidth: 14,
barWidth: 12,
barGap: "-100%",
data: getMax,
itemStyle: {
normal: {
color: "rgba(224, 233, 255, 1)",
barBorderRadius: 30,
barBorderRadius: 20,
},
},
},
@ -1088,7 +1098,7 @@ export default {
name: "标题",
type: "pie",
center: ["35%", "50%"],
radius: ["65%", "90%"],
radius: ["60%", "80%"],
clockwise: false, //
avoidLabelOverlap: false,
label: {
@ -1124,6 +1134,10 @@ export default {
</script>
<style lang="scss" scoped>
::v-deep .el-tabs__header{
margin: 0;
}
.dashboard-editor-container {
padding: 15px;
background-color: rgb(240, 242, 245);

View File

@ -26,19 +26,17 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
plain
size="mini"
@click="handleRules"
>评分规则设置</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableListData" height="800">
<el-table-column label="序号" align="center" width="80" type="index" fixed="left">
<template slot-scope="scope">
@ -56,7 +54,7 @@
<el-table-column label="订单数量分数" align="center" prop="orderNumScore" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="订单金额分数" align="center" prop="orderAmountScore" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="总分" align="center" prop="totalScore" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
<el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
@ -73,7 +71,7 @@
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
/>
<!-- 添加或修改参数配置对话框 -->
<el-dialog title="评分规则配置" :visible.sync="open" width="800px" append-to-body>
<div style="color: red;">温馨提示配置总分需要为100分请合理配置分数区间分数取最后一条的分数作为合计总分</div>
@ -190,7 +188,7 @@
</template>
<script>
import { systemAreaTreeApi } from "@/api/base/stall";
import { systemAreaTreeApi } from "@/api/base/stall";
import { supplierPageApi,supplierScorePageApi,supplierScoreHistApi,supplierScoreRuleListApi,editSupplierRuleApi } from "@/api/foodManage/supplierManage";
export default {
@ -211,9 +209,7 @@ export default {
//
total: 0,
//
tableListData: [
{supplierName:'111',areaName:'111'},{supplierName:'222',areaName:'222'},
],
tableListData: [],
//
open: false,
//
@ -338,7 +334,7 @@ export default {
queryParams2: {
pageNum: 1,
pageSize: 10
},
},
total2: 0,
histRow:{},
dialogTableData:[],
@ -373,7 +369,7 @@ export default {
supplierPageApi({ isPaging:1,areaIdList:[] }).then((response) => {
this.supplierOptions = response.rows||[];
});
},
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
@ -398,7 +394,7 @@ export default {
this.total = Number(response.total);
this.loading = false;
});
},
},
/** 新增按钮操作 */
handleRules() {
this.reset();
@ -418,7 +414,6 @@ export default {
this.resetForm("form");
},
//item-> sub-> 0%-10%
handleAdd(item){
let sub = item.sectionVOList[item.sectionVOList.length-1]
if(!sub.rightValue||!sub.sectionScore){
@ -492,7 +487,7 @@ export default {
}
}
});
},
},
handleView(row){
this.histRow = row;
this.getList2()
@ -512,7 +507,7 @@ export default {
this.openHistory = true;
this.loading = false;
});
},
},
}
};
</script>

View File

@ -411,7 +411,7 @@ export default {
var option = {
backgroundColor: "#fff",
grid: {
left: "10%",
left: "5%",
right: "2%",
bottom: "2%",
top: "10%",
@ -446,6 +446,7 @@ export default {
var str = "";
var no = "NO.";
num = index + 1;
value = value.length > 8 ? value.slice(0, 8) + '...' : value
if (index === 0) {
str = " {num1|" + num + "} {title1|" + value + "}";
} else if (index === 1) {

View File

@ -572,7 +572,7 @@ export default {
var option = {
backgroundColor: "#fff",
grid: {
left: "10%",
left: "5%",
right: "2%",
bottom: "2%",
top: "10%",
@ -607,6 +607,7 @@ export default {
var str = "";
var no = "NO.";
num = index + 1;
// value = value.length > 6 ? value.slice(0, 6) + '...' : value
if (index === 0) {
str = " {num1|" + num + "} {title1|" + value + "}";
} else if (index === 1) {
@ -779,7 +780,7 @@ export default {
var option = {
backgroundColor: "#fff",
grid: {
left: "10%",
left: "5%",
right: "2%",
bottom: "2%",
top: "10%",
@ -814,6 +815,7 @@ export default {
var str = "";
var no = "NO.";
num = index + 1;
// value = value.length > 6 ? value.slice(0, 6) + '...' : value
if (index === 0) {
str = " {num1|" + num + "} {title1|" + value + "}";
} else if (index === 1) {
@ -986,7 +988,7 @@ export default {
var option = {
backgroundColor: "#fff",
grid: {
left: "10%",
left: "5%",
right: "2%",
bottom: "2%",
top: "10%",
@ -1021,6 +1023,7 @@ export default {
var str = "";
var no = "NO.";
num = index + 1;
// value = value.length > 6 ? value.slice(0, 6) + '...' : value
if (index === 0) {
str = " {num1|" + num + "} {title1|" + value + "}";
} else if (index === 1) {

View File

@ -37,7 +37,7 @@ module.exports = {
[process.env.VUE_APP_BASE_API]: {
// target: `http://192.168.2.75:48380`,//旭
target: `http://192.168.0.244:48380`,//测试
// target: `http://192.168.1.176:48380`,//测试
// target: `http://192.168.0.176:48380`,//刘鑫
// target: `http://192.168.0.44:48380`,//测试
// target: `http://192.168.0.176:48380`,//
changeOrigin: true,