kts-component-invoice-operate 3.2.3 → 3.2.5
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/digtal/GoodsList.o/ui/AddRowButton → Invoice-digtal/_test/prefab}/index.d.ts +1 -0
- package/dist/Invoice/ui/digtal/GoodsList/hook/useRowSelection/index.d.ts +1 -1
- package/dist/index.esm.js +29 -8
- package/dist/index.js +29 -8
- package/docs-dist/404.html +33 -0
- package/docs-dist/index.html +33 -0
- package/docs-dist/static/add.a70623b4.svg +12 -0
- package/docs-dist/static/arrowDown.a1cbf0d8.svg +3 -0
- package/docs-dist/static/arrowUp.4c482054.svg +3 -0
- package/docs-dist/static/auto.a6cd905c.svg +1 -0
- package/docs-dist/static/fork.5431267d.svg +12 -0
- package/docs-dist/static/magnifier.2b26be6e.svg +1 -0
- package/docs-dist/static/plus.4fd1af30.svg +12 -0
- package/docs-dist/umi.css +20 -0
- package/docs-dist/umi.js +1 -0
- package/package.json +1 -1
- package/src/Invoice/Invoice-digtal/_test/prefab/index.tsx +150 -0
- package/src/Invoice/Invoice-digtal/index.md +3 -0
- package/src/Invoice/ui/digtal/GoodsList/hook/useRowSelection/index.tsx +12 -2
- package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useAddDiscountRowButton/index.tsx +1 -0
- package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useEmptyRefill/index.tsx +1 -0
- package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useReselectInvoiceType/index.tsx +1 -0
- package/src/Invoice/ui/digtal/Stakeholder/index.tsx +5 -1
- package/src/InvoiceTypeModal/dist/index.js +92 -0
- package/src/InvoiceTypeModal/index.tsx +8 -2
- package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/autoFillFn/index.d.ts +0 -35
- package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/index.d.ts +0 -3
- package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/ItemNameInput/index.d.ts +0 -7
- package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowEditButton/index.d.ts +0 -6
- package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/_useAddComparison/index.d.ts +0 -4
- package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.d.ts +0 -7
- package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/useDelItem/index.d.ts +0 -7
- package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.d.ts +0 -7
- package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/index.d.ts +0 -7
- package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowSaveButton/index.d.ts +0 -6
- package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/TitleText/index.d.ts +0 -8
- package/dist/Invoice/ui/digtal/GoodsList.o/hook/useDeduction/index.d.ts +0 -8
- package/dist/Invoice/ui/digtal/GoodsList.o/hook/useOnRow/index.d.ts +0 -8
- package/dist/Invoice/ui/digtal/GoodsList.o/hook/useRowSelection/index.d.ts +0 -8
- package/dist/Invoice/ui/digtal/GoodsList.o/hook/useWindowClick/index.d.ts +0 -8
- package/dist/Invoice/ui/digtal/GoodsList.o/index.d.ts +0 -20
- package/dist/Invoice/ui/digtal/GoodsList.o/ui/TableRow/index.d.ts +0 -2
- package/dist/Invoice/ui/digtal/GoodsList.o/ui/TableVirtual/index.d.ts +0 -4
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/autoFillFn/index.ts +0 -520
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/index.tsx +0 -624
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/ItemNameInput/index.less +0 -10
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/ItemNameInput/index.tsx +0 -19
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowEditButton/index.tsx +0 -30
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/_useAddComparison/index.tsx +0 -43
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.tsx +0 -76
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/useDelItem/index.tsx +0 -41
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.tsx +0 -34
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/index.less +0 -13
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/index.tsx +0 -98
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowSaveButton/index.tsx +0 -14
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/TitleText/index.tsx +0 -20
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useDeduction/index.tsx +0 -24
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useOnRow/index.tsx +0 -39
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useRowSelection/index.tsx +0 -112
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useWindowClick/index.tsx +0 -23
- package/src/Invoice/ui/digtal/GoodsList.o/index.less +0 -7
- package/src/Invoice/ui/digtal/GoodsList.o/index.tsx +0 -132
- package/src/Invoice/ui/digtal/GoodsList.o/ui/AddRowButton/index.tsx +0 -66
- package/src/Invoice/ui/digtal/GoodsList.o/ui/TableRow/index.tsx +0 -28
- package/src/Invoice/ui/digtal/GoodsList.o/ui/TableVirtual/index.less +0 -43
- package/src/Invoice/ui/digtal/GoodsList.o/ui/TableVirtual/index.tsx +0 -109
- /package/{src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/spot.svg → docs-dist/static/spot.42e620e1.svg} +0 -0
package/package.json
CHANGED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Invoice from '../../..';
|
|
3
|
+
import idGenerator from '../../../../Invoice/tools/idGenerator';
|
|
4
|
+
import 'antd/dist/antd.css';
|
|
5
|
+
|
|
6
|
+
export default () => {
|
|
7
|
+
|
|
8
|
+
const controller = React.useMemo(() => {
|
|
9
|
+
const controller = new Invoice.InvoiceController();
|
|
10
|
+
controller.run(async s => {
|
|
11
|
+
s.model = 'prefab';
|
|
12
|
+
s.goodsListState.goodsList = lines.map(e => {
|
|
13
|
+
return {
|
|
14
|
+
$index: idGenerator(),
|
|
15
|
+
...e,
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}).then(() => {
|
|
19
|
+
controller.formList.get('stakeholder')?.setFieldsValue({
|
|
20
|
+
buyerName: '购买方名称',
|
|
21
|
+
buyerTaxId: 'xxxxxxxxxx',
|
|
22
|
+
buyerAddress: '购买方地址',
|
|
23
|
+
buyerPhone: '15800000000',
|
|
24
|
+
buyerBank: '购买方开户银行',
|
|
25
|
+
buyerAccount: '银行账号',
|
|
26
|
+
|
|
27
|
+
supplierName: '销售方名称',
|
|
28
|
+
supplierTaxId: 'xxxxxxxxxxxx',
|
|
29
|
+
sellerAddress: '购买方地址',
|
|
30
|
+
sellerPhone: '15800000000',
|
|
31
|
+
sellerBank: '购买方开户银行',
|
|
32
|
+
sellerAccount: '银行账号',
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
return controller;
|
|
36
|
+
}, []);
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<Invoice
|
|
40
|
+
invoiceType='digtal'
|
|
41
|
+
controller={controller}
|
|
42
|
+
/>
|
|
43
|
+
)
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const lines: any[] = [
|
|
47
|
+
{
|
|
48
|
+
"buyersItemCode": null,
|
|
49
|
+
"buyersItemModelName": "GN-G32Z104",
|
|
50
|
+
"buyersItemName": "*配电控制设备*公牛(BULL)",
|
|
51
|
+
"buyersItemUnit": null,
|
|
52
|
+
"discount": 5010.04,
|
|
53
|
+
"discountGroup": "31b6d887-4877-4926-abe8-ab49ef6902da",
|
|
54
|
+
"dispatchDocumentReference": null,
|
|
55
|
+
"dispatchLineReference": null,
|
|
56
|
+
"favouredPolicyMark": "0",
|
|
57
|
+
"favouredPolicyName": null,
|
|
58
|
+
"id": "40823568750477313",
|
|
59
|
+
"itemModelName": "GN-G32Z104",
|
|
60
|
+
"itemName": "*配电控制设备*公牛(BULL)",
|
|
61
|
+
"lineAmountExcludeTax": 443365.88,
|
|
62
|
+
"lineAmountIncludeTax": 501003.53,
|
|
63
|
+
"lineAttribute": "0",
|
|
64
|
+
"lineDiscountExcludeTax": 4433.66,
|
|
65
|
+
"lineDiscountRate": null,
|
|
66
|
+
"lineId": "1740823580142206976",
|
|
67
|
+
"lineOrder": 1,
|
|
68
|
+
"materialCode": null,
|
|
69
|
+
"noticeCodeNo": null,
|
|
70
|
+
"noticeLineId": null,
|
|
71
|
+
"orderLineId": null,
|
|
72
|
+
"orderLineReference": null,
|
|
73
|
+
"orderNo": null,
|
|
74
|
+
"orderReference": null,
|
|
75
|
+
"priceExcludeTax": 827.17518997,
|
|
76
|
+
"priceIncludeTax": 934.70796467,
|
|
77
|
+
"quantity": 536,
|
|
78
|
+
"receiptDocumentReference": null,
|
|
79
|
+
"receiptLineReference": null,
|
|
80
|
+
"reconciliationDocumentReference": null,
|
|
81
|
+
"reconciliationSheetLineReference": null,
|
|
82
|
+
"relationReferences": null,
|
|
83
|
+
"requisitionLineNo": null,
|
|
84
|
+
"sellersItemCode": null,
|
|
85
|
+
"sellersItemModelName": null,
|
|
86
|
+
"sellersItemName": "*配电控制设备*1",
|
|
87
|
+
"sellersItemUnit": null,
|
|
88
|
+
"specialManagement": null,
|
|
89
|
+
"statementCode": null,
|
|
90
|
+
"statementLineId": null,
|
|
91
|
+
"taxAmount": 57637.65,
|
|
92
|
+
"taxClassificationCode": "1090407030000000000",
|
|
93
|
+
"taxDiscount": 576.38,
|
|
94
|
+
"taxRate": 13,
|
|
95
|
+
"unit": "件",
|
|
96
|
+
"zeroTaxRateFlag": 'dddddd'
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"buyersItemCode": null,
|
|
100
|
+
"buyersItemModelName": "GN-G32Z104",
|
|
101
|
+
"buyersItemName": "*配电控制设备*公牛(BULL)",
|
|
102
|
+
"buyersItemUnit": null,
|
|
103
|
+
"discount": null,
|
|
104
|
+
"discountGroup": "31b6d887-4877-4926-abe8-ab49ef6902da",
|
|
105
|
+
"dispatchDocumentReference": null,
|
|
106
|
+
"dispatchLineReference": null,
|
|
107
|
+
"favouredPolicyMark": "0",
|
|
108
|
+
"favouredPolicyName": null,
|
|
109
|
+
"id": "40823568750477313",
|
|
110
|
+
"itemModelName": "",
|
|
111
|
+
"itemName": "*配电控制设备*公牛(BULL)",
|
|
112
|
+
"lineAmountExcludeTax": -4433.66,
|
|
113
|
+
"lineAmountIncludeTax": -5010.04,
|
|
114
|
+
"lineAttribute": "0",
|
|
115
|
+
"lineDiscountExcludeTax": null,
|
|
116
|
+
"lineDiscountRate": null,
|
|
117
|
+
"lineId": "1740823580142206976",
|
|
118
|
+
"lineOrder": 2,
|
|
119
|
+
"materialCode": null,
|
|
120
|
+
"noticeCodeNo": null,
|
|
121
|
+
"noticeLineId": null,
|
|
122
|
+
"orderLineId": null,
|
|
123
|
+
"orderLineReference": null,
|
|
124
|
+
"orderNo": null,
|
|
125
|
+
"orderReference": null,
|
|
126
|
+
"priceExcludeTax": null,
|
|
127
|
+
"priceIncludeTax": null,
|
|
128
|
+
"quantity": null,
|
|
129
|
+
"receiptDocumentReference": null,
|
|
130
|
+
"receiptLineReference": null,
|
|
131
|
+
"reconciliationDocumentReference": null,
|
|
132
|
+
"reconciliationSheetLineReference": null,
|
|
133
|
+
"relationReferences": null,
|
|
134
|
+
"requisitionLineNo": null,
|
|
135
|
+
"sellersItemCode": null,
|
|
136
|
+
"sellersItemModelName": null,
|
|
137
|
+
"sellersItemName": "*配电控制设备*1",
|
|
138
|
+
"sellersItemUnit": null,
|
|
139
|
+
"specialManagement": null,
|
|
140
|
+
"statementCode": null,
|
|
141
|
+
"statementLineId": null,
|
|
142
|
+
"taxAmount": -576.38,
|
|
143
|
+
"taxClassificationCode": "1090407030000000000",
|
|
144
|
+
"taxDiscount": null,
|
|
145
|
+
"taxRate": 13,
|
|
146
|
+
"unit": "",
|
|
147
|
+
"zeroTaxRateFlag": null
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
|
|
@@ -15,8 +15,17 @@ export default () => {
|
|
|
15
15
|
/** 货物列表 */
|
|
16
16
|
const goodsList = controller.useMemo(s => s.goodsListState.goodsList, []);
|
|
17
17
|
|
|
18
|
+
/** 组件模式 */
|
|
19
|
+
const model = controller.useMemo(s => s.model, []);
|
|
20
|
+
|
|
18
21
|
/** 搜索条件 */
|
|
19
|
-
const searchValue = controller.useMemo(s => s.goodsListState.searchValue, []);
|
|
22
|
+
// const searchValue = controller.useMemo(s => s.goodsListState.searchValue, []);
|
|
23
|
+
|
|
24
|
+
/** 是否显示选择框 */
|
|
25
|
+
const isShow = React.useMemo(() => {
|
|
26
|
+
if (model === 'readOnly') return false
|
|
27
|
+
return true;
|
|
28
|
+
}, [model])
|
|
20
29
|
|
|
21
30
|
/** 是否全选 */
|
|
22
31
|
// const isAll = controller.useMemo(s => s.goodsListState.goodsList.length > 0 && s.goodsListState.selectedGoodIndex.length === s.goodsListState.goodsList.length, [])
|
|
@@ -40,7 +49,7 @@ export default () => {
|
|
|
40
49
|
await controller.pipeline(async s => {
|
|
41
50
|
const seeGoodsIndex = controller.getGoodsSearch(s.goodsListState.goodsList, s.goodsListState.searchValue, s.goodsListState.isTaxIncluded).map(e => e.$index)
|
|
42
51
|
|
|
43
|
-
s.goodsListState.selectedGoodIndex = s.goodsListState.selectedGoodIndex.filter(e
|
|
52
|
+
s.goodsListState.selectedGoodIndex = s.goodsListState.selectedGoodIndex.filter(e => !seeGoodsIndex.some(t => e === t));
|
|
44
53
|
})()
|
|
45
54
|
} else {
|
|
46
55
|
await controller.pipeline(async s => {
|
|
@@ -103,6 +112,7 @@ export default () => {
|
|
|
103
112
|
sortOut(true);
|
|
104
113
|
}, [sortOut, goodsList])
|
|
105
114
|
|
|
115
|
+
if (isShow === false) return undefined;
|
|
106
116
|
return {
|
|
107
117
|
columnWidth: 45,
|
|
108
118
|
columnTitle,
|
|
@@ -65,7 +65,11 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
|
|
|
65
65
|
|
|
66
66
|
const rulesMap = controller.useMemo(s => s.stakeholder.rulesMap || {}, []);
|
|
67
67
|
|
|
68
|
-
const readOnly = React.useMemo(() =>
|
|
68
|
+
const readOnly = React.useMemo(() => {
|
|
69
|
+
if(model === 'readOnly') return true;
|
|
70
|
+
if(model === 'prefab') return true;
|
|
71
|
+
return false;
|
|
72
|
+
}, [model]);
|
|
69
73
|
|
|
70
74
|
const onExpand = React.useCallback(() => { setExpand(e => !e) }, []);
|
|
71
75
|
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
exports.__esModule = true;
|
|
39
|
+
var react_1 = require("react");
|
|
40
|
+
var kts_xui_1 = require("kts-xui");
|
|
41
|
+
require("./index.less");
|
|
42
|
+
function InvoiceTypeModal(props) {
|
|
43
|
+
var _this = this;
|
|
44
|
+
var _a = props.disableds, disableds = _a === void 0 ? [] : _a;
|
|
45
|
+
var _b = react_1["default"].useState({ billingType: props.defaultBillingType || 'digital' }), formValues = _b[0], setValues = _b[1];
|
|
46
|
+
var form = kts_xui_1.Form.useForm()[0];
|
|
47
|
+
var onConfirm = react_1["default"].useCallback(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
48
|
+
var values;
|
|
49
|
+
return __generator(this, function (_a) {
|
|
50
|
+
switch (_a.label) {
|
|
51
|
+
case 0: return [4 /*yield*/, form.validateFields()];
|
|
52
|
+
case 1:
|
|
53
|
+
values = _a.sent();
|
|
54
|
+
props.onOk && props.onOk(values);
|
|
55
|
+
return [2 /*return*/];
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}); }, [props.onOk, form]);
|
|
59
|
+
var onChangeBillingType = react_1["default"].useCallback(function (e) {
|
|
60
|
+
props.onChange && props.onChange(e.target.value);
|
|
61
|
+
form.setFieldsValue({ invoiceType: null, business: null });
|
|
62
|
+
setValues(form.getFieldsValue());
|
|
63
|
+
}, [props.onChange, form]);
|
|
64
|
+
react_1["default"].useEffect(function () {
|
|
65
|
+
if (props.open) {
|
|
66
|
+
var values = {
|
|
67
|
+
billingType: props.defaultBillingType || 'digital',
|
|
68
|
+
invoiceType: props.defaultInvoiceType,
|
|
69
|
+
business: props.defaultBusiness
|
|
70
|
+
};
|
|
71
|
+
form.resetFields();
|
|
72
|
+
form.setFieldsValue(values);
|
|
73
|
+
setValues(values);
|
|
74
|
+
}
|
|
75
|
+
}, [props.open, props.defaultBillingType, props.defaultBusiness, props.defaultInvoiceType, form]);
|
|
76
|
+
return (react_1["default"].createElement(kts_xui_1.Modal, { title: props.modalTitle || "选择开具信息", open: props.open, onOk: onConfirm, onCancel: props.onCancel, okText: '\u786E\u5B9A', cancelText: '\u53D6\u6D88' },
|
|
77
|
+
react_1["default"].createElement(kts_xui_1.Form, { form: form, layout: "vertical", style: { paddingTop: 20 }, onValuesChange: function (_, e) { setValues(e); } },
|
|
78
|
+
react_1["default"].createElement(kts_xui_1.Row, { gutter: [16, 16] },
|
|
79
|
+
react_1["default"].createElement(kts_xui_1.Col, { span: 24 },
|
|
80
|
+
react_1["default"].createElement(kts_xui_1.Form.Item, { name: 'billingType' },
|
|
81
|
+
react_1["default"].createElement(kts_xui_1.Radio.Group, { size: 'large', className: "goods-list-digtal-reselect-invoice-typeModal-radio", optionType: "button", disabled: disableds.indexOf('billingType') >= 0, onChange: onChangeBillingType, options: [
|
|
82
|
+
{ label: '数电发票', value: 'digital' },
|
|
83
|
+
{ label: '税控发票', value: 'taxation' },
|
|
84
|
+
] }))),
|
|
85
|
+
react_1["default"].createElement(kts_xui_1.Col, { span: 12 },
|
|
86
|
+
react_1["default"].createElement(kts_xui_1.Form.Item, { name: 'invoiceType', label: "\u9009\u62E9\u7968\u7C7B", rules: [{ required: true, message: '选择票类必填' }] },
|
|
87
|
+
react_1["default"].createElement(kts_xui_1.Select, { size: 'large', allowClear: true, placeholder: "\u8BF7\u9009\u62E9\uFF08\u5FC5\u586B\u9879\uFF09", disabled: disableds.indexOf('invoiceType') >= 0, options: props.invoiceTypeOptions }))),
|
|
88
|
+
react_1["default"].createElement(kts_xui_1.Col, { span: 12 },
|
|
89
|
+
react_1["default"].createElement(kts_xui_1.Form.Item, { name: 'business', label: "\u7279\u5B9A\u4E1A\u52A1" },
|
|
90
|
+
react_1["default"].createElement(kts_xui_1.Select, { size: 'large', allowClear: true, placeholder: "\u8BF7\u9009\u62E9\uFF08\u975E\u5FC5\u586B\u9879\uFF09", disabled: disableds.indexOf('business') >= 0 || !formValues.invoiceType, options: props.businessOptions })))))));
|
|
91
|
+
}
|
|
92
|
+
exports["default"] = InvoiceTypeModal;
|
|
@@ -63,7 +63,13 @@ export default function InvoiceTypeModal(props: IInvoiceTypeModalProps) {
|
|
|
63
63
|
const onConfirm = React.useCallback(async () => {
|
|
64
64
|
const values = await form.validateFields();
|
|
65
65
|
props.onOk && props.onOk(values);
|
|
66
|
-
}, [props.onOk])
|
|
66
|
+
}, [props.onOk, form])
|
|
67
|
+
|
|
68
|
+
const onChangeBillingType = React.useCallback(e => {
|
|
69
|
+
props.onChange && props.onChange(e.target.value);
|
|
70
|
+
form.setFieldsValue({ invoiceType: null, business: null });
|
|
71
|
+
setValues(form.getFieldsValue());
|
|
72
|
+
}, [props.onChange, form])
|
|
67
73
|
|
|
68
74
|
React.useEffect(() => {
|
|
69
75
|
if (props.open) {
|
|
@@ -102,7 +108,7 @@ export default function InvoiceTypeModal(props: IInvoiceTypeModalProps) {
|
|
|
102
108
|
className="goods-list-digtal-reselect-invoice-typeModal-radio"
|
|
103
109
|
optionType="button"
|
|
104
110
|
disabled={disableds.indexOf('billingType') >= 0}
|
|
105
|
-
onChange={
|
|
111
|
+
onChange={onChangeBillingType}
|
|
106
112
|
options={[
|
|
107
113
|
{ label: '数电发票', value: 'digital' },
|
|
108
114
|
{ label: '税控发票', value: 'taxation' },
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 数量 保留15位数字
|
|
3
|
-
* 单价 保留15位数字
|
|
4
|
-
* 金额 小数点后 2位
|
|
5
|
-
* 税额 小数点后 2位
|
|
6
|
-
*/
|
|
7
|
-
import { WrappedFormUtils } from 'kts-components-antd-x3/lib/form/Form';
|
|
8
|
-
import InvoiceController, { IGood } from '../../../../../../InvoiceController';
|
|
9
|
-
export { format2, format15 } from '../../../../../../tools/calculate';
|
|
10
|
-
/** 清除计算中启动字段 */
|
|
11
|
-
export declare const clearCalculatingField: (controller: InvoiceController) => Promise<any>;
|
|
12
|
-
/** 数量改变了 */
|
|
13
|
-
export declare const onChangeQuantity: (...par: any[]) => void;
|
|
14
|
-
/** 单价(含税) */
|
|
15
|
-
export declare const onChangePriceIncludeTax: (...par: any[]) => void;
|
|
16
|
-
/** 单价(不含税) */
|
|
17
|
-
export declare const onChangePriceExcludeTax: (...par: any[]) => void;
|
|
18
|
-
/** 金额(含税) */
|
|
19
|
-
export declare const onChangeLineAmountIncludeTax: (...par: any[]) => void;
|
|
20
|
-
/** 金额(不含税) */
|
|
21
|
-
export declare const onChangeLineAmountExcludeTax: (...par: any[]) => void;
|
|
22
|
-
/** 税率 */
|
|
23
|
-
export declare const onChangeTaxRate: (...par: any[]) => void;
|
|
24
|
-
/** 小规模纳税人 1% 和 3% 自动赋码免税 */
|
|
25
|
-
export declare function dutyFree(controller: InvoiceController, taxRate: number, form: WrappedFormUtils<any>, record: IGood): number | undefined;
|
|
26
|
-
/** 含税 => 更新(不含税) */
|
|
27
|
-
export declare const updateUnitPriceExcludingTax: (controller: InvoiceController, form: WrappedFormUtils, record: IGood) => Promise<unknown>;
|
|
28
|
-
/** 不含税 => 更新(含税) */
|
|
29
|
-
export declare const updateUnitPriceTax: (controller: InvoiceController, form: WrappedFormUtils, record: IGood) => Promise<unknown>;
|
|
30
|
-
/** 保存到编辑货物 */
|
|
31
|
-
export declare const onSaveEditGood: (...par: any[]) => void;
|
|
32
|
-
/** 单调赋码 */
|
|
33
|
-
export declare const endowCode: (controller: InvoiceController, goods: IGood) => Promise<void>;
|
|
34
|
-
/** 修改了 项目名称 */
|
|
35
|
-
export declare const onChangeItemName: (controller: InvoiceController, form: WrappedFormUtils<any>, record: IGood) => Promise<void>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './index.less';
|
|
3
|
-
export interface IGoodsListProps {
|
|
4
|
-
/** 扩展部分 */
|
|
5
|
-
menuExpansion?: React.ReactNode;
|
|
6
|
-
/** 产品最大数 */
|
|
7
|
-
goodMax?: number;
|
|
8
|
-
/** 扣除额 */
|
|
9
|
-
deduction?: number;
|
|
10
|
-
/** 是否能添加折扣行 */
|
|
11
|
-
isAddDiscount?: boolean;
|
|
12
|
-
/** 是否可以切换(含税/不含税)状态 */
|
|
13
|
-
isSwitchTax?: boolean;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* 货物列表
|
|
17
|
-
*/
|
|
18
|
-
export default class GoodsList extends React.Component<IGoodsListProps> {
|
|
19
|
-
render(): JSX.Element;
|
|
20
|
-
}
|