diff --git a/app/service/systemMethods/stock/transaction.js b/app/service/systemMethods/stock/transaction.js index f8c94e1..6dae504 100644 --- a/app/service/systemMethods/stock/transaction.js +++ b/app/service/systemMethods/stock/transaction.js @@ -38,6 +38,7 @@ class StockTransactionMethodService extends MainService { store_ids: storeIds, stock_ids: stockIds, keyword, + ids, transaction_type: transactionType, order_type: orderType, order_no: orderNo, @@ -67,6 +68,7 @@ class StockTransactionMethodService extends MainService { storeIds, stockIds, keyword, + ids, transactionType, orderType, orderNo, @@ -109,6 +111,7 @@ class StockTransactionMethodService extends MainService { stock_ids: stockIdsRaw, stock_id: stockIdRaw, keyword, + ids, transaction_type: transactionType, order_type: orderType, order_no: orderNo, @@ -148,6 +151,7 @@ class StockTransactionMethodService extends MainService { warehouseIds, stockIds, keyword, + ids, transactionType, orderType, orderNo, @@ -178,6 +182,7 @@ class StockTransactionMethodService extends MainService { store_ids: storeIds, stock_ids: stockIds, keyword, + ids, transaction_type: transactionType, order_type: orderType, order_no: orderNo, @@ -223,6 +228,7 @@ class StockTransactionMethodService extends MainService { storeIds, stockIds, keyword, + ids, transactionType, orderType, orderNo, @@ -284,6 +290,7 @@ class StockTransactionMethodService extends MainService { stock_ids: stockIdsRaw, stock_id: stockIdRaw, keyword, + ids, transaction_type: transactionType, order_type: orderType, order_no: orderNo, @@ -337,6 +344,7 @@ class StockTransactionMethodService extends MainService { warehouseIds, stockIds, keyword, + ids, transactionType, orderType, orderNo, diff --git a/app/service/systems/stock_transaction.js b/app/service/systems/stock_transaction.js index a339123..110c9d3 100644 --- a/app/service/systems/stock_transaction.js +++ b/app/service/systems/stock_transaction.js @@ -400,6 +400,7 @@ class StockTransactionService extends Service { warehouseIds, stockIds: rawStockIds, keyword, + ids, transactionType, orderType, orderNo, @@ -482,6 +483,15 @@ class StockTransactionService extends Service { replacements.stockIds = normalizedStockIds; } + // 记录ID筛选(精确导出选中记录) + const normalizedIds = Array.isArray(ids) + ? ids.map(item => Number(item)).filter(item => Number.isInteger(item) && item > 0) + : []; + if (normalizedIds.length > 0) { + whereClauses.push('t.id IN (:ids)'); + replacements.ids = normalizedIds; + } + // 流水类型 if (transactionType) { whereClauses.push('t.transaction_type = :transactionType'); @@ -644,6 +654,7 @@ class StockTransactionService extends Service { warehouseIds, stockIds: rawStockIds, keyword, + ids, transactionType, orderType, orderNo, @@ -722,6 +733,15 @@ class StockTransactionService extends Service { replacements.stockIds = normalizedStockIds; } + // 记录ID筛选(精确导出选中记录) + const normalizedIds = Array.isArray(ids) + ? ids.map(item => Number(item)).filter(item => Number.isInteger(item) && item > 0) + : []; + if (normalizedIds.length > 0) { + whereClauses.push('t.id IN (:ids)'); + replacements.ids = normalizedIds; + } + if (transactionType) { whereClauses.push('t.transaction_type = :transactionType'); replacements.transactionType = String(transactionType).trim();