#
whycq
2022-09-28 d3cb74c577d7254fe0f879ce77694e5d51d77ae4
pages/basics/manStoCheck.vue
@@ -8,8 +8,8 @@
         </view>
         <view class="square-content">
            <view class="content-input">
               <input type="text" v-model="locno" placeholder="扫码 / 输入" :focus="locnoFocus">
               <uni-icons v-show="locno" type="closeempty" size="20" color="#dadada" @click="remove('locno')"></uni-icons>
               <input type="text" v-model="locNo" placeholder="扫码 / 输入" :focus="locnoFocus">
               <uni-icons v-show="locNo" type="closeempty" size="20" color="#dadada" @click="remove('locno')"></uni-icons>
            </view>
         </view>
      </view>
@@ -113,7 +113,7 @@
      data() {
         return {
            commonUrl:null,
            locno: '',
            locNo: '',
            locnoFocus: true,
            matnr: '',
            matnrFocus: true,
@@ -238,15 +238,15 @@
         },
         resst() {
            this.matList = []
            this.locno = ''
            this.barcodeFocuss()
            this.locNo = ''
            // this.barcodeFocuss()
            uni.vibrateShort();
         },
         comb() {
            uni.vibrateShort();
            let that = this;
            if (that.barcode === '') {
               uni.showToast({title: '请扫描托盘条码', icon: "none", position: 'top'});
            if (that.locNo === '') {
               uni.showToast({title: '请扫描库位条码', icon: "none", position: 'top'});
               return;
            }
            if (that.matList.length === 0) {
@@ -261,9 +261,9 @@
            }
            uni.showLoading();
            uni.request({
                url: that.commonUrl + '/mobile/comb/auth',
                url: that.commonUrl + '/locCheck/pda',
                data: JSON.stringify({
                  barcode: that.barcode,
                  locNo: that.locNo,
                  combMats: that.matList
               }),
               method: 'POST',
@@ -293,6 +293,63 @@
               }
            });
         },
         // 提取商品
         selectMat() {
            let that = this
            uni.vibrateShort();
            uni.navigateTo({
               url: "matSelect",
               events: {
                   // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据  另外一个页面传过来的
                   acceptDataFromOpenedPage: function(data) {
                     that.matnr = data.data
                     that.findMat(that.matnr)
                   },
               },
               success: function(res) {
                   // 通过eventChannel向被打开页面传送数据   向另外一个页面传递值的
                   res.eventChannel.emit('commonUrl', {commonUrl:that.commonUrl })
               },
            });
            that.matnr = ''
         },
         findMat() {
            let that = this
            uni.request({
                url: that.commonUrl + '/mat/auth',
                data: {
                  matnr:that.matnr
                },
                header: {
                  'token':uni.getStorageSync('token')
                },
               success(result) {
                  uni.vibrateShort();
                  let res = result.data
                  if (res.code === 200 && res.data) {
                     that.matData = res.data
                     that.matnr = ''
                     uni.navigateTo({
                        url: "matQuery",
                        events: {
                            // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
                            matList: function(data) {
                              console.log(data)
                              that.matList.push(data.data)
                           },
                        },
                        success: function(res) {
                           // 通过eventChannel向被打开页面传送数据
                           res.eventChannel.emit('matData', { data: that.matData })
                        },
                     });
                  }
               }
            });
         },
      }
   }
</script>