gm-printer 10.14.1-alpha.6 → 10.14.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.
- package/.eslintcache +1 -1
- package/package.json +1 -1
- package/src/common/editor_store.js +6 -6
- package/src/editor_purchase/context_menu.js +0 -1
- package/src/editor_settle/context_menu.js +1 -0
- package/src/finance_voucher/components/finance_batch_printer.js +36 -0
- package/src/finance_voucher/components/table.js +343 -0
- package/src/finance_voucher/components/table_subtotal_tr.js +147 -0
- package/src/finance_voucher/finance_printer.js +312 -0
- package/src/index.js +4 -2
- package/src/printer/do_print.js +35 -4
- package/src/printer/index.js +8 -2
- package/src/printer/page.js +7 -3
- package/src/printer/printer.js +3 -1
- package/src/printer/store.js +74 -1
- package/src/printer/style.lesss +4 -0
- package/src/printer/table.js +6 -2
- package/src/printer/table_subtotal_tr.js +80 -50
- package/src/util.js +6 -3
package/.eslintcache
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/table.js":"1","/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/store.js":"2","/Users/yancheng/gm/gm-open-source/gm-printer/src/editor/editor.js":"3","/Users/yancheng/gm/gm-open-source/gm-printer/src/editor/context_menu.js":"4","/Users/yancheng/gm/gm-open-source/gm-printer/src/components/tooltip/index.js":"5","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/common_context_menu.js":"6","/Users/yancheng/gm/gm-open-source/gm-printer/src/util.js":"7","/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/printer.js":"8","/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/do_print.js":"9","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_special_field.js":"10","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/hoc_with_store.js":"11","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/hoc_with_shadow_dom.js":"12","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_title.js":"13","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_store.js":"14","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_add_field.js":"15","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_page_summary.js":"16","/Users/yancheng/gm/gm-open-source/gm-printer/src/editor_account/editor.js":"17","/Users/yancheng/gm/gm-open-source/gm-printer/src/editor_account/context_menu.js":"18","/Users/yancheng/gm/gm-open-source/gm-printer/src/editor_purchase/context_menu.js":"19","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_customize_config.js":"20","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_edit_field.js":"21","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/component.js":"22","/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/panel.js":"23"},{"size":9379,"mtime":1643448762149,"results":"24","hashOfConfig":"25"},{"size":15630,"mtime":1647251452872,"results":"26","hashOfConfig":"25"},{"size":4244,"mtime":1635494969691,"results":"27","hashOfConfig":"25"},{"size":4501,"mtime":1646970942704,"results":"28","hashOfConfig":"25"},{"size":616,"mtime":1621235314060,"results":"29","hashOfConfig":"30"},{"size":9693,"mtime":1621242097206,"results":"31","hashOfConfig":"30"},{"size":7258,"mtime":1639037857730,"results":"32","hashOfConfig":"25"},{"size":10283,"mtime":1646979851812,"results":"33","hashOfConfig":"25"},{"size":3119,"mtime":1634191808754,"results":"34","hashOfConfig":"25"},{"size":1113,"mtime":1635407660514,"results":"35","hashOfConfig":"25"},{"size":4349,"mtime":1646815933499,"results":"36","hashOfConfig":"25"},{"size":861,"mtime":1635246075403,"results":"37","hashOfConfig":"25"},{"size":3260,"mtime":1635334661529,"results":"38","hashOfConfig":"25"},{"size":26478,"mtime":1647251348368,"results":"39","hashOfConfig":"25"},{"size":1907,"mtime":1635492860490,"results":"40","hashOfConfig":"25"},{"size":3548,"mtime":1635409410379,"results":"41","hashOfConfig":"25"},{"size":2989,"mtime":1635495718901,"results":"42","hashOfConfig":"25"},{"size":3399,"mtime":1646816404368,"results":"43","hashOfConfig":"25"},{"size":2456,"mtime":1646721857196,"results":"44","hashOfConfig":"25"},{"size":1159,"mtime":1646970893747,"results":"45","hashOfConfig":"25"},{"size":13280,"mtime":1646901618757,"results":"46","hashOfConfig":"25"},{"size":14804,"mtime":1646895235712,"results":"47","hashOfConfig":"25"},{"size":3005,"mtime":1647228414919,"results":"48","hashOfConfig":"25"},{"filePath":"49","messages":"50","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1j0d8vf",{"filePath":"51","messages":"52","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"53","messages":"54","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"55","messages":"56","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"57","messages":"58","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"175njjo",{"filePath":"59","messages":"60","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"61","messages":"62","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"63","messages":"64","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"65","messages":"66","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"67","messages":"68","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"69","messages":"70","errorCount":3,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"71","messages":"72","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"73","messages":"74","errorCount":13,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"75","messages":"76","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"77","messages":"78","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"79","messages":"80","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"81","messages":"82","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"83","messages":"84","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"85","messages":"86","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"87","messages":"88","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"89","messages":"90","errorCount":1,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"91","messages":"92","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"93","messages":"94","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/table.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/store.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/editor/editor.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/editor/context_menu.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/components/tooltip/index.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/common_context_menu.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/util.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/printer.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/do_print.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_special_field.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/hoc_with_store.js",["95","96","97"],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/hoc_with_shadow_dom.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_title.js",["98","99","100","101","102","103","104","105","106","107","108","109","110"],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_store.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_add_field.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_page_summary.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/editor_account/editor.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/editor_account/context_menu.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/editor_purchase/context_menu.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_customize_config.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_edit_field.js",["111","112","113"],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/component.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/panel.js",[],{"ruleId":"114","severity":2,"message":"115","line":10,"column":29,"nodeType":"116","endLine":10,"endColumn":35},{"ruleId":"114","severity":2,"message":"117","line":10,"column":43,"nodeType":"116","endLine":10,"endColumn":51},{"ruleId":"114","severity":2,"message":"117","line":147,"column":63,"nodeType":"116","endLine":147,"endColumn":71},{"ruleId":"114","severity":2,"message":"118","line":47,"column":13,"nodeType":"119","messageId":"120","endLine":47,"endColumn":22},{"ruleId":"114","severity":2,"message":"121","line":48,"column":30,"nodeType":"116","messageId":"120","endLine":48,"endColumn":36},{"ruleId":"114","severity":2,"message":"122","line":49,"column":31,"nodeType":"116","messageId":"120","endLine":49,"endColumn":47},{"ruleId":"114","severity":2,"message":"122","line":50,"column":21,"nodeType":"116","messageId":"120","endLine":50,"endColumn":37},{"ruleId":"114","severity":2,"message":"118","line":56,"column":13,"nodeType":"119","messageId":"120","endLine":56,"endColumn":22},{"ruleId":"114","severity":2,"message":"123","line":59,"column":20,"nodeType":"116","messageId":"120","endLine":59,"endColumn":32},{"ruleId":"114","severity":2,"message":"121","line":61,"column":23,"nodeType":"116","messageId":"120","endLine":61,"endColumn":29},{"ruleId":"114","severity":2,"message":"124","line":61,"column":30,"nodeType":"116","messageId":"120","endLine":61,"endColumn":34},{"ruleId":"114","severity":2,"message":"125","line":63,"column":15,"nodeType":"116","messageId":"120","endLine":63,"endColumn":19},{"ruleId":"114","severity":2,"message":"118","line":67,"column":23,"nodeType":"119","messageId":"120","endLine":67,"endColumn":32},{"ruleId":"114","severity":2,"message":"121","line":70,"column":32,"nodeType":"116","messageId":"120","endLine":70,"endColumn":38},{"ruleId":"114","severity":2,"message":"118","line":78,"column":13,"nodeType":"119","messageId":"120","endLine":78,"endColumn":22},{"ruleId":"114","severity":2,"message":"121","line":84,"column":42,"nodeType":"116","messageId":"120","endLine":84,"endColumn":48},{"ruleId":"126","severity":1,"message":"127","line":265,"column":13,"nodeType":"128","endLine":265,"endColumn":49},{"ruleId":"126","severity":1,"message":"127","line":283,"column":13,"nodeType":"128","endLine":283,"endColumn":56},{"ruleId":"129","severity":2,"message":"130","line":436,"column":22,"nodeType":"131","messageId":"132","endLine":436,"endColumn":31},"react/prop-types","'config' is missing in props validation","Identifier","'mockData' is missing in props validation","'editStore' is missing in props validation","Property","missingPropType","'editStore.config' is missing in props validation","'editStore.config.batchPrintConfig' is missing in props validation","'editStore.originConfig' is missing in props validation","'editStore.config.name' is missing in props validation","'editStore.init' is missing in props validation","react/jsx-handler-names","Handler function for onChange prop key must begin with 'handle'","JSXAttribute","gmfe/i18n-check","t函数的key只能为字符串常量(Literal),请使用单引号或双引号包裹","MemberExpression","isVariable"]
|
|
1
|
+
[{"/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/table.js":"1","/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/store.js":"2","/Users/yancheng/gm/gm-open-source/gm-printer/src/editor/editor.js":"3","/Users/yancheng/gm/gm-open-source/gm-printer/src/editor/context_menu.js":"4","/Users/yancheng/gm/gm-open-source/gm-printer/src/components/tooltip/index.js":"5","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/common_context_menu.js":"6","/Users/yancheng/gm/gm-open-source/gm-printer/src/util.js":"7","/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/printer.js":"8","/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/do_print.js":"9","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_special_field.js":"10","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/hoc_with_store.js":"11","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/hoc_with_shadow_dom.js":"12","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_title.js":"13","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_store.js":"14","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_add_field.js":"15","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_page_summary.js":"16","/Users/yancheng/gm/gm-open-source/gm-printer/src/editor_account/editor.js":"17","/Users/yancheng/gm/gm-open-source/gm-printer/src/editor_account/context_menu.js":"18","/Users/yancheng/gm/gm-open-source/gm-printer/src/editor_purchase/context_menu.js":"19","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_customize_config.js":"20","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_edit_field.js":"21","/Users/yancheng/gm/gm-open-source/gm-printer/src/common/component.js":"22","/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/panel.js":"23"},{"size":9379,"mtime":1643448762149,"results":"24","hashOfConfig":"25"},{"size":15785,"mtime":1647332608072,"results":"26","hashOfConfig":"25"},{"size":4244,"mtime":1635494969691,"results":"27","hashOfConfig":"25"},{"size":4501,"mtime":1646970942704,"results":"28","hashOfConfig":"25"},{"size":616,"mtime":1621235314060,"results":"29","hashOfConfig":"30"},{"size":9693,"mtime":1621242097206,"results":"31","hashOfConfig":"30"},{"size":7258,"mtime":1639037857730,"results":"32","hashOfConfig":"25"},{"size":10283,"mtime":1646979851812,"results":"33","hashOfConfig":"25"},{"size":3119,"mtime":1634191808754,"results":"34","hashOfConfig":"25"},{"size":1113,"mtime":1635407660514,"results":"35","hashOfConfig":"25"},{"size":4349,"mtime":1646815933499,"results":"36","hashOfConfig":"25"},{"size":861,"mtime":1635246075403,"results":"37","hashOfConfig":"25"},{"size":3260,"mtime":1635334661529,"results":"38","hashOfConfig":"25"},{"size":26478,"mtime":1647331538032,"results":"39","hashOfConfig":"25"},{"size":1907,"mtime":1635492860490,"results":"40","hashOfConfig":"25"},{"size":3548,"mtime":1635409410379,"results":"41","hashOfConfig":"25"},{"size":2989,"mtime":1635495718901,"results":"42","hashOfConfig":"25"},{"size":3399,"mtime":1646816404368,"results":"43","hashOfConfig":"25"},{"size":2456,"mtime":1646721857196,"results":"44","hashOfConfig":"25"},{"size":1159,"mtime":1646970893747,"results":"45","hashOfConfig":"25"},{"size":13280,"mtime":1646901618757,"results":"46","hashOfConfig":"25"},{"size":14804,"mtime":1646895235712,"results":"47","hashOfConfig":"25"},{"size":3005,"mtime":1647228414919,"results":"48","hashOfConfig":"25"},{"filePath":"49","messages":"50","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1j0d8vf",{"filePath":"51","messages":"52","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"53","messages":"54","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"55","messages":"56","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"57","messages":"58","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"175njjo",{"filePath":"59","messages":"60","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"61","messages":"62","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"63","messages":"64","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"65","messages":"66","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"67","messages":"68","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"69","messages":"70","errorCount":3,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"71","messages":"72","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"73","messages":"74","errorCount":13,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"75","messages":"76","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"77","messages":"78","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"79","messages":"80","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"81","messages":"82","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"83","messages":"84","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"85","messages":"86","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"87","messages":"88","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"89","messages":"90","errorCount":1,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"91","messages":"92","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"93","messages":"94","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/table.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/store.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/editor/editor.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/editor/context_menu.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/components/tooltip/index.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/common_context_menu.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/util.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/printer.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/do_print.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_special_field.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/hoc_with_store.js",["95","96","97"],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/hoc_with_shadow_dom.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_title.js",["98","99","100","101","102","103","104","105","106","107","108","109","110"],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_store.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_add_field.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_page_summary.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/editor_account/editor.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/editor_account/context_menu.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/editor_purchase/context_menu.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_customize_config.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/editor_edit_field.js",["111","112","113"],"/Users/yancheng/gm/gm-open-source/gm-printer/src/common/component.js",[],"/Users/yancheng/gm/gm-open-source/gm-printer/src/printer/panel.js",[],{"ruleId":"114","severity":2,"message":"115","line":10,"column":29,"nodeType":"116","endLine":10,"endColumn":35},{"ruleId":"114","severity":2,"message":"117","line":10,"column":43,"nodeType":"116","endLine":10,"endColumn":51},{"ruleId":"114","severity":2,"message":"117","line":147,"column":63,"nodeType":"116","endLine":147,"endColumn":71},{"ruleId":"114","severity":2,"message":"118","line":47,"column":13,"nodeType":"119","messageId":"120","endLine":47,"endColumn":22},{"ruleId":"114","severity":2,"message":"121","line":48,"column":30,"nodeType":"116","messageId":"120","endLine":48,"endColumn":36},{"ruleId":"114","severity":2,"message":"122","line":49,"column":31,"nodeType":"116","messageId":"120","endLine":49,"endColumn":47},{"ruleId":"114","severity":2,"message":"122","line":50,"column":21,"nodeType":"116","messageId":"120","endLine":50,"endColumn":37},{"ruleId":"114","severity":2,"message":"118","line":56,"column":13,"nodeType":"119","messageId":"120","endLine":56,"endColumn":22},{"ruleId":"114","severity":2,"message":"123","line":59,"column":20,"nodeType":"116","messageId":"120","endLine":59,"endColumn":32},{"ruleId":"114","severity":2,"message":"121","line":61,"column":23,"nodeType":"116","messageId":"120","endLine":61,"endColumn":29},{"ruleId":"114","severity":2,"message":"124","line":61,"column":30,"nodeType":"116","messageId":"120","endLine":61,"endColumn":34},{"ruleId":"114","severity":2,"message":"125","line":63,"column":15,"nodeType":"116","messageId":"120","endLine":63,"endColumn":19},{"ruleId":"114","severity":2,"message":"118","line":67,"column":23,"nodeType":"119","messageId":"120","endLine":67,"endColumn":32},{"ruleId":"114","severity":2,"message":"121","line":70,"column":32,"nodeType":"116","messageId":"120","endLine":70,"endColumn":38},{"ruleId":"114","severity":2,"message":"118","line":78,"column":13,"nodeType":"119","messageId":"120","endLine":78,"endColumn":22},{"ruleId":"114","severity":2,"message":"121","line":84,"column":42,"nodeType":"116","messageId":"120","endLine":84,"endColumn":48},{"ruleId":"126","severity":1,"message":"127","line":265,"column":13,"nodeType":"128","endLine":265,"endColumn":49},{"ruleId":"126","severity":1,"message":"127","line":283,"column":13,"nodeType":"128","endLine":283,"endColumn":56},{"ruleId":"129","severity":2,"message":"130","line":436,"column":22,"nodeType":"131","messageId":"132","endLine":436,"endColumn":31},"react/prop-types","'config' is missing in props validation","Identifier","'mockData' is missing in props validation","'editStore' is missing in props validation","Property","missingPropType","'editStore.config' is missing in props validation","'editStore.config.batchPrintConfig' is missing in props validation","'editStore.originConfig' is missing in props validation","'editStore.config.name' is missing in props validation","'editStore.init' is missing in props validation","react/jsx-handler-names","Handler function for onChange prop key must begin with 'handle'","JSXAttribute","gmfe/i18n-check","t函数的key只能为字符串常量(Literal),请使用单引号或双引号包裹","MemberExpression","isVariable"]
|
package/package.json
CHANGED
|
@@ -132,12 +132,6 @@ class EditorStore {
|
|
|
132
132
|
const table = this.mockData._table[dataKey]
|
|
133
133
|
this.setAutoFillingConfig(isAutoFilling)
|
|
134
134
|
|
|
135
|
-
if (isAutoFilling) {
|
|
136
|
-
table.push(...this.getFilledTableData(table))
|
|
137
|
-
} else {
|
|
138
|
-
this.clearExtraTableData(dataKey)
|
|
139
|
-
return
|
|
140
|
-
}
|
|
141
135
|
set(this.config, {
|
|
142
136
|
autoFillConfig: {
|
|
143
137
|
region: this.selectedRegion,
|
|
@@ -145,6 +139,12 @@ class EditorStore {
|
|
|
145
139
|
checked: isAutoFilling
|
|
146
140
|
}
|
|
147
141
|
})
|
|
142
|
+
if (isAutoFilling) {
|
|
143
|
+
table.push(...this.getFilledTableData(table))
|
|
144
|
+
} else {
|
|
145
|
+
this.clearExtraTableData(dataKey)
|
|
146
|
+
return
|
|
147
|
+
}
|
|
148
148
|
this.mockData._table[dataKey] = table
|
|
149
149
|
}
|
|
150
150
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Printer from '../finance_printer'
|
|
3
|
+
import _ from 'lodash'
|
|
4
|
+
import PropTypes from 'prop-types'
|
|
5
|
+
|
|
6
|
+
class BatchPrinter extends React.Component {
|
|
7
|
+
constructor(props) {
|
|
8
|
+
super(props)
|
|
9
|
+
this.ready = 0
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
handleReady = () => {
|
|
13
|
+
this.ready++
|
|
14
|
+
if (this.ready === this.props.list.length) {
|
|
15
|
+
this.props.onReady()
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
render() {
|
|
20
|
+
const { list } = this.props
|
|
21
|
+
return _.map(list, ({ config, data }, i) => (
|
|
22
|
+
<Printer key={i} data={data} config={config} onReady={this.handleReady} />
|
|
23
|
+
))
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
BatchPrinter.propTypes = {
|
|
28
|
+
list: PropTypes.array.isRequired,
|
|
29
|
+
onReady: PropTypes.func
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
BatchPrinter.defaultProps = {
|
|
33
|
+
onReady: _.noop
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default BatchPrinter
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import PropTypes from 'prop-types'
|
|
3
|
+
import _ from 'lodash'
|
|
4
|
+
import {
|
|
5
|
+
dispatchMsg,
|
|
6
|
+
getDataKey,
|
|
7
|
+
getHeight,
|
|
8
|
+
getMultiNumber,
|
|
9
|
+
getTableColumnName,
|
|
10
|
+
getWidth,
|
|
11
|
+
isMultiTable
|
|
12
|
+
} from '../../util'
|
|
13
|
+
import { inject, observer } from 'mobx-react'
|
|
14
|
+
import classNames from 'classnames'
|
|
15
|
+
import { MULTI_SUFFIX } from '../../config'
|
|
16
|
+
import SpecialTr from '../../printer/table_special_tr'
|
|
17
|
+
import SubtotalTr from './table_subtotal_tr'
|
|
18
|
+
import PageSummary from '../../printer/page_summary'
|
|
19
|
+
|
|
20
|
+
@inject('printerStore')
|
|
21
|
+
@observer
|
|
22
|
+
class Table extends React.Component {
|
|
23
|
+
constructor(props) {
|
|
24
|
+
super(props)
|
|
25
|
+
this.ref = React.createRef()
|
|
26
|
+
this.state = {
|
|
27
|
+
index: null
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
componentDidMount() {
|
|
32
|
+
const { name, printerStore } = this.props
|
|
33
|
+
|
|
34
|
+
if (!printerStore.ready) {
|
|
35
|
+
const $table = this.ref.current.querySelector('table')
|
|
36
|
+
const tHead = $table.querySelector('thead')
|
|
37
|
+
const ths = tHead.querySelectorAll('th') || []
|
|
38
|
+
const trs = $table.querySelectorAll('tbody tr') || []
|
|
39
|
+
const detailsDiv = $table.querySelectorAll('tr td .b-table-details')
|
|
40
|
+
|
|
41
|
+
printerStore.setHeight(name, getHeight($table))
|
|
42
|
+
|
|
43
|
+
printerStore.setTable(name, {
|
|
44
|
+
head: {
|
|
45
|
+
height: getHeight(tHead),
|
|
46
|
+
widths: _.map(ths, th => getWidth(th))
|
|
47
|
+
},
|
|
48
|
+
body: {
|
|
49
|
+
heights: _.map(trs, tr => getHeight(tr)),
|
|
50
|
+
children: _.map(detailsDiv, div => getHeight(div))
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
handleClick = e => {
|
|
57
|
+
const { name } = this.props
|
|
58
|
+
const { index } = e.target.dataset
|
|
59
|
+
|
|
60
|
+
dispatchMsg('gm-printer-select', {
|
|
61
|
+
selected: getTableColumnName(name, index)
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
handleDragStart = e => {
|
|
66
|
+
const { name } = this.props
|
|
67
|
+
const { index } = e.target.dataset
|
|
68
|
+
|
|
69
|
+
this.setState({
|
|
70
|
+
index
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
dispatchMsg('gm-printer-select', {
|
|
74
|
+
selected: getTableColumnName(name, index)
|
|
75
|
+
})
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
handleSelectedRegion = () => {
|
|
79
|
+
const { name } = this.props
|
|
80
|
+
|
|
81
|
+
dispatchMsg('gm-printer-select-region', { selected: name })
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
handleDrop = e => {
|
|
85
|
+
const { index } = e.target.dataset
|
|
86
|
+
|
|
87
|
+
if (this.state.index !== index) {
|
|
88
|
+
dispatchMsg('gm-printer-table-drag', {
|
|
89
|
+
source: this.state.index,
|
|
90
|
+
target: index
|
|
91
|
+
})
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
handleDragOver = e => {
|
|
96
|
+
e.preventDefault()
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
getColumns = () => {
|
|
100
|
+
const {
|
|
101
|
+
config: { columns, dataKey }
|
|
102
|
+
} = this.props
|
|
103
|
+
const columns1 = columns.map((val, index) => ({ ...val, index }))
|
|
104
|
+
// 如果是多列表格
|
|
105
|
+
if (isMultiTable(dataKey)) {
|
|
106
|
+
// 多栏商品的第二列有点特殊,都带 _MULTI_SUFFIX 后缀
|
|
107
|
+
let res = columns1
|
|
108
|
+
const colNumber = getMultiNumber(dataKey)
|
|
109
|
+
for (let i = 2; i <= colNumber; i++) {
|
|
110
|
+
const colNum = i > 2 ? i : '' // 栏数
|
|
111
|
+
const columnsI = columns.map((val, index) => {
|
|
112
|
+
const data = {
|
|
113
|
+
...val,
|
|
114
|
+
index,
|
|
115
|
+
text: val.text.replace(
|
|
116
|
+
/{{(price\()?列\.([^{{]+)}}/g,
|
|
117
|
+
(s, s1, s2) => {
|
|
118
|
+
if (s1) {
|
|
119
|
+
// 有price函数插进来
|
|
120
|
+
const mix_suffix = s2.replace(/\*/, () => `${MULTI_SUFFIX}*`)
|
|
121
|
+
return `{{${s1}列.${mix_suffix}${colNum}}}`
|
|
122
|
+
} else {
|
|
123
|
+
return `{{列.${s2}${MULTI_SUFFIX}${colNum}}}`
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
) // {{列.xx}} => {{列.xxMULTI_SUFFIXi}}
|
|
127
|
+
}
|
|
128
|
+
// 多栏商品的明细取 __details_MULTI_SUFFIX
|
|
129
|
+
if (val.specialDetailsKey)
|
|
130
|
+
data.specialDetailsKey =
|
|
131
|
+
val.specialDetailsKey + `${MULTI_SUFFIX}${colNum}`
|
|
132
|
+
return data
|
|
133
|
+
})
|
|
134
|
+
res = res.concat(columnsI)
|
|
135
|
+
}
|
|
136
|
+
return res
|
|
137
|
+
} else {
|
|
138
|
+
return columns1
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
renderDefault() {
|
|
143
|
+
let {
|
|
144
|
+
config,
|
|
145
|
+
config: { dataKey, arrange, customerRowHeight = 23 },
|
|
146
|
+
name,
|
|
147
|
+
range,
|
|
148
|
+
pageIndex,
|
|
149
|
+
printerStore
|
|
150
|
+
} = this.props
|
|
151
|
+
|
|
152
|
+
// 数据
|
|
153
|
+
dataKey = getDataKey(dataKey, arrange)
|
|
154
|
+
const tableData = printerStore.data._table[dataKey] || []
|
|
155
|
+
|
|
156
|
+
// 列
|
|
157
|
+
const columns = this.getColumns()
|
|
158
|
+
// 列宽固定(避免跳页bug)
|
|
159
|
+
const thWidths = printerStore.tablesInfo[name]?.head.widths || []
|
|
160
|
+
// 每页合计在前
|
|
161
|
+
const subtotalTrPageSummary = () => {
|
|
162
|
+
return (
|
|
163
|
+
<>
|
|
164
|
+
<SubtotalTr
|
|
165
|
+
range={range}
|
|
166
|
+
config={config}
|
|
167
|
+
printerStore={printerStore}
|
|
168
|
+
/>
|
|
169
|
+
<PageSummary {...this.props} />
|
|
170
|
+
</>
|
|
171
|
+
)
|
|
172
|
+
}
|
|
173
|
+
// 合计在前
|
|
174
|
+
const PageSummarySubtotalTr = () => {
|
|
175
|
+
return (
|
|
176
|
+
<>
|
|
177
|
+
<PageSummary {...this.props} />
|
|
178
|
+
<SubtotalTr
|
|
179
|
+
range={range}
|
|
180
|
+
config={config}
|
|
181
|
+
printerStore={printerStore}
|
|
182
|
+
/>
|
|
183
|
+
</>
|
|
184
|
+
)
|
|
185
|
+
}
|
|
186
|
+
const getTdStyle = (index, style = {}) => {
|
|
187
|
+
const width = thWidths[index]
|
|
188
|
+
const { fontSize } = style
|
|
189
|
+
let tdStyle = {}
|
|
190
|
+
let minWidth = 24
|
|
191
|
+
|
|
192
|
+
if (!width) return tdStyle
|
|
193
|
+
if (fontSize) minWidth = _.parseInt(fontSize) * 2
|
|
194
|
+
if (width >= 150) {
|
|
195
|
+
tdStyle = {
|
|
196
|
+
minWidth: width
|
|
197
|
+
}
|
|
198
|
+
} else {
|
|
199
|
+
tdStyle = {
|
|
200
|
+
minWidth,
|
|
201
|
+
width
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return tdStyle
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
return (
|
|
208
|
+
<table>
|
|
209
|
+
<thead>
|
|
210
|
+
<tr style={{ height: `${customerRowHeight}px` }}>
|
|
211
|
+
{_.map(columns, (col, i) => (
|
|
212
|
+
<th
|
|
213
|
+
key={i}
|
|
214
|
+
data-index={col.index}
|
|
215
|
+
data-name={getTableColumnName(name, col.index)}
|
|
216
|
+
draggable
|
|
217
|
+
style={{
|
|
218
|
+
...getTdStyle(i, col.headStyle),
|
|
219
|
+
...col.headStyle
|
|
220
|
+
}}
|
|
221
|
+
className={classNames({
|
|
222
|
+
active:
|
|
223
|
+
getTableColumnName(name, col.index) ===
|
|
224
|
+
printerStore.selected
|
|
225
|
+
})}
|
|
226
|
+
onClick={this.handleClick}
|
|
227
|
+
onDragStart={this.handleDragStart}
|
|
228
|
+
onDrop={this.handleDrop}
|
|
229
|
+
onDragOver={this.handleDragOver}
|
|
230
|
+
>
|
|
231
|
+
{col.head}
|
|
232
|
+
</th>
|
|
233
|
+
))}
|
|
234
|
+
</tr>
|
|
235
|
+
</thead>
|
|
236
|
+
<tbody>
|
|
237
|
+
{_.map(_.range(range.begin, range.end), i => {
|
|
238
|
+
const _special = tableData[i] && tableData[i]._special
|
|
239
|
+
if (_special)
|
|
240
|
+
return <SpecialTr key={i} config={config} data={_special} />
|
|
241
|
+
// 如果项为空对象展现一个占满一行的td
|
|
242
|
+
const isItemNone = !_.keys(tableData[i]).length
|
|
243
|
+
|
|
244
|
+
return (
|
|
245
|
+
<tr style={{ height: `${customerRowHeight}px` }} key={i}>
|
|
246
|
+
{isItemNone ? (
|
|
247
|
+
<td colSpan='99' />
|
|
248
|
+
) : (
|
|
249
|
+
_.map(columns, (col, j) => {
|
|
250
|
+
return (
|
|
251
|
+
<td
|
|
252
|
+
key={j}
|
|
253
|
+
data-name={getTableColumnName(name, col.index)}
|
|
254
|
+
style={{
|
|
255
|
+
...getTdStyle(j, col.style),
|
|
256
|
+
...col.style
|
|
257
|
+
}}
|
|
258
|
+
className={classNames({
|
|
259
|
+
active:
|
|
260
|
+
getTableColumnName(name, col.index) ===
|
|
261
|
+
printerStore.selected
|
|
262
|
+
})}
|
|
263
|
+
dangerouslySetInnerHTML={{
|
|
264
|
+
__html: col.isSpecialColumn
|
|
265
|
+
? printerStore.templateSpecialDetails(
|
|
266
|
+
col,
|
|
267
|
+
dataKey,
|
|
268
|
+
i
|
|
269
|
+
)
|
|
270
|
+
: printerStore
|
|
271
|
+
.templateFinance(
|
|
272
|
+
col.text,
|
|
273
|
+
dataKey,
|
|
274
|
+
i,
|
|
275
|
+
pageIndex
|
|
276
|
+
)
|
|
277
|
+
.replace(/\(\)/g, '')
|
|
278
|
+
}}
|
|
279
|
+
/>
|
|
280
|
+
)
|
|
281
|
+
})
|
|
282
|
+
)}
|
|
283
|
+
</tr>
|
|
284
|
+
)
|
|
285
|
+
})}
|
|
286
|
+
{this.props.config.subtotal.isCommutationPlace
|
|
287
|
+
? PageSummarySubtotalTr()
|
|
288
|
+
: subtotalTrPageSummary()}
|
|
289
|
+
</tbody>
|
|
290
|
+
</table>
|
|
291
|
+
)
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
renderEmptyTable() {
|
|
295
|
+
return (
|
|
296
|
+
<table>
|
|
297
|
+
<thead />
|
|
298
|
+
<tbody>
|
|
299
|
+
<tr />
|
|
300
|
+
</tbody>
|
|
301
|
+
</table>
|
|
302
|
+
)
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
render() {
|
|
306
|
+
let {
|
|
307
|
+
config: { className, dataKey, arrange },
|
|
308
|
+
name,
|
|
309
|
+
placeholder,
|
|
310
|
+
printerStore
|
|
311
|
+
} = this.props
|
|
312
|
+
dataKey = getDataKey(dataKey, arrange)
|
|
313
|
+
const tableData = printerStore.data._table[dataKey] || []
|
|
314
|
+
const active = printerStore.selectedRegion === name
|
|
315
|
+
|
|
316
|
+
return (
|
|
317
|
+
<div
|
|
318
|
+
ref={this.ref}
|
|
319
|
+
className={classNames(
|
|
320
|
+
'gm-printer-table',
|
|
321
|
+
'gm-printer-table-classname-' + (className || 'default'),
|
|
322
|
+
{ active }
|
|
323
|
+
)}
|
|
324
|
+
data-name={name}
|
|
325
|
+
data-placeholder={placeholder}
|
|
326
|
+
onClick={this.handleSelectedRegion}
|
|
327
|
+
>
|
|
328
|
+
{tableData.length ? this.renderDefault() : this.renderEmptyTable()}
|
|
329
|
+
</div>
|
|
330
|
+
)
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
Table.propTypes = {
|
|
335
|
+
config: PropTypes.object.isRequired,
|
|
336
|
+
name: PropTypes.string.isRequired,
|
|
337
|
+
range: PropTypes.object.isRequired,
|
|
338
|
+
pageIndex: PropTypes.number.isRequired,
|
|
339
|
+
placeholder: PropTypes.string,
|
|
340
|
+
printerStore: PropTypes.object
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
export default Table
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import i18next from '../../../locales'
|
|
3
|
+
import PropTypes from 'prop-types'
|
|
4
|
+
import _ from 'lodash'
|
|
5
|
+
import { MULTI_SUFFIX } from '../../config'
|
|
6
|
+
import Big from 'big.js'
|
|
7
|
+
import { coverDigit2Uppercase, getDataKey } from '../../util'
|
|
8
|
+
import { observer } from 'mobx-react'
|
|
9
|
+
import { get } from 'mobx'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 每页合计组件,分页计算后,根据range来统计每页合计数据
|
|
13
|
+
* @param props
|
|
14
|
+
* @returns {*}
|
|
15
|
+
*/
|
|
16
|
+
const SubtotalTr = props => {
|
|
17
|
+
const {
|
|
18
|
+
config: {
|
|
19
|
+
dataKey,
|
|
20
|
+
arrange,
|
|
21
|
+
subtotal,
|
|
22
|
+
subtotal: {
|
|
23
|
+
show,
|
|
24
|
+
isUpperCaseBefore, // 决定小写金额是否在前
|
|
25
|
+
isUpperLowerCaseSeparate, // 决定大小写金额是否分开在两端
|
|
26
|
+
style,
|
|
27
|
+
fields = [
|
|
28
|
+
{
|
|
29
|
+
name: i18next.t('出库金额'),
|
|
30
|
+
valueField: 'real_item_price'
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
displayName = false // 是否展示字段名
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
range,
|
|
37
|
+
printerStore: {
|
|
38
|
+
config: {
|
|
39
|
+
financeSpecialConfig: {
|
|
40
|
+
CapitalPrefix = '大写',
|
|
41
|
+
LowercasePrefix = '小写'
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
printerStore
|
|
46
|
+
} = props
|
|
47
|
+
const tableData = printerStore.data._table[getDataKey(dataKey, arrange)] || []
|
|
48
|
+
// 计算合计
|
|
49
|
+
const sumData = (list, field) => {
|
|
50
|
+
return _.reduce(
|
|
51
|
+
list,
|
|
52
|
+
(a, b) => {
|
|
53
|
+
let result = a
|
|
54
|
+
|
|
55
|
+
const _origin = b._origin || {}
|
|
56
|
+
const _origin2 = b['_origin' + MULTI_SUFFIX] || {}
|
|
57
|
+
|
|
58
|
+
result = a.plus(_origin[field] || 0)
|
|
59
|
+
if (_origin2[field]) {
|
|
60
|
+
result = result.plus(_origin2[field])
|
|
61
|
+
}
|
|
62
|
+
return result
|
|
63
|
+
},
|
|
64
|
+
Big(0)
|
|
65
|
+
).toFixed(2)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// 每页小计
|
|
69
|
+
// show 是否展示小计,fields<Array> 合计的字段和展现的name,displayName 是否显示名字
|
|
70
|
+
if (show && printerStore.ready) {
|
|
71
|
+
const list = tableData.slice(range.begin, range.end)
|
|
72
|
+
|
|
73
|
+
const sum = {}
|
|
74
|
+
|
|
75
|
+
_.each(fields, v => {
|
|
76
|
+
sum[v.name] = sumData(list, v.valueField)
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
// 定义每页小记的左右两侧内容
|
|
80
|
+
let subtotalLeftContent
|
|
81
|
+
let subtotalRightContent
|
|
82
|
+
|
|
83
|
+
for (const name in sum) {
|
|
84
|
+
const price = sum[name]
|
|
85
|
+
const priceUpperCase = get(subtotal, 'needUpperCase') // needUpperCase在初始模板中undefined,所以必须用这个方法
|
|
86
|
+
? coverDigit2Uppercase(price)
|
|
87
|
+
: ''
|
|
88
|
+
if (displayName) {
|
|
89
|
+
// 大写金额是否在前
|
|
90
|
+
if (isUpperCaseBefore) {
|
|
91
|
+
subtotalLeftContent = `${name}${priceUpperCase}`
|
|
92
|
+
subtotalRightContent = `(${LowercasePrefix || '小写'}:¥${price})`
|
|
93
|
+
} else {
|
|
94
|
+
subtotalLeftContent = `(${LowercasePrefix || '小写'}:¥${price})`
|
|
95
|
+
subtotalRightContent = `${name} ${priceUpperCase}`
|
|
96
|
+
}
|
|
97
|
+
} else {
|
|
98
|
+
if (isUpperCaseBefore) {
|
|
99
|
+
subtotalLeftContent = `${priceUpperCase}`
|
|
100
|
+
subtotalRightContent = `(${LowercasePrefix || '小写'}:¥${price})`
|
|
101
|
+
} else {
|
|
102
|
+
subtotalLeftContent = `(${LowercasePrefix || '小写'}:¥${price})`
|
|
103
|
+
subtotalRightContent = `${priceUpperCase}`
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<tr>
|
|
110
|
+
<td colSpan={99} style={{ ...style, height: '8mm' }}>
|
|
111
|
+
{/* 大写金额和小写金额分开在表格的两侧,通过控制类名实现,添加类名后,覆盖原来的居中、靠右靠左 */}
|
|
112
|
+
<div
|
|
113
|
+
className={
|
|
114
|
+
isUpperLowerCaseSeparate
|
|
115
|
+
? 'gm-printer-subtotal-UpperLowerCaseSeparate-outer'
|
|
116
|
+
: ''
|
|
117
|
+
}
|
|
118
|
+
style={{ margin: '0 30px' }}
|
|
119
|
+
>
|
|
120
|
+
{i18next.t(`${CapitalPrefix || '大写'}:`)}
|
|
121
|
+
{/* {i18next.t('每页合计')}: */}
|
|
122
|
+
<span
|
|
123
|
+
className={
|
|
124
|
+
isUpperLowerCaseSeparate
|
|
125
|
+
? 'gm-printer-subtotal-UpperLowerCaseSeparate-inter'
|
|
126
|
+
: ''
|
|
127
|
+
}
|
|
128
|
+
>
|
|
129
|
+
<span> {subtotalLeftContent} </span>
|
|
130
|
+
<span> {subtotalRightContent} </span>
|
|
131
|
+
</span>
|
|
132
|
+
</div>
|
|
133
|
+
</td>
|
|
134
|
+
</tr>
|
|
135
|
+
)
|
|
136
|
+
} else {
|
|
137
|
+
return null
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
SubtotalTr.propTypes = {
|
|
142
|
+
config: PropTypes.object.isRequired,
|
|
143
|
+
range: PropTypes.object.isRequired,
|
|
144
|
+
printStore: PropTypes.object
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export default observer(SubtotalTr)
|