imeik-bizui 2.6.9 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -396,14 +396,21 @@ export default {
396
396
  return rows.slice(start, start + size)
397
397
  },
398
398
  formatCell(value, col = {}) {
399
- if (col.type === 'number' || col.digits != null) {
400
- return formatNumber(value, { digits: col.digits != null ? col.digits : 2, fallback: '-' })
399
+ if (col.type === 'number' || col.type === 'highlight' || col.digits != null) {
400
+ // 与看板一致:不强制小数位,保留接口原值精度
401
+ return formatNumber(value, {
402
+ digits: col.digits != null ? col.digits : null,
403
+ fallback: '-'
404
+ })
401
405
  }
402
406
  if (value === undefined || value === null || value === '') return '-'
403
407
  return String(value)
404
408
  },
405
409
  formatGapCell(value, col = {}) {
406
- return formatSignedNumber(value, { digits: col.digits != null ? col.digits : 0, fallback: '-' })
410
+ return formatSignedNumber(value, {
411
+ digits: col.digits != null ? col.digits : null,
412
+ fallback: '-'
413
+ })
407
414
  },
408
415
  gapClass(value, row) {
409
416
  const n = Number(value != null ? value : row && row.gap)
@@ -98,18 +98,17 @@ export function normalizeOverview(data = {}, options = {}) {
98
98
  function summaryColumns() {
99
99
  return [
100
100
  { prop: 'name', label: '产品', minWidth: 110, fixed: 'left' },
101
- { prop: 'beforePrice', label: '当前底价', type: 'number', digits: 0, minWidth: 88, align: 'right' },
102
- { prop: 'afterPrice', label: '申请后底价', type: 'number', digits: 0, minWidth: 96, align: 'right', bold: true },
103
- { prop: 'standard', label: '标准底价', type: 'number', digits: 0, minWidth: 88, align: 'right' },
104
- { prop: 'gap', label: '差距', type: 'gap', digits: 1, minWidth: 80, align: 'right' },
105
- { prop: 'orderAmount', label: '订单金额', type: 'number', digits: 0, minWidth: 96, align: 'right' },
106
- { prop: 'nonSalesFee', label: '非销售促进费', type: 'number', digits: 0, minWidth: 110, align: 'right' },
107
- { prop: 'spentFee', label: '已花费用', type: 'number', digits: 0, minWidth: 88, align: 'right' },
101
+ { prop: 'beforePrice', label: '当前底价', type: 'number', minWidth: 88, align: 'right' },
102
+ { prop: 'afterPrice', label: '申请后底价', type: 'number', minWidth: 96, align: 'right', bold: true },
103
+ { prop: 'standard', label: '标准底价', type: 'number', minWidth: 88, align: 'right' },
104
+ { prop: 'gap', label: '差距', type: 'gap', minWidth: 80, align: 'right' },
105
+ { prop: 'orderAmount', label: '订单金额', type: 'number', minWidth: 96, align: 'right' },
106
+ { prop: 'nonSalesFee', label: '非销售促进费', type: 'number', minWidth: 110, align: 'right' },
107
+ { prop: 'spentFee', label: '已花费用', type: 'number', minWidth: 88, align: 'right' },
108
108
  {
109
109
  prop: 'currentAllocation',
110
110
  label: '本次分摊',
111
111
  type: 'highlight',
112
- digits: 0,
113
112
  minWidth: 88,
114
113
  align: 'right',
115
114
  highlightTone: 'current'
@@ -144,7 +143,7 @@ function buildSections(data = {}) {
144
143
  { prop: 'productName', label: '产品', minWidth: 100 },
145
144
  { prop: 'saleTypeLabel', label: '类型', width: 64 },
146
145
  { prop: 'qty', label: '数量', align: 'right', width: 56 },
147
- { prop: 'amount', label: '金额', type: 'number', digits: 0, align: 'right', width: 96 }
146
+ { prop: 'amount', label: '金额', type: 'number', align: 'right', width: 96 }
148
147
  ],
149
148
  rows: saleRows,
150
149
  footer: {
@@ -164,7 +163,7 @@ function buildSections(data = {}) {
164
163
  { prop: 'orderNum', label: '出库单号', minWidth: 140 },
165
164
  { prop: 'productName', label: '产品', minWidth: 100 },
166
165
  { prop: 'qty', label: '数量', align: 'right', width: 56 },
167
- { prop: 'amount', label: '折算费用', type: 'number', digits: 0, align: 'right', width: 96 }
166
+ { prop: 'amount', label: '折算费用', type: 'number', align: 'right', width: 96 }
168
167
  ],
169
168
  rows: nonSaleRows,
170
169
  footer: {
@@ -186,7 +185,7 @@ function buildSections(data = {}) {
186
185
  columns: [
187
186
  { prop: 'bizOrderCode', label: '单号', minWidth: 120 },
188
187
  { prop: 'costType', label: '类型', minWidth: 88 },
189
- { prop: 'costAmount', label: '金额', type: 'number', digits: 0, align: 'right', width: 96 }
188
+ { prop: 'costAmount', label: '金额', type: 'number', align: 'right', width: 96 }
190
189
  ],
191
190
  rows: expenseRows,
192
191
  footer: {
@@ -23,14 +23,14 @@ export function formatMoney(value, { digits = null, fallback = '-' } = {}) {
23
23
  return `¥ ${body}`
24
24
  }
25
25
 
26
- /** 带正负号的差距展示,如 -23.6 / +3.1 */
27
- export function formatSignedNumber(value, { digits = 1, fallback = '-' } = {}) {
26
+ /** 带正负号的差距展示,如 -23.68 / +3.1;digits 默认 null 保留原精度 */
27
+ export function formatSignedNumber(value, { digits = null, fallback = '-' } = {}) {
28
28
  if (value === undefined || value === null || value === '') return fallback
29
29
  const n = Number(value)
30
30
  if (Number.isNaN(n)) return String(value)
31
31
  const abs = Math.abs(n)
32
32
  const body =
33
- digits === null
33
+ digits === null || digits === undefined
34
34
  ? abs.toLocaleString('zh-CN')
35
35
  : abs.toLocaleString('zh-CN', {
36
36
  minimumFractionDigits: digits,
@@ -46,8 +46,9 @@ export function formatSignedNumber(value, { digits = 1, fallback = '-' } = {}) {
46
46
  * - gap < 0 → 低于底价 / 禁止;文案「低 N 元/支」
47
47
  * - gap > 0 → 通过;文案「高 N 元/支」
48
48
  * - gap = 0 → 持平
49
+ * digits 默认 null,与看板金额一致不强制取整
49
50
  */
50
- export function computePriceGap(afterPrice, standard, { digits = 0 } = {}) {
51
+ export function computePriceGap(afterPrice, standard, { digits = null } = {}) {
51
52
  const after = Number(afterPrice)
52
53
  const std = Number(standard)
53
54
  if (