kts-component-invoice-operate 3.2.128 → 3.2.129

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.
@@ -2,6 +2,7 @@ import './index.less';
2
2
  import React from 'react';
3
3
  import InvoiceController from './InvoiceController';
4
4
  import * as calculator from './tools/calculate';
5
+ import * as utils from './tools/utils';
5
6
  import GoodsList from './ui/default/GoodsList';
6
7
  import Seller from './ui/default/Seller';
7
8
  import Buyer from './ui/default/Buyer';
@@ -53,6 +54,8 @@ export default class Invoice extends React.PureComponent<IInvoiceProps> {
53
54
  static idGenerator: () => string;
54
55
  /** 金额计算方法 */
55
56
  static calculator: typeof calculator;
57
+ /** 工具方法 */
58
+ static utils: typeof utils;
56
59
  /** 获取控制器钩子 */
57
60
  static useInvoiceController: () => InvoiceController;
58
61
  render(): JSX.Element;
@@ -0,0 +1 @@
1
+ export * as Money from './money';
@@ -0,0 +1,2 @@
1
+ /** 数字转中文 */
2
+ export declare const toStringChinese: (value: any) => any;
package/dist/index.esm.js CHANGED
@@ -9733,6 +9733,39 @@ function useToGenerateId(controller) {
9733
9733
  }, [goodsList]);
9734
9734
  }
9735
9735
 
9736
+ var Nzh = require("nzh");
9737
+
9738
+ var nzhcn = new Nzh({
9739
+ ch: '零壹贰叁肆伍陆柒捌玖',
9740
+ ch_u: '个拾佰仟万亿',
9741
+ ch_f: '负',
9742
+ ch_d: '点',
9743
+ m_t: '人民币',
9744
+ m_z: '整',
9745
+ m_u: '圆角分'
9746
+ });
9747
+ /** 数字转中文 */
9748
+
9749
+ var toStringChinese = function toStringChinese(value) {
9750
+ try {
9751
+ return nzhcn.toMoney(value, {
9752
+ outSymbol: false
9753
+ });
9754
+ } catch (e) {
9755
+ return '';
9756
+ }
9757
+ };
9758
+
9759
+ var index = /*#__PURE__*/Object.freeze({
9760
+ __proto__: null,
9761
+ toStringChinese: toStringChinese
9762
+ });
9763
+
9764
+ var utils = /*#__PURE__*/Object.freeze({
9765
+ __proto__: null,
9766
+ Money: index
9767
+ });
9768
+
9736
9769
  var _defs, _path, _path2, _path3;
9737
9770
 
