pan
2025-12-04 1bf0068b7931ff7de7233ffb219fed5d87fe66b1
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/views/outbound/BatchPickingConfirm.vue
@@ -4,29 +4,8 @@
      <el-page-header @back="goBack">
        <template #content>
          <span class="title">出库拣选确认 - {{ this.$route.query.orderNo }}</span>
          <el-tag v-if="currentBatchNo" type="success" style="margin-left: 10px;">
            å½“前批次: {{ currentBatchNo }}
          </el-tag>
        </template>
      </el-page-header>
    </div>
    <!-- æ‰¹æ¬¡æ“ä½œåŒºåŸŸ -->
    <div class="batch-operations">
      <el-card>
        <div class="batch-actions">
          <el-button type="primary" @click="openBatchAllocateDialog">分批分配</el-button>
          <el-select v-model="selectedBatchNo" placeholder="选择批次" @change="onBatchChange" style="width: 200px; margin-left: 10px;">
            <el-option
              v-for="batch in batchList"
              :key="batch.batchNo"
              :label="`${batch.batchNo} (${batch.batchStatusText})`"
              :value="batch.batchNo">
            </el-option>
          </el-select>
          <el-button type="info" @click="refreshBatchList">刷新批次</el-button>
        </div>
      </el-card>
    </div>
    <!-- æ‰«ç åŒºåŸŸ -->
@@ -52,21 +31,6 @@
          <el-button type="info" @click="openRevertSplitDialog">撤销拆包</el-button>
          <el-button type="info" @click="handleEmptyPallet">取空箱</el-button>
          <el-button type="primary" @click="openBatchReturnDialog">回库</el-button>
        </div>
      </el-card>
    </div>
    <!-- æ‰¹æ¬¡æ±‡æ€»ä¿¡æ¯ -->
    <div class="batch-summary-area" v-if="currentBatchNo">
      <el-card>
        <div class="batch-summary-info">
          <el-tag type="info">批次号: {{ batchSummary.batchNo }}</el-tag>
          <el-tag :type="getBatchStatusType(batchSummary.batchStatus)">
            {{ batchSummary.batchStatusText }}
          </el-tag>
          <el-tag type="warning">分配数量: {{ batchSummary.batchQuantity }}</el-tag>
          <el-tag type="success">完成数量: {{ batchSummary.completedQuantity }}</el-tag>
          <el-tag type="danger">剩余数量: {{ batchSummary.remainingQuantity }}</el-tag>
        </div>
      </el-card>
    </div>
@@ -119,7 +83,7 @@
              <el-table-column type="selection" width="55"></el-table-column>
              <el-table-column prop="materielCode" label="物料编码" width="120"></el-table-column>
              <el-table-column prop="pickedQty" label="已拣数量" width="100"></el-table-column>
              <el-table-column prop="locationCode" label="货位" width="100"></el-table-column>
              <!-- <el-table-column prop="locationCode" label="货位" width="100"></el-table-column> -->
              <el-table-column prop="currentBarcode" label="条码"></el-table-column>
            </el-table>
          </el-card>
@@ -127,54 +91,8 @@
      </el-row>
    </div>
    <!-- åˆ†æ‰¹åˆ†é…å¼¹çª— -->
    <div v-if="showBatchAllocateDialog" class="custom-dialog-overlay">
      <div class="custom-dialog-wrapper">
        <div class="custom-dialog">
          <div class="custom-dialog-header">
            <h3>分批分配库存</h3>
            <el-button type="text" @click="closeBatchAllocateDialog" class="close-button">×</el-button>
          </div>
          <div class="custom-dialog-body">
            <el-form :model="batchAllocateForm" :rules="batchAllocateFormRules" ref="batchAllocateFormRef" label-width="100px">
              <el-form-item label="订单编号">
                <el-input v-model="batchAllocateForm.orderNo" disabled></el-input>
              </el-form-item>
              <el-form-item label="物料明细" prop="orderDetailId">
                <el-select v-model="batchAllocateForm.orderDetailId" placeholder="选择物料明细" style="width: 100%">
                  <el-option
                    v-for="detail in allocatableDetails"
                    :key="detail.id"
                    :label="`${detail.materielCode} - éœ€æ±‚:${detail.needOutQuantity} å·²åˆ†é…:${detail.allocatedQuantity} å¯åˆ†é…:${detail.availableQuantity}`"
                    :value="detail.id">
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="分配数量" prop="batchQuantity">
                <el-input-number
                  v-model="batchAllocateForm.batchQuantity"
                  :min="0.01"
                  :precision="2"
                  :step="1"
                  style="width: 100%"
                  placeholder="输入分配数量">
                </el-input-number>
              </el-form-item>
              <el-form-item label="可分配数量">
                <el-input :value="getAvailableQuantity()" disabled></el-input>
              </el-form-item>
            </el-form>
          </div>
          <div class="custom-dialog-footer">
            <el-button @click="closeBatchAllocateDialog">取消</el-button>
            <el-button type="primary" @click="handleBatchAllocate" :loading="batchAllocateLoading">确认分配</el-button>
          </div>
        </div>
      </div>
    </div>
    <!-- æ‹†åŒ…弹窗 -->
    <div v-if="showCustomSplitDialog" class="custom-dialog-overlay">
    <div  v-show="showCustomSplitDialog" class="custom-dialog-overlay">
      <div class="custom-dialog-wrapper">
        <div class="custom-dialog">
          <div class="custom-dialog-header">
