zhou zhou
5 天以前 aaf8a50511d77dbc209ca93bbba308c21179a8bc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
export const STATISTIC_COUNT_REPORT_TITLE = '日出入库汇总统计'
 
export function createStatisticCountSearchState() {
  return {
    condition: '',
    dayTime: '',
    matnrCode: '',
    maktx: '',
    batch: ''
  }
}
 
export function buildStatisticCountPageQueryParams(params = {}) {
  const values = {
    condition: params.condition,
    dayTime: params.dayTime,
    matnrCode: params.matnrCode,
    maktx: params.maktx,
    batch: params.batch
  }
 
  return Object.entries(values).reduce(
    (result, [key, value]) => {
      if (value === undefined || value === null) {
        return result
      }
      if (typeof value === 'string') {
        const normalized = value.trim()
        if (!normalized) {
          return result
        }
        result[key] = normalized
        return result
      }
      result[key] = value
      return result
    },
    {
      current: Number(params.current) || 1,
      pageSize: Number(params.pageSize || params.size) || 20
    }
  )
}
 
export function normalizeStatisticCountRow(row = {}) {
  return {
    ...row,
    count: Number(row.count || 0),
    anfme: Number(row.anfme || 0),
    inAnfmeCount: Number(row.inAnfmeCount || 0),
    outAnfmeCount: Number(row.outAnfmeCount || 0),
    inAnfme: Number(row.inAnfme || 0),
    outAnfme: Number(row.outAnfme || 0)
  }
}