From 7e78f42e20bc8ff2a16137d1d59430b0c22a3d70 Mon Sep 17 00:00:00 2001 From: lihua <531456470@qq.com> Date: Thu, 15 Aug 2019 12:34:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AE=A1=E8=AE=A1=E5=92=8C?= =?UTF-8?q?=E5=91=8A=E8=AD=A6=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/material.js | 14 ++- src/icons/svg/audit.svg | 1 + src/icons/svg/export.svg | 1 - src/icons/svg/warn.svg | 2 +- src/router/index.js | 6 +- src/store/getters.js | 4 +- src/store/modules/app.js | 16 ++- src/views/layout/components/Navbar.vue | 152 +++++++++++++++++-------- src/views/material/audit/index.vue | 47 +++++++- src/views/material/log/Log.vue | 10 +- src/views/material/log/LogDetail.vue | 16 ++- src/views/material/warehouse/index.vue | 22 +++- 12 files changed, 223 insertions(+), 68 deletions(-) create mode 100644 src/icons/svg/audit.svg delete mode 100644 src/icons/svg/export.svg diff --git a/src/api/material.js b/src/api/material.js index dcac7ba..47cf241 100644 --- a/src/api/material.js +++ b/src/api/material.js @@ -136,10 +136,14 @@ export function donwload() { type: 'application/vnd.ms-excel' }) const fileName = 'template.xlsx' - var link = document.createElement('a') - link.href = window.URL.createObjectURL(blob) - link.download = fileName - link.click() - window.URL.revokeObjectURL(link.href) + if (window.navigator.msSaveOrOpenBlob) { + navigator.msSaveBlob(blob, fileName) + } else { + var link = document.createElement('a') + link.href = window.URL.createObjectURL(blob) + link.download = fileName + link.click() + window.URL.revokeObjectURL(link.href) + } }) } diff --git a/src/icons/svg/audit.svg b/src/icons/svg/audit.svg new file mode 100644 index 0000000..5414f3c --- /dev/null +++ b/src/icons/svg/audit.svg @@ -0,0 +1 @@ + diff --git a/src/icons/svg/export.svg b/src/icons/svg/export.svg deleted file mode 100644 index 9a05de4..0000000 --- a/src/icons/svg/export.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/icons/svg/warn.svg b/src/icons/svg/warn.svg index a4aeaf0..8fd6f68 100644 --- a/src/icons/svg/warn.svg +++ b/src/icons/svg/warn.svg @@ -1 +1 @@ - + diff --git a/src/router/index.js b/src/router/index.js index 684d0d1..db73f79 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -48,9 +48,10 @@ export const constantRouterMap = [ path: 'warehouse', component: () => import('@/views/material/warehouse/index'), meta: { title: '物料仓库', icon: 'warehouse' } - }, { + }, + { path: 'audit', - admin: true, + hidden: true, component: () => import('@/views/material/audit/index'), meta: { title: '出库审核', icon: 'export' } }, @@ -60,6 +61,7 @@ export const constantRouterMap = [ meta: { title: '出入库日志', icon: 'log' } }, { path: 'warn', + hidden: true, component: () => import('@/views/material/warn/index'), meta: { title: '物料告警', icon: 'warn' } }] diff --git a/src/store/getters.js b/src/store/getters.js index 8087473..5547f05 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -3,6 +3,8 @@ const getters = { device: state => state.app.device, token: state => state.user.token, name: state => state.user.name, - role: state => state.user.role + role: state => state.user.role, + auditCount: state => state.app.auditCount, + warnCount: state => state.app.warnCount } export default getters diff --git a/src/store/modules/app.js b/src/store/modules/app.js index f487241..4a8e66d 100644 --- a/src/store/modules/app.js +++ b/src/store/modules/app.js @@ -6,7 +6,9 @@ const app = { opened: !+Cookies.get('sidebarStatus'), withoutAnimation: false }, - device: 'desktop' + device: 'desktop', + auditCount: 0, + warnCount: 0 }, mutations: { TOGGLE_SIDEBAR: state => { @@ -25,6 +27,12 @@ const app = { }, TOGGLE_DEVICE: (state, device) => { state.device = device + }, + SET_AUDIT_COUNT: (state, count) => { + state.auditCount = count + }, + SET_WARN_COUNT: (state, count) => { + state.warnCount = count } }, actions: { @@ -36,6 +44,12 @@ const app = { }, ToggleDevice({ commit }, device) { commit('TOGGLE_DEVICE', device) + }, + SetAuditCount({ commit }, count) { + commit('SET_AUDIT_COUNT', count) + }, + SetWarnCount({ commit }, count) { + commit('SET_WARN_COUNT', count) } } } diff --git a/src/views/layout/components/Navbar.vue b/src/views/layout/components/Navbar.vue index 03695a2..c0500e8 100644 --- a/src/views/layout/components/Navbar.vue +++ b/src/views/layout/components/Navbar.vue @@ -2,24 +2,35 @@