9738
9771
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
@@ -10092,7 +10125,7 @@ function TableVirtual (props) {
10092
10125
  var css_248z$3 = ".kts-invoice-operate-goods-list-statistics {\n background: #fafafa;\n overflow-y: scroll;\n}\n.kts-invoice-operate-goods-list-statistics .kts-invoice-operate-goods-list-statistics-row {\n height: 30px;\n line-height: 30px;\n border-bottom: 1px solid #e8e8e8;\n display: flex;\n}\n.kts-invoice-operate-goods-list-statistics .kts-invoice-operate-goods-list-statistics-row > div {\n border-right: 1px solid #e8e8e8;\n}\n.kts-invoice-operate-goods-list-statistics .kts-invoice-operate-goods-list-statistics-row > div label {\n padding: 0 10px;\n}\n";
10093
10126
  styleInject(css_248z$3);
10094
10127
 
10095
- var nzhcn = require('nzh').cn;
10128
+ var nzhcn$1 = require('nzh').cn;
10096
10129
 
10097
10130
  var Statistics = (function () {
10098
10131
  var controller = Invoice.useInvoiceController();
@@ -10219,9 +10252,7 @@ var Statistics = (function () {
10219
10252
  flex: 5,
10220
10253
  border: 'none'
10221
10254
  }
10222
- }, /*#__PURE__*/React.createElement("label", null, "\u4EF7\u7A0E\u5408\u8BA1\uFF08\u5927\u5199\uFF09"), /*#__PURE__*/React.createElement("label", null, nzhcn.toMoney(lineAmountIncludeTax, {
10223
- outSymbol: false
10224
- }))), /*#__PURE__*/React.createElement("div", {
10255
+ }, /*#__PURE__*/React.createElement("label", null, "\u4EF7\u7A0E\u5408\u8BA1\uFF08\u5927\u5199\uFF09"), /*#__PURE__*/React.createElement("label", null, toStringChinese(lineAmountIncludeTax))), /*#__PURE__*/React.createElement("div", {
10225
10256
  style: {
10226
10257
  flex: 5,
10227
10258
  border: 'none'
@@ -17505,8 +17536,6 @@ function SvgFork(props) {
17505
17536
  var css_248z$j = ".kts-invoice-operate-goods-list-statistics-digtal {\n overflow-y: scroll;\n /* 设置滚动条滑块颜色 */\n}\n.kts-invoice-operate-goods-list-statistics-digtal::-webkit-scrollbar-track {\n background-color: #f1f1f1;\n}\n.kts-invoice-operate-goods-list-statistics-digtal .statistics-digtal-total-tax,\n.kts-invoice-operate-goods-list-statistics-digtal .statistics-digtal-total {\n height: 42px;\n display: flex;\n align-items: center;\n}\n.kts-invoice-operate-goods-list-statistics-digtal .statistics-digtal-total-tax > div:first-child,\n.kts-invoice-operate-goods-list-statistics-digtal .statistics-digtal-total > div:first-child {\n width: 225px;\n color: #9F613E;\n font-family: PingFang SC;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.kts-invoice-operate-goods-list-statistics-digtal .statistics-digtal-total-tax {\n border-top: 2px solid #9F613E;\n}\n.kts-invoice-operate-goods-list-statistics-digtal .statistics-digtal-total-tax > div:first-child {\n border-right: 2px solid #9F613E;\n}\n";
17506
17537
  styleInject(css_248z$j);
17507
17538
 
17508
- var nzhcn$1 = require('nzh').cn;
17509
-
17510
17539
  var Statistics$1 = (function () {
17511
17540
  var controller = Invoice.useInvoiceController();
17512
17541
  /** 是否不含税) */
@@ -17617,9 +17646,7 @@ var Statistics$1 = (function () {
17617
17646
  fontWeight: 'bold',
17618
17647
  marginLeft: 4
17619
17648
  }
17620
- }, nzhcn$1.toMoney(lineAmountIncludeTax, {
17621
- outSymbol: false
17622
- }))), /*#__PURE__*/React.createElement("div", {
17649
+ }, toStringChinese(lineAmountIncludeTax))), /*#__PURE__*/React.createElement("div", {
17623
17650
  style: {
17624
17651
  flex: 1
17625
17652
  }
@@ -24105,6 +24132,8 @@ var Invoice = /*#__PURE__*/function (_React$PureComponent) {
24105
24132
 
24106
24133
  /** 金额计算方法 */
24107
24134
 
24135
+ /** 工具方法 */
24136
+
24108
24137
  /** 获取控制器钩子 */
24109
24138
  function render() {
24110
24139
  if (this.props.invoiceType === 'digtal') {
@@ -24132,6 +24161,7 @@ Invoice.SignDigtal = SignDigtal;
24132
24161
  Invoice.GoodsListDigtal = GoodsList$1;
24133
24162
  Invoice.idGenerator = idGenerator;
24134
24163
  Invoice.calculator = calculator;
24164
+ Invoice.utils = utils;
24135
24165
 
24136
24166
  Invoice.useInvoiceController = function () {
24137
24167
  return React.useContext(InvoiceContext);
package/dist/index.js CHANGED
@@ -9743,6 +9743,39 @@ function useToGenerateId(controller) {
9743
9743
  }, [goodsList]);
9744
9744
  }
9745
9745
 
9746
+ var Nzh = require("nzh");
9747
+
9748
+ var nzhcn = new Nzh({
9749
+ ch: '零壹贰叁肆伍陆柒捌玖',
9750
+ ch_u: '个拾佰仟万亿',
9751
+ ch_f: '负',
9752
+ ch_d: '点',
9753
+ m_t: '人民币',
9754
+ m_z: '整',
9755
+ m_u: '圆角分'
9756
+ });
9757
+ /** 数字转中文 */
9758
+
9759
+ var toStringChinese = function toStringChinese(value) {
9760
+ try {
9761
+ return nzhcn.toMoney(value, {
9762
+ outSymbol: false
9763
+ });
9764
+ } catch (e) {
9765
+ return '';
9766
+ }
9767
+ };
9768
+
9769
+ var index = /*#__PURE__*/Object.freeze({
9770
+ __proto__: null,
9771
+ toStringChinese: toStringChinese
9772
+ });
9773
+
9774
+ var utils = /*#__PURE__*/Object.freeze({
9775
+ __proto__: null,
9776
+ Money: index
9777
+ });
9778
+
9746
9779
  var _defs, _path, _path2, _path3;
9747
9780
 
9748
9781
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
@@ -10102,7 +10135,7 @@ function TableVirtual (props) {
10102
10135
  var css_248z$3 = ".kts-invoice-operate-goods-list-statistics {\n background: #fafafa;\n overflow-y: scroll;\n}\n.kts-invoice-operate-goods-list-statistics .kts-invoice-operate-goods-list-statistics-row {\n height: 30px;\n line-height: 30px;\n border-bottom: 1px solid #e8e8e8;\n display: flex;\n}\n.kts-invoice-operate-goods-list-statistics .kts-invoice-operate-goods-list-statistics-row > div {\n border-right: 1px solid #e8e8e8;\n}\n.kts-invoice-operate-goods-list-statistics .kts-invoice-operate-goods-list-statistics-row > div label {\n padding: 0 10px;\n}\n";
10103
10136
  styleInject(css_248z$3);
10104
10137
 
10105
- var nzhcn = require('nzh').cn;
10138
+ var nzhcn$1 = require('nzh').cn;
10106
10139
 
10107
10140
  var Statistics = (function () {
10108
10141
  var controller = Invoice.useInvoiceController();
@@ -10229,9 +10262,7 @@ var Statistics = (function () {
10229
10262
  flex: 5,
10230
10263
  border: 'none'
10231
10264
  }
10232
- }, /*#__PURE__*/React__default['default'].createElement("label", null, "\u4EF7\u7A0E\u5408\u8BA1\uFF08\u5927\u5199\uFF09"), /*#__PURE__*/React__default['default'].createElement("label", null, nzhcn.toMoney(lineAmountIncludeTax, {
10233
- outSymbol: false
10234
- }))), /*#__PURE__*/React__default['default'].createElement("div", {
10265
+ }, /*#__PURE__*/React__default['default'].createElement("label", null, "\u4EF7\u7A0E\u5408\u8BA1\uFF08\u5927\u5199\uFF09"), /*#__PURE__*/React__default['default'].createElement("label", null, toStringChinese(lineAmountIncludeTax))), /*#__PURE__*/React__default['default'].createElement("div", {
10235
10266
  style: {
10236
10267
  flex: 5,
10237
10268
  border: 'none'
@@ -17515,8 +17546,6 @@ function SvgFork(props) {
17515
17546
  var css_248z$j = ".kts-invoice-operate-goods-list-statistics-digtal {\n overflow-y: scroll;\n /* 设置滚动条滑块颜色 */\n}\n.kts-invoice-operate-goods-list-statistics-digtal::-webkit-scrollbar-track {\n background-color: #f1f1f1;\n}\n.kts-invoice-operate-goods-list-statistics-digtal .statistics-digtal-total-tax,\n.kts-invoice-operate-goods-list-statistics-digtal .statistics-digtal-total {\n height: 42px;\n display: flex;\n align-items: center;\n}\n.kts-invoice-operate-goods-list-statistics-digtal .statistics-digtal-total-tax > div:first-child,\n.kts-invoice-operate-goods-list-statistics-digtal .statistics-digtal-total > div:first-child {\n width: 225px;\n color: #9F613E;\n font-family: PingFang SC;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.kts-invoice-operate-goods-list-statistics-digtal .statistics-digtal-total-tax {\n border-top: 2px solid #9F613E;\n}\n.kts-invoice-operate-goods-list-statistics-digtal .statistics-digtal-total-tax > div:first-child {\n border-right: 2px solid #9F613E;\n}\n";
17516
17547
  styleInject(css_248z$j);
17517
17548
 
17518
- var nzhcn$1 = require('nzh').cn;
17519
-
17520
17549
  var Statistics$1 = (function () {
17521
17550
  var controller = Invoice.useInvoiceController();
17522
17551
  /** 是否不含税) */
@@ -17627,9 +17656,7 @@ var Statistics$1 = (function () {
17627
17656
  fontWeight: 'bold',
17628
17657
  marginLeft: 4
17629
17658
  }
17630
- }, nzhcn$1.toMoney(lineAmountIncludeTax, {
17631
- outSymbol: false
17632
- }))), /*#__PURE__*/React__default['default'].createElement("div", {
17659
+ }, toStringChinese(lineAmountIncludeTax))), /*#__PURE__*/React__default['default'].createElement("div", {
17633
17660
  style: {
17634
17661
  flex: 1
17635
17662
  }
@@ -24115,6 +24142,8 @@ var Invoice = /*#__PURE__*/function (_React$PureComponent) {
24115
24142
 
24116
24143
  /** 金额计算方法 */
24117
24144
 
24145
+ /** 工具方法 */
24146
+
24118
24147
  /** 获取控制器钩子 */
24119
24148
  function render() {
24120
24149
  if (this.props.invoiceType === 'digtal') {
@@ -24142,6 +24171,7 @@ Invoice.SignDigtal = SignDigtal;
24142
24171
  Invoice.GoodsListDigtal = GoodsList$1;
24143
24172
  Invoice.idGenerator = idGenerator;
24144
24173
  Invoice.calculator = calculator;
24174
+ Invoice.utils = utils;
24145
24175
 
24146
24176
  Invoice.useInvoiceController = function () {
24147
24177
  return React__default['default'].useContext(InvoiceContext);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.128",
3
+ "version": "3.2.129",
4
4
  "scripts": {
5
5
  "dev": "dumi dev",
6
6
  "start": "dumi dev",
@@ -5,6 +5,7 @@ import InvoiceController from './InvoiceController';
5
5
  import useToGenerateId from './tools/useToGenerateId';
6
6
  import idGenerator from './tools/idGenerator';
7
7
  import * as calculator from './tools/calculate';
8
+ import * as utils from './tools/utils';
8
9
 
9
10
  import InvoiceHeader from './ui/default/InvoiceHeader';
10
11
  import GoodsList from './ui/default/GoodsList';
@@ -93,6 +94,9 @@ export default class Invoice extends React.PureComponent<IInvoiceProps> {
93
94
  /** 金额计算方法 */
94
95
  static calculator = calculator;
95
96
 
97
+ /** 工具方法 */
98
+ static utils = utils;
99
+
96
100
  /** 获取控制器钩子 */
97
101
  static useInvoiceController = () => { return React.useContext(InvoiceContext) };
98
102
 
@@ -0,0 +1 @@
1
+ export * as Money from './money';
@@ -0,0 +1,20 @@
1
+ const Nzh = require("nzh");
2
+
3
+ const nzhcn = new Nzh({
4
+ ch: '零壹贰叁肆伍陆柒捌玖'
5
+ ,ch_u: '个拾佰仟万亿'
6
+ ,ch_f: '负'
7
+ ,ch_d: '点'
8
+ ,m_t: '人民币'
9
+ ,m_z: '整'
10
+ ,m_u: '圆角分'
11
+ })
12
+
13
+ /** 数字转中文 */
14
+ export const toStringChinese = (value: any) => {
15
+ try {
16
+ return nzhcn.toMoney(value, { outSymbol: false })
17
+ } catch(e) {
18
+ return ''
19
+ }
20
+ };
@@ -3,6 +3,7 @@ import { } from 'kts-components-antd-x3';
3
3
  import { chain, bignumber } from 'mathjs';
4
4
  import { LineAttributeType } from '../../../../../../Invoice/InvoiceController';
5
5
  import Invoice from '../../../../..';
6
+ import { Money } from '../../../../../tools/utils';
6
7
  import './index.less';
7
8
 
8
9
  const nzhcn = require('nzh').cn;
@@ -101,7 +102,7 @@ export default () => {
101
102
  <div style={{ flex: 5, border: 'none' }}>
102
103
  <label>价税合计(大写)</label>
103
104
  <label>
104
- {nzhcn.toMoney(lineAmountIncludeTax, { outSymbol: false })}
105
+ {Money.toStringChinese(lineAmountIncludeTax)}
105
106
  </label>
106
107
  </div>
107
108
  <div style={{ flex: 5, border: 'none' }}>
@@ -4,10 +4,9 @@ import { } from 'kts-components-antd-x3';
4
4
  import { ReactComponent as ForkSvg } from './svg/fork.svg';
5
5
  import { chain, bignumber } from 'mathjs';
6
6
  import Invoice from '../../../../..';
7
+ import { Money } from '../../../../../tools/utils';
7
8
  import './index.less';
8
9
 
9
- const nzhcn = require('nzh').cn;
10
-
11
10
  export default () => {
12
11
  const controller = Invoice.useInvoiceController();
13
12
 
@@ -88,7 +87,7 @@ export default () => {
88
87
  <div>价税合计(大写)</div>
89
88
  <div style={{ paddingLeft: 30 }} >
90
89
  <Icon style={{fontSize: 16}} component={ForkSvg} />
91
- <span style={{ fontWeight: 'bold', marginLeft: 4 }} >{nzhcn.toMoney(lineAmountIncludeTax, { outSymbol: false })}</span>
90
+ <span style={{ fontWeight: 'bold', marginLeft: 4 }} >{Money.toStringChinese(lineAmountIncludeTax)}</span>
92
91
  </div>
93
92
  <div style={{ flex: 1 }} />
94
93
  <div style={{ width: 90, color: '#9F613E' }} >(小写)</div>