#
whycq
2024-04-20 fdfc2c66434bdacdd539f228b51a33c8d15e71d5
pages/home/home.vue
@@ -21,8 +21,10 @@
         return {
            baseUrl: '',
            token: '',
            icon: '',
            elements: [],
            elements2: [{
            elements2: [
               {
                  title: '组托入库',
                  name: 'pakin',
                  color: 'cyan',
@@ -30,37 +32,51 @@
                  url: '/pakin/pakin'
               },
               {
                  title: '再次拣料',
                  name: 'changePallet',
                  color: 'green',
                  cuIcon: 'order',
                  url: '/pakin/pickAgain'
               },
               {
                  title: '订单入库',
                  name: 'orderPakin',
                  color: 'blue',
                  color: 'red',
                  cuIcon: 'pullup',
                  url: '/order/orderPakin'
               },
               // {
               //    title: '打印',
               //    name: 'print',
               //    color: 'purple',
               //    cuIcon: 'text',
               //    url: '/print/print'
               // },
               {
                  title: '组托上架',
                  name: 'putOn',
                  color: 'orange',
                  cuIcon: 'pullup',
                  url: '/pakin/putOn'
               },
               {
                  title: '打印',
                  name: 'print',
                  color: 'purple',
                  cuIcon: 'text',
                  url: '/print/print'
               },
               {
                  title: '订单上架',
                  name: 'orderPutOn',
                  color: 'mauve',
                  color: 'yellow',
                  cuIcon: 'pullup',
                  url: '/order/orderPutOn'
               },
               {
                  title: '订单下架',
                  name: 'orderPutDown',
                  color: 'pink',
                  color: 'olive',
                  cuIcon: 'pulldown',
                  url: '/order/orderPutDown'
               },
               {
                  title: '库存查询',
                  name: 'stockQuery',
                  color: 'brown',
                  color: 'green',
                  cuIcon: 'check',
                  url: '/stock/stockQuery'
               },
@@ -136,11 +152,12 @@
                        if (res.data.length < 0) {
                           break;
                        }
                        that.getIcon(res.data[i].title)
                        that.elements.unshift({
                           title: res.data[i].name,
                           name: res.data[i].title,
                           color: that.colorList[i],
                           cuIcon: 'safe',
                           cuIcon: that.icon,
                           url: res.data[i].action
                        })
                     }
@@ -148,7 +165,8 @@
                        title: '退出登录',
                        name: 'logOut',
                        color: 'grey',
                        cuIcon: 'exit'
                        cuIcon: 'exit',
                        url: '/login/logOut'
                     })
                  } else if (res.code === 403) {
                     uni.showToast({
@@ -162,11 +180,12 @@
                        });
                     }, 1000);
                  } else if(res.status === 404) {
                     uni.showToast({
                        title: '404',
                        icon: "none",
                        position: 'top'
                     })
                     that.elements = that.elements2
                     // uni.showToast({
                     //    title: '默认主页',
                     //    icon: "none",
                     //    position: 'top'
                     // })
                  } else {
                     uni.showToast({
                        title: res.msg,
@@ -180,6 +199,12 @@
               }
            })
         },
         getIcon(e) {
            const ways = ['pakin','orderPakin','orderPutOn']
            if (ways.includes(e)) {
               this.icon = 'pullup'
            }
         }
      }
   }
</script>