|  |  | 
 |  |  | <template> | 
 |  |  |    <view> | 
 |  |  |       <view class="list list-font-color" :class="orderDetl.color" v-for="(orderDetl,index) in dataList" :key="index"> | 
 |  |  |          <view class="list-left"> | 
 |  |  |             <view class="detl-threeCode">{{orderDetl.threeCode}}</view> | 
 |  |  |             <view>主单号:{{orderDetl.orderNo}}</view> | 
 |  |  |             <view>编号:{{orderDetl.matnr}}</view> | 
 |  |  |             <view>名称:{{orderDetl.maktx}}</view> | 
 |  |  |             <view>库存数量:{{orderDetl.anfme}}</view> | 
 |  |  |             <view>订单可出数量:{{orderDetl.stock}}</view> | 
 |  |  |             <view>拣料数量:{{orderDetl.count}}</view> | 
 |  |  |          </view> | 
 |  |  |          <view class="list-right" @click="addItem(index)"> | 
 |  |  |             <uni-icons type="folder-add" size="25"  color="#fff"></uni-icons> | 
 |  |  |          </view> | 
 |  |  |       </view> | 
 |  |  |       <!-- 垫高 --> | 
 |  |  |       <view style="height: 100rpx;text-align: center;color: #b9b9b9;"></view> | 
 |  |  | 		 | 
 |  |  |       <!-- 弹窗 --> | 
 |  |  |       <view> | 
 |  |  | 			 | 
 |  |  |          <uni-popup ref="addItem" type="dialog"> | 
 |  |  |             <view class="popup"> | 
 |  |  |                <!-- 标题 --> | 
 |  |  |                <view class="title">拣料数量</view> | 
 |  |  |                <view class="popup-item"> | 
 |  |  |                   <uni-number-box :value="count" :step='1' :max="maxCount" color="#747474" @change="changeValue" /> | 
 |  |  |                </view> | 
 |  |  |                <view class="btn"> | 
 |  |  |                   <view class="btn-left" @click="addClose">取消</view> | 
 |  |  |                   <view class="btn-right" @click="addConfirm()">添加</view> | 
 |  |  |                </view> | 
 |  |  |             </view> | 
 |  |  |          </uni-popup> | 
 |  |  |       </view> | 
 |  |  |       <!-- 底部操作按钮 --> | 
 |  |  |       <view class="buttom"> | 
 |  |  |          <button size="mini" type="primary" @click="confirmPick('warn')">确认拣料</button> | 
 |  |  |       </view> | 
 |  |  |    </view> | 
 |  |  | </template> | 
 |  |  | 
 |  |  |    export default { | 
 |  |  |       data() { | 
 |  |  |          return { | 
 |  |  | 				 | 
 |  |  |             dataList: [], | 
 |  |  |             orderCarList: [], | 
 |  |  |             pickList: [], | 
 |  |  |             index: 0, | 
 |  |  |             count: 0, | 
 |  |  |             maxCount: 0, | 
 |  |  |             wrkNo: '', | 
 |  |  |             locNo: '' | 
 |  |  |          } | 
 |  |  |       }, | 
 |  |  |       onShow() { | 
 |  |  | 
 |  |  |          // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据 | 
 |  |  |          eventChannel.on('item', function(data) { | 
 |  |  |             console.log(data); | 
 |  |  |             _this.pickList = data.wrkDetls | 
 |  |  |             _this.wrkNo = data.wrkDetls[0].wrkNo | 
 |  |  |             _this.locNo = data.item.sourceLocNo | 
 |  |  |             _this.getLocDetl(data.item.sourceLocNo) | 
 |  |  |          }) | 
 |  |  |       }, | 
 |  |  |       methods: { | 
 |  |  |          getLocDetl() { | 
 |  |  |          getLocDetl(locNo) { | 
 |  |  |             let _this = this | 
 |  |  |             uni.request({ | 
 |  |  |                url: `${_this.baseUrl}/agvMobile/query/locDetl/v1`, | 
 |  |  |                url: `${_this.baseUrl}/agv/locDetl/list/auth/v2`, | 
 |  |  |                header: { 'token': uni.getStorageSync('token') }, | 
 |  |  |                data: { | 
 |  |  |                   curr: 1, | 
 |  |  |                   limit: 999, | 
 |  |  |                   loc_no: locNo | 
 |  |  |                }, | 
 |  |  |                method: 'POST', | 
 |  |  |                method: 'GET', | 
 |  |  |                success(res) { | 
 |  |  |                   res = res.data | 
 |  |  |                   console.log(res); | 
 |  |  |                   if (res.code === 200) { | 
 |  |  |                      let enbleList = [], isfl; | 
 |  |  |                      for (let k of res.data.records) { | 
 |  |  |                         isfl = false; | 
 |  |  |                         for (let j of _this.pickList) { | 
 |  |  |                            if (j.matnr == k.matnr && j.threeCode == k.threeCode) { | 
 |  |  |                               isfl = true; | 
 |  |  |                               break | 
 |  |  |                            } else { | 
 |  |  |                               if (k.stock == -1) { | 
 |  |  |                                  k['color'] = 'order-sts-end' | 
 |  |  |                               } else { | 
 |  |  |                                  k.stock = k.stock >= k.anfme ? k.anfme : k.stock | 
 |  |  |                                  k['color'] = 'order-sts-start' | 
 |  |  |                               } | 
 |  |  |                               k['count'] = 0 | 
 |  |  | 										 | 
 |  |  |                            } | 
 |  |  |                         } | 
 |  |  |                         if (!isfl) { | 
 |  |  |                            enbleList.push(k) | 
 |  |  |                         } | 
 |  |  | 								 | 
 |  |  |                      } | 
 |  |  |                      _this.dataList = enbleList | 
 |  |  |                       | 
 |  |  |                   } 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' }) | 
 |  |  |                   } | 
 |  |  |                } | 
 |  |  |             }) | 
 |  |  |          }, | 
 |  |  |          // 已选拣料列表 | 
 |  |  |          orderCar() { | 
 |  |  | 				 | 
 |  |  |          }, | 
 |  |  |          // 添加入库商品至 待组托列表 | 
 |  |  |          addItem(index) { | 
 |  |  |             // 判断添加的商品是否和已经添加的重复 | 
 |  |  |             let dataList = this.dataList | 
 |  |  |             this.index = index | 
 |  |  |             this.maxCount = this.dataList[index].stock | 
 |  |  |             this.$refs.addItem.open() | 
 |  |  |          }, | 
 |  |  |          addClose() { | 
 |  |  |             this.$refs.addItem.close() | 
 |  |  |          }, | 
 |  |  |          addConfirm() { | 
 |  |  |             this.dataList[this.index].count = this.count  | 
 |  |  |             this.count = 0 | 
 |  |  |             this.$refs.addItem.close() | 
 |  |  |          }, | 
 |  |  |          changeValue(value) { | 
 |  |  |             this.count = value | 
 |  |  |          }, | 
 |  |  |          // 确认再次拣料 | 
 |  |  |          confirmPick() { | 
 |  |  |             let _this = this | 
 |  |  |             uni.request({ | 
 |  |  |                url: `${_this.baseUrl}/agvMobile/pick/again/auth`, | 
 |  |  |                header: { 'token': uni.getStorageSync('token') }, | 
 |  |  |                data: JSON.stringify({ | 
 |  |  |                   wrkNo: _this.wrkNo, | 
 |  |  |                   locNo: _this.locNo, | 
 |  |  |                   picks: _this.dataList | 
 |  |  |                }), | 
 |  |  |                method: 'POST', | 
 |  |  |                success(res) { | 
 |  |  |                   res = res.data | 
 |  |  |                   console.log(res); | 
 |  |  |                   if  (res.code === 200) { | 
 |  |  |                      _this.getOpenerEventChannel().emit('acceptDataFromOpenedPage', {data: 1}); | 
 |  |  |                      setTimeout(()=>{ | 
 |  |  |                         uni.navigateBack() | 
 |  |  |                      },700) | 
 |  |  |                   } else if (res.code == 403) { | 
 |  |  |                      uni.showToast({ title: res.msg, icon: "error", position: 'top' }) | 
 |  |  |                      setTimeout(() => { uni.reLaunch({ url: '../../login/login' }); }, 1000); | 
 |  |  | 
 |  |  | </script> | 
 |  |  |  | 
 |  |  | <style> | 
 |  |  |  | 
 |  |  |    @import url('../../../static/css/common/order.css'); | 
 |  |  |    .list-font-color { | 
 |  |  |       color: #fff; | 
 |  |  |       /* background-color: #33bb44; */ | 
 |  |  |    } | 
 |  |  |    .order-sts-start { | 
 |  |  |       background-color: #3eb689; | 
 |  |  |    } | 
 |  |  |    .order-sts-working { | 
 |  |  |       background-color: #ff9d46; | 
 |  |  |    } | 
 |  |  |    .order-sts-end { | 
 |  |  |       background-color: #ff7356; | 
 |  |  |    } | 
 |  |  |    .detl-threeCode { | 
 |  |  |       font-size: 28px; | 
 |  |  |       font-weight: bold; | 
 |  |  |    } | 
 |  |  |    .shop-car { | 
 |  |  |       position: fixed; | 
 |  |  |       left: 22rpx; | 
 |  |  |       bottom: 150rpx; | 
 |  |  |       background-color: #2299ff; | 
 |  |  |       width: 260rpx; | 
 |  |  |       height: 90rpx; | 
 |  |  |       display: flex; | 
 |  |  |       align-items: center; | 
 |  |  |       box-shadow: 0 0 10px 5px rgba(0, 0, 0, .6); | 
 |  |  |       border-radius: 10rpx; | 
 |  |  |       color: #fff; | 
 |  |  |       font-size: 28px; | 
 |  |  |       font-weight: bold; | 
 |  |  |    } | 
 |  |  |    .car-left { | 
 |  |  |       padding: 16rpx; | 
 |  |  |       flex: 5; | 
 |  |  |    } | 
 |  |  |    .car-right { | 
 |  |  |       flex: 4; | 
 |  |  |    } | 
 |  |  | 	 | 
 |  |  |    .popup { | 
 |  |  |       width: 80vw; | 
 |  |  |       min-height: 100rpx; | 
 |  |  |       background-color: #FFF; | 
 |  |  |       border-radius: 25rpx; | 
 |  |  |       position: relative; | 
 |  |  |    } | 
 |  |  |    .title { | 
 |  |  |       height: 100rpx; | 
 |  |  |       line-height: 100rpx; | 
 |  |  |       width: 100%; | 
 |  |  |       color: #606266; | 
 |  |  |       text-align: center; | 
 |  |  |       font-size: 16px; | 
 |  |  |    } | 
 |  |  |    .popup-item { | 
 |  |  |       height: 80rpx; | 
 |  |  |       line-height: 80rpx; | 
 |  |  |       display: flex; | 
 |  |  |       align-items: center; | 
 |  |  |       justify-content: center; | 
 |  |  |    } | 
 |  |  |    .popup-item-left { | 
 |  |  |       width: 16vw; | 
 |  |  |       padding-right: 20rpx; | 
 |  |  |       text-align: right; | 
 |  |  |       color: #606266; | 
 |  |  |    } | 
 |  |  |    .popup-item-right { | 
 |  |  |       display: flex; | 
 |  |  |       align-items: center; | 
 |  |  |       width: 50vw; | 
 |  |  |       height: 50rpx; | 
 |  |  |       padding: 2px 5px; | 
 |  |  |       border: 1px solid #E4E7ED; | 
 |  |  |       border-radius: 5rpx; | 
 |  |  |    } | 
 |  |  |    .popup-item-right input{ | 
 |  |  |       color: #606266; | 
 |  |  |    } | 
 |  |  |    .btn { | 
 |  |  |       display: flex; | 
 |  |  |       height: 90rpx; | 
 |  |  |       margin-top: 20rpx; | 
 |  |  |       border-top: 1px solid #DCDFE6; | 
 |  |  |       justify-content: center; | 
 |  |  |       align-items: center; | 
 |  |  |    } | 
 |  |  |    .btn-left { | 
 |  |  |       display: flex; | 
 |  |  |       flex: 1; | 
 |  |  |       height: 100%; | 
 |  |  |       justify-content: center; | 
 |  |  |       align-items: center; | 
 |  |  |       color: #606266; | 
 |  |  |       border-right: 1px solid #DCDFE6; | 
 |  |  |    } | 
 |  |  |    .btn-right { | 
 |  |  |       display: flex; | 
 |  |  |       flex: 1; | 
 |  |  |       justify-content: center; | 
 |  |  |       align-items: center; | 
 |  |  |       color: #409EFF; | 
 |  |  |    } | 
 |  |  | </style> |