#
whycq
2024-04-01 f11f38fbd00c39c9a021807b6b585c6fb0c5aa96
pages/phyz/stationManage/stationManage.vue
@@ -2,12 +2,11 @@
   <view>
      <view class="code">
         <uni-search-bar :focus="searchValueFocus" v-model="searchValue"  @input="searchValueInput()"
            maxlength="500" ancel="cancel" @clear="clear" placeholder="输入 / 扫描 订单号">
            maxlength="500" ancel="cancel" @clear="clear" placeholder="输入 / 扫描 站点号">
         </uni-search-bar>
      </view>
      <view class="list" style="background-color: #3eb689;color: #fff;" v-if="station">
         <view class="list-left">
            <view>站点编号:{{station.stationCode}}</view>
            <view>工位编号:{{station.devNo}}</view>
            <view>工位状态:{{station.locSts$}}</view>
            <view>条形码:{{station.barcode}}</view>
@@ -42,7 +41,51 @@
         </view>
      </view>
      
      <view class="list" style="background-color: #fda800;color: #fff;" v-for="wrkMast in waitPakins">
         <view class="list-left">
            <view>物料号:{{wrkMast.matnr}}</view>
            <view>物料名称:{{wrkMast.maktx}}</view>
            <view>批号:{{wrkMast.batch}}</view>
            <view>规格:{{wrkMast.specs}}</view>
            <view>数量:{{wrkMast.anfme}}</view>
         </view>
      </view>
      <view style="height: 100rpx;"></view>
      <!-- 空板入库弹窗 -->
      <view>
         <uni-popup ref="revise" type="dialog">
            <view class="popup">
               <!-- 标题 -->
               <view class="title">请录入货架码</view>
               <view class="popup-item">
                  <view class="popup-item-left">货架码:</view>
                  <view class="popup-item-right"><input type="text" v-model="barcode"></view>
               </view>
               <view class="btn">
                  <view class="btn-left" @click="reviseClose">取消</view>
                  <view class="btn-right" @click="reviseConfirm()">入库</view>
               </view>
            </view>
         </uni-popup>
      </view>
      <!-- 底部操作按钮 -->
      <view class="buttom" v-if="waitPakins.length > 0">
         <button size="mini" type="primary" @click="startPakin(searchValue)" v-if="waitPakins">启动入库</button>
      </view>
      <!-- 底部操作按钮 -->
      <view class="buttom" v-if="station.locSts == 'O'">
         <button size="mini" type="primary" @click="emptyPakin()">空板入库</button>
      </view>
      <!-- 底部操作按钮 -->
      <view class="buttom" v-if="wrkMast">
         <button size="mini" type="primary" @click="containerMoveOut(searchValue)" v-if="wrkMast.ioType == 101">确认出库</button>
         <button size="mini" type="primary" @click="pickIn(searchValue)" v-if="wrkMast.ioType == 103">已拣料回库</button>
      </view>
   </view>
</template>
@@ -56,8 +99,9 @@
            searchValue: '',
            station: '',
            wrkMast: '',
            wrkDetls: []
            wrkDetls: [],
            waitPakins: [],
            barcode: ''
         }
      },
      onLoad() {
@@ -78,7 +122,8 @@
            }
         },
         clear() {
            this.waitPakins = []
            this.wrkDetls = []
         },
         // 获取暂存位
         getBasDevp() {
@@ -97,7 +142,35 @@
                  if (res.code === 200) {
                     for (let item of res.data.records) {
                        _this.station = item
                        _this.getWrkMast(item.barcode)
                        if (item.barcode) {
                           _this.getWrkMast(item.barcode)
                           _this.getWaitPakin(item.barcode)
                        } else {
                        }
                     }
                  }
               }
            })
         },
         // 获取组托档
         getWaitPakin(barcode) {
            let _this = this
            uni.request({
               url: `${_this.baseUrl}/agv/waitPakin/list/auth`,
               header: {'token': uni.getStorageSync('token')},
               data: {
                  curr: 1,
                  limit: 1000,
                  supp_code: barcode
               },
               method: 'GET',
               success(res) {
                  res = res.data
                  if (res.code === 200) {
                     for (let item of res.data.records) {
                        _this.waitPakins = res.data.records
                        // _this.getWrkDetl(item.wrkNo)
                     }
                  }
               }
@@ -126,6 +199,7 @@
               }
            })
         },
         // 获取工作明细
         getWrkDetl(wrkNo) {
            let _this = this
            uni.request({
@@ -144,6 +218,94 @@
                  }
               }
            })
         },
         // 拣料回库
         pickIn(e) {
            let _this = this
            uni.request({
               url: `${_this.baseUrl}/agv/basDevp/visualized/container/pickIn`,
               data: {devNo: e},
               method: 'POST',
               success(res) {
               }
            })
         },
         // 容器离场
         containerMoveOut(e) {
            let _this = this
            let devNo = {devNo:[e]}
            // console.log(JSON.stringify(devNo));
            uni.request({
               url: `${_this.baseUrl}/agv/basDevp/visualized/container/moveOut`,
               data: JSON.stringify(devNo),
               method: 'POST',
               success(res) {
               }
            })
         },
         // 启动入库
         startPakin(type) {
            let that = this
            let params = []
            let param = {}
            if (type == 'empty') {
               param = {
                  devNo: this.searchValue,
                  containerCode: this.barcode,
               }
            } else {
               param = {
                  devNo: this.searchValue,
                  containerCode: this.station.barcode,
               }
            }
            params.push(param)
            uni.request({
               url: that.baseUrl + '/agvMobile/pakin/empty/auth',
               data: {pad: params},
               method: 'POST',
               header: {'token': uni.getStorageSync('token')},
               success(result) {
                  var res = result.data
                  if (res.code === 200) {
                     uni.showToast({
                        title: res.msg,
                        icon: "none",
                        position: 'top'
                     })
                  } else if (res.code == 403) {
                     that.messageText = res.msg
                     that.messageToggle('error')
                     setTimeout(() => {
                        uni.reLaunch({
                           url: '../login/login'
                        });
                     }, 1000);
                  } else {
                     that.messageText = res.msg
                     that.messageToggle('error')
                  }
               }
            });
         },
         // 空板入库
         emptyPakin() {
            let _this = this
            this.$refs.revise.open()
         },
         // 取消空板入库
         reviseClose() {
            this.$refs.revise.close()
         },
         // 确认空板入库
         reviseConfirm() {
            this.startPakin('empty')
            this.$refs.revise.close()
            setTimeout(()=> {
               this.getBasDevp()
            },300)
         }
      }
   }
@@ -163,4 +325,68 @@
      color: #e2231a;
      font-weight: bold;
   }
   .popup {
      width: 80vw;
      min-height: 100rpx;
      background-color: #FFF;
      border-radius: 25rpx;
   }
   .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;
      font-size: 14px;
   }
   .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>