From 753d48a91d238af09827ea2e02888d994c8738cb Mon Sep 17 00:00:00 2001 From: fengdong777 <1478994744@qq.com> Date: Wed, 16 Aug 2023 18:03:55 +0800 Subject: [PATCH] 8.16 --- base-ui/package.json | 3 + supervise-crm-ui/package.json | 2 + supervise-crm-ui/src/config/rem.js | 15 ++ .../src/layout/components/Sidebar/index.vue | 11 +- .../src/router/modules/codemenu.js | 13 ++ supervise-crm-ui/src/styles/sidebar.scss | 62 +++--- .../src/utils/devicePixelRatio.js | 44 ++++ .../src/views/projectStaff/index.vue | 195 ++++++++++++++++++ supervise-enterprise-ui/package.json | 3 + .../src/layout/components/Sidebar/index.vue | 131 +++++++++++- supervise-enterprise-ui/src/main.js | 70 +------ .../src/router/modules/codemenu.js | 78 +++++++ .../src/views/NewList/market.vue | 62 ++++++ .../src/views/NewList/needMoney.vue | 62 ++++++ .../src/views/NewList/outbound.vue | 114 ++++++++++ .../src/views/NewList/returnedMoney.vue | 62 ++++++ .../src/views/NewList/warehouse.vue | 115 +++++++++++ .../component/stockManagement/stockList.vue | 34 ++- 18 files changed, 961 insertions(+), 115 deletions(-) create mode 100644 supervise-crm-ui/src/config/rem.js create mode 100644 supervise-crm-ui/src/utils/devicePixelRatio.js create mode 100644 supervise-crm-ui/src/views/projectStaff/index.vue create mode 100644 supervise-enterprise-ui/src/views/NewList/market.vue create mode 100644 supervise-enterprise-ui/src/views/NewList/needMoney.vue create mode 100644 supervise-enterprise-ui/src/views/NewList/outbound.vue create mode 100644 supervise-enterprise-ui/src/views/NewList/returnedMoney.vue create mode 100644 supervise-enterprise-ui/src/views/NewList/warehouse.vue diff --git a/base-ui/package.json b/base-ui/package.json index 095cfd02..ab87973d 100644 --- a/base-ui/package.json +++ b/base-ui/package.json @@ -25,11 +25,14 @@ "path-to-regexp": "2.4.0", "portfinder": "^1.0.21", "qs": "^6.9.4", + "regenerator-runtime": "^0.14.0", "sass-resources-loader": "^2.1.1", + "svg-baker-runtime": "^1.4.7", "viewerjs": "^1.9.0", "vue": "2.6.10", "vue-amap": "^0.5.10", "vue-router": "3.0.6", + "vue-style-loader": "^4.1.3", "vuex": "3.1.0", "vuex-persistedstate": "^4.0.0" }, diff --git a/supervise-crm-ui/package.json b/supervise-crm-ui/package.json index b7226334..4ccdb261 100644 --- a/supervise-crm-ui/package.json +++ b/supervise-crm-ui/package.json @@ -32,6 +32,7 @@ "vue": "2.6.10", "vue-amap": "^0.5.10", "vue-router": "3.0.6", + "vue2-scale-box": "^0.1.7", "vuex": "3.1.0", "vuex-persistedstate": "^4.0.0", "xcrud": "^0.4.19" @@ -53,6 +54,7 @@ "eslint-plugin-vue": "6.2.2", "html-webpack-plugin": "3.2.0", "mockjs": "1.0.1-beta3", + "postcss-pxtorem": "^6.0.0", "runjs": "4.3.2", "sass": "1.26.8", "sass-loader": "8.0.2", diff --git a/supervise-crm-ui/src/config/rem.js b/supervise-crm-ui/src/config/rem.js new file mode 100644 index 00000000..8cf194d8 --- /dev/null +++ b/supervise-crm-ui/src/config/rem.js @@ -0,0 +1,15 @@ +// 基准大小 +const baseSize = 32 +// 设置 rem 函数 +function setRem () { + // 当前页面宽度相对于 750 宽的缩放比例,可根据自己需要修改。 + const scale = document.documentElement.clientWidth / 750 + // 设置页面根节点字体大小 + document.documentElement.style.fontSize = (baseSize * Math.min(scale, 2)) + 'px' +} +// 初始化 +setRem() +// 改变窗口大小时重新设置 rem +window.onresize = function () { + setRem() +} \ No newline at end of file diff --git a/supervise-crm-ui/src/layout/components/Sidebar/index.vue b/supervise-crm-ui/src/layout/components/Sidebar/index.vue index 637a9f18..a8722453 100644 --- a/supervise-crm-ui/src/layout/components/Sidebar/index.vue +++ b/supervise-crm-ui/src/layout/components/Sidebar/index.vue @@ -19,8 +19,7 @@ import SidebarItem from './SidebarItem' import variables from '@/styles/variables.scss' import { - getrolemenus, - loginDetails + getrolemenus } from '@/api/system/Role/role.js' import { getStorage @@ -79,12 +78,6 @@ methods: { // 获取用户信息 postHuoquyonghu() { - // var token = getStorage() - // loginDetails(token).then((response) => { - // console.log('resss', response) - // if (response.code === '200') { - // this.YongHuid = response.data - // this.params.userSid = this.YongHuid.sid getrolemenus(this.params).then((res) => { console.log('userRoles', res.data) const userRoles = this.resRouter(res.data) @@ -94,8 +87,6 @@ hidden: true }) return userRoles - // }) - // } }) }, resRouter(menus) { diff --git a/supervise-crm-ui/src/router/modules/codemenu.js b/supervise-crm-ui/src/router/modules/codemenu.js index 392453b8..621e6a2b 100644 --- a/supervise-crm-ui/src/router/modules/codemenu.js +++ b/supervise-crm-ui/src/router/modules/codemenu.js @@ -66,5 +66,18 @@ const codemenu = [{ noCache: true } }] +},{ + path: 'projectStaff', + component: Layout, + redirect: '/projectStaff', + children: [{ + path: '/projectStaff/index', + component: () => import('@/views/projectStaff/index.vue'), + name: 'projectStaff', + meta: { + title: '项目人员', + noCache: true + } + }] }] export default codemenu diff --git a/supervise-crm-ui/src/styles/sidebar.scss b/supervise-crm-ui/src/styles/sidebar.scss index 4d304e20..e98bf8c2 100644 --- a/supervise-crm-ui/src/styles/sidebar.scss +++ b/supervise-crm-ui/src/styles/sidebar.scss @@ -9,38 +9,42 @@ position: relative; overflow: hidden; } + //.TagsView{ // height: 50px; //} - .home-box{ - position: fixed; - top: 60px; - left: 0; - background-color: $menuBg; + .home-box { + position: fixed; + top: 60px; + left: 0; + background-color: $menuBg; border: 1px solid $menuHover; - line-height: 40px; - width: 210px; + line-height: 40px; + width: 210px; z-index: 1000; - a{ - display: inline-block; - line-height: 40px; - box-sizing: border-box; + + a { + display: inline-block; + line-height: 40px; + box-sizing: border-box; width: 50%; text-align: center; - font-size: 16px; - font-weight: 500; + font-size: 16px; + font-weight: 500; color: #FFFFFF; - } - a:last-child{ - border:0; + } + + a:last-child { + border: 0; background-color: $menuHover; - } + } } + .sidebar-container { transition: width 0.28s; width: $sideBarWidth !important; background-color: $menuBg; - height: calc(100% - 60px) ; + height: calc(100% - 60px); position: absolute; font-size: 0px; top: 60px; @@ -56,7 +60,7 @@ } .scrollbar-wrapper { - height: calc(100% - 40px) ; //此高度是100%减去页面底部的栏高 + height: calc(100% - 40px); //此高度是100%减去页面底部的栏高 overflow-x: hidden !important; } @@ -106,9 +110,11 @@ background-color: $menuHover !important; } } - .el-submenu__title i{ - color: #FFFFFF; - } + + .el-submenu__title i { + color: #FFFFFF; + } + .is-active>.el-submenu__title { color: $subMenuActiveText !important; } @@ -122,9 +128,10 @@ background-color: $subMenuHover !important; } } - & .el-menu-item.is-active { - background-color: $subMenuHover !important; - } + + & .el-menu-item.is-active { + background-color: $subMenuHover !important; + } } // .hideSidebar { @@ -175,7 +182,7 @@ // .el-menu--collapse { // .el-submenu { - // &>.el-submenu__title { + // &>.el-submenu__le { // &>span { // height: 0; // width: 0; @@ -227,6 +234,7 @@ .svg-icon { margin-right: 16px; } + .sub-el-icon { margin-right: 12px; margin-left: -2px; @@ -259,4 +267,4 @@ border-radius: 20px; } } -} +} \ No newline at end of file diff --git a/supervise-crm-ui/src/utils/devicePixelRatio.js b/supervise-crm-ui/src/utils/devicePixelRatio.js new file mode 100644 index 00000000..f7648a56 --- /dev/null +++ b/supervise-crm-ui/src/utils/devicePixelRatio.js @@ -0,0 +1,44 @@ +class devicePixelRatio { + /* 获取系统类型 */ + getSystem() { + const agent = navigator.userAgent.toLowerCase(); + const isMac = /macintosh|mac os x/i.test(navigator.userAgent); + if (isMac) return false; + // 目前只针对 win 处理,其它系统暂无该情况,需要则继续在此添加即可 + if (agent.indexOf("windows") >= 0) return true; + } + /* 监听方法兼容写法 */ + addHandler(element, type, handler) { + if (element.addEventListener) { + element.addEventListener(type, handler, false); + } else if (element.attachEvent) { + element.attachEvent("on" + type, handler); + } else { + element["on" + type] = handler; + } + } + /* 校正浏览器缩放比例 */ + correct() { + // 页面devicePixelRatio(设备像素比例)变化后,计算页面body标签zoom修改其大小,来抵消devicePixelRatio带来的变化 + document.getElementsByTagName("body")[0].style.zoom = + 1 / window.devicePixelRatio; + } + /* 监听页面缩放 */ + watch() { + const that = this; + // 注意: 这个方法是解决全局有两个window.resize + that.addHandler(window, "resize", function () { + that.correct(); // 重新校正浏览器缩放比例 + }); + } + /* 初始化页面比例 */ + init() { + const that = this; + // 判断设备,只在 win 系统下校正浏览器缩放比例 + if (that.getSystem()) { + that.correct(); // 校正浏览器缩放比例 + that.watch(); // 监听页面缩放 + } + } + } + export default devicePixelRatio; \ No newline at end of file diff --git a/supervise-crm-ui/src/views/projectStaff/index.vue b/supervise-crm-ui/src/views/projectStaff/index.vue new file mode 100644 index 00000000..b1b9dd65 --- /dev/null +++ b/supervise-crm-ui/src/views/projectStaff/index.vue @@ -0,0 +1,195 @@ + + + + \ No newline at end of file diff --git a/supervise-enterprise-ui/package.json b/supervise-enterprise-ui/package.json index b7226334..eea95083 100644 --- a/supervise-enterprise-ui/package.json +++ b/supervise-enterprise-ui/package.json @@ -27,11 +27,14 @@ "path-to-regexp": "2.4.0", "portfinder": "^1.0.21", "qs": "^6.9.4", + "regenerator-runtime": "^0.14.0", "sass-resources-loader": "^2.1.1", + "svg-baker-runtime": "^1.4.7", "viewerjs": "^1.9.0", "vue": "2.6.10", "vue-amap": "^0.5.10", "vue-router": "3.0.6", + "vue-style-loader": "^4.1.3", "vuex": "3.1.0", "vuex-persistedstate": "^4.0.0", "xcrud": "^0.4.19" diff --git a/supervise-enterprise-ui/src/layout/components/Sidebar/index.vue b/supervise-enterprise-ui/src/layout/components/Sidebar/index.vue index 0569393a..974e264c 100644 --- a/supervise-enterprise-ui/src/layout/components/Sidebar/index.vue +++ b/supervise-enterprise-ui/src/layout/components/Sidebar/index.vue @@ -33,7 +33,120 @@ data() { return { YongHuid: [], - routes: [], + routes: [ + { + alwaysShow: true, + component: "warehouse", + meta: { + icon: "el-icon-menu", + title: "入库质押申请", + }, + name: "/NewList/warehouse", + path: "/NewList/warehouse" + }, + { + alwaysShow: true, + component: "outbound", + meta: { + icon: "el-icon-menu", + title: "解质出库申请", + }, + name: "/NewList/outbound", + path: "/NewList/outbound" + }, + { + alwaysShow: true, + component: "needMoney", + meta: { + icon: "el-icon-menu", + title: "用款申请", + }, + name: "/NewList/needMoney", + path: "/NewList/needMoney" + }, + { + alwaysShow: true, + component: "returnedMoney", + meta: { + icon: "el-icon-menu", + title: "回款上报", + }, + name: "/NewList/returnedMoney", + path: "/NewList/returnedMoney" + }, + { + alwaysShow: true, + component: "market", + meta: { + icon: "el-icon-menu", + title: "销售数据上报", + }, + name: "/NewList/market", + path: "/NewList/market" + }, + { + alwaysShow: true, + component: "kucungysgl", + meta: { + icon: "el-icon-menu", + title: "供应商管理", + }, + name: "/khzxgysgl/index", + path: "/khzxgysgl/index" + }, + { + alwaysShow: true, + component: "kucunDdcxs", + meta: { + icon: "el-icon-menu", + title: "订单查询", + }, + name: "/kucun/ddcx", + path: "/kucun/ddcx" + }, + { + alwaysShow: true, + component: "commodityFile", + meta: { + icon: "el-icon-menu", + title: "商品档案", + }, + name: "/commodityFile", + path: "/commodityFile", + children: [{ + alwaysShow: true, + component: "commodityManagementInfo", + meta: { + icon: "el-icon-help", + title: "商品管理", + }, + name: "/supervise/commodityFile/commodity/commodityManagementInfo", + path: "/supervise/commodityFile/commodity/commodityManagementInfo", + }, + { + alwaysShow: true, + component: "brandManagementInfo", + meta: { + icon: "el-icon-help", + title: "品牌维护", + }, + name: "/supervise/commodityFile/brand/brandManagementInfo", + path: "/supervise/commodityFile/brand/brandManagementInfo", + }, + { + alwaysShow: true, + component: "classManagementInfo", + meta: { + icon: "el-icon-help", + title: "类别维护", + }, + name: "/supervise/commodityFile/classification/classManagementInfo", + path: "/supervise/commodityFile/classification/classManagementInfo", + } + ] + + }, + ], params: { sourceSid: '8aeb5ddd-b810-4846-96bf-34262094c0ea', userSid: '', @@ -78,11 +191,11 @@ // 获取用户信息 postHuoquyonghu() { var token = getStorage() - loginDetails(token).then((response) => { - console.log('resss', response) - if (response.code === '200') { - this.YongHuid = response.data - this.params.userSid = this.YongHuid.sid + // loginDetails(token).then((response) => { + // console.log('resss', response) + // if (response.code === '200') { + // this.YongHuid = response.data + // this.params.userSid = this.YongHuid.sid getrolemenus(this.params).then((res) => { console.log('res', res) const userRoles = this.resRouter(res.data) @@ -93,8 +206,8 @@ }) return userRoles }) - } - }) + // } + // }) }, resRouter(menus) { // 递归,将后台传来数组 @@ -124,7 +237,7 @@ // } } } - this.routes = menus + // this.routes = menus console.log('左侧菜单', this.routes) return menus }, diff --git a/supervise-enterprise-ui/src/main.js b/supervise-enterprise-ui/src/main.js index cac4571a..4704f264 100644 --- a/supervise-enterprise-ui/src/main.js +++ b/supervise-enterprise-ui/src/main.js @@ -43,14 +43,14 @@ VueAMap.initAMapApiLoader({ Vue.config.productionTip = false -let token = null -token = GetQueryString('token') -if (token) { - setStorage(token) - const href = window.location.href -// href = href.split(`token=${token}`)[0] -// window.location.href = href.slice(0, href.length - 1) -} +// let token = null +// token = GetQueryString('token') +// if (token) { +// setStorage(token) +// const href = window.location.href +// // href = href.split(`token=${token}`)[0] +// // window.location.href = href.slice(0, href.length - 1) +// } var one = window.location.href.indexOf('&organizationData') + 18 if (parseInt(one) > 18) { @@ -65,66 +65,12 @@ if (parseInt(one) > 18) { // 获取登录用户信息 function getUserInfo() { - return request({ - baseURL: '/api', - url: '/portal/v1/sysuser/loginDetails', - method: 'post', - headers: { - 'Content-Type': 'application/json' - } - }).then(rep => { - const data = rep.data - const user = { - roleSid: data.roleSid, - name: data.name, - userName: data.userName, - departmentName: data.departmentName, // 部门名称 - departmentSid: data.departmentSid, // 部门sid - isAdmin: data.isAdmin, - staffSid: data.staffSid, // 业务员sid - userSid: data.sid, - orgSid: data.organizationSid, // 单位sid - Orgname: data.organizationName, - dwjb: data.dwjb, - orgNamePath: data.orgNamePath, // 使用组织全路径名称 - orgSidPath: data.orgSidPath // 使用组织全路径Sid - } - // 结果存入缓存 - window.sessionStorage.setItem('staffSid', user.staffSid) - window.sessionStorage.setItem('userSid', user.userSid) - window.sessionStorage.setItem('Orgname', user.Orgname) - window.sessionStorage.setItem('orgSid', user.orgSid) - window.sessionStorage.setItem('departmentName', user.departmentName) - window.sessionStorage.setItem('name', user.name) - window.sessionStorage.setItem('user', user) - window.sessionStorage.setItem('departmentName', user.departmentName) - window.sessionStorage.setItem('departmentSid', user.departmentSid) - window.sessionStorage.setItem('orgNamePath', user.orgNamePath) - window.sessionStorage.setItem('orgSidPath', user.orgSidPath) new Vue({ el: '#app', router, store, render: h => h(App) }) - }) } getUserInfo() -function GetQueryString(name) { - var one = window.location.href.indexOf('?token=') + 7 - if (one < 7) { return null } - var two = window.location.href.lastIndexOf('&') // + 1 - var data = window.location.href.substr(one) - if (two > one) { - data = window.location.href.slice(one, two) - console.log('token', data) - } - if (data) { - return data - } - return null - // var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)') - // var r = window.location.search.substr(1).match(reg) - // if (r != null) return unescape(r[2]); return null -} diff --git a/supervise-enterprise-ui/src/router/modules/codemenu.js b/supervise-enterprise-ui/src/router/modules/codemenu.js index 4241721a..e83ba18f 100644 --- a/supervise-enterprise-ui/src/router/modules/codemenu.js +++ b/supervise-enterprise-ui/src/router/modules/codemenu.js @@ -26,7 +26,85 @@ const codemenu = [{ noCache: true } }] +},{ + path: '/kucunDdcxs', + component: Layout, + redirect: '/kucun/ddcx', + children: [{ + path: '/kucun/ddcx', + component: () => import('@/views/query/orders.vue'), + name: 'kucunDdcxs', + meta: { + title: '订单查询', + noCache: true + } + }] +},{ + path: '/NewList', + component: Layout, + redirect: '/NewList/warehouse', + children: [{ + path: '/NewList/warehouse', + component: () => import('@/views/NewList/warehouse.vue'), + name: 'warehouse', + meta: { + title: '货物入库质押申请', + noCache: true + } + }] +},{ + path: '/NewList', + component: Layout, + redirect: '/NewList/returnedMoney', + children: [{ + path: '/NewList/returnedMoney', + component: () => import('@/views/NewList/returnedMoney.vue'), + name: 'returnedMoney', + meta: { + title: '回款上报', + noCache: true + } + }] +},{ + path: '/NewList', + component: Layout, + redirect: '/NewList/market', + children: [{ + path: '/NewList/market', + component: () => import('@/views/NewList/market.vue'), + name: 'market', + meta: { + title: '销售上报', + noCache: true + } + }] +},{ + path: '/NewList', + component: Layout, + redirect: '/NewList/outbound', + children: [{ + path: '/NewList/outbound', + component: () => import('@/views/NewList/outbound.vue'), + name: 'outbound', + meta: { + title: '货物解除质押出库申请', + noCache: true + } + }] }, { + path: '/NewList', + component: Layout, + redirect: '/NewList/needMoney', + children: [{ + path: '/NewList/needMoney', + component: () => import('@/views/NewList/needMoney.vue'), + name: 'needMoney', + meta: { + title: '用款申请提交', + noCache: true + } + }] +},{ path: '/kucuncgsq', component: Layout, redirect: '/tobaccopurchaseapplication', diff --git a/supervise-enterprise-ui/src/views/NewList/market.vue b/supervise-enterprise-ui/src/views/NewList/market.vue new file mode 100644 index 00000000..35d85190 --- /dev/null +++ b/supervise-enterprise-ui/src/views/NewList/market.vue @@ -0,0 +1,62 @@ + + + + + + \ No newline at end of file diff --git a/supervise-enterprise-ui/src/views/NewList/needMoney.vue b/supervise-enterprise-ui/src/views/NewList/needMoney.vue new file mode 100644 index 00000000..e7a6bba9 --- /dev/null +++ b/supervise-enterprise-ui/src/views/NewList/needMoney.vue @@ -0,0 +1,62 @@ + + + + + + \ No newline at end of file diff --git a/supervise-enterprise-ui/src/views/NewList/outbound.vue b/supervise-enterprise-ui/src/views/NewList/outbound.vue new file mode 100644 index 00000000..35d328a0 --- /dev/null +++ b/supervise-enterprise-ui/src/views/NewList/outbound.vue @@ -0,0 +1,114 @@ + + + + + diff --git a/supervise-enterprise-ui/src/views/NewList/returnedMoney.vue b/supervise-enterprise-ui/src/views/NewList/returnedMoney.vue new file mode 100644 index 00000000..d44c77f8 --- /dev/null +++ b/supervise-enterprise-ui/src/views/NewList/returnedMoney.vue @@ -0,0 +1,62 @@ + + + + + + \ No newline at end of file diff --git a/supervise-enterprise-ui/src/views/NewList/warehouse.vue b/supervise-enterprise-ui/src/views/NewList/warehouse.vue new file mode 100644 index 00000000..43d97e19 --- /dev/null +++ b/supervise-enterprise-ui/src/views/NewList/warehouse.vue @@ -0,0 +1,115 @@ + + + + + + \ No newline at end of file diff --git a/warehousing-system/project_web_ui/src/views/component/stockManagement/stockList.vue b/warehousing-system/project_web_ui/src/views/component/stockManagement/stockList.vue index 9b71a398..98b7cab1 100644 --- a/warehousing-system/project_web_ui/src/views/component/stockManagement/stockList.vue +++ b/warehousing-system/project_web_ui/src/views/component/stockManagement/stockList.vue @@ -8,15 +8,22 @@