gm-printer 10.41.1 → 10.41.3-beta.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-printer",
3
- "version": "10.41.1",
3
+ "version": "10.41.3-beta.0",
4
4
  "description": "diy printer",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -0,0 +1,35 @@
1
+ /**
2
+ * 模板 table.dataKey 前缀工具。
3
+ * 采购模板:purchase_*;分拣明细模板:sorting_detail_*(后缀与采购一致)。
4
+ */
5
+ export const SORTING_DETAIL_PREFIX = 'sorting_detail_'
6
+ export const PURCHASE_PREFIX = 'purchase_'
7
+
8
+ export function getDataKeyPrefix(dataKey) {
9
+ if (dataKey?.startsWith(SORTING_DETAIL_PREFIX)) return SORTING_DETAIL_PREFIX
10
+ return PURCHASE_PREFIX
11
+ }
12
+
13
+ export function getDataKeySuffix(dataKey) {
14
+ if (!dataKey || typeof dataKey !== 'string') return ''
15
+ return dataKey.replace(/^(sorting_detail_|purchase_)/, '')
16
+ }
17
+
18
+ export function buildDataKey(prefix, suffix) {
19
+ return `${prefix}${suffix}`
20
+ }
21
+
22
+ /** 下拉选中「按明细单行」时的 value(detail_one_row) */
23
+ export function isDetailOneRowSelectKey(dataKey) {
24
+ return getDataKeySuffix(dataKey) === 'detail_one_row'
25
+ }
26
+
27
+ export function isIndependentRolDataKey(dataKey) {
28
+ const suffix = getDataKeySuffix(dataKey)
29
+ return suffix === 'independent_rol_sku' || suffix === 'independent_rol_address'
30
+ }
31
+
32
+ export function isLastColDataKey(dataKey) {
33
+ const suffix = getDataKeySuffix(dataKey)
34
+ return suffix === 'last_col' || suffix === 'last_col_noLineBreak'
35
+ }
@@ -19,7 +19,7 @@ import {
19
19
  } from '../common/component'
20
20
  import { get, toJS } from 'mobx'
21
21
  import PropTypes from 'prop-types'
22
- import { subtotalRadioList } from './util'
22
+ import { subtotalRadioList, overallOrderRadioList } from './util'
23
23
  import { LONG_PRINT } from '../config'
24
24
  import _ from 'lodash'
25
25
 
@@ -207,8 +207,15 @@ class EditorField extends React.Component {
207
207
  tableDataKeyList,
208
208
  editStore,
209
209
  isSomeSubtotalTr,
210
- mergeClassificationAndLabel
210
+ mergeClassificationAndLabel,
211
+ editFieldConfig = {}
211
212
  } = this.props
213
+ // 业务侧可通过 editFieldConfig 隐藏配送单专属配置;未传则默认全部展示(兼容旧逻辑)
214
+ const showCategory = editFieldConfig.category !== false
215
+ const showCategorySubtotal = editFieldConfig.categorySubtotal !== false
216
+ const showPageSubtotal = editFieldConfig.pageSubtotal !== false
217
+ const showDiyPageSubtotal = editFieldConfig.diyPageSubtotal !== false
218
+ const showOverallOrder = editFieldConfig.overallOrder !== false
212
219
  const { head, headStyle, text, style } = editStore.computedSelectedInfo
213
220
  const { config } = editStore
214
221
  const isLongPrint = config?.page?.type === LONG_PRINT
@@ -216,12 +223,25 @@ class EditorField extends React.Component {
216
223
  specialConfig,
217
224
  subtotal,
218
225
  overallOrder,
219
- diyOverallOrder
226
+ diyOverallOrder,
227
+ diySubtotal
220
228
  } = editStore.computedTableSpecialConfig
221
229
 
230
+ // 与预览区右键开关联动:未开启时不展示对应编辑配置(避免「点不动却占位」)
231
+ const pageSubtotalEnabled = !!subtotal?.show
232
+ const diyPageSubtotalEnabled = !!diySubtotal?.show
233
+ const overallOrderEnabled = !!overallOrder?.show
234
+ const diyOverallOrderEnabled = !!diyOverallOrder?.show
235
+
222
236
  // 新分类
