kts-component-invoice-operate 3.2.34 → 3.2.36
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/index.esm.js +40 -40
- package/dist/index.js +39 -39
- package/package.json +1 -1
- package/src/Invoice/InvoiceController/fns/getGoodsSearch.ts +4 -2
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/index.tsx +5 -1
- package/src/Invoice/ui/default/GoodsList/ui/Search/index.tsx +3 -1
- package/src/Invoice/ui/default/ImportGoodsDrawer/index.tsx +20 -1
- package/src/Invoice/ui/digtal/Stakeholder/index.tsx +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -4,7 +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 as Icon$1, Tag as Tag$1, Select, Button, Tooltip, Switch as Switch$1, Typography, Menu, Dropdown, AutoComplete as AutoComplete$2, Spin, Checkbox, Drawer, Descriptions, Empty, Divider, Popover, Table as Table$1, Tree, Modal as Modal$1, Row as Row$1, Col as Col$1 } from 'kts-components-antd-x3';
|
|
6
6
|
import { v4 } from 'uuid';
|
|
7
|
-
import { message as message$1, TableManual, Switch, AutoComplete as AutoComplete$1, Row, Col, Button as Button$1, Tooltip as Tooltip$1,
|
|
7
|
+
import { message as message$1, TableManual, Switch, AutoComplete as AutoComplete$1, Row, Col, Button as Button$1, Tooltip as Tooltip$1, Input as Input$1, Select as Select$1, Spin as Spin$1, Menu as Menu$1, Form as Form$1, Drawer as Drawer$1, Space, Radio, InputNumber, Popconfirm, Modal } from 'kts-xui';
|
|
8
8
|
import classnames from 'classnames';
|
|
9
9
|
import { Table } from 'kts-components-antd-x4-v4';
|
|
10
10
|
import { render } from 'react-dom';
|
|
@@ -1695,10 +1695,12 @@ var validateFields = function validateFields(form) {
|
|
|
1695
1695
|
function getGoodsSearch(goodsList, search, isTaxIncluded) {
|
|
1696
1696
|
if (!search) return goodsList;
|
|
1697
1697
|
return goodsList.filter(function (e) {
|
|
1698
|
-
var _e$itemName$indexOf, _e$itemName, _e$itemModelName$inde, _e$itemModelName, _e$lineAmountIncludeT, _e$lineAmountExcludeT;
|
|
1698
|
+
var _e$itemName$indexOf, _e$itemName, _e$itemCode$indexOf, _e$itemCode, _e$itemModelName$inde, _e$itemModelName, _e$lineAmountIncludeT, _e$lineAmountExcludeT;
|
|
1699
1699
|
|
|
1700
1700
|
if (((_e$itemName$indexOf = (_e$itemName = e.itemName) === null || _e$itemName === void 0 ? void 0 : _e$itemName.indexOf(search)) !== null && _e$itemName$indexOf !== void 0 ? _e$itemName$indexOf : -1) >= 0) {
|
|
1701
1701
|
return true;
|
|
1702
|
+
} else if (((_e$itemCode$indexOf = (_e$itemCode = e.itemCode) === null || _e$itemCode === void 0 ? void 0 : _e$itemCode.indexOf(search)) !== null && _e$itemCode$indexOf !== void 0 ? _e$itemCode$indexOf : -1) >= 0) {
|
|
1703
|
+
return true;
|
|
1702
1704
|
} else if (((_e$itemModelName$inde = (_e$itemModelName = e.itemModelName) === null || _e$itemModelName === void 0 ? void 0 : _e$itemModelName.indexOf(search)) !== null && _e$itemModelName$inde !== void 0 ? _e$itemModelName$inde : -1) >= 0) {
|
|
1703
1705
|
return true;
|
|
1704
1706
|
} else if ("".concat(isTaxIncluded ? (_e$lineAmountIncludeT = e.lineAmountIncludeTax) === null || _e$lineAmountIncludeT === void 0 ? void 0 : _e$lineAmountIncludeT.toFixed(2) : (_e$lineAmountExcludeT = e.lineAmountExcludeTax) === null || _e$lineAmountExcludeT === void 0 ? void 0 : _e$lineAmountExcludeT.toFixed(2)).indexOf(search) >= 0) {
|
|
@@ -9999,6 +10001,9 @@ function Search() {
|
|
|
9999
10001
|
var readOnly = controller.useMemo(function (s) {
|
|
10000
10002
|
return !!s.goodsListState.editGood;
|
|
10001
10003
|
}, []);
|
|
10004
|
+
var columnshide = controller.useMemo(function (s) {
|
|
10005
|
+
return s.goodsListState.columnshide;
|
|
10006
|
+
}, []);
|
|
10002
10007
|
/** 是否含税 */
|
|
10003
10008
|
|
|
10004
10009
|
var isTaxIncluded = controller.useMemo(function (s) {
|
|
@@ -10062,7 +10067,7 @@ function Search() {
|
|
|
10062
10067
|
readOnly: readOnly,
|
|
10063
10068
|
value: value,
|
|
10064
10069
|
className: "kts-invoice-operate-goods-list-search",
|
|
10065
|
-
placeholder: "\u8BF7\u60A8\u8F93\u5165\u9879\u76EE\u540D\u79F0\u3001\u89C4\u683C\u578B\u53F7\u3001\u91D1\u989D(".concat(isTaxIncluded ? '含税' : '不含税', ")\u641C\u7D22"),
|
|
10070
|
+
placeholder: "\u8BF7\u60A8\u8F93\u5165".concat(columnshide.includes('itemCode') ? '' : '商品编码、', "\u9879\u76EE\u540D\u79F0\u3001\u89C4\u683C\u578B\u53F7\u3001\u91D1\u989D(").concat(isTaxIncluded ? '含税' : '不含税', ")\u641C\u7D22"),
|
|
10066
10071
|
prefix: React.createElement(Icon$1, {
|
|
10067
10072
|
component: SvgMagnifier,
|
|
10068
10073
|
style: {
|
|
@@ -12384,7 +12389,11 @@ var useColumns = (function (form) {
|
|
|
12384
12389
|
render: function render(_, record) {
|
|
12385
12390
|
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
12386
12391
|
return React.createElement(Form.Item, null, getFieldDecorator('itemCode', {
|
|
12387
|
-
initialValue: editGood.itemCode
|
|
12392
|
+
initialValue: editGood.itemCode,
|
|
12393
|
+
rules: [].concat(_toConsumableArray(getReplenishRules('itemCode')), [{
|
|
12394
|
+
pattern: /^.{1,19}$/,
|
|
12395
|
+
message: '商品编码长度不能超过19位'
|
|
12396
|
+
}])
|
|
12388
12397
|
})(React.createElement(ItemCodeInput, {
|
|
12389
12398
|
record: record,
|
|
12390
12399
|
onChange: function () {
|
|
@@ -12416,7 +12425,11 @@ var useColumns = (function (form) {
|
|
|
12416
12425
|
}()
|
|
12417
12426
|
})));
|
|
12418
12427
|
} else {
|
|
12419
|
-
return
|
|
12428
|
+
return React.createElement("span", {
|
|
12429
|
+
style: {
|
|
12430
|
+
padding: '0 10px'
|
|
12431
|
+
}
|
|
12432
|
+
}, record.itemCode);
|
|
12420
12433
|
}
|
|
12421
12434
|
}
|
|
12422
12435
|
}, {
|
|
@@ -15633,13 +15646,6 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
|
|
|
15633
15646
|
gutter: [16, 0]
|
|
15634
15647
|
}, React.createElement(Col, {
|
|
15635
15648
|
span: 24
|
|
15636
|
-
}, React.createElement(Form.Item, {
|
|
15637
|
-
label: "\u8D2D\u4E70\u65B9\u4FE1\u606F",
|
|
15638
|
-
colon: false
|
|
15639
|
-
}, getFieldDecorator('naturalPersonFlag', {})(React.createElement(NaturalPersonFlag, {
|
|
15640
|
-
readOnly: isReadOnly('naturalPersonFlag')
|
|
15641
|
-
})))), React.createElement(Col, {
|
|
15642
|
-
span: 24
|
|
15643
15649
|
}, React.createElement(Form.Item, {
|
|
15644
15650
|
label: "\u540D\u79F0",
|
|
15645
15651
|
colon: false
|
|
@@ -15822,27 +15828,6 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
|
|
|
15822
15828
|
})))))))));
|
|
15823
15829
|
});
|
|
15824
15830
|
|
|
15825
|
-
function NaturalPersonFlag(props) {
|
|
15826
|
-
var _React$useState3 = React.useState(props.value || 0),
|
|
15827
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
15828
|
-
value = _React$useState4[0],
|
|
15829
|
-
setValue = _React$useState4[1];
|
|
15830
|
-
|
|
15831
|
-
var onChange = React.useCallback(function (e) {
|
|
15832
|
-
if (props.readOnly) return;
|
|
15833
|
-
setValue(e.target.checked ? 1 : 0);
|
|
15834
|
-
props.onChange && props.onChange(e.target.checked ? 1 : 0);
|
|
15835
|
-
}, [props.onChange, props.readOnly]);
|
|
15836
|
-
React.useEffect(function () {
|
|
15837
|
-
setValue(props.value || 0);
|
|
15838
|
-
}, [props.value]);
|
|
15839
|
-
return React.createElement(Checkbox$1, {
|
|
15840
|
-
disabled: props.readOnly,
|
|
15841
|
-
checked: value === 1,
|
|
15842
|
-
onChange: onChange
|
|
15843
|
-
}, "\u662F\u5426\u5F00\u7968\u7ED9\u81EA\u7136\u4EBA");
|
|
15844
|
-
}
|
|
15845
|
-
|
|
15846
15831
|
function BuyerNameInput$1(props) {
|
|
15847
15832
|
var fieldName = props.fieldName,
|
|
15848
15833
|
form = props.myform;
|
|
@@ -21242,6 +21227,7 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
21242
21227
|
|
|
21243
21228
|
between = _objectSpread2({}, record);
|
|
21244
21229
|
between.itemName = getItemName(record, s.goodsListState.editGood);
|
|
21230
|
+
between.itemCode = getItemCode(record, s.goodsListState.editGood);
|
|
21245
21231
|
between.itemNameOther = getItemNameOther(record, s.goodsListState.editGood); // 设置编辑货物
|
|
21246
21232
|
|
|
21247
21233
|
editGood = s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), between);
|
|
@@ -21277,22 +21263,22 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
21277
21263
|
s.goodsListState.importGoods.isVisibleDrawer = false;
|
|
21278
21264
|
|
|
21279
21265
|
if (!s.goodsListState.isTaxIncluded) {
|
|
21280
|
-
_context2.next =
|
|
21266
|
+
_context2.next = 26;
|
|
21281
21267
|
break;
|
|
21282
21268
|
}
|
|
21283
21269
|
|
|
21284
|
-
_context2.next =
|
|
21270
|
+
_context2.next = 24;
|
|
21285
21271
|
return updateUnitPriceExcludingTax(controller, s.goodsListState.form, record);
|
|
21286
21272
|
|
|
21287
|
-
case
|
|
21288
|
-
_context2.next =
|
|
21273
|
+
case 24:
|
|
21274
|
+
_context2.next = 28;
|
|
21289
21275
|
break;
|
|
21290
21276
|
|
|
21291
|
-
case
|
|
21292
|
-
_context2.next =
|
|
21277
|
+
case 26:
|
|
21278
|
+
_context2.next = 28;
|
|
21293
21279
|
return updateUnitPriceTax(controller, s.goodsListState.form, record);
|
|
21294
21280
|
|
|
21295
|
-
case
|
|
21281
|
+
case 28:
|
|
21296
21282
|
case "end":
|
|
21297
21283
|
return _context2.stop();
|
|
21298
21284
|
}
|
|
@@ -21348,6 +21334,20 @@ var getItemNameOther = function getItemNameOther(record, editGood) {
|
|
|
21348
21334
|
// return `*${shorthand}*${record.itemNameSelf}`;
|
|
21349
21335
|
// }
|
|
21350
21336
|
return record.itemName;
|
|
21337
|
+
}; // 获取商品编号
|
|
21338
|
+
|
|
21339
|
+
|
|
21340
|
+
var getItemCode = function getItemCode(record, editGood) {
|
|
21341
|
+
// let shorthand;
|
|
21342
|
+
// shorthand = record.shorthand;
|
|
21343
|
+
// if (shorthand) {
|
|
21344
|
+
// return `*${shorthand}*${record.itemName}`;
|
|
21345
|
+
// }
|
|
21346
|
+
// shorthand = getSN(editGood.itemName)?.shorthand;
|
|
21347
|
+
// if (shorthand) {
|
|
21348
|
+
// return `*${shorthand}*${record.itemNameSelf}`;
|
|
21349
|
+
// }
|
|
21350
|
+
return record.productCode;
|
|
21351
21351
|
};
|
|
21352
21352
|
|
|
21353
21353
|
var css_248z$q = ".kts-invoice-operate-goods-endow-code-button-list {\n display: flex;\n flex-direction: column;\n}\n.kts-invoice-operate-goods-endow-code-button-list > button {\n margin-bottom: 10px;\n}\n";
|
package/dist/index.js
CHANGED
|
@@ -1705,10 +1705,12 @@ var validateFields = function validateFields(form) {
|
|
|
1705
1705
|
function getGoodsSearch(goodsList, search, isTaxIncluded) {
|
|
1706
1706
|
if (!search) return goodsList;
|
|
1707
1707
|
return goodsList.filter(function (e) {
|
|
1708
|
-
var _e$itemName$indexOf, _e$itemName, _e$itemModelName$inde, _e$itemModelName, _e$lineAmountIncludeT, _e$lineAmountExcludeT;
|
|
1708
|
+
var _e$itemName$indexOf, _e$itemName, _e$itemCode$indexOf, _e$itemCode, _e$itemModelName$inde, _e$itemModelName, _e$lineAmountIncludeT, _e$lineAmountExcludeT;
|
|
1709
1709
|
|
|
1710
1710
|
if (((_e$itemName$indexOf = (_e$itemName = e.itemName) === null || _e$itemName === void 0 ? void 0 : _e$itemName.indexOf(search)) !== null && _e$itemName$indexOf !== void 0 ? _e$itemName$indexOf : -1) >= 0) {
|
|
1711
1711
|
return true;
|
|
1712
|
+
} else if (((_e$itemCode$indexOf = (_e$itemCode = e.itemCode) === null || _e$itemCode === void 0 ? void 0 : _e$itemCode.indexOf(search)) !== null && _e$itemCode$indexOf !== void 0 ? _e$itemCode$indexOf : -1) >= 0) {
|
|
1713
|
+
return true;
|
|
1712
1714
|
} else if (((_e$itemModelName$inde = (_e$itemModelName = e.itemModelName) === null || _e$itemModelName === void 0 ? void 0 : _e$itemModelName.indexOf(search)) !== null && _e$itemModelName$inde !== void 0 ? _e$itemModelName$inde : -1) >= 0) {
|
|
1713
1715
|
return true;
|
|
1714
1716
|
} else if ("".concat(isTaxIncluded ? (_e$lineAmountIncludeT = e.lineAmountIncludeTax) === null || _e$lineAmountIncludeT === void 0 ? void 0 : _e$lineAmountIncludeT.toFixed(2) : (_e$lineAmountExcludeT = e.lineAmountExcludeTax) === null || _e$lineAmountExcludeT === void 0 ? void 0 : _e$lineAmountExcludeT.toFixed(2)).indexOf(search) >= 0) {
|
|
@@ -10009,6 +10011,9 @@ function Search() {
|
|
|
10009
10011
|
var readOnly = controller.useMemo(function (s) {
|
|
10010
10012
|
return !!s.goodsListState.editGood;
|
|
10011
10013
|
}, []);
|
|
10014
|
+
var columnshide = controller.useMemo(function (s) {
|
|
10015
|
+
return s.goodsListState.columnshide;
|
|
10016
|
+
}, []);
|
|
10012
10017
|
/** 是否含税 */
|
|
10013
10018
|
|
|
10014
10019
|
var isTaxIncluded = controller.useMemo(function (s) {
|
|
@@ -10072,7 +10077,7 @@ function Search() {
|
|
|
10072
10077
|
readOnly: readOnly,
|
|
10073
10078
|
value: value,
|
|
10074
10079
|
className: "kts-invoice-operate-goods-list-search",
|
|
10075
|
-
placeholder: "\u8BF7\u60A8\u8F93\u5165\u9879\u76EE\u540D\u79F0\u3001\u89C4\u683C\u578B\u53F7\u3001\u91D1\u989D(".concat(isTaxIncluded ? '含税' : '不含税', ")\u641C\u7D22"),
|
|
10080
|
+
placeholder: "\u8BF7\u60A8\u8F93\u5165".concat(columnshide.includes('itemCode') ? '' : '商品编码、', "\u9879\u76EE\u540D\u79F0\u3001\u89C4\u683C\u578B\u53F7\u3001\u91D1\u989D(").concat(isTaxIncluded ? '含税' : '不含税', ")\u641C\u7D22"),
|
|
10076
10081
|
prefix: React__default['default'].createElement(ktsComponentsAntdX3.Icon, {
|
|
10077
10082
|
component: SvgMagnifier,
|
|
10078
10083
|
style: {
|
|
@@ -12394,7 +12399,11 @@ var useColumns = (function (form) {
|
|
|
12394
12399
|
render: function render(_, record) {
|
|
12395
12400
|
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
12396
12401
|
return React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('itemCode', {
|
|
12397
|
-
initialValue: editGood.itemCode
|
|
12402
|
+
initialValue: editGood.itemCode,
|
|
12403
|
+
rules: [].concat(_toConsumableArray(getReplenishRules('itemCode')), [{
|
|
12404
|
+
pattern: /^.{1,19}$/,
|
|
12405
|
+
message: '商品编码长度不能超过19位'
|
|
12406
|
+
}])
|
|
12398
12407
|
})(React__default['default'].createElement(ItemCodeInput, {
|
|
12399
12408
|
record: record,
|
|
12400
12409
|
onChange: function () {
|
|
@@ -12426,7 +12435,11 @@ var useColumns = (function (form) {
|
|
|
12426
12435
|
}()
|
|
12427
12436
|
})));
|
|
12428
12437
|
} else {
|
|
12429
|
-
return
|
|
12438
|
+
return React__default['default'].createElement("span", {
|
|
12439
|
+
style: {
|
|
12440
|
+
padding: '0 10px'
|
|
12441
|
+
}
|
|
12442
|
+
}, record.itemCode);
|
|
12430
12443
|
}
|
|
12431
12444
|
}
|
|
12432
12445
|
}, {
|
|
@@ -15643,13 +15656,6 @@ var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
|
|
|
15643
15656
|
gutter: [16, 0]
|
|
15644
15657
|
}, React__default['default'].createElement(ktsXui.Col, {
|
|
15645
15658
|
span: 24
|
|
15646
|
-
}, React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
|
|
15647
|
-
label: "\u8D2D\u4E70\u65B9\u4FE1\u606F",
|
|
15648
|
-
colon: false
|
|
15649
|
-
}, getFieldDecorator('naturalPersonFlag', {})(React__default['default'].createElement(NaturalPersonFlag, {
|
|
15650
|
-
readOnly: isReadOnly('naturalPersonFlag')
|
|
15651
|
-
})))), React__default['default'].createElement(ktsXui.Col, {
|
|
15652
|
-
span: 24
|
|
15653
15659
|
}, React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
|
|
15654
15660
|
label: "\u540D\u79F0",
|
|
15655
15661
|
colon: false
|
|
@@ -15832,27 +15838,6 @@ var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
|
|
|
15832
15838
|
})))))))));
|
|
15833
15839
|
});
|
|
15834
15840
|
|
|
15835
|
-
function NaturalPersonFlag(props) {
|
|
15836
|
-
var _React$useState3 = React__default['default'].useState(props.value || 0),
|
|
15837
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
15838
|
-
value = _React$useState4[0],
|
|
15839
|
-
setValue = _React$useState4[1];
|
|
15840
|
-
|
|
15841
|
-
var onChange = React__default['default'].useCallback(function (e) {
|
|
15842
|
-
if (props.readOnly) return;
|
|
15843
|
-
setValue(e.target.checked ? 1 : 0);
|
|
15844
|
-
props.onChange && props.onChange(e.target.checked ? 1 : 0);
|
|
15845
|
-
}, [props.onChange, props.readOnly]);
|
|
15846
|
-
React__default['default'].useEffect(function () {
|
|
15847
|
-
setValue(props.value || 0);
|
|
15848
|
-
}, [props.value]);
|
|
15849
|
-
return React__default['default'].createElement(ktsXui.Checkbox, {
|
|
15850
|
-
disabled: props.readOnly,
|
|
15851
|
-
checked: value === 1,
|
|
15852
|
-
onChange: onChange
|
|
15853
|
-
}, "\u662F\u5426\u5F00\u7968\u7ED9\u81EA\u7136\u4EBA");
|
|
15854
|
-
}
|
|
15855
|
-
|
|
15856
15841
|
function BuyerNameInput$1(props) {
|
|
15857
15842
|
var fieldName = props.fieldName,
|
|
15858
15843
|
form = props.myform;
|
|
@@ -21252,6 +21237,7 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
21252
21237
|
|
|
21253
21238
|
between = _objectSpread2({}, record);
|
|
21254
21239
|
between.itemName = getItemName(record, s.goodsListState.editGood);
|
|
21240
|
+
between.itemCode = getItemCode(record, s.goodsListState.editGood);
|
|
21255
21241
|
between.itemNameOther = getItemNameOther(record, s.goodsListState.editGood); // 设置编辑货物
|
|
21256
21242
|
|
|
21257
21243
|
editGood = s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), between);
|
|
@@ -21287,22 +21273,22 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
21287
21273
|
s.goodsListState.importGoods.isVisibleDrawer = false;
|
|
21288
21274
|
|
|
21289
21275
|
if (!s.goodsListState.isTaxIncluded) {
|
|
21290
|
-
_context2.next =
|
|
21276
|
+
_context2.next = 26;
|
|
21291
21277
|
break;
|
|
21292
21278
|
}
|
|
21293
21279
|
|
|
21294
|
-
_context2.next =
|
|
21280
|
+
_context2.next = 24;
|
|
21295
21281
|
return updateUnitPriceExcludingTax(controller, s.goodsListState.form, record);
|
|
21296
21282
|
|
|
21297
|
-
case
|
|
21298
|
-
_context2.next =
|
|
21283
|
+
case 24:
|
|
21284
|
+
_context2.next = 28;
|
|
21299
21285
|
break;
|
|
21300
21286
|
|
|
21301
|
-
case
|
|
21302
|
-
_context2.next =
|
|
21287
|
+
case 26:
|
|
21288
|
+
_context2.next = 28;
|
|
21303
21289
|
return updateUnitPriceTax(controller, s.goodsListState.form, record);
|
|
21304
21290
|
|
|
21305
|
-
case
|
|
21291
|
+
case 28:
|
|
21306
21292
|
case "end":
|
|
21307
21293
|
return _context2.stop();
|
|
21308
21294
|
}
|
|
@@ -21358,6 +21344,20 @@ var getItemNameOther = function getItemNameOther(record, editGood) {
|
|
|
21358
21344
|
// return `*${shorthand}*${record.itemNameSelf}`;
|
|
21359
21345
|
// }
|
|
21360
21346
|
return record.itemName;
|
|
21347
|
+
}; // 获取商品编号
|
|
21348
|
+
|
|
21349
|
+
|
|
21350
|
+
var getItemCode = function getItemCode(record, editGood) {
|
|
21351
|
+
// let shorthand;
|
|
21352
|
+
// shorthand = record.shorthand;
|
|
21353
|
+
// if (shorthand) {
|
|
21354
|
+
// return `*${shorthand}*${record.itemName}`;
|
|
21355
|
+
// }
|
|
21356
|
+
// shorthand = getSN(editGood.itemName)?.shorthand;
|
|
21357
|
+
// if (shorthand) {
|
|
21358
|
+
// return `*${shorthand}*${record.itemNameSelf}`;
|
|
21359
|
+
// }
|
|
21360
|
+
return record.productCode;
|
|
21361
21361
|
};
|
|
21362
21362
|
|
|
21363
21363
|
var css_248z$q = ".kts-invoice-operate-goods-endow-code-button-list {\n display: flex;\n flex-direction: column;\n}\n.kts-invoice-operate-goods-endow-code-button-list > button {\n margin-bottom: 10px;\n}\n";
|
package/package.json
CHANGED
|
@@ -6,13 +6,15 @@ import IGood from "../InvoiceControllerState/GoodsListState/IGood";
|
|
|
6
6
|
* @param goodsList 被搜索列表
|
|
7
7
|
* @param search 搜索条件
|
|
8
8
|
* @param isTaxIncluded 是否含税
|
|
9
|
-
* @returns
|
|
9
|
+
* @returns
|
|
10
10
|
*/
|
|
11
11
|
export default function getGoodsSearch(goodsList: IGood[], search: string, isTaxIncluded: boolean) {
|
|
12
12
|
if (!search) return goodsList;
|
|
13
13
|
return goodsList.filter(e => {
|
|
14
14
|
if ((e.itemName?.indexOf(search) ?? -1) >= 0) {
|
|
15
15
|
return true;
|
|
16
|
+
} else if ((e.itemCode?.indexOf(search) ?? -1) >= 0) {
|
|
17
|
+
return true
|
|
16
18
|
} else if ((e.itemModelName?.indexOf(search) ?? -1) >= 0) {
|
|
17
19
|
return true
|
|
18
20
|
} else if (`${isTaxIncluded ? e.lineAmountIncludeTax?.toFixed(2) : e.lineAmountExcludeTax?.toFixed(2)}`.indexOf(search) >= 0) {
|
|
@@ -21,4 +23,4 @@ export default function getGoodsSearch(goodsList: IGood[], search: string, isTax
|
|
|
21
23
|
return false;
|
|
22
24
|
}
|
|
23
25
|
})
|
|
24
|
-
}
|
|
26
|
+
}
|
|
@@ -107,6 +107,10 @@ export default (form: WrappedFormUtils) => {
|
|
|
107
107
|
<Form.Item>
|
|
108
108
|
{getFieldDecorator('itemCode', {
|
|
109
109
|
initialValue: editGood.itemCode,
|
|
110
|
+
rules: [
|
|
111
|
+
...getReplenishRules('itemCode'),
|
|
112
|
+
{ pattern: /^.{1,19}$/, message: '商品编码长度不能超过19位' },
|
|
113
|
+
]
|
|
110
114
|
})(
|
|
111
115
|
<ItemCodeInput
|
|
112
116
|
record={record}
|
|
@@ -119,7 +123,7 @@ export default (form: WrappedFormUtils) => {
|
|
|
119
123
|
</Form.Item>
|
|
120
124
|
)
|
|
121
125
|
} else {
|
|
122
|
-
return record.itemCode
|
|
126
|
+
return <span style={{ padding: '0 10px' }}>{record.itemCode}</span>
|
|
123
127
|
}
|
|
124
128
|
}
|
|
125
129
|
},
|
|
@@ -13,6 +13,8 @@ export default function Search() {
|
|
|
13
13
|
|
|
14
14
|
const readOnly = controller.useMemo(s => !!s.goodsListState.editGood, [])
|
|
15
15
|
|
|
16
|
+
const columnshide = controller.useMemo(s => s.goodsListState.columnshide, [])
|
|
17
|
+
|
|
16
18
|
/** 是否含税 */
|
|
17
19
|
const isTaxIncluded = controller.useMemo(s => s.goodsListState.isTaxIncluded, [])
|
|
18
20
|
|
|
@@ -40,7 +42,7 @@ export default function Search() {
|
|
|
40
42
|
readOnly={readOnly}
|
|
41
43
|
value={value}
|
|
42
44
|
className="kts-invoice-operate-goods-list-search"
|
|
43
|
-
placeholder={
|
|
45
|
+
placeholder={`请您输入${columnshide.includes('itemCode') ? '' : '商品编码、'}项目名称、规格型号、金额(${isTaxIncluded ? '含税' : '不含税'})搜索`}
|
|
44
46
|
prefix={<Icon component={MagnifierSvg} style={{ color: "#b8b8b8" }} />}
|
|
45
47
|
onChange={e => { setValue(e.target.value); }}
|
|
46
48
|
onClick={onClick}
|
|
@@ -79,6 +79,7 @@ const DrawerBody = () => {
|
|
|
79
79
|
// 中间数据
|
|
80
80
|
const between = { ...record };
|
|
81
81
|
between.itemName = getItemName(record, s.goodsListState.editGood);
|
|
82
|
+
between.itemCode = getItemCode(record, s.goodsListState.editGood);
|
|
82
83
|
between.itemNameOther = getItemNameOther(record, s.goodsListState.editGood);
|
|
83
84
|
|
|
84
85
|
// 设置编辑货物
|
|
@@ -171,4 +172,22 @@ const getItemNameOther = (record: any, editGood: IGood) => {
|
|
|
171
172
|
// return `*${shorthand}*${record.itemNameSelf}`;
|
|
172
173
|
// }
|
|
173
174
|
return record.itemName;
|
|
174
|
-
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// 获取商品编号
|
|
178
|
+
const getItemCode = (record: any, editGood: IGood) => {
|
|
179
|
+
|
|
180
|
+
// let shorthand;
|
|
181
|
+
|
|
182
|
+
// shorthand = record.shorthand;
|
|
183
|
+
// if (shorthand) {
|
|
184
|
+
// return `*${shorthand}*${record.itemName}`;
|
|
185
|
+
// }
|
|
186
|
+
|
|
187
|
+
// shorthand = getSN(editGood.itemName)?.shorthand;
|
|
188
|
+
// if (shorthand) {
|
|
189
|
+
// return `*${shorthand}*${record.itemNameSelf}`;
|
|
190
|
+
// }
|
|
191
|
+
|
|
192
|
+
return record.productCode;
|
|
193
|
+
}
|
|
@@ -113,14 +113,14 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
|
|
|
113
113
|
<div>
|
|
114
114
|
<Form className="digtal-stakeholder-form" >
|
|
115
115
|
<Row gutter={[16, 0]}>
|
|
116
|
-
<Col span={24} >
|
|
116
|
+
{/* <Col span={24} >
|
|
117
117
|
<Form.Item label='购买方信息' colon={false}>
|
|
118
118
|
{getFieldDecorator('naturalPersonFlag', {
|
|
119
119
|
})(
|
|
120
120
|
<NaturalPersonFlag readOnly={isReadOnly('naturalPersonFlag')} />
|
|
121
121
|
)}
|
|
122
122
|
</Form.Item>
|
|
123
|
-
</Col>
|
|
123
|
+
</Col> */}
|
|
124
124
|
|
|
125
125
|
<Col span={24} >
|
|
126
126
|
<Form.Item label='名称' colon={false}>
|