kts-component-invoice-operate 3.1.2 → 3.1.4

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.
Files changed (117) hide show
  1. package/.dumi/theme/builtins/API.tsx +66 -66
  2. package/.editorconfig +16 -16
  3. package/.fatherrc.ts +4 -4
  4. package/.prettierignore +7 -7
  5. package/.prettierrc +11 -11
  6. package/.umirc.ts +8 -8
  7. package/README.md +5 -5
  8. package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood/index.d.ts +2 -2
  9. package/dist/Invoice/ui/GoodsList/hook/useColumns/autoFillFn/index.d.ts +1 -1
  10. package/dist/index.esm.js +2715 -3859
  11. package/dist/index.js +2715 -3859
  12. package/docs/index.md +5 -5
  13. package/docs-dist/umi.js +1 -1
  14. package/index.html +12 -12
  15. package/package.json +59 -59
  16. package/src/Invoice/InvoiceController/InvoiceControllerForm/index.ts +94 -94
  17. package/src/Invoice/InvoiceController/InvoiceControllerState/BuyerState/index.tsx +88 -88
  18. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/EndowCode/index.tsx +90 -90
  19. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IColumnsReplenish/index.ts +10 -10
  20. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood/index.ts +72 -72
  21. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/ImportGoods/index.ts +80 -80
  22. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/LineAttributeType/index.ts +5 -5
  23. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/ProductComparison/index.ts +9 -9
  24. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/index.ts +88 -88
  25. package/src/Invoice/InvoiceController/InvoiceControllerState/index.ts +42 -42
  26. package/src/Invoice/InvoiceController/fns/addGood.ts +11 -11
  27. package/src/Invoice/InvoiceController/fns/addGoodDiscount.ts +125 -125
  28. package/src/Invoice/InvoiceController/fns/delGood.ts +43 -43
  29. package/src/Invoice/InvoiceController/fns/getGoodsSearch.ts +23 -23
  30. package/src/Invoice/InvoiceController/fns/saveEditGood.ts +23 -23
  31. package/src/Invoice/InvoiceController/fns/setEditGood.ts +16 -16
  32. package/src/Invoice/InvoiceController/fns/setGoods.ts +10 -10
  33. package/src/Invoice/InvoiceController/fns/updateInvoiceNo.ts +8 -8
  34. package/src/Invoice/InvoiceController/index.ts +61 -61
  35. package/src/Invoice/_test/buyerNameSearch/index.tsx +41 -41
  36. package/src/Invoice/_test/deduction/index.tsx +935 -935
  37. package/src/Invoice/_test/draft/index.tsx +40 -40
  38. package/src/Invoice/_test/easiest/index.tsx +5 -5
  39. package/src/Invoice/_test/endowCode/index.tsx +1095 -1095
  40. package/src/Invoice/_test/goodsMenuExpand/index.tsx +32 -32
  41. package/src/Invoice/_test/importBuyer/index.tsx +74 -74
  42. package/src/Invoice/_test/importGoods/index.tsx +515 -515
  43. package/src/Invoice/_test/invoiceType/index.tsx +59 -59
  44. package/src/Invoice/_test/isInvoiceNo/index.tsx +12 -12
  45. package/src/Invoice/_test/replaceHead/index.tsx +22 -22
  46. package/src/Invoice/_test/retrieveData/index.tsx +22 -22
  47. package/src/Invoice/_test/seller/index.tsx +28 -28
  48. package/src/Invoice/_test/setDataSource/index.tsx +22 -22
  49. package/src/Invoice/_test/unit/index.tsx +19 -19
  50. package/src/Invoice/index.less +12 -12
  51. package/src/Invoice/index.md +53 -53
  52. package/src/Invoice/index.tsx +104 -104
  53. package/src/Invoice/tools/calculate/index.ts +97 -97
  54. package/src/Invoice/tools/coolingFn/index.ts +17 -17
  55. package/src/Invoice/tools/evaluate/index.ts +7 -7
  56. package/src/Invoice/tools/idGenerator/index.ts +2 -2
  57. package/src/Invoice/tools/itemName/index.ts +46 -46
  58. package/src/Invoice/tools/lazyFn/index.ts +19 -19
  59. package/src/Invoice/tools/strringFn/index.ts +40 -40
  60. package/src/Invoice/ui/AddComparisonDrawer/index.tsx +149 -149
  61. package/src/Invoice/ui/Buyer/index.less +219 -219
  62. package/src/Invoice/ui/Buyer/index.tsx +114 -114
  63. package/src/Invoice/ui/Buyer/ui/BuyerNameInput/index.tsx +166 -166
  64. package/src/Invoice/ui/Buyer/ui/ImportBuyerButton/index.tsx +21 -21
  65. package/src/Invoice/ui/EndowCodeDrawer/index.less +8 -8
  66. package/src/Invoice/ui/EndowCodeDrawer/index.tsx +441 -441
  67. package/src/Invoice/ui/GoodsList/hook/useColumns/autoFillFn/index.ts +490 -490
  68. package/src/Invoice/ui/GoodsList/hook/useColumns/index.tsx +603 -603
  69. package/src/Invoice/ui/GoodsList/hook/useColumns/ui/ItemNameInput/index.less +9 -9
  70. package/src/Invoice/ui/GoodsList/hook/useColumns/ui/ItemNameInput/index.tsx +34 -34
  71. package/src/Invoice/ui/GoodsList/hook/useColumns/ui/RowEditButton/index.tsx +30 -30
  72. package/src/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/_useAddComparison/index.tsx +43 -43
  73. package/src/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.tsx +76 -76
  74. package/src/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useDelItem/index.tsx +35 -35
  75. package/src/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.tsx +34 -34
  76. package/src/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/index.less +13 -13
  77. package/src/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/index.tsx +98 -98
  78. package/src/Invoice/ui/GoodsList/hook/useColumns/ui/RowSaveButton/index.tsx +14 -14
  79. package/src/Invoice/ui/GoodsList/hook/useColumns/ui/TitleText/index.tsx +20 -20
  80. package/src/Invoice/ui/GoodsList/hook/useDeduction/index.tsx +24 -24
  81. package/src/Invoice/ui/GoodsList/hook/useOnRow/index.tsx +39 -39
  82. package/src/Invoice/ui/GoodsList/hook/useRowSelection/index.tsx +111 -111
  83. package/src/Invoice/ui/GoodsList/hook/useToGenerateId/index.ts +8 -8
  84. package/src/Invoice/ui/GoodsList/hook/useWindowClick/index.tsx +23 -23
  85. package/src/Invoice/ui/GoodsList/index.less +170 -170
  86. package/src/Invoice/ui/GoodsList/index.tsx +177 -177
  87. package/src/Invoice/ui/GoodsList/ui/AddRowButton/index.tsx +61 -61
  88. package/src/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useAddDiscountRowButton/index.less +21 -21
  89. package/src/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useAddDiscountRowButton/index.tsx +244 -244
  90. package/src/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useCommodityComparisonButton/index.tsx +75 -75
  91. package/src/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useDelRowButton/index.tsx +66 -66
  92. package/src/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useEndowCodeButton/index.tsx +58 -58
  93. package/src/Invoice/ui/GoodsList/ui/BulkMenu/index.tsx +37 -37
  94. package/src/Invoice/ui/GoodsList/ui/DescribeSwitch/index.tsx +36 -36
  95. package/src/Invoice/ui/GoodsList/ui/Search/index.less +10 -10
  96. package/src/Invoice/ui/GoodsList/ui/Search/index.tsx +50 -50
  97. package/src/Invoice/ui/GoodsList/ui/Statistics/index.less +18 -18
  98. package/src/Invoice/ui/GoodsList/ui/Statistics/index.tsx +109 -109
  99. package/src/Invoice/ui/GoodsList/ui/TableRow/index.tsx +27 -27
  100. package/src/Invoice/ui/GoodsList/ui/TableVirtual/index.less +38 -38
  101. package/src/Invoice/ui/GoodsList/ui/TableVirtual/index.tsx +105 -105
  102. package/src/Invoice/ui/GoodsList/ui/TableVirtual.o/index.less +44 -44
  103. package/src/Invoice/ui/GoodsList/ui/TableVirtual.o/index.tsx +96 -96
  104. package/src/Invoice/ui/GoodsList/ui/TaxIncludedSwitch/index.tsx +30 -30
  105. package/src/Invoice/ui/ImportBuyerDrawer/index.tsx +75 -75
  106. package/src/Invoice/ui/ImportGoodsDrawer/index.tsx +174 -174
  107. package/src/Invoice/ui/InvoiceHeader/index.less +68 -68
  108. package/src/Invoice/ui/InvoiceHeader/index.tsx +246 -246
  109. package/src/Invoice/ui/Seller/index.less +113 -113
  110. package/src/Invoice/ui/Seller/index.tsx +98 -98
  111. package/src/Invoice/ui/Sign/index.less +14 -14
  112. package/src/Invoice/ui/Sign/index.tsx +71 -71
  113. package/src/index.ts +6 -6
  114. package/tsconfig.json +31 -31
  115. package/typings.d.ts +3 -3
  116. package/yarn.e.lock +14331 -14331
  117. package/yarn.o.lock +14800 -14800
