Commit a4e463ae authored by dragondean@qq.com's avatar dragondean@qq.com

待出角标

parent d7b2c5ea
...@@ -999,3 +999,11 @@ export function exportOrderSummaryByContainerNumber(params){ ...@@ -999,3 +999,11 @@ export function exportOrderSummaryByContainerNumber(params){
responseType: 'blob' responseType: 'blob'
}) })
} }
// 查询权限范围内待出订单数量
export function getWaitingShipmentCount(){
return request({
url: '/air/order/data/scope/waiting/shipment/count',
method: 'get'
})
}
...@@ -10,20 +10,32 @@ export default { ...@@ -10,20 +10,32 @@ export default {
title: { title: {
type: String, type: String,
default: '' default: ''
} },
badge: Number
}, },
render(h, context) { render(h, context) {
const { icon, title } = context.props const { icon, title, badge } = context.props
const vnodes = [] const vnodes = []
if (icon) { if (icon) {
vnodes.push(<svg-icon icon-class={icon}/>) vnodes.push(<svg-icon icon-class={icon} test="1"/>)
} }
if (title) { if (title) {
vnodes.push(<span slot='title'>{(title)}</span>) vnodes.push(<span><span>{(title)}</span><span class="badge">{badge}</span></span>)
} }
return vnodes return vnodes
} }
} }
</script> </script>
<style lang="scss" scoped>
.badge:not(:empty){
background: red;
color: #fff;
padding: 2px 8px;
font-size: 12px;
border-radius: 10px;
margin-left: 5px;
}
</style>
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
<template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow"> <template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)"> <app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)">
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}"> <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
<item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="$l(onlyOneChild.meta, 'title')" /> <item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="$l(onlyOneChild.meta, 'title')" :badge="badge" />
</el-menu-item> </el-menu-item>
</app-link> </app-link>
</template> </template>
<el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body> <el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body>
<template slot="title"> <template slot="title">
<item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="$l(item.meta, 'title')" /> <item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="$l(item.meta, 'title')" :badge="badge" />
</template> </template>
<sidebar-item <sidebar-item
v-for="child in item.children" v-for="child in item.children"
...@@ -54,6 +54,11 @@ export default { ...@@ -54,6 +54,11 @@ export default {
this.onlyOneChild = null this.onlyOneChild = null
return {} return {}
}, },
computed:{
badge(){
return this.$store.getters.badgeData[this.item.meta.badgeField]
}
},
methods: { methods: {
hasOneShowingChild(children = [], parent) { hasOneShowingChild(children = [], parent) {
if (!children) { if (!children) {
......
...@@ -28,6 +28,7 @@ import { mapGetters, mapState } from "vuex"; ...@@ -28,6 +28,7 @@ import { mapGetters, mapState } from "vuex";
import Logo from "./Logo"; import Logo from "./Logo";
import SidebarItem from "./SidebarItem"; import SidebarItem from "./SidebarItem";
import variables from "@/assets/styles/variables.scss"; import variables from "@/assets/styles/variables.scss";
import {getWaitingShipmentCount} from "@/api/ecw/order";
export default { export default {
components: { SidebarItem, Logo }, components: { SidebarItem, Logo },
...@@ -52,6 +53,13 @@ export default { ...@@ -52,6 +53,13 @@ export default {
isCollapse() { isCollapse() {
return !this.sidebar.opened; return !this.sidebar.opened;
} }
},
created() {
// 查询待出订单数量 waitingShipment
getWaitingShipmentCount().then(res => {
console.log('getWaitingShipmentCount', res.data)
this.$store.commit('SET_BADGE_DATA', { waitingShipment: res.data}, )
})
} }
}; };
</script> </script>
...@@ -17,6 +17,8 @@ const getters = { ...@@ -17,6 +17,8 @@ const getters = {
defaultRoutes:state => state.permission.defaultRoutes, defaultRoutes:state => state.permission.defaultRoutes,
sidebarRouters:state => state.permission.sidebarRouters, sidebarRouters:state => state.permission.sidebarRouters,
// 数据字典 // 数据字典
dict_datas: state => state.dict.dictDatas dict_datas: state => state.dict.dictDatas,
// 角标数据
badgeData: state => state.user.badgeData
} }
export default getters export default getters
...@@ -56,7 +56,8 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) { ...@@ -56,7 +56,8 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
titleEn: route.nameEn, titleEn: route.nameEn,
icon: route.icon, icon: route.icon,
noCache: !route.keepalive, // 不缓存,如果需要缓存则需要组件名称能对应上 noCache: !route.keepalive, // 不缓存,如果需要缓存则需要组件名称能对应上
componentPath: route.component componentPath: route.component,
badgeField: route.badgeField
} }
route.hidden = typeof route.isShowInMenuBar != 'undefined' && (route.isShowInMenuBar == 'false' || !route.isShowInMenuBar) route.hidden = typeof route.isShowInMenuBar != 'undefined' && (route.isShowInMenuBar == 'false' || !route.isShowInMenuBar)
// 处理 component 属性 // 处理 component 属性
......
...@@ -13,7 +13,11 @@ const user = { ...@@ -13,7 +13,11 @@ const user = {
permissions: [], permissions: [],
notMessage:0, notMessage:0,
matterNum:0, matterNum:0,
download: 0 download: 0,
badgeData:{
// 待出订单数量
waitingShipment: 0
}
}, },
mutations: { mutations: {
...@@ -43,6 +47,9 @@ const user = { ...@@ -43,6 +47,9 @@ const user = {
}, },
SET_DOWNLOAD(state, cnt){ SET_DOWNLOAD(state, cnt){
state.download = cnt; state.download = cnt;
},
SET_BADGE_DATA(state, data){
state.badgeData = Object.assign({}, state.badgeData, data)
} }
}, },
......
...@@ -261,7 +261,7 @@ ...@@ -261,7 +261,7 @@
<el-timeline v-if="order.orderTimeVOList && order.orderTimeVOList.length" :reverse="true"> <el-timeline v-if="order.orderTimeVOList && order.orderTimeVOList.length" :reverse="true">
<el-timeline-item v-for="(activity, index) in order.orderTimeVOList" :key="index" :timestamp="parseTime(activity.businessTime)"> <el-timeline-item v-for="(activity, index) in order.orderTimeVOList" :key="index" :timestamp="parseTime(activity.businessTime)">
{{ $l(activity, 'title') }} {{ $l(activity, 'title') }}
<div>{{$l(activity, 'remarks')}}</div> <div :class="{red: !!activity.mark}">{{$l(activity, 'remarks')}}</div>
</el-timeline-item> </el-timeline-item>
</el-timeline> </el-timeline>
<el-result v-else icon="info " :title="$t('暂无数据')" :subTitle="$t('暂无订单动态数据')" /> <el-result v-else icon="info " :title="$t('暂无数据')" :subTitle="$t('暂无订单动态数据')" />
...@@ -794,6 +794,9 @@ export default { ...@@ -794,6 +794,9 @@ export default {
</script> </script>
<style scoped> <style scoped>
.red{
color: red;
}
.card { .card {
margin-bottom: 20px; margin-bottom: 20px;
} }
......
...@@ -148,6 +148,11 @@ ...@@ -148,6 +148,11 @@
<el-input v-model="form.redirect" :placeholder="$t('请输入重定向地址')" /> <el-input v-model="form.redirect" :placeholder="$t('请输入重定向地址')" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item :label="$t('角标字段')" prop="redirect">
<el-input v-model="form.badgeField" :placeholder="$t('不清楚请留空,已设勿改')" />
</el-form-item>
</el-col>
</el-row> </el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment