imeik-bizui 2.7.0 → 2.7.2

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.
@@ -59,7 +59,7 @@ bizui: scene 选接口 → Dashboard 拉数 → Board / Detail
59
59
  | 物资入参 | `customUniqueCode`、`businessLineNumber`、`isGroupCustomer`、`applyDeptCode`、`costBearDeptCode`、`costType`、`materialList[]`(允许 `[]`) |
60
60
  | 会议入参 | `meetTypeCode`、`meetFormJson`、`customUniqueCode`、`forceRefresh`;`meetCode` 有值才传 |
61
61
  | 申请中心入参 | 见丽臻底价接口文档 |
62
- | 展示 | 看板 `normalizeOverview`;三端 **data 同形**;明细顶部汇总取概览;**差距 = 申请后 − 标准(前端算)** |
62
+ | 展示 | 看板 `normalizeOverview`;三端 **data 同形**;明细顶部汇总优先 `basePriceOverview`,无则回退概览;**差距 = 申请后 − 标准(前端算)** |
63
63
 
64
64
  ---
65
65
 
@@ -242,9 +242,10 @@ export default {
242
242
  type: Boolean,
243
243
  default: false
244
244
  },
245
+ /** 价格/金额小数位,默认两位 */
245
246
  numberDigits: {
246
247
  type: Number,
247
- default: null
248
+ default: 2
248
249
  },
249
250
  maxColumns: {
250
251
  type: Number,
@@ -308,7 +309,7 @@ export default {
308
309
  },
309
310
  applyTotalFeeText() {
310
311
  if (this.applyTotalFee == null || this.applyTotalFee === '') return ''
311
- return `${formatNumber(this.applyTotalFee)} 元`
312
+ return `${formatNumber(this.applyTotalFee, { digits: this.numberDigits })} 元`
312
313
  },
313
314
  yearText() {
314
315
  if (this.year == null || this.year === '') return ''
@@ -169,7 +169,7 @@ export default {
169
169
  return normalizeDetail(raw, {
170
170
  // 优先接口 customName(在 normalizeDetail 内读取);prop / 概览作兜底
171
171
  customerName: this.customerName || this.board.customerName,
172
- // 顶部汇总取概览产品行(与看板同源),明细接口只负责三区列表
172
+ // 顶部汇总优先 detail.basePriceOverview;无该字段时回退概览产品行
173
173
  overviewProducts: this.board.products
174
174
  })
175
175
  },
@@ -1,6 +1,6 @@
1
1
  <!--
2
2
  通用「底价明细」弹窗(纯展示,无接口依赖)
3
- - 顶部汇总:由 Dashboard 传入概览产品行
3
+ - 顶部汇总:优先详情 basePriceOverview,无则回退 Dashboard 传入的概览产品行
4
4
  - 下方三区(销售订单 / 非销出库 / 销售费用)等分三列并排
5
5
  - 三列卡片等高:表格固定高度按 pageSize 撑开,合计底对齐
6
6
  - 分区数据前端分页(pageSize);无底部关闭按钮,右上角关闭即可
@@ -397,9 +397,9 @@ export default {
397
397
  },
398
398
  formatCell(value, col = {}) {
399
399
  if (col.type === 'number' || col.type === 'highlight' || col.digits != null) {
400
- // 与看板一致:不强制小数位,保留接口原值精度
400
+ // 价格/金额统一两位小数;数量列勿标 type:number,或显式 digits:null
401
401
  return formatNumber(value, {
402
- digits: col.digits != null ? col.digits : null,
402
+ digits: col.digits != null ? col.digits : 2,
403
403
  fallback: '-'
404
404
  })
405
405
  }
@@ -408,7 +408,7 @@ export default {
408
408
  },
409
409
  formatGapCell(value, col = {}) {
410
410
  return formatSignedNumber(value, {
411
- digits: col.digits != null ? col.digits : null,
411
+ digits: col.digits != null ? col.digits : 2,
412
412
  fallback: '-'
413
413
  })
414
414
  },
@@ -149,7 +149,7 @@ function buildSections(data = {}) {
149
149
  footer: {
150
150
  label: '合计(含本次)',
151
151
  theme: 'purple',
152
- values: [`金额 ${formatNumber(sumBy(saleRows, 'amount'))}`]
152
+ values: [`金额 ${formatNumber(sumBy(saleRows, 'amount'), { digits: 2 })}`]
153
153
  }
154
154
  })
155
155
  }
@@ -171,7 +171,7 @@ function buildSections(data = {}) {
171
171
  theme: 'danger',
172
172
  values: [
173
173
  `数量 ${formatNumber(sumBy(nonSaleRows, 'qty'))}`,
174
- `折算费用 ${formatNumber(sumBy(nonSaleRows, 'amount'))}`
174
+ `折算费用 ${formatNumber(sumBy(nonSaleRows, 'amount'), { digits: 2 })}`
175
175
  ]
176
176
  }
177
177
  })
