|  |  | 
 |  |  | <template> | 
 |  |  |    <view > | 
 |  |  |       <scroll-view scroll-y catch:touchmove="touchmove"> | 
 |  |  |          <view class="pak-seach-box"> | 
 |  |  |             <view class="box-top"> | 
 |  |  |                <view class="color-block-blue"></view> | 
 |  |  |                <text class="title">托盘条码</text> | 
 |  |  |       <scroll-view scroll-y class="scroll-Y"> | 
 |  |  |          <view class="square-2"> | 
 |  |  |             <view class="square-title"> | 
 |  |  |                <view class="title-sign"><view class="sign"></view></view> | 
 |  |  |                <view class="title-text"><text>托盘条码</text></view> | 
 |  |  |             </view> | 
 |  |  |             <view class="box-buttom"> | 
 |  |  |                <input v-model="barcode" type="text" placeholder="扫码 / 输入"> | 
 |  |  |                <view class="search-icon"> | 
 |  |  |                   <uni-icons type="closeempty" size="20" color="#a5a5a5" @click="removeBarcode()"></uni-icons> | 
 |  |  |             <view class="square-content"> | 
 |  |  |                <view class="content-input"> | 
 |  |  |                   <input v-model="barcode" type="text" placeholder="扫码 / 输入" maxlength="8"  | 
 |  |  |                   @input="findBarcode()" :focus="barcodeFocus" @focus="focuss" > | 
 |  |  |                   <uni-icons type="closeempty" size="20" color="#dadada" @click="removeBarcode()"></uni-icons> | 
 |  |  |                </view> | 
 |  |  |             </view> | 
 |  |  |          </view> | 
 |  |  |          <view class="pak-seach-box"> | 
 |  |  |             <view class="box-top"> | 
 |  |  |                <view class="color-block-blue"></view> | 
 |  |  |                <text class="title">货品条码</text> | 
 |  |  |          <view class="square-2"> | 
 |  |  |             <view class="square-title"> | 
 |  |  |                <view class="title-sign"><view class="sign"></view></view> | 
 |  |  |                <view class="title-text"><text>货品条码</text></view> | 
 |  |  |             </view> | 
 |  |  |             <view class="box-buttom"> | 
 |  |  |                <input v-model="matnr" type="text" placeholder="扫码 / 输入" @input="findMat()"> | 
 |  |  |                <view class="search-icon"> | 
 |  |  |                   <uni-icons type="closeempty" size="20" color="#a5a5a5" @click="removeMatnr()"></uni-icons> | 
 |  |  |             <view class="square-content"> | 
 |  |  |                <view class="content-input-combox" style="width: 94%;"> | 
 |  |  |                   <input style="width: 90%;" type="text" v-model="matnr" placeholder="扫码 / 输入" @input="findMat()":focus="focus" | 
 |  |  |                    @focus="focuss"> | 
 |  |  |                   <!-- @focus="focuss" --> | 
 |  |  |                   <uni-icons type="closeempty" size="20" color="#dadada" @click="removeMatnr()"></uni-icons> | 
 |  |  |                </view> | 
 |  |  |             </view> | 
 |  |  |             <button class="cu-btn bg-blue" @click="selectMat()">+提取</button> | 
 |  |  |          </view> | 
 |  |  |          <view class="pak-data-box"> | 
 |  |  |             <view class="box-top"> | 
 |  |  |                <view class="color-block-blue"></view> | 
 |  |  |                <text class="title">商品列表</text> | 
 |  |  | 			 | 
 |  |  |          <view class="square-1"> | 
 |  |  |             <view class="square-title"> | 
 |  |  |                <view class="title-sign"><view class="sign"></view></view> | 
 |  |  |                <view class="title-text"><text>商品列表</text></view> | 
 |  |  |                <view v-show="matCount > 0" style="display: inline-block;float: right;height: 100rpx;line-height: 100rpx;margin-right: 50rpx;">请扫码选取 {{matCount}} 件商品</view> | 
 |  |  |             </view> | 
 |  |  |          </view> | 
 |  |  |          <view class="pak-data-box"  v-show="matList.length === 0"> | 
 |  |  |             <view style="text-align: center;">暂无更多数据</view> | 
 |  |  |          <view class="square-none" v-show="matList.length === 0"> | 
 |  |  |             <view class="v-show">暂无更多数据. . . </view> | 
 |  |  |          </view> | 
 |  |  |          <checkbox-group @change="checkbox"> | 
 |  |  |             <view v-for="(item,index) in matList" :key="index" class="data-list bg-false" :class="'bg-'+item.checked" > | 
 |  |  |                <view class="data-list-left"> | 
 |  |  |                   <view class="matnr"><text style="width: 400rpx;">编码:{{item.matnr}}</text></view> | 
 |  |  |                   <view><text style="width: 400rpx;">品名:{{item.maktx}}</text></view> | 
 |  |  |                   <view><text style="width: 400rpx;">批号:{{item.batch}}</text></view> | 
 |  |  |                   <view><text style="width: 400rpx;">数量:{{item.anfme}}</text></view> | 
 |  |  |                   <view class="matnr" :style="item.color">No:{{listLen-index}}</view> | 
 |  |  |                   <view class="matnr" :style="item.color">{{item.matnr}}-{{item.batch}}</view> | 
 |  |  |                </view> | 
 |  |  |                <view class="data-list-right"> | 
 |  |  |                   <uni-icons type="trash" size="25" color="#a5a5a5" @click="remove(item,index)"></uni-icons> | 
 |  |  |                   <uni-icons type="trash" size="20" color="#a5a5a5" @click="remove(item,index)"></uni-icons> | 
 |  |  |                </view> | 
 |  |  |             </view> | 
 |  |  |          </checkbox-group> | 
 |  |  | 
 |  |  |             <button class="cu-btn lg" @click="resst()">重置</button> | 
 |  |  |          </view> | 
 |  |  |          <view> | 
 |  |  |             <button class="cu-btn lg pakin-btn bg-blue" @click="comb()">组托</button> | 
 |  |  |             <button class="cu-btn lg pakin-btn bg-blue" @click="comb()">确认</button> | 
 |  |  |          </view> | 
 |  |  |       </view> | 
 |  |  |       <view> | 
 |  |  |          <!-- 提示信息弹窗 --> | 
 |  |  |          <uni-popup ref="message" type="message"> | 
 |  |  |             <uni-popup-message :type="msgType" :message="messageText" :duration="2000"></uni-popup-message> | 
 |  |  |          </uni-popup> | 
 |  |  |       </view> | 
 |  |  |    </view> | 
 |  |  | </template> | 
 |  |  | 
 |  |  |       data() { | 
 |  |  |          return { | 
 |  |  |             barcode: '', | 
 |  |  |             barcodeFocus:true, | 
 |  |  |             focus:false, | 
 |  |  |             type: 'center', | 
 |  |  |             searchBox: 'hide', | 
 |  |  |             pick:'hide', | 
 |  |  |             matnr:'', | 
 |  |  |             // matList:[{matnr:'1101842-10000',batch:'22047515999',color:{color:'red'}}], | 
 |  |  |             matList:[], | 
 |  |  |             result: '' | 
 |  |  |             result: '', | 
 |  |  |             siteList:[], | 
 |  |  |             staNoList:[], | 
 |  |  |             satNo:'', | 
 |  |  |             listLen:0, | 
 |  |  |             msgType: 'success', | 
 |  |  |             messageText: '这是一条成功提示', | 
 |  |  |             fontColor:{color:'red'}, | 
 |  |  |             matCount:'', | 
 |  |  |             wrkNo:'', | 
 |  |  |          } | 
 |  |  |       }, | 
 |  |  |       onReady() { | 
 |  |  |          setInterval(function(){ | 
 |  |  |             // console.log(this.matList) | 
 |  |  |             // this.getMatListLen() | 
 |  |  |          },1000) | 
 |  |  |       }, | 
 |  |  |       mounted(){ | 
 |  |  |          const UIP = uni.getStorageSync('UIP'); | 
 |  |  |          this.baseIP = UIP; | 
 |  |  |          const UPORT = uni.getStorageSync('UPORT'); | 
 |  |  |          this.basePORT = UPORT | 
 |  |  | 			 | 
 |  |  |       }, | 
 |  |  |       methods: { | 
 |  |  |          huanghang() { | 
 |  |  |             this.matnr = '' | 
 |  |  |             this.focus = false; | 
 |  |  |             this.$nextTick(function() { | 
 |  |  |                this.focus = true; | 
 |  |  |             }); | 
 |  |  | 					 | 
 |  |  |          }, | 
 |  |  |          messageToggle(type) { | 
 |  |  |             this.msgType = type | 
 |  |  |             this.messageText = `这是一条${type}消息提示` | 
 |  |  |             this.$refs.message.open() | 
 |  |  |          }, | 
 |  |  |          getMatListLen() { | 
 |  |  |             // this.listLen = this.matList.length; | 
 |  |  |          }, | 
 |  |  |          focuss() { | 
 |  |  |             // uni.hideKeyboard() | 
 |  |  |          }, | 
 |  |  |          resst() { | 
 |  |  |             this.matList = [] | 
 |  |  |             this.barcode = '' | 
 |  |  |             this.matnr = '' | 
 |  |  |             this.matCount = '' | 
 |  |  |             uni.vibrateShort(); | 
 |  |  |          }, | 
 |  |  |          removeBarcode() { | 
 |  |  |             this.barcode = '' | 
 |  |  |             uni.vibrateShort(); | 
 |  |  |             uni.vibrateShort();	 | 
 |  |  |             this.barcodeFocus = false; | 
 |  |  |             this.$nextTick(function() { | 
 |  |  |                this.barcodeFocus = true; | 
 |  |  |             }); | 
 |  |  |          }, | 
 |  |  |          removeMatnr() { | 
 |  |  |             this.matnr = '' | 
 |  |  |             uni.vibrateShort(); | 
 |  |  |          }, | 
 |  |  |          remove(item,index) { | 
 |  |  |             this.matList.splice(index,1) | 
 |  |  |             uni.vibrateShort(); | 
 |  |  |          }, | 
 |  |  |          comb() { | 
 |  |  |             uni.vibrateShort(); | 
 |  |  |             let that = this; | 
 |  |  |             if (that.barcode === '') { | 
 |  |  |                uni.showToast({title: '请扫描托盘条码', icon: "none", position: 'top'}); | 
 |  |  |                return; | 
 |  |  |             } | 
 |  |  |             if (that.matList.length === 0) { | 
 |  |  |                uni.showToast({title: '请添加商品列表', icon: "none", position: 'top'}); | 
 |  |  |                return; | 
 |  |  |             } | 
 |  |  |             uni.showLoading(); | 
 |  |  |             uni.request({ | 
 |  |  |                 url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mobile/comb/auth', | 
 |  |  |                 data: JSON.stringify({ | 
 |  |  |                   barcode: that.barcode, | 
 |  |  |                   combMats: that.matList | 
 |  |  |                }), | 
 |  |  |                method: 'POST', | 
 |  |  |                 header: { | 
 |  |  |                   'token':uni.getStorageSync('token') | 
 |  |  |                 }, | 
 |  |  |                success(result) { | 
 |  |  |                   uni.showLoading(); | 
 |  |  |                   var res = result.data | 
 |  |  |                   if (res.code === 200) { | 
 |  |  |                      uni.showToast({ | 
 |  |  |                         title: res.msg, | 
 |  |  |                         position: 'bottom', | 
 |  |  |                         duration: 1000 | 
 |  |  |                      }); | 
 |  |  |                   } else if (res.code == 403) { | 
 |  |  |                      uni.showToast({title: res.msg, icon: "none", position: 'top'}) | 
 |  |  |                      setTimeout(() => { | 
 |  |  |                         uni.reLaunch({ | 
 |  |  |                            url: '../login/login' | 
 |  |  |                         }); | 
 |  |  |                      }, 1000); | 
 |  |  |                   } else { | 
 |  |  |                      uni.showToast({title: res.msg, icon: "none",position: 'top'}) | 
 |  |  |                   } | 
 |  |  |                } | 
 |  |  |             this.focus = false; | 
 |  |  |             this.$nextTick(function() { | 
 |  |  |                this.focus = true; | 
 |  |  |             }); | 
 |  |  |          }, | 
 |  |  |          remove(item,index) { | 
 |  |  |             this.matList.splice(index,1); | 
 |  |  |             this.listLen = this.matList.length | 
 |  |  |             this.messageToggle('success') | 
 |  |  |             this.messageText = '删除成功' | 
 |  |  |             uni.vibrateShort(); | 
 |  |  |          }, | 
 |  |  | 			 | 
 |  |  |          selectMat() { | 
 |  |  |             let that = this | 
 |  |  |             uni.vibrateShort(); | 
 |  |  | 
 |  |  |             }); | 
 |  |  |             that.matnr = '' | 
 |  |  |          }, | 
 |  |  |          findBarcode() { | 
 |  |  |             let that = this | 
 |  |  |             uni.request({ | 
 |  |  |                 url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mobile/pakout/confirm/barcode/auth', | 
 |  |  |                 data: { | 
 |  |  |                   barcode:that.barcode | 
 |  |  |                 }, | 
 |  |  |                 header: { | 
 |  |  |                   'token':uni.getStorageSync('token'), | 
 |  |  |                 }, | 
 |  |  |                success(result) { | 
 |  |  |                   console.log(result) | 
 |  |  |                   let res = result.data; | 
 |  |  |                   if (res.code === 200) { | 
 |  |  |                      if (res.data.ioType === 101) { | 
 |  |  |                         that.matList = res.data.list.concat(that.matList) | 
 |  |  |                         that.listLen = that.matList.length; | 
 |  |  |                         return; | 
 |  |  |                      } | 
 |  |  |                      if (res.data.ioType === 103) { | 
 |  |  |                         that.matCount = res.data.list.length | 
 |  |  |                         that.wrkNo = res.data.list[0].wrkNo | 
 |  |  |                         return; | 
 |  |  |                      } | 
 |  |  |                      // if (res.data) { | 
 |  |  |                      //    that.matCount = res.data.length | 
 |  |  |                      // } | 
 |  |  |                   } else if (res.code === 403) { | 
 |  |  |                      uni.showToast({title: res.msg, icon: "none", position: 'top'}) | 
 |  |  |                         setTimeout(() => { | 
 |  |  |                            uni.reLaunch({ | 
 |  |  |                               url: '../login/login' | 
 |  |  |                            }); | 
 |  |  |                      }, 1000); | 
 |  |  |                   } else { | 
 |  |  |                      uni.showToast({title: res.msg, icon: "none",position: 'top'}) | 
 |  |  |                   } | 
 |  |  | 						 | 
 |  |  |                } | 
 |  |  |             }); | 
 |  |  | 				 | 
 |  |  |          }, | 
 |  |  |          findMat() { | 
 |  |  |             let that = this | 
 |  |  |             uni.request({ | 
 |  |  |                 url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mat/auth', | 
 |  |  |                 url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mobile/pakout/confirm/pick/auth', | 
 |  |  |                 data: { | 
 |  |  |                   wrkNo:that.wrkNo, | 
 |  |  |                   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 | 
 |  |  |                      uni.navigateTo({ | 
 |  |  |                         url: "matQuery", | 
 |  |  |                         events: { | 
 |  |  |                             // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据 | 
 |  |  |                             matList: function(data) { | 
 |  |  |                               that.matList.push(data.data) | 
 |  |  |                             }, | 
 |  |  |                           }, | 
 |  |  |                           success: function(res) { | 
 |  |  |                             // 通过eventChannel向被打开页面传送数据 | 
 |  |  |                             res.eventChannel.emit('matData', { data: that.matData }) | 
 |  |  |                           } | 
 |  |  |                      }); | 
 |  |  |                   console.log(result) | 
 |  |  |                   var res = result.data; | 
 |  |  |                   if(res.code === 200 ) { | 
 |  |  |                      if(res.data) { | 
 |  |  |                         if (that.matList.length == 0) { | 
 |  |  |                            that.matList.push(res.data) | 
 |  |  |                            that.listLen = that.matList.length; | 
 |  |  |                            that.huanghang(); | 
 |  |  |                            return; | 
 |  |  |                         } | 
 |  |  |                         for(let i = 0;i<that.matList.length;i++) { | 
 |  |  |                            if (that.matList.length < that.matCount){ | 
 |  |  |                               if(JSON.stringify(that.matList[i]) === JSON.stringify(res.data)) { | 
 |  |  |                                  that.messageToggle('warn'); | 
 |  |  |                                  that.messageText = '该商品已添加'; | 
 |  |  |                                  that.huanghang(); | 
 |  |  |                                  return; | 
 |  |  |                               } else { | 
 |  |  |                                  that.matList.unshift(res.data); | 
 |  |  |                                  that.listLen = that.matList.length; | 
 |  |  |                                  that.huanghang(); | 
 |  |  |                                  return; | 
 |  |  |                               } | 
 |  |  |                            } else { | 
 |  |  |                               that.messageToggle('warn'); | 
 |  |  |                               that.messageText = '已出全部商品,请确认出库'; | 
 |  |  |                               that.huanghang(); | 
 |  |  |                               return; | 
 |  |  |                            } | 
 |  |  |                         } | 
 |  |  |                      } | 
 |  |  |                   } else if (res.code == 403) { | 
 |  |  |                      uni.showToast({title: res.msg, icon: "none", position: 'top'}) | 
 |  |  |                      setTimeout(() => { | 
 |  |  |                         uni.reLaunch({ | 
 |  |  |                            url: '../login/login' | 
 |  |  |                         }); | 
 |  |  |                      }, 1000); | 
 |  |  |                   } else { | 
 |  |  |                      uni.showToast({title: res.msg, icon: "none",position: 'top'}) | 
 |  |  |                   } | 
 |  |  |                    | 
 |  |  |                } | 
 |  |  |             }); | 
 |  |  |          }, | 
 |  |  | 		 | 
 |  |  |          comb() { | 
 |  |  |             let that = this; | 
 |  |  |             if (that.barcode === '') { | 
 |  |  |                this.messageToggle('error') | 
 |  |  |                this.messageText = '请扫描托盘码' | 
 |  |  |                return; | 
 |  |  |             } | 
 |  |  |             if (that.barcode.length !== 8) { | 
 |  |  |                this.messageToggle('error') | 
 |  |  |                this.messageText = '托盘码必须为8位' | 
 |  |  |                return; | 
 |  |  |             } | 
 |  |  |             if (that.matList.length === 0) { | 
 |  |  |                this.messageToggle('error') | 
 |  |  |                this.messageText = '请添加商品列表' | 
 |  |  |                return; | 
 |  |  |             } | 
 |  |  | 				 | 
 |  |  |             if (that.matList.length < that.matCount) { | 
 |  |  |                var len = that.matCount - that.matList.length | 
 |  |  |                that.messageToggle('error') | 
 |  |  |                that.messageText = '还剩' + len + '件未扫描' | 
 |  |  |                return; | 
 |  |  |             } | 
 |  |  |             uni.showLoading(); | 
 |  |  |             uni.request({ | 
 |  |  |                 url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mobile/pakout/confirm/auth', | 
 |  |  |                 data: that.matList, | 
 |  |  |                method: 'POST', | 
 |  |  |                 header: { | 
 |  |  |                   'token':uni.getStorageSync('token') | 
 |  |  |                 }, | 
 |  |  |                success(result) { | 
 |  |  |                   uni.showLoading(); | 
 |  |  |                   var res = result.data | 
 |  |  |                   if (res.code === 200) { | 
 |  |  |                      uni.showToast({ title: res.msg,position: 'bottom',duration: 1000}); | 
 |  |  |                      that.resst(); | 
 |  |  |                   } else if (res.code == 403) { | 
 |  |  |                      uni.showToast({title: res.msg, icon: "none", position: 'top'}) | 
 |  |  |                      setTimeout(() => { | 
 |  |  |                         uni.reLaunch({ | 
 |  |  |                            url: '../login/login' | 
 |  |  |                         }); | 
 |  |  |                      }, 1000); | 
 |  |  |                   } else { | 
 |  |  |                      uni.showToast({title: res.msg, icon: "none",position: 'top'}) | 
 |  |  |                   } | 
 |  |  |                } | 
 |  |  |             }); | 
 |  |  |          }, | 
 |  |  |          getCheckDetl() {   // 获取出库口货物信息 | 
 |  |  |             let that = this | 
 |  |  | 				 | 
 |  |  |          }, // getCheckDetl | 
 |  |  |          change(e) { | 
 |  |  |             console.log('当前模式:' + e.type + ',状态:' + e.show); | 
 |  |  |          }, | 
 |  |  |          toggle(type) { | 
 |  |  |             this.type = type | 
 |  |  | 
 |  |  | <style> | 
 |  |  |    /* @import "../../colorui/main.css"; | 
 |  |  |    @import "../../colorui/icon.css"; */ | 
 |  |  | 	 | 
 |  |  |  | 
 |  |  |    .pak-seach-box { | 
 |  |  |       background-color: #FFFFFF; | 
 |  |  |       margin: 15rpx 15rpx 0rpx 15rpx; | 
 |  |  | 
 |  |  |    } | 
 |  |  |    .box-buttom { | 
 |  |  |       display: inline-block; | 
 |  |  |       background-color: #ededed; | 
 |  |  |       background-color: #f0f0f0; | 
 |  |  |       width: 65%; | 
 |  |  |       height: 60rpx; | 
 |  |  |       border-radius: 20rpx; | 
 |  |  | 
 |  |  |       margin-top: 5rpx; | 
 |  |  |       margin-right: 10rpx; | 
 |  |  |    } | 
 |  |  | 	 | 
 |  |  |    /* .pak-seach-box input { | 
 |  |  |       background-color: #ededed; | 
 |  |  |       border: 1rpx solid #d8d8d8; | 
 |  |  | 
 |  |  |    } | 
 |  |  |    .data-list { | 
 |  |  |       border-bottom: 1px solid #d8d8d8; | 
 |  |  |       height: 180rpx; | 
 |  |  |       height: 130rpx; | 
 |  |  |       margin: 15rpx; | 
 |  |  |       border-radius: 20rpx; | 
 |  |  |    } | 
 |  |  | 
 |  |  |       margin-top: 20rpx; | 
 |  |  |    } | 
 |  |  |    .data-list:last-child { | 
 |  |  |       margin-bottom: 120rpx; | 
 |  |  |       margin-bottom: 200rpx; | 
 |  |  |    } | 
 |  |  |    /* .data-list-left { | 
 |  |  |       display: inline-block; | 
 |  |  | 
 |  |  |       line-height: 180rpx; | 
 |  |  |    } */ | 
 |  |  |    .data-list-left { | 
 |  |  |       width: 550rpx; | 
 |  |  |       /* background-color: #007AFF; */ | 
 |  |  |       display: inline-block; | 
 |  |  |       float: left; | 
 |  |  |       margin-left: 6%; | 
 |  |  |       height: 180rpx; | 
 |  |  |       margin-left: 4%; | 
 |  |  |       height: 130rpx; | 
 |  |  |       color: #676767; | 
 |  |  |    } | 
 |  |  |    .matnr { | 
 |  |  |       padding-top: 10rpx; | 
 |  |  |       display: inline-block; | 
 |  |  |       width: 100%; | 
 |  |  |       font-size: 14px; | 
 |  |  |       font-weight: 700; | 
 |  |  |       padding-top: 15rpx; | 
 |  |  |       /* height: 130rpx; | 
 |  |  |       line-height: 130rpx; */ | 
 |  |  |    } | 
 |  |  |    .data-list-right { | 
 |  |  |       /* background-color: #6739B6; */ | 
 |  |  |       display: inline-block; | 
 |  |  |       float: right; | 
 |  |  |       height: 180rpx; | 
 |  |  |       line-height: 180rpx; | 
 |  |  |       margin-right: 10%; | 
 |  |  |       width: 100rpx; | 
 |  |  |       height: 130rpx; | 
 |  |  |       line-height: 130rpx; | 
 |  |  |    } | 
 |  |  | </style> |