223
237
  const categoryStyle =
224
238
  toJS(editStore.computedTableSpecialConfig)?.categoryConfig?.style || {}
239
+ // 当前表格 dataKey tokens,用于判断商品分类/商品三级分类是否开启
240
+ const tableKeyArr = (
241
+ editStore.computedTableSpecialConfig?.dataKey || ''
242
+ ).split('_')
243
+ const isNewCategoryOn = tableKeyArr.includes('newCategory')
244
+ const isNewCategory3On = tableKeyArr.includes('newCategory3')
225
245
  // 小计样式,specialConfig可能是undefined
226
246
  const specialStyle =
227
247
  toJS(editStore.computedTableSpecialConfig)?.specialConfig?.style || {}
@@ -246,13 +266,18 @@ class EditorField extends React.Component {
246
266
  get(subtotal, 'isUpperLowerCaseSeparate')) ||
247
267
  false
248
268
  // 每页合计样式
249
- const overallOrderStyle =
250
- (overallOrder && overallOrder?.fields[0].style) || {}
269
+ // 兼容 overallOrder 无 fields 的模板(如仅存 {show:false}),链式取值避免渲染崩溃
270
+ const overallOrderStyle = overallOrder?.fields?.[0]?.style || {}
251
271
  // 每页合计自定义单元格
252
272
  const subtotalUpperCustomCell =
253
273
  (editStore.computedTableSpecialConfig?.subtotal &&
254
274
  get(subtotal, 'isCustomCells')) ||
255
275
  false
276
+ // 每页合计单元格拆分展示(与自定义单元格互斥的新配置)
277
+ const subtotalSplitCell =
278
+ (editStore.computedTableSpecialConfig?.subtotal &&
279
+ get(subtotal, 'isSplitCells')) ||
280
+ false
256
281
 
257
282
  // 打印账户总计金额
258
283
  const printAccount =
@@ -477,211 +502,256 @@ class EditorField extends React.Component {
477
502
  />
478
503
  <Gap />
479
504
 
480
- {!mergeClassificationAndLabel && (
505
+ {!mergeClassificationAndLabel &&
506
+ (showCategory || showCategorySubtotal) && (
507
+ <>
508
+ {showCategory && (
509
+ <Flex>
510
+ <Flex>{i18next.t('分类设置')}:</Flex>
511
+ <Fonter
512
+ style={categoryStyle}
513
+ onChange={this.handleCategoryStyleChange}
514
+ />
515
+ <Separator />
516
+ <TextAlign
517
+ style={categoryStyle}
518
+ onChange={this.handleCategoryStyleChange}
519
+ />
520
+ </Flex>
521
+ )}
522
+
523
+ {showCategorySubtotal && (
524
+ <>
525
+ <Flex>
526
+ <Flex>{i18next.t('小计设置')}:</Flex>
527
+ <Fonter
528
+ style={specialStyle}
529
+ onChange={this.handleSpecialStyleChange}
530
+ />
531
+ <Separator />
532
+ <TextAlign
533
+ style={specialStyle}
534
+ onChange={this.handleSpecialStyleChange}
535
+ />
536
+ </Flex>
537
+ <EditorSubtotalCheck
538
+ subtotalCheckDisabled
539
+ subtotalChecked={specialTrNeedUpperCase}
540
+ subtotalCheckOnChange={editStore.setSpecialUpperCase}
541
+ subtotalCheckText='显示大写金额'
542
+ />
543
+ </>
544
+ )}
545
+ </>
546
+ )}
547
+
548
+ {showPageSubtotal && pageSubtotalEnabled && (
481
549
  <>
482
550
  <Flex>
483
- <Flex>{i18next.t('分类设置')}:</Flex>
551
+ <Flex>{i18next.t('每页合计设置')}:</Flex>
484
552
  <Fonter
485
- style={categoryStyle}
486
- onChange={this.handleCategoryStyleChange}
553
+ style={subtotalStyle}
554
+ onChange={this.handleSubtotalStyleChange}
487
555
  />
488
556
  <Separator />
489
557
  <TextAlign
490
- style={categoryStyle}
491
- onChange={this.handleCategoryStyleChange}
558
+ style={subtotalStyle}
559
+ onChange={this.handleSubtotalStyleChange}
492
560
  />
493
561
  </Flex>
562
+ <Gap />
563
+ {!isSomeSubtotalTr && (
564
+ <div>
565
+ <Flex>{i18next.t('合计栏打印金额')}:</Flex>
566
+ <Flex style={{ marginLeft: 57 }} wrap>
567
+ {subtotalRadioList.map(fields => {
568
+ // 兼容
569
+ let subtotalFields = subtotal?.fields?.[0].valueField
570
+ if (subtotalFields === 'total_item_price')
571
+ subtotalFields = '下单金额'
572
+ if (
573
+ subtotalFields === 'real_item_price' ||
574
+ !subtotal?.fields?.[0].valueField
575
+ )
576
+ subtotalFields = '出库金额'
577
+ return (
578
+ <Radio
579
+ style={{ marginLeft: 5 }}
580
+ id={fields.id}
581
+ value={fields.value}
582
+ key={fields.id}
583
+ inputName='subtotalRadio'
584
+ checked={subtotalFields === fields.id}
585
+ radioChecked={() =>
586
+ editStore.subtotalRadioCheck(fields)
587
+ }
588
+ />
589
+ )
590
+ })}
591
+ </Flex>
592
+ </div>
593
+ )}
594
+ {/* 结款单不需要这个配置 */}
595
+ {!isSomeSubtotalTr && (
596
+ <EditorSubtotalCheck
597
+ subtotalCheckDisabled
598
+ subtotalChecked={printAccount}
599
+ subtotalCheckOnChange={editStore.setPrintAccount}
600
+ subtotalCheckText='打印账户总计金额'
601
+ />
602
+ )}
603
+ <EditorSubtotalCheck
604
+ subtotalCheckDisabled
605
+ subtotalChecked={subtotalNeedUpperCase}
606
+ subtotalCheckOnChange={editStore.setSubtotalUpperCase}
607
+ subtotalCheckText='显示大写金额'
608
+ />
609
+ {/* 结款单不需要这些配置 */}
610
+ {!isSomeSubtotalTr && (
611
+ <>
612
+ <EditorSubtotalCheck
613
+ subtotalCheckDisabled={subtotalNeedUpperCase}
614
+ subtotalChecked={subtotalUpperCaseBefore}
615
+ subtotalCheckOnChange={editStore.setSubtotalUpperCaseBefore}
616
+ subtotalCheckText='大写金额在前'
617
+ />
618
+ <EditorSubtotalCheck
619
+ subtotalCheckDisabled={subtotalNeedUpperCase}
620
+ subtotalChecked={subtotalUpperLowerCaseSeparate}
621
+ subtotalCheckOnChange={
622
+ editStore.setSubtotalUpperLowerCaseSeparate
623
+ }
624
+ subtotalCheckText='大、小写金额分左右两边展示'
625
+ />
626
+ <EditorSubtotalCheck
627
+ subtotalCheckDisabled
628
+ subtotalChecked={subtotalUpperCustomCell}
629
+ subtotalCheckOnChange={editStore.setSubtotalCustomCells}
630
+ subtotalCheckText='开启自定义单元格'
631
+ />
632
+ <Text
633
+ // 只有自定义单元格的valueField值是空的,以后自每页合计,记得加type,之前没加,都无法区分
634
+ value={
635
+ subtotal && subtotal?.fields?.length > 1
636
+ ? _.find(subtotal?.fields, item => !item.valueField)
637
+ ?.name ?? ''
638
+ : ''
639
+ }
640
+ onChange={editStore.setSubtotalFields}
641
+ style={{ width: '65px', margin: '5px 0 5px 80px' }}
642
+ />
643
+ {/* 单元格拆分展示:每页合计/数值拆分为两个单元格,与开启自定义单元格互斥(默认未选) */}
644
+ <EditorSubtotalCheck
645
+ subtotalCheckDisabled
646
+ subtotalChecked={subtotalSplitCell}
647
+ subtotalCheckOnChange={editStore.setSubtotalSplitCells}
648
+ subtotalCheckText={i18next.t('单元格拆分展示')}
649
+ />
650
+ {/* 左侧文案修改:默认"每页合计",允许为空,每页合计统一展示输入框内容 */}
651
+ <Flex style={{ margin: '5px 0 5px 62px' }} alignCenter>
652
+ <EditorText
653
+ label={i18next.t('左侧文案修改')}
654
+ value={subtotal?.fields?.[0]?.name ?? ''}
655
+ // Text 组件的 onChange 实际收到事件对象(handleChange 被 spread 覆盖),需自行取 e.target.value
656
+ onChange={e =>
657
+ editStore.setSubtotalLeftText(e.target.value)
658
+ }
659
+ />
660
+ </Flex>
661
+ </>
662
+ )}
663
+ </>
664
+ )}
494
665
 
666
+ {showDiyPageSubtotal &&
667
+ diyPageSubtotalEnabled &&
668
+ this.renderDiySummaryEditor({
669
+ label: '自定义每页合计',
670
+ placeholder: '请输入要每页合计字段',
671
+ showConfigKey: 'showDiySubtotal',
672
+ configKey: 'diySubtotal',
673
+ editStore
674
+ })}
675
+
676
+ {showOverallOrder && overallOrderEnabled && (
677
+ <>
495
678
  <Flex>
496
- <Flex>{i18next.t('小计设置')}:</Flex>
679
+ <Flex>{i18next.t('整单合计')}:</Flex>
497
680
  <Fonter
498
- style={specialStyle}
499
- onChange={this.handleSpecialStyleChange}
681
+ style={overallOrderStyle}
682
+ onChange={this.handleOverallOrderStyleChange}
500
683
  />
501
684
  <Separator />
502
685
  <TextAlign
503
- style={specialStyle}
504
- onChange={this.handleSpecialStyleChange}
686
+ style={overallOrderStyle}
687
+ onChange={this.handleOverallOrderStyleChange}
505
688
  />
506
689
  </Flex>
507
690
  <EditorSubtotalCheck
508
691
  subtotalCheckDisabled
509
- subtotalChecked={specialTrNeedUpperCase}
510
- subtotalCheckOnChange={editStore.setSpecialUpperCase}
511
- subtotalCheckText='显示大写金额'
692
+ subtotalChecked={overallOrder?.showEachPage !== false}
693
+ subtotalCheckOnChange={editStore.setOverallOrderShowEachPage}
694
+ subtotalCheckText='每页展示'
512
695
  />
513
- </>
514
- )}
515
-
516
- <Flex>
517
- <Flex>{i18next.t('每页合计设置')}:</Flex>
518
- <Fonter
519
- style={subtotalStyle}
520
- onChange={this.handleSubtotalStyleChange}
521
- />
522
- <Separator />
523
- <TextAlign
524
- style={subtotalStyle}
525
- onChange={this.handleSubtotalStyleChange}
526
- />
527
- </Flex>
528
- <Gap />
529
- {!isSomeSubtotalTr && (
530
- <div>
531
- <Flex>{i18next.t('合计栏打印金额')}:</Flex>
532
- <Flex style={{ marginLeft: 57 }}>
533
- {subtotalRadioList.map(fields => {
534
- // 兼容
535
- let subtotalFields = subtotal?.fields?.[0].valueField
536
- if (subtotalFields === 'total_item_price')
537
- subtotalFields = '下单金额'
538
- if (
539
- subtotalFields === 'real_item_price' ||
540
- !subtotal?.fields?.[0].valueField
541
- )
542
- subtotalFields = '出库金额'
696
+ <Flex style={{ marginLeft: 57 }} wrap>
697
+ {overallOrderRadioList.map((fields, i) => {
543
698
  return (
544
699
  <Radio
545
700
  style={{ marginLeft: 5 }}
546
- id={fields.id}
701
+ id={`${fields.id}${i}`}
547
702
  value={fields.value}
548
703
  key={fields.id}
549
- inputName='subtotalRadio'
550
- checked={subtotalFields === fields.id}
551
- radioChecked={() => editStore.subtotalRadioCheck(fields)}
704
+ inputName='overallOrderRadio'
705
+ checked={
706
+ (overallOrder?.fields?.[0]?.valueField ?? '出库金额') ===
707
+ fields.id
708
+ }
709
+ radioChecked={() =>
710
+ editStore.setOverallOrderValueField(fields)
711
+ }
552
712
  />
553
713
  )
554
714
  })}
555
715
  </Flex>
556
- </div>
557
- )}
558
- {/* 结款单不需要这个配置 */}
559
- {!isSomeSubtotalTr && (
560
- <EditorSubtotalCheck
561
- subtotalCheckDisabled
562
- subtotalChecked={printAccount}
563
- subtotalCheckOnChange={editStore.setPrintAccount}
564
- subtotalCheckText='打印账户总计金额'
565
- />
566
- )}
567
- <EditorSubtotalCheck
568
- subtotalCheckDisabled
569
- subtotalChecked={subtotalNeedUpperCase}
570
- subtotalCheckOnChange={editStore.setSubtotalUpperCase}
571
- subtotalCheckText='显示大写金额'
572
- />
573
- {/* 结款单不需要这些配置 */}
574
- {!isSomeSubtotalTr && (
575
- <>
576
716
  <EditorSubtotalCheck
577
- subtotalCheckDisabled={subtotalNeedUpperCase}
578
- subtotalChecked={subtotalUpperCaseBefore}
579
- subtotalCheckOnChange={editStore.setSubtotalUpperCaseBefore}
717
+ subtotalCheckDisabled
718
+ subtotalChecked={overallOrderNeedUpperCase}
719
+ subtotalCheckOnChange={editStore.setOverallOrderUpperCase}
720
+ subtotalCheckText='显示大写金额'
721
+ />
722
+ <EditorSubtotalCheck
723
+ subtotalCheckDisabled={overallOrderNeedUpperCase}
724
+ subtotalChecked={overallOrderCaseBefore}
725
+ subtotalCheckOnChange={editStore.setOverallOrderUpperCaseBefore}
580
726
  subtotalCheckText='大写金额在前'
581
727
  />
582
728
  <EditorSubtotalCheck
583
- subtotalCheckDisabled={subtotalNeedUpperCase}
584
- subtotalChecked={subtotalUpperLowerCaseSeparate}
729
+ subtotalCheckDisabled={overallOrderNeedUpperCase}
730
+ subtotalChecked={overallOrderUpperLowerCaseSeparate}
585
731
  subtotalCheckOnChange={
586
- editStore.setSubtotalUpperLowerCaseSeparate
732
+ editStore.setOverallOrderUpperLowerCaseSeparate
587
733
  }
588
734
  subtotalCheckText='大、小写金额分左右两边展示'
589
735
  />
590
736
  <EditorSubtotalCheck
591
737
  subtotalCheckDisabled
592
- subtotalChecked={subtotalUpperCustomCell}
593
- subtotalCheckOnChange={editStore.setSubtotalCustomCells}
738
+ subtotalChecked={overallOrderUpperCustomCell}
739
+ subtotalCheckOnChange={editStore.setOverallOrderCustomCells}
594
740
  subtotalCheckText='开启自定义单元格'
595
741
  />
596
742
  <Text
597
- // 只有自定义单元格的valueField值是空的,以后自每页合计,记得加type,之前没加,都无法区分
598
743
  value={
599
- subtotal && subtotal?.fields?.length > 1
600
- ? _.find(subtotal?.fields, item => !item.valueField)?.name ??
601
- ''
744
+ overallOrder && overallOrder?.fields?.[1]
745
+ ? overallOrder.fields[1].name
602
746
  : ''
603
747
  }
604
- onChange={editStore.setSubtotalFields}
748
+ onChange={editStore.setOverallOrderFields}
605
749
  style={{ width: '65px', margin: '5px 0 5px 80px' }}
606
750
  />
607
751
  </>
608
752
  )}
609
-
610
- {this.renderDiySummaryEditor({
611
- label: '自定义每页合计',
612
- placeholder: '请输入要每页合计字段',
613
- showConfigKey: 'showDiySubtotal',
614
- configKey: 'diySubtotal',
615
- editStore
616
- })}
617
-
618
- <Flex>
619
- <Flex>{i18next.t('整单合计')}:</Flex>
620
- <Fonter
621
- style={overallOrderStyle}
622
- onChange={this.handleOverallOrderStyleChange}
623
- />
624
- <Separator />
625
- <TextAlign
626
- style={overallOrderStyle}
627
- onChange={this.handleOverallOrderStyleChange}
628
- />
629
- </Flex>
630
- <Flex style={{ marginLeft: 57 }}>
631
- {subtotalRadioList.map((fields, i) => {
632
- return (
633
- <Radio
634
- style={{ marginLeft: 5 }}
635
- id={`${fields.id}${i}`}
636
- value={fields.value}
637
- key={fields.id}
638
- inputName='overallOrderRadio'
639
- checked={
640
- (overallOrder?.fields?.[0]?.valueField ?? '出库金额') ===
641
- fields.id
642
- }
643
- radioChecked={() => editStore.setOverallOrderValueField(fields)}
644
- />
645
- )
646
- })}
647
- </Flex>
648
- <EditorSubtotalCheck
649
- subtotalCheckDisabled
650
- subtotalChecked={overallOrderNeedUpperCase}
651
- subtotalCheckOnChange={editStore.setOverallOrderUpperCase}
652
- subtotalCheckText='显示大写金额'
653
- />
654
- <EditorSubtotalCheck
655
- subtotalCheckDisabled={overallOrderNeedUpperCase}
656
- subtotalChecked={overallOrderCaseBefore}
657
- subtotalCheckOnChange={editStore.setOverallOrderUpperCaseBefore}
658
- subtotalCheckText='大写金额在前'
659
- />
660
- <EditorSubtotalCheck
661
- subtotalCheckDisabled={overallOrderNeedUpperCase}
662
- subtotalChecked={overallOrderUpperLowerCaseSeparate}
663
- subtotalCheckOnChange={
664
- editStore.setOverallOrderUpperLowerCaseSeparate
665
- }
666
- subtotalCheckText='大、小写金额分左右两边展示'
667
- />
668
- <EditorSubtotalCheck
669
- subtotalCheckDisabled
670
- subtotalChecked={overallOrderUpperCustomCell}
671
- subtotalCheckOnChange={editStore.setOverallOrderCustomCells}
672
- subtotalCheckText='开启自定义单元格'
673
- />
674
- <Text
675
- value={
676
- overallOrder && overallOrder?.fields?.[1]
677
- ? overallOrder.fields[1].name
678
- : ''
679
- }
680
- onChange={editStore.setOverallOrderFields}
681
- style={{ width: '65px', margin: '5px 0 5px 80px' }}
682
- />
683
- {/* 自定义整单合计 */}
684
- {editStore.config.showDiyOverAllOrder && (
753
+ {/* 自定义整单合计:能力开关 showDiyOverAllOrder + 预览区已开启 */}
754
+ {editStore.config.showDiyOverAllOrder && diyOverallOrderEnabled && (
685
755
  <Flex>
686
756
  <Flex>{i18next.t('自定义整单合计')}:</Flex>
687
757
  <div>
@@ -766,6 +836,23 @@ class EditorField extends React.Component {
766
836
  </div>
767
837
  </Flex>
768
838
  )}
839
+ {/* 分类/三级分类设置:选中商品分类或商品三级分类时展示,控制标题行字体及位置(共用 categoryConfig) */}
840
+ {mergeClassificationAndLabel && (isNewCategoryOn || isNewCategory3On) && (
841
+ <>
842
+ <Flex>{i18next.t('分类/三级分类设置')}:</Flex>
843
+ <Flex style={{ marginLeft: 57 }}>
844
+ <Fonter
845
+ style={categoryStyle}
846
+ onChange={this.handleCategoryStyleChange}
847
+ />
848
+ <Separator />
849
+ <TextAlign
850
+ style={categoryStyle}
851
+ onChange={this.handleCategoryStyleChange}
852
+ />
853
+ </Flex>
854
+ </>
855
+ )}
769
856
  {mergeClassificationAndLabel && (
770
857
  <>
771
858
  <Flex>{i18next.t('分类/标签小计')}:</Flex>
@@ -780,11 +867,11 @@ class EditorField extends React.Component {
780
867
  style={specialStyle}
781
868
  onChange={this.handleClassificationAndLabelTally}
782
869
  />
783
- <Flex style={{ marginLeft: 0 }}>
870
+ <Flex style={{ marginLeft: 0 }} wrap>
784
871
  {subtotalRadioList.map((fields, i) => {
785
872
  return (
786
873
  <Radio
787
- style={{ marginLeft: 5 }}
874
+ style={{ marginLeft: 5, marginBottom: 4 }}
788
875
  id={`${fields.id}_${i}`}
789
876
  value={fields.value}
790
877
  key={fields.id}
@@ -835,6 +922,29 @@ class EditorField extends React.Component {
835
922
  subtotalCheckText='大、小写金额分左右两边展示'
836
923
  marginLeft
837
924
  />
925
+ {/* 显示分类名称:选中时小计行展示"分类名+小计文案",未选中只展示"小计文案"(默认选中) */}
926
+ <EditorSubtotalCheck
927
+ subtotalCheckDisabled
928
+ subtotalChecked={
929
+ editStore.computedTableSpecialConfig?.specialConfig
930
+ ?.showCategoryName ?? true
931
+ }
932
+ subtotalCheckOnChange={editStore.setShowCategoryName}
933
+ subtotalCheckText={i18next.t('显示分类名称')}
934
+ marginLeft
935
+ />
936
+ {/* 小计文案修改:默认"小计",允许为空 */}
937
+ <Flex style={{ margin: '5px 0 5px 17px' }} alignCenter>
938
+ <EditorText
939
+ label={i18next.t('小计文案修改')}
940
+ value={
941
+ editStore.computedTableSpecialConfig?.specialConfig
942
+ ?.subtotalText ?? '小计'
943
+ }
944
+ // Text 组件的 onChange 实际收到事件对象(handleChange 被 spread 覆盖),需自行取 e.target.value
945
+ onChange={e => editStore.setSubtotalText(e.target.value)}
946
+ />
947
+ </Flex>
838
948
  </div>
839
949
  </Flex>
840
950
 
@@ -985,10 +1095,16 @@ EditorField.propTypes = {
985
1095
  tableDataKeyList: PropTypes.array,
986
1096
  showNewDate: PropTypes.bool,
987
1097
  isSomeSubtotalTr: PropTypes.bool,
988
- mergeClassificationAndLabel: PropTypes.bool
1098
+ mergeClassificationAndLabel: PropTypes.bool,
1099
+ /**
1100
+ * 控制「编辑字段」区各配置块显隐。未传 / 某项不为 false 时保持展示(默认兼容配送单)。
1101
+ * 可选 key:category / categorySubtotal / pageSubtotal / diyPageSubtotal / overallOrder
1102
+ */
1103
+ editFieldConfig: PropTypes.object
989
1104
  }
990
1105
  EditorField.defaultProps = {
991
- showNewDate: false
1106
+ showNewDate: false,
1107
+ editFieldConfig: {}
992
1108
  }
993
1109
 
994
1110
  class EditorSubtotalCheck extends React.Component {