#
whycq
2024-11-28 248ef3ba3de9994dc83d2b36690542893f9fb6e6
pages/home/orderManage.vue
@@ -12,6 +12,7 @@
         </view>
         <view class="cu-tabbar-height"></view>
      </scroll-view>
      <view style="height: 50rpx;"></view>
   </view>
</template>
@@ -26,44 +27,113 @@
            project: 'tzsk',
            elements2: [
               {
                  title: '待包装入库单',
                  name: 'pakinOrder',
                  color: 'blue',
                  url: `/phyz/waitOrder/waitOrderIn`
               },
               {
                  title: '待包装出库单',
                  name: 'pakinOrder',
                  color: 'blue',
                  url: `/phyz/waitOrder/waitOrderOut`
               },
               {
                  title: '采购入库单',
                  name: 'outOrder',
                  name: 'pakinOrder',
                  color: 'blue',
                  // cuIcon: 'pullup',
                  url: `/phyz/order/pakinOrderSelect`
               },
               // {
               //    title: '出库单',
               //    name: 'outOrder',
               //    color: 'blue',
               //    // cuIcon: 'pullup',
               //    url: `/phyz/order/outOrder`
               // },
               // {
               //    title: '入库单测试用',
               //    name: 'pakin',
               //    color: 'blue',
               //    // cuIcon: 'pullup',
               //    url: `/phyz/order/purchaseOrder`
               // },
               {
                  title: '出库单',
                  title: '采购出库',
                  name: 'outOrder',
                  color: 'blue',
                  // cuIcon: 'pullup',
                  url: `/phyz/order/outOrder`
               },
               {
                  title: '入库单测试用',
                  name: 'pakin',
                  color: 'blue',
                  // cuIcon: 'pullup',
                  url: `/phyz/order/purchaseOrder`
               },
               {
                  title: '出库单测试用',
                  name: 'pakin',
                  color: 'blue',
                  // cuIcon: 'pullup',
                  url: `/phyz/orderOut/orderOutSelect`
               },
               {
                  title: '半成品入库单',
                  name: 'bcpOrder',
                  color: 'blue',
                  // cuIcon: 'pullup',
                  url: `/phyz/bcp/bcpOrder`
               },
               {
                  title: '半成品调拨单',
                  name: 'bcpDbOrder',
                  color: 'blue',
                  // cuIcon: 'pullup',
                  url: `/phyz/bcp/bcpDbOrder`
               },
               {
                  title: '半成品出库单',
                  name: 'bcpOutOrder',
                  color: 'blue',
                  // cuIcon: 'pullup',
                  url: `/phyz/orderOut/bcpOrderOutSelect`
               },
               {
                  title: '半成品加工单',
                  name: 'processOrder',
                  color: 'blue',
                  // cuIcon: 'pullup',
                  url: `/phyz/processOrder/processOrder`
               },
               {
                  title: '半成品回流单',
                  name: 'backStock',
                  color: 'blue',
                  // cuIcon: 'pullup',
                  url: `/phyz/backStock/backStocksOrder`
               },
               {
                  title: '入库单',
                  name: 'orderIn',
                  color: 'blue',
                  // cuIcon: 'pullup',
                  url: `/phyz/comOrder/orderIn`
               },
               {
                  title: '出库单',
                  name: 'orderOut',
                  color: 'blue',
                  // cuIcon: 'pullup',
                  url: `/phyz/comOrder/orderOut`
               },
               
            ],
            menu: [],
            colorList: ['cyan','blue','purple','mauve','pink','brown','red','orange','yellow','olive','olive','grey' ]
         };
      },
      onShow() {
      // onShow() {
      //    this.baseUrl = uni.getStorageSync('baseUrl');
      //    this.token = uni.getStorageSync('token');
      //    this.project = uni.getStorageSync('project')
      //    // this.getAuth()
      //    this.backGroundRepeat()
      // },
      onLoad(option) {
         this.baseUrl = uni.getStorageSync('baseUrl');
         this.token = uni.getStorageSync('token');
         this.project = uni.getStorageSync('project')
         this.getAuth()
         this.project = uni.getStorageSync('project');
         this.menu = uni.getStorageSync('menu');
         this.getAuth2(option.id)
         this.backGroundRepeat()
      },
      methods: {
@@ -78,11 +148,30 @@
               i++
            }
         },
         getAuth() {
         getAuth2(id) {
            let secMenu = []
            for (let k of this.menu) {
               if (id == k.id) {
                  secMenu = k.children
               }
            }
            for (let i in secMenu) {
               this.getIcon(secMenu[i].title)
               this.elements.unshift({
                  title: secMenu[i].name,
                  name: secMenu[i].title,
                  color: this.colorList[i],
                  cuIcon: this.icon,
                  id: secMenu[i].id,
                  url: `${secMenu[i].code}`
               })
            }
         },
         getAuth(id) {
            let that = this
            uni.request({
               url: that.baseUrl + '/menu/pda/auth',
               data: {},
               data: {level:2 ,id: id},
               header: { 'token': uni.getStorageSync('token') },
               method: 'POST',
               success(res) {
@@ -95,8 +184,11 @@
                  that.elements = []
                  if (res.code === 200) {
                     if (res.data == undefined || res.data == null || res.data == "") {
                        that.elements = that.elements2
                        return
                        if (res.data.length == 0) {
                           return
                        } else {
                           that.elements = that.elements2
                        }
                     }
                     for (var i = 0; i < res.data.length; i++) {
                        if (res.data.length < 0) {
@@ -108,16 +200,9 @@
                           name: res.data[i].title,
                           color: that.colorList[i],
                           cuIcon: that.icon,
                           url: `/${that.project}${res.data[i].action}`
                           url: `${res.data[i].code}`
                        })
                     }
                     that.elements.push({
                        title: '退出登录',
                        name: 'logOut',
                        color: 'grey',
                        cuIcon: 'exit',
                        url: '/login/logOut'
                     })
                  } else if (res.code === 403) {
                     uni.showToast({
                        title: res.msg,