helongyang
2026-03-31 8fcd7a67e4391a5f1fbdb590c2a3f913aeb2a0a0
´úÂë¹ÜÀí/»´°²PDA/pages/stash/boxing.vue
@@ -18,24 +18,20 @@
                     <uni-easyinput type="text" :placeholder="Testplaceholder" ref='midInput'
                        v-model="Initiallife" />
                  </uni-forms-item>
                  <!-- <uni-forms-item>
                     <checkbox checked="check">是否满盘</checkbox>
                  </uni-forms-item> -->
                  <uni-forms-item>
                     <button @click="submit" type="primary" size="default" style="margin-top: 2%;">组盘</button>
                     <!-- ç»„盘按钮添加禁用状态 -->
                     <button
                        @click="submit"
                        type="primary"
                        size="default"
                        style="margin-top: 2%;"
                        :disabled="isSubmitting"
                     >
                        {{ isSubmitting ? '组盘中...' : '组盘' }}
                     </button>
                  </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">
@@ -68,7 +64,16 @@
                        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>
@@ -174,7 +179,11 @@
            addressdisabled: false,
            pksns: [],
            pkmaterSn: "",
            pkmatInfos: []
            pkmatInfos: [],
            // æ–°å¢žï¼šç»„盘请求状态(防止重复点击)
            isSubmitting: false,
            // æ–°å¢žï¼šå…¥åº“请求状态(防止重复点击)
            isInbounding: false
         }
      },
      onShow() {},
@@ -473,6 +482,7 @@
            })
         },
         inbound() {
            // 1. å‰ç½®æ ¡éªŒ
            if (this.inboundBarcode == "") {
               this.$refs.uToast.show({
                  title: "请扫描托盘条码",
@@ -487,6 +497,13 @@
               })
               return;
            }
            // 2. é˜²æ­¢é‡å¤ç‚¹å‡»ï¼šå¦‚果正在请求,直接返回
            if (this.isInbounding) return;
            // 3. æ ‡è®°ä¸ºè¯·æ±‚中,禁用按钮
            this.isInbounding = true;
            var postData = {
               MainData: {
                  "barcode": this.inboundBarcode,
@@ -519,6 +536,9 @@
                  title: err.message,
                  type: "error"
               })
            }).finally(() => {
               // 4. è¯·æ±‚完成(成功/失败)后,恢复按钮状态
               this.isInbounding = false;
            })
         },
         inputChangebarcode() {
@@ -562,6 +582,7 @@
            this.sns.splice(res, 1);
         },
         submit() {
            // 1. å‰ç½®æ ¡éªŒ
            if (this.barcode == "") {
               this.$refs.uToast.show({
                  title: "请扫描托盘条码",
@@ -593,6 +614,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++) {
@@ -620,6 +648,9 @@
                     type: "error"
                  })
               }
            }).finally(() => {
               // 4. è¯·æ±‚完成(成功/失败)后,恢复按钮状态
               this.isSubmitting = false;
            })
         }
      }