gm-printer 10.41.1 → 10.41.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-printer",
3
- "version": "10.41.1",
3
+ "version": "10.41.2",
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,9 +223,16 @@ 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 || {}
@@ -477,211 +491,235 @@ class EditorField extends React.Component {
477
491
  />
478
492
  <Gap />
479
493
 
480
- {!mergeClassificationAndLabel && (
494
+ {!mergeClassificationAndLabel && (showCategory || showCategorySubtotal) && (
495
+ <>
496
+ {showCategory && (
497
+ <Flex>
498
+ <Flex>{i18next.t('分类设置')}:</Flex>
499
+ <Fonter
500
+ style={categoryStyle}
501
+ onChange={this.handleCategoryStyleChange}
502
+ />
503
+ <Separator />
504
+ <TextAlign
505
+ style={categoryStyle}
506
+ onChange={this.handleCategoryStyleChange}
507
+ />
508
+ </Flex>
509
+ )}
510
+
511
+ {showCategorySubtotal && (
512
+ <>
513
+ <Flex>
514
+ <Flex>{i18next.t('小计设置')}:</Flex>
515
+ <Fonter
516
+ style={specialStyle}
517
+ onChange={this.handleSpecialStyleChange}
518
+ />
519
+ <Separator />
520
+ <TextAlign
521
+ style={specialStyle}
522
+ onChange={this.handleSpecialStyleChange}
523
+ />
524
+ </Flex>
525
+ <EditorSubtotalCheck
526
+ subtotalCheckDisabled
527
+ subtotalChecked={specialTrNeedUpperCase}
528
+ subtotalCheckOnChange={editStore.setSpecialUpperCase}
529
+ subtotalCheckText='显示大写金额'
530
+ />
531
+ </>
532
+ )}
533
+ </>
534
+ )}
535
+
536
+ {showPageSubtotal && pageSubtotalEnabled && (
481
537
  <>
482
538
  <Flex>
483
- <Flex>{i18next.t('分类设置')}:</Flex>
539
+ <Flex>{i18next.t('每页合计设置')}:</Flex>
484
540
  <Fonter
485
- style={categoryStyle}
486
- onChange={this.handleCategoryStyleChange}
541
+ style={subtotalStyle}
542
+ onChange={this.handleSubtotalStyleChange}
487
543
  />
488
544
  <Separator />
489
545
  <TextAlign
490
- style={categoryStyle}
491
- onChange={this.handleCategoryStyleChange}
546
+ style={subtotalStyle}
547
+ onChange={this.handleSubtotalStyleChange}
492
548
  />
493
549
  </Flex>
550
+ <Gap />
551
+ {!isSomeSubtotalTr && (
552
+ <div>
553
+ <Flex>{i18next.t('合计栏打印金额')}:</Flex>
554
+ <Flex style={{ marginLeft: 57 }} wrap>
555
+ {subtotalRadioList.map(fields => {
556
+ // 兼容
557
+ let subtotalFields = subtotal?.fields?.[0].valueField
558
+ if (subtotalFields === 'total_item_price')
559
+ subtotalFields = '下单金额'
560
+ if (
561
+ subtotalFields === 'real_item_price' ||
562
+ !subtotal?.fields?.[0].valueField
563
+ )
564
+ subtotalFields = '出库金额'
565
+ return (
566
+ <Radio
567
+ style={{ marginLeft: 5 }}
568
+ id={fields.id}
569
+ value={fields.value}
570
+ key={fields.id}
571
+ inputName='subtotalRadio'
572
+ checked={subtotalFields === fields.id}
573
+ radioChecked={() => editStore.subtotalRadioCheck(fields)}
574
+ />
575
+ )
576
+ })}
577
+ </Flex>
578
+ </div>
579
+ )}
580
+ {/* 结款单不需要这个配置 */}
581
+ {!isSomeSubtotalTr && (
582
+ <EditorSubtotalCheck
583
+ subtotalCheckDisabled
584
+ subtotalChecked={printAccount}
585
+ subtotalCheckOnChange={editStore.setPrintAccount}
586
+ subtotalCheckText='打印账户总计金额'
587
+ />
588
+ )}
589
+ <EditorSubtotalCheck
590
+ subtotalCheckDisabled
591
+ subtotalChecked={subtotalNeedUpperCase}
592
+ subtotalCheckOnChange={editStore.setSubtotalUpperCase}
593
+ subtotalCheckText='显示大写金额'
594
+ />
595
+ {/* 结款单不需要这些配置 */}
596
+ {!isSomeSubtotalTr && (
597
+ <>
598
+ <EditorSubtotalCheck
599
+ subtotalCheckDisabled={subtotalNeedUpperCase}
600
+ subtotalChecked={subtotalUpperCaseBefore}
601
+ subtotalCheckOnChange={editStore.setSubtotalUpperCaseBefore}
602
+ subtotalCheckText='大写金额在前'
603
+ />
604
+ <EditorSubtotalCheck
605
+ subtotalCheckDisabled={subtotalNeedUpperCase}
606
+ subtotalChecked={subtotalUpperLowerCaseSeparate}
607
+ subtotalCheckOnChange={
608
+ editStore.setSubtotalUpperLowerCaseSeparate
609
+ }
610
+ subtotalCheckText='大、小写金额分左右两边展示'
611
+ />
612
+ <EditorSubtotalCheck
613
+ subtotalCheckDisabled
614
+ subtotalChecked={subtotalUpperCustomCell}
615
+ subtotalCheckOnChange={editStore.setSubtotalCustomCells}
616
+ subtotalCheckText='开启自定义单元格'
617
+ />
618
+ <Text
619
+ // 只有自定义单元格的valueField值是空的,以后自每页合计,记得加type,之前没加,都无法区分
620
+ value={
621
+ subtotal && subtotal?.fields?.length > 1
622
+ ? _.find(subtotal?.fields, item => !item.valueField)
623
+ ?.name ?? ''
624
+ : ''
625
+ }
626
+ onChange={editStore.setSubtotalFields}
627
+ style={{ width: '65px', margin: '5px 0 5px 80px' }}
628
+ />
629
+ </>
630
+ )}
631
+ </>
632
+ )}
633
+
634
+ {showDiyPageSubtotal &&
635
+ diyPageSubtotalEnabled &&
636
+ this.renderDiySummaryEditor({
637
+ label: '自定义每页合计',
638
+ placeholder: '请输入要每页合计字段',
639
+ showConfigKey: 'showDiySubtotal',
640
+ configKey: 'diySubtotal',
641
+ editStore
642
+ })}
494
643
 
644
+ {showOverallOrder && overallOrderEnabled && (
645
+ <>
495
646
  <Flex>
496
- <Flex>{i18next.t('小计设置')}:</Flex>
647
+ <Flex>{i18next.t('整单合计')}:</Flex>
497
648
  <Fonter
498
- style={specialStyle}
499
- onChange={this.handleSpecialStyleChange}
649
+ style={overallOrderStyle}
650
+ onChange={this.handleOverallOrderStyleChange}
500
651
  />
501
652
  <Separator />
502
653
  <TextAlign
503
- style={specialStyle}
504
- onChange={this.handleSpecialStyleChange}
654
+ style={overallOrderStyle}
655
+ onChange={this.handleOverallOrderStyleChange}
505
656
  />
506
657
  </Flex>
507
658
  <EditorSubtotalCheck
508
659
  subtotalCheckDisabled
509
- subtotalChecked={specialTrNeedUpperCase}
510
- subtotalCheckOnChange={editStore.setSpecialUpperCase}
511
- subtotalCheckText='显示大写金额'
660
+ subtotalChecked={overallOrder?.showEachPage !== false}
661
+ subtotalCheckOnChange={editStore.setOverallOrderShowEachPage}
662
+ subtotalCheckText='每页展示'
512
663
  />
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 = '出库金额'
664
+ <Flex style={{ marginLeft: 57 }} wrap>
665
+ {overallOrderRadioList.map((fields, i) => {
543
666
  return (
544
667
  <Radio
545
668
  style={{ marginLeft: 5 }}
546
- id={fields.id}
669
+ id={`${fields.id}${i}`}
547
670
  value={fields.value}
548
671
  key={fields.id}
549
- inputName='subtotalRadio'
550
- checked={subtotalFields === fields.id}
551
- radioChecked={() => editStore.subtotalRadioCheck(fields)}
672
+ inputName='overallOrderRadio'
673
+ checked={
674
+ (overallOrder?.fields?.[0]?.valueField ?? '出库金额') ===
675
+ fields.id
676
+ }
677
+ radioChecked={() =>
678
+ editStore.setOverallOrderValueField(fields)
679
+ }
552
680
  />
553
681
  )
554
682
  })}
555
683
  </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
684
  <EditorSubtotalCheck
577
- subtotalCheckDisabled={subtotalNeedUpperCase}
578
- subtotalChecked={subtotalUpperCaseBefore}
579
- subtotalCheckOnChange={editStore.setSubtotalUpperCaseBefore}
685
+ subtotalCheckDisabled
686
+ subtotalChecked={overallOrderNeedUpperCase}
687
+ subtotalCheckOnChange={editStore.setOverallOrderUpperCase}
688
+ subtotalCheckText='显示大写金额'
689
+ />
690
+ <EditorSubtotalCheck
691
+ subtotalCheckDisabled={overallOrderNeedUpperCase}
692
+ subtotalChecked={overallOrderCaseBefore}
693
+ subtotalCheckOnChange={editStore.setOverallOrderUpperCaseBefore}
580
694
  subtotalCheckText='大写金额在前'
581
695
  />
582
696
  <EditorSubtotalCheck
583
- subtotalCheckDisabled={subtotalNeedUpperCase}
584
- subtotalChecked={subtotalUpperLowerCaseSeparate}
697
+ subtotalCheckDisabled={overallOrderNeedUpperCase}
698
+ subtotalChecked={overallOrderUpperLowerCaseSeparate}
585
699
  subtotalCheckOnChange={
586
- editStore.setSubtotalUpperLowerCaseSeparate
700
+ editStore.setOverallOrderUpperLowerCaseSeparate
587
701
  }
588
702
  subtotalCheckText='大、小写金额分左右两边展示'
589
703
  />
590
704
  <EditorSubtotalCheck
591
705
  subtotalCheckDisabled
592
- subtotalChecked={subtotalUpperCustomCell}
593
- subtotalCheckOnChange={editStore.setSubtotalCustomCells}
706
+ subtotalChecked={overallOrderUpperCustomCell}
707
+ subtotalCheckOnChange={editStore.setOverallOrderCustomCells}
594
708
  subtotalCheckText='开启自定义单元格'
595
709
  />
596
710
  <Text
597
- // 只有自定义单元格的valueField值是空的,以后自每页合计,记得加type,之前没加,都无法区分
598
711
  value={
599
- subtotal && subtotal?.fields?.length > 1
600
- ? _.find(subtotal?.fields, item => !item.valueField)?.name ??
601
- ''
712
+ overallOrder && overallOrder?.fields?.[1]
713
+ ? overallOrder.fields[1].name
602
714
  : ''
603
715
  }
604
- onChange={editStore.setSubtotalFields}
716
+ onChange={editStore.setOverallOrderFields}
605
717
  style={{ width: '65px', margin: '5px 0 5px 80px' }}
606
718
  />
607
719
  </>
608
720
  )}
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 && (
721
+ {/* 自定义整单合计:能力开关 showDiyOverAllOrder + 预览区已开启 */}
722
+ {editStore.config.showDiyOverAllOrder && diyOverallOrderEnabled && (
685
723
  <Flex>
686
724
  <Flex>{i18next.t('自定义整单合计')}:</Flex>
687
725
  <div>
@@ -780,11 +818,11 @@ class EditorField extends React.Component {
780
818
  style={specialStyle}
781
819
  onChange={this.handleClassificationAndLabelTally}
782
820
  />
783
- <Flex style={{ marginLeft: 0 }}>
821
+ <Flex style={{ marginLeft: 0 }} wrap>
784
822
  {subtotalRadioList.map((fields, i) => {
785
823
  return (
786
824
  <Radio
787
- style={{ marginLeft: 5 }}
825
+ style={{ marginLeft: 5, marginBottom: 4 }}
788
826
  id={`${fields.id}_${i}`}
789
827
  value={fields.value}
790
828
  key={fields.id}
@@ -985,10 +1023,16 @@ EditorField.propTypes = {
985
1023
  tableDataKeyList: PropTypes.array,
986
1024
  showNewDate: PropTypes.bool,
987
1025
  isSomeSubtotalTr: PropTypes.bool,
988
- mergeClassificationAndLabel: PropTypes.bool
1026
+ mergeClassificationAndLabel: PropTypes.bool,
1027
+ /**
1028
+ * 控制「编辑字段」区各配置块显隐。未传 / 某项不为 false 时保持展示(默认兼容配送单)。
1029
+ * 可选 key:category / categorySubtotal / pageSubtotal / diyPageSubtotal / overallOrder
1030
+ */
1031
+ editFieldConfig: PropTypes.object
989
1032
  }
990
1033
  EditorField.defaultProps = {
991
- showNewDate: false
1034
+ showNewDate: false,
1035
+ editFieldConfig: {}
992
1036
  }
993
1037
 
994
1038
  class EditorSubtotalCheck extends React.Component {
@@ -4,6 +4,12 @@ import { pageTypeMap } from '../config'
4
4
  import _ from 'lodash'
5
5
  import { dispatchMsg, getBlockName, exchange, getColSpanLength } from '../util'
6
6
  import { accountRadioList } from './util'
7
+ import {
8
+ buildDataKey,
9
+ getDataKeyPrefix,
10
+ isDetailOneRowSelectKey,
11
+ isIndependentRolDataKey,
12
+ } from './data_key_util'
7
13
  import React from 'react'
8
14
  import { createDiySummaryStoreMethods } from './diy_summary_helper'
9
15
 
@@ -773,6 +779,10 @@ class EditorStore {
773
779
  set(table.overallOrder, {
774
780
  show: !table.overallOrder.show
775
781
  })
782
+ // 老模板补默认:每页展示默认勾选
783
+ if (table.overallOrder.showEachPage === undefined) {
784
+ set(table.overallOrder, { showEachPage: true })
785
+ }
776
786
  table.overallOrder.fields[0].colSpan =
777
787
  colSpanLength - (table.overallOrder.fields?.[1]?.colSpan ?? 0)
778
788
  } else {
@@ -780,6 +790,7 @@ class EditorStore {
780
790
  set(table, {
781
791
  overallOrder: {
782
792
  show: true,
793
+ showEachPage: true,
783
794
  fields: [
784
795
  {
785
796
  name: '整单合计:',
@@ -796,6 +807,19 @@ class EditorStore {
796
807
  this.config = toJS(this.config)
797
808
  }
798
809
 
810
+ // 整单合计「每页展示」
811
+ @action.bound
812
+ setOverallOrderShowEachPage() {
813
+ if (!this.selectedRegion) return
814
+ const arr = this.selectedRegion.split('.')
815
+ const table = this.config.contents[arr[2]]
816
+ if (!table?.overallOrder) return
817
+ this.overallOrderShow = !this.overallOrderShow
818
+ const next = !(table.overallOrder.showEachPage !== false)
819
+ set(table.overallOrder, { showEachPage: next })
820
+ this.config = toJS(this.config)
821
+ }
822
+
799
823
  @action
800
824
  setDiyOverallOrderShow(name) {
801
825
  const arr = name.split('.')
@@ -1251,16 +1275,17 @@ class EditorStore {
1251
1275
  const table = this.config.contents[arr[2]]
1252
1276
 
1253
1277
  const getDataKey = () => {
1254
- if (dataKey === 'purchase_detail_one_row') {
1278
+ if (isDetailOneRowSelectKey(dataKey)) {
1255
1279
  if (!table.purchaseSettingKey) {
1256
1280
  this.setPurchasePrintSettingKey()
1257
1281
  return dataKey
1258
1282
  }
1283
+ const prefix = getDataKeyPrefix(dataKey)
1259
1284
  if (table.purchaseSettingKey === 'goods') {
1260
- return 'purchase_independent_rol_sku'
1285
+ return buildDataKey(prefix, 'independent_rol_sku')
1261
1286
  }
1262
1287
  if (table.purchaseSettingKey === 'merchant') {
1263
- return 'purchase_independent_rol_address'
1288
+ return buildDataKey(prefix, 'independent_rol_address')
1264
1289
  }
1265
1290
  }
1266
1291
  return dataKey
@@ -1280,15 +1305,15 @@ class EditorStore {
1280
1305
  @action.bound setPurchasePrintSettingKey(dataKey = 'goods') {
1281
1306
  const arr = this.selectedRegion.split('.')
1282
1307
  const table = this.config.contents[arr[2]]
1308
+ const prefix = getDataKeyPrefix(table.dataKey)
1283
1309
 
1284
1310
  set(table, {
1285
1311
  purchaseSettingKey: dataKey,
1286
1312
  dataKey:
1287
1313
  dataKey === 'goods'
1288
- ? 'purchase_independent_rol_sku'
1289
- : 'purchase_independent_rol_address',
1290
- // 切换打印设置时,重置明细行排序为默认值(候选值列表会变化)
1291
- detail_sort_type: 0
1314
+ ? buildDataKey(prefix, 'independent_rol_sku')
1315
+ : buildDataKey(prefix, 'independent_rol_address'),
1316
+ detail_sort_type: 0,
1292
1317
  })
1293
1318
  }
1294
1319
 
@@ -1309,11 +1334,8 @@ class EditorStore {
1309
1334
  const table = this.config.contents[arr[2]]
1310
1335
 
1311
1336
  const { dataKey } = table
1312
- if (
1313
- dataKey === 'purchase_independent_rol_sku' ||
1314
- dataKey === 'purchase_independent_rol_address'
1315
- ) {
1316
- return 'purchase_detail_one_row'
1337
+ if (isIndependentRolDataKey(dataKey)) {
1338
+ return buildDataKey(getDataKeyPrefix(dataKey), 'detail_one_row')
1317
1339
  }
1318
1340
  return dataKey
1319
1341
  }
@@ -1819,6 +1841,7 @@ class EditorStore {
1819
1841
  set(table, {
1820
1842
  overallOrder: {
1821
1843
  show: true,
1844
+ showEachPage: true,
1822
1845
  fields: [
1823
1846
  {
1824
1847
  name: '整单合计:',