helongyang
2026-03-31 8fcd7a67e4391a5f1fbdb590c2a3f913aeb2a0a0
´úÂë¹ÜÀí/»´°²PDA/pages/stash/raworderboxing.vue
@@ -22,28 +22,19 @@
                        v-model="Initiallife" />
                  </uni-forms-item>
                  <!-- <uni-forms-item>
                     <checkbox checked="check">是否满盘</checkbox>
                  </uni-forms-item> -->
                  <uni-forms-item>
                     <view style="display: flex;justify-content: space-around;margin-top: 2%;">
                        <button @click="reset" type="default" size="default"
                           style="width: 160rpx;border: 1rpx solid #007aff;color: #007aff;">重置</button>
                        <button @click="submit" type="primary" size="default" style="width: 160rpx;">组盘</button>
                        <!-- ç»„盘按钮添加禁用状态和文字提示 -->
                        <button @click="submit" type="primary" size="default" style="width: 160rpx;"
                           :disabled="isSubmitting">
                           {{ isSubmitting ? '组盘中...' : '组盘' }}
                        </button>
                     </view>
                  </uni-forms-item>
               </uni-forms>
               <uni-list>
                  <!-- <uni-list-item direction="column" v-for="item in matTotal" :key="item.matCode">
                     <template v-slot:body>
                        <view class="uni-list-box">
                           <view class="uni-content">
                              <view class="uni-title-sub uni-ellipsis-2">物料编码:{{item.matCode}}</view>
                              <view class="uni-title-sub uni-ellipsis-2">数量:{{item.matQuantity}}</view>
                           </view>
                        </view>
                     </template>
                  </uni-list-item> -->
                  <uni-list-item direction="column" v-for="(item,index) in matInfos" :key="index">
                     <template v-slot:body>
                        <view class="uni-list-box">
@@ -76,7 +67,11 @@
                        placeholder="请扫描地址条码" ref='midInput' :focus="addressFocus" />
                  </uni-forms-item>
                  <uni-forms-item>
                     <button @click="inbound" type="primary" size="default" style="margin-top: 2%;">入库确认</button>
                     <!-- å…¥åº“确认按钮添加禁用状态和文字提示 -->
                     <button @click="inbound" type="primary" size="default" style="margin-top: 2%;"
                        :disabled="isInbounding">
                        {{ isInbounding ? '入库中...' : '入库确认' }}
                     </button>
                  </uni-forms-item>
               </uni-forms>
            </view>
@@ -92,7 +87,6 @@
                              <view style="font-size: 18px;">物料编码:{{item.materielCode}}</view>
                              <view>物料名称:{{item.materielName}}</view>
                              <view>物料规格:{{item.materielSpec}}</view>
                              <!-- <view style="font-size: 18px;">物料名称:{{item.matName}}</view> -->
                              <view style="font-size: 18px;">数量:{{item.orderQuantity+item.unit}}</view>
                              <view style="font-size: 18px;">组盘数量:{{item.receiptQuantity}}</view>
                           </view>
@@ -114,8 +108,11 @@
                     <view style="display: flex;justify-content: space-around;margin-top: 2%;">
                        <button @click="resetInPk" type="default" size="default"
                           style="width: 160rpx;border: 1rpx solid #007aff;color: #007aff;">重置</button>
                        <!-- å…¥å¹³åº“按钮添加禁用状态和文字提示 -->
                        <button @click="pksubmit" type="primary" size="default"
                           style="margin-top: 2%;">入平库</button>
                           style="margin-top: 2%;" :disabled="isPkSubmitting">
                           {{ isPkSubmitting ? '入库中...' : '入平库' }}
                        </button>
                     </view>
                  </uni-forms-item>
@@ -180,7 +177,11 @@
            Testcheck: false,
            pkmaterSn: "",
            pkmatInfos: [],
            addressdisabled: false
            addressdisabled: false,
            // æ–°å¢žï¼šé˜²é‡å¤ç‚¹å‡»çŠ¶æ€å˜é‡
            isSubmitting: false,    // ç»„盘请求状态
            isInbounding: false,   // å…¥åº“确认请求状态
            isPkSubmitting: false  // å…¥å¹³åº“请求状态
         }
      },
      onShow() {},
