|  |  | 
 |  |  | <template> | 
 |  |  |    <view> | 
 |  |  |       <view class="status_bar"> | 
 |  |  |          <!-- 这里是状态栏 --> | 
 |  |  |       </view> | 
 |  |  |       <uni-nav-bar left-icon="left" background-color="#f8f8f8" title="并板入库" @clickLeft="back"  :fixed="true" | 
 |  |  |          :border="false" rightWidth="160rpx" leftWidth="160rpx" | 
 |  |  |          > | 
 |  |  |          <block slot="right"> | 
 |  |  |             <view class="city"> | 
 |  |  |                <view> | 
 |  |  |                   <text class="uni-nav-bar-text">{{store}}</text> | 
 |  |  |                </view> | 
 |  |  |             </view> | 
 |  |  |          </block> | 
 |  |  |        </uni-nav-bar> | 
 |  |  |       <view class="code"> | 
 |  |  |          <view class="item"> | 
 |  |  |             <view class="code-decs">库位号:</view> | 
 |  |  | 
 |  |  |                      <uni-tag :text="item.batch" type="warning"></uni-tag> | 
 |  |  |                   </view> | 
 |  |  |                </view> | 
 |  |  |                <view class="list-left-item"> | 
 |  |  |                <view class="list-left-item" v-if="!showChecked"> | 
 |  |  |                   <view class="desc">可用数量:</view> | 
 |  |  |                   <view class="left-item"> | 
 |  |  |                      {{item.count}} | 
 |  |  |                   </view> | 
 |  |  |                </view> | 
 |  |  |                <view class="list-left-item"> | 
 |  |  |                   <view class="desc">使用数量:</view> | 
 |  |  |                <view class="list-left-item" v-else> | 
 |  |  |                   <view class="desc">数量:</view> | 
 |  |  |                   <view class="left-item">{{item.useCount}}</view> | 
 |  |  |                </view> | 
 |  |  |             </view> | 
 |  |  | 
 |  |  |          return { | 
 |  |  |             baseUrl: '', | 
 |  |  |             token: '', | 
 |  |  |             storeId: 0, | 
 |  |  |             store: '', | 
 |  |  |             locNo: '', | 
 |  |  |             locNoList: [], | 
 |  |  |             sta: '', | 
 |  |  |             sta: '106', | 
 |  |  |             staList: [], | 
 |  |  |             dataList: [], | 
 |  |  |             checkedDataList: [], | 
 |  |  | 
 |  |  |          this.token = uni.getStorageSync('token'); | 
 |  |  |          this.getPickStaList() | 
 |  |  |          this.getMatList() | 
 |  |  |          this.getLocNoList() | 
 |  |  |          this.storeId = uni.getStorageSync('store') | 
 |  |  |          if (this.storeId == 1) { | 
 |  |  |             this.store = '宁波仓' | 
 |  |  |          } | 
 |  |  |          if (this.storeId == 2) { | 
 |  |  |             this.store = '新昌仓' | 
 |  |  |          } | 
 |  |  |       }, | 
 |  |  |       methods: { | 
 |  |  |          back() { uni.navigateBack({}) }, | 
 |  |  |          set(e) { | 
 |  |  |             var ck = this.dataList[e].checked | 
 |  |  |             this.dataList[e].checked = ck ? false : true | 
 |  |  | 
 |  |  |             let that = this | 
 |  |  |             uni.request({ | 
 |  |  |                url: that.baseUrl + '/mobile/loc/f/list', | 
 |  |  |                header: { | 
 |  |  |                   'token': uni.getStorageSync('token') | 
 |  |  |                }, | 
 |  |  |                data: { | 
 |  |  |                   locNo: that.locNo | 
 |  |  |                }, | 
 |  |  |                header: { 'token': uni.getStorageSync('token') }, | 
 |  |  |                data: { locNo: that.locNo }, | 
 |  |  |                method: 'GET', | 
 |  |  |                success(res) { | 
 |  |  |                   res = res.data; | 
 |  |  | 
 |  |  |                         list.push(item.locNo) | 
 |  |  |                      }) | 
 |  |  |                      that.locNoList = list; | 
 |  |  |                   } else if (res.code == 403) { | 
 |  |  |                      uni.showToast({ title: res.msg, icon: "error", position: 'center' }) | 
 |  |  |                      setTimeout(() => { uni.reLaunch({ url: '../login/login' }); }, 1000); | 
 |  |  |                   } else { | 
 |  |  |                      uni.showToast({ title: res.msg, icon: "error", position: 'center' }) | 
 |  |  |                   } | 
 |  |  |                } | 
 |  |  |             }) | 
 |  |  | 
 |  |  |                         list.push(item.stnNo) | 
 |  |  |                      }) | 
 |  |  |                      that.staList = list; | 
 |  |  |                   } else if (res.code == 403) { | 
 |  |  |                      uni.showToast({ title: res.msg, icon: "error", position: 'center' }) | 
 |  |  |                      setTimeout(() => { uni.reLaunch({ url: '../login/login' }); }, 1000); | 
 |  |  |                   } else { | 
 |  |  |                      uni.showToast({ title: res.msg, icon: "error", position: 'center' }) | 
 |  |  |                   } | 
 |  |  |                } | 
 |  |  |             }) | 
 |  |  | 
 |  |  |                      for (var i = 0; i < that.dataList.length; i++) { | 
 |  |  |                         that.$set(that.dataList[i], 'checked', false) | 
 |  |  |                      } | 
 |  |  |                   } else if (res.code == 403) { | 
 |  |  |                      uni.showToast({ title: res.msg, icon: "error", position: 'center' }) | 
 |  |  |                      setTimeout(() => { uni.reLaunch({ url: '../login/login' }); }, 1000); | 
 |  |  |                   } else { | 
 |  |  |                      uni.showToast({ title: res.msg, icon: "error", position: 'center' }) | 
 |  |  |                   } | 
 |  |  |                } | 
 |  |  |             }) | 
 |  |  | 				 | 
 |  |  |          }, | 
 |  |  |          getChecked() { | 
 |  |  |             let checkedList = this.checkedDataList; | 
 |  |  |             for (var i = 0; i < this.dataList.length; i++) { | 
 |  |  |                var t = !this.dataList[i].checked | 
 |  |  |                if (this.dataList[i].checked) { | 
 |  |  |                   checkedList.push(this.dataList[i]) | 
 |  |  |                   let data = this.dataList[i] | 
 |  |  |                   data.useCount = data.count | 
 |  |  |                   checkedList.push(data) | 
 |  |  |                } | 
 |  |  |             } | 
 |  |  | 				 | 
 |  |  |             this.matnr = "" | 
 |  |  |             this.checkedDataList = checkedList; | 
 |  |  |             this.switchCheckedList() | 
 |  |  |          }, | 
 |  |  | 
 |  |  |             this.dataList = this.checkedDataList; | 
 |  |  |             this.showChecked = true; | 
 |  |  |          }, | 
 |  |  | 			 | 
 |  |  | 			 | 
 |  |  |          checkboxChange: function(e) {}, | 
 |  |  |          messageToggle(type) { | 
 |  |  |             this.msgType1 = type | 
 |  |  | 
 |  |  |             uni.vibrateShort(); | 
 |  |  |             let that = this; | 
 |  |  |             if (that.checkedDataList.length === 0) { | 
 |  |  |                this.messageText = "请添加商品列表" | 
 |  |  |                this.messageToggle('error') | 
 |  |  |                uni.showToast({ title: "请选择并板商品", icon: "error", position: 'center' }) | 
 |  |  |                return; | 
 |  |  |             } | 
 |  |  |             if (that.locNo == '') { | 
 |  |  |                this.messageText = "库位号不能为空" | 
 |  |  |                this.messageToggle('error') | 
 |  |  |                uni.showToast({ title: "库位号不能为空", icon: "error", position: 'center' }) | 
 |  |  |                return; | 
 |  |  |             } | 
 |  |  |             if (that.sta == '') { | 
 |  |  |                this.messageText = "站点不能为空" | 
 |  |  |                this.messageToggle('error') | 
 |  |  |                uni.showToast({ title: "站点不能为空", icon: "error", position: 'center' }) | 
 |  |  |                return; | 
 |  |  |             } | 
 |  |  |             for (var i = 0; i < that.checkedDataList.length; i++) { | 
 |  |  |                if (that.checkedDataList[i].useCount == 0 || that.checkedDataList[i].useCount == '') { | 
 |  |  |                   this.messageText = that.checkedDataList[i].matnr + '并板数量不能为0' | 
 |  |  |                   this.messageToggle('error') | 
 |  |  |                   uni.showToast({ title: "并板数量不能为0", icon: "error", position: 'center' }) | 
 |  |  |                   return; | 
 |  |  |                } | 
 |  |  |             } | 
 |  |  | 
 |  |  |                   staNo: that.sta, | 
 |  |  |                   list: that.checkedDataList | 
 |  |  |             } | 
 |  |  |             console.log(param); | 
 |  |  |             uni.request({ | 
 |  |  |                url: that.baseUrl + '/mobile/pick/in', | 
 |  |  |                data: JSON.stringify(param), | 
 |  |  | 
 |  |  |                   var res = result.data | 
 |  |  |                   if (res.code === 200) { | 
 |  |  |                      that.resst(); | 
 |  |  |                      that.messageText = "并板成功" | 
 |  |  |                      that.messageToggle('success') | 
 |  |  |                      uni.showToast({ title: "并板成功", icon: "success", position: 'center' }) | 
 |  |  |                   } else if (res.code == 403) { | 
 |  |  |                      that.messageText = res.msg | 
 |  |  |                      that.messageToggle('error') | 
 |  |  |                      setTimeout(() => { | 
 |  |  |                         uni.reLaunch({ | 
 |  |  |                            url: '../login/login' | 
 |  |  |                         }); | 
 |  |  |                      }, 1000); | 
 |  |  |                      uni.showToast({ title: res.msg, icon: "success", position: 'center' }) | 
 |  |  |                      setTimeout(() => { uni.reLaunch({ url: '../login/login' }); }, 1000); | 
 |  |  |                   } else { | 
 |  |  |                      that.messageText = res.msg | 
 |  |  |                      that.messageToggle('error') | 
 |  |  |                      uni.showToast({ title: res.msg, icon: "success", position: 'center' }) | 
 |  |  |                   } | 
 |  |  |                } | 
 |  |  |             }); | 
 |  |  | 
 |  |  |          resst() { | 
 |  |  |             this.dataList = [] | 
 |  |  |             this.checkedDataList = [] | 
 |  |  |             this.locNo = '' | 
 |  |  |             this.sta = '' | 
 |  |  |          }, | 
 |  |  |          combClose() { | 
 |  |  |             this.$refs.combConfirm.close() |