kts-component-invoice-operate 1.0.82 → 1.0.86
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/InvoiceController/InvoiceControllerState/GoodsListState/EndowCode.d.ts +6 -2
- package/dist/index.esm.js +70 -47
- package/dist/index.js +71 -47
- package/docs-dist/umi.css +1 -1
- package/docs-dist/umi.js +1 -1
- package/package.json +3 -2
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/EndowCode.tsx +6 -2
- package/src/Invoice/_test/endowCode/index.tsx +63 -3318
- package/src/Invoice/index.tsx +10 -2
- package/src/Invoice/tools/calculate/index.ts +1 -1
- package/src/Invoice/ui/EndowCodeDrawer/index.tsx +10 -19
- package/src/Invoice/ui/GoodsList/hook/useColumns/autoFillFn/index.ts +10 -12
- package/src/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/index.tsx +4 -3
- package/src/Invoice/ui/GoodsList/index.less +9 -3
- package/src/Invoice/ui/GoodsList/index.tsx +6 -3
- package/src/Invoice/ui/GoodsList/ui/Statistics/index.tsx +10 -2
- package/src/Invoice/ui/InvoiceHeader/index.tsx +3 -2
- package/src/Invoice/ui/Seller/index.tsx +1 -1
- package/src/Invoice/ui/Sign/index.tsx +3 -3
|
@@ -10,8 +10,12 @@ export default class EndowCode {
|
|
|
10
10
|
}[]>;
|
|
11
11
|
/** 税率 是否可以编辑 */
|
|
12
12
|
getReadOnlyTaxRate?: (value?: GoodsListState) => boolean;
|
|
13
|
-
/**
|
|
14
|
-
|
|
13
|
+
/**
|
|
14
|
+
* 获取赋码时候的默认值
|
|
15
|
+
* @param value 商品信息
|
|
16
|
+
* @param length 商品数量
|
|
17
|
+
* */
|
|
18
|
+
getDefaultValue?: (value: IGood, length: number) => Promise<IGood>;
|
|
15
19
|
/** 税率 是否可以编辑 校验函数 */
|
|
16
20
|
readonly readOnlyTaxRateMap: {
|
|
17
21
|
[key: string]: (value?: GoodsListState) => boolean;
|
package/dist/index.esm.js
CHANGED
|
@@ -4,6 +4,7 @@ import GreyReactBox, { decorator } from 'grey-react-box';
|
|
|
4
4
|
import { chain as chain$1, bignumber, create, all } from 'mathjs';
|
|
5
5
|
import { message, Form, Input, Icon, Tag, Select, Row, Col, Table, Button, Switch, Typography, Drawer, Menu, Dropdown, AutoComplete, Spin, Checkbox, Descriptions } from 'kts-components-antd-x3';
|
|
6
6
|
import { v4 } from 'uuid';
|
|
7
|
+
import classnames from 'classnames';
|
|
7
8
|
import { createAsyncFormActions, FormEffectHooks, SchemaForm, FormButtonGroup, SchemaMarkupField } from '@formily/antd';
|
|
8
9
|
import { Input as Input$1, NumberPicker } from '@formily/antd-components';
|
|
9
10
|
|
|
@@ -1218,7 +1219,7 @@ var InvoiceHeader = decorator(Form.create())(function (props) {
|
|
|
1218
1219
|
}, isInvoiceNo ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "\u53D1\u7968\u5355\u636E\u7F16\u53F7 :"), getFieldDecorator('id', {
|
|
1219
1220
|
initialValue: props.defaultId
|
|
1220
1221
|
})( /*#__PURE__*/React.createElement(Input, {
|
|
1221
|
-
|
|
1222
|
+
disabled: readOnlyInvoiceNo,
|
|
1222
1223
|
style: {
|
|
1223
1224
|
width: 230
|
|
1224
1225
|
},
|
|
@@ -1315,7 +1316,12 @@ var FormSpanString = /*#__PURE__*/function (_React$Component) {
|
|
|
1315
1316
|
_createClass(FormSpanString, [{
|
|
1316
1317
|
key: "render",
|
|
1317
1318
|
value: function render() {
|
|
1318
|
-
return
|
|
1319
|
+
// return <span>{this.props.value}</span>;
|
|
1320
|
+
return /*#__PURE__*/React.createElement(Input, {
|
|
1321
|
+
size: "small",
|
|
1322
|
+
disabled: true,
|
|
1323
|
+
value: this.props.value
|
|
1324
|
+
});
|
|
1319
1325
|
}
|
|
1320
1326
|
}]);
|
|
1321
1327
|
|
|
@@ -1439,12 +1445,17 @@ var Statistics = (function () {
|
|
|
1439
1445
|
/** 金额(含税) */
|
|
1440
1446
|
|
|
1441
1447
|
var lineAmountIncludeTax = controller.useMemo(function (s) {
|
|
1448
|
+
var _s$goodsListState$for, _s$goodsListState$for2;
|
|
1449
|
+
|
|
1442
1450
|
var sum = chain$1(bignumber(0));
|
|
1443
1451
|
var editGood = s.goodsListState.editGood; // 正在编辑的货物
|
|
1444
1452
|
|
|
1453
|
+
var err = (_s$goodsListState$for = (_s$goodsListState$for2 = s.goodsListState.form) === null || _s$goodsListState$for2 === void 0 ? void 0 : _s$goodsListState$for2.getFieldsError()) !== null && _s$goodsListState$for !== void 0 ? _s$goodsListState$for : {};
|
|
1445
1454
|
s.goodsListState.goodsList.forEach(function (e) {
|
|
1446
1455
|
if (e.$index === (editGood === null || editGood === void 0 ? void 0 : editGood.$index)) {
|
|
1447
|
-
|
|
1456
|
+
if (!err.lineAmountIncludeTax) {
|
|
1457
|
+
sum = sum.add(bignumber(editGood.lineAmountIncludeTax || 0));
|
|
1458
|
+
}
|
|
1448
1459
|
} else {
|
|
1449
1460
|
sum = sum.add(bignumber(e.lineAmountIncludeTax || 0));
|
|
1450
1461
|
}
|
|
@@ -1454,12 +1465,17 @@ var Statistics = (function () {
|
|
|
1454
1465
|
/** 金额(不含税) */
|
|
1455
1466
|
|
|
1456
1467
|
var lineAmountExcludeTax = controller.useMemo(function (s) {
|
|
1468
|
+
var _s$goodsListState$for3, _s$goodsListState$for4;
|
|
1469
|
+
|
|
1457
1470
|
var sum = chain$1(bignumber(0));
|
|
1458
1471
|
var editGood = s.goodsListState.editGood; // 正在编辑的货物
|
|
1459
1472
|
|
|
1473
|
+
var err = (_s$goodsListState$for3 = (_s$goodsListState$for4 = s.goodsListState.form) === null || _s$goodsListState$for4 === void 0 ? void 0 : _s$goodsListState$for4.getFieldsError()) !== null && _s$goodsListState$for3 !== void 0 ? _s$goodsListState$for3 : {};
|
|
1460
1474
|
s.goodsListState.goodsList.forEach(function (e) {
|
|
1461
1475
|
if (e.$index === (editGood === null || editGood === void 0 ? void 0 : editGood.$index)) {
|
|
1462
|
-
|
|
1476
|
+
if (!err.lineAmountExcludeTax) {
|
|
1477
|
+
sum = sum.add(bignumber(editGood.lineAmountExcludeTax || 0));
|
|
1478
|
+
}
|
|
1463
1479
|
} else {
|
|
1464
1480
|
sum = sum.add(bignumber(e.lineAmountExcludeTax || 0));
|
|
1465
1481
|
}
|
|
@@ -2373,7 +2389,7 @@ var format15 = function format15(value) {
|
|
|
2373
2389
|
if (value === Infinity) return '';
|
|
2374
2390
|
if ("".concat(value) === 'NaN') return '';
|
|
2375
2391
|
if (typeof value === 'string') value = parseFloat(value);
|
|
2376
|
-
var fractionDigits = 15 -
|
|
2392
|
+
var fractionDigits = 15 - "".concat(value || 0).indexOf('.');
|
|
2377
2393
|
return parseFloat(value.toFixed(fractionDigits > 8 ? 8 : fractionDigits));
|
|
2378
2394
|
}; // 数量 + 单价(含税) => 金额(含税)
|
|
2379
2395
|
|
|
@@ -2407,10 +2423,14 @@ var lazyFn$1 = function lazyFn(fn) {
|
|
|
2407
2423
|
|
|
2408
2424
|
var promptErr = function promptErr(err) {
|
|
2409
2425
|
if (!err) return false;
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2426
|
+
|
|
2427
|
+
if (err.errors[0].message !== 'lineAmountIncludeTax need to revalidate') {
|
|
2428
|
+
message.error({
|
|
2429
|
+
key: err.errors[0].message,
|
|
2430
|
+
content: err.errors[0].message
|
|
2431
|
+
});
|
|
2432
|
+
}
|
|
2433
|
+
|
|
2414
2434
|
return true;
|
|
2415
2435
|
};
|
|
2416
2436
|
/** 数量改变了 */
|
|
@@ -2441,7 +2461,7 @@ var onChangeQuantity = lazyFn$1(function (controller, form, record) {
|
|
|
2441
2461
|
return _context.abrupt("return");
|
|
2442
2462
|
|
|
2443
2463
|
case 5:
|
|
2444
|
-
if (!
|
|
2464
|
+
if (!err.quantity) {
|
|
2445
2465
|
_context.next = 7;
|
|
2446
2466
|
break;
|
|
2447
2467
|
}
|
|
@@ -2591,7 +2611,7 @@ var onChangePriceIncludeTax = lazyFn$1(function (controller, form, record) {
|
|
|
2591
2611
|
return _context2.abrupt("return");
|
|
2592
2612
|
|
|
2593
2613
|
case 5:
|
|
2594
|
-
if (!
|
|
2614
|
+
if (!err.priceIncludeTax) {
|
|
2595
2615
|
_context2.next = 7;
|
|
2596
2616
|
break;
|
|
2597
2617
|
}
|
|
@@ -2690,7 +2710,7 @@ var onChangePriceExcludeTax = lazyFn$1(function (controller, form, record) {
|
|
|
2690
2710
|
return _context3.abrupt("return");
|
|
2691
2711
|
|
|
2692
2712
|
case 5:
|
|
2693
|
-
if (!
|
|
2713
|
+
if (!err.priceExcludeTax) {
|
|
2694
2714
|
_context3.next = 7;
|
|
2695
2715
|
break;
|
|
2696
2716
|
}
|
|
@@ -3077,7 +3097,7 @@ var updateUnitPriceTax = function updateUnitPriceTax(controller, form, record) {
|
|
|
3077
3097
|
case 0:
|
|
3078
3098
|
err = err || {};
|
|
3079
3099
|
|
|
3080
|
-
if (!(!
|
|
3100
|
+
if (!(!err.taxRat && (values.taxRate || values.taxRate === 0) && !promptErr(err.lineAmountExcludeTax) && (values.lineAmountExcludeTax || values.lineAmountExcludeTax === 0))) {
|
|
3081
3101
|
_context8.next = 12;
|
|
3082
3102
|
break;
|
|
3083
3103
|
}
|
|
@@ -3115,7 +3135,7 @@ var updateUnitPriceTax = function updateUnitPriceTax(controller, form, record) {
|
|
|
3115
3135
|
});
|
|
3116
3136
|
|
|
3117
3137
|
case 15:
|
|
3118
|
-
if (!(!
|
|
3138
|
+
if (!(!err.taxRat && (values.taxRate || values.taxRate === 0) && !promptErr(err.priceExcludeTax) && (values.priceExcludeTax || values.priceExcludeTax === 0))) {
|
|
3119
3139
|
_context8.next = 20;
|
|
3120
3140
|
break;
|
|
3121
3141
|
}
|
|
@@ -3317,11 +3337,12 @@ var RowMenu = (function (props) {
|
|
|
3317
3337
|
var endowCode = useEndowCode(props.goods);
|
|
3318
3338
|
var itemList = React.useMemo(function () {
|
|
3319
3339
|
var arr = [];
|
|
3340
|
+
console.log('model ===>', model, controller);
|
|
3320
3341
|
model !== 'prefab' && addDiscount && arr.push(addDiscount); // 添加折扣行
|
|
3321
3342
|
|
|
3322
|
-
endowCode && arr.push(endowCode); //
|
|
3343
|
+
endowCode && arr.push(endowCode); // 赋码
|
|
3323
3344
|
|
|
3324
|
-
model !== 'prefab' && delItem && arr.push(delItem); //
|
|
3345
|
+
model !== 'prefab' && delItem && arr.push(delItem); // 删除
|
|
3325
3346
|
|
|
3326
3347
|
if (!goodsMenuExpand || goodsMenuExpand.length === 0) return arr;
|
|
3327
3348
|
arr.unshift( /*#__PURE__*/React.createElement(Menu.Divider, {
|
|
@@ -4339,7 +4360,7 @@ var useRowSelection = (function () {
|
|
|
4339
4360
|
};
|
|
4340
4361
|
});
|
|
4341
4362
|
|
|
4342
|
-
var css_248z$6 = ".kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-table-tax-rate .ktsAnt3x-select-selection-selected-value {\n float: right;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able {\n display: flex;\n padding: 10px;\n border-bottom: 1px solid #dcdcdc;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list {\n flex: 1;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list button {\n padding-left: 10px;\n padding-right: 10px;\n border-radius: 12px;\n color: #0074ff;\n border: 1px solid #0074ff;\n margin: 0 10px;\n height: 24px;\n line-height: 22px;\n cursor: pointer;\n font-size: 12px;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list button[disabled] {\n color: rgba(0, 0, 0, 0.25);\n border: 1px solid;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-extend {\n flex: none;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-extend label {\n margin-right: 5px;\n}\n.kts-invoice-operate-goods-list-table {\n border-bottom: 1px solid #dcdcdc;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-discount {\n color: rgba(0, 0, 0, 0.25);\n background: #f5f5f5;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-list-able-list-itemName-import {\n display: flex;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-list-able-list-itemName-import .ktsAnt3x-btn {\n display: block;\n line-height: 0;\n width: auto;\n padding-right: 5px;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-form-item-children {\n height: 30px;\n display: block;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-table-body {\n height: 240px;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-form-explain {\n position: absolute;\n right: 6px;\n top: 6px;\n}\n.kts-invoice-operate-goods-list-table table {\n border-bottom: 1px solid #d9d9d9 !important;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td {\n padding: 0 !important;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-form-explain {\n display: none;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-form-item {\n padding: 0;\n margin: 0;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-form-item .ktsAnt3x-form-item-control {\n line-height: inherit;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .has-error .ktsAnt3x-select-selection,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .has-error .ktsAnt3x-input,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .has-error .ktsAnt3x-input:hover {\n border-right-width: 1px !important;\n border-top-width: 1px;\n border-left-width: 1px;\n border-bottom-width: 1px;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-select-selection--single,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-select-auto-complete.ktsAnt3x-select .ktsAnt3x-input:hover,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-input {\n height: 30px;\n border-radius: 0;\n border-right-width: 0 !important;\n border-top-width: 0;\n border-left-width: 0;\n border-bottom-width: 0;\n box-shadow: none;\n}\n";
|
|
4363
|
+
var css_248z$6 = ".kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-table-tax-rate .ktsAnt3x-select-selection-selected-value {\n float: right;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able {\n display: flex;\n padding: 10px;\n border-bottom: 1px solid #dcdcdc;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list {\n flex: 1;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list button {\n padding-left: 10px;\n padding-right: 10px;\n border-radius: 12px;\n color: #0074ff;\n border: 1px solid #0074ff;\n margin: 0 10px;\n height: 24px;\n line-height: 22px;\n cursor: pointer;\n font-size: 12px;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list button[disabled] {\n color: rgba(0, 0, 0, 0.25);\n border: 1px solid;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-extend {\n flex: none;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-extend label {\n margin-right: 5px;\n}\n.kts-invoice-operate-goods-list-table.kts-invoice-operate-prefab .ktsAnt3x-table-row {\n color: rgba(0, 0, 0, 0.25);\n background: #f5f5f5;\n}\n.kts-invoice-operate-goods-list-table {\n border-bottom: 1px solid #dcdcdc;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-discount {\n color: rgba(0, 0, 0, 0.25);\n background: #f5f5f5;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-list-able-list-itemName-import {\n display: flex;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-list-able-list-itemName-import .ktsAnt3x-btn {\n display: block;\n line-height: 0;\n width: auto;\n padding-right: 5px;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-form-item-children {\n height: 30px;\n display: block;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-table-body {\n height: 240px;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-form-explain {\n position: absolute;\n right: 6px;\n top: 6px;\n}\n.kts-invoice-operate-goods-list-table table {\n border-bottom: 1px solid #d9d9d9 !important;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td {\n padding: 0 !important;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-form-explain {\n display: none;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-form-item {\n padding: 0;\n margin: 0;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-form-item .ktsAnt3x-form-item-control {\n line-height: inherit;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .has-error .ktsAnt3x-select-selection,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .has-error .ktsAnt3x-input,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .has-error .ktsAnt3x-input:hover {\n border-right-width: 1px !important;\n border-top-width: 1px;\n border-left-width: 1px;\n border-bottom-width: 1px;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-select-selection--single,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-select-auto-complete.ktsAnt3x-select .ktsAnt3x-input:hover,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-input {\n height: 30px;\n border-radius: 0;\n border-right-width: 0 !important;\n border-top-width: 0;\n border-left-width: 0;\n border-bottom-width: 0;\n box-shadow: none;\n}\n";
|
|
4343
4364
|
styleInject(css_248z$6);
|
|
4344
4365
|
|
|
4345
4366
|
var GoodsList = /*#__PURE__*/function (_React$Component) {
|
|
@@ -4368,6 +4389,9 @@ var Main = decorator(Form.create())(function (props) {
|
|
|
4368
4389
|
var goodsList = controller.useMemo(function (s) {
|
|
4369
4390
|
return s.goodsListState.goodsList;
|
|
4370
4391
|
}, []);
|
|
4392
|
+
var isprefab = controller.useMemo(function (s) {
|
|
4393
|
+
return s.model === 'prefab';
|
|
4394
|
+
}, []);
|
|
4371
4395
|
/** 表格行事件 */
|
|
4372
4396
|
|
|
4373
4397
|
var _onRow = useOnRow();
|
|
@@ -4450,7 +4474,9 @@ var Main = decorator(Form.create())(function (props) {
|
|
|
4450
4474
|
}, /*#__PURE__*/React.createElement(AddRowButton, null), /*#__PURE__*/React.createElement(DelRowButton, null), /*#__PURE__*/React.createElement(AddDiscountRowButton, null), /*#__PURE__*/React.createElement(EndowCodeButton, null)), /*#__PURE__*/React.createElement("div", {
|
|
4451
4475
|
className: "kts-invoice-operate-goods-list-able-extend"
|
|
4452
4476
|
}, props.menuExpansion, /*#__PURE__*/React.createElement(TaxIncludedSwitch, null))), /*#__PURE__*/React.createElement("div", {
|
|
4453
|
-
className:
|
|
4477
|
+
className: classnames('kts-invoice-operate-goods-list-table', {
|
|
4478
|
+
'kts-invoice-operate-prefab': isprefab
|
|
4479
|
+
})
|
|
4454
4480
|
}, /*#__PURE__*/React.createElement(TableVirtual, {
|
|
4455
4481
|
bordered: true,
|
|
4456
4482
|
size: "small",
|
|
@@ -4466,7 +4492,7 @@ var Main = decorator(Form.create())(function (props) {
|
|
|
4466
4492
|
},
|
|
4467
4493
|
dataSource: controller.useMemo(function (s) {
|
|
4468
4494
|
return s.goodsListState.goodsList;
|
|
4469
|
-
}, []),
|
|
4495
|
+
}, [controller]),
|
|
4470
4496
|
columns: useColumns(props.form),
|
|
4471
4497
|
rowSelection: useRowSelection(),
|
|
4472
4498
|
onRow: function onRow(record) {
|
|
@@ -4621,9 +4647,7 @@ var Main$1 = decorator(Form.create())(function (props) {
|
|
|
4621
4647
|
className: "kts-invoice-operate-seller-remarks-value"
|
|
4622
4648
|
}, getFieldDecorator('remarks', {
|
|
4623
4649
|
initialValue: props.defaultsellerRemarks
|
|
4624
|
-
})( /*#__PURE__*/React.createElement(TextArea,
|
|
4625
|
-
readOnly: model === 'prefab'
|
|
4626
|
-
}))))));
|
|
4650
|
+
})( /*#__PURE__*/React.createElement(TextArea, null))))));
|
|
4627
4651
|
});
|
|
4628
4652
|
|
|
4629
4653
|
var css_248z$8 = ".kts-invoice-operate-sign form {\n display: flex;\n}\n.kts-invoice-operate-sign form .ktsAnt3x-row.ktsAnt3x-form-item {\n margin: 0;\n}\n.kts-invoice-operate-sign form > div {\n flex: 1;\n text-align: center;\n}\n";
|
|
@@ -4647,14 +4671,12 @@ var Sign = decorator(Form.create())(function (props) {
|
|
|
4647
4671
|
}, getFieldDecorator('payee', {
|
|
4648
4672
|
initialValue: props.defaultPayee
|
|
4649
4673
|
})( /*#__PURE__*/React.createElement(Input, {
|
|
4650
|
-
readOnly: model === 'prefab',
|
|
4651
4674
|
size: "small"
|
|
4652
4675
|
})))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form.Item, {
|
|
4653
4676
|
label: "\u590D\u6838\u4EBA"
|
|
4654
4677
|
}, getFieldDecorator('reviewer', {
|
|
4655
4678
|
initialValue: props.defaultReviewer
|
|
4656
4679
|
})( /*#__PURE__*/React.createElement(Input, {
|
|
4657
|
-
readOnly: model === 'prefab',
|
|
4658
4680
|
size: "small"
|
|
4659
4681
|
})))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form.Item, {
|
|
4660
4682
|
label: "\u5F00\u7968\u4EBA"
|
|
@@ -4665,7 +4687,6 @@ var Sign = decorator(Form.create())(function (props) {
|
|
|
4665
4687
|
message: '请输入开票人'
|
|
4666
4688
|
}]
|
|
4667
4689
|
})( /*#__PURE__*/React.createElement(Input, {
|
|
4668
|
-
readOnly: model === 'prefab',
|
|
4669
4690
|
size: "small"
|
|
4670
4691
|
}))))));
|
|
4671
4692
|
});
|
|
@@ -5243,41 +5264,33 @@ var EndowCodeDrawer = (function () {
|
|
|
5243
5264
|
return _context2.abrupt("return");
|
|
5244
5265
|
|
|
5245
5266
|
case 4:
|
|
5246
|
-
if (!(endowcodeGoodIndex.length === 1)) {
|
|
5247
|
-
_context2.next = 17;
|
|
5248
|
-
break;
|
|
5249
|
-
}
|
|
5250
|
-
|
|
5251
5267
|
getDefaultValue = s.goodsListState.endowCode.getDefaultValue;
|
|
5252
5268
|
|
|
5253
5269
|
if (!getDefaultValue) {
|
|
5254
|
-
_context2.next =
|
|
5270
|
+
_context2.next = 13;
|
|
5255
5271
|
break;
|
|
5256
5272
|
}
|
|
5257
5273
|
|
|
5258
5274
|
_context2.t0 = setDefaultValue;
|
|
5259
|
-
_context2.next =
|
|
5260
|
-
return getDefaultValue(_objectSpread2({}, good));
|
|
5275
|
+
_context2.next = 9;
|
|
5276
|
+
return getDefaultValue(_objectSpread2({}, good), endowcodeGoodIndex.length);
|
|
5261
5277
|
|
|
5262
|
-
case
|
|
5278
|
+
case 9:
|
|
5263
5279
|
_context2.t1 = _context2.sent;
|
|
5264
5280
|
(0, _context2.t0)(_context2.t1);
|
|
5265
|
-
_context2.next =
|
|
5281
|
+
_context2.next = 14;
|
|
5266
5282
|
break;
|
|
5267
5283
|
|
|
5268
|
-
case
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
setDefaultValue({
|
|
5277
|
-
taxRate: good.taxRate
|
|
5278
|
-
});
|
|
5284
|
+
case 13:
|
|
5285
|
+
if (endowcodeGoodIndex.length === 1) {
|
|
5286
|
+
setDefaultValue(good);
|
|
5287
|
+
} else {
|
|
5288
|
+
setDefaultValue({
|
|
5289
|
+
taxRate: good.taxRate
|
|
5290
|
+
});
|
|
5291
|
+
}
|
|
5279
5292
|
|
|
5280
|
-
case
|
|
5293
|
+
case 14:
|
|
5281
5294
|
case "end":
|
|
5282
5295
|
return _context2.stop();
|
|
5283
5296
|
}
|
|
@@ -5752,7 +5765,17 @@ var Main$3 = function Main(props) {
|
|
|
5752
5765
|
var controller = React.useMemo(function () {
|
|
5753
5766
|
return props.controller || new InvoiceController();
|
|
5754
5767
|
}, [props.controller]);
|
|
5768
|
+
|
|
5769
|
+
var _React$useState = React.useState(0),
|
|
5770
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
5771
|
+
key = _React$useState2[0],
|
|
5772
|
+
setKey = _React$useState2[1];
|
|
5773
|
+
|
|
5774
|
+
React.useEffect(function () {
|
|
5775
|
+
setKey(key + 1);
|
|
5776
|
+
}, [controller]);
|
|
5755
5777
|
return /*#__PURE__*/React.createElement(InvoiceContext.Provider, {
|
|
5778
|
+
key: key,
|
|
5756
5779
|
value: controller
|
|
5757
5780
|
}, /*#__PURE__*/React.createElement("div", {
|
|
5758
5781
|
className: "kts-invoice-operate"
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ var GreyReactBox = require('grey-react-box');
|
|
|
8
8
|
var mathjs = require('mathjs');
|
|
9
9
|
var ktsComponentsAntdX3 = require('kts-components-antd-x3');
|
|
10
10
|
var uuid = require('uuid');
|
|
11
|
+
var classnames = require('classnames');
|
|
11
12
|
var antd = require('@formily/antd');
|
|
12
13
|
var antdComponents = require('@formily/antd-components');
|
|
13
14
|
|
|
@@ -15,6 +16,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
15
16
|
|
|
16
17
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
17
18
|
var GreyReactBox__default = /*#__PURE__*/_interopDefaultLegacy(GreyReactBox);
|
|
19
|
+
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
18
20
|
|
|
19
21
|
function ownKeys(object, enumerableOnly) {
|
|
20
22
|
var keys = Object.keys(object);
|
|
@@ -1227,7 +1229,7 @@ var InvoiceHeader = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
|
|
|
1227
1229
|
}, isInvoiceNo ? /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("label", null, "\u53D1\u7968\u5355\u636E\u7F16\u53F7 :"), getFieldDecorator('id', {
|
|
1228
1230
|
initialValue: props.defaultId
|
|
1229
1231
|
})( /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Input, {
|
|
1230
|
-
|
|
1232
|
+
disabled: readOnlyInvoiceNo,
|
|
1231
1233
|
style: {
|
|
1232
1234
|
width: 230
|
|
1233
1235
|
},
|
|
@@ -1324,7 +1326,12 @@ var FormSpanString = /*#__PURE__*/function (_React$Component) {
|
|
|
1324
1326
|
_createClass(FormSpanString, [{
|
|
1325
1327
|
key: "render",
|
|
1326
1328
|
value: function render() {
|
|
1327
|
-
return
|
|
1329
|
+
// return <span>{this.props.value}</span>;
|
|
1330
|
+
return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Input, {
|
|
1331
|
+
size: "small",
|
|
1332
|
+
disabled: true,
|
|
1333
|
+
value: this.props.value
|
|
1334
|
+
});
|
|
1328
1335
|
}
|
|
1329
1336
|
}]);
|
|
1330
1337
|
|
|
@@ -1448,12 +1455,17 @@ var Statistics = (function () {
|
|
|
1448
1455
|
/** 金额(含税) */
|
|
1449
1456
|
|
|
1450
1457
|
var lineAmountIncludeTax = controller.useMemo(function (s) {
|
|
1458
|
+
var _s$goodsListState$for, _s$goodsListState$for2;
|
|
1459
|
+
|
|
1451
1460
|
var sum = mathjs.chain(mathjs.bignumber(0));
|
|
1452
1461
|
var editGood = s.goodsListState.editGood; // 正在编辑的货物
|
|
1453
1462
|
|
|
1463
|
+
var err = (_s$goodsListState$for = (_s$goodsListState$for2 = s.goodsListState.form) === null || _s$goodsListState$for2 === void 0 ? void 0 : _s$goodsListState$for2.getFieldsError()) !== null && _s$goodsListState$for !== void 0 ? _s$goodsListState$for : {};
|
|
1454
1464
|
s.goodsListState.goodsList.forEach(function (e) {
|
|
1455
1465
|
if (e.$index === (editGood === null || editGood === void 0 ? void 0 : editGood.$index)) {
|
|
1456
|
-
|
|
1466
|
+
if (!err.lineAmountIncludeTax) {
|
|
1467
|
+
sum = sum.add(mathjs.bignumber(editGood.lineAmountIncludeTax || 0));
|
|
1468
|
+
}
|
|
1457
1469
|
} else {
|
|
1458
1470
|
sum = sum.add(mathjs.bignumber(e.lineAmountIncludeTax || 0));
|
|
1459
1471
|
}
|
|
@@ -1463,12 +1475,17 @@ var Statistics = (function () {
|
|
|
1463
1475
|
/** 金额(不含税) */
|
|
1464
1476
|
|
|
1465
1477
|
var lineAmountExcludeTax = controller.useMemo(function (s) {
|
|
1478
|
+
var _s$goodsListState$for3, _s$goodsListState$for4;
|
|
1479
|
+
|
|
1466
1480
|
var sum = mathjs.chain(mathjs.bignumber(0));
|
|
1467
1481
|
var editGood = s.goodsListState.editGood; // 正在编辑的货物
|
|
1468
1482
|
|
|
1483
|
+
var err = (_s$goodsListState$for3 = (_s$goodsListState$for4 = s.goodsListState.form) === null || _s$goodsListState$for4 === void 0 ? void 0 : _s$goodsListState$for4.getFieldsError()) !== null && _s$goodsListState$for3 !== void 0 ? _s$goodsListState$for3 : {};
|
|
1469
1484
|
s.goodsListState.goodsList.forEach(function (e) {
|
|
1470
1485
|
if (e.$index === (editGood === null || editGood === void 0 ? void 0 : editGood.$index)) {
|
|
1471
|
-
|
|
1486
|
+
if (!err.lineAmountExcludeTax) {
|
|
1487
|
+
sum = sum.add(mathjs.bignumber(editGood.lineAmountExcludeTax || 0));
|
|
1488
|
+
}
|
|
1472
1489
|
} else {
|
|
1473
1490
|
sum = sum.add(mathjs.bignumber(e.lineAmountExcludeTax || 0));
|
|
1474
1491
|
}
|
|
@@ -2382,7 +2399,7 @@ var format15 = function format15(value) {
|
|
|
2382
2399
|
if (value === Infinity) return '';
|
|
2383
2400
|
if ("".concat(value) === 'NaN') return '';
|
|
2384
2401
|
if (typeof value === 'string') value = parseFloat(value);
|
|
2385
|
-
var fractionDigits = 15 -
|
|
2402
|
+
var fractionDigits = 15 - "".concat(value || 0).indexOf('.');
|
|
2386
2403
|
return parseFloat(value.toFixed(fractionDigits > 8 ? 8 : fractionDigits));
|
|
2387
2404
|
}; // 数量 + 单价(含税) => 金额(含税)
|
|
2388
2405
|
|
|
@@ -2416,10 +2433,14 @@ var lazyFn$1 = function lazyFn(fn) {
|
|
|
2416
2433
|
|
|
2417
2434
|
var promptErr = function promptErr(err) {
|
|
2418
2435
|
if (!err) return false;
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2436
|
+
|
|
2437
|
+
if (err.errors[0].message !== 'lineAmountIncludeTax need to revalidate') {
|
|
2438
|
+
ktsComponentsAntdX3.message.error({
|
|
2439
|
+
key: err.errors[0].message,
|
|
2440
|
+
content: err.errors[0].message
|
|
2441
|
+
});
|
|
2442
|
+
}
|
|
2443
|
+
|
|
2423
2444
|
return true;
|
|
2424
2445
|
};
|
|
2425
2446
|
/** 数量改变了 */
|
|
@@ -2450,7 +2471,7 @@ var onChangeQuantity = lazyFn$1(function (controller, form, record) {
|
|
|
2450
2471
|
return _context.abrupt("return");
|
|
2451
2472
|
|
|
2452
2473
|
case 5:
|
|
2453
|
-
if (!
|
|
2474
|
+
if (!err.quantity) {
|
|
2454
2475
|
_context.next = 7;
|
|
2455
2476
|
break;
|
|
2456
2477
|
}
|
|
@@ -2600,7 +2621,7 @@ var onChangePriceIncludeTax = lazyFn$1(function (controller, form, record) {
|
|
|
2600
2621
|
return _context2.abrupt("return");
|
|
2601
2622
|
|
|
2602
2623
|
case 5:
|
|
2603
|
-
if (!
|
|
2624
|
+
if (!err.priceIncludeTax) {
|
|
2604
2625
|
_context2.next = 7;
|
|
2605
2626
|
break;
|
|
2606
2627
|
}
|
|
@@ -2699,7 +2720,7 @@ var onChangePriceExcludeTax = lazyFn$1(function (controller, form, record) {
|
|
|
2699
2720
|
return _context3.abrupt("return");
|
|
2700
2721
|
|
|
2701
2722
|
case 5:
|
|
2702
|
-
if (!
|
|
2723
|
+
if (!err.priceExcludeTax) {
|
|
2703
2724
|
_context3.next = 7;
|
|
2704
2725
|
break;
|
|
2705
2726
|
}
|
|
@@ -3086,7 +3107,7 @@ var updateUnitPriceTax = function updateUnitPriceTax(controller, form, record) {
|
|
|
3086
3107
|
case 0:
|
|
3087
3108
|
err = err || {};
|
|
3088
3109
|
|
|
3089
|
-
if (!(!
|
|
3110
|
+
if (!(!err.taxRat && (values.taxRate || values.taxRate === 0) && !promptErr(err.lineAmountExcludeTax) && (values.lineAmountExcludeTax || values.lineAmountExcludeTax === 0))) {
|
|
3090
3111
|
_context8.next = 12;
|
|
3091
3112
|
break;
|
|
3092
3113
|
}
|
|
@@ -3124,7 +3145,7 @@ var updateUnitPriceTax = function updateUnitPriceTax(controller, form, record) {
|
|
|
3124
3145
|
});
|
|
3125
3146
|
|
|
3126
3147
|
case 15:
|
|
3127
|
-
if (!(!
|
|
3148
|
+
if (!(!err.taxRat && (values.taxRate || values.taxRate === 0) && !promptErr(err.priceExcludeTax) && (values.priceExcludeTax || values.priceExcludeTax === 0))) {
|
|
3128
3149
|
_context8.next = 20;
|
|
3129
3150
|
break;
|
|
3130
3151
|
}
|
|
@@ -3326,11 +3347,12 @@ var RowMenu = (function (props) {
|
|
|
3326
3347
|
var endowCode = useEndowCode(props.goods);
|
|
3327
3348
|
var itemList = React__default['default'].useMemo(function () {
|
|
3328
3349
|
var arr = [];
|
|
3350
|
+
console.log('model ===>', model, controller);
|
|
3329
3351
|
model !== 'prefab' && addDiscount && arr.push(addDiscount); // 添加折扣行
|
|
3330
3352
|
|
|
3331
|
-
endowCode && arr.push(endowCode); //
|
|
3353
|
+
endowCode && arr.push(endowCode); // 赋码
|
|
3332
3354
|
|
|
3333
|
-
model !== 'prefab' && delItem && arr.push(delItem); //
|
|
3355
|
+
model !== 'prefab' && delItem && arr.push(delItem); // 删除
|
|
3334
3356
|
|
|
3335
3357
|
if (!goodsMenuExpand || goodsMenuExpand.length === 0) return arr;
|
|
3336
3358
|
arr.unshift( /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Menu.Divider, {
|
|
@@ -4348,7 +4370,7 @@ var useRowSelection = (function () {
|
|
|
4348
4370
|
};
|
|
4349
4371
|
});
|
|
4350
4372
|
|
|
4351
|
-
var css_248z$6 = ".kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-table-tax-rate .ktsAnt3x-select-selection-selected-value {\n float: right;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able {\n display: flex;\n padding: 10px;\n border-bottom: 1px solid #dcdcdc;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list {\n flex: 1;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list button {\n padding-left: 10px;\n padding-right: 10px;\n border-radius: 12px;\n color: #0074ff;\n border: 1px solid #0074ff;\n margin: 0 10px;\n height: 24px;\n line-height: 22px;\n cursor: pointer;\n font-size: 12px;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list button[disabled] {\n color: rgba(0, 0, 0, 0.25);\n border: 1px solid;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-extend {\n flex: none;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-extend label {\n margin-right: 5px;\n}\n.kts-invoice-operate-goods-list-table {\n border-bottom: 1px solid #dcdcdc;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-discount {\n color: rgba(0, 0, 0, 0.25);\n background: #f5f5f5;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-list-able-list-itemName-import {\n display: flex;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-list-able-list-itemName-import .ktsAnt3x-btn {\n display: block;\n line-height: 0;\n width: auto;\n padding-right: 5px;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-form-item-children {\n height: 30px;\n display: block;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-table-body {\n height: 240px;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-form-explain {\n position: absolute;\n right: 6px;\n top: 6px;\n}\n.kts-invoice-operate-goods-list-table table {\n border-bottom: 1px solid #d9d9d9 !important;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td {\n padding: 0 !important;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-form-explain {\n display: none;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-form-item {\n padding: 0;\n margin: 0;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-form-item .ktsAnt3x-form-item-control {\n line-height: inherit;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .has-error .ktsAnt3x-select-selection,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .has-error .ktsAnt3x-input,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .has-error .ktsAnt3x-input:hover {\n border-right-width: 1px !important;\n border-top-width: 1px;\n border-left-width: 1px;\n border-bottom-width: 1px;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-select-selection--single,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-select-auto-complete.ktsAnt3x-select .ktsAnt3x-input:hover,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-input {\n height: 30px;\n border-radius: 0;\n border-right-width: 0 !important;\n border-top-width: 0;\n border-left-width: 0;\n border-bottom-width: 0;\n box-shadow: none;\n}\n";
|
|
4373
|
+
var css_248z$6 = ".kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-table-tax-rate .ktsAnt3x-select-selection-selected-value {\n float: right;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able {\n display: flex;\n padding: 10px;\n border-bottom: 1px solid #dcdcdc;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list {\n flex: 1;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list button {\n padding-left: 10px;\n padding-right: 10px;\n border-radius: 12px;\n color: #0074ff;\n border: 1px solid #0074ff;\n margin: 0 10px;\n height: 24px;\n line-height: 22px;\n cursor: pointer;\n font-size: 12px;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list button[disabled] {\n color: rgba(0, 0, 0, 0.25);\n border: 1px solid;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-extend {\n flex: none;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-extend label {\n margin-right: 5px;\n}\n.kts-invoice-operate-goods-list-table.kts-invoice-operate-prefab .ktsAnt3x-table-row {\n color: rgba(0, 0, 0, 0.25);\n background: #f5f5f5;\n}\n.kts-invoice-operate-goods-list-table {\n border-bottom: 1px solid #dcdcdc;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-discount {\n color: rgba(0, 0, 0, 0.25);\n background: #f5f5f5;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-list-able-list-itemName-import {\n display: flex;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-list-able-list-itemName-import .ktsAnt3x-btn {\n display: block;\n line-height: 0;\n width: auto;\n padding-right: 5px;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-form-item-children {\n height: 30px;\n display: block;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-table-body {\n height: 240px;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-form-explain {\n position: absolute;\n right: 6px;\n top: 6px;\n}\n.kts-invoice-operate-goods-list-table table {\n border-bottom: 1px solid #d9d9d9 !important;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td {\n padding: 0 !important;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-form-explain {\n display: none;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-form-item {\n padding: 0;\n margin: 0;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-form-item .ktsAnt3x-form-item-control {\n line-height: inherit;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .has-error .ktsAnt3x-select-selection,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .has-error .ktsAnt3x-input,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .has-error .ktsAnt3x-input:hover {\n border-right-width: 1px !important;\n border-top-width: 1px;\n border-left-width: 1px;\n border-bottom-width: 1px;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-select-selection--single,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-select-auto-complete.ktsAnt3x-select .ktsAnt3x-input:hover,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-input {\n height: 30px;\n border-radius: 0;\n border-right-width: 0 !important;\n border-top-width: 0;\n border-left-width: 0;\n border-bottom-width: 0;\n box-shadow: none;\n}\n";
|
|
4352
4374
|
styleInject(css_248z$6);
|
|
4353
4375
|
|
|
4354
4376
|
var GoodsList = /*#__PURE__*/function (_React$Component) {
|
|
@@ -4377,6 +4399,9 @@ var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
|
|
|
4377
4399
|
var goodsList = controller.useMemo(function (s) {
|
|
4378
4400
|
return s.goodsListState.goodsList;
|
|
4379
4401
|
}, []);
|
|
4402
|
+
var isprefab = controller.useMemo(function (s) {
|
|
4403
|
+
return s.model === 'prefab';
|
|
4404
|
+
}, []);
|
|
4380
4405
|
/** 表格行事件 */
|
|
4381
4406
|
|
|
4382
4407
|
var _onRow = useOnRow();
|
|
@@ -4459,7 +4484,9 @@ var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
|
|
|
4459
4484
|
}, /*#__PURE__*/React__default['default'].createElement(AddRowButton, null), /*#__PURE__*/React__default['default'].createElement(DelRowButton, null), /*#__PURE__*/React__default['default'].createElement(AddDiscountRowButton, null), /*#__PURE__*/React__default['default'].createElement(EndowCodeButton, null)), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4460
4485
|
className: "kts-invoice-operate-goods-list-able-extend"
|
|
4461
4486
|
}, props.menuExpansion, /*#__PURE__*/React__default['default'].createElement(TaxIncludedSwitch, null))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4462
|
-
className:
|
|
4487
|
+
className: classnames__default['default']('kts-invoice-operate-goods-list-table', {
|
|
4488
|
+
'kts-invoice-operate-prefab': isprefab
|
|
4489
|
+
})
|
|
4463
4490
|
}, /*#__PURE__*/React__default['default'].createElement(TableVirtual, {
|
|
4464
4491
|
bordered: true,
|
|
4465
4492
|
size: "small",
|
|
@@ -4475,7 +4502,7 @@ var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
|
|
|
4475
4502
|
},
|
|
4476
4503
|
dataSource: controller.useMemo(function (s) {
|
|
4477
4504
|
return s.goodsListState.goodsList;
|
|
4478
|
-
}, []),
|
|
4505
|
+
}, [controller]),
|
|
4479
4506
|
columns: useColumns(props.form),
|
|
4480
4507
|
rowSelection: useRowSelection(),
|
|
4481
4508
|
onRow: function onRow(record) {
|
|
@@ -4630,9 +4657,7 @@ var Main$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function
|
|
|
4630
4657
|
className: "kts-invoice-operate-seller-remarks-value"
|
|
4631
4658
|
}, getFieldDecorator('remarks', {
|
|
4632
4659
|
initialValue: props.defaultsellerRemarks
|
|
4633
|
-
})( /*#__PURE__*/React__default['default'].createElement(TextArea,
|
|
4634
|
-
readOnly: model === 'prefab'
|
|
4635
|
-
}))))));
|
|
4660
|
+
})( /*#__PURE__*/React__default['default'].createElement(TextArea, null))))));
|
|
4636
4661
|
});
|
|
4637
4662
|
|
|
4638
4663
|
var css_248z$8 = ".kts-invoice-operate-sign form {\n display: flex;\n}\n.kts-invoice-operate-sign form .ktsAnt3x-row.ktsAnt3x-form-item {\n margin: 0;\n}\n.kts-invoice-operate-sign form > div {\n flex: 1;\n text-align: center;\n}\n";
|
|
@@ -4656,14 +4681,12 @@ var Sign = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
|
|
|
4656
4681
|
}, getFieldDecorator('payee', {
|
|
4657
4682
|
initialValue: props.defaultPayee
|
|
4658
4683
|
})( /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Input, {
|
|
4659
|
-
readOnly: model === 'prefab',
|
|
4660
4684
|
size: "small"
|
|
4661
4685
|
})))), /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
|
|
4662
4686
|
label: "\u590D\u6838\u4EBA"
|
|
4663
4687
|
}, getFieldDecorator('reviewer', {
|
|
4664
4688
|
initialValue: props.defaultReviewer
|
|
4665
4689
|
})( /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Input, {
|
|
4666
|
-
readOnly: model === 'prefab',
|
|
4667
4690
|
size: "small"
|
|
4668
4691
|
})))), /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
|
|
4669
4692
|
label: "\u5F00\u7968\u4EBA"
|
|
@@ -4674,7 +4697,6 @@ var Sign = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
|
|
|
4674
4697
|
message: '请输入开票人'
|
|
4675
4698
|
}]
|
|
4676
4699
|
})( /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Input, {
|
|
4677
|
-
readOnly: model === 'prefab',
|
|
4678
4700
|
size: "small"
|
|
4679
4701
|
}))))));
|
|
4680
4702
|
});
|
|
@@ -5252,41 +5274,33 @@ var EndowCodeDrawer = (function () {
|
|
|
5252
5274
|
return _context2.abrupt("return");
|
|
5253
5275
|
|
|
5254
5276
|
case 4:
|
|
5255
|
-
if (!(endowcodeGoodIndex.length === 1)) {
|
|
5256
|
-
_context2.next = 17;
|
|
5257
|
-
break;
|
|
5258
|
-
}
|
|
5259
|
-
|
|
5260
5277
|
getDefaultValue = s.goodsListState.endowCode.getDefaultValue;
|
|
5261
5278
|
|
|
5262
5279
|
if (!getDefaultValue) {
|
|
5263
|
-
_context2.next =
|
|
5280
|
+
_context2.next = 13;
|
|
5264
5281
|
break;
|
|
5265
5282
|
}
|
|
5266
5283
|
|
|
5267
5284
|
_context2.t0 = setDefaultValue;
|
|
5268
|
-
_context2.next =
|
|
5269
|
-
return getDefaultValue(_objectSpread2({}, good));
|
|
5285
|
+
_context2.next = 9;
|
|
5286
|
+
return getDefaultValue(_objectSpread2({}, good), endowcodeGoodIndex.length);
|
|
5270
5287
|
|
|
5271
|
-
case
|
|
5288
|
+
case 9:
|
|
5272
5289
|
_context2.t1 = _context2.sent;
|
|
5273
5290
|
(0, _context2.t0)(_context2.t1);
|
|
5274
|
-
_context2.next =
|
|
5291
|
+
_context2.next = 14;
|
|
5275
5292
|
break;
|
|
5276
5293
|
|
|
5277
|
-
case
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
setDefaultValue({
|
|
5286
|
-
taxRate: good.taxRate
|
|
5287
|
-
});
|
|
5294
|
+
case 13:
|
|
5295
|
+
if (endowcodeGoodIndex.length === 1) {
|
|
5296
|
+
setDefaultValue(good);
|
|
5297
|
+
} else {
|
|
5298
|
+
setDefaultValue({
|
|
5299
|
+
taxRate: good.taxRate
|
|
5300
|
+
});
|
|
5301
|
+
}
|
|
5288
5302
|
|
|
5289
|
-
case
|
|
5303
|
+
case 14:
|
|
5290
5304
|
case "end":
|
|
5291
5305
|
return _context2.stop();
|
|
5292
5306
|
}
|
|
@@ -5761,7 +5775,17 @@ var Main$3 = function Main(props) {
|
|
|
5761
5775
|
var controller = React__default['default'].useMemo(function () {
|
|
5762
5776
|
return props.controller || new InvoiceController();
|
|
5763
5777
|
}, [props.controller]);
|
|
5778
|
+
|
|
5779
|
+
var _React$useState = React__default['default'].useState(0),
|
|
5780
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
5781
|
+
key = _React$useState2[0],
|
|
5782
|
+
setKey = _React$useState2[1];
|
|
5783
|
+
|
|
5784
|
+
React__default['default'].useEffect(function () {
|
|
5785
|
+
setKey(key + 1);
|
|
5786
|
+
}, [controller]);
|
|
5764
5787
|
return /*#__PURE__*/React__default['default'].createElement(InvoiceContext.Provider, {
|
|
5788
|
+
key: key,
|
|
5765
5789
|
value: controller
|
|
5766
5790
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5767
5791
|
className: "kts-invoice-operate"
|