kts-component-invoice-operate 3.2.117 → 3.2.118-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/dist/Invoice/index.d.ts +3 -0
- package/dist/Invoice/tools/utils/index.d.ts +1 -0
- package/dist/Invoice/tools/utils/money/index.d.ts +2 -0
- package/dist/index.esm.js +51 -23
- package/dist/index.js +51 -23
- package/package.json +1 -1
- package/src/Invoice/index.tsx +4 -0
- package/src/Invoice/tools/utils/index.ts +1 -0
- package/src/Invoice/tools/utils/money/index.ts +15 -0
- package/src/Invoice/ui/default/GoodsList/ui/Statistics/index.tsx +2 -2
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/index.tsx +15 -17
- package/src/Invoice/ui/digtal/GoodsList/ui/Statistics/index.tsx +2 -2
package/dist/Invoice/index.d.ts
CHANGED
|
@@ -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';
|
package/dist/index.esm.js
CHANGED
|
@@ -9547,6 +9547,35 @@ function useToGenerateId(controller) {
|
|
|
9547
9547
|
}, [goodsList]);
|
|
9548
9548
|
}
|
|
9549
9549
|
|
|
9550
|
+
var Nzh = require("nzh");
|
|
9551
|
+
|
|
9552
|
+
var nzhcn = new Nzh({
|
|
9553
|
+
ch: '零壹贰叁肆伍陆柒捌玖',
|
|
9554
|
+
ch_u: '个拾佰仟万亿',
|
|
9555
|
+
ch_f: '负',
|
|
9556
|
+
ch_d: '点',
|
|
9557
|
+
m_t: '人民币',
|
|
9558
|
+
m_z: '整',
|
|
9559
|
+
m_u: '圆角分'
|
|
9560
|
+
});
|
|
9561
|
+
/** 数字转中文 */
|
|
9562
|
+
|
|
9563
|
+
var toStringChinese = function toStringChinese(value) {
|
|
9564
|
+
return nzhcn.toMoney(value, {
|
|
9565
|
+
outSymbol: false
|
|
9566
|
+
});
|
|
9567
|
+
};
|
|
9568
|
+
|
|
9569
|
+
var index = /*#__PURE__*/Object.freeze({
|
|
9570
|
+
__proto__: null,
|
|
9571
|
+
toStringChinese: toStringChinese
|
|
9572
|
+
});
|
|
9573
|
+
|
|
9574
|
+
var utils = /*#__PURE__*/Object.freeze({
|
|
9575
|
+
__proto__: null,
|
|
9576
|
+
Money: index
|
|
9577
|
+
});
|
|
9578
|
+
|
|
9550
9579
|
var _defs, _path, _path2, _path3;
|
|
9551
9580
|
|
|
9552
9581
|
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); }
|
|
@@ -9906,8 +9935,6 @@ function TableVirtual (props) {
|
|
|
9906
9935
|
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";
|
|
9907
9936
|
styleInject(css_248z$3);
|
|
9908
9937
|
|
|
9909
|
-
var nzhcn = require('nzh').cn;
|
|
9910
|
-
|
|
9911
9938
|
var Statistics = (function () {
|
|
9912
9939
|
var controller = Invoice.useInvoiceController();
|
|
9913
9940
|
/** 是否不含税) */
|
|
@@ -10033,9 +10060,7 @@ var Statistics = (function () {
|
|
|
10033
10060
|
flex: 5,
|
|
10034
10061
|
border: 'none'
|
|
10035
10062
|
}
|
|
10036
|
-
}, /*#__PURE__*/React.createElement("label", null, "\u4EF7\u7A0E\u5408\u8BA1\uFF08\u5927\u5199\uFF09"), /*#__PURE__*/React.createElement("label", null,
|
|
10037
|
-
outSymbol: false
|
|
10038
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
10063
|
+
}, /*#__PURE__*/React.createElement("label", null, "\u4EF7\u7A0E\u5408\u8BA1\uFF08\u5927\u5199\uFF09"), /*#__PURE__*/React.createElement("label", null, toStringChinese(lineAmountIncludeTax))), /*#__PURE__*/React.createElement("div", {
|
|
10039
10064
|
style: {
|
|
10040
10065
|
flex: 5,
|
|
10041
10066
|
border: 'none'
|
|
@@ -17334,8 +17359,6 @@ function SvgFork(props) {
|
|
|
17334
17359
|
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";
|
|
17335
17360
|
styleInject(css_248z$j);
|
|
17336
17361
|
|
|
17337
|
-
var nzhcn$1 = require('nzh').cn;
|
|
17338
|
-
|
|
17339
17362
|
var Statistics$1 = (function () {
|
|
17340
17363
|
var controller = Invoice.useInvoiceController();
|
|
17341
17364
|
/** 是否不含税) */
|
|
@@ -17446,9 +17469,7 @@ var Statistics$1 = (function () {
|
|
|
17446
17469
|
fontWeight: 'bold',
|
|
17447
17470
|
marginLeft: 4
|
|
17448
17471
|
}
|
|
17449
|
-
},
|
|
17450
|
-
outSymbol: false
|
|
17451
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
17472
|
+
}, toStringChinese(lineAmountIncludeTax))), /*#__PURE__*/React.createElement("div", {
|
|
17452
17473
|
style: {
|
|
17453
17474
|
flex: 1
|
|
17454
17475
|
}
|
|
@@ -20390,18 +20411,15 @@ var MyItemNameDiv$1 = /*#__PURE__*/function (_React$Component3) {
|
|
|
20390
20411
|
return /*#__PURE__*/React.createElement(Tooltip$1, {
|
|
20391
20412
|
title: valueT
|
|
20392
20413
|
}, /*#__PURE__*/React.createElement("span", {
|
|
20393
|
-
style: {
|
|
20394
|
-
padding: '0 10px',
|
|
20414
|
+
style: _objectSpread2(_objectSpread2({}, MyItemNameStyle), {}, {
|
|
20395
20415
|
color: '#0074ff'
|
|
20396
|
-
}
|
|
20416
|
+
})
|
|
20397
20417
|
}, valueT));
|
|
20398
20418
|
} else {
|
|
20399
20419
|
return /*#__PURE__*/React.createElement(Tooltip$1, {
|
|
20400
20420
|
title: valueF
|
|
20401
20421
|
}, /*#__PURE__*/React.createElement("span", {
|
|
20402
|
-
style:
|
|
20403
|
-
padding: '0 10px'
|
|
20404
|
-
}
|
|
20422
|
+
style: MyItemNameStyle
|
|
20405
20423
|
}, valueF));
|
|
20406
20424
|
}
|
|
20407
20425
|
} else {
|
|
@@ -20409,18 +20427,16 @@ var MyItemNameDiv$1 = /*#__PURE__*/function (_React$Component3) {
|
|
|
20409
20427
|
return /*#__PURE__*/React.createElement(Tooltip$1, {
|
|
20410
20428
|
title: valueF
|
|
20411
20429
|
}, /*#__PURE__*/React.createElement("span", {
|
|
20412
|
-
style:
|
|
20413
|
-
padding: '0 10px'
|
|
20414
|
-
}
|
|
20430
|
+
style: MyItemNameStyle
|
|
20415
20431
|
}, valueF));
|
|
20416
20432
|
} else {
|
|
20417
20433
|
return /*#__PURE__*/React.createElement(Tooltip$1, {
|
|
20418
|
-
title: valueT
|
|
20434
|
+
title: valueT,
|
|
20435
|
+
style: MyItemNameStyle
|
|
20419
20436
|
}, /*#__PURE__*/React.createElement("span", {
|
|
20420
|
-
style: {
|
|
20421
|
-
padding: '0 10px',
|
|
20437
|
+
style: _objectSpread2(_objectSpread2({}, MyItemNameStyle), {}, {
|
|
20422
20438
|
color: '#0074ff'
|
|
20423
|
-
}
|
|
20439
|
+
})
|
|
20424
20440
|
}, valueT));
|
|
20425
20441
|
}
|
|
20426
20442
|
}
|
|
@@ -20462,6 +20478,15 @@ function dcoding$1(v) {
|
|
|
20462
20478
|
}).join('');
|
|
20463
20479
|
}
|
|
20464
20480
|
|
|
20481
|
+
var MyItemNameStyle = {
|
|
20482
|
+
padding: '0px 10px',
|
|
20483
|
+
whiteSpace: 'nowrap',
|
|
20484
|
+
overflow: 'hidden',
|
|
20485
|
+
width: "100%",
|
|
20486
|
+
display: 'block',
|
|
20487
|
+
textOverflow: 'ellipsis'
|
|
20488
|
+
};
|
|
20489
|
+
|
|
20465
20490
|
var useOnRow$1 = (function () {
|
|
20466
20491
|
/** 控制器 */
|
|
20467
20492
|
var controller = Invoice.useInvoiceController();
|
|
@@ -23755,6 +23780,8 @@ var Invoice = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
23755
23780
|
|
|
23756
23781
|
/** 金额计算方法 */
|
|
23757
23782
|
|
|
23783
|
+
/** 工具方法 */
|
|
23784
|
+
|
|
23758
23785
|
/** 获取控制器钩子 */
|
|
23759
23786
|
function render() {
|
|
23760
23787
|
if (this.props.invoiceType === 'digtal') {
|
|
@@ -23782,6 +23809,7 @@ Invoice.SignDigtal = SignDigtal;
|
|
|
23782
23809
|
Invoice.GoodsListDigtal = GoodsList$1;
|
|
23783
23810
|
Invoice.idGenerator = idGenerator;
|
|
23784
23811
|
Invoice.calculator = calculator;
|
|
23812
|
+
Invoice.utils = utils;
|
|
23785
23813
|
|
|
23786
23814
|
Invoice.useInvoiceController = function () {
|
|
23787
23815
|
return React.useContext(InvoiceContext);
|
package/dist/index.js
CHANGED
|
@@ -9557,6 +9557,35 @@ function useToGenerateId(controller) {
|
|
|
9557
9557
|
}, [goodsList]);
|
|
9558
9558
|
}
|
|
9559
9559
|
|
|
9560
|
+
var Nzh = require("nzh");
|
|
9561
|
+
|
|
9562
|
+
var nzhcn = new Nzh({
|
|
9563
|
+
ch: '零壹贰叁肆伍陆柒捌玖',
|
|
9564
|
+
ch_u: '个拾佰仟万亿',
|
|
9565
|
+
ch_f: '负',
|
|
9566
|
+
ch_d: '点',
|
|
9567
|
+
m_t: '人民币',
|
|
9568
|
+
m_z: '整',
|
|
9569
|
+
m_u: '圆角分'
|
|
9570
|
+
});
|
|
9571
|
+
/** 数字转中文 */
|
|
9572
|
+
|
|
9573
|
+
var toStringChinese = function toStringChinese(value) {
|
|
9574
|
+
return nzhcn.toMoney(value, {
|
|
9575
|
+
outSymbol: false
|
|
9576
|
+
});
|
|
9577
|
+
};
|
|
9578
|
+
|
|
9579
|
+
var index = /*#__PURE__*/Object.freeze({
|
|
9580
|
+
__proto__: null,
|
|
9581
|
+
toStringChinese: toStringChinese
|
|
9582
|
+
});
|
|
9583
|
+
|
|
9584
|
+
var utils = /*#__PURE__*/Object.freeze({
|
|
9585
|
+
__proto__: null,
|
|
9586
|
+
Money: index
|
|
9587
|
+
});
|
|
9588
|
+
|
|
9560
9589
|
var _defs, _path, _path2, _path3;
|
|
9561
9590
|
|
|
9562
9591
|
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); }
|
|
@@ -9916,8 +9945,6 @@ function TableVirtual (props) {
|
|
|
9916
9945
|
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";
|
|
9917
9946
|
styleInject(css_248z$3);
|
|
9918
9947
|
|
|
9919
|
-
var nzhcn = require('nzh').cn;
|
|
9920
|
-
|
|
9921
9948
|
var Statistics = (function () {
|
|
9922
9949
|
var controller = Invoice.useInvoiceController();
|
|
9923
9950
|
/** 是否不含税) */
|
|
@@ -10043,9 +10070,7 @@ var Statistics = (function () {
|
|
|
10043
10070
|
flex: 5,
|
|
10044
10071
|
border: 'none'
|
|
10045
10072
|
}
|
|
10046
|
-
}, /*#__PURE__*/React__default['default'].createElement("label", null, "\u4EF7\u7A0E\u5408\u8BA1\uFF08\u5927\u5199\uFF09"), /*#__PURE__*/React__default['default'].createElement("label", null,
|
|
10047
|
-
outSymbol: false
|
|
10048
|
-
}))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
10073
|
+
}, /*#__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", {
|
|
10049
10074
|
style: {
|
|
10050
10075
|
flex: 5,
|
|
10051
10076
|
border: 'none'
|
|
@@ -17344,8 +17369,6 @@ function SvgFork(props) {
|
|
|
17344
17369
|
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";
|
|
17345
17370
|
styleInject(css_248z$j);
|
|
17346
17371
|
|
|
17347
|
-
var nzhcn$1 = require('nzh').cn;
|
|
17348
|
-
|
|
17349
17372
|
var Statistics$1 = (function () {
|
|
17350
17373
|
var controller = Invoice.useInvoiceController();
|
|
17351
17374
|
/** 是否不含税) */
|
|
@@ -17456,9 +17479,7 @@ var Statistics$1 = (function () {
|
|
|
17456
17479
|
fontWeight: 'bold',
|
|
17457
17480
|
marginLeft: 4
|
|
17458
17481
|
}
|
|
17459
|
-
},
|
|
17460
|
-
outSymbol: false
|
|
17461
|
-
}))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
17482
|
+
}, toStringChinese(lineAmountIncludeTax))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
17462
17483
|
style: {
|
|
17463
17484
|
flex: 1
|
|
17464
17485
|
}
|
|
@@ -20400,18 +20421,15 @@ var MyItemNameDiv$1 = /*#__PURE__*/function (_React$Component3) {
|
|
|
20400
20421
|
return /*#__PURE__*/React__default['default'].createElement(ktsXui.Tooltip, {
|
|
20401
20422
|
title: valueT
|
|
20402
20423
|
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
20403
|
-
style: {
|
|
20404
|
-
padding: '0 10px',
|
|
20424
|
+
style: _objectSpread2(_objectSpread2({}, MyItemNameStyle), {}, {
|
|
20405
20425
|
color: '#0074ff'
|
|
20406
|
-
}
|
|
20426
|
+
})
|
|
20407
20427
|
}, valueT));
|
|
20408
20428
|
} else {
|
|
20409
20429
|
return /*#__PURE__*/React__default['default'].createElement(ktsXui.Tooltip, {
|
|
20410
20430
|
title: valueF
|
|
20411
20431
|
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
20412
|
-
style:
|
|
20413
|
-
padding: '0 10px'
|
|
20414
|
-
}
|
|
20432
|
+
style: MyItemNameStyle
|
|
20415
20433
|
}, valueF));
|
|
20416
20434
|
}
|
|
20417
20435
|
} else {
|
|
@@ -20419,18 +20437,16 @@ var MyItemNameDiv$1 = /*#__PURE__*/function (_React$Component3) {
|
|
|
20419
20437
|
return /*#__PURE__*/React__default['default'].createElement(ktsXui.Tooltip, {
|
|
20420
20438
|
title: valueF
|
|
20421
20439
|
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
20422
|
-
style:
|
|
20423
|
-
padding: '0 10px'
|
|
20424
|
-
}
|
|
20440
|
+
style: MyItemNameStyle
|
|
20425
20441
|
}, valueF));
|
|
20426
20442
|
} else {
|
|
20427
20443
|
return /*#__PURE__*/React__default['default'].createElement(ktsXui.Tooltip, {
|
|
20428
|
-
title: valueT
|
|
20444
|
+
title: valueT,
|
|
20445
|
+
style: MyItemNameStyle
|
|
20429
20446
|
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
20430
|
-
style: {
|
|
20431
|
-
padding: '0 10px',
|
|
20447
|
+
style: _objectSpread2(_objectSpread2({}, MyItemNameStyle), {}, {
|
|
20432
20448
|
color: '#0074ff'
|
|
20433
|
-
}
|
|
20449
|
+
})
|
|
20434
20450
|
}, valueT));
|
|
20435
20451
|
}
|
|
20436
20452
|
}
|
|
@@ -20472,6 +20488,15 @@ function dcoding$1(v) {
|
|
|
20472
20488
|
}).join('');
|
|
20473
20489
|
}
|
|
20474
20490
|
|
|
20491
|
+
var MyItemNameStyle = {
|
|
20492
|
+
padding: '0px 10px',
|
|
20493
|
+
whiteSpace: 'nowrap',
|
|
20494
|
+
overflow: 'hidden',
|
|
20495
|
+
width: "100%",
|
|
20496
|
+
display: 'block',
|
|
20497
|
+
textOverflow: 'ellipsis'
|
|
20498
|
+
};
|
|
20499
|
+
|
|
20475
20500
|
var useOnRow$1 = (function () {
|
|
20476
20501
|
/** 控制器 */
|
|
20477
20502
|
var controller = Invoice.useInvoiceController();
|
|
@@ -23765,6 +23790,8 @@ var Invoice = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
23765
23790
|
|
|
23766
23791
|
/** 金额计算方法 */
|
|
23767
23792
|
|
|
23793
|
+
/** 工具方法 */
|
|
23794
|
+
|
|
23768
23795
|
/** 获取控制器钩子 */
|
|
23769
23796
|
function render() {
|
|
23770
23797
|
if (this.props.invoiceType === 'digtal') {
|
|
@@ -23792,6 +23819,7 @@ Invoice.SignDigtal = SignDigtal;
|
|
|
23792
23819
|
Invoice.GoodsListDigtal = GoodsList$1;
|
|
23793
23820
|
Invoice.idGenerator = idGenerator;
|
|
23794
23821
|
Invoice.calculator = calculator;
|
|
23822
|
+
Invoice.utils = utils;
|
|
23795
23823
|
|
|
23796
23824
|
Invoice.useInvoiceController = function () {
|
|
23797
23825
|
return React__default['default'].useContext(InvoiceContext);
|
package/package.json
CHANGED
package/src/Invoice/index.tsx
CHANGED
|
@@ -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,15 @@
|
|
|
1
|
+
var Nzh = require("nzh");
|
|
2
|
+
const nzhcn = new Nzh({
|
|
3
|
+
ch: '零壹贰叁肆伍陆柒捌玖'
|
|
4
|
+
,ch_u: '个拾佰仟万亿'
|
|
5
|
+
,ch_f: '负'
|
|
6
|
+
,ch_d: '点'
|
|
7
|
+
,m_t: '人民币'
|
|
8
|
+
,m_z: '整'
|
|
9
|
+
,m_u: '圆角分'
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
/** 数字转中文 */
|
|
13
|
+
export const toStringChinese = (value: any) => {
|
|
14
|
+
return nzhcn.toMoney(value, { outSymbol: false })
|
|
15
|
+
};
|
|
@@ -4,8 +4,8 @@ import { chain, bignumber } from 'mathjs';
|
|
|
4
4
|
import { LineAttributeType } from '../../../../../../Invoice/InvoiceController';
|
|
5
5
|
import Invoice from '../../../../..';
|
|
6
6
|
import './index.less';
|
|
7
|
+
import { Money } from '../../../../../tools/utils';
|
|
7
8
|
|
|
8
|
-
const nzhcn = require('nzh').cn;
|
|
9
9
|
|
|
10
10
|
export default () => {
|
|
11
11
|
const controller = Invoice.useInvoiceController();
|
|
@@ -101,7 +101,7 @@ export default () => {
|
|
|
101
101
|
<div style={{ flex: 5, border: 'none' }}>
|
|
102
102
|
<label>价税合计(大写)</label>
|
|
103
103
|
<label>
|
|
104
|
-
{
|
|
104
|
+
{Money.toStringChinese(lineAmountIncludeTax)}
|
|
105
105
|
</label>
|
|
106
106
|
</div>
|
|
107
107
|
<div style={{ flex: 5, border: 'none' }}>
|
|
@@ -137,17 +137,6 @@ export default (form: WrappedFormUtils) => {
|
|
|
137
137
|
}}
|
|
138
138
|
/>
|
|
139
139
|
)}
|
|
140
|
-
{/* <div className="kts-invoice-operate-goods-list-able-list-itemName-import">
|
|
141
|
-
{controller.getGoodsList && model !== 'readOnly' && (
|
|
142
|
-
<Tooltip title="点击从商品管理中添加商品信息">
|
|
143
|
-
<Button
|
|
144
|
-
onClick={controller.pipeline(async s => { s.goodsListState.importGoods.isVisibleDrawer = true })}
|
|
145
|
-
type="link"
|
|
146
|
-
icon="plus-circle"
|
|
147
|
-
/>
|
|
148
|
-
</Tooltip>
|
|
149
|
-
)}
|
|
150
|
-
</div> */}
|
|
151
140
|
</div>
|
|
152
141
|
</Form.Item>
|
|
153
142
|
);
|
|
@@ -533,7 +522,7 @@ export default (form: WrappedFormUtils) => {
|
|
|
533
522
|
}
|
|
534
523
|
})
|
|
535
524
|
// 是否启动拖拽
|
|
536
|
-
.filter(e => e.key !=='drag' || isStart)
|
|
525
|
+
.filter(e => e.key !== 'drag' || isStart)
|
|
537
526
|
// 只读
|
|
538
527
|
.filter(e => {
|
|
539
528
|
if (model === 'readOnly') {
|
|
@@ -603,13 +592,13 @@ class MyItemNameDiv extends React.Component<{ valueT?: React.ReactNode, valueF?:
|
|
|
603
592
|
if (valueT) {
|
|
604
593
|
return (
|
|
605
594
|
<Tooltip title={valueT}>
|
|
606
|
-
<span style={{
|
|
595
|
+
<span style={{ ...MyItemNameStyle, color: '#0074ff' }}>{valueT}</span>
|
|
607
596
|
</Tooltip>
|
|
608
597
|
)
|
|
609
598
|
} else {
|
|
610
599
|
return (
|
|
611
600
|
<Tooltip title={valueF}>
|
|
612
|
-
<span style={
|
|
601
|
+
<span style={MyItemNameStyle}>{valueF}</span>
|
|
613
602
|
</Tooltip>
|
|
614
603
|
)
|
|
615
604
|
}
|
|
@@ -617,13 +606,13 @@ class MyItemNameDiv extends React.Component<{ valueT?: React.ReactNode, valueF?:
|
|
|
617
606
|
if (valueF) {
|
|
618
607
|
return (
|
|
619
608
|
<Tooltip title={valueF}>
|
|
620
|
-
<span style={
|
|
609
|
+
<span style={MyItemNameStyle}>{valueF}</span>
|
|
621
610
|
</Tooltip>
|
|
622
611
|
)
|
|
623
612
|
} else {
|
|
624
613
|
return (
|
|
625
|
-
<Tooltip title={valueT}>
|
|
626
|
-
<span style={{
|
|
614
|
+
<Tooltip title={valueT} style={MyItemNameStyle}>
|
|
615
|
+
<span style={{ ...MyItemNameStyle, color: '#0074ff' }}>{valueT}</span>
|
|
627
616
|
</Tooltip>
|
|
628
617
|
)
|
|
629
618
|
}
|
|
@@ -648,3 +637,12 @@ function ucoding(v: string): string {
|
|
|
648
637
|
function dcoding(v: string): string {
|
|
649
638
|
return v.split('U').map(e => e ? String.fromCharCode(parseInt(e.replace('E', ''))) : '').join('');
|
|
650
639
|
}
|
|
640
|
+
|
|
641
|
+
const MyItemNameStyle: any = {
|
|
642
|
+
padding: '0px 10px',
|
|
643
|
+
whiteSpace: 'nowrap',
|
|
644
|
+
overflow: 'hidden',
|
|
645
|
+
width: "100%",
|
|
646
|
+
display: 'block',
|
|
647
|
+
textOverflow: 'ellipsis'
|
|
648
|
+
}
|
|
@@ -4,9 +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
10
|
|
|
11
11
|
export default () => {
|
|
12
12
|
const controller = Invoice.useInvoiceController();
|
|
@@ -88,7 +88,7 @@ export default () => {
|
|
|
88
88
|
<div>价税合计(大写)</div>
|
|
89
89
|
<div style={{ paddingLeft: 30 }} >
|
|
90
90
|
<Icon style={{fontSize: 16}} component={ForkSvg} />
|
|
91
|
-
<span style={{ fontWeight: 'bold', marginLeft: 4 }} >{
|
|
91
|
+
<span style={{ fontWeight: 'bold', marginLeft: 4 }} >{Money.toStringChinese(lineAmountIncludeTax)}</span>
|
|
92
92
|
</div>
|
|
93
93
|
<div style={{ flex: 1 }} />
|
|
94
94
|
<div style={{ width: 90, color: '#9F613E' }} >(小写)</div>
|