kts-component-invoice-operate 3.2.227 → 3.2.228

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 (62) hide show
  1. package/dist/Invoice/Invoice-digtal/_test/pay/index.d.ts +4 -0
  2. package/dist/Invoice/InvoiceController/InvoiceControllerState/PayListState/IColumnsReplenish/index.d.ts +6 -0
  3. package/dist/Invoice/InvoiceController/InvoiceControllerState/PayListState/IGood/index.d.ts +12 -0
  4. package/dist/Invoice/InvoiceController/InvoiceControllerState/PayListState/ImportGoods/index.d.ts +21 -0
  5. package/dist/Invoice/InvoiceController/InvoiceControllerState/PayListState/index.d.ts +31 -0
  6. package/dist/Invoice/InvoiceController/InvoiceControllerState/index.d.ts +2 -0
  7. package/dist/Invoice/InvoiceController/fns/addPay.d.ts +6 -0
  8. package/dist/Invoice/InvoiceController/fns/delPay.d.ts +6 -0
  9. package/dist/Invoice/InvoiceController/fns/saveEditPay.d.ts +6 -0
  10. package/dist/Invoice/InvoiceController/fns/setEditPay.d.ts +6 -0
  11. package/dist/Invoice/InvoiceController/fns/setPay.d.ts +6 -0
  12. package/dist/Invoice/InvoiceController/index.d.ts +6 -0
  13. package/dist/Invoice/index.d.ts +2 -0
  14. package/dist/Invoice/ui/digtal/PayList/hook/useColumns/index.d.ts +3 -0
  15. package/dist/Invoice/ui/digtal/PayList/hook/useColumns/ui/TitleText/index.d.ts +8 -0
  16. package/dist/Invoice/ui/digtal/PayList/hook/useOnRow/index.d.ts +8 -0
  17. package/dist/Invoice/ui/digtal/PayList/hook/useRowSelection/index.d.ts +8 -0
  18. package/dist/Invoice/ui/digtal/PayList/hook/useWindowClick/index.d.ts +5 -0
  19. package/dist/Invoice/ui/digtal/PayList/index.d.ts +18 -0
  20. package/dist/Invoice/ui/digtal/PayList/ui/AddRowButton/index.d.ts +3 -0
  21. package/dist/Invoice/ui/digtal/PayList/ui/BulkMenu/hooks/useDelRowButton/index.d.ts +6 -0
  22. package/dist/Invoice/ui/digtal/PayList/ui/BulkMenu/hooks/useEmptyRefill/index.d.ts +6 -0
  23. package/dist/Invoice/ui/digtal/PayList/ui/TableRow/index.d.ts +3 -0
  24. package/dist/Invoice/ui/digtal/PayList/ui/TableVirtual/index.d.ts +4 -0
  25. package/dist/index.esm.js +8035 -5547
  26. package/dist/index.js +8035 -5547
  27. package/package.json +1 -1
  28. package/src/Invoice/Invoice-digtal/_test/easiest/index.tsx +40 -8
  29. package/src/Invoice/Invoice-digtal/_test/freight/index.tsx +23 -17
  30. package/src/Invoice/Invoice-digtal/_test/pay/index.tsx +14637 -0
  31. package/src/Invoice/Invoice-digtal/index.md +7 -6
  32. package/src/Invoice/InvoiceController/InvoiceControllerForm/index.ts +11 -0
  33. package/src/Invoice/InvoiceController/InvoiceControllerState/PayListState/IColumnsReplenish/index.ts +10 -0
  34. package/src/Invoice/InvoiceController/InvoiceControllerState/PayListState/IGood/index.ts +35 -0
  35. package/src/Invoice/InvoiceController/InvoiceControllerState/PayListState/ImportGoods/index.ts +81 -0
  36. package/src/Invoice/InvoiceController/InvoiceControllerState/PayListState/index.ts +40 -0
  37. package/src/Invoice/InvoiceController/InvoiceControllerState/index.ts +3 -0
  38. package/src/Invoice/InvoiceController/fns/addPay.ts +11 -0
  39. package/src/Invoice/InvoiceController/fns/delPay.ts +38 -0
  40. package/src/Invoice/InvoiceController/fns/saveEditPay.ts +23 -0
  41. package/src/Invoice/InvoiceController/fns/setEditPay.ts +16 -0
  42. package/src/Invoice/InvoiceController/fns/setPay.ts +11 -0
  43. package/src/Invoice/InvoiceController/index.ts +21 -0
  44. package/src/Invoice/index.tsx +3 -0
  45. package/src/Invoice/tools/useToGenerateId/index.ts +2 -0
  46. package/src/Invoice/ui/digtal/PayList/hook/useColumns/dist/index.js +616 -0
  47. package/src/Invoice/ui/digtal/PayList/hook/useColumns/index.tsx +168 -0
  48. package/src/Invoice/ui/digtal/PayList/hook/useColumns/ui/TitleText/index.tsx +20 -0
  49. package/src/Invoice/ui/digtal/PayList/hook/useOnRow/index.tsx +37 -0
  50. package/src/Invoice/ui/digtal/PayList/hook/useRowSelection/index.tsx +120 -0
  51. package/src/Invoice/ui/digtal/PayList/hook/useWindowClick/index.tsx +19 -0
  52. package/src/Invoice/ui/digtal/PayList/index.less +73 -0
  53. package/src/Invoice/ui/digtal/PayList/index.tsx +132 -0
  54. package/src/Invoice/ui/digtal/PayList/ui/AddRowButton/index.tsx +75 -0
  55. package/src/Invoice/ui/digtal/PayList/ui/BulkMenu/hooks/useDelRowButton/index.tsx +50 -0
  56. package/src/Invoice/ui/digtal/PayList/ui/BulkMenu/hooks/useEmptyRefill/index.tsx +37 -0
  57. package/src/Invoice/ui/digtal/PayList/ui/TableRow/index.less +29 -0
  58. package/src/Invoice/ui/digtal/PayList/ui/TableRow/index.tsx +21 -0
  59. package/src/Invoice/ui/digtal/PayList/ui/TableVirtual/index.less +39 -0
  60. package/src/Invoice/ui/digtal/PayList/ui/TableVirtual/index.tsx +109 -0
  61. package/src/Invoice/ui/digtal/StakeFarmerholder/index.less +1 -1
  62. package/src/Invoice/ui/digtal/StakeFarmerholder/index.tsx +523 -202
