import request from '@/utils/http' function normalizeText(value) { return typeof value === 'string' ? value.trim() : value } function filterParams(params = {}, ignoredKeys = []) { return Object.fromEntries( Object.entries(params) .filter(([key, value]) => { if (ignoredKeys.includes(key)) return false if (value === undefined || value === null) return false if (typeof value === 'string' && value.trim() === '') return false return true }) .map(([key, value]) => [key, normalizeText(value)]) ) } export function buildCheckOutBoundPageParams(params = {}) { return { current: params.current || 1, pageSize: params.pageSize || params.size || 20, ...filterParams(params, ['current', 'pageSize', 'size']) } } export function fetchCheckOutBoundPage(params = {}) { return request.post({ url: '/locItem/useO/page', params: buildCheckOutBoundPageParams(params) }) } export function fetchGetCheckOutBoundDetail(id) { return request.get({ url: `/locItem/${id}` }) } export function fetchCheckOutBoundSites() { return request.get({ url: '/check/tasks/sites' }) } export function fetchGenerateCheckOutBoundTask(payload = {}) { return request.post({ url: '/locItem/check/task', params: payload }) }