imeik-bizui 2.6.9 → 2.7.1

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
 
@@ -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);无底部关闭按钮,右上角关闭即可
@@ -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: {
@@ -199,6 +198,24 @@ function buildSections(data = {}) {
199
198
  return sections
200
199
  }
201
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
+
202
219
  /**
203
220
  * getProductPriceDetail data → DetailDialog
204
221
  */
@@ -206,16 +223,11 @@ export function normalizeDetail(data = {}, options = {}) {
206
223
  // 详情标题优先接口 customName,其次外部传入 / customerName 兼容字段
207
224
  const customerName =
208
225
  data.customName || options.customerName || data.customerName || ''
209
- const overviewProducts = options.overviewProducts
210
- const summaryRows =
211
- Array.isArray(overviewProducts) && overviewProducts.length
212
- ? overviewProducts
213
- : listOverviewProducts(data.productBasePriceList)
214
226
 
215
227
  return {
216
228
  title: customerName ? `底价明细 · ${customerName}` : '底价明细',
217
229
  summaryColumns: summaryColumns(),
218
- summaryRows,
230
+ summaryRows: resolveDetailSummaryRows(data, options),
219
231
  sections: buildSections(data),
220
232
  formulas: DEFAULT_DETAIL_FORMULAS
221
233
  }
@@ -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 (