数据总览页面修改

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> <style lang="scss" scoped>
.panel-group { .panel-group {
// margin-top: 5px; // margin-top: 5px;
padding-left: 10px; padding-left: 20px;
padding-right: 10px; padding-right: 20px;
.card-panel-col { .card-panel-col {
margin-bottom: 10px; margin-bottom: 10px;

View File

@ -1,6 +1,16 @@
<template> <template>
<div class="dashboard-editor-container"> <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"/> <panel-group :topData="topAreaOptions"/>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
@ -66,6 +76,10 @@ import { getDataScreeningModelApi,
getThisMonthSDishSalesRankingApi, getThisMonthSDishSalesRankingApi,
getProportionOfOrderTypesApi getProportionOfOrderTypesApi
} from "@/api/index"; } from "@/api/index";
import {
supplierScorePageApi
} from "@/api/foodManage/index";
export default { export default {
name: 'Index', name: 'Index',
components: { components: {
@ -125,6 +139,7 @@ export default {
type1:1, type1:1,
type2:1, type2:1,
type3:1, type3:1,
activeName:'1',
myCharts1:null, myCharts1:null,
myCharts2:null, myCharts2:null,
myCharts3:null, myCharts3:null,
@ -157,16 +172,14 @@ export default {
}, 500); }, 500);
} }
}, },
handleTabClick(){
console.log(this.activeName)
},
getTopData(){ getTopData(){
getDataScreeningModelApi({}).then((response) => { getDataScreeningModelApi({}).then((response) => {
this.topAreaOptions = response.data.data; this.topAreaOptions = response.data.data;
}); });
}, },
changType1(e){
console.log(this.type1)
this.InitEChartsOne()
this.myCharts1.resize();
},
InitEChartsOne() { InitEChartsOne() {
let chartData=[] let chartData=[]
// let weekDate=["","","","","","",""] // let weekDate=["","","","","","",""]
@ -286,12 +299,7 @@ export default {
this.myCharts1 = echarts.init(document.querySelector('#lineChartOne')); this.myCharts1 = echarts.init(document.querySelector('#lineChartOne'));
this.myCharts1.setOption(option) this.myCharts1.setOption(option)
}); });
}, },
changType2(e){
console.log(this.type2)
this.InitEChartsTwo()
this.myCharts2.resize();
},
InitEChartsTwo() { InitEChartsTwo() {
let chartData=[] let chartData=[]
// let weekDate=["","","","","","",""] // let weekDate=["","","","","","",""]
@ -412,6 +420,11 @@ export default {
this.myCharts2.setOption(option) this.myCharts2.setOption(option)
}); });
}, },
changType3(e){
console.log(this.type3)
this.InitEChartsThree()
this.myCharts3.resize();
},
InitEChartsThree() { InitEChartsThree() {
var getName = []; var getName = [];
var getValue = []; var getValue = [];
@ -430,7 +443,7 @@ export default {
var option = { var option = {
backgroundColor: "#fff", backgroundColor: "#fff",
grid: { grid: {
left: "10%", left: "2%",
right: "2%", right: "2%",
bottom: "2%", bottom: "2%",
top: "10%", top: "10%",
@ -465,6 +478,7 @@ export default {
var str = ""; var str = "";
var no = "NO."; var no = "NO.";
num = index + 1; num = index + 1;
value = value.length > 7 ? value.slice(0, 7) + '...' : value
if (index === 0) { if (index === 0) {
str = " {num1|" + num + "} {title1|" + value + "}"; str = " {num1|" + num + "} {title1|" + value + "}";
} else if (index === 1) { } else if (index === 1) {
@ -583,7 +597,7 @@ export default {
zlevel: 1, zlevel: 1,
itemStyle: { itemStyle: {
normal: { normal: {
barBorderRadius: 30, barBorderRadius: 20,
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [ color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [
{ {
offset: 0, offset: 0,
@ -596,19 +610,19 @@ export default {
]), ]),
}, },
}, },
barWidth: 14, barWidth: 12,
data: getValue, data: getValue,
}, },
{ {
name: "背景", name: "背景",
type: "bar", type: "bar",
barWidth: 14, barWidth: 12,
barGap: "-100%", barGap: "-100%",
data: getMax, data: getMax,
itemStyle: { itemStyle: {
normal: { normal: {
color: "rgba(224, 233, 255, 1)", 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() { InitEChartsFour() {
var chartData=[] var chartData=[]
getProportionOfOrderTypesApi({type:this.type3}).then((response) => { getProportionOfOrderTypesApi({type:this.type3}).then((response) => {
@ -737,7 +746,7 @@ export default {
name: "标题", name: "标题",
type: "pie", type: "pie",
center: ["35%", "50%"], center: ["35%", "50%"],
radius: ["65%", "90%"], radius: ["60%", "80%"],
clockwise: false, // clockwise: false, //
avoidLabelOverlap: false, avoidLabelOverlap: false,
label: { label: {
@ -772,11 +781,11 @@ export default {
var getName = []; var getName = [];
var getValue = []; var getValue = [];
var chartData=[] var chartData=[]
getThisMonthSDishSalesRankingApi().then((response) => { supplierScorePageApi({"pageNum": 1,"pageSize": 10}).then((response) => {
chartData = response.data.slice(0, 10); chartData = response.rows.slice(0, 10);
chartData.forEach((item,index)=>{ chartData.forEach((item,index)=>{
getName.push(item.name) getName.push(item.supplierName)
getValue.push(item.num) getValue.push(item.totalScore)
}) })
var max = Math.max.apply(null, getValue); var max = Math.max.apply(null, getValue);
var getMax = []; var getMax = [];
@ -786,7 +795,7 @@ export default {
var option = { var option = {
backgroundColor: "#fff", backgroundColor: "#fff",
grid: { grid: {
left: "10%", left: "2%",
right: "2%", right: "2%",
bottom: "2%", bottom: "2%",
top: "10%", top: "10%",
@ -812,7 +821,7 @@ export default {
offset: 100, offset: 100,
axisLabel: { axisLabel: {
show: true, show: true,
align: "left", align: "left",
textStyle: { textStyle: {
color: "#66cc00", color: "#66cc00",
}, },
@ -821,6 +830,7 @@ export default {
var str = ""; var str = "";
var no = "NO."; var no = "NO.";
num = index + 1; num = index + 1;
value = value.length > 7 ? value.slice(0, 7) + '...' : value
if (index === 0) { if (index === 0) {
str = " {num1|" + num + "} {title1|" + value + "}"; str = " {num1|" + num + "} {title1|" + value + "}";
} else if (index === 1) { } else if (index === 1) {
@ -829,7 +839,7 @@ export default {
str = " {num3|" + num + "} {title3|" + value + "}"; str = " {num3|" + num + "} {title3|" + value + "}";
} else { } else {
str = " {num|" + num + "} {title|" + value + "}"; str = " {num|" + num + "} {title|" + value + "}";
} }
return str; return str;
}, },
rich: { rich: {
@ -913,7 +923,7 @@ export default {
{ {
type: "category", type: "category",
inverse: true, inverse: true,
offset: -20, offset: -10,
axisTick: "none", axisTick: "none",
axisLine: "none", axisLine: "none",
show: true, show: true,
@ -939,7 +949,7 @@ export default {
zlevel: 1, zlevel: 1,
itemStyle: { itemStyle: {
normal: { normal: {
barBorderRadius: 30, barBorderRadius: 20,
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [ color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [
{ {
offset: 0, offset: 0,
@ -952,19 +962,19 @@ export default {
]), ]),
}, },
}, },
barWidth: 14, barWidth: 12,
data: getValue, data: getValue,
}, },
{ {
name: "背景", name: "背景",
type: "bar", type: "bar",
barWidth: 14, barWidth: 12,
barGap: "-100%", barGap: "-100%",
data: getMax, data: getMax,
itemStyle: { itemStyle: {
normal: { normal: {
color: "rgba(224, 233, 255, 1)", color: "rgba(224, 233, 255, 1)",
barBorderRadius: 30, barBorderRadius: 20,
}, },
}, },
}, },
@ -1088,7 +1098,7 @@ export default {
name: "标题", name: "标题",
type: "pie", type: "pie",
center: ["35%", "50%"], center: ["35%", "50%"],
radius: ["65%", "90%"], radius: ["60%", "80%"],
clockwise: false, // clockwise: false, //
avoidLabelOverlap: false, avoidLabelOverlap: false,
label: { label: {
@ -1124,6 +1134,10 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .el-tabs__header{
margin: 0;
}
.dashboard-editor-container { .dashboard-editor-container {
padding: 15px; padding: 15px;
background-color: rgb(240, 242, 245); 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-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="primary" type="primary"
plain plain
size="mini" size="mini"
@click="handleRules" @click="handleRules"
>评分规则设置</el-button> >评分规则设置</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="tableListData" height="800"> <el-table v-loading="loading" :data="tableListData" height="800">
<el-table-column label="序号" align="center" width="80" type="index" fixed="left"> <el-table-column label="序号" align="center" width="80" type="index" fixed="left">
<template slot-scope="scope"> <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="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="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" 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"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
@ -73,7 +71,7 @@
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />
<!-- 添加或修改参数配置对话框 --> <!-- 添加或修改参数配置对话框 -->
<el-dialog title="评分规则配置" :visible.sync="open" width="800px" append-to-body> <el-dialog title="评分规则配置" :visible.sync="open" width="800px" append-to-body>
<div style="color: red;">温馨提示配置总分需要为100分请合理配置分数区间分数取最后一条的分数作为合计总分</div> <div style="color: red;">温馨提示配置总分需要为100分请合理配置分数区间分数取最后一条的分数作为合计总分</div>
@ -190,7 +188,7 @@
</template> </template>
<script> <script>
import { systemAreaTreeApi } from "@/api/base/stall"; import { systemAreaTreeApi } from "@/api/base/stall";
import { supplierPageApi,supplierScorePageApi,supplierScoreHistApi,supplierScoreRuleListApi,editSupplierRuleApi } from "@/api/foodManage/supplierManage"; import { supplierPageApi,supplierScorePageApi,supplierScoreHistApi,supplierScoreRuleListApi,editSupplierRuleApi } from "@/api/foodManage/supplierManage";
export default { export default {
@ -211,9 +209,7 @@ export default {
// //
total: 0, total: 0,
// //
tableListData: [ tableListData: [],
{supplierName:'111',areaName:'111'},{supplierName:'222',areaName:'222'},
],
// //
open: false, open: false,
// //
@ -338,7 +334,7 @@ export default {
queryParams2: { queryParams2: {
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
}, },
total2: 0, total2: 0,
histRow:{}, histRow:{},
dialogTableData:[], dialogTableData:[],
@ -373,7 +369,7 @@ export default {
supplierPageApi({ isPaging:1,areaIdList:[] }).then((response) => { supplierPageApi({ isPaging:1,areaIdList:[] }).then((response) => {
this.supplierOptions = response.rows||[]; this.supplierOptions = response.rows||[];
}); });
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
@ -398,7 +394,7 @@ export default {
this.total = Number(response.total); this.total = Number(response.total);
this.loading = false; this.loading = false;
}); });
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleRules() { handleRules() {
this.reset(); this.reset();
@ -418,7 +414,6 @@ export default {
this.resetForm("form"); this.resetForm("form");
}, },
//item-> sub-> 0%-10% //item-> sub-> 0%-10%
handleAdd(item){ handleAdd(item){
let sub = item.sectionVOList[item.sectionVOList.length-1] let sub = item.sectionVOList[item.sectionVOList.length-1]
if(!sub.rightValue||!sub.sectionScore){ if(!sub.rightValue||!sub.sectionScore){
@ -492,7 +487,7 @@ export default {
} }
} }
}); });
}, },
handleView(row){ handleView(row){
this.histRow = row; this.histRow = row;
this.getList2() this.getList2()
@ -512,7 +507,7 @@ export default {
this.openHistory = true; this.openHistory = true;
this.loading = false; this.loading = false;
}); });
}, },
} }
}; };
</script> </script>

View File

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

View File

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

View File

@ -37,7 +37,7 @@ module.exports = {
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
// target: `http://192.168.2.75:48380`,//旭 // target: `http://192.168.2.75:48380`,//旭
target: `http://192.168.0.244: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.44:48380`,//测试
// target: `http://192.168.0.176:48380`,// // target: `http://192.168.0.176:48380`,//
changeOrigin: true, changeOrigin: true,