@@ -191,13 +191,31 @@ function buildSections(data = {}) {
191
191
  footer: {
192
192
  label: '合计(含本次)',
193
193
  theme: 'danger',
194
- values: [formatNumber(sumBy(expenseRows, 'costAmount'))]
194
+ values: [formatNumber(sumBy(expenseRows, 'costAmount'), { digits: 2 })]
195
195
  }
196
196
  })
197
197
  }
198
198
  return sections
199
199
  }
200
200
 
201
+ /**
202
+ * 明细顶部汇总产品行:
203
+ * 1. 优先详情接口新增的 basePriceOverview.productBasePriceList
204
+ * 2. 其次外部传入的概览产品行(看板同源)
205
+ * 3. 最后兼容详情根上的 productBasePriceList
206
+ */
207
+ function resolveDetailSummaryRows(data = {}, options = {}) {
208
+ const embedded = data.basePriceOverview
209
+ if (embedded && Array.isArray(embedded.productBasePriceList)) {
210
+ return listOverviewProducts(embedded.productBasePriceList)
211
+ }
212
+ const overviewProducts = options.overviewProducts
213
+ if (Array.isArray(overviewProducts) && overviewProducts.length) {
214
+ return overviewProducts
215
+ }
216
+ return listOverviewProducts(data.productBasePriceList)
217
+ }
218
+
201
219
  /**
202
220
  * getProductPriceDetail data → DetailDialog
203
221
  */
@@ -205,16 +223,11 @@ export function normalizeDetail(data = {}, options = {}) {
205
223
  // 详情标题优先接口 customName,其次外部传入 / customerName 兼容字段
206
224
  const customerName =
207
225
  data.customName || options.customerName || data.customerName || ''
208
- const overviewProducts = options.overviewProducts
209
- const summaryRows =
210
- Array.isArray(overviewProducts) && overviewProducts.length
211
- ? overviewProducts
212
- : listOverviewProducts(data.productBasePriceList)
213
226
 
214
227
  return {
215
228
  title: customerName ? `底价明细 · ${customerName}` : '底价明细',
216
229
  summaryColumns: summaryColumns(),
217
- summaryRows,
230
+ summaryRows: resolveDetailSummaryRows(data, options),
218
231
  sections: buildSections(data),
219
232
  formulas: DEFAULT_DETAIL_FORMULAS
220
233
  }
@@ -16,15 +16,15 @@ export function formatNumber(value, { digits = null, fallback = '-' } = {}) {
16
16
  })
17
17
  }
18
18
 
19
- /** 金额带 ¥,如 ¥ 860 */
20
- export function formatMoney(value, { digits = null, fallback = '-' } = {}) {
19
+ /** 金额带 ¥,如 ¥ 800.00;价格/金额默认保留两位小数 */
20
+ export function formatMoney(value, { digits = 2, fallback = '-' } = {}) {
21
21
  const body = formatNumber(value, { digits, fallback: null })
22
22
  if (body == null) return fallback
23
23
  return `¥ ${body}`
24
24
  }
25
25
 
26
- /** 带正负号的差距展示,如 -23.68 / +3.1;digits 默认 null 保留原精度 */
27
- export function formatSignedNumber(value, { digits = null, fallback = '-' } = {}) {
26
+ /** 带正负号的差距展示,如 -23.68 / +3.10;金额默认两位小数 */
27
+ export function formatSignedNumber(value, { digits = 2, 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)
@@ -46,9 +46,9 @@ export function formatSignedNumber(value, { digits = null, fallback = '-' } = {}
46
46
  * - gap < 0 → 低于底价 / 禁止;文案「低 N 元/支」
47
47
  * - gap > 0 → 通过;文案「高 N 元/支」
48
48
  * - gap = 0 → 持平
49
- * digits 默认 null,与看板金额一致不强制取整
49
+ * digits 默认 2,与看板/明细金额展示一致
50
50
  */
51
- export function computePriceGap(afterPrice, standard, { digits = null } = {}) {
51
+ export function computePriceGap(afterPrice, standard, { digits = 2 } = {}) {
52
52
  const after = Number(afterPrice)
53
53
  const std = Number(standard)
54
54
  if (