#
whycq
2024-10-28 004b81ef2b3132f89685932508101d2f7c0027e1
pages/pakin/WarehouseOutParallelBoard.vue
@@ -2,71 +2,43 @@
   <view>
      <view class="code">         
         <view class="item">
            <view class="item" style="width: 50%;">
               <view class="code-decs" style="width: 100%;">库位号:{{item.locNo}}</view>
            <view class="item" style="width: 100%;">
               <view class="code-decs" style="width: 50%;">库位号: {{item.locNo}}</view>
               <view class="code-decs" style="width: 50%;">库存可出数量: {{item.anfme}}</view>
            </view>
         </view>
         <view class="item">
            <view class="item" style="width: 90%;">
               <view class="code-decs" style="width: 100%;">物料:{{item.matnr}}</view>
               <view class="code-decs" style="width: 70%;">物料: {{item.matnr}}</view>
               <button size="mini" type="primary" @click="getOrder">出库订单</button>
            </view>
         </view>
         <view class="item">
            <view class="code-decs">订单号:</view>
            <input type="text" placeholder=" 扫码 / 输入" v-model="orderNo" :focus="barcodeFocus"
               @input="barcodeInput()">
         </view>
      </view>
      <view class="mat-list-title">
         <view style="width: 200rpx;"></view>
         <view style="-webkit-flex: 1;flex: 1;">商品列表</view>
         <view style="-webkit-flex: 1;flex: 1;">出库订单</view>
         <view style="width: 200rpx;"></view>
      </view>
      <scroll-view>
         <checkbox-group class="list" v-for="(item,i) in dataList" :key="i" @change="checkboxChange">
            <!-- <view class="aside">
               <checkbox :value="item.matnr" :checked="item.checked" @click="set(i)"/>
            </view> -->
            <view class="list-left" style="margin: 0;">
               <view class="list-left-item">
                  <view class="desc">No:</view>
                  <view class="left-item">{{i + 1}}</view>
                  <view class="desc">No:{{i + 1}}</view>
               </view>
               <view class="list-left-item">
                  <view class="desc">订单号:</view>
                  <view class="left-item">
                     <uni-tag :text="item.orderNo" type="primary"></uni-tag>
                  </view>
                  <view class="desc">订单号:{{item.orderNo}}</view>
               </view>
               <view class="list-left-item">
                  <view class="desc">料号:</view>
                  <view class="left-item">
                     <uni-tag :text="item.matnr" type="primary"></uni-tag>
                  </view>
                  <view class="desc">料号:{{item.matnr}}</view>
               </view>
               <view class="list-left-item">
                  <view class="desc">名称:</view>
                  <view class="left-item">{{item.maktx}}</view>
                  <view class="desc">批号:{{item.batch}}</view>
               </view>
               <view class="list-left-item">
                  <view class="desc">规格:</view>
                  <view class="left-item">{{item.specs}}</view>
                  <view class="desc">可用数量:{{item.count}}</view>
               </view>
               <view class="list-left-item">
                  <view class="desc">批号:</view>
                  <view class="left-item">
                     <uni-tag :text="item.batch" type="warning"></uni-tag>
                  </view>
               </view>
               <!-- <view class="list-left-item">
                  <view class="desc">重量:</view>
                  <view class="left-item">
                     <uni-tag :text="item.weight" type="warning"></uni-tag>
                  </view>
               </view> -->
               <view class="list-left-item">
                  <view class="desc">数量:</view>
                  <view class="left-item">{{item.anfme}}</view>
               <view class="list-left-item" >
                  <view class="desc">数量:{{item.anfme}}</view>
               </view>
            </view>
            <view class="list-right">
@@ -105,7 +77,7 @@
               <view class="popup-item">
                  <view class="popup-item-left">数量:</view>
                  <view class="popup-item-right" style="border: none;justify-content: center;">
                     <uni-number-box :value="count" :step='0.01' :max="9999999" color="#747474"
                     <uni-number-box :value="count" :step='1' :max="mastCount" color="#747474"
                        @change="changeValue" />
                  </view>
               </view>
