diff --git a/pages.json b/pages.json index 63fc9fa..b5caba5 100644 --- a/pages.json +++ b/pages.json @@ -102,6 +102,14 @@ } } + ,{ + "path" : "pages/modules/cache-code-change", + "style" : + { + "navigationStyle": "custom" + } + + } ], "globalStyle": { // "pageOrientation": "landscape", diff --git a/pages/home/home.vue b/pages/home/home.vue index c8135c4..90bd061 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -15,7 +15,7 @@ - + {{e.name}} @@ -32,58 +32,30 @@ return { roles: this.$store.getters.saveRoles, userName: '', - menuList: [] + menuList: [ + {id: '1', name: '原材料入库', icon: 'RF04', role: 'A1', path: '/pages/modules/rawmater-instore'}, + {id: '2', name: '原材料出库', icon: 'RF06', role: 'A1', path: '/pages/modules/rawmater-outstore'}, + {id: '3', name: '搬运任务', icon: 'RF07', role: 'A2', path: '/pages/modules/carry-task'}, + {id: '4', name: '组盘解绑', icon: 'RF08', role: 'A2', path: '/pages/modules/zupan-unbind'}, + {id: '5', name: '指令管理', icon: 'RF01', role: '', path: '/pages/modules/zlmanage'}, + {id: '6', name: '任务管理', icon: 'RF09', role: '', path: '/pages/modules/taskmanage'}, + {id: '7', name: '异常出库', icon: 'RF10', role: '', path: '/pages/modules/error-outstore'}, + {id: '8', name: '托盘号补录', icon: 'RF05', role: 'A1', path: '/pages/modules/pallet-add-record'}, + {id: '9', name: '缓存码变更', icon: 'RF11', role: 'A1', path: '/pages/modules/cache-code-change'} + ] }; }, created () { - this.menuList = [ - // {id: '1', name: '人工排产', icon: 'RF01', path: '/pages/modules/man-paichan'}, - // {id: '2', name: '涂线板', icon: 'RF02', path: '/pages/modules/wire-board'}, - // {id: '3', name: '物料库存', icon: 'RF03', path: '/pages/modules/mater-inventory'} - {id: '1', name: '原材料入库', icon: 'RF04', path: '/pages/modules/rawmater-instore'}, - {id: '2', name: '原材料出库', icon: 'RF06', path: '/pages/modules/rawmater-outstore'}, - {id: '3', name: '搬运任务', icon: 'RF07', path: '/pages/modules/carry-task'}, - {id: '4', name: '组盘解绑', icon: 'RF08', path: '/pages/modules/zupan-unbind'}, - {id: '5', name: '指令管理', icon: 'RF01', path: '/pages/modules/zlmanage'}, - {id: '6', name: '任务管理', icon: 'RF09', path: '/pages/modules/taskmanage'}, - {id: '7', name: '异常出库', icon: 'RF10', path: '/pages/modules/error-outstore'}, - {id: '8', name: '托盘号补录', icon: 'RF05', path: '/pages/modules/pallet-add-record'} - ] - if (this.roles === 'A1,A2,') { - this.menuList = [ - // {id: '1', name: '人工排产', icon: 'RF01', path: '/pages/modules/man-paichan'}, - // {id: '2', name: '涂线板', icon: 'RF02', path: '/pages/modules/wire-board'}, - // {id: '3', name: '物料库存', icon: 'RF03', path: '/pages/modules/mater-inventory'} - {id: '1', name: '原材料入库', icon: 'RF03', path: '/pages/modules/rawmater-instore'}, - {id: '2', name: '原材料出库', icon: 'RF07', path: '/pages/modules/rawmater-outstore'}, - {id: '3', name: '搬运任务', icon: 'RF01', path: '/pages/modules/carry-task'}, - {id: '4', name: '组盘解绑', icon: 'RF04', path: '/pages/modules/zupan-unbind'}, - {id: '5', name: '指令管理', icon: 'RF02', path: '/pages/modules/zlmanage'}, - {id: '6', name: '任务管理', icon: 'RF09', path: '/pages/modules/taskmanage'}, - {id: '7', name: '异常出库', icon: 'RF10', path: '/pages/modules/error-outstore'}, - {id: '8', name: '托盘号补录', icon: 'RF05', path: '/pages/modules/pallet-add-record'} - ] - } - if (this.roles === 'A1,') { - this.menuList = [ - {id: '1', name: '原材料入库', icon: 'RF03', path: '/pages/modules/rawmater-instore'}, - {id: '2', name: '原材料出库', icon: 'RF07', path: '/pages/modules/rawmater-outstore'}, - {id: '5', name: '指令管理', icon: 'RF02', path: '/pages/modules/zlmanage'}, - {id: '6', name: '任务管理', icon: 'RF09', path: '/pages/modules/taskmanage'}, - {id: '7', name: '异常出库', icon: 'RF10', path: '/pages/modules/error-outstore'}, - {id: '8', name: '托盘号补录', icon: 'RF05', path: '/pages/modules/pallet-add-record'} - ] - } - if (this.roles === 'A2,') { - this.menuList = [ - {id: '3', name: '搬运任务', icon: 'RF01', path: '/pages/modules/carry-task'}, - {id: '4', name: '组盘解绑', icon: 'RF04', path: '/pages/modules/zupan-unbind'}, - {id: '5', name: '指令管理', icon: 'RF02', path: '/pages/modules/zlmanage'}, - {id: '6', name: '任务管理', icon: 'RF09', path: '/pages/modules/taskmanage'}, - {id: '7', name: '异常出库', icon: 'RF10', path: '/pages/modules/error-outstore'} - ] - } - this.$store.dispatch('setPublicObj', '') + this.menuList.map(el => { + if (this.roles === '') { + this.$set(el, 'show', true) + } else if (this.roles!== '' && el.role === '') { + this.$set(el, 'show', true) + } else if (this.roles!== '' && el.role !== '') { + let show = this.roles.indexOf(el.role) !== -1 + this.$set(el, 'show', show) + } + }) if (this.$store.getters.userInfo) { this.userName = JSON.parse(this.$store.getters.userInfo).username } diff --git a/pages/modules/cache-code-change.vue b/pages/modules/cache-code-change.vue new file mode 100644 index 0000000..bcde769 --- /dev/null +++ b/pages/modules/cache-code-change.vue @@ -0,0 +1,77 @@ + + + + + diff --git a/pages/modules/carry-task.vue b/pages/modules/carry-task.vue index b661259..8afaabc 100644 --- a/pages/modules/carry-task.vue +++ b/pages/modules/carry-task.vue @@ -136,6 +136,9 @@ async _taskCarry () { try { let res = await taskCarry(this.index1, this.index2) + if (res.code === '1') { + this.toClear() + } this.disabled = false uni.showToast({ title: res.message, diff --git a/pages/modules/rawmater-instore.vue b/pages/modules/rawmater-instore.vue index e7aee7f..2232ad1 100644 --- a/pages/modules/rawmater-instore.vue +++ b/pages/modules/rawmater-instore.vue @@ -90,6 +90,9 @@ } try { let res = await yclrk(this.index1, this.val2, this.val3, this.val4) + if (res.code === '1') { + this.toClear() + } this.disabled = false uni.showToast({ title: res.message, diff --git a/pages/modules/rawmater-outstore.vue b/pages/modules/rawmater-outstore.vue index 4692b90..717031d 100644 --- a/pages/modules/rawmater-outstore.vue +++ b/pages/modules/rawmater-outstore.vue @@ -104,6 +104,9 @@ } try { let res = await yclck(this.index1, this.index2, this.val2, this.val3) + if (res.code === '1') { + this.toClear() + } this.disabled = false uni.showToast({ title: res.message, diff --git a/pages/modules/zupan-unbind.vue b/pages/modules/zupan-unbind.vue index 650af82..617a342 100644 --- a/pages/modules/zupan-unbind.vue +++ b/pages/modules/zupan-unbind.vue @@ -77,6 +77,9 @@ } try { let res = await zpjb(this.val1, this.val2) + if (res.code === '1') { + this.toClear() + } this.disabled = false uni.showToast({ title: res.message, diff --git a/static/image/menu/RF11.png b/static/image/menu/RF11.png new file mode 100644 index 0000000..b472693 Binary files /dev/null and b/static/image/menu/RF11.png differ diff --git a/utils/getData2.js b/utils/getData2.js index 24b94b7..f03ad24 100644 --- a/utils/getData2.js +++ b/utils/getData2.js @@ -21,6 +21,14 @@ export const handLogin = (user, password) => request({ password: password } }) +// export const handLogin = (user, password) => { +// let res = { +// user: {user: 'admin'}, +// token: 'aaaa', +// roles: 'A1,A2,' +// } +// return res +// } /** * 人工排产 @@ -135,4 +143,15 @@ export const materialList = () => { export const getInventoryMaterialInfo = (code) => { let res = [{"material_code":"FJB","material_name":"负极板","point_code":"01-09-01","point_name":"01排09列01层","vehicle_code":"T202312060006","vehicle_type":"1"}] return res -} \ No newline at end of file +} + +/** + * 缓存码变更 + */ +export const zpchange = (code, ncode) => request({ + url:'api/pda/zpchange', + data: { + sub_tray: code, + new_sub_tray: ncode + } +}) \ No newline at end of file