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