@@ -182,7 +154,9 @@
            orderNoList: [],
            orderNo: '',
            item:'',
            locNo:''
            locNo:'',
            mastCount: '',
            mastAnfme: 0
         }
      },
      onLoad() {
@@ -190,7 +164,7 @@
         // const eventChannel = this.$scope.eventChannel; // 兼容APP-NVUE
         const eventChannel = this.getOpenerEventChannel();
         eventChannel.on('item', function(data) {
            // console.log(data.item);
            that.mastAnfme = data.item.anfme
            that.item = data.item
            
         })
@@ -201,6 +175,23 @@
         this.getOrderNoList()
      },
      methods: {
         getOrder() {
            let _this = this
            uni.navigateTo({
               url: '../order/pickOrderList2',
               success(res) {
                  res.eventChannel.emit('item', {
                     item: _this.item
                  })
               },
               events: {
                  sMat: function(data) {
                     data.data['anfme'] = data.data.useCount
                     _this.dataList.push(data.data)
                  }
               }
            })
         },
         set(e) {
            var ck = this.dataList[e].checked
            this.dataList[e].checked = ck ? false:true
@@ -312,66 +303,6 @@
               this.matFocus = true;
            }, 100);
         },
         // 搜索物料
         findMat() {
            let that = this
            var matnr = that.matnr.split(";")
            that.order = matnr[0]
            that.matnr = matnr[1]
            uni.request({
               url: that.baseUrl + '/mat/auth',
               data: {
                  matnr: that.matnr
               },
               header: {
                  'token': uni.getStorageSync('token')
               },
               success(result) {
                  result = result.data
                  if (result.code === 200 && result.data) {
                     that.matData = result.data
                     that.matnr = ''
                     that.matData['batch'] = ''
                     result.data.batch = matnr[2]
                     uni.navigateTo({
                        url: "../mat/matSelected",
                        // 通过eventChannel向被打开页面传送数据
                        success: function(res) {
                           res.eventChannel.emit('mat', {
                              data: result.data
                           })
                        },
                        // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
                        events: {
                           matList: function(data) {
                              that.checkMat(data.data)
                              that.focuss()
                           },
                        },
                     });
                  } else if (result.code == 403) {
                     uni.showToast({
                        title: result.msg,
                        icon: "none",
                        position: 'top'
                     })
                     setTimeout(() => {
                        uni.reLaunch({
                           url: '../login/login'
                        });
                     }, 1000);
                  } else {
                     uni.showToast({
                        title: result.msg,
                        icon: "none",
                        position: 'top'
                     })
                  }
               }
            });
         },
         checkMat(mat) {
            mat['orderNo'] = this.order
            var len = this.dataList.length
@@ -420,28 +351,25 @@
         comb() {
            uni.vibrateShort();
            let that = this;
            if (that.orderNo === '') {
               this.messageText = "请输入订单号"
               this.messageToggle('error')
               return;
            }
            if (that.dataList.length === 0) {
               this.messageText = "请添加单据明细列表"
               this.messageToggle('error')
               return;
            }
            for (var i = 0; i < that.dataList.length; i++) {
               if (that.dataList[i].anfme == 0 || that.dataList[i].anfme == '') {
                  this.messageText = that.dataList[i].matnr + '拣选数量不能为0'
                  this.messageToggle('error')
                  return;
               }
            var useAnfme = 0
            for   (let order of that.dataList) {
               useAnfme = useAnfme + order.anfme
            }
            if (useAnfme > that.mastAnfme) {
               this.messageText = "出库数量已超最大库存数量"
               this.messageToggle('error')
               return;
            }
            uni.request({
               url: that.baseUrl + '/mobile/pda/WarehouseOut/v1',
               data: JSON.stringify({
                  locno: that.item.locNo,
                  orderNo: that.dataList[0].orderNo,
                  combMats: that.dataList
               }),
               method: 'POST',
@@ -495,6 +423,7 @@
            this.batch = this.dataList[i].batch
            this.weight = this.dataList[i].weight
            this.rowNum = i
            this.mastCount = this.dataList[i].anfme
            this.eject()
         },
         eject(type) {
@@ -560,7 +489,7 @@
   }
   .list:first-child {
      margin-top: 360rpx;
      margin-top: 260rpx;
   }
   .list:last-child {
@@ -578,7 +507,7 @@
   .code {
      width: 100%;
      position: fixed;
      min-height: 200rpx;
      min-height: 140rpx;
      background-color: #FFF;
      z-index: 10;
   }
@@ -619,7 +548,7 @@
      width: 100%;
      background-color: white;
      position: fixed;
      margin-top: 200rpx;
      margin-top: 140rpx;
      z-index: 9;
      /* border-top: 1px solid #DCDFE6; */
      text-align: center;