pan
2025-12-04 561ff75c5e3c0857ba813290fcf25dae3443f73e
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/views/outbound/BatchPickingConfirm.vue
@@ -92,7 +92,7 @@
    </div>
    <!-- æ‹†åŒ…弹窗 -->
    <div v-if="showCustomSplitDialog" class="custom-dialog-overlay">
    <div  v-show="showCustomSplitDialog" class="custom-dialog-overlay" style="z-index: 2001;">
      <div class="custom-dialog-wrapper">
        <div class="custom-dialog">
          <div class="custom-dialog-header">
@@ -154,7 +154,7 @@
    </div>
    <!-- æ’¤é”€æ‹†åŒ…弹窗 -->
    <div v-if="showRevertSplitDialog" class="custom-dialog-overlay">
    <div  v-show="showRevertSplitDialog" class="custom-dialog-overlay" style="z-index: 2001;">
      <div class="custom-dialog-wrapper">
        <div class="custom-dialog">
          <div class="custom-dialog-header">
@@ -214,7 +214,7 @@
    </div>
    <!-- æ‹†åŒ…链信息弹窗 -->
<div v-if="showSplitChainDialog" class="custom-dialog-overlay">
<div v-show="showSplitChainDialog" class="custom-dialog-overlay" style="z-index: 2003;">
  <div class="custom-dialog-wrapper">
    <div class="custom-dialog" style="width: 750px;">
      <div class="custom-dialog-header">
@@ -338,7 +338,7 @@
</div>
    <!-- æ‰¹é‡å›žåº“弹窗 -->
    <div v-if="showBatchReturnDialog" class="custom-dialog-overlay">
    <div v-if="showBatchReturnDialog" class="custom-dialog-overlay"  style="z-index: 2004;">
      <div class="custom-dialog-wrapper">
        <div class="custom-dialog">
          <div class="custom-dialog-header">
@@ -370,7 +370,7 @@
    </div>
    <!-- å–走空箱弹窗 -->
    <div v-if="showEmptyPalletDialog" class="custom-dialog-overlay">
    <div v-if="showEmptyPalletDialog" class="custom-dialog-overlay"  style="z-index: 2005;">
      <div class="custom-dialog-wrapper">
        <div class="custom-dialog">
          <div class="custom-dialog-header">