@@ -210,10 +211,6 @@
         this.getData();
      },
      methods: {
         // voiceSpeech(src) {
         //    innerAudioContext.src = src; // '../../static/success.mp3';
         //    innerAudioContext.play();
         // },
         updateFocus() {
            debugger
            this.$nextTick(() => {
@@ -258,14 +255,7 @@
         barcodeInput() {
            this.$nextTick(function(x) {
               if (this.barcode.length > 0) {
                  // if (this.barcode.substring(0, 1) == 'A' || this.barcode.substring(0, 2) == 'TP') {
                  this.focus = true;
                  // } else {
                  //    this.$refs.uToast.show({
                  //       title: "扫码错误,请扫描托盘码",
                  //       type: "error"
                  //    })
                  // }
               }
            })
         },
@@ -283,29 +273,19 @@
                        this.Testcheck = false;
                        if (res.status) {
                           this.sns.push(res.data.serialNumber);
                           this.matInfos.push(res.data);
                           if (res.message) {
                              this.$refs.uToast.show({
                                 title: res.message,
                                 type: "error"
                              })
                              // setTimeout(() => {
                              //    this.voiceSpeech('../../static/fail.mp3');
                              // }, 100);
                              return;
                           }
                           // setTimeout(() => {
                           //    this.voiceSpeech('../../static/success.mp3');
                           // }, 100);
                        } else {
                           this.$refs.uToast.show({
                              title: res.message,
                              type: "error"
                           })
                           // setTimeout(() => {
                           //    this.voiceSpeech('../../static/fail.mp3');
                           // }, 100);
                        }
                     })
                  }
@@ -318,9 +298,7 @@
         pksnInput() {
            this.$nextTick(() => {
               if (this.pkmaterSn != "") {
                  var matSn = this.pkmaterSn;
                  if(matSn.indexOf("POHA")>0){
                     this.$u.post('/api/MaterielInfo/CodeAnalysis?serNum=' + matSn, {}).then((res) => {
                        if (res.status) {
@@ -331,23 +309,14 @@
                                 title: res.message,
                                 type: "error"
                              })
                              // setTimeout(() => {
                              //    this.voiceSpeech('../../static/fail.mp3');
                              // }, 100);
                              return;
                           }
                           // setTimeout(() => {
                           //    this.voiceSpeech('../../static/success.mp3');
                           // }, 100);
                           return;
                        } else {
                           this.$refs.uToast.show({
                              title: res.message,
                              type: "error"
                           })
                           // setTimeout(() => {
                           //    this.voiceSpeech('../../static/fail.mp3');
                           // }, 100);
                        }
                     })
                  }
@@ -358,6 +327,7 @@
            })
         },
         inbound() {
            // 1. å‰ç½®æ ¡éªŒ
            if (this.inboundBarcode == "") {
               this.$refs.uToast.show({
                  title: "请扫描托盘条码",
@@ -372,6 +342,13 @@
               })
               return;
            }
            // 2. é˜²æ­¢é‡å¤ç‚¹å‡»ï¼šè¯·æ±‚中则直接返回
            if (this.isInbounding) return;
            // 3. æ ‡è®°ä¸ºè¯·æ±‚中,禁用按钮
            this.isInbounding = true;
            var postData = {
               MainData: {
                  "barcode": this.inboundBarcode,
@@ -401,6 +378,9 @@
                  title: err.message,
                  type: "error"
               })
            }).finally(() => {
               // 4. è¯·æ±‚完成(成功/失败)恢复按钮状态
               this.isInbounding = false;
            })
         },
         inputChangebarcode() {
@@ -435,6 +415,7 @@
            this.pksns = [];
         },
         pksubmit() {
            // 1. å‰ç½®æ ¡éªŒ
            if (this.pkmatInfos.length == 0) {
               this.$refs.uToast.show({
                  title: "请扫描内箱标签",
@@ -442,6 +423,13 @@
               })
               return;
            }
            // 2. é˜²æ­¢é‡å¤ç‚¹å‡»ï¼šè¯·æ±‚中则直接返回
            if (this.isPkSubmitting) return;
            // 3. æ ‡è®°ä¸ºè¯·æ±‚中,禁用按钮
            this.isPkSubmitting = true;
            this.$u.post('/api/InboundOrder/InPinKu?warehouseId=' + this.warehouseId + "&orderNo=" + this.orderNo, this
               .pksns).then(res => {
               if (res.status) {
@@ -458,9 +446,18 @@
                     type: "error"
                  })
               }
            }).catch(err => {
               this.$refs.uToast.show({
                  title: err.message,
                  type: "error"
               })
            }).finally(() => {
               // 4. è¯·æ±‚完成(成功/失败)恢复按钮状态
               this.isPkSubmitting = false;
            })
         },
         submit() {
            // 1. å‰ç½®æ ¡éªŒ
            if (this.barcode == "") {
               this.$refs.uToast.show({
                  title: "请扫描托盘条码",
@@ -492,6 +489,13 @@
                  return;
               }
            }
            // 2. é˜²æ­¢é‡å¤ç‚¹å‡»ï¼šè¯·æ±‚中则直接返回
            if (this.isSubmitting) return;
            // 3. æ ‡è®°ä¸ºè¯·æ±‚中,禁用按钮
            this.isSubmitting = true;
            if (this.warehouseId == 2) { //油墨仓库区ID
               this.sn = this.sns[0];
               for (var i = 0; i < this.Initiallife - 1; i++) {
@@ -503,7 +507,6 @@
                  "palletCode": this.barcode,
                  "orderNo": this.orderNo,
                  "initiallife": this.Initiallife,
                  // "isFull": this.check
                  "warehouseId": this.warehouseId
               },
               DelKeys: this.sns
@@ -528,6 +531,14 @@
                     type: "error"
                  })
               }
            }).catch(err => {
               this.$refs.uToast.show({
                  title: err.message,
                  type: "error"
               })
            }).finally(() => {
               // 4. è¯·æ±‚完成(成功/失败)恢复按钮状态
               this.isSubmitting = false;
            })
         }
      }