647556386
2026-01-22 68e75f8e483accd14d34ea64e228678c58b498bc
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/views/outbound/outPicking.vue
@@ -499,43 +499,81 @@
            }
        },
        loadUnpickedData() {
            return new Promise((resolve, reject) => {
                this.http.post(`/api/Outbound/QueryPickingTasks?orderNo=${this.orderNo}&palletCode=${this.scanForm.palletCode}`, {}).then(response => {
                    if (response.status) {
                        if (response.data.outStockLockInfos.length > 0) {
                            this.unpickedData = response.data.outStockLockInfos;
                            this.matMixed = response.data.isMatMixed;
                            this.orderOver = response.data.orderOver;
                            this.calculateUnpickedStats()
                            // æ£€æŸ¥æ˜¯å¦éœ€è¦æ•´å‡ºç¡®è®¤
                            this.$nextTick(() => {
                                if (this.hasWholeOut()) {
                                    this.showWholeOutConfirm()
                                }
                            })
                            // è‡ªåŠ¨èšç„¦åˆ°ç‰©æ–™æ¡ç è¾“å…¥æ¡†
                            this.$nextTick(() => {
                                if (this.$refs.materialInput) {
                                    this.$refs.materialInput.focus()
                                }
                            })
                        } else {
                            if (flag) {
                                this.$message.warning('该托盘无未拣选任务')
                            }
                            this.unpickedData = []
    return new Promise((resolve, reject) => {
        // å…ˆæ¸…空之前的提示,避免重复提示
        this.$message.closeAll();
        this.http.post(`/api/Outbound/QueryPickingTasks?orderNo=${this.orderNo}&palletCode=${this.scanForm.palletCode}`, {}).then(response => {
            if (response.status) {
                // æƒ…况1:有未拣选数据
                if (response.data.outStockLockInfos && response.data.outStockLockInfos.length > 0) {
                    this.unpickedData = response.data.outStockLockInfos;
                    this.matMixed = response.data.isMatMixed;
                    this.orderOver = response.data.orderOver;
                    this.calculateUnpickedStats()
                    // æ£€æŸ¥æ•´å‡ºç¡®è®¤
                    this.$nextTick(() => {
                        if (this.hasWholeOut()) {
                            this.showWholeOutConfirm()
                        }
                        resolve()
                    } else {
                        this.$message.error(response.message || '获取托盘数据失败')
                        this.unpickedData = []
                        reject(response.message || '获取托盘数据失败')
                    }
                }).catch(error => {
                    reject(error)
                })
            })
        },
                    })
                    // èšç„¦ç‰©æ–™æ¡ç è¾“入框
                    this.$nextTick(() => {
                        if (this.$refs.materialInput) {
                            this.$refs.materialInput.focus()
                        }
                    })
                }
                // æƒ…况2:无未拣选数据
                else {
                    this.unpickedData = [];
                    this.calculateUnpickedStats(); // é‡ç½®ç»Ÿè®¡æ•°æ®
                    // å‹å¥½æç¤º + äº¤äº’优化
                    this.$message.warning({
                        message: `托盘【${this.scanForm.palletCode}】暂无拣选记录`,
                        duration: 3000, // æç¤ºæ˜¾ç¤º3秒
                        showClose: true // å…è®¸æ‰‹åЍ关闭
                    });
                    // æ¸…空物料条码并聚焦回托盘码输入框
                    this.scanForm.materialBarcode = '';
                    this.$nextTick(() => {
                        if (this.$refs.palletInput) {
                            this.$refs.palletInput.focus();
                        }
                    });
                }
                resolve();
            }
            // æƒ…况3:接口返回失败
            else {
                this.unpickedData = [];
                this.calculateUnpickedStats();
                this.$message.error({
                    message: response.message || `获取托盘【${this.scanForm.palletCode}】拣选数据失败`,
                    duration: 5000,
                    showClose: true
                });
                reject(response.message || '获取托盘数据失败');
            }
        }).catch(error => {
            // æƒ…况4:网络/请求异常
            this.unpickedData = [];
            this.calculateUnpickedStats();
            this.$message.error({
                message: `获取托盘【${this.scanForm.palletCode}】拣选数据异常:${error.message || '网络错误,请重试'}`,
                duration: 5000,
                showClose: true
            });
            reject(error);
        })
    })
},
        loadPickedData() {
            return new Promise((resolve, reject) => {
@@ -546,8 +584,10 @@
                            this.calculatePickedStats()
                        } else {
                            this.pickedData = []
                        }
                        resolve()
                    } else {
                        this.$message.error(response.message || '获取托盘数据失败')
                        this.pickedData = []