@@ -412,11 +412,13 @@
import { useRoute } from 'vue-router'
import printView from "@/extension/outbound/extend/printView.vue"
export default defineComponent({
  name: 'BatchOutboundPicking',
  components: {printView},
  data() {
    return {
      // ä¿æŒåŽŸå§‹æ•°æ®ç»“æž„ä¸å˜
      scanData: {
        orderNo: '',
        palletCode: '',
@@ -432,19 +434,19 @@
      },
      palletStatus: '未知',
      
      // å¼¹çª—状态
      // å¼¹çª—状态 - ä¿æŒåŽŸå§‹çŠ¶æ€
      showCustomSplitDialog: false,
      showRevertSplitDialog: false,
      showBatchReturnDialog: false,
      showEmptyPalletDialog: false,
      showSplitChainDialog: false, // æ–°å¢žï¼šæ‹†åŒ…链信息弹窗
      showSplitChainDialog: false,
      
      // åŠ è½½çŠ¶æ€
      splitLoading: false,
      revertSplitLoading: false,
      batchReturnLoading: false,
      emptypalletOutLoading: false,
      splitChainLoading: false, // æ–°å¢žï¼šæ‹†åŒ…链加载状态
      splitChainLoading: false,
      
      // è¡¨å•数据
      splitForm: {
@@ -472,7 +474,7 @@
        palletCode: ''
      },
      
      // æ–°å¢žï¼šæ‹†åŒ…链相关数据
      // æ‹†åŒ…链相关数据
      splitChainInfo: {
        originalBarcode: '',
        totalSplitTimes: 0,
@@ -502,11 +504,13 @@
        ]
      },
      
      isProcessing: false
      isProcessing: false,
      // æ–°å¢ž: ç”¨äºŽé˜²æ­¢å¼¹çª—重叠
      isDialogOpening: false
    }
  },
  computed: {
    // æ˜¯å¦å¯ä»¥å–消整个拆包链
    canCancelWholeChain() {
      return this.splitChainInfo.splitChain && 
             this.splitChainInfo.splitChain.some(item => !item.isReverted);
@@ -528,7 +532,7 @@
      this.$router.back()
    },
    // åˆ†æ‹£ç›¸å…³æ–¹æ³•
    // ä¿®å¤: æ·»åŠ é˜²é‡å¤ç‚¹å‡»æœºåˆ¶
    async confirmPicking() {
      if (this.isProcessing) return;
      
@@ -568,16 +572,41 @@
      }
    },
    // æ‹†åŒ…相关方法
    // ä¿®å¤: æ‰“开拆包弹窗 - æ·»åŠ é˜²é‡å æœºåˆ¶
    openSplitDialog() {
      if (this.isDialogOpening) return;
      if (!this.scanData.palletCode) {
        this.$message.warning('请先扫描托盘码');
        return;
      }
      this.showCustomSplitDialog = true;
      this.resetSplitForm();
      this.splitForm.orderNo = this.scanData.orderNo;
      this.splitForm.palletCode = this.scanData.palletCode;
      this.isDialogOpening = true;
      try {
        // ç¡®ä¿å…³é—­å…¶ä»–弹窗
        this.closeAllDialogs();
        // å»¶è¿Ÿæ‰“开,确保DOM更新完成
        this.$nextTick(() => {
          this.showCustomSplitDialog = true;
          this.resetSplitForm();
          this.splitForm.orderNo = this.scanData.orderNo;
          this.splitForm.palletCode = this.scanData.palletCode;
          // ç¡®ä¿è¾“入框获得焦点
          this.$nextTick(() => {
            const input = document.querySelector('#splitOriginalBarcode');
            if (input) {
              input.focus();
            }
            this.isDialogOpening = false;
          });
        });
      } catch (error) {
        console.error('打开拆包弹窗失败:', error);
        this.isDialogOpening = false;
      }
    },
    async onSplitBarcodeScan() {
@@ -608,293 +637,213 @@
    async handleSplitPackage() {
      if (this.$refs.splitFormRef) {
        this.$refs.splitFormRef.validate(async (valid) => {
          if (valid) {
            this.splitLoading = true;
            try {
              const res = await http.post('/api/OutboundBatchPicking/split-package', {
                orderNo: this.splitForm.orderNo,
                palletCode: this.splitForm.palletCode,
                originalBarcode: this.splitForm.originalBarcode,
                splitQuantity: this.splitForm.splitQuantity
              });
              if (res.status) {
                this.$message.success('拆包成功');
                this.showCustomSplitDialog = false;
                await this.loadPalletData();
              } else {
                this.$message.error(res.message || '拆包失败');
              }
            } catch (error) {
              this.$message.error('拆包失败');
            } finally {
              this.splitLoading = false;
            }
        try {
          const valid = await this.$refs.splitFormRef.validate();
          if (!valid) return;
          this.splitLoading = true;
          const res = await http.post('/api/OutboundBatchPicking/split-package', {
            orderNo: this.splitForm.orderNo,
            palletCode: this.splitForm.palletCode,
            originalBarcode: this.splitForm.originalBarcode,
            splitQuantity: this.splitForm.splitQuantity
          });
          if (res.status) {
            this.$message.success('拆包成功');
            this.showCustomSplitDialog = false;
            await this.loadPalletData();
          } else {
            this.$message.error(res.message || '拆包失败');
          }
        });
        } catch (error) {
          this.$message.error('拆包失败');
        } finally {
          this.splitLoading = false;
        }
      }
    },
// åœ¨æ‹†åŒ…弹窗中查看拆包链
async viewSplitChainFromSplit(barcode) {
  if (!barcode) {
    this.$message.warning('请先输入条码');
    return;
  }
  // å…ˆå…³é—­æ‹†åŒ…弹窗
  this.closeCustomSplitDialog();
  await this.$nextTick();
  // ç„¶åŽæ‰“开拆包链信息弹窗
  await this.viewSplitChain(barcode);
},
    // æ’¤é”€æ‹†åŒ…
    // ä¿®å¤: æ’¤é”€æ‹†åŒ…弹窗
    openRevertSplitDialog() {
      if (this.isDialogOpening) return;
      this.isDialogOpening = true;
      try {
        this.closeAllDialogs();
        this.$nextTick(() => {
          this.showRevertSplitDialog = true;
          this.revertSplitForm.newBarcode = '';
          this.$nextTick(() => {
            const input = document.querySelector('#revertSplitBarcode');
            if (input) {
              input.focus();
            }
            this.isDialogOpening = false;
          });
        });
      } catch (error) {
        console.error('打开撤销拆包弹窗失败:', error);
        this.isDialogOpening = false;
      }
    },
    async onRevertSplitBarcodeScan() {
      if (!this.revertSplitForm.newBarcode) return;
      this.revertSplitForm.newBarcode = this.revertSplitForm.newBarcode.replace(/\n/g, '').trim();
      // æ–°å¢žï¼šæ‰«æåŽè‡ªåŠ¨æ˜¾ç¤ºæ‹†åŒ…é“¾ä¿¡æ¯
      await this.viewSplitChain(this.revertSplitForm.newBarcode);
    },
    async handleRevertSplit() {
      if (this.$refs.revertSplitFormRef) {
        this.$refs.revertSplitFormRef.validate(async (valid) => {
          if (valid) {
            this.revertSplitLoading = true;
            try {
              const res = await http.post('/api/OutboundBatchPicking/cancel-split', {
                orderNo: this.scanData.orderNo,
                palletCode: this.scanData.palletCode,
                newBarcode: this.revertSplitForm.newBarcode
              });
              if (res.status) {
                this.$message.success('撤销拆包成功');
                this.showRevertSplitDialog = false;
                await this.loadPalletData();
              } else {
                this.$message.error(res.message || '撤销拆包失败');
              }
            } catch (error) {
              this.$message.error('撤销拆包失败');
            } finally {
              this.revertSplitLoading = false;
            }
        try {
          const valid = await this.$refs.revertSplitFormRef.validate();
          if (!valid) return;
          this.revertSplitLoading = true;
          const res = await http.post('/api/OutboundBatchPicking/cancel-split', {
            orderNo: this.scanData.orderNo,
            palletCode: this.scanData.palletCode,
            newBarcode: this.revertSplitForm.newBarcode
          });
          if (res.status) {
            this.$message.success('撤销拆包成功');
            this.showRevertSplitDialog = false;
            await this.loadPalletData();
          } else {
            this.$message.error(res.message || '撤销拆包失败');
          }
        });
        } catch (error) {
          this.$message.error('撤销拆包失败');
        } finally {
          this.revertSplitLoading = false;
        }
      }
    },
// æŸ¥æ‰¾å®Œæ•´æ‹†åŒ…链(从根条码开始)
async findRootChain(currentBarcode) {
  this.splitChainLoading = true;
  try {
    const res = await http.post('/api/OutboundBatchPicking/find-root-split-chain', {
      orderNo: this.scanData.orderNo,
      barcode: currentBarcode
    });
    if (res.status) {
      this.splitChainInfo = res.data;
      this.$message.success('已加载完整拆包链');
    } else {
      this.$message.error(res.message || '查找完整拆包链失败');
    }
  } catch (error) {
    this.$message.error('查找完整拆包链失败');
  } finally {
    this.splitChainLoading = false;
  }
},
    // æ‹†åŒ…链相关方法
   // æŸ¥çœ‹æ‹†åŒ…链信息
async viewSplitChain(barcode) {
  if (!barcode) {
    this.$message.warning('请先输入条码');
    return;
  }
  this.splitChainLoading = true;
  try {
    const res = await http.post('/api/OutboundBatchPicking/split-package-chain-info', {
      orderNo: this.scanData.orderNo,
      barcode: barcode
    });
    if (res.status) {
      this.splitChainInfo = res.data;
      // æ˜¾ç¤ºæç¤ºä¿¡æ¯ï¼Œå‘Šè¯‰ç”¨æˆ·è¿™æ˜¯ä»€ä¹ˆç±»åž‹çš„æ‹†åŒ…链
      let chainType = "当前条码的拆包链";
      if (this.splitChainInfo.chainType === 'root') {
        chainType = "完整拆包链(从原始条码开始)";
      } else if (this.splitChainInfo.chainType === 'branch') {
        chainType = "分支拆包链";
    // ä¿®å¤: æŸ¥çœ‹æ‹†åŒ…链
    async viewSplitChain(barcode) {
      if (!barcode) {
        this.$message.warning('请先输入条码');
        return;
      }
      
      this.$message.info(`已加载${chainType},共${this.splitChainInfo.totalSplitTimes}次拆包`);
      this.showSplitChainDialog = true;
    } else {
      this.$message.error(res.message || '获取拆包链信息失败');
    }
  } catch (error) {
    this.$message.error('获取拆包链信息失败');
  } finally {
    this.splitChainLoading = false;
  }
},
      if (this.isDialogOpening) return;
      this.isDialogOpening = true;
      this.splitChainLoading = true;
      try {
        const res = await http.post('/api/OutboundBatchPicking/split-package-chain-info', {
          orderNo: this.scanData.orderNo,
          barcode: barcode
        });
        if (res.status) {
          this.splitChainInfo = res.data;
          // å…³é—­å…¶ä»–弹窗
          this.closeAllDialogs();
          await this.$nextTick(() => {
            this.showSplitChainDialog = true;
            this.isDialogOpening = false;
          });
        } else {
          this.$message.error(res.message || '获取拆包链信息失败');
          this.isDialogOpening = false;
        }
      } catch (error) {
        this.$message.error('获取拆包链信息失败');
        this.isDialogOpening = false;
      } finally {
        this.splitChainLoading = false;
      }
    },
    // å…³é—­æ‹†åŒ…链信息弹窗
    // ä¿®å¤: å…³é—­æ‹†åŒ…链信息弹窗
    closeSplitChainDialog() {
      this.showSplitChainDialog = false;
    },
    // åœ¨æ’¤é”€æ‹†åŒ…弹窗中查看拆包链
async viewSplitChainFromRevert(barcode) {
  if (!barcode) {
    this.$message.warning('请先输入条码');
    return;
  }
  // å…ˆå…³é—­æ’¤é”€æ‹†åŒ…弹窗
  this.closeRevertSplitDialog();
  await this.$nextTick();
  // ç„¶åŽæ‰“开拆包链信息弹窗
  await this.viewSplitChain(barcode);
},
// å¿«é€Ÿé‡æ–°æ‰“开拆包链弹窗
async quickReopenSplitChainDialog(barcode) {
  if (!barcode) return;
  this.showSplitChainDialog = true;
  this.splitChainLoading = true;
  try {
    const res = await http.post('/api/OutboundBatchPicking/split-package-chain-info', {
      orderNo: this.scanData.orderNo,
      barcode: barcode
    });
    if (res.status) {
      this.splitChainInfo = res.data;
    }
  } catch (error) {
    console.error('重新加载拆包链信息失败:', error);
  } finally {
    this.splitChainLoading = false;
  }
},
    // å–消单个拆包记录
async cancelSingleSplit(newBarcode) {
  // å…ˆè®°å½•当前信息,然后关闭弹窗
  const originalBarcode = this.splitChainInfo.originalBarcode;
  this.closeSplitChainDialog();
  await this.$nextTick();
  try {
    await this.$confirm(
      `确定要取消条码 ${newBarcode} çš„æ‹†åŒ…操作吗?`,
      '取消单个拆包',
      {
        confirmButtonText: '确定取消',
        cancelButtonText: '再想想',
        type: 'warning'
      }
    );
    this.revertSplitLoading = true;
    const res = await http.post('/api/OutboundBatchPicking/cancel-split', {
      orderNo: this.scanData.orderNo,
      palletCode: this.scanData.palletCode,
      newBarcode: newBarcode
    });
    if (res.status) {
      this.$message.success('取消拆包成功');
      await this.loadPalletData();
      // é‡æ–°æ‰“开弹窗显示更新后的状态
      await this.viewSplitChain(originalBarcode);
    } else {
      this.$message.error(res.message || '取消拆包失败');
      await this.viewSplitChain(originalBarcode);
    }
  } catch (error) {
    if (error === 'cancel') {
      // ç”¨æˆ·å–消后重新打开弹窗
      await this.viewSplitChain(originalBarcode);
    } else {
      this.$message.error('取消拆包失败');
      await this.viewSplitChain(originalBarcode);
    }
  } finally {
    this.revertSplitLoading = false;
  }
},
// å–消整个拆包链
async cancelWholeSplitChain() {
  // å…ˆè®°å½•当前拆包链信息,然后关闭弹窗
  const originalBarcode = this.splitChainInfo.originalBarcode;
  this.closeSplitChainDialog();
  // ç»™ä¸€ç‚¹æ—¶é—´è®©å¼¹çª—完全关闭
  await this.$nextTick();
  try {
    // çŽ°åœ¨æ˜¾ç¤ºç¡®è®¤å¯¹è¯æ¡†ï¼Œç¡®ä¿å®ƒåœ¨æœ€å‰é¢
    await this.$confirm(
      `确定要取消整个拆包链吗?\n这将取消从条码 ${originalBarcode} å¼€å§‹çš„æ‰€æœ‰æ‹†åŒ…操作。`,
      '取消拆包链确认',
      {
        confirmButtonText: '确定取消',
        cancelButtonText: '再想想',
        type: 'warning',
        center: true,
        closeOnClickModal: false
    // ä¿®å¤: å–消单个拆包记录
    async cancelSingleSplit(newBarcode) {
      try {
        await ElMessageBox.confirm(
          `确定要取消条码 ${newBarcode} çš„æ‹†åŒ…操作吗?`,
          '取消单个拆包',
          {
            confirmButtonText: '确定取消',
            cancelButtonText: '再想想',
            type: 'warning'
          }
        );
        this.revertSplitLoading = true;
        const res = await http.post('/api/OutboundBatchPicking/cancel-split', {
          orderNo: this.scanData.orderNo,
          palletCode: this.scanData.palletCode,
          newBarcode: newBarcode
        });
        if (res.status) {
          this.$message.success('取消拆包成功');
          await this.loadPalletData();
          // é‡æ–°åŠ è½½æ‹†åŒ…é“¾ä¿¡æ¯
          if (this.splitChainInfo.originalBarcode) {
            await this.viewSplitChain(this.splitChainInfo.originalBarcode);
          }
        } else {
          this.$message.error(res.message || '取消拆包失败');
        }
      } catch (error) {
        if (error !== 'cancel') {
          this.$message.error('取消拆包失败');
        }
      } finally {
        this.revertSplitLoading = false;
      }
    );
    // ç”¨æˆ·ç¡®è®¤åŽæ‰§è¡Œå–消操作
    this.revertSplitLoading = true;
    const res = await http.post('/api/OutboundBatchPicking/cancel-split-chain', {
      orderNo: this.scanData.orderNo,
      palletCode: this.scanData.palletCode,
      startBarcode: originalBarcode
    });
    console.log('取消拆包链响应:', res);
    if (res.status) {
      this.$message.success('取消拆包链成功');
      await this.loadPalletData();
      // å¯é€‰ï¼šé‡æ–°æ‰“开拆包链信息弹窗显示更新后的状态
      // await this.viewSplitChain(originalBarcode);
    } else {
      this.$message.error(res.message || '取消拆包链失败');
      // å¤±è´¥åŽé‡æ–°æ‰“开弹窗
      await this.viewSplitChain(originalBarcode);
    }
  } catch (error) {
    // ç”¨æˆ·å–消操作
    if (error === 'cancel') {
      console.log('用户取消了拆包链操作');
      // ç”¨æˆ·å–消后重新打开弹窗
      await this.viewSplitChain(originalBarcode);
    } else {
      console.error('取消拆包链错误:', error);
      this.$message.error('取消拆包链失败: ' + error.message);
      // å‡ºé”™åŽé‡æ–°æ‰“开弹窗
      await this.viewSplitChain(originalBarcode);
    }
  } finally {
    this.revertSplitLoading = false;
  }
},
    },
    // ä¿®å¤: å–消整个拆包链
    async cancelWholeSplitChain() {
      try {
        await ElMessageBox.confirm(
          `确定要取消整个拆包链吗?\n这将取消从条码 ${this.splitChainInfo.originalBarcode} å¼€å§‹çš„æ‰€æœ‰æ‹†åŒ…操作。`,
          '取消拆包链确认',
          {
            confirmButtonText: '确定取消',
            cancelButtonText: '再想想',
            type: 'warning'
          }
        );
        this.revertSplitLoading = true;
        const res = await http.post('/api/OutboundBatchPicking/cancel-split-chain', {
          orderNo: this.scanData.orderNo,
          palletCode: this.scanData.palletCode,
          startBarcode: this.splitChainInfo.originalBarcode
        });
        if (res.status) {
          this.$message.success('取消拆包链成功');
          this.closeSplitChainDialog();
          await this.loadPalletData();
        } else {
          this.$message.error(res.message || '取消拆包链失败');
        }
      } catch (error) {
        if (error !== 'cancel') {
          this.$message.error('取消拆包链失败');
        }
      } finally {
        this.revertSplitLoading = false;
      }
    },
    // æ£€æŸ¥æ¡ç æ˜¯å¦å·²è¢«åˆ†æ‹£
    hasPicked(barcode) {
@@ -908,17 +857,31 @@
      return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')} ${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}:${date.getSeconds().toString().padStart(2, '0')}`;
    },
    // ä¿®å¤: æ–°å¢žå…³é—­æ‰€æœ‰å¼¹çª—的方法
    closeAllDialogs() {
      this.showCustomSplitDialog = false;
      this.showRevertSplitDialog = false;
      this.showSplitChainDialog = false;
      this.showBatchReturnDialog = false;
      this.showEmptyPalletDialog = false;
    },
    // å›žåº“相关方法
    openBatchReturnDialog() {
      if (!this.scanData.palletCode) {
        this.$message.warning('请先扫描托盘码');
        return;
      }
      this.showBatchReturnDialog = true;
      this.batchReturnForm.orderNo = this.scanData.orderNo;
      this.batchReturnForm.palletCode = this.scanData.palletCode;
      this.batchReturnForm.unpickedCount = this.summary.unpickedCount;
      this.batchReturnForm.unpickedQuantity = this.summary.unpickedQuantity;
      this.closeAllDialogs();
      this.$nextTick(() => {
        this.showBatchReturnDialog = true;
        this.batchReturnForm.orderNo = this.scanData.orderNo;
        this.batchReturnForm.palletCode = this.scanData.palletCode;
        this.batchReturnForm.unpickedCount = this.summary.unpickedCount;
        this.batchReturnForm.unpickedQuantity = this.summary.unpickedQuantity;
      });
    },
    async handleBatchReturnConfirm() {
@@ -944,9 +907,13 @@
    // å–空箱方法
    handleEmptyPallet() {
      this.showEmptyPalletDialog = true;
      this.emptypalletOutForm.orderNo = this.scanData.orderNo;
      this.emptypalletOutForm.palletCode = '';
      this.closeAllDialogs();
      this.$nextTick(() => {
        this.showEmptyPalletDialog = true;
        this.emptypalletOutForm.orderNo = this.scanData.orderNo;
        this.emptypalletOutForm.palletCode = '';
      });
    },
    async handleEmptyPalletConfirm() {
@@ -974,9 +941,15 @@
    async loadPalletData() {
      if (!this.scanData.orderNo || !this.scanData.palletCode) return;
      
      await this.loadUnpickedList();
      await this.loadPickedList();
      await this.loadPalletStatus();
      try {
        await Promise.all([
          this.loadUnpickedList(),
          this.loadPickedList(),
          this.loadPalletStatus()
        ]);
      } catch (error) {
        console.error('加载托盘数据失败:', error);
      }
    },
    async loadUnpickedList() {
@@ -986,12 +959,12 @@
          palletCode: this.scanData.palletCode
        });
        if (res.status) {
          //this.unpickedList = res.data || [];
          this.unpickedList = (res.data || []).filter(item => item.canPick === true);
          this.summary.unpickedCount = this.unpickedList.length;
          this.summary.unpickedQuantity = this.unpickedList.reduce((sum, item) => sum + (item.remainQuantity || 0), 0);
        }
      } catch (error) {
        console.error('加载未拣选列表失败:', error);
        this.$message.error('加载未拣选列表失败');
      }
    },
@@ -1003,19 +976,14 @@
          palletCode: this.scanData.palletCode
        });
        if (res.status) {
          this.pickedList = res.data || [];
          this.pickedList = res.data.map(item => {
  // æ–¹å¼1:保留原barcode字段,新增currentBarcode
  return {
    ...item,
    currentBarcode: item.barcode
  };
});
          this.pickedList = res.data.map(item => ({
            ...item,
            currentBarcode: item.barcode
          }));
          this.summary.pickedCount = this.pickedList.length;
        }
      } catch (error) {
        console.error('加载已拣选列表失败:', error);
        this.$message.error('加载已拣选列表失败');
      }
    },
@@ -1030,6 +998,7 @@
          this.palletStatus = res.data.statusText || '未知';
        }
      } catch (error) {
        console.error('加载托盘状态失败:', error);
        this.palletStatus = '未知';
      }
    },