@@ -1,10 +1,11 @@
1
1
  # 数电
2
2
 
3
- <!-- ## 简单用法
4
- <code src="./_test/easiest/index.tsx"></code> -->
3
+ ## 简单用法
4
+ <code src="./_test/pay/index.tsx"></code>
5
+ <!-- <code src="./_test/easiest/index.tsx"></code> -->
5
6
 
6
- ## 不动产经营租赁服务
7
- <code src="./_test/realEstateInfo/index.tsx"></code>
7
+ <!-- ## 不动产经营租赁服务
8
+ <code src="./_test/realEstateInfo/index.tsx"></code> -->
8
9
 
9
10
  <!-- ## 建筑服务
10
11
  <code src="./_test/architecture/index.tsx"></code> -->
@@ -39,6 +40,6 @@
39
40
 
40
41
 
41
42
  -->
42
-
43
- <!-- ## 货物运输服务
43
+ <!--
44
+ ## 货物运输服务
44
45
  <code src="./_test/freight/index.tsx"></code> -->
@@ -58,6 +58,17 @@ export default class InvoiceControllerForm extends GreyReactBox<InvoiceControlle
58
58
 
59
59
  _values.set('freightList', this.state.freightListState.goodsList.slice());
60
60
 
61
+ //支付
62
+ if (this.state.payListState.form) {
63
+ try {
64
+ await this.state.payListState.form?.validateFields()
65
+ } catch (error: any) {
66
+ _errors.set('payList', error.errors);
67
+ }
68
+ }
69
+
70
+ _values.set('payList', this.state.payListState.goodsList.slice());
71
+
61
72
  // 金额(含税)
62
73
  _values.set('lineAmountIncludeTax', (() => {
63
74
  let sum = chain(bignumber(0));
@@ -0,0 +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
+ }
@@ -0,0 +1,35 @@
1
+ export default interface IGood {
2
+ /** 数据索引 */
3
+ $index: string;
4
+ /** 序号 */
5
+ sortNumber?: number;
6
+ /** 运输工具种类列表 */
7
+ vehicleList?: any[] | null;
8
+
9
+ /** 运输工具种类 */
10
+ vehicle?: string;
11
+
12
+ channel:string;
13
+
14
+ number:string;
15
+
16
+
17
+
18
+ // itemName?:string;
19
+
20
+ /** 运输工具牌号 */
21
+ // vehicleNo?: string;
22
+
23
+ /** 起运地 */
24
+ // origin?: string[];
25
+
26
+ /** 到达地 */
27
+ // destination?: string[];
28
+
29
+ /** 运输货物名称 */
30
+ // goodName?: string;
31
+
32
+ /** 地区 */
33
+ // area?: string[];
34
+
35
+ }
@@ -0,0 +1,81 @@
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
+ render: text => text || text === 0 ? `${text}%` : ''
44
+ },
45
+ {
46
+ title: '单价(含税)',
47
+ dataIndex: 'priceIncludeTax',
48
+ key: 'priceIncludeTax',
49
+ },
50
+ {
51
+ title: '税收分类编码',
52
+ dataIndex: 'taxClassificationCode',
53
+ key: 'taxClassificationCode',
54
+ },
55
+ ];
56
+
57
+ /** 货物列表 */
58
+ dataSource: ColumnType[] = [];
59
+
60
+ /** 分页数据 */
61
+ pagination: PaginationConfig = {};
62
+
63
+ /** 是否显示导入 */
64
+ isVisibleDrawer = false;
65
+
66
+ /** 顶部扩展 */
67
+ topExpand?: React.ReactNode;
68
+
69
+ /** 导入时校验函数 */
70
+ verifyFn: (record: any) => Promise<boolean> = async record => {
71
+ if (!record.taxClassificationCode) {
72
+ message.error({ content: '请维护该商品的税收分类编码!', key: '请维护该商品的税收分类编码!' })
73
+ return false;
74
+ }
75
+ if (record.productStatus === 0) {
76
+ message.error({ content: '当前货物为禁用', key: '当前货物为禁用' })
77
+ return false;
78
+ }
79
+ return true;
80
+ };
81
+ }
@@ -0,0 +1,40 @@
1
+ import IGood from './IGood';
2
+ import { WrappedFormUtils } from 'kts-components-antd-x3/lib/form/Form';
3
+
4
+ export default class PayListState {
5
+
6
+ /** 产品最大数 */
7
+ goodMax?: number;
8
+
9
+ /** 正在编辑的货物 */
10
+ editGood?: IGood;
11
+
12
+ /** 是否可以添加行 */
13
+ isAddRow = true;
14
+
15
+ /** 是否可以删除行 */
16
+ isRemRow = true;
17
+
18
+ /** 货物字典 */
19
+ goodsMap = new Map<string, IGood>();
20
+
21
+ /** 被编辑行的form对象 */
22
+ form?: WrappedFormUtils;
23
+
24
+ /** 运输工具种类列表 */
25
+ vehicleTypeList: any[] = [];
26
+
27
+ /** 货物列表 */
28
+ goodsList: IGood[] = [];
29
+
30
+ /** 列表选中的货物索引列表 */
31
+ selectedGoodIndex: string[] = [];
32
+
33
+ /** 地区 */
34
+ area: any[] = [];
35
+
36
+ addressFieldNames: IFieldNames = { label: 'label', value: 'value', children: 'children' }
37
+ }
38
+ interface IFieldNames {
39
+ label: string; value: string; children: string
40
+ }
@@ -1,5 +1,6 @@
1
1
  import GoodsListState from './GoodsListState';
2
2
  import FreightListState from './FreightListState';
3
+ import PayListState from './PayListState';
3
4
  import BuyerState from './BuyerState';
4
5
  import Stakeholder from './Stakeholder';
5
6
  import { IInvoiceTypeModalProps } from '../../../InvoiceTypeModal';
@@ -68,6 +69,8 @@ export default class InvoiceControllerState {
68
69
  * 货物运输列表
69
70
  */
70
71
  freightListState = new FreightListState();
72
+
73
+ payListState=new PayListState();
71
74
 
72
75
  addGoodsCheck?: any;
73
76
  }
