diff --git a/seller/src/libs/util.js b/seller/src/libs/util.js index 2d833e58..1e79f3fe 100644 --- a/seller/src/libs/util.js +++ b/seller/src/libs/util.js @@ -1,7 +1,7 @@ -import { getCurrentPermissionList } from "@/api/index"; import lazyLoading from './lazyLoading.js'; import Cookies from "js-cookie"; import { result } from './routerJson.js'; +import { getCurrentPermissionList } from "@/api/index"; const config = require('@/config/index') @@ -327,55 +327,40 @@ util.initRouter = function (vm) { // 初始化路由 return; } - if (!vm.$store.state.app.added) { + // 加载菜单 + getCurrentPermissionList().then(res => { - if (!res.success) return false; - let menuData = result; - - - // 格式化数据,设置 空children 为 null - for (let i = 0; i < menuData.length; i++) { - let t = menuData[i].children; - for (let k = 0; k < t.length; k++) { - let tt = t[k].children; - for (let z = 0; z < tt.length; z++) { - tt[z].children = null; - // 给所有三级路由添加字段,显示一级菜单name,方便点击页签时的选中筛选 - tt[z].firstRouterName = menuData[i].name; - } + if (!res.success) return false; + let menuData = res.result; + // 格式化数据,设置 空children 为 null + for (let i = 0; i < menuData.length; i++) { + let t = menuData[i].children + for (let k = 0; k < t.length; k++) { + let tt = t[k].children; + for (let z = 0; z < tt.length; z++) { + tt[z].children = null + // 给所有三级路由添加字段,显示一级菜单name,方便点击页签时的选中筛选 + tt[z].firstRouterName = menuData[i].name + } + } } - } - if (!menuData) { - return; - } - util.initAllMenuData(constRoutes, menuData); - util.initRouterNode(otherRoutes, otherRouter); - // 添加所有主界面路由 - vm.$store.commit( - "updateAppRouter", - constRoutes.filter(item => item.children.length > 0) - ); - // 添加全局路由 - vm.$store.commit("updateDefaultRouter", otherRoutes); - // 添加菜单路由 - util.initMenuData(vm, menuData); - // 缓存数据 修改加载标识 - window.localStorage.setItem("menuData", JSON.stringify(menuData)); - vm.$store.commit("setAdded", true); - }); - - } else { - // 读取缓存数据 - let data = window.localStorage.getItem('menuData'); - if (!data) { - vm.$store.commit('setAdded', false); - return; - } - let menuData = JSON.parse(data); - // 添加菜单路由 - util.initMenuData(vm, menuData); - } + if (!menuData) { + return; + } + util.initAllMenuData(constRoutes, menuData); + util.initRouterNode(otherRoutes, otherRouter); + // 添加所有主界面路由 + vm.$store.commit('updateAppRouter', constRoutes.filter(item => item.children.length > 0)); + // 添加全局路由 + vm.$store.commit('updateDefaultRouter', otherRoutes); + // 添加菜单路由 + util.initMenuData(vm, menuData); + // 缓存数据 修改加载标识 + window.localStorage.setItem('menuData', JSON.stringify(menuData)); + vm.$store.commit('setAdded', true); + }) + }; // 添加所有顶部导航栏下的菜单路由 @@ -384,7 +369,6 @@ util.initAllMenuData = function (constRoutes, data) { let allMenuData = []; data.forEach(e => { if (e.level == 0) { - console.log(e) e.children.forEach(item => { allMenuData.push(item); }) @@ -454,7 +438,6 @@ util.initRouterNode = function (routers, data) { // data为所有子菜单数 for (var item of data) { let menu = Object.assign({}, item); menu.component = lazyLoading(menu.frontRoute); - console.log(menu.component); if (item.children && item.children.length > 0) { menu.children = []; util.initRouterNode(menu.children, item.children); diff --git a/seller/src/views/login.vue b/seller/src/views/login.vue index b53e04b1..067cf4b0 100644 --- a/seller/src/views/login.vue +++ b/seller/src/views/login.vue @@ -2,38 +2,66 @@
-
- -
- - - - - - -
+
+ +
+ + + + + + +
- - + + + - -
-
diff --git a/seller/src/views/order/after-order/returnGoodsOrder.vue b/seller/src/views/order/after-order/returnGoodsOrder.vue index fc39d177..7b46d10e 100644 --- a/seller/src/views/order/after-order/returnGoodsOrder.vue +++ b/seller/src/views/order/after-order/returnGoodsOrder.vue @@ -263,7 +263,6 @@ this.loading = false; if (res.success) { this.data = res.result.records; - this.total = res.result.total; } }); diff --git a/seller/src/views/shop/system/clerk/clerkManage.vue b/seller/src/views/shop/system/clerk/clerkManage.vue index 3d1bdb9f..afcbf299 100644 --- a/seller/src/views/shop/system/clerk/clerkManage.vue +++ b/seller/src/views/shop/system/clerk/clerkManage.vue @@ -110,7 +110,7 @@
+ autocomplete="off" @on-change="checkClerks"/>   @@ -180,6 +180,7 @@ export default { }, data() { return { + open:0, loading: true, // 加载状态 selectCount: 0, // 已选数量 selectList: [], // 已选数据列表 @@ -197,7 +198,7 @@ export default { modalTitle: "", // modal标题 form: { // 表单 username: "", - mobile: "", + mobile: 0, sex: "", isSuper: 0, roles: [], @@ -448,6 +449,16 @@ export default { init() { this.getUserList(); }, + checkClerks() { + this.open = this.form.mobile.length; + console.log(this.open) + if(this.open == 11 ){ + this.checkClerk(); + } + if(this.open < 11){ + this.checkAgainClerk() + } + }, // 选择部门回调 handleSelectDepTree(v) { if (v) { @@ -626,6 +637,7 @@ export default { }, // 添加用户 add() { + // this.checkClerks(); this.modalType = 0; this.modalTitle = "添加店员"; this.$refs.form.resetFields(); @@ -637,7 +649,7 @@ export default { departmentId: "", departmentTitle: "" }, - this.oldMember = false + this.oldMember = false this.newMember = false this.userModalVisible = true; },