@@ -1074,33 +1043,39 @@
        return;
      }
      this.$confirm(`确定要取消选中的 ${this.selectedPickedRows.length} é¡¹å—?`, '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(async () => {
        try {
          for (const row of this.selectedPickedRows) {
            try {
              const res = await http.post('/api/OutboundBatchPicking/cancel-picking', {
                orderNo: this.scanData.orderNo,
                palletCode: this.scanData.palletCode,
                barcode: row.currentBarcode
              });
              if (!res.status) {
                this.$message.warning(`取消拣选失败: ${row.currentBarcode} - ${res.message}`);
              }
            } catch (error) {
              this.$message.warning(`取消拣选失败: ${row.currentBarcode} - ${error.message}`);
      try {
        await ElMessageBox.confirm(
          `确定要取消选中的 ${this.selectedPickedRows.length} é¡¹å—?`,
          '提示',
          {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }
        );
        for (const row of this.selectedPickedRows) {
          try {
            const res = await http.post('/api/OutboundBatchPicking/cancel-picking', {
              orderNo: this.scanData.orderNo,
              palletCode: this.scanData.palletCode,
              barcode: row.currentBarcode
            });
            if (!res.status) {
              this.$message.warning(`取消拣选失败: ${row.currentBarcode} - ${res.message}`);
            }
          }
          this.$message.success('批量取消完成');
          await this.loadPalletData();
          this.selectedPickedRows = [];
        } catch (error) {
          } catch (error) {
            this.$message.warning(`取消拣选失败: ${row.currentBarcode} - ${error.message}`);
          }
        }
        this.$message.success('批量取消完成');
        await this.loadPalletData();
        this.selectedPickedRows = [];
      } catch (error) {
        if (error !== 'cancel') {
          this.$message.error('批量取消操作失败');
        }
      });
      }
    },
    // é‡ç½®æ–¹æ³•
