From 512d112b06403441275811a056846031cafb0f67 Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Mon, 6 May 2024 09:27:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9D=83=E9=99=90=E5=92=8C?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 6 +- src/api/request2.js | 43 ++++ src/common/classify.data.js | 50 +++++ src/common/utils/storage.js | 7 + src/pages.json | 45 ++++ src/pages/foam/downLink.vue | 186 ++++++++++++++++ src/pages/foam/foamNoGood.vue | 302 ++++++++++++++++++++++++++ src/pages/foam/upLink.vue | 243 +++++++++++++++++++++ src/pages/index/index.vue | 41 +++- src/pages/plastics/plasticsNoGood.vue | 302 ++++++++++++++++++++++++++ src/pages/plastics/scanCode.vue | 275 +++++++++++++++++++++++ src/store/getters.js | 1 + src/store/modules/user.js | 22 +- 13 files changed, 1517 insertions(+), 6 deletions(-) create mode 100644 src/pages/foam/downLink.vue create mode 100644 src/pages/foam/foamNoGood.vue create mode 100644 src/pages/foam/upLink.vue create mode 100644 src/pages/plastics/plasticsNoGood.vue create mode 100644 src/pages/plastics/scanCode.vue diff --git a/src/App.vue b/src/App.vue index e204d47..e0e1360 100644 --- a/src/App.vue +++ b/src/App.vue @@ -7,18 +7,18 @@ export default { onLaunch: function() { - + console.log('App Launch') // 隐藏顶部电池,时间等信息 // #ifdef APP-PLUS - // 隐藏顶部电池,时间等信息 uni.setStorageSync('hasLogin', false) + // 隐藏顶部电池,时间等信息 // plus.navigator.setFullscreen(true); // // app 锁定横屏 // plus.screen.lockOrientation('landscape-primary'); // // app 强制竖屏 // plus.screen.lockOrientation('portrait-primary'); - appUpdate(false); + // appUpdate(false); // #endif }, diff --git a/src/api/request2.js b/src/api/request2.js index 8c19194..678424d 100644 --- a/src/api/request2.js +++ b/src/api/request2.js @@ -337,4 +337,47 @@ export function checkItemCodeByBucket(BucketCode,itemCode) { }); } +/** + * @param params 泡沫合格品上悬链接 提交 + */ +export function upLickSubmit(params) { + return request({ + url: baseApi + "/Ware/Insert", + method: "post", + data: params, + }); +} + +/** + * @param params 泡沫合格品下悬链接 提交 + */ +export function downLickSubmit(params) { + return request({ + url: baseApi + "/Ware/Insert", + method: "post", + data: params, + }); +} + +/** + * @param params 泡沫不良品收货 提交 + */ +export function foamNoGoodSubmit(params) { + return request({ + url: baseApi + "/Ware/Insert", + method: "post", + data: params, + }); +} + +/** + * @param params 注塑不良品收货 提交 + */ +export function plasticsNoGoodSubmit(params) { + return request({ + url: baseApi + "/Ware/Insert", + method: "post", + data: params, + }); +} diff --git a/src/common/classify.data.js b/src/common/classify.data.js index 929daab..1327444 100644 --- a/src/common/classify.data.js +++ b/src/common/classify.data.js @@ -1,16 +1,45 @@ export default [{ "name": "泡沫", + "isShow":true, "children": [{ "name": "泡沫点检", + "code":"PDA0000001", "icon": "/count.svg", + "isShow":true, "path": "/pages/foam/check", "index": 1, }, { "name": "泡沫投料", + "code":"PDA0000002", "icon": "/purchase_return.svg", + "isShow":true, "path": "/pages/foam/input", "index": 2, + }, + { + "name": "合格品\n上悬链接", + "code":"PDA0000003", + "icon": "/purchase_return.svg", + "isShow":true, + "path": "/pages/foam/upLink", + "index": 2, + }, + { + "name": "合格品\n下悬链接", + "code":"PDA0000004", + "icon": "/purchase_return.svg", + "isShow":true, + "path": "/pages/foam/downLink", + "index": 2, + }, + { + "name": "不良品收货", + "code":"PDA0000005", + "icon": "/purchase_return.svg", + "isShow":true, + "path": "/pages/foam/foamNoGood", + "index": 2, } ] @@ -18,18 +47,39 @@ export default [{ { "name": "注塑", + "isShow":true, "children": [{ "name": "注塑点检", + "code":"SPDA0000001", "icon": "/query_supplier_deliver.svg", + "isShow":true, "path": "/pages/plastics/check", "index": 1, }, { "name": "注塑投料", + "code":"SPDA0000002", "icon": "/unbind_pallet.svg", + "isShow":true, "path": "/pages/plastics/input", "index": 2, }, + { + "name": "开办件扫码", + "code":"SPDA0000003", + "icon": "/unbind_pallet.svg", + "isShow":true, + "path": "/pages/plastics/scanCode", + "index": 2, + }, + { + "name": "不良品收货", + "code":"SPDA0000004", + "icon": "/unbind_pallet.svg", + "isShow":true, + "path": "/pages/plastics/plasticsNoGood", + "index": 2, + }, ] } diff --git a/src/common/utils/storage.js b/src/common/utils/storage.js index 515d413..4f42431 100644 --- a/src/common/utils/storage.js +++ b/src/common/utils/storage.js @@ -1,10 +1,16 @@ // 获取本地存储对应key const getStorage = (key)=>{ + if(key==undefined){ + return "" + } return uni.getStorageSync( key ); } // 设置本地存储对应key const setStorage = (key,value)=>{ + if(key==undefined){ + return "" + } return uni.setStorageSync( key,value ); } @@ -24,6 +30,7 @@ const constant = { avatar: 'avatar', name: 'name', roles: 'roles', + powers:"powers", permissions: 'permissions' } diff --git a/src/pages.json b/src/pages.json index b767c68..f2bf922 100644 --- a/src/pages.json +++ b/src/pages.json @@ -46,6 +46,33 @@ "enablePullDownRefresh" : false } }, + { + "path": "pages/foam/upLink", + "style": { + "navigationBarTitleText": "合格品上悬链接", + "titleNView": { + "buttons": [{}] + } + } + }, + { + "path": "pages/foam/downLink", + "style": { + "navigationBarTitleText": "合格品下悬链接", + "titleNView": { + "buttons": [{}] + } + } + }, + { + "path": "pages/foam/foamNoGood", + "style": { + "navigationBarTitleText": "不良品收货", + "titleNView": { + "buttons": [{}] + } + } + }, { "path": "pages/plastics/check", "style": { @@ -64,6 +91,24 @@ } } }, + { + "path": "pages/plastics/plasticsNoGood", + "style": { + "navigationBarTitleText": "不良品收货", + "titleNView": { + "buttons": [{}] + } + } + }, + { + "path": "pages/plastics/scanCode", + "style": { + "navigationBarTitleText": "开办件扫码", + "titleNView": { + "buttons": [{}] + } + } + }, { "path": "pages/common/plan", "style": { diff --git a/src/pages/foam/downLink.vue b/src/pages/foam/downLink.vue new file mode 100644 index 0000000..b5abc7c --- /dev/null +++ b/src/pages/foam/downLink.vue @@ -0,0 +1,186 @@ + + + + + \ No newline at end of file diff --git a/src/pages/foam/foamNoGood.vue b/src/pages/foam/foamNoGood.vue new file mode 100644 index 0000000..f13a3d7 --- /dev/null +++ b/src/pages/foam/foamNoGood.vue @@ -0,0 +1,302 @@ + + + + + \ No newline at end of file diff --git a/src/pages/foam/upLink.vue b/src/pages/foam/upLink.vue new file mode 100644 index 0000000..bfc16d1 --- /dev/null +++ b/src/pages/foam/upLink.vue @@ -0,0 +1,243 @@ + + + + + \ No newline at end of file diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 3637475..e45016e 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -29,6 +29,7 @@ {{item.name}} @@ -96,8 +97,10 @@ } }, onLoad() { + var test ="" if (uni.getStorageSync("hasLogin")) { - this.tabbar = classifyData; + + this.tabbar = this.getPowersByRoles(); } else { this.tabbar = [] } @@ -148,6 +151,38 @@ }, mounted() {}, methods: { + getPowersByRoles(){ + var permissionList = this.$store.state.user.powers + var tempList=[]; + classifyData.forEach(menuItem=>{ + var temp = { + name :menuItem.name, + isShow:menuItem.isShow, + children:[] + } + menuItem.children.forEach(rightItem=>{ + permissionList.forEach(permission=>{ + if(rightItem.code==permission){ + rightItem.isShow=true + temp.children.push(rightItem) + }else { + rightItem.isShow=false + } + }) + }) + tempList.push(temp) + }) + + var showList =[]; + tempList.forEach(res=>{ + if(res.children.length>0){ + showList.push(res) + } + }) + return showList; + + }, + findList(tab) { let res = null for (let i = 0; i < tab.length; i++) { @@ -270,8 +305,10 @@ uni.navigateTo({ url: url }); - this.filterList = [] + }, + + showMessage(message) { this.$refs.comMessage.showMessage(message, res => { if (res) { diff --git a/src/pages/plastics/plasticsNoGood.vue b/src/pages/plastics/plasticsNoGood.vue new file mode 100644 index 0000000..f13a3d7 --- /dev/null +++ b/src/pages/plastics/plasticsNoGood.vue @@ -0,0 +1,302 @@ + + + + + \ No newline at end of file diff --git a/src/pages/plastics/scanCode.vue b/src/pages/plastics/scanCode.vue new file mode 100644 index 0000000..d9bf712 --- /dev/null +++ b/src/pages/plastics/scanCode.vue @@ -0,0 +1,275 @@ + + + + + \ No newline at end of file diff --git a/src/store/getters.js b/src/store/getters.js index e5dbfae..7af3979 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -4,6 +4,7 @@ const getters = { avatar: state => state.user.avatar, name: state => state.user.name, roles: state => state.user.roles, + powers: state => state.user.powers, permissions: state => state.user.permissions, hasLogin:state=>state.user.hasLogin } diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 0f4fc23..97136d6 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -14,7 +14,8 @@ const user = { name: storage.getStorage(storage.constant.name), avatar: storage.getStorage(storage.constant.avatar), roles: storage.getStorage(storage.constant.roles), - permissions: storage.getStorage(storage.constant.permissions) + permissions: storage.getStorage(storage.constant.permissions), + powers:storage.getStorage(storage.constant.powers) }, mutations: { @@ -38,6 +39,12 @@ const user = { state.permissions = permissions storage.setStorage(storage.constant.permissions, permissions) }, + SET_POWERS: (state, powers) => { + state.powers = powers + storage.setStorage(storage.constant.powers, powers) + } + + }, @@ -52,8 +59,21 @@ const user = { return new Promise((resolve, reject) => { login(username, password).then(res => { if(res){ + res.Result.Powers =[ + "PDA0000001", + "PDA0000002", + "PDA0000003", + "PDA0000004", + "PDA0000005", + "SPDA0000001", + "SPDA0000002", + "SPDA0000003", + "SPDA0000004" + ] commit('SET_ID',res.Result.LoginUserID) commit('SET_NAME',res.Result.UserName) + commit('SET_POWERS',res.Result.Powers) + resolve(res) }else { uni.showToast({