@@ -1,91 +1,91 @@
1
- import GoodsListState from '../../GoodsListState';
2
- import IGood from '../IGood';
3
- import LineAttributeType from '../LineAttributeType';
4
-
5
- export default class EndowCode {
6
-
7
- /** 准备赋码的货物索引列表 */
8
- endowcodeGoodIndex: string[] = [];
9
-
10
- /**
11
- * 获取 税收分类编码列表 (弃用)
12
- * @deprecated 请使用 getTaxCategoryCodeTree 替换
13
- * */
14
- getTaxCategoryCodeList: (value: string) => Promise<{ value: string, label: string }[]> = async () => [];
15
-
16
- /**
17
- * 获取 税收分类编码树
18
- * @param taxCategoryCode 税收分类编码
19
- * @param val val
20
- * @returns 税收分类编码树
21
- */
22
- getTaxCategoryCodeTree?: (taxCategoryCode?: string, val?: string) => Promise<{ id: string, pid: string }[]>;
23
-
24
- /** 税率 优惠政策 */
25
- getReadOnlyTaxRate?: (value?: GoodsListState) => boolean;
26
-
27
- /** 优惠政策 优惠政策 */
28
- getReadOnlyFavouredPolicy?: (value?: GoodsListState) => boolean;
29
-
30
- /**
31
- * 获取赋码时候的默认值
32
- * @param value 商品信息
33
- * @param length 商品数量
34
- * */
35
- getDefaultValue?: (value: IGood, length: number) => Promise<IGood>;
36
-
37
- /** 税率 是否可以编辑 校验函数 */
38
- readonly readOnlyTaxRateMap: { [key: string]: (value?: GoodsListState) => boolean } = {
39
- /** 草稿发票 */
40
- DRAFT: draft,
41
- };
42
-
43
- /** 优惠政策类型列表 */
44
- favouredPolicyNameList: string[] = [
45
- '100%先征后退',
46
- '即征即退30%',
47
- '即征即退50%',
48
- '即征即退70%',
49
- '按3%简易征收',
50
- '按5%简易征收',
51
- '按3%简易征收减按1.5%计征',
52
- '稀土产品',
53
- '简易征收',
54
- '50%先征后退',
55
- '不征税',
56
- '先征后退',
57
- '免税',
58
- '即征即退100%',
59
- '超税负3%即征即退',
60
- '超税负8%即征即退',
61
- '超税负12%即征即退',
62
- ];
63
-
64
- /** 免税类型 列表 */
65
- taxFreeTypeList: any[] = [
66
- { label: '出口免税和其他免税优惠政策(免税)', value: 1 },
67
- { label: '不征增值税(不征税))', value: 2 },
68
- { label: '普通零税率(0%)', value: 3 },
69
- ];
70
-
71
- /**
72
- * 小规模纳税人 自动赋码缓存 、
73
- * */
74
- cache: { [key: string]: any } = {};
75
- }
76
-
77
- /** 草稿发票 税率 是否可以编辑 校验函数 */
78
- function draft(value?: GoodsListState) {
79
- if (!value) return true;
80
-
81
- // isDiscount
82
- const goods = value.endowCode.endowcodeGoodIndex.map(e => value.goodsMap.get(e)).filter(e => e?.lineAttribute !== LineAttributeType.折扣行);
83
- const isDiscount = goods.some(e => e?.lineAttribute === LineAttributeType.被折扣行);
84
-
85
- // 是否折扣
86
- if (isDiscount) {
87
- return goods.length === 1
88
- } else {
89
- return false;
90
- }
1
+ import GoodsListState from '../../GoodsListState';
2
+ import IGood from '../IGood';
3
+ import LineAttributeType from '../LineAttributeType';
4
+
5
+ export default class EndowCode {
6
+
7
+ /** 准备赋码的货物索引列表 */
8
+ endowcodeGoodIndex: string[] = [];
9
+
10
+ /**
11
+ * 获取 税收分类编码列表 (弃用)
12
+ * @deprecated 请使用 getTaxCategoryCodeTree 替换
13
+ * */
14
+ getTaxCategoryCodeList: (value: string) => Promise<{ value: string, label: string }[]> = async () => [];
15
+
16
+ /**
17
+ * 获取 税收分类编码树
18
+ * @param taxCategoryCode 税收分类编码
19
+ * @param val val
20
+ * @returns 税收分类编码树
21
+ */
22
+ getTaxCategoryCodeTree?: (taxCategoryCode?: string, val?: string) => Promise<{ id: string, pid: string }[]>;
23
+
24
+ /** 税率 优惠政策 */
25
+ getReadOnlyTaxRate?: (value?: GoodsListState) => boolean;
26
+
27
+ /** 优惠政策 优惠政策 */
28
+ getReadOnlyFavouredPolicy?: (value?: GoodsListState) => boolean;
29
+
30
+ /**
31
+ * 获取赋码时候的默认值
32
+ * @param value 商品信息
33
+ * @param length 商品数量
34
+ * */
35
+ getDefaultValue?: (value: IGood, length: number) => Promise<IGood>;
36
+
37
+ /** 税率 是否可以编辑 校验函数 */
38
+ readonly readOnlyTaxRateMap: { [key: string]: (value?: GoodsListState) => boolean } = {
39
+ /** 草稿发票 */
40
+ DRAFT: draft,
41
+ };
42
+
43
+ /** 优惠政策类型列表 */
44
+ favouredPolicyNameList: string[] = [
45
+ '100%先征后退',
46
+ '即征即退30%',
47
+ '即征即退50%',
48
+ '即征即退70%',
49
+ '按3%简易征收',
50
+ '按5%简易征收',
51
+ '按3%简易征收减按1.5%计征',
52
+ '稀土产品',
53
+ '简易征收',
54
+ '50%先征后退',
55
+ '不征税',
56
+ '先征后退',
57
+ '免税',
58
+ '即征即退100%',
59
+ '超税负3%即征即退',
60
+ '超税负8%即征即退',
61
+ '超税负12%即征即退',
62
+ ];
63
+
64
+ /** 免税类型 列表 */
65
+ taxFreeTypeList: any[] = [
66
+ { label: '出口免税和其他免税优惠政策(免税)', value: 1 },
67
+ { label: '不征增值税(不征税))', value: 2 },
68
+ { label: '普通零税率(0%)', value: 3 },
69
+ ];
70
+
71
+ /**
72
+ * 小规模纳税人 自动赋码缓存 、
73
+ * */
74
+ cache: { [key: string]: any } = {};
75
+ }
76
+
77
+ /** 草稿发票 税率 是否可以编辑 校验函数 */
78
+ function draft(value?: GoodsListState) {
79
+ if (!value) return true;
80
+
81
+ // isDiscount
82
+ const goods = value.endowCode.endowcodeGoodIndex.map(e => value.goodsMap.get(e)).filter(e => e?.lineAttribute !== LineAttributeType.折扣行);
83
+ const isDiscount = goods.some(e => e?.lineAttribute === LineAttributeType.被折扣行);
84
+
85
+ // 是否折扣
86
+ if (isDiscount) {
87
+ return goods.length === 1
88
+ } else {
89
+ return false;
90
+ }
91
91
  }
@@ -1,10 +1,10 @@
1
-
2
- /** 商品表格补充配置 */
3
-
4
- import { ValidationRule } from "kts-components-antd-x3/lib/form";
5
-
6
- export default interface IColumnsReplenish {
7
-
8
- /** 补充的规则 */
9
- rules: ValidationRule[];
10
- }
1
+
2
+ /** 商品表格补充配置 */
3
+
4
+ import { ValidationRule } from "kts-components-antd-x3/lib/form";
5
+
6
+ export default interface IColumnsReplenish {
7
+
8
+ /** 补充的规则 */
9
+ rules: ValidationRule[];
10
+ }
@@ -1,72 +1,72 @@
1
- import LineAttributeType from '../LineAttributeType';
2
-
3
- export default interface IGood {
4
- /** 数据索引 */
5
- $index: string;
6
-
7
- /** 序号 */
8
- serialNo?: number;
9
-
10
- /** 折扣组 uuid */
11
- discountGroup?: string;
12
-
13
- /** 发票ID */
14
- id?: string;
15
-
16
- /** 商品编码(对方-购买方) */
17
- itemCode?: string;
18
-
19
- /** 货物名称(对方-购买方) */
20
- itemName?: string;
21
-
22
- /** 单位(对方-购买方) */
23
- unit?: string;
24
-
25
- /** 货物规格型号(对方-购买方) */
26
- itemModelName?: string;
27
-
28
- /** 商品编码(我方-销售) */
29
- itemCodeSelf?: string;
30
-
31
- /** 货物名称(我方-销售) */
32
- itemNameSelf?: string;
33
-
34
- /** 货物规格型号(我方-销售) */
35
- itemModelNameSelf?: string;
36
-
37
- /** 数量 */
38
- quantity?: number;
39
-
40
- /** 单价(含税) */
41
- priceIncludeTax?: number;
42
-
43
- /** 单价(不含税) */
44
- priceExcludeTax?: number;
45
-
46
- /** 类型 0 正常行, 1 折扣行 2 被折扣行 */
47
- lineAttribute: LineAttributeType;
48
-
49
- /** 金额(含税) */
50
- lineAmountIncludeTax?: number;
51
-
52
- /** 金额(不含税) */
53
- lineAmountExcludeTax?: number;
54
-
55
- /** 税率 */
56
- taxRate?: number;
57
-
58
- /** 免税类型 */
59
- taxFreeType?: string;
60
-
61
- /** 税额 */
62
- taxAmount?: number;
63
-
64
- /** 税收分类编码 */
65
- taxClassificationCode?: string;
66
-
67
- /** 是否享受优惠政策 */
68
- favouredPolicyMark?: number;
69
-
70
- /** 优惠政策类型 */
71
- favouredPolicyName?: string;
72
- }
1
+ import LineAttributeType from '../LineAttributeType';
2
+
3
+ export default interface IGood {
4
+ /** 数据索引 */
5
+ $index: string;
6
+
7
+ /** 序号 */
8
+ serialNo?: number;
9
+
10
+ /** 折扣组 uuid */
11
+ discountGroup?: string;
12
+
13
+ /** 发票ID */
14
+ id?: string;
15
+
16
+ /** 商品编码(对方-购买方) */
17
+ itemCode?: string;
18
+
19
+ /** 项目名称(对方-购买方) */
20
+ itemName?: string;
21
+
22
+ /** 单位(对方-购买方) */
23
+ unit?: string;
24
+
25
+ /** 货物规格型号(对方-购买方) */
26
+ itemModelName?: string;
27
+
28
+ /** 商品编码(我方-销售) */
29
+ itemCodeSelf?: string;
30
+
31
+ /** 项目名称(我方-销售) */
32
+ itemNameSelf?: string;
33
+
34
+ /** 货物规格型号(我方-销售) */
35
+ itemModelNameSelf?: string;
36
+
37
+ /** 数量 */
38
+ quantity?: number;
39
+
40
+ /** 单价(含税) */
41
+ priceIncludeTax?: number;
42
+
43
+ /** 单价(不含税) */
44
+ priceExcludeTax?: number;
45
+
46
+ /** 类型 0 正常行, 1 折扣行 2 被折扣行 */
47
+ lineAttribute: LineAttributeType;
48
+
49
+ /** 金额(含税) */
50
+ lineAmountIncludeTax?: number;
51
+
52
+ /** 金额(不含税) */
53
+ lineAmountExcludeTax?: number;
54
+
55
+ /** 税率 */
56
+ taxRate?: number;
57
+
58
+ /** 免税类型 */
59
+ taxFreeType?: string;
60
+
61
+ /** 税额 */
62
+ taxAmount?: number;
63
+
64
+ /** 税收分类编码 */
65
+ taxClassificationCode?: string;
66
+
67
+ /** 是否享受优惠政策 */
68
+ favouredPolicyMark?: number;
69
+
70
+ /** 优惠政策类型 */
71
+ favouredPolicyName?: string;
72
+ }
@@ -1,80 +1,80 @@
1
- import { ColumnProps } from 'kts-components-antd-x3/lib/Table/interface';
2
- import { PaginationConfig } from 'kts-components-antd-x3/lib/Table';
3
- import { message } from 'kts-components-antd-x3';
4
- import React from 'react';
5
-
6
- export interface IGetGoodsListOption {
7
- /** 分页数据 */
8
- pagination: PaginationConfig;
9
- }
10
-
11
- export default class ImportGoods<ColumnType = any> {
12
- /** 表头 */
13
- columns: ColumnProps<ColumnType>[] = [
14
- {
15
- title: '商品分类',
16
- dataIndex: 'itemType',
17
- key: 'itemType',
18
- },
19
- {
20
- title: '商品编码',
21
- dataIndex: 'itemNo',
22
- key: 'itemNo',
23
- },
24
- {
25
- title: '商品名称',
26
- dataIndex: 'itemName',
27
- key: 'itemName',
28
- },
29
- {
30
- title: '规格型号',
31
- dataIndex: 'itemModelName',
32
- key: 'itemModelName',
33
- },
34
- {
35
- title: '计量单位',
36
- dataIndex: 'unit',
37
- key: 'unit',
38
- },
39
- {
40
- title: '税率(%)',
41
- dataIndex: 'taxRate',
42
- key: 'taxRate',
43
- },
44
- {
45
- title: '单价(含税)',
46
- dataIndex: 'priceIncludeTax',
47
- key: 'priceIncludeTax',
48
- },
49
- {
50
- title: '税收分类编码',
51
- dataIndex: 'taxClassificationCode',
52
- key: 'taxClassificationCode',
53
- },
54
- ];
55
-
56
- /** 货物列表 */
57
- dataSource: ColumnType[] = [];
58
-
59
- /** 分页数据 */
60
- pagination: PaginationConfig = {};
61
-
62
- /** 是否显示导入 */
63
- isVisibleDrawer = false;
64
-
65
- /** 顶部扩展 */
66
- topExpand?: React.ReactNode;
67
-
68
- /** 导入时校验函数 */
69
- verifyFn: (record: any) => Promise<boolean> = async record => {
70
- if (!record.taxClassificationCode) {
71
- message.error({ content: '请维护该商品的税收分类编码!', key: '请维护该商品的税收分类编码!' })
72
- return false;
73
- }
74
- if (record.productStatus === 0) {
75
- message.error({ content: '当前货物为禁用', key: '当前货物为禁用' })
76
- return false;
77
- }
78
- return true;
79
- };
80
- }
1
+ import { ColumnProps } from 'kts-components-antd-x3/lib/Table/interface';
2
+ import { PaginationConfig } from 'kts-components-antd-x3/lib/Table';
3
+ import { message } from 'kts-components-antd-x3';
4
+ import React from 'react';
5
+
6
+ export interface IGetGoodsListOption {
7
+ /** 分页数据 */
8
+ pagination: PaginationConfig;
9
+ }
10
+
11
+ export default class ImportGoods<ColumnType = any> {
12
+ /** 表头 */
13
+ columns: ColumnProps<ColumnType>[] = [
14
+ {
15
+ title: '商品分类',
16
+ dataIndex: 'itemType',
17
+ key: 'itemType',
18
+ },
19
+ {
20
+ title: '商品编码',
21
+ dataIndex: 'itemNo',
22
+ key: 'itemNo',
23
+ },
24
+ {
25
+ title: '商品名称',
26
+ dataIndex: 'itemName',
27
+ key: 'itemName',
28
+ },
29
+ {
30
+ title: '规格型号',
31
+ dataIndex: 'itemModelName',
32
+ key: 'itemModelName',
33
+ },
34
+ {
35
+ title: '计量单位',
36
+ dataIndex: 'unit',
37
+ key: 'unit',
38
+ },
39
+ {
40
+ title: '税率(%)',
41
+ dataIndex: 'taxRate',
42
+ key: 'taxRate',
43
+ },
44
+ {
45
+ title: '单价(含税)',
46
+ dataIndex: 'priceIncludeTax',
47
+ key: 'priceIncludeTax',
48
+ },
49
+ {
50
+ title: '税收分类编码',
51
+ dataIndex: 'taxClassificationCode',
52
+ key: 'taxClassificationCode',
53
+ },
54
+ ];
55
+
56
+ /** 货物列表 */
57
+ dataSource: ColumnType[] = [];
58
+
59
+ /** 分页数据 */
60
+ pagination: PaginationConfig = {};
61
+
62
+ /** 是否显示导入 */
63
+ isVisibleDrawer = false;
64
+
65
+ /** 顶部扩展 */
66
+ topExpand?: React.ReactNode;
67
+
68
+ /** 导入时校验函数 */
69
+ verifyFn: (record: any) => Promise<boolean> = async record => {
70
+ if (!record.taxClassificationCode) {
71
+ message.error({ content: '请维护该商品的税收分类编码!', key: '请维护该商品的税收分类编码!' })
72
+ return false;
73
+ }
74
+ if (record.productStatus === 0) {
75
+ message.error({ content: '当前货物为禁用', key: '当前货物为禁用' })
76
+ return false;
77
+ }
78
+ return true;
79
+ };
80
+ }
@@ -1,6 +1,6 @@
1
- enum LineAttributeType {
2
- 正常 = 0,
3
- 折扣行 = 1,
4
- 被折扣行 = 2
5
- }
1
+ enum LineAttributeType {
2
+ 正常 = 0,
3
+ 折扣行 = 1,
4
+ 被折扣行 = 2
5
+ }
6
6
  export default LineAttributeType;
@@ -1,10 +1,10 @@
1
- import IGood from "../IGood";
2
-
3
- export default class ProductComparison {
4
-
5
- /** 执行商品对照 */
6
- onComply?: (e: IGood[]) => Promise<IGood[]>
7
-
8
- /** 更新对照表 */
9
- // onUpdateComparisonTable?: (e: IGood, values:any) => Promise<void>
1
+ import IGood from "../IGood";
2
+
3
+ export default class ProductComparison {
4
+
5
+ /** 执行商品对照 */
6
+ onComply?: (e: IGood[]) => Promise<IGood[]>
7
+
8
+ /** 更新对照表 */
9
+ // onUpdateComparisonTable?: (e: IGood, values:any) => Promise<void>
10
10
  }