@@ -1114,11 +1089,6 @@
    closeCustomSplitDialog() {
      this.showCustomSplitDialog = false;
      this.resetSplitForm();
    },
    openRevertSplitDialog() {
      this.showRevertSplitDialog = true;
      this.revertSplitForm.newBarcode = '';
    },
    closeRevertSplitDialog() {
@@ -1182,19 +1152,7 @@
  color: #909399;
}
/* è‡ªå®šä¹‰å¼¹çª—样式 */
:deep(.el-message-box) {
  z-index: 10010 !important;
}
:deep(.el-overlay) {
  z-index: 10009 !important;
}
:deep(.el-message) {
  z-index: 10011 !important;
}
/* è‡ªå®šä¹‰å¼¹çª—样式 - å…³é”®ä¿®å¤: ç§»é™¤å¯èƒ½å¯¼è‡´å†²çªçš„z-index规则 */
.custom-dialog-overlay {
  position: fixed;
  top: 0;
@@ -1205,12 +1163,11 @@
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000; /* ä¿æŒä¸€ä¸ªåˆç†çš„ z-index */
  /* ç§»é™¤è¿™é‡Œçš„z-index,在模板中单独设置 */
}
.custom-dialog-wrapper {
  position: relative;
  z-index: 2001;
}
.custom-dialog {
@@ -1276,14 +1233,7 @@
    flex-direction: column;
    align-items: stretch;
  }
  /* ç¡®ä¿ç¡®è®¤å¯¹è¯æ¡†åœ¨æœ€å‰é¢ */
.el-message-box__wrapper {
  z-index: 10001 !important;
}
.el-message {
  z-index: 10002 !important;
}
  .scanner-form .el-input {
    width: 100%;
  }