kts-component-invoice-operate 1.0.99 → 1.0.104

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 (51) 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/index.esm.js +36 -18
  9. package/dist/index.js +36 -18
  10. package/docs-dist/404.html +1 -1
  11. package/docs-dist/index.html +1 -1
  12. package/docs-dist/umi.css +2 -2
  13. package/docs-dist/umi.js +1 -1
  14. package/package.json +1 -1
  15. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/EndowCode.tsx +71 -71
  16. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood.ts +57 -57
  17. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/index.ts +13 -0
  18. package/src/Invoice/InvoiceController/fns/addGood.ts +11 -11
  19. package/src/Invoice/InvoiceController/fns/delGood.ts +45 -45
  20. package/src/Invoice/InvoiceController/fns/saveEditGood.ts +23 -23
  21. package/src/Invoice/InvoiceController/fns/setEditGood.ts +16 -16
  22. package/src/Invoice/InvoiceController/fns/updateInvoiceNo.ts +8 -8
  23. package/src/Invoice/InvoiceController/index.ts +57 -57
  24. package/src/Invoice/_test/deduction/index.tsx +42 -0
  25. package/src/Invoice/_test/draft/index.tsx +2 -3
  26. package/src/Invoice/_test/easiest/index.tsx +5 -5
  27. package/src/Invoice/_test/importBuyer/index.tsx +74 -74
  28. package/src/Invoice/_test/isInvoiceNo/index.tsx +12 -12
  29. package/src/Invoice/_test/setDataSource/index.tsx +22 -22
  30. package/src/Invoice/_test/unit/index.tsx +19 -19
  31. package/src/Invoice/index.less +12 -12
  32. package/src/Invoice/index.md +3 -0
  33. package/src/Invoice/index.tsx +104 -104
  34. package/src/Invoice/tools/calculate/index.ts +70 -5
  35. package/src/Invoice/tools/evaluate/index.ts +7 -7
  36. package/src/Invoice/ui/EndowCodeDrawer/index.less +8 -8
  37. package/src/Invoice/ui/EndowCodeDrawer/index.tsx +7 -3
  38. package/src/Invoice/ui/GoodsList/hook/useColumns/autoFillFn/index.ts +32 -46
  39. package/src/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/index.tsx +5 -2
  40. package/src/Invoice/ui/GoodsList/hook/useDeduction/index.tsx +24 -0
  41. package/src/Invoice/ui/GoodsList/hook/useOnRow/index.tsx +4 -0
  42. package/src/Invoice/ui/GoodsList/hook/useWindowClick/index.tsx +23 -0
  43. package/src/Invoice/ui/GoodsList/index.less +1 -0
  44. package/src/Invoice/ui/GoodsList/index.tsx +38 -13
  45. package/src/Invoice/ui/GoodsList/ui/AddDiscountRowButton/index.tsx +8 -3
  46. package/src/Invoice/ui/GoodsList/ui/AddRowButton/index.tsx +13 -2
  47. package/src/Invoice/ui/GoodsList/ui/TaxIncludedSwitch/index.tsx +4 -0
  48. package/src/Invoice/ui/ImportGoodsDrawer/index.tsx +4 -10
  49. package/src/Invoice/ui/InvoiceHeader/index.tsx +13 -8
  50. package/tsconfig.json +31 -31
  51. package/typings.d.ts +3 -3
@@ -1,66 +1,66 @@
1
- import React, { useContext } from 'react';
2
- import type { IApiComponentProps } from 'dumi/theme';
3
- import { context, useApiData, AnchorLink } from 'dumi/theme';
4
-
5
- const LOCALE_TEXTS = {
6
- 'zh-CN': {
7
- name: '属性名',
8
- description: '描述',
9
- type: '类型',
10
- default: '默认值',
11
- required: '(必选)',
12
- },
13
- 'en-US': {
14
- name: 'Name',
15
- description: 'Description',
16
- type: 'Type',
17
- default: 'Default',
18
- required: '(required)',
19
- },
20
- };
21
-
22
- export default ({
23
- name,
24
- identifier,
25
- export: expt,
26
- }: IApiComponentProps & { name: string }) => {
27
- const data = useApiData(identifier);
28
- const { locale } = useContext(context);
29
- const texts = /^zh|cn$/i.test(locale)
30
- ? LOCALE_TEXTS['zh-CN']
31
- : LOCALE_TEXTS['en-US'];
32
-
33
- return (
34
- <>
35
- <p>{name}</p>
36
- {data && (
37
- <table style={{ marginTop: 24 }}>
38
- <thead>
39
- <tr>
40
- <th>{texts.name}</th>
41
- <th>{texts.description}</th>
42
- <th>{texts.type}</th>
43
- <th>{texts.default}</th>
44
- </tr>
45
- </thead>
46
- <tbody>
47
- {data[expt]?.map((row) => (
48
- <tr key={row.identifier}>
49
- <td>{row.identifier}</td>
50
- <td>{row.description || '--'}</td>
51
- <td>
52
- <code>{row.type}</code>
53
- </td>
54
- <td>
55
- <code>
56
- {row.default || (row.required && texts.required) || '--'}
57
- </code>
58
- </td>
59
- </tr>
60
- ))}
61
- </tbody>
62
- </table>
63
- )}
64
- </>
65
- );
66
- };
1
+ import React, { useContext } from 'react';
2
+ import type { IApiComponentProps } from 'dumi/theme';
3
+ import { context, useApiData, AnchorLink } from 'dumi/theme';
4
+
5
+ const LOCALE_TEXTS = {
6
+ 'zh-CN': {
7
+ name: '属性名',
8
+ description: '描述',
9
+ type: '类型',
10
+ default: '默认值',
11
+ required: '(必选)',
12
+ },
13
+ 'en-US': {
14
+ name: 'Name',
15
+ description: 'Description',
16
+ type: 'Type',
17
+ default: 'Default',
18
+ required: '(required)',
19
+ },
20
+ };
21
+
22
+ export default ({
23
+ name,
24
+ identifier,
25
+ export: expt,
26
+ }: IApiComponentProps & { name: string }) => {
27
+ const data = useApiData(identifier);
28
+ const { locale } = useContext(context);
29
+ const texts = /^zh|cn$/i.test(locale)
30
+ ? LOCALE_TEXTS['zh-CN']
31
+ : LOCALE_TEXTS['en-US'];
32
+
33
+ return (
34
+ <>
35
+ <p>{name}</p>
36
+ {data && (
37
+ <table style={{ marginTop: 24 }}>
38
+ <thead>
39
+ <tr>
40
+ <th>{texts.name}</th>
41
+ <th>{texts.description}</th>
42
+ <th>{texts.type}</th>
43
+ <th>{texts.default}</th>
44
+ </tr>
45
+ </thead>
46
+ <tbody>
47
+ {data[expt]?.map((row) => (
48
+ <tr key={row.identifier}>
49
+ <td>{row.identifier}</td>
50
+ <td>{row.description || '--'}</td>
51
+ <td>
52
+ <code>{row.type}</code>
53
+ </td>
54
+ <td>
55
+ <code>
56
+ {row.default || (row.required && texts.required) || '--'}
57
+ </code>
58
+ </td>
59
+ </tr>
60
+ ))}
61
+ </tbody>
62
+ </table>
63
+ )}
64
+ </>
65
+ );
66
+ };
package/.editorconfig CHANGED
@@ -1,16 +1,16 @@
1
- # http://editorconfig.org
2
- root = true
3
-
4
- [*]
5
- indent_style = space
6
- indent_size = 2
7
- end_of_line = lf
8
- charset = utf-8
9
- trim_trailing_whitespace = true
10
- insert_final_newline = true
11
-
12
- [*.md]
13
- trim_trailing_whitespace = false
14
-
15
- [Makefile]
16
- indent_style = tab
1
+ # http://editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ indent_style = space
6
+ indent_size = 2
7
+ end_of_line = lf
8
+ charset = utf-8
9
+ trim_trailing_whitespace = true
10
+ insert_final_newline = true
11
+
12
+ [*.md]
13
+ trim_trailing_whitespace = false
14
+
15
+ [Makefile]
16
+ indent_style = tab
package/.fatherrc.ts CHANGED
@@ -1,4 +1,4 @@
1
- export default {
2
- esm: 'rollup',
3
- cjs: 'rollup',
4
- };
1
+ export default {
2
+ esm: 'rollup',
3
+ cjs: 'rollup',
4
+ };
package/.prettierignore CHANGED
@@ -1,7 +1,7 @@
1
- **/*.svg
2
- **/*.ejs
3
- **/*.html
4
- package.json
5
- .umi
6
- .umi-production
7
- .umi-test
1
+ **/*.svg
2
+ **/*.ejs
3
+ **/*.html
4
+ package.json
5
+ .umi
6
+ .umi-production
7
+ .umi-test
package/.prettierrc CHANGED
@@ -1,11 +1,11 @@
1
- {
2
- "singleQuote": true,
3
- "trailingComma": "all",
4
- "printWidth": 80,
5
- "overrides": [
6
- {
7
- "files": ".prettierrc",
8
- "options": { "parser": "json" }
9
- }
10
- ]
11
- }
1
+ {
2
+ "singleQuote": true,
3
+ "trailingComma": "all",
4
+ "printWidth": 80,
5
+ "overrides": [
6
+ {
7
+ "files": ".prettierrc",
8
+ "options": { "parser": "json" }
9
+ }
10
+ ]
11
+ }
package/.umirc.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { defineConfig } from 'dumi';
2
-
3
- export default defineConfig({
4
- locales: [['zh-CN', '中文']],
5
- title: '发票组件',
6
- outputPath: 'docs-dist',
7
- publicPath:'/docs-dist/',
8
- });
1
+ import { defineConfig } from 'dumi';
2
+
3
+ export default defineConfig({
4
+ locales: [['zh-CN', '中文']],
5
+ title: '发票组件',
6
+ outputPath: 'docs-dist',
7
+ publicPath:'/docs-dist/',
8
+ });
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # kts-component-invoice-operate
2
-
3
- 文档地址:http://kts-component-invoice-operate.dev.kingxunlian.com/
4
-
5
-
1
+ # kts-component-invoice-operate
2
+
3
+ 文档地址:http://kts-component-invoice-operate.dev.kingxunlian.com/
4
+
5
+
6
6
  南湖:https://lanhuapp.com/web/#/item/project/detailDetach?pid=7daf94b0-9aa7-4372-89a7-226f389b021d&project_id=7daf94b0-9aa7-4372-89a7-226f389b021d&image_id=3bc42812-5718-4aa5-b088-5bc7e0c9a62f&fromEditor=true
