gm-printer 10.37.3-beta.2 → 10.38.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.37.3-beta.2",
3
+ "version": "10.38.0",
4
4
  "description": "diy printer",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -39,14 +39,7 @@ class Store extends EditorStore {
39
39
  return {
40
40
  dataKey: this.defaultTableDataKey,
41
41
  subtotal: { show: false },
42
- columns: [
43
- {
44
- head: i18next.t('表头'),
45
- text: i18next.t('{{列.表头}}'),
46
- style: { textAlign: 'center' },
47
- headStyle: { textAlign: 'center' }
48
- }
49
- ]
42
+ columns: DEFAULT_TABLE_COLUMNS
50
43
  }
51
44
  }
52
45
 
@@ -58,6 +51,9 @@ class Store extends EditorStore {
58
51
 
59
52
  @action.bound
60
53
  addContent(name, index, type, tableConfig = null) {
54
+ if (type === 'table' && !tableConfig) {
55
+ tableConfig = this.getDefaultTableConfig()
56
+ }
61
57
  super.addContent(name, index, type, tableConfig)
62
58
  this.config = toJS(this.config)
63
59
  }
package/src/index.js CHANGED
@@ -3,7 +3,7 @@ import '../locales'
3
3
  import Editor, { Editor2 } from './editor'
4
4
 
5
5
  import EditorPurchase from './editor_purchase'
6
- import EditorExaminingReport from './examining_report_editor'
6
+ import examiningReportEditor from './examining_report_editor'
7
7
  import EditorStockIn from './editor_stockin'
8
8
  import EditorStockOut from './editor_stockout'
9
9
  import EditorSettle from './editor_settle'
@@ -33,7 +33,7 @@ export {
33
33
  EditorStockIn,
34
34
  EditorStockOut,
35
35
  EditorPurchase,
36
- EditorExaminingReport,
36
+ examiningReportEditor,
37
37
  EditorSettle,
38
38
  EditorStatement,
39
39
  EditorAccoutStatement,
@@ -20,7 +20,13 @@ class BatchPrinter extends React.Component {
20
20
  const { list } = this.props
21
21
 
22
22
  return _.map(list, ({ config, data }, i) => (
23
- <Printer key={i} data={data} config={config} onReady={this.handleReady} />
23
+ <Printer
24
+ key={i}
25
+ data={data}
26
+ config={config}
27
+ onReady={this.handleReady}
28
+ isLast={i === list.length - 1}
29
+ />
24
30
  ))
25
31
  }
26
32
  }
@@ -374,6 +374,7 @@ class Printer extends React.Component {
374
374
  onReady,
375
375
  selectedRegion,
376
376
  printerStore,
377
+ isLast,
377
378
  ...rest
378
379
  } = this.props
379
380
  const {
@@ -390,7 +391,8 @@ class Printer extends React.Component {
390
391
  className={classNames('gm-printer', className)}
391
392
  style={Object.assign({}, style, {
392
393
  width,
393
- breakAfter: batchPrintConfig === 2 ? 'auto' : 'always'
394
+ breakAfter: batchPrintConfig === 2 || isLast ? 'auto' : 'always',
395
+ pageBreakAfter: batchPrintConfig === 2 || isLast ? 'auto' : 'always'
394
396
  })}
395
397
  >
396
398
  {this.doRender()}
@@ -552,8 +552,7 @@ class PrinterStore {
552
552
  dataKey !== 'purchase_detail_one_row' &&
553
553
  dataKey !== 'purchase_independent_rol_sku' &&
554
554
  dataKey !== 'purchase_independent_rol_address' &&
555
- dataKey !== 'taxRateSales' &&
556
- dataKey !== 'ordinary'
555
+ dataKey !== 'taxRateSales'
557
556
  ) {
558
557
  return null
559
558
  }