fix: support multiple copies printing natively in backend print service

This commit is contained in:
DXC
2026-03-13 10:16:57 +08:00
parent 3ba4e74a60
commit f42f19f8e5

View File

@ -417,8 +417,6 @@ const borrowedQuantities = ref<Record<string, number>>({})
// ★ 新增: 会话ID // ★ 新增: 会话ID
const currentSessionId = ref<string>('') const currentSessionId = ref<string>('')
// ★ 新增: 差异报告列表
const varianceList = ref<any[]>([])
const varianceLoading = ref(false) const varianceLoading = ref(false)
const filterType = ref('all') const filterType = ref('all')
@ -830,9 +828,18 @@ const stats = computed(() => {
}) })
const varianceList = computed(() => { const varianceList = computed(() => {
return allData.value.filter(i => return allData.value
!i.scanned || (i.scanned && i.qty_actual !== parseFloat(i.qty_stock as any)) .filter(i => !i.scanned || (i.scanned && i.qty_actual !== parseFloat(i.qty_stock as any)))
) .map(i => ({
...i,
// 映射字段名以匹配模板
stock_name: i.name,
stock_spec: i.standard,
stock_location: i.location || i.warehouse_loc || '',
stock_qty: i.qty_stock,
quantity: i.qty_actual,
diff_qty: i.qty_actual - parseFloat(i.qty_stock as any)
}))
}) })
const openInventoryList = () => { showList.value = true } const openInventoryList = () => { showList.value = true }
@ -872,15 +879,9 @@ const finishStocktake = async () => {
const openVarianceDialog = async () => { const openVarianceDialog = async () => {
varianceLoading.value = true varianceLoading.value = true
showVarianceDialog.value = true showVarianceDialog.value = true
try { // varianceList 已通过 computed 自动计算,无需额外 API 调用
const res: any = await api.getVarianceReport()
varianceList.value = res.list || []
} catch (e: any) {
ElMessage.error(e?.message || '获取差异报告失败')
} finally {
varianceLoading.value = false varianceLoading.value = false
} }
}
// ★ 新增: 确认平账 // ★ 新增: 确认平账
const handleAdjust = async (row: any) => { const handleAdjust = async (row: any) => {