whycq
2024-04-17 16b692b3ea44779cd15f730b5376ef12b39a9e13
pages/phyz/checkLocDetl/checkLocDetl.vue
@@ -65,9 +65,10 @@
            bay1: '',
            lev1: '',
            dataList: [],
            item: ''
         }
      },
      onLoad() {
      onShow() {
         this.baseUrl = uni.getStorageSync('baseUrl');
         this.token = uni.getStorageSync('token');
         this.getLocMastList()
@@ -128,17 +129,29 @@
                           k['color'] = 'locSts-X' 
                        } else if (k.locSts == 'Q') {
                           k['color'] = 'locSts-Q' 
                        } else if (k.locSts == 'P') {
                           k['color'] = 'locSts-P'
                        } else if (k.locSts == 'X') {
                           k['color'] = 'locSts-X' 
                        }
                     }
                     _this.dataList = res.data.records
                  } else if (res.code == 403) {
                     uni.showToast({ title: res.msg, icon: "error", position: 'top' })
                     setTimeout(() => { uni.reLaunch({ url: '../../login/login' }); }, 1000);
                  } else {
                     uni.showToast({ title: res.msg, icon: "error", position: 'top' })
                  } 
               }
            })
         },
         goToLocDetl(e) {
            this.locNo = e.locNo
            this.item = e
            if (e.locSts == 'S' || e.locSts == 'R') {
               uni.showToast({ title: '当前库位在作业', icon: "error", position: 'top' })
               return
            }
            this.$refs.check.open()
         },
         checkClose() {
@@ -148,11 +161,13 @@
            let _this = this
            let param = {
               barcode : _this.barcode,
               locNo : _this.locNo
               locNo : _this.locNo,
               item: _this.item
            }
            uni.navigateTo({
               url: "./locDetl",
               success: function(res) {
                  _this.$refs.check.close()
                  // 通过eventChannel向被打开页面传送数据   向另外一个页面传递值的
                  res.eventChannel.emit('item', {
                     item: param
@@ -161,7 +176,8 @@
               events: {
                  // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据  另外一个页面传过来的
                  acceptDataFromOpenedPage: function(data) {
                     _this.searchValueFocus = true
                     _this.$refs.check.close()
                     _this.getLocMastList()
                  }
               },
            });