Commit 947e9816 by liangjianmin

feat(stockRecheck): 优化打印物流标签功能,支持批量打印并清空选择状态

- 遍历选中的出库单,分别调用打印接口,构建打印参数
- 添加用户邮箱信息以便于打印任务追踪
- 实现打印过程中加载提示,增强用户体验
- 增加延迟清空勾选状态的逻辑,提升操作流畅性
parent c69eb413
Showing with 47 additions and 13 deletions
...@@ -1247,21 +1247,55 @@ ...@@ -1247,21 +1247,55 @@
return; return;
} }
this.request(API.printLogisticsLabels, 'POST', { var user_email = uni.getStorageSync('oa_user_email') || '';
stock_out_ids: this.filter_id.join(',')
}, true).then(response => { // 遍历选中的出库单,分别调用打印接口
if (response.code === 0) { this.filter_id.forEach((stockOutId) => {
uni.showToast({ // 根据ID找到对应的出库单数据
title: '打印任务已发送,请查看打印机', var stockOutItem = this.list.find(item => item.stock_out_id === stockOutId);
icon: 'success' if (!stockOutItem) {
}); console.error('未找到出库单数据:', stockOutId);
} else { return;
uni.showToast({
title: response.msg || '打印失败',
icon: 'none'
});
} }
// 构建打印参数
var printParams = {
sn: '',
user_email: user_email,
type: 8, // 物流标签类型
shipping_name: stockOutItem.shipping_name || '',
shipping_code: stockOutItem.shipping_code || ''
};
this.request(API.latePrint, 'POST', printParams, true).then(res => {
if (res.code === 0) {
uni.showLoading({
title: '正在打印中...'
});
setTimeout(() => {
uni.hideLoading();
}, 3000);
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
});
}); });
// 延迟清空勾选状态
setTimeout(() => {
this.clearSelection();
}, 2000);
},
/**
* 清空选择状态
*/
clearSelection() {
this.filter_id = [];
this.filter_list = this.filter_list.map(() => false);
} }
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment