kts-component-invoice-operate 3.2.73 → 3.2.74
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
CHANGED
|
@@ -10706,8 +10706,6 @@ function ItemNameInput(props) {
|
|
|
10706
10706
|
while (1) {
|
|
10707
10707
|
switch (_context2.prev = _context2.next) {
|
|
10708
10708
|
case 0:
|
|
10709
|
-
// const good = options.filter(e=>e.itemName === itemName)[0];
|
|
10710
|
-
// good && controller.state.goodsListState.form?.setFieldsValue(removeNullUndefined(good));
|
|
10711
10709
|
record = options.filter(function (e) {
|
|
10712
10710
|
return e.itemName === itemName;
|
|
10713
10711
|
})[0];
|
|
@@ -10726,51 +10724,10 @@ function ItemNameInput(props) {
|
|
|
10726
10724
|
});
|
|
10727
10725
|
|
|
10728
10726
|
case 5:
|
|
10729
|
-
controller.importGoodsDrawer(record);
|
|
10730
|
-
|
|
10731
|
-
// // 没用 被编辑的货物 和 form 就退出
|
|
10732
|
-
// if (!s.goodsListState.editGood || !s.goodsListState.form) return;
|
|
10733
|
-
// // 导入时清空之前输入的值,使用导入的单价和税率(参考税局系统)
|
|
10734
|
-
// record.quantity = undefined;
|
|
10735
|
-
// record.lineAmountExcludeTax = undefined;
|
|
10736
|
-
// record.lineAmountIncludeTax = undefined;
|
|
10737
|
-
// // 中间数据
|
|
10738
|
-
// const between = { ...record };
|
|
10739
|
-
// between.itemName = record.itemName;
|
|
10740
|
-
// between.itemNameOther = record.itemName;
|
|
10741
|
-
// // 设置编辑货物
|
|
10742
|
-
// const editGood: IGood = s.goodsListState.editGood = { ...s.goodsListState.editGood, ...between };
|
|
10743
|
-
// if (editGood.taxRate) {
|
|
10744
|
-
// editGood.taxRate = dutyFree(controller, editGood.taxRate, s.goodsListState.form, editGood)
|
|
10745
|
-
// }
|
|
10746
|
-
// if (`${editGood.priceIncludeTax}` === '0') {
|
|
10747
|
-
// editGood.priceIncludeTax = undefined;
|
|
10748
|
-
// editGood.priceExcludeTax = undefined;
|
|
10749
|
-
// } else {
|
|
10750
|
-
// editGood.priceExcludeTax = getPriceExcludeTax(editGood, record, s.calculatingDigits) as number;
|
|
10751
|
-
// }
|
|
10752
|
-
// if (editGood.quantity && editGood.priceIncludeTax) {
|
|
10753
|
-
// editGood.lineAmountIncludeTax = countAmountIncludeTax(editGood.quantity, editGood.priceIncludeTax, s.calculatingDigits);
|
|
10754
|
-
// }
|
|
10755
|
-
// // 导入FORM里
|
|
10756
|
-
// if (s.goodsListState.isMyShow) {
|
|
10757
|
-
// s.goodsListState.form.setFieldsValue({
|
|
10758
|
-
// ...editGood,
|
|
10759
|
-
// itemName: editGood.itemNameSelf,
|
|
10760
|
-
// itemModelName: editGood.itemModelNameSelf,
|
|
10761
|
-
// });
|
|
10762
|
-
// } else {
|
|
10763
|
-
// s.goodsListState.form.setFieldsValue({
|
|
10764
|
-
// ...editGood,
|
|
10765
|
-
// });
|
|
10766
|
-
// }
|
|
10767
|
-
// s.goodsListState.importGoods.isVisibleDrawer = false;
|
|
10768
|
-
// s.goodsListState.isTaxIncluded
|
|
10769
|
-
// ? await updateUnitPriceExcludingTax(controller, s.goodsListState.form, record)
|
|
10770
|
-
// : await updateUnitPriceTax(controller, s.goodsListState.form, record)
|
|
10771
|
-
// })
|
|
10727
|
+
controller.importGoodsDrawer(record);
|
|
10728
|
+
setOptions([]);
|
|
10772
10729
|
|
|
10773
|
-
case
|
|
10730
|
+
case 7:
|
|
10774
10731
|
case "end":
|
|
10775
10732
|
return _context2.stop();
|
|
10776
10733
|
}
|
package/dist/index.js
CHANGED
|
@@ -10716,8 +10716,6 @@ function ItemNameInput(props) {
|
|
|
10716
10716
|
while (1) {
|
|
10717
10717
|
switch (_context2.prev = _context2.next) {
|
|
10718
10718
|
case 0:
|
|
10719
|
-
// const good = options.filter(e=>e.itemName === itemName)[0];
|
|
10720
|
-
// good && controller.state.goodsListState.form?.setFieldsValue(removeNullUndefined(good));
|
|
10721
10719
|
record = options.filter(function (e) {
|
|
10722
10720
|
return e.itemName === itemName;
|
|
10723
10721
|
})[0];
|
|
@@ -10736,51 +10734,10 @@ function ItemNameInput(props) {
|
|
|
10736
10734
|
});
|
|
10737
10735
|
|
|
10738
10736
|
case 5:
|
|
10739
|
-
controller.importGoodsDrawer(record);
|
|
10740
|
-
|
|
10741
|
-
// // 没用 被编辑的货物 和 form 就退出
|
|
10742
|
-
// if (!s.goodsListState.editGood || !s.goodsListState.form) return;
|
|
10743
|
-
// // 导入时清空之前输入的值,使用导入的单价和税率(参考税局系统)
|
|
10744
|
-
// record.quantity = undefined;
|
|
10745
|
-
// record.lineAmountExcludeTax = undefined;
|
|
10746
|
-
// record.lineAmountIncludeTax = undefined;
|
|
10747
|
-
// // 中间数据
|
|
10748
|
-
// const between = { ...record };
|
|
10749
|
-
// between.itemName = record.itemName;
|
|
10750
|
-
// between.itemNameOther = record.itemName;
|
|
10751
|
-
// // 设置编辑货物
|
|
10752
|
-
// const editGood: IGood = s.goodsListState.editGood = { ...s.goodsListState.editGood, ...between };
|
|
10753
|
-
// if (editGood.taxRate) {
|
|
10754
|
-
// editGood.taxRate = dutyFree(controller, editGood.taxRate, s.goodsListState.form, editGood)
|
|
10755
|
-
// }
|
|
10756
|
-
// if (`${editGood.priceIncludeTax}` === '0') {
|
|
10757
|
-
// editGood.priceIncludeTax = undefined;
|
|
10758
|
-
// editGood.priceExcludeTax = undefined;
|
|
10759
|
-
// } else {
|
|
10760
|
-
// editGood.priceExcludeTax = getPriceExcludeTax(editGood, record, s.calculatingDigits) as number;
|
|
10761
|
-
// }
|
|
10762
|
-
// if (editGood.quantity && editGood.priceIncludeTax) {
|
|
10763
|
-
// editGood.lineAmountIncludeTax = countAmountIncludeTax(editGood.quantity, editGood.priceIncludeTax, s.calculatingDigits);
|
|
10764
|
-
// }
|
|
10765
|
-
// // 导入FORM里
|
|
10766
|
-
// if (s.goodsListState.isMyShow) {
|
|
10767
|
-
// s.goodsListState.form.setFieldsValue({
|
|
10768
|
-
// ...editGood,
|
|
10769
|
-
// itemName: editGood.itemNameSelf,
|
|
10770
|
-
// itemModelName: editGood.itemModelNameSelf,
|
|
10771
|
-
// });
|
|
10772
|
-
// } else {
|
|
10773
|
-
// s.goodsListState.form.setFieldsValue({
|
|
10774
|
-
// ...editGood,
|
|
10775
|
-
// });
|
|
10776
|
-
// }
|
|
10777
|
-
// s.goodsListState.importGoods.isVisibleDrawer = false;
|
|
10778
|
-
// s.goodsListState.isTaxIncluded
|
|
10779
|
-
// ? await updateUnitPriceExcludingTax(controller, s.goodsListState.form, record)
|
|
10780
|
-
// : await updateUnitPriceTax(controller, s.goodsListState.form, record)
|
|
10781
|
-
// })
|
|
10737
|
+
controller.importGoodsDrawer(record);
|
|
10738
|
+
setOptions([]);
|
|
10782
10739
|
|
|
10783
|
-
case
|
|
10740
|
+
case 7:
|
|
10784
10741
|
case "end":
|
|
10785
10742
|
return _context2.stop();
|
|
10786
10743
|
}
|
package/package.json
CHANGED
|
@@ -56,14 +56,7 @@ class MyInvoiceController extends InvoiceController {
|
|
|
56
56
|
"shorthand": "发电",
|
|
57
57
|
"taxRate": 2
|
|
58
58
|
},
|
|
59
|
-
|
|
60
|
-
"itemName": "苹果",
|
|
61
|
-
"taxClassificationCode": "1010115010100000000",
|
|
62
|
-
"itemModelName": null,
|
|
63
|
-
"shorthand": "水果",
|
|
64
|
-
"taxRate": 3
|
|
65
|
-
}
|
|
66
|
-
] as any
|
|
59
|
+
].slice() as any
|
|
67
60
|
}
|
|
68
61
|
}
|
|
69
62
|
|
|
@@ -24,7 +24,7 @@ export default function ItemNameInput(props: { onChange?: (e: ChangeEvent<HTMLIn
|
|
|
24
24
|
const onSearch = React.useCallback(async (searchText: string) => {
|
|
25
25
|
try {
|
|
26
26
|
if (autoComplete.onItemNameSearch) {
|
|
27
|
-
setOptions(await autoComplete.onItemNameSearch(searchText))
|
|
27
|
+
setOptions(await autoComplete.onItemNameSearch(searchText));
|
|
28
28
|
}
|
|
29
29
|
} catch (error) {
|
|
30
30
|
setOptions([])
|
|
@@ -33,67 +33,14 @@ export default function ItemNameInput(props: { onChange?: (e: ChangeEvent<HTMLIn
|
|
|
33
33
|
}, [autoComplete.onItemNameSearch])
|
|
34
34
|
|
|
35
35
|
const onChangeAutoComplete = React.useCallback(async itemName => {
|
|
36
|
-
// const good = options.filter(e=>e.itemName === itemName)[0];
|
|
37
|
-
// good && controller.state.goodsListState.form?.setFieldsValue(removeNullUndefined(good));
|
|
38
|
-
|
|
39
36
|
const record = options.filter(e => e.itemName === itemName)[0] as any;
|
|
40
37
|
if (!record) return;
|
|
41
38
|
|
|
42
39
|
await controller.setEditGood({ itemName: record.itemName });
|
|
43
40
|
|
|
44
41
|
controller.importGoodsDrawer(record);
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// // 没用 被编辑的货物 和 form 就退出
|
|
49
|
-
// if (!s.goodsListState.editGood || !s.goodsListState.form) return;
|
|
50
|
-
|
|
51
|
-
// // 导入时清空之前输入的值,使用导入的单价和税率(参考税局系统)
|
|
52
|
-
// record.quantity = undefined;
|
|
53
|
-
// record.lineAmountExcludeTax = undefined;
|
|
54
|
-
// record.lineAmountIncludeTax = undefined;
|
|
55
|
-
|
|
56
|
-
// // 中间数据
|
|
57
|
-
// const between = { ...record };
|
|
58
|
-
// between.itemName = record.itemName;
|
|
59
|
-
// between.itemNameOther = record.itemName;
|
|
60
|
-
|
|
61
|
-
// // 设置编辑货物
|
|
62
|
-
// const editGood: IGood = s.goodsListState.editGood = { ...s.goodsListState.editGood, ...between };
|
|
63
|
-
|
|
64
|
-
// if (editGood.taxRate) {
|
|
65
|
-
// editGood.taxRate = dutyFree(controller, editGood.taxRate, s.goodsListState.form, editGood)
|
|
66
|
-
// }
|
|
67
|
-
|
|
68
|
-
// if (`${editGood.priceIncludeTax}` === '0') {
|
|
69
|
-
// editGood.priceIncludeTax = undefined;
|
|
70
|
-
// editGood.priceExcludeTax = undefined;
|
|
71
|
-
// } else {
|
|
72
|
-
// editGood.priceExcludeTax = getPriceExcludeTax(editGood, record, s.calculatingDigits) as number;
|
|
73
|
-
// }
|
|
74
|
-
|
|
75
|
-
// if (editGood.quantity && editGood.priceIncludeTax) {
|
|
76
|
-
// editGood.lineAmountIncludeTax = countAmountIncludeTax(editGood.quantity, editGood.priceIncludeTax, s.calculatingDigits);
|
|
77
|
-
// }
|
|
78
|
-
|
|
79
|
-
// // 导入FORM里
|
|
80
|
-
// if (s.goodsListState.isMyShow) {
|
|
81
|
-
// s.goodsListState.form.setFieldsValue({
|
|
82
|
-
// ...editGood,
|
|
83
|
-
// itemName: editGood.itemNameSelf,
|
|
84
|
-
// itemModelName: editGood.itemModelNameSelf,
|
|
85
|
-
// });
|
|
86
|
-
// } else {
|
|
87
|
-
// s.goodsListState.form.setFieldsValue({
|
|
88
|
-
// ...editGood,
|
|
89
|
-
// });
|
|
90
|
-
// }
|
|
91
|
-
|
|
92
|
-
// s.goodsListState.importGoods.isVisibleDrawer = false;
|
|
93
|
-
// s.goodsListState.isTaxIncluded
|
|
94
|
-
// ? await updateUnitPriceExcludingTax(controller, s.goodsListState.form, record)
|
|
95
|
-
// : await updateUnitPriceTax(controller, s.goodsListState.form, record)
|
|
96
|
-
// })
|
|
42
|
+
|
|
43
|
+
setOptions([]);
|
|
97
44
|
}, [options, controller])
|
|
98
45
|
|
|
99
46
|
return (
|