kts-component-invoice-operate 3.2.181-16 → 3.2.181-18
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/IGood/index.d.ts +1 -0
- package/dist/Invoice/ui/default/GoodsList/hook/useColumns/ui/RowMenu/hook/useDelItem/index.d.ts +1 -1
- package/dist/index.esm.js +18 -11
- package/dist/index.js +18 -11
- package/package.json +1 -1
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood/index.ts +2 -0
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/autoFillFn/index.ts +1 -1
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/index.tsx +8 -8
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/RowMenu/hook/useDelItem/index.tsx +7 -1
- package/src/Invoice/ui/default/ImportGoodsDrawer/index.tsx +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -9796,7 +9796,7 @@ var onChangeSwitchTax = /*#__PURE__*/function () {
|
|
|
9796
9796
|
var lineAmountIncludeTax = format2(evaluate("".concat(priceIncludeTax, " * ").concat(quantity)));
|
|
9797
9797
|
var taxAmount = countTaxAmount(lineAmountIncludeTax, controller.state.goodsListState.deduction, taxRate);
|
|
9798
9798
|
var lineAmountExcludeTax = countAmountExcludeTax(lineAmountIncludeTax, taxAmount);
|
|
9799
|
-
var priceExcludeTax = countPrice(lineAmountExcludeTax, quantity,
|
|
9799
|
+
var priceExcludeTax = countPrice(lineAmountExcludeTax, quantity, 8);
|
|
9800
9800
|
return _objectSpread2(_objectSpread2({}, good), {}, {
|
|
9801
9801
|
lineAmountExcludeTax: lineAmountExcludeTax,
|
|
9802
9802
|
lineAmountIncludeTax: lineAmountIncludeTax,
|
|
@@ -11118,6 +11118,8 @@ function SvgSpot(props) {
|
|
|
11118
11118
|
}
|
|
11119
11119
|
|
|
11120
11120
|
var useDelItem = (function (goods) {
|
|
11121
|
+
var _goods$referenceLines;
|
|
11122
|
+
|
|
11121
11123
|
var controller = Invoice.useInvoiceController();
|
|
11122
11124
|
var model = controller.useMemo(function (s) {
|
|
11123
11125
|
return s.model;
|
|
@@ -11128,6 +11130,11 @@ var useDelItem = (function (goods) {
|
|
|
11128
11130
|
var onClick = React.useCallback(function () {
|
|
11129
11131
|
controller.delGood(goods.$index);
|
|
11130
11132
|
}, [controller, goods.$index]);
|
|
11133
|
+
console.log('111111111', goods);
|
|
11134
|
+
|
|
11135
|
+
if (goods.lineAttribute === LineAttributeType$1.正常 && (goods === null || goods === void 0 ? void 0 : goods.referenceLines) && (goods === null || goods === void 0 ? void 0 : (_goods$referenceLines = goods.referenceLines) === null || _goods$referenceLines === void 0 ? void 0 : _goods$referenceLines.length) > 0) {
|
|
11136
|
+
return undefined;
|
|
11137
|
+
}
|
|
11131
11138
|
|
|
11132
11139
|
if (goods.lineAttribute === LineAttributeType$1.被折扣行) {
|
|
11133
11140
|
return undefined;
|
|
@@ -11144,7 +11151,7 @@ var useDelItem = (function (goods) {
|
|
|
11144
11151
|
return {
|
|
11145
11152
|
key: 'delItem',
|
|
11146
11153
|
title: '删除',
|
|
11147
|
-
|
|
11154
|
+
disabled: onClick
|
|
11148
11155
|
}; // return React.useMemo(() => {
|
|
11149
11156
|
// return <Menu.Item key="delItem" onClick={onClick}><Text strong type="danger">删除</Text></Menu.Item>
|
|
11150
11157
|
// }, [onClick])
|
|
@@ -14013,13 +14020,13 @@ var useColumns = (function (form) {
|
|
|
14013
14020
|
render: function render(value, record) {
|
|
14014
14021
|
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && model !== 'prefab') {
|
|
14015
14022
|
return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('priceIncludeTax', {
|
|
14016
|
-
initialValue: nonScientificNotation(editGood.priceIncludeTax,
|
|
14023
|
+
initialValue: nonScientificNotation(editGood.priceIncludeTax, 8),
|
|
14017
14024
|
getValueFromEvent: onNumberValueChange,
|
|
14018
14025
|
rules: [].concat(_toConsumableArray(getReplenishRules('priceIncludeTax')), [// { pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '单价必须为数字' },
|
|
14019
14026
|
// { pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '金额必须为数字' },
|
|
14020
14027
|
{
|
|
14021
|
-
pattern: /^[+-]?(0|([1-9]\d*))(\.\d{1,
|
|
14022
|
-
message: '单价必须为数字且最多保留
|
|
14028
|
+
pattern: /^[+-]?(0|([1-9]\d*))(\.\d{1,8})?$/,
|
|
14029
|
+
message: '单价必须为数字且最多保留8位小数'
|
|
14023
14030
|
}, {
|
|
14024
14031
|
validator: function () {
|
|
14025
14032
|
var _validator3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(_, value, callback) {
|
|
@@ -14095,7 +14102,7 @@ var useColumns = (function (form) {
|
|
|
14095
14102
|
style: {
|
|
14096
14103
|
padding: '0 10px'
|
|
14097
14104
|
}
|
|
14098
|
-
}, nonScientificNotation(value,
|
|
14105
|
+
}, nonScientificNotation(value, 8));
|
|
14099
14106
|
}
|
|
14100
14107
|
}
|
|
14101
14108
|
}, {
|
|
@@ -14109,12 +14116,12 @@ var useColumns = (function (form) {
|
|
|
14109
14116
|
render: function render(value, record) {
|
|
14110
14117
|
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && model !== 'prefab') {
|
|
14111
14118
|
return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('priceExcludeTax', {
|
|
14112
|
-
initialValue: nonScientificNotation(editGood.priceExcludeTax,
|
|
14119
|
+
initialValue: nonScientificNotation(editGood.priceExcludeTax, 8),
|
|
14113
14120
|
getValueFromEvent: onNumberValueChange,
|
|
14114
14121
|
rules: [].concat(_toConsumableArray(getReplenishRules('priceExcludeTax')), [// { pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '单价必须为数字' },
|
|
14115
14122
|
{
|
|
14116
|
-
pattern: /^[+-]?(0|([1-9]\d*))(\.\d{1,
|
|
14117
|
-
message: '单价必须为数字且最多保留
|
|
14123
|
+
pattern: /^[+-]?(0|([1-9]\d*))(\.\d{1,8})?$/,
|
|
14124
|
+
message: '单价必须为数字且最多保留8位小数'
|
|
14118
14125
|
}, {
|
|
14119
14126
|
validator: function () {
|
|
14120
14127
|
var _validator4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(_, value, callback) {
|
|
@@ -14190,7 +14197,7 @@ var useColumns = (function (form) {
|
|
|
14190
14197
|
style: {
|
|
14191
14198
|
padding: '0 10px'
|
|
14192
14199
|
}
|
|
14193
|
-
}, nonScientificNotation(value,
|
|
14200
|
+
}, nonScientificNotation(value, 8));
|
|
14194
14201
|
}
|
|
14195
14202
|
}
|
|
14196
14203
|
}, {
|
|
@@ -27022,7 +27029,7 @@ var DrawerBody$1 = function DrawerBody() {
|
|
|
27022
27029
|
editGood.priceIncludeTax = undefined;
|
|
27023
27030
|
editGood.priceExcludeTax = undefined;
|
|
27024
27031
|
} else {
|
|
27025
|
-
editGood.priceExcludeTax = editGood.priceExcludeTax || getPriceExcludeTax$1(editGood, record,
|
|
27032
|
+
editGood.priceExcludeTax = editGood.priceExcludeTax || getPriceExcludeTax$1(editGood, record, 8);
|
|
27026
27033
|
}
|
|
27027
27034
|
|
|
27028
27035
|
if (editGood.quantity && editGood.priceIncludeTax) {
|
package/dist/index.js
CHANGED
|
@@ -9806,7 +9806,7 @@ var onChangeSwitchTax = /*#__PURE__*/function () {
|
|
|
9806
9806
|
var lineAmountIncludeTax = format2(evaluate("".concat(priceIncludeTax, " * ").concat(quantity)));
|
|
9807
9807
|
var taxAmount = countTaxAmount(lineAmountIncludeTax, controller.state.goodsListState.deduction, taxRate);
|
|
9808
9808
|
var lineAmountExcludeTax = countAmountExcludeTax(lineAmountIncludeTax, taxAmount);
|
|
9809
|
-
var priceExcludeTax = countPrice(lineAmountExcludeTax, quantity,
|
|
9809
|
+
var priceExcludeTax = countPrice(lineAmountExcludeTax, quantity, 8);
|
|
9810
9810
|
return _objectSpread2(_objectSpread2({}, good), {}, {
|
|
9811
9811
|
lineAmountExcludeTax: lineAmountExcludeTax,
|
|
9812
9812
|
lineAmountIncludeTax: lineAmountIncludeTax,
|
|
@@ -11128,6 +11128,8 @@ function SvgSpot(props) {
|
|
|
11128
11128
|
}
|
|
11129
11129
|
|
|
11130
11130
|
var useDelItem = (function (goods) {
|
|
11131
|
+
var _goods$referenceLines;
|
|
11132
|
+
|
|
11131
11133
|
var controller = Invoice.useInvoiceController();
|
|
11132
11134
|
var model = controller.useMemo(function (s) {
|
|
11133
11135
|
return s.model;
|
|
@@ -11138,6 +11140,11 @@ var useDelItem = (function (goods) {
|
|
|
11138
11140
|
var onClick = React__default['default'].useCallback(function () {
|
|
11139
11141
|
controller.delGood(goods.$index);
|
|
11140
11142
|
}, [controller, goods.$index]);
|
|
11143
|
+
console.log('111111111', goods);
|
|
11144
|
+
|
|
11145
|
+
if (goods.lineAttribute === LineAttributeType$1.正常 && (goods === null || goods === void 0 ? void 0 : goods.referenceLines) && (goods === null || goods === void 0 ? void 0 : (_goods$referenceLines = goods.referenceLines) === null || _goods$referenceLines === void 0 ? void 0 : _goods$referenceLines.length) > 0) {
|
|
11146
|
+
return undefined;
|
|
11147
|
+
}
|
|
11141
11148
|
|
|
11142
11149
|
if (goods.lineAttribute === LineAttributeType$1.被折扣行) {
|
|
11143
11150
|
return undefined;
|
|
@@ -11154,7 +11161,7 @@ var useDelItem = (function (goods) {
|
|
|
11154
11161
|
return {
|
|
11155
11162
|
key: 'delItem',
|
|
11156
11163
|
title: '删除',
|
|
11157
|
-
|
|
11164
|
+
disabled: onClick
|
|
11158
11165
|
}; // return React.useMemo(() => {
|
|
11159
11166
|
// return <Menu.Item key="delItem" onClick={onClick}><Text strong type="danger">删除</Text></Menu.Item>
|
|
11160
11167
|
// }, [onClick])
|
|
@@ -14023,13 +14030,13 @@ var useColumns = (function (form) {
|
|
|
14023
14030
|
render: function render(value, record) {
|
|
14024
14031
|
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && model !== 'prefab') {
|
|
14025
14032
|
return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('priceIncludeTax', {
|
|
14026
|
-
initialValue: nonScientificNotation(editGood.priceIncludeTax,
|
|
14033
|
+
initialValue: nonScientificNotation(editGood.priceIncludeTax, 8),
|
|
14027
14034
|
getValueFromEvent: onNumberValueChange,
|
|
14028
14035
|
rules: [].concat(_toConsumableArray(getReplenishRules('priceIncludeTax')), [// { pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '单价必须为数字' },
|
|
14029
14036
|
// { pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '金额必须为数字' },
|
|
14030
14037
|
{
|
|
14031
|
-
pattern: /^[+-]?(0|([1-9]\d*))(\.\d{1,
|
|
14032
|
-
message: '单价必须为数字且最多保留
|
|
14038
|
+
pattern: /^[+-]?(0|([1-9]\d*))(\.\d{1,8})?$/,
|
|
14039
|
+
message: '单价必须为数字且最多保留8位小数'
|
|
14033
14040
|
}, {
|
|
14034
14041
|
validator: function () {
|
|
14035
14042
|
var _validator3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(_, value, callback) {
|
|
@@ -14105,7 +14112,7 @@ var useColumns = (function (form) {
|
|
|
14105
14112
|
style: {
|
|
14106
14113
|
padding: '0 10px'
|
|
14107
14114
|
}
|
|
14108
|
-
}, nonScientificNotation(value,
|
|
14115
|
+
}, nonScientificNotation(value, 8));
|
|
14109
14116
|
}
|
|
14110
14117
|
}
|
|
14111
14118
|
}, {
|
|
@@ -14119,12 +14126,12 @@ var useColumns = (function (form) {
|
|
|
14119
14126
|
render: function render(value, record) {
|
|
14120
14127
|
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && model !== 'prefab') {
|
|
14121
14128
|
return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('priceExcludeTax', {
|
|
14122
|
-
initialValue: nonScientificNotation(editGood.priceExcludeTax,
|
|
14129
|
+
initialValue: nonScientificNotation(editGood.priceExcludeTax, 8),
|
|
14123
14130
|
getValueFromEvent: onNumberValueChange,
|
|
14124
14131
|
rules: [].concat(_toConsumableArray(getReplenishRules('priceExcludeTax')), [// { pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '单价必须为数字' },
|
|
14125
14132
|
{
|
|
14126
|
-
pattern: /^[+-]?(0|([1-9]\d*))(\.\d{1,
|
|
14127
|
-
message: '单价必须为数字且最多保留
|
|
14133
|
+
pattern: /^[+-]?(0|([1-9]\d*))(\.\d{1,8})?$/,
|
|
14134
|
+
message: '单价必须为数字且最多保留8位小数'
|
|
14128
14135
|
}, {
|
|
14129
14136
|
validator: function () {
|
|
14130
14137
|
var _validator4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(_, value, callback) {
|
|
@@ -14200,7 +14207,7 @@ var useColumns = (function (form) {
|
|
|
14200
14207
|
style: {
|
|
14201
14208
|
padding: '0 10px'
|
|
14202
14209
|
}
|
|
14203
|
-
}, nonScientificNotation(value,
|
|
14210
|
+
}, nonScientificNotation(value, 8));
|
|
14204
14211
|
}
|
|
14205
14212
|
}
|
|
14206
14213
|
}, {
|
|
@@ -27032,7 +27039,7 @@ var DrawerBody$1 = function DrawerBody() {
|
|
|
27032
27039
|
editGood.priceIncludeTax = undefined;
|
|
27033
27040
|
editGood.priceExcludeTax = undefined;
|
|
27034
27041
|
} else {
|
|
27035
|
-
editGood.priceExcludeTax = editGood.priceExcludeTax || getPriceExcludeTax$1(editGood, record,
|
|
27042
|
+
editGood.priceExcludeTax = editGood.priceExcludeTax || getPriceExcludeTax$1(editGood, record, 8);
|
|
27036
27043
|
}
|
|
27037
27044
|
|
|
27038
27045
|
if (editGood.quantity && editGood.priceIncludeTax) {
|
package/package.json
CHANGED
|
@@ -654,7 +654,7 @@ export const onChangeSwitchTax = async (controller: InvoiceController, isTaxIncl
|
|
|
654
654
|
const lineAmountIncludeTax: any = format2(evaluate(`${priceIncludeTax} * ${quantity}`));
|
|
655
655
|
const taxAmount: any = countTaxAmount(lineAmountIncludeTax, controller.state.goodsListState.deduction, taxRate as any);
|
|
656
656
|
const lineAmountExcludeTax: any = countAmountExcludeTax(lineAmountIncludeTax, taxAmount);
|
|
657
|
-
const priceExcludeTax: any = countPrice(lineAmountExcludeTax, quantity,
|
|
657
|
+
const priceExcludeTax: any = countPrice(lineAmountExcludeTax, quantity, 8);
|
|
658
658
|
|
|
659
659
|
return {
|
|
660
660
|
...good,
|
|
@@ -320,15 +320,15 @@ export default (form: WrappedFormUtils) => {
|
|
|
320
320
|
return (
|
|
321
321
|
<Form.Item>
|
|
322
322
|
{getFieldDecorator('priceIncludeTax', {
|
|
323
|
-
initialValue: nonScientificNotation(editGood.priceIncludeTax,
|
|
323
|
+
initialValue: nonScientificNotation(editGood.priceIncludeTax, 8),
|
|
324
324
|
getValueFromEvent: onNumberValueChange,
|
|
325
325
|
rules: [
|
|
326
326
|
...getReplenishRules('priceIncludeTax'),
|
|
327
327
|
// { pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '单价必须为数字' },
|
|
328
328
|
// { pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '金额必须为数字' },
|
|
329
329
|
{
|
|
330
|
-
pattern: /^[+-]?(0|([1-9]\d*))(\.\d{1,
|
|
331
|
-
message: '单价必须为数字且最多保留
|
|
330
|
+
pattern: /^[+-]?(0|([1-9]\d*))(\.\d{1,8})?$/,
|
|
331
|
+
message: '单价必须为数字且最多保留8位小数'
|
|
332
332
|
},
|
|
333
333
|
{
|
|
334
334
|
validator: async (_, value, callback) => {
|
|
@@ -364,7 +364,7 @@ export default (form: WrappedFormUtils) => {
|
|
|
364
364
|
</Form.Item>
|
|
365
365
|
);
|
|
366
366
|
} else {
|
|
367
|
-
return <span style={{ padding: '0 10px' }}>{nonScientificNotation(value,
|
|
367
|
+
return <span style={{ padding: '0 10px' }}>{nonScientificNotation(value, 8)}</span>;
|
|
368
368
|
}
|
|
369
369
|
},
|
|
370
370
|
},
|
|
@@ -379,14 +379,14 @@ export default (form: WrappedFormUtils) => {
|
|
|
379
379
|
return (
|
|
380
380
|
<Form.Item>
|
|
381
381
|
{getFieldDecorator('priceExcludeTax', {
|
|
382
|
-
initialValue: nonScientificNotation(editGood.priceExcludeTax,
|
|
382
|
+
initialValue: nonScientificNotation(editGood.priceExcludeTax, 8),
|
|
383
383
|
getValueFromEvent: onNumberValueChange,
|
|
384
384
|
rules: [
|
|
385
385
|
...getReplenishRules('priceExcludeTax'),
|
|
386
386
|
// { pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '单价必须为数字' },
|
|
387
387
|
{
|
|
388
|
-
pattern: /^[+-]?(0|([1-9]\d*))(\.\d{1,
|
|
389
|
-
message: '单价必须为数字且最多保留
|
|
388
|
+
pattern: /^[+-]?(0|([1-9]\d*))(\.\d{1,8})?$/,
|
|
389
|
+
message: '单价必须为数字且最多保留8位小数'
|
|
390
390
|
},
|
|
391
391
|
{
|
|
392
392
|
validator: async (_, value, callback) => {
|
|
@@ -422,7 +422,7 @@ export default (form: WrappedFormUtils) => {
|
|
|
422
422
|
</Form.Item>
|
|
423
423
|
);
|
|
424
424
|
} else {
|
|
425
|
-
return <span style={{ padding: '0 10px' }}>{nonScientificNotation(value,
|
|
425
|
+
return <span style={{ padding: '0 10px' }}>{nonScientificNotation(value, 8)}</span>;
|
|
426
426
|
}
|
|
427
427
|
},
|
|
428
428
|
},
|
package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/RowMenu/hook/useDelItem/index.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
// import { Menu, Typography } from 'kts-components-antd-x3';
|
|
3
3
|
import { IGood, LineAttributeType } from '../../../../../../../../../InvoiceController';
|
|
4
|
-
import Invoice from '../../../../../../../../..';
|
|
4
|
+
import Invoice from '../../../../../../../../..';
|
|
5
5
|
|
|
6
6
|
// const { Text } = Typography;
|
|
7
7
|
|
|
@@ -16,6 +16,11 @@ export default (goods: IGood) => {
|
|
|
16
16
|
const onClick = React.useCallback(() => {
|
|
17
17
|
controller.delGood(goods.$index);
|
|
18
18
|
}, [controller, goods.$index]);
|
|
19
|
+
console.log('111111111', goods);
|
|
20
|
+
|
|
21
|
+
if (goods.lineAttribute === LineAttributeType.正常 && goods?.referenceLines && goods?.referenceLines?.length > 0 ) {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
19
24
|
|
|
20
25
|
if (goods.lineAttribute === LineAttributeType.被折扣行) {
|
|
21
26
|
return undefined;
|
|
@@ -32,6 +37,7 @@ export default (goods: IGood) => {
|
|
|
32
37
|
return {
|
|
33
38
|
key:'delItem',
|
|
34
39
|
title:'删除',
|
|
40
|
+
disabled:
|
|
35
41
|
onClick,
|
|
36
42
|
}
|
|
37
43
|
|
|
@@ -112,7 +112,7 @@ const DrawerBody = () => {
|
|
|
112
112
|
editGood.priceIncludeTax = undefined;
|
|
113
113
|
editGood.priceExcludeTax = undefined;
|
|
114
114
|
} else {
|
|
115
|
-
editGood.priceExcludeTax = editGood.priceExcludeTax || getPriceExcludeTax(editGood, record,
|
|
115
|
+
editGood.priceExcludeTax = editGood.priceExcludeTax || getPriceExcludeTax(editGood, record, 8) as number;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
if (editGood.quantity && editGood.priceIncludeTax) {
|