kts-component-invoice-operate 3.2.247 → 3.2.249
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 +2 -0
- package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/index.d.ts +6 -0
- package/dist/Invoice/ui/default/MeiTanModal/index.d.ts +4 -0
- package/dist/index.esm.js +330 -17
- package/dist/index.js +329 -16
- package/package.json +1 -1
- package/src/Invoice/Invoice-digtal/_test/importGoods/index.tsx +713 -1
- package/src/Invoice/Invoice-digtal/index.md +6 -7
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood/index.ts +2 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/index.ts +17 -1
- package/src/Invoice/InvoiceController/fns/importGoodsDrawer.ts +9 -2
- package/src/Invoice/_test/importGoods/index.tsx +180 -57
- package/src/Invoice/index.md +5 -5
- package/src/Invoice/index.tsx +3 -0
- package/src/Invoice/ui/default/EndowCodeDrawer/index.tsx +23 -15
- package/src/Invoice/ui/default/ImportGoodsDrawer/index.tsx +7 -1
- package/src/Invoice/ui/default/MeiTanModal/index.less +40 -0
- package/src/Invoice/ui/default/MeiTanModal/index.tsx +166 -0
|
@@ -26,20 +26,19 @@
|
|
|
26
26
|
<code src="./_test/disabled/index.tsx"></code>
|
|
27
27
|
|
|
28
28
|
## 导入关系人
|
|
29
|
-
<code src="./_test/importStakeholder/index.tsx"></code
|
|
29
|
+
<code src="./_test/importStakeholder/index.tsx"></code>-->
|
|
30
|
+
|
|
31
|
+
|
|
30
32
|
|
|
31
33
|
## 导入项目
|
|
32
34
|
<code src="./_test/importGoods/index.tsx"></code>
|
|
33
35
|
|
|
34
|
-
## 预制模式
|
|
36
|
+
<!-- ## 预制模式
|
|
35
37
|
<code src="./_test/prefab/index.tsx"></code>
|
|
36
38
|
|
|
37
39
|
## 查看当前可用授信额度
|
|
38
|
-
<code src="./_test/lineCredit/index.tsx"></code>
|
|
39
|
-
|
|
40
|
+
<code src="./_test/lineCredit/index.tsx"></code> -->
|
|
40
41
|
|
|
41
42
|
|
|
42
|
-
-->
|
|
43
|
-
<!--
|
|
44
43
|
## 货物运输服务
|
|
45
|
-
<code src="./_test/freight/index.tsx"></code>
|
|
44
|
+
<code src="./_test/freight/index.tsx"></code>
|
|
@@ -23,7 +23,7 @@ export default class GoodsListState {
|
|
|
23
23
|
|
|
24
24
|
/** 是否根据税收分类编码改变商品的可选税率 */
|
|
25
25
|
isUpdateGoodsTaxRateList = false;
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
/** 是否能添加折扣行 */
|
|
28
28
|
isAddDiscount?: boolean;
|
|
29
29
|
|
|
@@ -131,4 +131,20 @@ export default class GoodsListState {
|
|
|
131
131
|
/** 商品校验是否关闭,默认开启 */
|
|
132
132
|
isValidateGood = true;
|
|
133
133
|
|
|
134
|
+
/** 煤炭类校验是否关闭,默认开启 */
|
|
135
|
+
isValidateMeiTan = true;
|
|
136
|
+
|
|
137
|
+
/** 煤炭种类赋值商品索引 */
|
|
138
|
+
meiTanGoodIndex?: string[] = [];
|
|
139
|
+
|
|
140
|
+
/** 煤炭时校验函数 */
|
|
141
|
+
verifyMeiTanFn: (record: any) => Promise<boolean> = async record => {
|
|
142
|
+
const { taxClassificationCode } = record;
|
|
143
|
+
if (taxClassificationCode === '1020101000000000000' || taxClassificationCode === '1020102000000000000' || taxClassificationCode === '1020199000000000000') {
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return false;
|
|
148
|
+
};
|
|
149
|
+
|
|
134
150
|
}
|
|
@@ -6,7 +6,7 @@ import { countAmountIncludeTax } from '../../tools/calculate';
|
|
|
6
6
|
/**
|
|
7
7
|
* 删除一个货物
|
|
8
8
|
*/
|
|
9
|
-
export default async (s: InvoiceControllerState, record: any, controller:any) => {
|
|
9
|
+
export default async (s: InvoiceControllerState, record: any, controller: any) => {
|
|
10
10
|
Object.keys(record).filter(e => !record[e] && record[e] !== 0).forEach(e => { delete record[e] });
|
|
11
11
|
|
|
12
12
|
// 没用 被编辑的货物 和 form 就退出
|
|
@@ -18,7 +18,7 @@ export default async (s: InvoiceControllerState, record: any, controller:any) =>
|
|
|
18
18
|
record.lineAmountIncludeTax = undefined;
|
|
19
19
|
|
|
20
20
|
// 中间数据
|
|
21
|
-
const between: any = {...record };
|
|
21
|
+
const between: any = { ...record };
|
|
22
22
|
|
|
23
23
|
between.itemCode = record.itemCode;
|
|
24
24
|
between.shorthand = record.shorthand;
|
|
@@ -32,6 +32,7 @@ export default async (s: InvoiceControllerState, record: any, controller:any) =>
|
|
|
32
32
|
between.lineAmountExcludeTax = record.lineAmountExcludeTax;
|
|
33
33
|
between.taxRate = record.taxRate;
|
|
34
34
|
between.taxAmount = record.taxAmount;
|
|
35
|
+
between.mtzlDm = undefined;
|
|
35
36
|
|
|
36
37
|
// 设置编辑货物
|
|
37
38
|
const editGood: IGood = s.goodsListState.editGood = { ...s.goodsListState.editGood, ...between };
|
|
@@ -68,6 +69,12 @@ export default async (s: InvoiceControllerState, record: any, controller:any) =>
|
|
|
68
69
|
s.goodsListState.isTaxIncluded
|
|
69
70
|
? await updateUnitPriceExcludingTax(controller, s.goodsListState.form, record)
|
|
70
71
|
: await updateUnitPriceTax(controller, s.goodsListState.form, record)
|
|
72
|
+
|
|
73
|
+
if (s.goodsListState.isValidateMeiTan) {
|
|
74
|
+
if (await s.goodsListState.verifyMeiTanFn(record) === true) {
|
|
75
|
+
s.goodsListState.meiTanGoodIndex = [editGood.$index];
|
|
76
|
+
}
|
|
77
|
+
}
|
|
71
78
|
}
|
|
72
79
|
|
|
73
80
|
/** 货物单价,不含税 */
|
|
@@ -28,39 +28,39 @@ class MyInvoiceController extends InvoiceController {
|
|
|
28
28
|
this.state.autoComplete.onItemNameBlur = async (value: any) => {
|
|
29
29
|
console.log(value, 'onBuyerNameBlur - Blur');
|
|
30
30
|
|
|
31
|
-
return new Promise((resolve, reject)=> {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
31
|
+
return new Promise((resolve, reject) => {
|
|
32
|
+
resolve([
|
|
33
|
+
{
|
|
34
|
+
"taxCategoryCode": "1030206030000000000",
|
|
35
|
+
"productName": "醋及醋代用品",
|
|
36
|
+
"shorthand": "调味品",
|
|
37
|
+
"id": null,
|
|
38
|
+
"specification": null,
|
|
39
|
+
"createTime": null,
|
|
40
|
+
"status": 1,
|
|
41
|
+
"versionCode": "48.0",
|
|
42
|
+
"version": "32.0",
|
|
43
|
+
"startTime": "20190401",
|
|
44
|
+
"endTime": null,
|
|
45
|
+
"cargo": null,
|
|
46
|
+
"desc": null,
|
|
47
|
+
"taxRate": "13%",
|
|
48
|
+
"keyword": "食醋、米醋、酒醋、啤酒醋、麦芽醋、酒精醋、水果醋、醋精",
|
|
49
|
+
"summarizedItem": "N",
|
|
50
|
+
"countCode": null,
|
|
51
|
+
"customsItem": null,
|
|
52
|
+
"updateTime": null,
|
|
53
|
+
"hzx": null,
|
|
54
|
+
"children": null,
|
|
55
|
+
"vatspecialManagement": "",
|
|
56
|
+
"pid": "1030206000000000000",
|
|
57
|
+
"vatpolicyBasis": null,
|
|
58
|
+
"vatspecialManagementCode": "",
|
|
59
|
+
"gstpolicyBasisCode": null,
|
|
60
|
+
"gstspecialManagement": null,
|
|
61
|
+
"gstpolicyBasis": null
|
|
62
|
+
}
|
|
63
|
+
]);
|
|
64
64
|
|
|
65
65
|
});
|
|
66
66
|
//
|
|
@@ -127,19 +127,74 @@ class MyInvoiceController extends InvoiceController {
|
|
|
127
127
|
"specialGoodsMark": "",
|
|
128
128
|
"createTime": "2023-03-22 17:09:32",
|
|
129
129
|
"updateTime": "2023-03-22 17:09:32"
|
|
130
|
-
}
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"attributeVOList": null,
|
|
133
|
+
"productName": '原煤',
|
|
134
|
+
"name": null,
|
|
135
|
+
"productCode": "0003",
|
|
136
|
+
"shorthand": "小型起重设备",
|
|
137
|
+
"id": "10881474649024102400167947617243",
|
|
138
|
+
"specification": null,
|
|
139
|
+
"categoryId": "10688389540499947520167487266471",
|
|
140
|
+
"categoryName": "水果",
|
|
141
|
+
"internalNumber": null,
|
|
142
|
+
"taxCategoryName": "轻小型起重设备配套件",
|
|
143
|
+
"referenceAmount": null,
|
|
144
|
+
"priceAmount": 200.000,
|
|
145
|
+
"taxId": null,
|
|
146
|
+
"taxRate": null,
|
|
147
|
+
"brandName": null,
|
|
148
|
+
"buyGroupCode": null,
|
|
149
|
+
"buyGroupId": null,
|
|
150
|
+
"buyGroupName": null,
|
|
151
|
+
"categoryId": 2073,
|
|
152
|
+
"categoryName": "通用",
|
|
153
|
+
"companyId": "41daec4c-baa2-451f-b756-e26067b8657c",
|
|
154
|
+
"createTime": "2021-09-10 15:45:43.0",
|
|
155
|
+
"enjoyPreferentialPolicies": 0,
|
|
156
|
+
"factoryCode": null,
|
|
157
|
+
"factoryId": null,
|
|
158
|
+
"factoryName": null,
|
|
159
|
+
"id": 146200,
|
|
160
|
+
"internalNumber": "发动机盖",
|
|
161
|
+
"isUalityInspection": null,
|
|
162
|
+
"name": "原煤",
|
|
163
|
+
"preferentialPoliciesType": null,
|
|
164
|
+
"priceAmount": 50,
|
|
165
|
+
"procurementCycle": 0,
|
|
166
|
+
"shorthand": "煤炭",
|
|
167
|
+
"specification": "abc",
|
|
168
|
+
"spuCode": "6000001738252675",
|
|
169
|
+
"status": 1,
|
|
170
|
+
"taxCategoryCode": "1020101000000000000",
|
|
171
|
+
"taxExemptionType": "",
|
|
172
|
+
"taxId": 11,
|
|
173
|
+
"taxRate": null,
|
|
174
|
+
"unitId": 30,
|
|
175
|
+
"unitName": "件",
|
|
176
|
+
"itemType": "通用",
|
|
177
|
+
"itemNo": "6000001738252675",
|
|
178
|
+
"itemName": "原煤",
|
|
179
|
+
"itemCode": "123123",
|
|
180
|
+
"itemModelName": "abc",
|
|
181
|
+
"unit": "件",
|
|
182
|
+
"priceIncludeTax": 50,
|
|
183
|
+
"priceExcludeTax": 50,
|
|
184
|
+
"taxClassificationCode": "1020101000000000000"
|
|
185
|
+
},
|
|
131
186
|
];
|
|
132
187
|
|
|
133
|
-
return data.map((item: any) =>{
|
|
188
|
+
return data.map((item: any) => {
|
|
134
189
|
return {
|
|
135
190
|
...data,
|
|
136
|
-
itemName:item.productName,
|
|
137
|
-
taxClassificationCode:item.taxCategoryCode,
|
|
138
|
-
itemModelName:item.specification,
|
|
139
|
-
shorthand:item.shorthand,
|
|
140
|
-
priceIncludeTax:item.priceAmount,
|
|
141
|
-
unit:item.unitName,
|
|
142
|
-
taxRate:item.taxRate,
|
|
191
|
+
itemName: item.productName,
|
|
192
|
+
taxClassificationCode: item.taxCategoryCode,
|
|
193
|
+
itemModelName: item.specification,
|
|
194
|
+
shorthand: item.shorthand,
|
|
195
|
+
priceIncludeTax: item.priceAmount,
|
|
196
|
+
unit: item.unitName,
|
|
197
|
+
taxRate: item.taxRate,
|
|
143
198
|
}
|
|
144
199
|
})
|
|
145
200
|
};
|
|
@@ -147,6 +202,40 @@ class MyInvoiceController extends InvoiceController {
|
|
|
147
202
|
this.state.goodsListState.endowCode.onSearchTaxClassificationCode = async (value: any) => {
|
|
148
203
|
console.log(value, 'value-onSearchTaxClassificationCode');
|
|
149
204
|
|
|
205
|
+
if (value === '1020199000000000000') {
|
|
206
|
+
return [
|
|
207
|
+
{
|
|
208
|
+
"taxCategoryCode": "1020199000000000000",
|
|
209
|
+
"productName": "其他煤炭",
|
|
210
|
+
"shorthand": "其他煤炭",
|
|
211
|
+
"id": null,
|
|
212
|
+
"specification": null,
|
|
213
|
+
"createTime": "Tue Jun 20 14:55:37 CST 2023",
|
|
214
|
+
"status": 1,
|
|
215
|
+
"versionCode": "48.0",
|
|
216
|
+
"version": "32.0",
|
|
217
|
+
"startTime": "20190401",
|
|
218
|
+
"endTime": null,
|
|
219
|
+
"cargo": null,
|
|
220
|
+
"desc": null,
|
|
221
|
+
"taxRate": "",
|
|
222
|
+
"keyword": "金融服务",
|
|
223
|
+
"summarizedItem": "Y",
|
|
224
|
+
"countCode": null,
|
|
225
|
+
"customsItem": null,
|
|
226
|
+
"updateTime": "Tue Jun 20 14:55:37 CST 2023",
|
|
227
|
+
"hzx": "Y",
|
|
228
|
+
"children": null,
|
|
229
|
+
"vatspecialManagement": "",
|
|
230
|
+
"pid": "3000000000000000000",
|
|
231
|
+
"vatpolicyBasis": null,
|
|
232
|
+
"vatspecialManagementCode": "",
|
|
233
|
+
"gstpolicyBasisCode": null,
|
|
234
|
+
"gstspecialManagement": null,
|
|
235
|
+
"gstpolicyBasis": null
|
|
236
|
+
},
|
|
237
|
+
]
|
|
238
|
+
}
|
|
150
239
|
return [
|
|
151
240
|
{
|
|
152
241
|
"taxCategoryCode": "1030206030000000000",
|
|
@@ -183,7 +272,41 @@ class MyInvoiceController extends InvoiceController {
|
|
|
183
272
|
|
|
184
273
|
this.state.goodsListState.endowCode.onLoadTaxClassificationCode = async (value: any) => {
|
|
185
274
|
console.log(value, 'value-onSearchTaxClassificationCode');
|
|
186
|
-
if(value === '
|
|
275
|
+
if (value === '1020199000000000000') {
|
|
276
|
+
return [
|
|
277
|
+
{
|
|
278
|
+
"taxCategoryCode": "1020199000000000000",
|
|
279
|
+
"productName": "其他煤炭",
|
|
280
|
+
"shorthand": "其他煤炭",
|
|
281
|
+
"id": null,
|
|
282
|
+
"specification": null,
|
|
283
|
+
"createTime": "Tue Jun 20 14:55:37 CST 2023",
|
|
284
|
+
"status": 1,
|
|
285
|
+
"versionCode": "48.0",
|
|
286
|
+
"version": "32.0",
|
|
287
|
+
"startTime": "20190401",
|
|
288
|
+
"endTime": null,
|
|
289
|
+
"cargo": null,
|
|
290
|
+
"desc": null,
|
|
291
|
+
"taxRate": "",
|
|
292
|
+
"keyword": "金融服务",
|
|
293
|
+
"summarizedItem": "Y",
|
|
294
|
+
"countCode": null,
|
|
295
|
+
"customsItem": null,
|
|
296
|
+
"updateTime": "Tue Jun 20 14:55:37 CST 2023",
|
|
297
|
+
"hzx": "Y",
|
|
298
|
+
"children": null,
|
|
299
|
+
"vatspecialManagement": "",
|
|
300
|
+
"pid": "3000000000000000000",
|
|
301
|
+
"vatpolicyBasis": null,
|
|
302
|
+
"vatspecialManagementCode": "",
|
|
303
|
+
"gstpolicyBasisCode": null,
|
|
304
|
+
"gstspecialManagement": null,
|
|
305
|
+
"gstpolicyBasis": null
|
|
306
|
+
},
|
|
307
|
+
]
|
|
308
|
+
}
|
|
309
|
+
if (value === '3000000000000000000') {
|
|
187
310
|
return [
|
|
188
311
|
{
|
|
189
312
|
"taxCategoryCode": "3060000000000000000",
|
|
@@ -396,7 +519,7 @@ class MyInvoiceController extends InvoiceController {
|
|
|
396
519
|
"gstpolicyBasis": null
|
|
397
520
|
}
|
|
398
521
|
]
|
|
399
|
-
} else if(value === '3060000000000000000') {
|
|
522
|
+
} else if (value === '3060000000000000000') {
|
|
400
523
|
return [
|
|
401
524
|
{
|
|
402
525
|
"taxCategoryCode": "3060100000000000000",
|
|
@@ -519,7 +642,7 @@ class MyInvoiceController extends InvoiceController {
|
|
|
519
642
|
"gstpolicyBasis": null
|
|
520
643
|
}
|
|
521
644
|
]
|
|
522
|
-
}else {
|
|
645
|
+
} else {
|
|
523
646
|
return [
|
|
524
647
|
{
|
|
525
648
|
"taxCategoryCode": "3000000000000000000",
|
|
@@ -809,7 +932,7 @@ const getMok = async (current: number = 1) => {
|
|
|
809
932
|
"id": 146200,
|
|
810
933
|
"internalNumber": "发动机盖",
|
|
811
934
|
"isUalityInspection": null,
|
|
812
|
-
"name": "
|
|
935
|
+
"name": "原煤",
|
|
813
936
|
"preferentialPoliciesType": null,
|
|
814
937
|
"priceAmount": 50,
|
|
815
938
|
"procurementCycle": 0,
|
|
@@ -817,7 +940,7 @@ const getMok = async (current: number = 1) => {
|
|
|
817
940
|
"specification": "abc",
|
|
818
941
|
"spuCode": "6000001738252675",
|
|
819
942
|
"status": 1,
|
|
820
|
-
"taxCategoryCode": "
|
|
943
|
+
"taxCategoryCode": "1020101000000000000",
|
|
821
944
|
"taxExemptionType": "",
|
|
822
945
|
"taxId": 11,
|
|
823
946
|
"taxRate": null,
|
|
@@ -825,13 +948,13 @@ const getMok = async (current: number = 1) => {
|
|
|
825
948
|
"unitName": "件",
|
|
826
949
|
"itemType": "通用",
|
|
827
950
|
"itemNo": "6000001738252675",
|
|
828
|
-
"itemName": "
|
|
951
|
+
"itemName": "原煤",
|
|
829
952
|
"itemCode": "123123",
|
|
830
953
|
"itemModelName": "abc",
|
|
831
954
|
"unit": "件",
|
|
832
955
|
"priceIncludeTax": 50,
|
|
833
956
|
"priceExcludeTax": 50,
|
|
834
|
-
"taxClassificationCode": "
|
|
957
|
+
"taxClassificationCode": "1020101000000000000"
|
|
835
958
|
},
|
|
836
959
|
{
|
|
837
960
|
"attributeVOList": null,
|
|
@@ -861,7 +984,7 @@ const getMok = async (current: number = 1) => {
|
|
|
861
984
|
"taxCategoryCode": "1010301010000000000",
|
|
862
985
|
"taxExemptionType": "1",
|
|
863
986
|
"taxId": 1,
|
|
864
|
-
"taxRate":null,
|
|
987
|
+
"taxRate": null,
|
|
865
988
|
"unitId": null,
|
|
866
989
|
"unitName": null,
|
|
867
990
|
"itemType": "通用",
|
|
@@ -901,7 +1024,7 @@ const getMok = async (current: number = 1) => {
|
|
|
901
1024
|
"taxCategoryCode": null,
|
|
902
1025
|
"taxExemptionType": null,
|
|
903
1026
|
"taxId": null,
|
|
904
|
-
"taxRate":null,
|
|
1027
|
+
"taxRate": null,
|
|
905
1028
|
"unitId": 362,
|
|
906
1029
|
"unitName": "年",
|
|
907
1030
|
"itemType": "分类cc>1",
|
|
@@ -941,7 +1064,7 @@ const getMok = async (current: number = 1) => {
|
|
|
941
1064
|
"taxCategoryCode": "1060301020100000000",
|
|
942
1065
|
"taxExemptionType": null,
|
|
943
1066
|
"taxId": null,
|
|
944
|
-
"taxRate":null,
|
|
1067
|
+
"taxRate": null,
|
|
945
1068
|
"unitId": null,
|
|
946
1069
|
"unitName": null,
|
|
947
1070
|
"itemType": "通用",
|
|
@@ -981,7 +1104,7 @@ const getMok = async (current: number = 1) => {
|
|
|
981
1104
|
"taxCategoryCode": "1010107010000000000",
|
|
982
1105
|
"taxExemptionType": "3",
|
|
983
1106
|
"taxId": 1,
|
|
984
|
-
"taxRate":null,
|
|
1107
|
+
"taxRate": null,
|
|
985
1108
|
"unitId": 32,
|
|
986
1109
|
"unitName": "把",
|
|
987
1110
|
"itemType": "通用",
|
|
@@ -1021,7 +1144,7 @@ const getMok = async (current: number = 1) => {
|
|
|
1021
1144
|
"taxCategoryCode": "1000000000000000000",
|
|
1022
1145
|
"taxExemptionType": null,
|
|
1023
1146
|
"taxId": null,
|
|
1024
|
-
"taxRate":null,
|
|
1147
|
+
"taxRate": null,
|
|
1025
1148
|
"unitId": 11,
|
|
1026
1149
|
"unitName": "包",
|
|
1027
1150
|
"itemType": "通用",
|
|
@@ -1061,7 +1184,7 @@ const getMok = async (current: number = 1) => {
|
|
|
1061
1184
|
"taxCategoryCode": "233WD5FG00911",
|
|
1062
1185
|
"taxExemptionType": null,
|
|
1063
1186
|
"taxId": null,
|
|
1064
|
-
"taxRate":null,
|
|
1187
|
+
"taxRate": null,
|
|
1065
1188
|
"unitId": 11,
|
|
1066
1189
|
"unitName": "包",
|
|
1067
1190
|
"itemType": "通用",
|
|
@@ -1101,7 +1224,7 @@ const getMok = async (current: number = 1) => {
|
|
|
1101
1224
|
"taxCategoryCode": "233WD5FG00911",
|
|
1102
1225
|
"taxExemptionType": null,
|
|
1103
1226
|
"taxId": null,
|
|
1104
|
-
"taxRate":null,
|
|
1227
|
+
"taxRate": null,
|
|
1105
1228
|
"unitId": 11,
|
|
1106
1229
|
"unitName": "包",
|
|
1107
1230
|
"itemType": "通用",
|
|
@@ -1141,7 +1264,7 @@ const getMok = async (current: number = 1) => {
|
|
|
1141
1264
|
"taxCategoryCode": "233WD5FG00911",
|
|
1142
1265
|
"taxExemptionType": null,
|
|
1143
1266
|
"taxId": null,
|
|
1144
|
-
"taxRate":null,
|
|
1267
|
+
"taxRate": null,
|
|
1145
1268
|
"unitId": 11,
|
|
1146
1269
|
"unitName": "包",
|
|
1147
1270
|
"itemType": "通用",
|
package/src/Invoice/index.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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>
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
<code src="./_test/goodsMenuExpand/index.tsx" title="查看 Console" ></code>
|
|
38
38
|
|
|
39
39
|
## 设置数据源 获取发票单据编号
|
|
40
|
-
<code src="./_test/setDataSource/index.tsx" ></code
|
|
40
|
+
<code src="./_test/setDataSource/index.tsx" ></code>-->
|
|
41
41
|
|
|
42
42
|
## 设置数据源 导入购买方
|
|
43
43
|
<code src="./_test/importBuyer/index.tsx"></code>
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
## 设置数据源 赋码 税收分类编码列表
|
|
49
49
|
<code src="./_test/endowCode/index.tsx"></code>
|
|
50
50
|
|
|
51
|
-
<API name="Invoice 发票组件 API" exports='["default"]' src="./index.tsx" ></API>
|
|
51
|
+
<!-- <API name="Invoice 发票组件 API" exports='["default"]' src="./index.tsx" ></API>
|
|
52
52
|
<API name="InvoiceHeader 发票头 API" exports='["default"]' src="./ui/default/InvoiceHeader/index.tsx"></API>
|
|
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> -->
|
package/src/Invoice/index.tsx
CHANGED
|
@@ -27,6 +27,7 @@ import ImportBuyerDrawer from './ui/default/ImportBuyerDrawer';
|
|
|
27
27
|
import ImportGoodsDrawer from './ui/default/ImportGoodsDrawer';
|
|
28
28
|
import EndowCodeDrawer from './ui/default/EndowCodeDrawer';
|
|
29
29
|
import AddComparisonDrawer from './ui/default/AddComparisonDrawer';
|
|
30
|
+
import MeiTanModal from './ui/default/MeiTanModal';
|
|
30
31
|
// import { create, all } from 'mathjs';
|
|
31
32
|
// const config = {
|
|
32
33
|
// number: 'BigNumber',
|
|
@@ -164,6 +165,7 @@ const Main = (props: IInvoiceProps) => {
|
|
|
164
165
|
<ImportGoodsDrawer />{/* 导入货品的抽屉 */}
|
|
165
166
|
<EndowCodeDrawer />{/* 给货品赋码的抽屉 */}
|
|
166
167
|
<AddComparisonDrawer />{/* 添加商品对照的抽屉 */}
|
|
168
|
+
<MeiTanModal /> {/* 煤炭类弹框 */}
|
|
167
169
|
</InvoiceContext.Provider>
|
|
168
170
|
);
|
|
169
171
|
};
|
|
@@ -193,6 +195,7 @@ const Digtal = (props: IInvoiceProps) => {
|
|
|
193
195
|
|
|
194
196
|
<ImportGoodsDrawer />{ /** 导入货品的抽屉 */}
|
|
195
197
|
<EndowCodeDrawer />{ /** 给货品赋码的抽屉 */}
|
|
198
|
+
<MeiTanModal /> {/* 煤炭类弹框 */}
|
|
196
199
|
</InvoiceContext.Provider>
|
|
197
200
|
)
|
|
198
201
|
}
|
|
@@ -317,9 +317,9 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
|
|
|
317
317
|
const [list, setList] = React.useState<any>([]);
|
|
318
318
|
|
|
319
319
|
const onSearch = React.useCallback(async (value: any = null) => {
|
|
320
|
-
if(value?.target?.value){
|
|
320
|
+
if (value?.target?.value) {
|
|
321
321
|
const arr = await controller.state.goodsListState.endowCode.onSearchTaxClassificationCode(value?.target?.value);
|
|
322
|
-
const list: any[] = arr.map((item: any)=> {
|
|
322
|
+
const list: any[] = arr.map((item: any) => {
|
|
323
323
|
return {
|
|
324
324
|
...item,
|
|
325
325
|
title: `${item.productName} ${item.taxCategoryCode}`,
|
|
@@ -335,7 +335,7 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
|
|
|
335
335
|
|
|
336
336
|
const onLoad = React.useCallback(async (value?: any) => {
|
|
337
337
|
const arr = await controller.state.goodsListState.endowCode.onLoadTaxClassificationCode(value?.taxCategoryCode);
|
|
338
|
-
const data: any[] = arr.map((item: any)=> {
|
|
338
|
+
const data: any[] = arr.map((item: any) => {
|
|
339
339
|
return {
|
|
340
340
|
...item,
|
|
341
341
|
title: `${item.productName} ${item.taxCategoryCode}`,
|
|
@@ -345,8 +345,8 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
|
|
|
345
345
|
|
|
346
346
|
const treeData = optimizeTreeData(data);
|
|
347
347
|
|
|
348
|
-
if(value?.key) {
|
|
349
|
-
setList((origin: any)=> {
|
|
348
|
+
if (value?.key) {
|
|
349
|
+
setList((origin: any) => {
|
|
350
350
|
updateTreeData(origin, value.key, treeData)
|
|
351
351
|
});
|
|
352
352
|
} else {
|
|
@@ -386,20 +386,20 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
|
|
|
386
386
|
// });
|
|
387
387
|
let node = info.node || info;
|
|
388
388
|
actions.setFieldState('taxClassificationCode', async s => {
|
|
389
|
-
if(node.taxCategoryCode) {
|
|
389
|
+
if (node.taxCategoryCode) {
|
|
390
390
|
s.value = node.taxCategoryCode
|
|
391
391
|
}
|
|
392
392
|
});
|
|
393
393
|
|
|
394
394
|
actions.setFieldState('shorthand', async (s) => {
|
|
395
|
-
if (node.shorthand){
|
|
395
|
+
if (node.shorthand) {
|
|
396
396
|
s.value = node.shorthand
|
|
397
397
|
}
|
|
398
|
-
});
|
|
398
|
+
});
|
|
399
399
|
setOpen(false);
|
|
400
400
|
}, [controller, actions]);
|
|
401
401
|
|
|
402
|
-
const onSelect = React.useCallback((key: any, info: any) => {
|
|
402
|
+
const onSelect = React.useCallback((key: any, info: any) => {
|
|
403
403
|
let node = info.node || info;
|
|
404
404
|
if (controller.state.goodsListState.isUpdateGoodsTaxRateList) {
|
|
405
405
|
if (node.taxRateList?.length) {
|
|
@@ -421,7 +421,7 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
|
|
|
421
421
|
}, [controller, actions]);
|
|
422
422
|
|
|
423
423
|
const optimizeTreeData = (data: any): any => {
|
|
424
|
-
return data.map((item: any)=> {
|
|
424
|
+
return data.map((item: any) => {
|
|
425
425
|
return {
|
|
426
426
|
...item,
|
|
427
427
|
selectable: item?.hzx === 'N',
|
|
@@ -459,7 +459,7 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
|
|
|
459
459
|
info={info}
|
|
460
460
|
onSelect={onSelect}
|
|
461
461
|
onSubmit={onSubmit1}
|
|
462
|
-
onCancel={()=> {setOpen(false); setInfo({})}}
|
|
462
|
+
onCancel={() => { setOpen(false); setInfo({}) }}
|
|
463
463
|
onSearch={onSearch}
|
|
464
464
|
onLoad={onLoad}
|
|
465
465
|
/>
|
|
@@ -486,11 +486,12 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
|
|
|
486
486
|
good.taxFreeType = values.taxFreeType;
|
|
487
487
|
good.favouredPolicyMark = values.favouredPolicyMark;
|
|
488
488
|
good.favouredPolicyName = values.favouredPolicyName;
|
|
489
|
+
good.mtzlDm = undefined; //设置成空
|
|
489
490
|
|
|
490
491
|
// 无论是否含税,都保持价税合计不变
|
|
491
492
|
good.taxAmount = countTaxAmount(good.lineAmountIncludeTax || 0, s.goodsListState.deduction, values.taxRate);
|
|
492
|
-
if (good.taxAmount || good.taxAmount === 0
|
|
493
|
-
good.lineAmountExcludeTax = countAmountExcludeTax(good.lineAmountIncludeTax || 0, good.taxAmount);
|
|
493
|
+
if (good.taxAmount || good.taxAmount === 0) {
|
|
494
|
+
good.lineAmountExcludeTax = countAmountExcludeTax(good.lineAmountIncludeTax || 0, good.taxAmount);
|
|
494
495
|
}
|
|
495
496
|
if (good.lineAmountExcludeTax && good.quantity) {
|
|
496
497
|
good.priceExcludeTax = countPrice(good.lineAmountExcludeTax, good.quantity, controller.state.calculatingDigits) as any;
|
|
@@ -500,8 +501,15 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
|
|
|
500
501
|
good.goodsTaxRateList = goodsTaxRateList;
|
|
501
502
|
|
|
502
503
|
});
|
|
503
|
-
|
|
504
504
|
s.goodsListState.goodsList = s.goodsListState.goodsList.slice();
|
|
505
|
+
|
|
506
|
+
// 煤炭类判断
|
|
507
|
+
if (s.goodsListState.isValidateMeiTan) {
|
|
508
|
+
if (await s.goodsListState.verifyMeiTanFn(values) === true) {
|
|
509
|
+
s.goodsListState.meiTanGoodIndex = s.goodsListState.endowCode.endowcodeGoodIndex.slice();
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
|
|
505
513
|
s.goodsListState.endowCode.endowcodeGoodIndex = [];
|
|
506
514
|
})();
|
|
507
515
|
}, [controller, goodsTaxRateList]);
|
|
@@ -532,7 +540,7 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
|
|
|
532
540
|
}, [controller]);
|
|
533
541
|
|
|
534
542
|
return (
|
|
535
|
-
<SchemaForm actions={actions} previewPlaceholder=" "
|
|
543
|
+
<SchemaForm actions={actions} previewPlaceholder=" " components={{ ...components, showSearch: !!controller.state.goodsListState.endowCode.onLoadTaxClassificationCode ? ShowSearch3 : ShowSearch }} effects={effects}>
|
|
536
544
|
<FormButtonGroup>
|
|
537
545
|
<Field
|
|
538
546
|
name="taxClassificationCode"
|
|
@@ -14,7 +14,7 @@ export default () => {
|
|
|
14
14
|
const topExpand = controller.useMemo(s => s.goodsListState.importGoods.topExpand, []);
|
|
15
15
|
|
|
16
16
|
const onClose = React.useCallback(() => {
|
|
17
|
-
controller.pipeline(async s => {
|
|
17
|
+
controller.pipeline(async s => {
|
|
18
18
|
s.goodsListState.importGoods.filter = {};
|
|
19
19
|
s.goodsListState.importGoods.isVisibleDrawer = false;
|
|
20
20
|
})();
|
|
@@ -90,6 +90,7 @@ const DrawerBody = () => {
|
|
|
90
90
|
...s.goodsListState.editGood,
|
|
91
91
|
itemModelName: undefined,
|
|
92
92
|
itemModelNameSelf: undefined,
|
|
93
|
+
mtzlDm: undefined,
|
|
93
94
|
...between
|
|
94
95
|
};
|
|
95
96
|
|
|
@@ -128,6 +129,11 @@ const DrawerBody = () => {
|
|
|
128
129
|
s.goodsListState.isTaxIncluded
|
|
129
130
|
? await updateUnitPriceExcludingTax(controller, s.goodsListState.form, record)
|
|
130
131
|
: await updateUnitPriceTax(controller, s.goodsListState.form, record)
|
|
132
|
+
if (s.goodsListState.isValidateMeiTan) {
|
|
133
|
+
if (await s.goodsListState.verifyMeiTanFn(record) === true) {
|
|
134
|
+
s.goodsListState.meiTanGoodIndex = [editGood.$index];
|
|
135
|
+
}
|
|
136
|
+
}
|
|
131
137
|
})
|
|
132
138
|
}
|
|
133
139
|
};
|