#
whycq
2024-07-22 e01dae65d8ea58d2cf8519aaac4ceba79b9c82a0
pages/phyz/stationManage/pickAgain.vue
@@ -36,7 +36,7 @@
      </view>
      <!-- 底部操作按钮 -->
      <view class="buttom">
         <button size="mini" type="primary" @click="confirmPick('warn')">确认拣料</button>
         <button size="mini" type="primary" @click="confirmPick('warn')" :disabled="pickAgaDis">确认拣料</button>
      </view>
   </view>
</template>
@@ -53,7 +53,8 @@
            maxCount: 0,
            wrkNo: '',
            locNo: '',
            pickedAnfme: 0
            pickedAnfme: 0,
            pickAgaDis: false
         }
      },
      onShow() {
@@ -73,6 +74,7 @@
      },
      methods: {
         getLocDetl(locNo) {
            let _this = this
            uni.request({
               url: `${_this.baseUrl}/agv/locDetl/list/auth/v2`,
@@ -120,7 +122,7 @@
                  } else {
                     uni.showToast({ title: res.msg, icon: "error", position: 'top' })
                  }
               }
               },
            })
         },
         // 已选拣料列表
@@ -155,12 +157,23 @@
            // 判断添加的商品是否和已经添加的重复
            let dataList = this.dataList
            this.index = index
            let orderCount = this.dataList[index].stock
            let locCount = this.dataList[index].anfme
            let pickedAnfme = this.dataList[index].pickedAnfme
            // 预计最大要出库
            let ftCount = pickedAnfme + orderCount
            
            if (this.dataList[index].stock > this.dataList[index].anfme) {
               this.maxCount = this.dataList[index].anfme - this.dataList[index].pickedAnfme
            if (orderCount > locCount) {
               this.maxCount = locCount - pickedAnfme
            } else {
               this.maxCount = this.dataList[index].stock
               if (ftCount > locCount) {
                  this.maxCount = locCount -pickedAnfme
               } else {
                  this.maxCount = orderCount
               }
            }
            this.$refs.addItem.open()
         },
         addClose() {
@@ -176,6 +189,7 @@
         },
         // 确认再次拣料
         confirmPick() {
            this.pickAgaDis = true
            let _this = this
            uni.request({
               url: `${_this.baseUrl}/agvMobile/pick/again/auth`,
@@ -187,6 +201,7 @@
               }),
               method: 'POST',
               success(res) {
                  _this.pickAgaDis = false
                  res = res.data
                  console.log(res);
                  if  (res.code === 200) {
@@ -202,6 +217,9 @@
                  }
               }
            })
         },
         fail(res) {
            _this.pickAgaDis = false
         }
      }
   }