@@ -186,20 +104,28 @@
              <el-form-item label="订单编号">
                <el-input v-model="splitForm.orderNo" disabled></el-input>
              </el-form-item>
              <el-form-item label="批次编号">
                <el-input v-model="splitForm.batchNo" disabled></el-input>
              </el-form-item>
              <el-form-item label="托盘编号">
                <el-input v-model="splitForm.palletCode" disabled></el-input>
              </el-form-item>
              <el-form-item label="原条码" prop="originalBarcode">
                <el-input
                  v-model="splitForm.originalBarcode"
                  placeholder="扫描原条码"
                  @keyup.enter.native="onSplitBarcodeScan"
                  @change="onSplitBarcodeScan"
                  clearable>
                </el-input>
                <div style="display: flex; align-items: center; gap: 10px;">
                  <el-input
                    v-model="splitForm.originalBarcode"
                    placeholder="扫描原条码"
                    @keyup.enter.native="onSplitBarcodeScan"
                    @change="onSplitBarcodeScan"
                    clearable
                    style="flex: 1;">
                  </el-input>
                  <!-- æ–°å¢žï¼šæŸ¥çœ‹æ‹†åŒ…链按钮 -->
                  <el-button
  type="primary"
  @click="viewSplitChainFromSplit(splitForm.originalBarcode)"
  :disabled="!splitForm.originalBarcode"
  :loading="splitChainLoading">
  æŸ¥çœ‹æ‹†åŒ…链
</el-button>
                </div>
              </el-form-item>
              <el-form-item label="物料编码">
                <el-input v-model="splitForm.materielCode" disabled></el-input>
@@ -228,7 +154,7 @@
    </div>
    <!-- æ’¤é”€æ‹†åŒ…弹窗 -->
    <div v-if="showRevertSplitDialog" class="custom-dialog-overlay">
    <div  v-show="showRevertSplitDialog" class="custom-dialog-overlay">
      <div class="custom-dialog-wrapper">
        <div class="custom-dialog">
          <div class="custom-dialog-header">
@@ -238,15 +164,46 @@
          <div class="custom-dialog-body">
            <el-form :model="revertSplitForm" :rules="revertSplitFormRules" ref="revertSplitFormRef" label-width="100px">
              <el-form-item label="新条码" prop="newBarcode">
                <el-input
                  v-model="revertSplitForm.newBarcode"
                  placeholder="扫描新条码"
                  @keyup.enter.native="onRevertSplitBarcodeScan"
                  @change="onRevertSplitBarcodeScan"
                  clearable>
                </el-input>
                <div style="display: flex; align-items: center; gap: 10px;">
                  <el-input
                    v-model="revertSplitForm.newBarcode"
                    placeholder="扫描新条码"
                    @keyup.enter.native="onRevertSplitBarcodeScan"
                    @change="onRevertSplitBarcodeScan"
                    clearable
                    style="flex: 1;">
                  </el-input>
                  <!-- æ–°å¢žï¼šæŸ¥çœ‹æ‹†åŒ…链按钮 -->
                  <el-button
                    type="primary"
                    @click="viewSplitChain(revertSplitForm.newBarcode)"
                    :disabled="!revertSplitForm.newBarcode">
                    æŸ¥çœ‹æ‹†åŒ…链
                  </el-button>
                </div>
              </el-form-item>
            </el-form>
            <!-- æ–°å¢žï¼šæ‹†åŒ…链简要信息显示 -->
            <div v-if="splitChainInfo.splitChain && splitChainInfo.splitChain.length > 0"
                 style="margin-top: 15px; padding: 10px; background: #f0f9ff; border-radius: 4px;">
              <div style="font-size: 14px; color: #606266;">
                <div>拆包链信息: å…± {{ splitChainInfo.totalSplitTimes }} æ¬¡æ‹†åŒ…</div>
                <div style="margin-top: 5px;">
                  <el-tag
                    v-for="item in splitChainInfo.splitChain.slice(0, 3)"
                    :key="item.newBarcode"
                    :type="item.isReverted ? 'success' : 'primary'"
                    size="small"
                    style="margin-right: 5px;">
                    {{ item.newBarcode }} ({{ item.splitQuantity }})
                  </el-tag>
                  <span v-if="splitChainInfo.splitChain.length > 3" style="color: #909399;">
                    ç­‰ {{ splitChainInfo.splitChain.length }} ä¸ªæ¡ç 
                  </span>
                </div>
              </div>
            </div>
          </div>
          <div class="custom-dialog-footer">
            <el-button @click="closeRevertSplitDialog">取消</el-button>
@@ -256,12 +213,136 @@
      </div>
    </div>
    <!-- æ‹†åŒ…链信息弹窗 -->