@@ -0,0 +1,11 @@
1
+ import { InvoiceControllerState } from '..';
2
+ import idGenerator from '../../tools/idGenerator';
3
+
4
+ /**
5
+ * 添加的付款
6
+ */
7
+ export default async (state: InvoiceControllerState, options?: any) => {
8
+ options.$index = idGenerator();
9
+ state.payListState.goodsList = [...state.payListState.goodsList, options];
10
+ return options;
11
+ };
@@ -0,0 +1,38 @@
1
+ import { InvoiceControllerState } from '..';
2
+
3
+ /**
4
+ * 删除一个付款行
5
+ */
6
+ export default async (state: InvoiceControllerState, $index?: string) => {
7
+ if (!$index) return;
8
+ // 查下要删除的货物
9
+ const goods = state.payListState.goodsList.filter((e) => e.$index === $index)[0];
10
+ if (!goods) return;
11
+
12
+ // 如果正在编辑 就取消编辑
13
+ if (state.payListState.editGood && state.payListState.editGood.$index === $index) {
14
+ state.payListState.editGood = undefined;
15
+ }
16
+ const goodsList = state.payListState.goodsList;
17
+ const goodsMap = state.payListState.goodsMap;
18
+
19
+ goodsMap.delete($index);
20
+
21
+ for (let i = 0; i < goodsList.length; i++) {
22
+
23
+ if (goodsList[i].$index === $index) {
24
+ // const good = goodsList[i];
25
+
26
+ // if (good.lineAttribute === LineAttributeType.折扣行 && goodsList[i - 1] && goodsList[i - 1].lineAttribute === LineAttributeType.被折扣行) {
27
+ // goodsList[i - 1].lineAttribute = LineAttributeType.正常;
28
+ // }
29
+
30
+ goodsList.splice(i, 1);
31
+
32
+ break;
33
+ }
34
+ }
35
+
36
+ state.payListState.goodsList = [...goodsList];
37
+ state.payListState.goodsMap = new Map(goodsMap);
38
+ };
@@ -0,0 +1,23 @@
1
+ import { InvoiceControllerState } from '..';
2
+
3
+ /**
4
+ * 保存正在编辑的支付信息
5
+ */
6
+ export default async (state: InvoiceControllerState) => {
7
+
8
+ const editGood = state.payListState.editGood;
9
+ const form = state.payListState.form;
10
+ if (!editGood || !form ) return;
11
+ if ((await validateFields(form)).err) return;
12
+
13
+ state.payListState.goodsList = state.payListState.goodsList.map((e) =>
14
+ e.$index === editGood.$index ? { ...e, ...editGood } : e,
15
+ );
16
+ state.payListState.editGood = undefined;
17
+ };
18
+
19
+ const validateFields = (form: any) => new Promise((resolve: (v: { err: any; values: any }) => void) => {
20
+ form.validateFields(async (err: any, values: any) => {
21
+ resolve({ err, values });
22
+ });
23
+ });
@@ -0,0 +1,16 @@
1
+ import { InvoiceControllerState, IGood3 } from '..';
2
+
3
+ /**
4
+ * 设置当前的编辑的付款信息
5
+ */
6
+ export default async (state: InvoiceControllerState, newEditGood?: any) => {
7
+ if (newEditGood) {
8
+ const editGood = state.payListState.editGood as IGood3;
9
+ state.payListState = {
10
+ ...state.payListState,
11
+ editGood: { ...editGood, ...newEditGood },
12
+ };
13
+ } else {
14
+ state.payListState = { ...state.payListState, editGood: undefined };
15
+ }
16
+ };
@@ -0,0 +1,11 @@
1
+
2
+ import { InvoiceControllerState, IGood } from '..';
3
+
4
+ /**
5
+ * 设置单个商品的付款信息
6
+ */
7
+ export default async (state: InvoiceControllerState, options?: IGood) => {
8
+ if (!options || !options.$index) return;
9
+ const goodsList = state.payListState.goodsList.map(e => e.$index === options.$index ? { ...e, ...options } : e);
10
+ state.payListState = { ...state.payListState, goodsList };
11
+ };
@@ -5,16 +5,27 @@ import { IGetGoodsListOption } from './InvoiceControllerState/GoodsListState/Imp
5
5
  // import updateInvoiceNo from './fns/updateInvoiceNo';
6
6
  import setEditGood from './fns/setEditGood';
7
7
  import setEditFreight from './fns/setEditFreight';
8
+ import setEditPay from './fns/setEditPay';
9
+
8
10
  import setGoods from './fns/setGoods';
9
11
  import setFreight from './fns/setFreight';
12
+ import setPay from './fns/setPay';
13
+
10
14
  import delGood from './fns/delGood';
11
15
  import delFreight from './fns/delFreight';
16
+ import delPay from './fns/delPay';
17
+
12
18
  import addGoodDiscount from './fns/addGoodDiscount';
13
19
  import addGoodDiscountV2 from './fns/addGoodDiscountV2';
20
+
14
21
  import addGood from './fns/addGood';
15
22
  import addFreight from './fns/addFreight';
23
+ import addPay from './fns/addPay';
24
+
16
25
  import saveEditGood from './fns/saveEditGood';
17
26
  import saveEditFreight from './fns/saveEditFreight';
27
+ import saveEditPay from './fns/saveEditPay';
28
+
18
29
  import getGoodsSearch from './fns/getGoodsSearch';
19
30
  import mergeDetails from './fns/mergeDetails';
20
31
  import mergeDiscount from './fns/mergeDiscount';
@@ -25,6 +36,7 @@ export { default as InvoiceControllerState } from './InvoiceControllerState';
25
36
  export { default as IGood } from './InvoiceControllerState/GoodsListState/IGood';
26
37
  export { default as LineAttributeType } from './InvoiceControllerState/GoodsListState/LineAttributeType';
27
38
  export { default as IGood2 } from './InvoiceControllerState/FreightListState/IGood';
39
+ export { default as IGood3 } from './InvoiceControllerState/PayListState/IGood';
28
40
  export default class InvoiceController extends InvoiceControllerForm {
29
41
  constructor(state = new InvoiceControllerState()) {
30
42
  super(state);
@@ -48,8 +60,12 @@ export default class InvoiceController extends InvoiceControllerForm {
48
60
  /** 设置货物运输属性 */
49
61
  setFreight = this.pipeline(setFreight);
50
62
 
63
+ setPay = this.pipeline(setPay);
64
+
51
65
  setEditFreight = this.pipeline(setEditFreight);
52
66
 
67
+ setEditPay = this.pipeline(setEditPay);
68
+
53
69
  /** 设置当前的编辑货物 */
54
70
  setEditGood = this.pipeline(setEditGood);
55
71
 
@@ -59,18 +75,23 @@ export default class InvoiceController extends InvoiceControllerForm {
59
75
  /** 保存正在编辑的货物运输 */
60
76
  saveEditFreight = this.pipeline<any>(saveEditFreight);
61
77
 
78
+ saveEditPay=this.pipeline<any>(saveEditPay);
62
79
  /** 删除一个货物 */
63
80
  delGood = this.pipeline(delGood);
64
81
 
65
82
  /** 删除一个货物运输 */
66
83
  delFreight = this.pipeline(delFreight);
67
84
 
85
+ delPay = this.pipeline(delPay);
86
+
68
87
  /** 添加一个货物 */
69
88
  addGood = this.pipeline(addGood);
70
89
 
71
90
  /** 添加一个货物运输 */
72
91
  addFreight = this.pipeline(addFreight);
73
92
 
93
+ addPay = this.pipeline(addPay);
94
+
74
95
  /** 全单合并明细 */
75
96
  mergeDetails = this.pipeline(mergeDetails);
76
97
 
@@ -21,6 +21,7 @@ import GoodsListDigtal from './ui/digtal/GoodsList';
21
21
  import RealEstateInfo from './ui/digtal/RealEstateInfo';
22
22
  import Architecture from './ui/digtal/Architecture';
23
23
  import FreightList from './ui/digtal/FreightList';
24
+ import PayList from './ui/digtal/PayList';
24
25
 
25
26
  import ImportBuyerDrawer from './ui/default/ImportBuyerDrawer';
26
27
  import ImportGoodsDrawer from './ui/default/ImportGoodsDrawer';
@@ -110,6 +111,8 @@ export default class Invoice extends React.PureComponent<IInvoiceProps> {
110
111
 
111
112
  static readonly FreightList = FreightList;
112
113
 
114
+ static readonly PayList = PayList;
115
+
113
116
  /** 货物列表(数电) */
114
117
  static readonly GoodsListDigtal = GoodsListDigtal;
115
118
 
@@ -8,4 +8,6 @@ export default function useToGenerateId(controller: InvoiceController) {
8
8
  React.useEffect(() => { goodsList.forEach((e, i) => { e.serialNo = i + 1 }) }, [goodsList])
9
9
  const freightList = controller.useMemo(s => s.freightListState.goodsList, []);
10
10
  React.useEffect(() => { freightList.forEach((e, i) => { e.sortNumber = i + 1 }) }, [freightList])
11
+ const payList = controller.useMemo(s => s.payListState.goodsList, []);
12
+ React.useEffect(() => { payList.forEach((e, i) => { e.sortNumber = i + 1 }) }, [payList])
11
13
  }