heshaofeng
2026-01-19 4d29fcfc27c10a09a3ac5aaf52b6cd3407d11ade
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue
@@ -203,6 +203,8 @@
      scanTimer: null,
      manualInputTimer: null,
      scanTarget: 'tray', // å½“前扫码目标: tray æˆ– material
      isSubmitting: false, // æ–°å¢žï¼šæäº¤é”å®šï¼Œé˜²æ­¢é‡å¤è¯·æ±‚
      groupedBarcodes: [],
      // åº“存统计相关变量
      totalStockSum: 0,
@@ -434,6 +436,8 @@
    },
    // é‡ç½®æ‰€æœ‰æ•°æ®
    resetData() {
      this.groupedBarcodes = []; // æ¸…空已组盘条码
      this.isSubmitting = false; // é‡ç½®æäº¤é”
      this.trayBarcode = '';
      this.barcode = '';
      this.materials = [];
@@ -619,6 +623,10 @@
    // å¤„理物料条码提交
    async handleBarcodeSubmit() {
      if (this.isSubmitting) {
    this.$message.warning('正在处理中,请稍候');
    return;
  }
      if (!await this.validateForm()) return;
      const currentBarcode = this.barcode.trim();
@@ -636,6 +644,7 @@
      this.focusBarcodeInput();
      this.error = '';
      this.loading = true;
      this.isSubmitting = true; // å¼€å¯æäº¤é”
      try {
        // è°ƒç”¨API查询物料信息
@@ -645,6 +654,7 @@
        }
        this.materials = [];
        const newBarcodes = []; // ä¸´æ—¶å­˜å‚¨æœ¬æ¬¡æ–°å¢žçš„æ¡ç 
        materialData.forEach(item => {
          this.materials.push({
            ...item,
@@ -653,7 +663,11 @@
            locationDesc: this.currentLocationDesc,
            scanTime: this.formatTime(new Date())
          });
          newBarcodes.push(item.barcode); // æ”¶é›†æœ¬æ¬¡ç»„盘的条码
        });
         // å°†æœ¬æ¬¡ç»„盘的条码加入已组盘列表
        this.groupedBarcodes = [...new Set([...this.groupedBarcodes, ...newBarcodes])];
        this.orderNo = materialData[0].orderNo;
        await this.fetchStockStatistics(materialData[0].orderNo);
        await this.fetchUnpalletMaterialDetails();
@@ -675,6 +689,7 @@
        }, 100);
      } finally {
        this.loading = false;
        this.isSubmitting = false; // å…³é—­æäº¤é”
      }
    },
@@ -716,7 +731,7 @@
    // å¤„理扫码枪输入
    handleKeyPress(event) {
      // å¦‚果是手动输入模式,不处理扫码枪逻辑
      if (this.isManualInput) {
      if (this.isManualInput || this.isSubmitting) {
        return;
      }
@@ -725,6 +740,7 @@
      // å¿½ç•¥ç›´æŽ¥æŒ‰ä¸‹çš„回车键(由handleBarcodeSubmit处理)
      if (key === 'Enter') {
        event.preventDefault(); // å¼ºåˆ¶é˜»æ­¢é»˜è®¤è¡Œä¸ºï¼Œé¿å…é‡å¤è§¦å‘
        if (this.scanCode.length > 0) {
          // é˜»æ­¢é»˜è®¤å›žè½¦è¡Œä¸ºï¼Œé¿å…è¡¨å•提交
          event.preventDefault();