<div v-show="showSplitChainDialog" class="custom-dialog-overlay">
  <div class="custom-dialog-wrapper">
    <div class="custom-dialog" style="width: 750px;">
      <div class="custom-dialog-header">
        <h3>拆包链信息</h3>
        <el-button type="text" @click="closeSplitChainDialog" class="close-button">×</el-button>
      </div>
      <div class="custom-dialog-body">
        <!-- æ–°å¢žï¼šæ‹†åŒ…链说明 -->
        <div style="margin-bottom: 15px; padding: 10px; background: #f0f9ff; border-radius: 4px;">
          <div style="display: flex; justify-content: space-between; align-items: center;">
            <div>
              <div style="font-weight: bold; color: #303133;">拆包链说明</div>
              <div style="font-size: 12px; color: #606266; margin-top: 5px;">
                å½“前显示的是从 <el-tag type="primary" size="small">{{ splitChainInfo.originalBarcode }}</el-tag> å¼€å§‹çš„æ‹†åŒ…链
                <br>共 {{ splitChainInfo.totalSplitTimes }} æ¬¡æ‹†åŒ…操作,涉及 {{ splitChainInfo.splitChain.length }} ä¸ªæ¡ç 
              </div>
            </div>
            <el-button
              type="primary"
              size="small"
              @click="findRootChain(splitChainInfo.originalBarcode)"
              v-if="splitChainInfo.chainType !== 'root'">
              æŸ¥æ‰¾å®Œæ•´æ‹†åŒ…链
            </el-button>
          </div>
        </div>
        <div style="margin-bottom: 15px;">
          <el-tag type="info">总拆包次数: {{ splitChainInfo.totalSplitTimes }}</el-tag>
          <el-tag type="warning" style="margin-left: 10px;">
            åŽŸå§‹æ¡ç : {{ splitChainInfo.originalBarcode }}
          </el-tag>
          <el-tag :type="splitChainInfo.chainType === 'root' ? 'success' : 'warning'" style="margin-left: 10px;">
            {{ splitChainInfo.chainType === 'root' ? '完整链' : '分支链' }}
          </el-tag>
        </div>
        <el-table :data="splitChainInfo.splitChain" border height="300">
          <el-table-column type="index" label="序号" width="60" align="center"></el-table-column>
          <el-table-column prop="splitTime" label="拆包时间" width="160">
            <template #default="scope">
              {{ formatDateTime(scope.row.splitTime) }}
            </template>
          </el-table-column>
          <el-table-column prop="originalBarcode" label="原条码" width="140">
            <template #default="scope">
              <el-tag
                :type="scope.row.originalBarcode === splitChainInfo.rootBarcode ? 'success' : 'primary'"
                size="small">
                {{ scope.row.originalBarcode }}
              </el-tag>
            </template>
          </el-table-column>
          <el-table-column prop="newBarcode" label="新条码" width="140">
            <template #default="scope">
              <el-tag
                :type="scope.row.isReverted ? 'info' : 'warning'"
                size="small">
                {{ scope.row.newBarcode }}
              </el-tag>
            </template>
          </el-table-column>
          <el-table-column prop="splitQuantity" label="拆包数量" width="100" align="right">
            <template #default="scope">
              {{ scope.row.splitQuantity.toFixed(2) }}
            </template>
          </el-table-column>
          <el-table-column prop="operator" label="操作员" width="100"></el-table-column>
          <el-table-column prop="isReverted" label="状态" width="80" align="center">
            <template #default="scope">
              <el-tag
                :type="scope.row.isReverted ? 'success' : 'danger'"
                size="small">
                {{ scope.row.isReverted ? '已撤销' : '有效' }}
              </el-tag>
            </template>
          </el-table-column>
          <el-table-column label="操作" width="120" align="center">
            <template #default="scope">
              <el-button
                v-if="!scope.row.isReverted"
                type="danger"
                size="mini"
                @click="cancelSingleSplit(scope.row.newBarcode)"
                :disabled="hasPicked(scope.row.newBarcode)">
                å–消
              </el-button>
              <span v-else style="color: #909399;">已撤销</span>
            </template>
          </el-table-column>
        </el-table>
        <!-- æ‰¹é‡æ“ä½œåŒºåŸŸ -->
        <div style="margin-top: 15px; padding: 10px; background: #f5f7fa; border-radius: 4px;">
          <div style="display: flex; justify-content: space-between; align-items: center;">
            <div>
              <span style="font-size: 14px; color: #606266;">
                æ‰¹é‡æ“ä½œ: å¯ä»¥å–消整个拆包链或选择单个拆包记录取消
              </span>
              <div style="font-size: 12px; color: #909399; margin-top: 5px;">
                å®Œæ•´æ‹†åŒ…链包含从最原始条码开始的所有拆包操作
              </div>
            </div>
            <div>
              <el-button
                type="danger"
                @click="cancelWholeSplitChain"
                :disabled="!canCancelWholeChain"
                :loading="revertSplitLoading">
                å–消整个拆包链
              </el-button>
            </div>
          </div>
        </div>
      </div>
      <div class="custom-dialog-footer">
        <el-button @click="closeSplitChainDialog">关闭</el-button>
      </div>
    </div>
  </div>
</div>
    <!-- æ‰¹é‡å›žåº“弹窗 -->
    <div v-if="showBatchReturnDialog" class="custom-dialog-overlay">
      <div class="custom-dialog-wrapper">
        <div class="custom-dialog">
          <div class="custom-dialog-header">
            <h3>批次回库</h3>
            <h3>托盘回库</h3>
            <el-button type="text" @click="closeBatchReturnDialog" class="close-button">×</el-button>
          </div>
          <div class="custom-dialog-body">
@@ -269,8 +350,8 @@
              <el-form-item label="订单编号">
                <el-input v-model="batchReturnForm.orderNo" disabled></el-input>
              </el-form-item>
              <el-form-item label="批次编号">
                <el-input v-model="batchReturnForm.batchNo" disabled></el-input>
              <el-form-item label="托盘编号">
                <el-input v-model="batchReturnForm.palletCode" disabled></el-input>
              </el-form-item>
              <el-form-item label="未拣选数量">
                <el-input v-model="batchReturnForm.unpickedQuantity" disabled></el-input>
