emis-frontend/src/views/emis/dashboard.vue

650 lines
24 KiB
Vue
Raw Normal View History

2023-11-27 08:29:42 +00:00
<template>
<div class="dashboard-container">
2024-05-07 04:53:25 +00:00
2023-11-27 08:29:42 +00:00
<!-- <el-row :gutter="10" >
<el-col :xs="3" :sm="3" :md="3" :lg="3" :xl="3">
<el-card class="quick-link-box" shadow="hover">
<router-link to="/user/profile" class="quick-link-wrapper">
<i class="icon iconfont icon-RectangleCopy141" style="color:#2296f3"></i>
<div class="quick-link-title">采购单</div>
</router-link>
</el-card>
</el-col>
<el-col :xs="3" :sm="3" :md="3" :lg="3" :xl="3">
<el-card class="quick-link-box" shadow="hover">
<router-link to="/user/profile" class="quick-link-wrapper">
<i class="icon iconfont icon-RectangleCopy141" style="color:#2296f3"></i>
<div class="quick-link-title">入库单</div>
</router-link>
</el-card>
</el-col>
<el-col :xs="3" :sm="3" :md="3" :lg="3" :xl="3">
<el-card class="quick-link-box" shadow="hover">
<router-link to="/user/profile" class="quick-link-wrapper">
<i class="icon iconfont icon-RectangleCopy141" style="color:#2296f3"></i>
<div class="quick-link-title">订单配货</div>
</router-link>
</el-card>
</el-col>
<el-col :xs="3" :sm="3" :md="3" :lg="3" :xl="3">
<el-card class="quick-link-box" shadow="hover">
<router-link to="/user/profile" class="quick-link-wrapper">
<i class="icon iconfont icon-RectangleCopy141" style="color:#2296f3"></i>
<div class="quick-link-title">入库</div>
</router-link>
</el-card>
</el-col>
<el-col :xs="3" :sm="3" :md="3" :lg="3" :xl="3">
<el-card class="quick-link-box" shadow="hover">
<router-link to="/user/profile" class="quick-link-wrapper">
<i class="icon iconfont icon-RectangleCopy141" style="color:#2296f3"></i>
<div class="quick-link-title">出库</div>
</router-link>
</el-card>
</el-col>
<el-col :xs="3" :sm="3" :md="3" :lg="3" :xl="3">
<el-card class="quick-link-box" shadow="hover">
<router-link to="/user/profile" class="quick-link-wrapper">
<i class="icon iconfont icon-RectangleCopy141" style="color:#2296f3"></i>
<div class="quick-link-title">财务</div>
</router-link>
</el-card>
</el-col>
<el-col :xs="3" :sm="3" :md="3" :lg="3" :xl="3">
<el-card class="quick-link-box" shadow="hover">
<router-link to="/user/profile" class="quick-link-wrapper">
<i class="icon iconfont icon-RectangleCopy141" style="color:#2296f3"></i>
<div class="quick-link-title">清关</div>
</router-link>
</el-card>
</el-col>
<el-col :xs="3" :sm="3" :md="3" :lg="3" :xl="3">
<el-card class="quick-link-box" shadow="hover">
<router-link to="/user/profile" class="quick-link-wrapper">
<i class="icon iconfont icon-RectangleCopy141" style="color:#2296f3"></i>
<div class="quick-link-title">运输</div>
</router-link>
</el-card>
</el-col>
</el-row> -->
<el-row :gutter="10" >
<el-col :xs="24" :sm="24" :md="16" :lg="16" :xl="16">
2024-12-16 13:06:48 +00:00
<CardWithHeader header="当日开单统计" height="146px" >
2023-11-27 08:29:42 +00:00
<template v-slot:body>
<div class="h-overview">
<el-row>
2024-11-25 01:25:50 +00:00
<el-col :span="5">
<div class="count">
<span @click="goRouter('/')" style="color: blue;">
{{queryStatInfoMap?queryStatInfoMap.totalNum:0}}
<span style="color: gray;font-size: 14px;">票</span>
</span>
<!-- <span @click="goRouter('/')">
{{queryStatInfoMap?queryStatInfoMap.totalNum:0}} <span>当月</span>
</span> -->
</div>
<!-- <i class="icon iconfont icon-RectangleCopy141" style="color:#2296f3;font-size: 25px;"></i> -->
<div class="title">当日票数</div>
</el-col>
2023-11-27 08:29:42 +00:00
<el-col :span="6">
2024-11-25 01:25:50 +00:00
<div class="count" style="color: red;">
<span @click="goRouter('/websites')"><span style="color: gray;font-size: 14px;">¥</span>{{queryStatInfoMap?queryStatInfoMap.totalFreight:0}}
</span>
</div>
<div class="title">总运费</div>
</el-col>
<el-col :span="4">
2023-11-27 08:29:42 +00:00
<div class="count">
2024-11-25 01:25:50 +00:00
<span @click="goRouter('/')">{{queryStatInfoMap?queryStatInfoMap.totalBillWeight:0}}
<span style="color: gray;font-size: 14px;">kg</span>
</span>
2023-11-27 08:29:42 +00:00
</div>
<!-- <i class="icon iconfont icon-RectangleCopy141" style="color:#2296f3;font-size: 25px;"></i> -->
2024-11-25 01:25:50 +00:00
<div class="title">实际重量</div>
</el-col>
<el-col :span="4">
<div class="count">
<span @click="goRouter('/')">{{queryStatInfoMap?queryStatInfoMap.totalVolume:0}}
<span style="color: gray;font-size: 14px;">m³</span>
</span>
</div>
<!-- <i class="icon iconfont icon-RectangleCopy141" style="color:#2296f3;font-size: 25px;"></i> -->
<div class="title">体积</div>
</el-col>
<el-col :span="4">
<div class="count">
<span @click="goRouter('/websites')">{{queryStatInfoMap?queryStatInfoMap.totalSettlementWeight:0}}</span>
<span style="color: gray;font-size: 14px;">kg</span>
</div>
<div class="title">结算重量</div>
</el-col>
<!-- <el-col :span="6">
<LineChart :chart-data="lineChartData" />
</el-col> -->
</el-row>
</div>
</template>
</CardWithHeader>
2024-12-17 02:34:05 +00:00
2024-12-16 13:06:48 +00:00
<CardWithHeader header="快捷方式" height="136px" >
<template v-slot:body>
<div style="display: flex;justify-content: flex-start;flex-flow:row wrap ">
<router-link class="quick-link-wrapper" v-for="(quickItem,index) in quickActionList" :key="index" :to="quickItem.path">
<div class="quick-link-title">{{ quickItem.title }}</div>
</router-link>
<!-- <el-button size="medium" type="text" style="color: #b12e29;font-weight: 500;text-decoration: underline;" plain v-for="(quickItem,index) in quickActionList" :key="index" @click="change(quickItem)"><span>{{ quickItem.title }}</span></el-button> -->
</div>
</template>
</CardWithHeader>
2024-12-17 02:34:05 +00:00
<!-- <CardWithHeader header="运单统计" height="146px" >
<template v-slot:body>
<div class="h-overview">
<el-row>
<el-col :span="4" style=" border-right: 1px solid #ebebeb;">
<div class="count">
<span @click="goRouter('/websites')">{{ emisOrderState.issueCount }}</span>
</div>
<div class="title" style="color:red">异常件</div>
</el-col>
<el-col :span="4">
<div class="count">
<span @click="goRouter('/websites')">{{ emisOrderState.totalCount }}</span>
</div>
<div class="title">总订单量</div>
</el-col>
<el-col :span="3">
<div class="count">
<span @click="goRouter('/websites')">{{ emisOrderState.waitGotCount }}</span>
</div>
<div class="title">待接单</div>
</el-col>
<el-col :span="3">
<div class="count">
<span @click="goRouter('/websites')">{{ emisOrderState.transCount }}</span>
</div>
<div class="title">运输中</div>
</el-col>
<el-col :span="3">
<div class="count">
<span @click="goRouter('/websites')">{{ emisOrderState.dispatchCount }}</span>
</div>
<div class="title">派送中</div>
</el-col>
<el-col :span="4">
<div class="count">
<span @click="goRouter('/websites')">{{ emisOrderState.signCount }}</span>
</div>
<div class="title">已签收</div>
</el-col>
</el-row>
</div>
</template>
</CardWithHeader> -->
2024-12-16 13:06:48 +00:00
<!-- <CardWithHeader header="待办提醒" height="146px">
<template v-slot:body>
<QuickLink ></QuickLink>
</template>
</CardWithHeader> -->
2024-12-16 23:37:27 +00:00
<CardWithHeader header="回款提成统计" height="146px" >
2024-11-25 01:25:50 +00:00
<template v-slot:body>
<div class="h-overview">
<el-row>
2023-11-27 08:29:42 +00:00
<el-col :span="6">
<div class="count">
2024-11-25 08:59:17 +00:00
<span @click="goRouter('/')">0/0</span>
2023-11-27 08:29:42 +00:00
</div>
<!-- <i class="icon iconfont icon-RectangleCopy141" style="color:#2296f3;font-size: 25px;"></i> -->
2024-11-25 08:59:17 +00:00
<div class="title">未回款:票数/金额</div>
2023-11-27 08:29:42 +00:00
</el-col>
<el-col :span="6">
<div class="count">
2024-11-25 08:59:17 +00:00
<span @click="goRouter('/')">0/0</span>
2023-11-27 08:29:42 +00:00
</div>
<!-- <i class="icon iconfont icon-RectangleCopy141" style="color:#2296f3;font-size: 25px;"></i> -->
2024-11-25 08:59:17 +00:00
<div class="title">未开票:票数/金额</div>
2023-11-27 08:29:42 +00:00
</el-col>
<el-col :span="6">
<div class="count">
2024-11-25 09:00:40 +00:00
<span @click="goRouter('/')">0</span>
2023-11-27 08:29:42 +00:00
</div>
<!-- <i class="icon iconfont icon-RectangleCopy141" style="color:#2296f3;font-size: 25px;"></i> -->
2024-11-25 08:59:17 +00:00
<div class="title">当月计提</div>
2023-11-27 08:29:42 +00:00
</el-col>
</el-row>
</div>
</template>
</CardWithHeader>
2024-11-25 01:25:50 +00:00
<!-- <CardWithHeader header="日单量趋势(最近15天)" height="400px">
2023-11-27 08:29:42 +00:00
<template v-slot:body>
2024-11-25 01:25:50 +00:00
<LineChart :chart-data="lineChartData" />
2023-11-27 08:29:42 +00:00
</template>
2024-11-25 01:25:50 +00:00
</CardWithHeader> -->
2023-11-27 08:29:42 +00:00
2025-01-10 10:35:33 +00:00
<CardWithHeader header="日单量趋势(最近1个月)" height="400px">
2024-12-16 13:06:48 +00:00
<template v-slot:body>
<LineOrderChart :chart-data="orderStateData" />
</template>
</CardWithHeader>
2024-11-25 01:25:50 +00:00
<!-- <CardWithHeader header="营业收入" style="margin-top: 20px; margin-bottom: 20px">
2023-11-27 08:29:42 +00:00
<template v-slot:body>
2024-11-25 01:25:50 +00:00
<v-charts
2023-11-27 08:29:42 +00:00
height="383px"
id="networkChart"
type="line"
:option="chartsOption['networkChart']"
:dataZoom="true"
2024-11-25 01:25:50 +00:00
/>
2023-11-27 08:29:42 +00:00
</template>
2024-11-25 01:25:50 +00:00
</CardWithHeader> -->
2023-11-27 08:29:42 +00:00
</el-col>
<el-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
<el-card class="box-card" shadow="hover">
<div class="flex items-center" >
<!-- <div>
<el-avatar circle :size="64" :src="avatar" />
</div> -->
<!-- <div style="flex: 1;padding-left: 12px;box-sizing: border-box;"> -->
<div style="flex: 1;padding-left: 0px;box-sizing: border-box;">
2024-11-25 01:25:50 +00:00
<div class="head-title" >Hi,{{ownerSiteName}} {{nickName}},欢迎您!</div>
2023-11-27 08:29:42 +00:00
<!-- <div class="head-sub-title">有问题可直接联系客服。</div> -->
</div>
</div>
2024-11-25 01:25:50 +00:00
<!-- <div style="display:inline-flex;width:100%;margin-top:10px" >
2023-11-27 08:29:42 +00:00
<div style="width: 50%;">
2024-11-25 01:25:50 +00:00
<span style="font-size: 14px;">预估提成(元)</span>
2023-11-27 08:29:42 +00:00
<div style="margin-top: 10px;font-size: 13px;font-weight: 500;">
<span @click="goRouter('/websites')">¥5000.00</span>
</div>
</div>
<div style="width: 50%;">
2024-11-25 01:25:50 +00:00
<span style="font-size: 14px;">待回款(元)</span>
2023-11-27 08:29:42 +00:00
<div style="margin-top: 10px;font-size: 13px;font-weight: 500;">
<span @click="goRouter('/websites')">¥100000.00</span>
</div>
</div>
2024-11-25 01:25:50 +00:00
</div> -->
<!-- <div style="margin-top: 10px;" >
2023-11-27 08:29:42 +00:00
<el-button
:loading="loading"
size="medium"
type="primary"
style="width:30%;"
>
<span>立即充值</span>
</el-button>
2024-11-25 01:25:50 +00:00
</div> -->
2023-11-27 08:29:42 +00:00
</el-card>
<!-- <CardWithHeader header="财务概览" isLinearBg="true">
<template v-slot:body>
</template>
</CardWithHeader> -->
2024-12-16 23:37:27 +00:00
<!-- @click="goRouter(item.clickPath)" -->
2023-11-27 08:29:42 +00:00
<CardWithHeader header="最新消息">
<template v-slot:body>
2024-12-16 13:06:48 +00:00
<div class="xd-notice-list">
<div v-for="(item, index) in noticeList" :key="index" class="xd-home-notice-item">
2024-12-16 23:37:27 +00:00
<div class="xd-item-content" >
2024-12-16 13:06:48 +00:00
<div class="ele-text-secondary ele-elip notice-time" style="display: inline-flex;width: 100%;">
2024-12-16 23:37:27 +00:00
<div style="text-align: left;width: 70%">
<router-link :key="index" :to="item.clickPath">
<div >{{ item.noticeTitle }}</div>
</router-link>
</div>
2024-12-16 13:06:48 +00:00
<div style="text-align: left;width: 30%;font-size: 12px;color:gray;font-weight: 600;">{{ parseTime(item.createTime, '{y}-{m}-{d}') }} </div>
</div>
</div>
</div>
</div>
2023-11-27 08:29:42 +00:00
</template>
</CardWithHeader>
2024-12-16 23:37:27 +00:00
<CardWithHeader header="最新任务">
<template v-slot:body>
<div class="xd-notice-list">
</div>
</template>
</CardWithHeader>
<CardWithHeader header="最近开单">
<template v-slot:body>
<div class="xd-notice-list">
</div>
</template>
</CardWithHeader>
2023-11-27 08:29:42 +00:00
</el-col>
</el-row>
</div>
</template>
<script>
const lineChartData = {
newVisitis: {
expectedData: [100, 120, 161, 134, 105, 160, 165],
actualData: [120, 82, 91, 154, 162, 140, 145]
},
messages: {
expectedData: [200, 192, 120, 144, 160, 130, 140],
actualData: [180, 160, 151, 106, 145, 150, 130]
},
purchases: {
expectedData: [80, 100, 121, 104, 105, 90, 100],
actualData: [120, 90, 100, 138, 142, 130, 130]
},
shoppings: {
expectedData: [130, 140, 141, 142, 145, 150, 160],
actualData: [120, 82, 91, 154, 162, 140, 130]
}
}
2024-05-07 04:53:25 +00:00
import { GridLayout, GridItem } from 'vue-grid-layout'
2024-11-25 01:25:50 +00:00
import { listSimpleAction } from "@/api/system/sysActionStats";
2024-12-16 23:37:27 +00:00
import { getQueryStatInfoMap,getLatestMonthCreateOrderMapList } from "@/api/emis/emisWaybill";
2024-11-25 01:25:50 +00:00
import {timeDiffTime,timeFormat} from '@/utils/dateUtils'
2024-12-16 13:06:48 +00:00
import {getTopNoticeListByUserId,addReadTimes,getPublicNoticeList} from "@/api/system/notice";
2023-11-27 08:29:42 +00:00
import CardWithHeader from '@/components/CardWithHeader/index.vue';
import RaddarChart from './common/RaddarChart.vue';
import LineChart from './common/LineChart.vue';
import QuickLink from './common/QuickLink.vue';
2024-12-16 13:06:48 +00:00
import LineOrderChart from './common/LineOrderChart.vue';
2023-11-27 08:29:42 +00:00
import { mapGetters } from 'vuex'
export default {
name: 'Index',
components: {
CardWithHeader,
RaddarChart,
2024-12-16 13:06:48 +00:00
LineOrderChart,
2023-11-27 08:29:42 +00:00
LineChart,
QuickLink,
2024-05-07 04:53:25 +00:00
GridLayout,
GridItem
2023-11-27 08:29:42 +00:00
},
data() {
return {
loading: false,
2024-12-16 13:06:48 +00:00
noticeList:[],
orderStateData:{
xAxisData:[],
orderStateData:[]
},
2024-12-17 02:34:05 +00:00
emisOrderState:{
dispatchCount: 0,
issueCount:0,
signCount:0,
totalCount:0,
transCount:0,
waitGotCount:0
},
emisBillFeeState:{
totalRecMoney:0,
totalRecedMoney:0,
waitPayMoney:0
},
2024-05-07 04:53:25 +00:00
lineChartData: lineChartData.newVisitis,
2024-11-25 01:25:50 +00:00
quickActionList:[],
queryStatInfoMap:null,
dateRange:[],
2024-05-07 04:53:25 +00:00
layout: [
{ x: 0, y: 0, w: 3, h: 2, i: '1', static: false },
{ x: 6, y: 0, w: 3, h: 2, i: '2', static: false },
],
2023-11-27 08:29:42 +00:00
}
},
computed: {
2024-11-25 01:25:50 +00:00
...mapGetters(['avatar', 'nickName','ownerSiteName']),
2023-11-27 08:29:42 +00:00
},
created() {
2024-12-16 13:06:48 +00:00
this.initUserNotice();
2024-11-25 01:25:50 +00:00
this.initQuickActionList();
this.initOrderStatData();
2023-11-27 08:29:42 +00:00
},
methods: {
2024-12-16 13:06:48 +00:00
initUserNotice() {
// 获取通知信息
getTopNoticeListByUserId().then(response => {
this.noticeList=response.rows;
});
},
2024-11-25 01:25:50 +00:00
initQuickActionList() {
let queryParams={
pageNum: 1,
pageSize: 12,
};
listSimpleAction(queryParams).then(response => {
this.quickActionList = response.rows;
});
},
2024-12-16 13:06:48 +00:00
// initOmsOrderState() {
// getOmsBillFeeStatInfo().then(response => {
// console.log("====>getOmsBillFeeStatInfo===>",response);
// if(response.data!=null){
// this.omsBillFeeState = response.data;
// }
// });
// },
2024-11-25 01:25:50 +00:00
initOrderStatData(){
// 查询统计
let qParam={
sendSiteCode:null,
params:{
2025-01-10 10:35:33 +00:00
sendSiteCode:null,
problemQueryType:2,
problemQueryIds:'173,170,151',
2024-11-25 01:25:50 +00:00
}
}
if(this.$store.getters.ownerSiteCode!='88888'){
qParam.sendSiteCode=this.$store.getters.ownerSiteCode;
}
const end = new Date()
const start = new Date()
start.setHours(0,0,0,0)
end.setHours(23,59,59,0)
this.dateRange=[timeFormat(start), timeFormat(end)]
2024-11-25 01:27:46 +00:00
// let extQParam={...qParam};
let extQParam=this.addDateRange(qParam, this.dateRange,"sendDate");
2024-11-25 01:25:50 +00:00
getQueryStatInfoMap(extQParam).then(response => {
this.queryStatInfoMap = response.data;
});
2024-12-16 13:06:48 +00:00
2024-12-16 23:37:27 +00:00
getLatestMonthCreateOrderMapList().then(response => {
console.log("====>getLatestMonthCreateOrderMapList===>",response);
2024-12-16 13:06:48 +00:00
2024-12-16 23:37:27 +00:00
let xData=[];
let yData=[];
// 做数据转换
response.data.forEach(item => {
xData.push(item.createDay);
yData.push(item.totalNum);
});
2024-12-16 13:06:48 +00:00
2024-12-16 23:37:27 +00:00
this.orderStateData.xAxisData=[...xData];
this.orderStateData.orderStateData=[...yData];
console.log("====>this.orderStateData===>",this.orderStateData);
2024-12-16 13:06:48 +00:00
2024-12-16 23:37:27 +00:00
});
2024-12-16 13:06:48 +00:00
2024-11-25 01:25:50 +00:00
},
2024-12-16 13:06:48 +00:00
goRouterPath(clickPath) {
// 跳转预警详情页面
this.$router.push({
path: clickPath,
query: {
},
});
},
2024-11-25 01:25:50 +00:00
ishttp(url) {
return url.indexOf('http://') !== -1 || url.indexOf('https://') !== -1
},
change(val) {
const path = val.path;
if(this.ishttp(val.path)) {
// http(s):// 路径新窗口打开
const pindex = path.indexOf("http");
window.open(path.substr(pindex, path.length), "_blank");
} else {
this.$router.push(val.path)
}
this.search = ''
this.options = []
this.$nextTick(() => {
this.show = false
})
this.initQuickActionList();
},
2024-05-07 04:53:25 +00:00
layoutUpdatedEvent(newLayout) {
this.layout = newLayout;
},
moveEvent(){
},
movedEvent(){
2023-11-27 08:29:42 +00:00
2024-05-07 04:53:25 +00:00
},
cardLayOut(){
}
2023-11-27 08:29:42 +00:00
},
}
</script>
<style lang="scss" scoped>
.h-overview {
text-align: center;
.title {
margin-top: 10px;
font-size: 14px;
color: var(--el-text-color-regular);
}
.count {
margin-top: 10px;
span {
font-size: 20px;
color: #000;
font-weight: 500;
line-height: 32px;
cursor: pointer;
}
}
}
2024-12-16 13:06:48 +00:00
.xd-home-notice-item {
padding: 10px 8px;
font-size: 13px;
}
2023-11-27 08:29:42 +00:00
.chart-wrapper {
background: #fff;
padding: 16px 16px 0;
margin-bottom: 32px;
}
.h-systemInfo {
margin-left: 18px;
height: 216px;
}
@-moz-document url-prefix() {
.h-systemInfo {
height: auto;
}
}
.system-label {
font-weight: 400 !important;
font-size: 14px !important;
color: #1f2329;
}
.system-content {
font-size: 13px !important;
}
.monitor-tags {
position: absolute;
top: -10px;
left: 20px;
.el-tag {
margin-right: 10px;
margin-bottom: 10px;
}
}
.right-count {
flex-shrink: 0;
text-align: right;
white-space: nowrap;
.count-item {
display: inline-block;
margin: 0 4px 0 24px;
.el-tag{
width: 26px;
height: 26px;
border-radius: 50%;
}
.header{
display: flex;
align-items: center;
margin-bottom: 4px;
font-size: 14px;
font-weight: 800;
.title{
margin-left: 8px;
}
}
.num{
font-weight: normal;
text-align: center;
}
}
}
</style>