kts-component-invoice-operate 3.2.127 → 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.
- 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 -16
- package/dist/index.js +51 -16
- 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 +20 -0
- package/src/Invoice/ui/default/GoodsList/ui/Statistics/index.tsx +2 -1
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/ItemNameInput/index.tsx +23 -21
- package/src/Invoice/ui/digtal/GoodsList/ui/Statistics/index.tsx +2 -3
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
|
@@ -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,
|
|
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
|
-
},
|
|
17621
|
-
outSymbol: false
|
|
17622
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
17649
|
+
}, toStringChinese(lineAmountIncludeTax))), /*#__PURE__*/React.createElement("div", {
|
|
17623
17650
|
style: {
|
|
17624
17651
|
flex: 1
|
|
17625
17652
|
}
|
|
@@ -19395,7 +19422,7 @@ function ItemNameInput$1(props) {
|
|
|
19395
19422
|
_context3.prev = 0;
|
|
19396
19423
|
|
|
19397
19424
|
if (!(autoComplete.onItemNameSearch && searchText)) {
|
|
19398
|
-
_context3.next =
|
|
19425
|
+
_context3.next = 10;
|
|
19399
19426
|
break;
|
|
19400
19427
|
}
|
|
19401
19428
|
|
|
@@ -19411,23 +19438,28 @@ function ItemNameInput$1(props) {
|
|
|
19411
19438
|
});
|
|
19412
19439
|
});
|
|
19413
19440
|
setOptions(list);
|
|
19414
|
-
|
|
19415
|
-
case 9:
|
|
19416
|
-
_context3.next = 15;
|
|
19441
|
+
_context3.next = 11;
|
|
19417
19442
|
break;
|
|
19418
19443
|
|
|
19444
|
+
case 10:
|
|
19445
|
+
setOptions([]);
|
|
19446
|
+
|
|
19419
19447
|
case 11:
|
|
19420
|
-
_context3.
|
|
19448
|
+
_context3.next = 17;
|
|
19449
|
+
break;
|
|
19450
|
+
|
|
19451
|
+
case 13:
|
|
19452
|
+
_context3.prev = 13;
|
|
19421
19453
|
_context3.t2 = _context3["catch"](0);
|
|
19422
19454
|
setOptions([]);
|
|
19423
19455
|
throw _context3.t2;
|
|
19424
19456
|
|
|
19425
|
-
case
|
|
19457
|
+
case 17:
|
|
19426
19458
|
case "end":
|
|
19427
19459
|
return _context3.stop();
|
|
19428
19460
|
}
|
|
19429
19461
|
}
|
|
19430
|
-
}, _callee3, null, [[0,
|
|
19462
|
+
}, _callee3, null, [[0, 13]]);
|
|
19431
19463
|
}));
|
|
19432
19464
|
|
|
19433
19465
|
return function (_x4) {
|
|
@@ -24100,6 +24132,8 @@ var Invoice = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
24100
24132
|
|
|
24101
24133
|
/** 金额计算方法 */
|
|
24102
24134
|
|
|
24135
|
+
/** 工具方法 */
|
|
24136
|
+
|
|
24103
24137
|
/** 获取控制器钩子 */
|
|
24104
24138
|
function render() {
|
|
24105
24139
|
if (this.props.invoiceType === 'digtal') {
|
|
@@ -24127,6 +24161,7 @@ Invoice.SignDigtal = SignDigtal;
|
|
|
24127
24161
|
Invoice.GoodsListDigtal = GoodsList$1;
|
|
24128
24162
|
Invoice.idGenerator = idGenerator;
|
|
24129
24163
|
Invoice.calculator = calculator;
|
|
24164
|
+
Invoice.utils = utils;
|
|
24130
24165
|
|
|
24131
24166
|
Invoice.useInvoiceController = function () {
|
|
24132
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,
|
|
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
|
-
},
|
|
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
|
}
|
|
@@ -19405,7 +19432,7 @@ function ItemNameInput$1(props) {
|
|
|
19405
19432
|
_context3.prev = 0;
|
|
19406
19433
|
|
|
19407
19434
|
if (!(autoComplete.onItemNameSearch && searchText)) {
|
|
19408
|
-
_context3.next =
|
|
19435
|
+
_context3.next = 10;
|
|
19409
19436
|
break;
|
|
19410
19437
|
}
|
|
19411
19438
|
|
|
@@ -19421,23 +19448,28 @@ function ItemNameInput$1(props) {
|
|
|
19421
19448
|
});
|
|
19422
19449
|
});
|
|
19423
19450
|
setOptions(list);
|
|
19424
|
-
|
|
19425
|
-
case 9:
|
|
19426
|
-
_context3.next = 15;
|
|
19451
|
+
_context3.next = 11;
|
|
19427
19452
|
break;
|
|
19428
19453
|
|
|
19454
|
+
case 10:
|
|
19455
|
+
setOptions([]);
|
|
19456
|
+
|
|
19429
19457
|
case 11:
|
|
19430
|
-
_context3.
|
|
19458
|
+
_context3.next = 17;
|
|
19459
|
+
break;
|
|
19460
|
+
|
|
19461
|
+
case 13:
|
|
19462
|
+
_context3.prev = 13;
|
|
19431
19463
|
_context3.t2 = _context3["catch"](0);
|
|
19432
19464
|
setOptions([]);
|
|
19433
19465
|
throw _context3.t2;
|
|
19434
19466
|
|
|
19435
|
-
case
|
|
19467
|
+
case 17:
|
|
19436
19468
|
case "end":
|
|
19437
19469
|
return _context3.stop();
|
|
19438
19470
|
}
|
|
19439
19471
|
}
|
|
19440
|
-
}, _callee3, null, [[0,
|
|
19472
|
+
}, _callee3, null, [[0, 13]]);
|
|
19441
19473
|
}));
|
|
19442
19474
|
|
|
19443
19475
|
return function (_x4) {
|
|
@@ -24110,6 +24142,8 @@ var Invoice = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
24110
24142
|
|
|
24111
24143
|
/** 金额计算方法 */
|
|
24112
24144
|
|
|
24145
|
+
/** 工具方法 */
|
|
24146
|
+
|
|
24113
24147
|
/** 获取控制器钩子 */
|
|
24114
24148
|
function render() {
|
|
24115
24149
|
if (this.props.invoiceType === 'digtal') {
|
|
@@ -24137,6 +24171,7 @@ Invoice.SignDigtal = SignDigtal;
|
|
|
24137
24171
|
Invoice.GoodsListDigtal = GoodsList$1;
|
|
24138
24172
|
Invoice.idGenerator = idGenerator;
|
|
24139
24173
|
Invoice.calculator = calculator;
|
|
24174
|
+
Invoice.utils = utils;
|
|
24140
24175
|
|
|
24141
24176
|
Invoice.useInvoiceController = function () {
|
|
24142
24177
|
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,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
|
-
{
|
|
105
|
+
{Money.toStringChinese(lineAmountIncludeTax)}
|
|
105
106
|
</label>
|
|
106
107
|
</div>
|
|
107
108
|
<div style={{ flex: 5, border: 'none' }}>
|
|
@@ -27,23 +27,23 @@ export default function ItemNameInput(props: {
|
|
|
27
27
|
}, [])
|
|
28
28
|
|
|
29
29
|
const onBlur = React.useCallback(async (searchText: any) => {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
try {
|
|
31
|
+
if (autoComplete.onItemNameBlur) {
|
|
32
|
+
if (!selectLine?.shorthand && !!searchText?.target?.value) {
|
|
33
|
+
const taxCategoryData: any = await autoComplete.onItemNameBlur(searchText);
|
|
34
|
+
if (taxCategoryData && taxCategoryData[0]) {
|
|
35
|
+
const params = {
|
|
36
|
+
taxClassificationCode: taxCategoryData[0].taxCategoryCode,
|
|
37
|
+
shorthand: taxCategoryData[0].shorthand
|
|
38
|
+
}
|
|
39
|
+
controller.itemNameBlur(params);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
setSelectLine(null);
|
|
40
43
|
}
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
} catch (error) {
|
|
45
|
+
throw error;
|
|
43
46
|
}
|
|
44
|
-
} catch (error) {
|
|
45
|
-
throw error;
|
|
46
|
-
}
|
|
47
47
|
}, [autoComplete.onItemNameBlur, selectLine, props.editGood])
|
|
48
48
|
|
|
49
49
|
const onChangeAutoComplete = React.useCallback(async (_, i) => {
|
|
@@ -57,8 +57,10 @@ export default function ItemNameInput(props: {
|
|
|
57
57
|
const onSearch = React.useCallback(async (searchText: string) => {
|
|
58
58
|
try {
|
|
59
59
|
if (autoComplete.onItemNameSearch && searchText) {
|
|
60
|
-
const list = [...await autoComplete.onItemNameSearch(searchText)].map(e => ({ ...e, $index: uuid() }))
|
|
60
|
+
const list = [...await autoComplete.onItemNameSearch(searchText)].map(e => ({ ...e, $index: uuid() }));
|
|
61
61
|
setOptions(list);
|
|
62
|
+
} else {
|
|
63
|
+
setOptions([]);
|
|
62
64
|
}
|
|
63
65
|
} catch (error) {
|
|
64
66
|
setOptions([]);
|
|
@@ -69,11 +71,11 @@ export default function ItemNameInput(props: {
|
|
|
69
71
|
return (
|
|
70
72
|
<div className='kts-invoice-operate-goods-list-itemName-input'>
|
|
71
73
|
{props.shorthand && <span style={{ alignSelf: 'center', fontSize: 12 }} >*{props.shorthand}*</span>}
|
|
72
|
-
<AutoComplete
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
<AutoComplete
|
|
75
|
+
onSearch={onSearch}
|
|
76
|
+
value={props.value}
|
|
77
|
+
options={options.map(e => ({ value: e.$index, label: e.itemName }))}
|
|
78
|
+
onSelect={onChangeAutoComplete}
|
|
77
79
|
>
|
|
78
80
|
<Input style={{ height: '100%' }} onChange={onChange} suffix={props.suffix} onBlur={onBlur} />
|
|
79
81
|
</AutoComplete>
|
|
@@ -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 }} >{
|
|
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>
|