@@ -335,36 +416,12 @@
  name: 'BatchOutboundPicking',
  components: {printView},
  data() {
    // éªŒè¯è§„则定义...
    const validateBatchQuantity = (rule, value, callback) => {
      if (value === null || value === undefined || value === '') {
        callback(new Error('请输入分配数量'));
      } else if (value <= 0) {
        callback(new Error('分配数量必须大于0'));
      } else {
        callback();
      }
    };
    const validateOrderDetailId = (rule, value, callback) => {
      if (!value) {
        callback(new Error('请选择物料明细'));
      } else {
        callback();
      }
    };
    return {
      scanData: {
        orderNo: '',
        palletCode: '',
        barcode: '',
        batchNo: ''
        barcode: ''
      },
      currentBatchNo: '', // å½“前批次号
      batchList: [], // æ‰¹æ¬¡åˆ—表
      selectedBatchNo: '', // é€‰ä¸­çš„æ‰¹æ¬¡å·
      batchSummary: {}, // æ‰¹æ¬¡æ±‡æ€»ä¿¡æ¯
      unpickedList: [],
      pickedList: [],
      selectedPickedRows: [],
@@ -376,30 +433,22 @@
      palletStatus: '未知',
      
      // å¼¹çª—状态
      showBatchAllocateDialog: false,
      showCustomSplitDialog: false,
      showRevertSplitDialog: false,
      showBatchReturnDialog: false,
      showEmptyPalletDialog: false,
      showSplitChainDialog: false, // æ–°å¢žï¼šæ‹†åŒ…链信息弹窗
      
      // åŠ è½½çŠ¶æ€
      batchAllocateLoading: false,
      splitLoading: false,
      revertSplitLoading: false,
      batchReturnLoading: false,
      emptypalletOutLoading: false,
      splitChainLoading: false, // æ–°å¢žï¼šæ‹†åŒ…链加载状态
      
      // è¡¨å•数据
      batchAllocateForm: {
        orderNo: '',
        orderDetailId: '',
        batchQuantity: 0
      },
      allocatableDetails: [], // å¯åˆ†é…çš„订单明细
      splitForm: {
        orderNo: '',
        batchNo: '',
        palletCode: '',
        originalBarcode: '',
        materielCode: '',
@@ -413,7 +462,7 @@
      
      batchReturnForm: {
        orderNo: '',
        batchNo: '',
        palletCode: '',
        unpickedCount: 0,
        unpickedQuantity: 0
      },
@@ -423,25 +472,128 @@
        palletCode: ''
      },
      
      // æ–°å¢žï¼šæ‹†åŒ…链相关数据
      splitChainInfo: {
        originalBarcode: '',
        totalSplitTimes: 0,
        splitChain: []
      },
      // éªŒè¯è§„则
      batchAllocateFormRules: {
        orderDetailId: [
          { required: true, validator: validateOrderDetailId, trigger: 'change' }
      splitFormRules: {
        originalBarcode: [
          { required: true, message: '请输入原条码', trigger: 'blur' }
        ],
        batchQuantity: [
          { required: true, validator: validateBatchQuantity, trigger: 'blur' }
        splitQuantity: [
          { required: true, message: '请输入拆包数量', trigger: 'blur' },
          { type: 'number', min: 0.01, message: '拆包数量必须大于0', trigger: 'blur' }
        ]
      },
      
      // å…¶ä»–验证规则...
      revertSplitFormRules: {
        newBarcode: [
          { required: true, message: '请输入新条码', trigger: 'blur' }
        ]
      },
      emptypalletOutFormRules: {
        palletCode: [
          { required: true, message: '请输入托盘码', trigger: 'blur' }
        ]
      },
       // å¼¹çª—状态 - æ”¹ä¸ºä½¿ç”¨å¯¹è±¡ç®¡ç†ï¼Œé¿å…åŒæ—¶æ‰“开多个弹窗
      dialogs: {
        customSplit: false,
        revertSplit: false,
        splitChain: false,
        batchReturn: false,
        emptyPallet: false
      },
      // åŠ è½½çŠ¶æ€
      loading: {
        split: false,
        revertSplit: false,
        batchReturn: false,
        emptyPallet: false,
        splitChain: false
      },
      // å½“前活动的弹窗类型
      activeDialog: null,
      isProcessing: false
    }
  },
  computed: {
     // è®¡ç®—属性映射到dialogs对象
    showCustomSplitDialog: {
      get() { return this.dialogs.customSplit; },
      set(val) {
        this.dialogs.customSplit = val;
        this.activeDialog = val ? 'customSplit' : null;
      }
    },
    showRevertSplitDialog: {
      get() { return this.dialogs.revertSplit; },
      set(val) {
        this.dialogs.revertSplit = val;
        this.activeDialog = val ? 'revertSplit' : null;
      }
    },
    showSplitChainDialog: {
      get() { return this.dialogs.splitChain; },
      set(val) {
        this.dialogs.splitChain = val;
        this.activeDialog = val ? 'splitChain' : null;
      }
    },
    showBatchReturnDialog: {
      get() { return this.dialogs.batchReturn; },
      set(val) {
        this.dialogs.batchReturn = val;
        this.activeDialog = val ? 'batchReturn' : null;
      }
    },
    showEmptyPalletDialog: {
      get() { return this.dialogs.emptyPallet; },
      set(val) {
        this.dialogs.emptyPallet = val;
        this.activeDialog = val ? 'emptyPallet' : null;
      },
    },
     // åŠ è½½çŠ¶æ€æ˜ å°„
    splitLoading: {
      get() { return this.loading.split; },
      set(val) { this.loading.split = val; }
    },
    revertSplitLoading: {
      get() { return this.loading.revertSplit; },
      set(val) { this.loading.revertSplit = val; }
    },
    batchReturnLoading: {
      get() { return this.loading.batchReturn; },
      set(val) { this.loading.batchReturn = val; }
    },
    emptypalletOutLoading: {
      get() { return this.loading.emptyPallet; },
      set(val) { this.loading.emptyPallet = val; }
    },
    splitChainLoading: {
      get() { return this.loading.splitChain; },
      set(val) { this.loading.splitChain = val; }
    },
    // æ˜¯å¦å¯ä»¥å–消整个拆包链
    canCancelWholeChain() {
      return this.splitChainInfo.splitChain &&
             this.splitChainInfo.splitChain.some(item => !item.isReverted);
    }
  },
  mounted() {
    if (this.$route.query.orderNo) {
      this.scanData.orderNo = this.$route.query.orderNo;
      this.batchAllocateForm.orderNo = this.$route.query.orderNo;
      this.loadBatchList();
      this.splitForm.orderNo = this.$route.query.orderNo;
      this.batchReturnForm.orderNo = this.$route.query.orderNo;
      this.emptypalletOutForm.orderNo = this.$route.query.orderNo;
    }
    this.$nextTick(() => {
      this.$refs.palletInput.focus();
@@ -450,150 +602,6 @@
  methods: {
    goBack(){
      this.$router.back()
    },
    // æ‰¹æ¬¡ç›¸å…³æ–¹æ³•
    async loadBatchList() {
      try {
        const res = await http.post('/api/BatchOutbound/order-batch-list', {
          orderNo: this.scanData.orderNo
        });
        if (res.status) {
          this.batchList = res.data || [];
          if (this.batchList.length > 0) {
            this.selectedBatchNo = this.batchList[0].batchNo;
            this.currentBatchNo = this.selectedBatchNo;
            this.scanData.batchNo = this.selectedBatchNo;
            this.loadBatchData();
          }
        }
      } catch (error) {
        this.$message.error('加载批次列表失败');
      }
    },
    async refreshBatchList() {
      await this.loadBatchList();
      this.$message.success('批次列表已刷新');
    },
    onBatchChange(batchNo) {
      this.currentBatchNo = batchNo;
      this.scanData.batchNo = batchNo;
      this.loadBatchData();
    },
    async loadBatchData() {
      if (!this.currentBatchNo) return;
      await this.loadBatchSummary();
      await this.loadUnpickedList();
      await this.loadPickedList();
    },
    async loadBatchSummary() {
      try {
        const res = await http.post('/api/BatchOutbound/batch-summary', {
          orderNo: this.scanData.orderNo,
          batchNo: this.currentBatchNo
        });
        if (res.status) {
          this.batchSummary = res.data || {};
        }
      } catch (error) {
        this.$message.error('加载批次汇总失败');
      }
    },
    async loadUnpickedList() {
      try {
        const res = await http.post('/api/BatchOutbound/batch-unpicked-list', {
          orderNo: this.scanData.orderNo,
          batchNo: this.currentBatchNo
        });
        this.unpickedList = res.data || [];
        this.summary.unpickedCount = this.unpickedList.length;
        this.summary.unpickedQuantity = this.unpickedList.reduce((sum, item) => sum + (item.remainQuantity || 0), 0);
      } catch (error) {
        this.$message.error('加载未拣选列表失败');
      }
    },
    async loadPickedList() {
      try {
        const res = await http.post('/api/BatchOutbound/batch-picked-list', {
          orderNo: this.scanData.orderNo,
          batchNo: this.currentBatchNo
        });
        this.pickedList = res.data || [];
        this.summary.pickedCount = this.pickedList.length;
      } catch (error) {
        this.$message.error('加载已拣选列表失败');
      }
    },
    getBatchStatusType(status) {
      const statusMap = {
        0: 'info', // åˆ†é…ä¸­
        1: 'warning', // æ‰§è¡Œä¸­
        2: 'success', // å·²å®Œæˆ
        3: 'danger' // å·²å›žåº“
      };
      return statusMap[status] || 'info';
    },
    // åˆ†æ‰¹åˆ†é…ç›¸å…³æ–¹æ³•
    async openBatchAllocateDialog() {
      this.showBatchAllocateDialog = true;
      await this.loadAllocatableDetails();
      this.batchAllocateForm.orderDetailId = '';
      this.batchAllocateForm.batchQuantity = 0;
    },
    async loadAllocatableDetails() {
      try {
        const res = await http.post('/api/BatchOutbound/allocatable-order-details', {
          orderNo: this.scanData.orderNo
        });
        if (res.status) {
          this.allocatableDetails = res.data || [];
        }
      } catch (error) {
        this.$message.error('加载可分配明细失败');
      }
    },
    getAvailableQuantity() {
      const detail = this.allocatableDetails.find(d => d.id === this.batchAllocateForm.orderDetailId);
      return detail ? detail.availableQuantity : 0;
    },
    async handleBatchAllocate() {
      if (this.$refs.batchAllocateFormRef) {
        this.$refs.batchAllocateFormRef.validate(async (valid) => {
          if (valid) {
            this.batchAllocateLoading = true;
            try {
              const res = await http.post('/api/BatchOutbound/batch-allocate-stock', this.batchAllocateForm);
              if (res.status) {
                this.$message.success('分批分配成功');
                this.showBatchAllocateDialog = false;
                await this.loadBatchList(); // åˆ·æ–°æ‰¹æ¬¡åˆ—表
              } else {
                this.$message.error(res.message || '分批分配失败');
              }
            } catch (error) {
              this.$message.error('分批分配失败');
            } finally {
              this.batchAllocateLoading = false;
            }
          }
        });
      }
    },
    closeBatchAllocateDialog() {
      this.showBatchAllocateDialog = false;
    },
    // åˆ†æ‹£ç›¸å…³æ–¹æ³•
@@ -606,21 +614,20 @@
        return;
      }
      if (!this.currentBatchNo) {
        this.$message.warning('请先选择批次');
        return;
      }
      this.isProcessing = true;
      
      try {
        const res = await http.post('/api/BatchOutbound/confirm-picking', this.scanData);
        const res = await http.post('/api/OutboundBatchPicking/confirm-picking', {
          orderNo: this.scanData.orderNo,
          palletCode: this.scanData.palletCode,
          barcode: this.scanData.barcode
        });
        if (res.status) {
          this.$message.success('拣选确认成功');
          this.scanData.barcode = '';
          await this.loadBatchData();
          if(res.data && res.data.splitResults && res.data.splitResults.length>0){
            this.$refs.childs.open(res.data.splitResults);
          await this.loadPalletData();
          if(res.data && res.data && res.data.length>0){
            this.$refs.childs.open(res.data);
          }
          this.$nextTick(() => {
            this.$refs.barcodeInput.focus();
@@ -643,15 +650,23 @@
        this.$message.warning('请先扫描托盘码');
        return;
      }
      if (!this.currentBatchNo) {
        this.$message.warning('请先选择批次');
        return;
      }
      this.showCustomSplitDialog = true;
      this.resetSplitForm();
      this.splitForm.orderNo = this.scanData.orderNo;
      this.splitForm.batchNo = this.currentBatchNo;
      this.splitForm.palletCode = this.scanData.palletCode;
         // å…³é—­å…¶ä»–所有弹窗
      this.closeAllDialogs();
        // å»¶è¿Ÿæ‰“开新弹窗,确保其他弹窗完全关闭
      this.$nextTick(() => {
        this.showCustomSplitDialog = true;
        this.resetSplitForm();
        this.splitForm.orderNo = this.scanData.orderNo;
        this.splitForm.palletCode = this.scanData.palletCode;
        // ç¡®ä¿è¾“入框获得焦点
        this.$nextTick(() => {
          const inputs = document.querySelectorAll('.custom-dialog input');
          if (inputs.length > 0) {
            inputs[0].focus();
          }
        });
      });
    },
    async onSplitBarcodeScan() {
@@ -659,13 +674,16 @@
      this.splitForm.originalBarcode = this.splitForm.originalBarcode.replace(/\n/g, '').trim();
      try {
        const res = await http.post('/api/BatchOutbound/split-package-info', {
        const res = await http.post('/api/OutboundBatchPicking/split-package-info', {
          orderNo: this.splitForm.orderNo,
          batchNo: this.splitForm.batchNo,
          palletCode: this.splitForm.palletCode,
          barcode: this.splitForm.originalBarcode
        });
        if (res.status) {
            if(res.data && res.data.length>0){
            this.$refs.childs.open(res.data);
          }
          this.splitForm.materielCode = res.data.materielCode;
          this.splitForm.maxQuantity = res.data.remainQuantity;
          this.splitForm.splitQuantity = Math.min(1, this.splitForm.maxQuantity);
@@ -679,145 +697,440 @@
    async handleSplitPackage() {
      if (this.$refs.splitFormRef) {
        this.$refs.splitFormRef.validate(async (valid) => {
          if (valid) {
            this.splitLoading = true;
            try {
              const res = await http.post('/api/BatchOutbound/manual-split-package', this.splitForm);
              if (res.status) {
                this.$message.success('拆包成功');
                this.showCustomSplitDialog = false;
                await this.loadBatchData();
              } else {
                this.$message.error(res.message || '拆包失败');
              }
            } catch (error) {
              this.$message.error('拆包失败');
            } finally {
              this.splitLoading = false;
            }
        const valid = await this.$refs.splitFormRef.validate();
        if (!valid) return;
        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('拆包失败: ' + (error.message || '网络错误'));
        } finally {
          this.splitLoading = false;
        }
      }
    },
// åœ¨æ‹†åŒ…弹窗中查看拆包链
async viewSplitChainFromSplit(barcode) {
  if (!barcode) {
    this.$message.warning('请先输入条码');
    return;
  }
  // å…ˆå…³é—­æ‹†åŒ…弹窗
  this.closeCustomSplitDialog();
  await this.$nextTick();
  // ç„¶åŽæ‰“开拆包链信息弹窗
  await this.viewSplitChain(barcode);
},
    // æ’¤é”€æ‹†åŒ…
    async onRevertSplitBarcodeScan() {
      if (!this.revertSplitForm.newBarcode) return;
        if (!this.revertSplitForm.newBarcode) return;
      this.revertSplitForm.newBarcode = this.revertSplitForm.newBarcode.replace(/\n/g, '').trim();
    },
    async handleRevertSplit() {
      if (this.$refs.revertSplitFormRef) {
        this.$refs.revertSplitFormRef.validate(async (valid) => {
          if (valid) {
            this.revertSplitLoading = true;
            try {
              const res = await http.post('/api/BatchOutbound/cancel-split-package', {
                orderNo: this.scanData.orderNo,
                batchNo: this.currentBatchNo,
                newBarcode: this.revertSplitForm.newBarcode
              });
              if (res.status) {
                this.$message.success('撤销拆包成功');
                this.showRevertSplitDialog = false;
                await this.loadBatchData();
              } else {
                this.$message.error(res.message || '撤销拆包失败');
              }
            } catch (error) {
              this.$message.error('撤销拆包失败');
            } finally {
              this.revertSplitLoading = false;
            }
       if (this.$refs.revertSplitFormRef) {
        const valid = await this.$refs.revertSplitFormRef.validate();
        if (!valid) return;
        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('撤销拆包失败: ' + (error.message || '网络错误'));
        } finally {
          this.revertSplitLoading = false;
        }
      }
    },
    // å›žåº“相关方法
    openBatchReturnDialog() {
      if (!this.currentBatchNo) {
        this.$message.warning('请先选择批次');
// æŸ¥æ‰¾å®Œæ•´æ‹†åŒ…链(从根条码开始)
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.showBatchReturnDialog = true;
      this.batchReturnForm.orderNo = this.scanData.orderNo;
      this.batchReturnForm.batchNo = this.currentBatchNo;
      this.batchReturnForm.unpickedCount = this.summary.unpickedCount;
      this.batchReturnForm.unpickedQuantity = this.summary.unpickedQuantity;
      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;
            // æ˜¾ç¤ºæç¤ºä¿¡æ¯
            let chainType = "当前条码的拆包链";
            if (this.splitChainInfo.chainType === 'root') {
              chainType = "完整拆包链(从原始条码开始)";
            } else if (this.splitChainInfo.chainType === 'branch') {
              chainType = "分支拆包链";
            }
            this.$message.info(`已加载${chainType},共${this.splitChainInfo.totalSplitTimes}次拆包`);
          });
        } else {
          this.$message.error(res.message || '获取拆包链信息失败');
        }
      } catch (error) {
        this.$message.error('获取拆包链信息失败: ' + (error.message || '网络错误'));
      } 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) {
   try {
        await ElMessageBox.confirm(
          `确定要取消条码 ${newBarcode} çš„æ‹†åŒ…操作吗?`,
          '取消单个拆包',
          {
            confirmButtonText: '确定取消',
            cancelButtonText: '再想想',
            type: 'warning',
            customClass: 'message-box-top'
          }
        );
        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('取消拆包失败: ' + error.message);
        }
      } finally {
        this.revertSplitLoading = false;
      }
},
// å–消整个拆包链
async cancelWholeSplitChain() {
  if (!this.canCancelWholeChain) return;
      try {
        await ElMessageBox.confirm(
          `确定要取消整个拆包链吗?\n这将取消从条码 ${this.splitChainInfo.originalBarcode} å¼€å§‹çš„æ‰€æœ‰æ‹†åŒ…操作。`,
          '取消拆包链确认',
          {
            confirmButtonText: '确定取消',
            cancelButtonText: '再想想',
            type: 'warning',
            center: true,
            closeOnClickModal: false,
            customClass: 'message-box-top'
          }
        );
        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('取消拆包链失败: ' + error.message);
        }
      } finally {
        this.revertSplitLoading = false;
      }
},
    // æ£€æŸ¥æ¡ç æ˜¯å¦å·²è¢«åˆ†æ‹£
    hasPicked(barcode) {
      return this.pickedList.some(item => item.currentBarcode === barcode);
    },
    // æ ¼å¼åŒ–日期时间
    formatDateTime(dateTime) {
      if (!dateTime) return '';
      const date = new Date(dateTime);
      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;
      this.activeDialog = null;
    },
    // å›žåº“相关方法
    openBatchReturnDialog() {
     if (!this.scanData.palletCode) {
        this.$message.warning('请先扫描托盘码');
        return;
      }
      // å…³é—­å…¶ä»–弹窗
      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() {
      this.batchReturnLoading = true;
      try {
        const res = await http.post('/api/BatchOutbound/batch-return-stock', {
        const res = await http.post('/api/OutboundBatchPicking/return-stock', {
          orderNo: this.scanData.orderNo,
          batchNo: this.currentBatchNo
          palletCode: this.scanData.palletCode
        });
        if (res.status) {
          this.$message.success('批次回库成功');
          this.$message.success('回库成功');
          this.showBatchReturnDialog = false;
          await this.loadBatchData();
          await this.loadPalletData();
        } else {
          this.$message.error(res.message || '批次回库失败');
          this.$message.error(res.message || '回库失败');
        }
      } catch (error) {
        this.$message.error('批次回库失败');
        this.$message.error('回库失败: ' + (error.message || '网络错误'));
      } finally {
        this.batchReturnLoading = false;
      }
    },
    // å–空箱方法
    handleEmptyPallet() {
      // å…³é—­å…¶ä»–弹窗
      this.closeAllDialogs();
      this.$nextTick(() => {
        this.showEmptyPalletDialog = true;
        this.emptypalletOutForm.orderNo = this.scanData.orderNo;
        this.emptypalletOutForm.palletCode = '';
      });
    },
    async handleEmptyPalletConfirm() {
      this.emptypalletOutLoading = true;
      try {
        const res = await http.post('/api/BatchOutbound/remove-empty-pallet', this.emptypalletOutForm);
        const res = await http.post('/api/OutboundBatchPicking/remove-empty-pallet', {
          orderNo: this.emptypalletOutForm.orderNo,
          palletCode: this.emptypalletOutForm.palletCode
        });
        if (res.status) {
          this.$message.success('取走空箱成功');
          this.showEmptyPalletDialog = false;
          await this.loadBatchData();
          await this.loadPalletData();
        } else {
          this.$message.error(res.message || '取走空箱失败');
        }
      } catch (error) {
        this.$message.error('取走空箱失败');
        this.$message.error('取走空箱失败: ' + (error.message || '网络错误'));
      } finally {
        this.emptypalletOutLoading = false;
      }
    },
    // å…¶ä»–原有方法...
    // æ•°æ®åŠ è½½æ–¹æ³•
    async loadPalletData() {
       if (!this.scanData.orderNo || !this.scanData.palletCode) return;
      try {
        await Promise.all([
          this.loadUnpickedList(),
          this.loadPickedList(),
          this.loadPalletStatus()
        ]);
      } catch (error) {
        console.error('加载托盘数据失败:', error);
      }
    },
    async loadUnpickedList() {
       try {
        const res = await http.post('/api/OutboundBatchPicking/pallet-locks', {
          orderNo: this.scanData.orderNo,
          palletCode: this.scanData.palletCode
        });
        if (res.status) {
          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('加载未拣选列表失败');
      }
    },
    async loadPickedList() {
      try {
        const res = await http.post('/api/OutboundBatchPicking/pallet-picked-list', {
          orderNo: this.scanData.orderNo,
          palletCode: this.scanData.palletCode
        });
        if (res.status) {
          this.pickedList = res.data.map(item => ({
            ...item,
            currentBarcode: item.barcode
          }));
          this.summary.pickedCount = this.pickedList.length;
        }
      } catch (error) {
        console.error('加载已拣选列表失败:', error);
        this.$message.error('加载已拣选列表失败');
      }
    },
    async loadPalletStatus() {
          try {
        const res = await http.post('/api/OutboundBatchPicking/pallet-status', {
          orderNo: this.scanData.orderNo,
          palletCode: this.scanData.palletCode
        });
        if (res.status) {
          this.palletStatus = res.data.statusText || '未知';
        }
      } catch (error) {
        console.error('加载托盘状态失败:', error);
        this.palletStatus = '未知';
      }
    },
    // æ‰«ç ç›¸å…³æ–¹æ³•
    onPalletScan() {
      this.scanData.palletCode = this.scanData.palletCode.replace(/\n/g, '').trim();
       this.scanData.palletCode = this.scanData.palletCode.replace(/\n/g, '').trim();
      if (!this.scanData.palletCode) return;
      
      this.loadActiveBatch();
      this.loadPalletData();
      this.$nextTick(() => {
        this.$refs.barcodeInput.focus();
      });
    },
    async loadActiveBatch() {
      try {
        const res = await http.post('/api/BatchOutbound/active-batch', {
          orderNo: this.scanData.orderNo,
          palletCode: this.scanData.palletCode
        });
        if (res.status && res.data) {
          this.currentBatchNo = res.data.batchNo;
          this.scanData.batchNo = res.data.batchNo;
          this.selectedBatchNo = res.data.batchNo;
          await this.loadBatchData();
        }
      } catch (error) {
        console.log('获取活跃批次失败,可能托盘没有关联批次');
      }
    },
    onBarcodeScan() {
      this.scanData.barcode = this.scanData.barcode.replace(/\n/g, '').trim();
       this.scanData.barcode = this.scanData.barcode.replace(/\n/g, '').trim();
      if (!this.scanData.barcode) return;
      this.confirmPicking();
    },
@@ -845,34 +1158,40 @@
        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/BatchOutbound/cancel-picking', {
                orderNo: this.scanData.orderNo,
                batchNo: this.currentBatchNo,
                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',
            customClass: 'message-box-top'
          }
        );
        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.loadBatchData();
          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('批量取消操作失败');
        }
      });
      }
    },
    // é‡ç½®æ–¹æ³•
@@ -889,8 +1208,13 @@
    },
    openRevertSplitDialog() {
      this.showRevertSplitDialog = true;
      this.revertSplitForm.newBarcode = '';
       // å…³é—­å…¶ä»–弹窗
      this.closeAllDialogs();
      this.$nextTick(() => {
        this.showRevertSplitDialog = true;
        this.revertSplitForm.newBarcode = '';
      });
    },
    closeRevertSplitDialog() {
@@ -902,10 +1226,9 @@
      this.showBatchReturnDialog = false;
    },
    openEmptyPalletDialog() {
      this.showEmptyPalletDialog = true;
      this.emptypalletOutForm.orderNo = this.scanData.orderNo;
      this.emptypalletOutForm.palletCode = '';
    onEmptyPalletScan() {
      if (!this.emptypalletOutForm.palletCode) return;
      this.emptypalletOutForm.palletCode = this.emptypalletOutForm.palletCode.replace(/\n/g, '').trim();
    },
    closeEmptyPalletDialog() {
@@ -913,9 +1236,8 @@
      this.emptypalletOutForm.palletCode = '';
    },
    onEmptyPalletScan() {
      if (!this.emptypalletOutForm.palletCode) return;
      this.emptypalletOutForm.palletCode = this.emptypalletOutForm.palletCode.replace(/\n/g, '').trim();
    parentcall() {
      // æ‰“印回调
    }
  }
})
@@ -924,26 +1246,6 @@
<style scoped>
.OutboundPicking-container {
  padding: 20px;
}
.batch-operations {
  margin-bottom: 15px;
}
.batch-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.batch-summary-area {
  margin-bottom: 15px;
}
.batch-summary-info {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}
.scanner-form {
@@ -977,6 +1279,23 @@
}
/* è‡ªå®šä¹‰å¼¹çª—样式 */
:deep(.el-message-box) {
  z-index: 9999 !important;
}
:deep(.el-overlay) {
  z-index: 9998 !important;
}
:deep(.el-message) {
  z-index: 10000 !important;
}
/* ç¡®ä¿ç¡®è®¤å¯¹è¯æ¡†åœ¨æœ€å‰é¢ */
:deep(.message-box-top) {
  z-index: 10001 !important;
}
.custom-dialog-overlay {
  position: fixed;
  top: 0;
@@ -987,12 +1306,12 @@
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  z-index: 2000;
}
.custom-dialog-wrapper {
  position: relative;
  z-index: 10000;
  z-index: 2001;
}
.custom-dialog {