kts-component-invoice-operate 3.2.218 → 3.2.219
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/ui/default/GoodsList/index.d.ts +1 -0
- package/dist/Invoice/ui/default/GoodsList/ui/AddRowButton/index.d.ts +1 -1
- package/dist/index.esm.js +22 -10
- package/dist/index.js +22 -10
- package/package.json +1 -1
- package/src/Invoice/InvoiceController/InvoiceControllerState/index.ts +1 -0
- package/src/Invoice/_test/deduction/index.tsx +22 -6
- package/src/Invoice/index.md +4 -4
- package/src/Invoice/ui/default/GoodsList/index.tsx +3 -1
- package/src/Invoice/ui/default/GoodsList/ui/AddRowButton/index.tsx +4 -1
- package/src/Invoice/ui/digtal/GoodsList/ui/AddRowButton/index.tsx +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -10652,7 +10652,7 @@ var Statistics = (function () {
|
|
|
10652
10652
|
}, /*#__PURE__*/React.createElement("label", null, "\uFF08\u5C0F\u5199\uFF09 ", lineAmountIncludeTax === '' ? '' : parseFloat(lineAmountIncludeTax).toFixed(2)))));
|
|
10653
10653
|
});
|
|
10654
10654
|
|
|
10655
|
-
var AddRowButton = (function () {
|
|
10655
|
+
var AddRowButton = (function (props) {
|
|
10656
10656
|
var controller = Invoice.useInvoiceController();
|
|
10657
10657
|
var model = controller.useMemo(function (s) {
|
|
10658
10658
|
return s.model;
|
|
@@ -10690,14 +10690,26 @@ var AddRowButton = (function () {
|
|
|
10690
10690
|
while (1) {
|
|
10691
10691
|
switch (_context.prev = _context.next) {
|
|
10692
10692
|
case 0:
|
|
10693
|
-
_context.
|
|
10694
|
-
|
|
10693
|
+
_context.t0 = props.addGoodsCheck;
|
|
10694
|
+
|
|
10695
|
+
if (!_context.t0) {
|
|
10696
|
+
_context.next = 4;
|
|
10697
|
+
break;
|
|
10698
|
+
}
|
|
10695
10699
|
|
|
10696
|
-
case 2:
|
|
10697
10700
|
_context.next = 4;
|
|
10698
|
-
return
|
|
10701
|
+
return props.addGoodsCheck();
|
|
10699
10702
|
|
|
10700
10703
|
case 4:
|
|
10704
|
+
console.log('continue');
|
|
10705
|
+
_context.next = 7;
|
|
10706
|
+
return addGood$1(controller);
|
|
10707
|
+
|
|
10708
|
+
case 7:
|
|
10709
|
+
_context.next = 9;
|
|
10710
|
+
return rollBottom(controller, rootElement);
|
|
10711
|
+
|
|
10712
|
+
case 9:
|
|
10701
10713
|
case "end":
|
|
10702
10714
|
return _context.stop();
|
|
10703
10715
|
}
|
|
@@ -16603,7 +16615,9 @@ var Main = decorator(Form.create())(function (props) {
|
|
|
16603
16615
|
className: "kts-invoice-operate-goods-list-able"
|
|
16604
16616
|
}, /*#__PURE__*/React.createElement("div", {
|
|
16605
16617
|
className: "kts-invoice-operate-goods-list-able-list"
|
|
16606
|
-
}, /*#__PURE__*/React.createElement(AddRowButton,
|
|
16618
|
+
}, /*#__PURE__*/React.createElement(AddRowButton, {
|
|
16619
|
+
addGoodsCheck: props.addGoodsCheck
|
|
16620
|
+
}), endowCodeButton.button, delRowButton.button, mergeDetails.button, mergeDiscount.button, addDiscountRowButton.drawer, salesDiscount.button, salesGifts.button, /*#__PURE__*/React.createElement(Search, null)), /*#__PURE__*/React.createElement("div", {
|
|
16607
16621
|
className: "kts-invoice-operate-goods-list-able-extend"
|
|
16608
16622
|
}, props.menuExpansion, /*#__PURE__*/React.createElement(DescribeSwitch, null), /*#__PURE__*/React.createElement(TaxIncludedSwitch, null))), /*#__PURE__*/React.createElement("div", {
|
|
16609
16623
|
className: classnames('kts-invoice-operate-goods-list-table', {
|
|
@@ -19158,17 +19172,15 @@ function _addGood$1() {
|
|
|
19158
19172
|
while (1) {
|
|
19159
19173
|
switch (_context2.prev = _context2.next) {
|
|
19160
19174
|
case 0:
|
|
19161
|
-
console.log(err, values);
|
|
19162
|
-
|
|
19163
19175
|
if (!err) {
|
|
19164
|
-
_context2.next =
|
|
19176
|
+
_context2.next = 3;
|
|
19165
19177
|
break;
|
|
19166
19178
|
}
|
|
19167
19179
|
|
|
19168
19180
|
message$1.error('请先填写发票行信息,再添加新的行');
|
|
19169
19181
|
return _context2.abrupt("return");
|
|
19170
19182
|
|
|
19171
|
-
case
|
|
19183
|
+
case 3:
|
|
19172
19184
|
case "end":
|
|
19173
19185
|
return _context2.stop();
|
|
19174
19186
|
}
|
package/dist/index.js
CHANGED
|
@@ -10662,7 +10662,7 @@ var Statistics = (function () {
|
|
|
10662
10662
|
}, /*#__PURE__*/React__default['default'].createElement("label", null, "\uFF08\u5C0F\u5199\uFF09 ", lineAmountIncludeTax === '' ? '' : parseFloat(lineAmountIncludeTax).toFixed(2)))));
|
|
10663
10663
|
});
|
|
10664
10664
|
|
|
10665
|
-
var AddRowButton = (function () {
|
|
10665
|
+
var AddRowButton = (function (props) {
|
|
10666
10666
|
var controller = Invoice.useInvoiceController();
|
|
10667
10667
|
var model = controller.useMemo(function (s) {
|
|
10668
10668
|
return s.model;
|
|
@@ -10700,14 +10700,26 @@ var AddRowButton = (function () {
|
|
|
10700
10700
|
while (1) {
|
|
10701
10701
|
switch (_context.prev = _context.next) {
|
|
10702
10702
|
case 0:
|
|
10703
|
-
_context.
|
|
10704
|
-
|
|
10703
|
+
_context.t0 = props.addGoodsCheck;
|
|
10704
|
+
|
|
10705
|
+
if (!_context.t0) {
|
|
10706
|
+
_context.next = 4;
|
|
10707
|
+
break;
|
|
10708
|
+
}
|
|
10705
10709
|
|
|
10706
|
-
case 2:
|
|
10707
10710
|
_context.next = 4;
|
|
10708
|
-
return
|
|
10711
|
+
return props.addGoodsCheck();
|
|
10709
10712
|
|
|
10710
10713
|
case 4:
|
|
10714
|
+
console.log('continue');
|
|
10715
|
+
_context.next = 7;
|
|
10716
|
+
return addGood$1(controller);
|
|
10717
|
+
|
|
10718
|
+
case 7:
|
|
10719
|
+
_context.next = 9;
|
|
10720
|
+
return rollBottom(controller, rootElement);
|
|
10721
|
+
|
|
10722
|
+
case 9:
|
|
10711
10723
|
case "end":
|
|
10712
10724
|
return _context.stop();
|
|
10713
10725
|
}
|
|
@@ -16613,7 +16625,9 @@ var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
|
|
|
16613
16625
|
className: "kts-invoice-operate-goods-list-able"
|
|
16614
16626
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
16615
16627
|
className: "kts-invoice-operate-goods-list-able-list"
|
|
16616
|
-
}, /*#__PURE__*/React__default['default'].createElement(AddRowButton,
|
|
16628
|
+
}, /*#__PURE__*/React__default['default'].createElement(AddRowButton, {
|
|
16629
|
+
addGoodsCheck: props.addGoodsCheck
|
|
16630
|
+
}), endowCodeButton.button, delRowButton.button, mergeDetails.button, mergeDiscount.button, addDiscountRowButton.drawer, salesDiscount.button, salesGifts.button, /*#__PURE__*/React__default['default'].createElement(Search, null)), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
16617
16631
|
className: "kts-invoice-operate-goods-list-able-extend"
|
|
16618
16632
|
}, props.menuExpansion, /*#__PURE__*/React__default['default'].createElement(DescribeSwitch, null), /*#__PURE__*/React__default['default'].createElement(TaxIncludedSwitch, null))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
16619
16633
|
className: classnames__default['default']('kts-invoice-operate-goods-list-table', {
|
|
@@ -19168,17 +19182,15 @@ function _addGood$1() {
|
|
|
19168
19182
|
while (1) {
|
|
19169
19183
|
switch (_context2.prev = _context2.next) {
|
|
19170
19184
|
case 0:
|
|
19171
|
-
console.log(err, values);
|
|
19172
|
-
|
|
19173
19185
|
if (!err) {
|
|
19174
|
-
_context2.next =
|
|
19186
|
+
_context2.next = 3;
|
|
19175
19187
|
break;
|
|
19176
19188
|
}
|
|
19177
19189
|
|
|
19178
19190
|
ktsXui.message.error('请先填写发票行信息,再添加新的行');
|
|
19179
19191
|
return _context2.abrupt("return");
|
|
19180
19192
|
|
|
19181
|
-
case
|
|
19193
|
+
case 3:
|
|
19182
19194
|
case "end":
|
|
19183
19195
|
return _context2.stop();
|
|
19184
19196
|
}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Input } from 'kts-components-antd-x3';
|
|
2
|
+
import { Input, message } from 'kts-components-antd-x3';
|
|
3
3
|
import Invoice from '../../';
|
|
4
4
|
import 'antd/dist/antd.css';
|
|
5
5
|
|
|
@@ -29,17 +29,33 @@ export default () => {
|
|
|
29
29
|
</span>
|
|
30
30
|
)
|
|
31
31
|
}, [])
|
|
32
|
+
const checkGood = async () => {
|
|
33
|
+
await new Promise((resolve,) => {
|
|
34
|
+
setTimeout(() => {
|
|
35
|
+
const a = Math.random();
|
|
36
|
+
if (a > 0.5) {
|
|
37
|
+
message.error('请先填写发票行信息,再添加新的行');
|
|
38
|
+
return false;
|
|
39
|
+
} else {
|
|
40
|
+
resolve(true)
|
|
41
|
+
console.log(11112)
|
|
42
|
+
}
|
|
32
43
|
|
|
44
|
+
}, 1000)
|
|
45
|
+
})
|
|
46
|
+
}
|
|
33
47
|
return (
|
|
34
48
|
<Invoice
|
|
35
49
|
controller={controller}
|
|
36
50
|
goodsList={
|
|
37
51
|
<Invoice.GoodsList
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
52
|
+
|
|
53
|
+
addGoodsCheck={checkGood}
|
|
54
|
+
// isSwitchTax={false} // 是否可以切换(含税/不含税)状态
|
|
55
|
+
// isAddDiscount={false} // 不能添加折扣行
|
|
56
|
+
// goodMax={goodMax} // 控制能可以添加的货物函数
|
|
57
|
+
// deduction={deduction} // 扣除额
|
|
58
|
+
// menuExpansion={menuExpansion} // 扩展
|
|
43
59
|
/>
|
|
44
60
|
}
|
|
45
61
|
/>
|
package/src/Invoice/index.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
# 默认
|
|
2
2
|
|
|
3
|
-
## 简单用法
|
|
3
|
+
<!-- ## 简单用法
|
|
4
4
|
<code src="./_test/easiest/index.tsx"></code>
|
|
5
5
|
|
|
6
6
|
## 设置为草稿,设置默认参数 扩展按钮
|
|
7
7
|
<code src="./_test/draft/index.tsx" title="类似的操作,请查看API" ></code>
|
|
8
8
|
|
|
9
9
|
## 设置购买方名称搜索
|
|
10
|
-
<code src="./_test/buyerNameSearch/index.tsx"></code>
|
|
10
|
+
<code src="./_test/buyerNameSearch/index.tsx"></code> -->
|
|
11
11
|
|
|
12
12
|
## 设置扣除额(差额征税)
|
|
13
13
|
<code src="./_test/deduction/index.tsx"></code>
|
|
14
14
|
|
|
15
|
-
## 设置单位列表、税率列表
|
|
15
|
+
<!-- ## 设置单位列表、税率列表
|
|
16
16
|
<code src="./_test/unit/index.tsx" ></code>
|
|
17
17
|
|
|
18
18
|
## 发票头类型设置和购买方信息配置
|
|
@@ -53,4 +53,4 @@
|
|
|
53
53
|
<API name="GoodsList 商品列表 API" exports='["default"]' src="./ui/default/GoodsList/index.tsx"></API>
|
|
54
54
|
<API name="Buyer 购买方 API" exports='["default"]' src="./ui/default/Buyer/index.tsx"></API>
|
|
55
55
|
<API name="Seller 销售方 API" exports='["default"]' src="./ui/default/Seller/index.tsx"></API>
|
|
56
|
-
<API name="Sign 落款 API" exports='["default"]' src="./ui/default/Sign/index.tsx"></API>
|
|
56
|
+
<API name="Sign 落款 API" exports='["default"]' src="./ui/default/Sign/index.tsx"></API> -->
|
|
@@ -47,6 +47,8 @@ export interface IGoodsListProps {
|
|
|
47
47
|
|
|
48
48
|
/** 是否可以切换(含税/不含税)状态 */
|
|
49
49
|
isSwitchTax?: boolean;
|
|
50
|
+
|
|
51
|
+
addGoodsCheck?:()=>void;
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
export default class GoodsList extends React.Component<IGoodsListProps>{
|
|
@@ -137,7 +139,7 @@ const Main = decorator<IGoodsListProps, FormComponentProps & IGoodsListProps>(Fo
|
|
|
137
139
|
<div className="kts-invoice-operate-goods-list-able">
|
|
138
140
|
<div className="kts-invoice-operate-goods-list-able-list">
|
|
139
141
|
{/* 添加行 */}
|
|
140
|
-
<AddRowButton />
|
|
142
|
+
<AddRowButton addGoodsCheck={props.addGoodsCheck}/>
|
|
141
143
|
|
|
142
144
|
{/* 批量菜单 */}
|
|
143
145
|
{/* <BulkMenu /> */}
|
|
@@ -3,7 +3,7 @@ import Invoice from '../../../../..';
|
|
|
3
3
|
import { Button, message } from 'kts-components-antd-x3';
|
|
4
4
|
import InvoiceController, { LineAttributeType } from '../../../../../InvoiceController';
|
|
5
5
|
|
|
6
|
-
export default () => {
|
|
6
|
+
export default (props: any) => {
|
|
7
7
|
const controller = Invoice.useInvoiceController();
|
|
8
8
|
|
|
9
9
|
const model = controller.useMemo(s => s.model, []);
|
|
@@ -26,6 +26,8 @@ export default () => {
|
|
|
26
26
|
const disabled = React.useMemo(() => typeof goodMax === 'number' ? goodsNum >= goodMax : !!searchValue, [goodMax, goodsNum, searchValue])
|
|
27
27
|
|
|
28
28
|
const onClick = React.useCallback(async () => {
|
|
29
|
+
props.addGoodsCheck &&await props.addGoodsCheck();
|
|
30
|
+
console.log('continue')
|
|
29
31
|
await addGood(controller);
|
|
30
32
|
await rollBottom(controller, rootElement);
|
|
31
33
|
}, [controller, rootElement]);
|
|
@@ -43,6 +45,7 @@ export default () => {
|
|
|
43
45
|
|
|
44
46
|
/** 添加一个空货物 */
|
|
45
47
|
async function addGood(controller: InvoiceController) {
|
|
48
|
+
|
|
46
49
|
await controller.saveEditGood();
|
|
47
50
|
await controller.wait();
|
|
48
51
|
await controller.run(async (s) => {
|
|
@@ -46,7 +46,7 @@ export default () => {
|
|
|
46
46
|
/** 添加一个空货物 */
|
|
47
47
|
async function addGood(controller: InvoiceController) {
|
|
48
48
|
await controller.formList.get('realEstateInfo')?.validateFields(async (err: any, values: any) => {
|
|
49
|
-
|
|
49
|
+
|
|
50
50
|
if (err) {
|
|
51
51
|
message.error('请先填写发票行信息,再添加新的行');
|
|
52
52
|
return;
|