package/dist/index.esm.js CHANGED
@@ -1176,21 +1176,33 @@ var InvoiceHeader = decorator(Form.create())(function (props) {
1176
1176
  return '增值税电子专用发票';
1177
1177
  }, [props.typeOption, props.title, typeIndex]);
1178
1178
  var fieldExpand = React.useMemo(function () {
1179
- var fieldExpand = [{
1180
- label: '发票代码 :',
1181
- render: function render(form) {
1182
- return form.getFieldDecorator('code', {
1183
- initialValue: props.defaultCode
1184
- })( /*#__PURE__*/React.createElement(FormSpanString, null));
1185
- }
1186
- }, {
1187
- label: '发票号码 :',
1188
- render: function render(form) {
1189
- return form.getFieldDecorator('no', {
1190
- initialValue: props.defaultNo
1191
- })( /*#__PURE__*/React.createElement(FormSpanString, null));
1192
- }
1193
- }];
1179
+ var fieldExpand = [];
1180
+
1181
+ if (!props.fieldExpand || props.fieldExpand.some(function (e) {
1182
+ return "".concat(e.label).replace(" :", '') === '发票代码';
1183
+ }) === false) {
1184
+ fieldExpand.push({
1185
+ label: '发票代码 :',
1186
+ render: function render(form) {
1187
+ return form.getFieldDecorator('code', {
1188
+ initialValue: props.defaultCode
1189
+ })( /*#__PURE__*/React.createElement(FormSpanString, null));
1190
+ }
1191
+ });
1192
+ }
1193
+
1194
+ if (!props.fieldExpand || props.fieldExpand.some(function (e) {
1195
+ return "".concat(e.label).replace(" :", '') === '发票号码';
1196
+ }) === false) {
1197
+ fieldExpand.push({
1198
+ label: '发票号码 :',
1199
+ render: function render(form) {
1200
+ return form.getFieldDecorator('no', {
1201
+ initialValue: props.defaultNo
1202
+ })( /*#__PURE__*/React.createElement(FormSpanString, null));
1203
+ }
1204
+ });
1205
+ }
1194
1206
 
1195
1207
  if (props.defaultInvoicingDate) {
1196
1208
  fieldExpand.push({
@@ -5584,7 +5596,7 @@ var DrawerBody$3 = function DrawerBody(props) {
5584
5596
  }); //截取名称
5585
5597
 
5586
5598
  if (!endowCodeGood.some(function (e) {
5587
- return bytesLnegth((e === null || e === void 0 ? void 0 : e.itemName) || '') > 100;
5599
+ return bytesLnegth((e === null || e === void 0 ? void 0 : e.itemName) || '') > 92;
5588
5600
  })) {
5589
5601
  _context6.next = 5;
5590
5602
  break;
@@ -5596,10 +5608,12 @@ var DrawerBody$3 = function DrawerBody(props) {
5596
5608
  confirm({
5597
5609
  title: '温馨提示',
5598
5610
  content: '商品名称长度过长,是否截取名称',
5611
+ okText: '确定',
5612
+ cancelText: '取消',
5599
5613
  onOk: function onOk() {
5600
5614
  endowCodeGood.forEach(function (e) {
5601
5615
  if (e && e.itemName) {
5602
- e.itemName = cutStr(e.itemName, 99);
5616
+ e.itemName = cutStr(e.itemName, 91);
5603
5617
  }
5604
5618
  });
5605
5619
  resolve();
@@ -5806,7 +5820,11 @@ var getShorthand = function getShorthand(value) {
5806
5820
 
5807
5821
  var getItemName$1 = function getItemName(value, shorthand) {
5808
5822
  if (!value) value = '';
5809
- if (!shorthand) return value;
5823
+
5824
+ if (!shorthand) {
5825
+ return value.replace(/\*[^*]+\*/, "");
5826
+ }
5827
+
5810
5828
  var arr = value.match(/\*[^*]+\*/);
5811
5829
 
5812
5830
  if (arr) {
package/dist/index.js CHANGED
@@ -1186,21 +1186,33 @@ var InvoiceHeader = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
1186
1186
  return '增值税电子专用发票';
1187
1187
  }, [props.typeOption, props.title, typeIndex]);
1188
1188
  var fieldExpand = React__default['default'].useMemo(function () {
1189
- var fieldExpand = [{
1190
- label: '发票代码 :',
1191
- render: function render(form) {
1192
- return form.getFieldDecorator('code', {
1193
- initialValue: props.defaultCode
1194
- })( /*#__PURE__*/React__default['default'].createElement(FormSpanString, null));
1195
- }
1196
- }, {
1197
- label: '发票号码 :',
1198
- render: function render(form) {
1199
- return form.getFieldDecorator('no', {
1200
- initialValue: props.defaultNo
1201
- })( /*#__PURE__*/React__default['default'].createElement(FormSpanString, null));
1202
- }
1203
- }];
1189
+ var fieldExpand = [];
1190
+
1191
+ if (!props.fieldExpand || props.fieldExpand.some(function (e) {
1192
+ return "".concat(e.label).replace(" :", '') === '发票代码';
1193
+ }) === false) {
1194
+ fieldExpand.push({
1195
+ label: '发票代码 :',
1196
+ render: function render(form) {
1197
+ return form.getFieldDecorator('code', {
1198
+ initialValue: props.defaultCode
1199
+ })( /*#__PURE__*/React__default['default'].createElement(FormSpanString, null));
1200
+ }
1201
+ });
1202
+ }
1203
+
1204
+ if (!props.fieldExpand || props.fieldExpand.some(function (e) {
1205
+ return "".concat(e.label).replace(" :", '') === '发票号码';
1206
+ }) === false) {
1207
+ fieldExpand.push({
1208
+ label: '发票号码 :',
1209
+ render: function render(form) {
1210
+ return form.getFieldDecorator('no', {
1211
+ initialValue: props.defaultNo
1212
+ })( /*#__PURE__*/React__default['default'].createElement(FormSpanString, null));
1213
+ }
1214
+ });
1215
+ }
1204
1216
 
1205
1217
  if (props.defaultInvoicingDate) {
1206
1218
  fieldExpand.push({
@@ -5594,7 +5606,7 @@ var DrawerBody$3 = function DrawerBody(props) {
5594
5606
  }); //截取名称
5595
5607
 
5596
5608
  if (!endowCodeGood.some(function (e) {
5597
- return bytesLnegth((e === null || e === void 0 ? void 0 : e.itemName) || '') > 100;
5609
+ return bytesLnegth((e === null || e === void 0 ? void 0 : e.itemName) || '') > 92;
5598
5610
  })) {
5599
5611
  _context6.next = 5;
5600
5612
  break;
@@ -5606,10 +5618,12 @@ var DrawerBody$3 = function DrawerBody(props) {
5606
5618
  confirm({
5607
5619
  title: '温馨提示',
5608
5620
  content: '商品名称长度过长,是否截取名称',
5621
+ okText: '确定',
5622
+ cancelText: '取消',
5609
5623
  onOk: function onOk() {
5610
5624
  endowCodeGood.forEach(function (e) {
5611
5625
  if (e && e.itemName) {
5612
- e.itemName = cutStr(e.itemName, 99);
5626
+ e.itemName = cutStr(e.itemName, 91);
5613
5627
  }
5614
5628
  });
5615
5629
  resolve();
@@ -5816,7 +5830,11 @@ var getShorthand = function getShorthand(value) {
5816
5830
 
5817
5831
  var getItemName$1 = function getItemName(value, shorthand) {
5818
5832
  if (!value) value = '';
5819
- if (!shorthand) return value;
5833
+
5834
+ if (!shorthand) {
5835
+ return value.replace(/\*[^*]+\*/, "");
5836
+ }
5837
+
5820
5838
  var arr = value.match(/\*[^*]+\*/);
5821
5839
 
5822
5840
  if (arr) {
@@ -11,7 +11,7 @@
11
11
  window.routerBase = "/";
12
12
  </script>
13
13
  <script>
14
- //! umi version: 3.5.17
14
+ //! umi version: 3.5.20
15
15
  </script>
16
16
  <script>
17
17
  !(function () {
@@ -11,7 +11,7 @@
11
11
  window.routerBase = "/";
12
12
  </script>
13
13
  <script>
14
- //! umi version: 3.5.17
14
+ //! umi version: 3.5.20
15
15
  </script>
16
16
  <script>
17
17
  !(function () {