kts-component-invoice-operate 3.2.174 → 3.2.176

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 (67) hide show
  1. package/dist/Invoice/Invoice-digtal/_test/architecture/index.d.ts +4 -0
  2. package/dist/Invoice/Invoice-digtal/_test/freight/index.d.ts +4 -0
  3. package/dist/Invoice/InvoiceController/InvoiceControllerState/FreightListState/IColumnsReplenish/index.d.ts +6 -0
  4. package/dist/Invoice/InvoiceController/InvoiceControllerState/FreightListState/IGood/index.d.ts +23 -0
  5. package/dist/Invoice/InvoiceController/InvoiceControllerState/FreightListState/ImportGoods/index.d.ts +21 -0
  6. package/dist/Invoice/InvoiceController/InvoiceControllerState/FreightListState/index.d.ts +31 -0
  7. package/dist/Invoice/InvoiceController/InvoiceControllerState/index.d.ts +5 -0
  8. package/dist/Invoice/InvoiceController/fns/addFreight.d.ts +6 -0
  9. package/dist/Invoice/InvoiceController/fns/delFreight.d.ts +6 -0
  10. package/dist/Invoice/InvoiceController/fns/saveEditFreight.d.ts +6 -0
  11. package/dist/Invoice/InvoiceController/fns/setEditFreight.d.ts +6 -0
  12. package/dist/Invoice/InvoiceController/fns/setFreight.d.ts +6 -0
  13. package/dist/Invoice/InvoiceController/index.d.ts +10 -0
  14. package/dist/Invoice/index.d.ts +4 -0
  15. package/dist/Invoice/ui/digtal/Architecture/index.d.ts +15 -0
  16. package/dist/Invoice/ui/digtal/FreightList/hook/useColumns/index.d.ts +3 -0
  17. package/dist/Invoice/ui/digtal/FreightList/hook/useColumns/ui/TitleText/index.d.ts +8 -0
  18. package/dist/Invoice/ui/digtal/FreightList/hook/useOnRow/index.d.ts +8 -0
  19. package/dist/Invoice/ui/digtal/FreightList/hook/useRowSelection/index.d.ts +8 -0
  20. package/dist/Invoice/ui/digtal/FreightList/hook/useWindowClick/index.d.ts +8 -0
  21. package/dist/Invoice/ui/digtal/FreightList/index.d.ts +9 -0
  22. package/dist/Invoice/ui/digtal/FreightList/ui/AddRowButton/index.d.ts +3 -0
  23. package/dist/Invoice/ui/digtal/FreightList/ui/BulkMenu/hooks/useDelRowButton/index.d.ts +6 -0
  24. package/dist/Invoice/ui/digtal/FreightList/ui/BulkMenu/hooks/useEmptyRefill/index.d.ts +6 -0
  25. package/dist/Invoice/ui/digtal/FreightList/ui/TableRow/index.d.ts +3 -0
  26. package/dist/Invoice/ui/digtal/FreightList/ui/TableVirtual/index.d.ts +4 -0
  27. package/dist/index.esm.js +1896 -52
  28. package/dist/index.js +1896 -52
  29. package/package.json +3 -3
  30. package/src/Invoice/Invoice-digtal/_test/architecture/index.tsx +22 -0
  31. package/src/Invoice/Invoice-digtal/_test/freight/index.tsx +14564 -0
  32. package/src/Invoice/Invoice-digtal/index.md +7 -1
  33. package/src/Invoice/InvoiceController/InvoiceControllerState/FreightListState/IColumnsReplenish/index.ts +10 -0
  34. package/src/Invoice/InvoiceController/InvoiceControllerState/FreightListState/IGood/index.ts +33 -0
  35. package/src/Invoice/InvoiceController/InvoiceControllerState/FreightListState/ImportGoods/index.ts +81 -0
  36. package/src/Invoice/InvoiceController/InvoiceControllerState/FreightListState/index.ts +40 -0
  37. package/src/Invoice/InvoiceController/InvoiceControllerState/index.ts +6 -0
  38. package/src/Invoice/InvoiceController/fns/addFreight.ts +11 -0
  39. package/src/Invoice/InvoiceController/fns/delFreight.ts +38 -0
  40. package/src/Invoice/InvoiceController/fns/saveEditFreight.ts +24 -0
  41. package/src/Invoice/InvoiceController/fns/setEditFreight.ts +16 -0
  42. package/src/Invoice/InvoiceController/fns/setFreight.ts +11 -0
  43. package/src/Invoice/InvoiceController/index.ts +20 -1
  44. package/src/Invoice/index.tsx +8 -1
  45. package/src/Invoice/tools/useToGenerateId/index.ts +2 -0
  46. package/src/Invoice/ui/default/EndowCodeDrawer/index.tsx +10 -11
  47. package/src/Invoice/ui/digtal/Architecture/index.less +15 -0
  48. package/src/Invoice/ui/digtal/Architecture/index.tsx +166 -0
  49. package/src/Invoice/ui/digtal/FreightList/hook/useColumns/dist/index.js +616 -0
  50. package/src/Invoice/ui/digtal/FreightList/hook/useColumns/index.tsx +246 -0
  51. package/src/Invoice/ui/digtal/FreightList/hook/useColumns/ui/TitleText/index.tsx +20 -0
  52. package/src/Invoice/ui/digtal/FreightList/hook/useOnRow/index.tsx +37 -0
  53. package/src/Invoice/ui/digtal/FreightList/hook/useRowSelection/index.tsx +120 -0
  54. package/src/Invoice/ui/digtal/FreightList/hook/useWindowClick/index.tsx +23 -0
  55. package/src/Invoice/ui/digtal/FreightList/index.less +74 -0
  56. package/src/Invoice/ui/digtal/FreightList/index.tsx +108 -0
  57. package/src/Invoice/ui/digtal/FreightList/ui/AddRowButton/index.tsx +65 -0
  58. package/src/Invoice/ui/digtal/FreightList/ui/BulkMenu/hooks/useDelRowButton/index.tsx +50 -0
  59. package/src/Invoice/ui/digtal/FreightList/ui/BulkMenu/hooks/useEmptyRefill/index.tsx +37 -0
  60. package/src/Invoice/ui/digtal/FreightList/ui/TableRow/index.less +29 -0
  61. package/src/Invoice/ui/digtal/FreightList/ui/TableRow/index.tsx +21 -0
  62. package/src/Invoice/ui/digtal/FreightList/ui/TableVirtual/index.less +39 -0
  63. package/src/Invoice/ui/digtal/FreightList/ui/TableVirtual/index.tsx +109 -0
  64. package/src/Invoice/ui/digtal/GoodsList/index.tsx +0 -1
  65. package/src/Invoice/ui/digtal/GoodsList/ui/TableRow/index.tsx +0 -1
  66. package/src/TaxClassificationCodeModal/index.less +0 -8
  67. package/src/TaxClassificationCodeModal/index.tsx +4 -13
@@ -1,6 +1,6 @@
1
1
  # 数电
2
2
 
3
- ## 简单用法
3
+ <!-- ## 简单用法
4
4
  <code src="./_test/easiest/index.tsx"></code>
5
5
 
6
6
  ## 只读模式
@@ -32,3 +32,9 @@
32
32
 
33
33
  ## 不动产经营租赁服务
34
34
  <code src="./_test/realEstateInfo/index.tsx"></code>
35
+
36
+ ## 建筑服务
37
+ <code src="./_test/architecture/index.tsx"></code> -->
38
+
39
+ ## 货物运输服务
40
+ <code src="./_test/freight/index.tsx"></code>
@@ -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,33 @@
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
+ type:string;
13
+
14
+ licensePlate:string;
15
+
16
+ itemName:string;
17
+
18
+ /** 运输工具牌号 */
19
+ vehicleNo?: string;
20
+
21
+ /** 起运地 */
22
+ origin?: string[];
23
+
24
+ /** 到达地 */
25
+ destination?: string[];
26
+
27
+ /** 运输货物名称 */
28
+ goodName?: string;
29
+
30
+ /** 地区 */
31
+ area?: string[];
32
+
33
+ }
@@ -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 FreightListState {
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,4 +1,5 @@
1
1
  import GoodsListState from './GoodsListState';
2
+ import FreightListState from './FreightListState';
2
3
  import BuyerState from './BuyerState';
3
4
  import Stakeholder from './Stakeholder';
4
5
  import { IInvoiceTypeModalProps } from '../../../InvoiceTypeModal';
@@ -62,4 +63,9 @@ export default class InvoiceControllerState {
62
63
  * 商品税收分类编码窗口
63
64
  * */
64
65
  taxClassificationProps?: TaxClassificationProps;
66
+
67
+ /**
68
+ * 货物运输列表
69
+ */
70
+ freightListState = new FreightListState();
65
71
  }
@@ -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.freightListState.goodsList = [...state.freightListState.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.freightListState.goodsList.filter((e) => e.$index === $index)[0];
10
+ if (!goods) return;
11
+
12
+ // 如果正在编辑 就取消编辑
13
+ if (state.freightListState.editGood && state.freightListState.editGood.$index === $index) {
14
+ state.freightListState.editGood = undefined;
15
+ }
16
+ const goodsList = state.freightListState.goodsList;
17
+ const goodsMap = state.freightListState.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.freightListState.goodsList = [...goodsList];
37
+ state.freightListState.goodsMap = new Map(goodsMap);
38
+ };
@@ -0,0 +1,24 @@
1
+ import { InvoiceControllerState } from '..';
2
+
3
+ /**
4
+ * 保存正在编辑的货物
5
+ */
6
+ export default async (state: InvoiceControllerState) => {
7
+
8
+ const editGood = state.freightListState.editGood;
9
+ const form = state.freightListState.form;
10
+
11
+ if (!editGood || !form ) return;
12
+ if ((await validateFields(form)).err) return;
13
+
14
+ state.freightListState.goodsList = state.freightListState.goodsList.map((e) =>
15
+ e.$index === editGood.$index ? { ...e, ...editGood } : e,
16
+ );
17
+ state.freightListState.editGood = undefined;
18
+ };
19
+
20
+ const validateFields = (form: any) => new Promise((resolve: (v: { err: any; values: any }) => void) => {
21
+ form.validateFields(async (err: any, values: any) => {
22
+ resolve({ err, values });
23
+ });
24
+ });
@@ -0,0 +1,16 @@
1
+ import { InvoiceControllerState, IGood2 } from '..';
2
+
3
+ /**
4
+ * 设置当前的编辑货物运输
5
+ */
6
+ export default async (state: InvoiceControllerState, newEditGood?: any) => {
7
+ if (newEditGood) {
8
+ const editGood = state.freightListState.editGood as IGood2;
9
+ state.freightListState = {
10
+ ...state.freightListState,
11
+ editGood: { ...editGood, ...newEditGood },
12
+ };
13
+ } else {
14
+ state.freightListState = { ...state.freightListState, 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.freightListState.goodsList.map(e => e.$index === options.$index ? { ...e, ...options } : e);
10
+ state.freightListState = { ...state.freightListState, goodsList };
11
+ };
@@ -4,12 +4,17 @@ import { IGetBuyerListOption } from './InvoiceControllerState/BuyerState';
4
4
  import { IGetGoodsListOption } from './InvoiceControllerState/GoodsListState/ImportGoods';
5
5
  // import updateInvoiceNo from './fns/updateInvoiceNo';
6
6
  import setEditGood from './fns/setEditGood';
7
+ import setEditFreight from './fns/setEditFreight';
7
8
  import setGoods from './fns/setGoods';
9
+ import setFreight from './fns/setFreight';
8
10
  import delGood from './fns/delGood';
11
+ import delFreight from './fns/delFreight';
9
12
  import addGoodDiscount from './fns/addGoodDiscount';
10
13
  import addGoodDiscountV2 from './fns/addGoodDiscountV2';
11
14
  import addGood from './fns/addGood';
15
+ import addFreight from './fns/addFreight';
12
16
  import saveEditGood from './fns/saveEditGood';
17
+ import saveEditFreight from './fns/saveEditFreight';
13
18
  import getGoodsSearch from './fns/getGoodsSearch';
14
19
  import mergeDetails from './fns/mergeDetails';
15
20
  import mergeDiscount from './fns/mergeDiscount';
@@ -19,7 +24,7 @@ import itemBlur from './fns/itemBlur';
19
24
  export { default as InvoiceControllerState } from './InvoiceControllerState';
20
25
  export { default as IGood } from './InvoiceControllerState/GoodsListState/IGood';
21
26
  export { default as LineAttributeType } from './InvoiceControllerState/GoodsListState/LineAttributeType';
22
-
27
+ export { default as IGood2 } from './InvoiceControllerState/FreightListState/IGood';
23
28
  export default class InvoiceController extends InvoiceControllerForm {
24
29
  constructor(state = new InvoiceControllerState()) {
25
30
  super(state);
@@ -40,18 +45,32 @@ export default class InvoiceController extends InvoiceControllerForm {
40
45
  /** 设置单个货物属性 */
41
46
  setGoods = this.pipeline(setGoods);
42
47
 
48
+ /** 设置货物运输属性 */
49
+ setFreight = this.pipeline(setFreight);
50
+
51
+ setEditFreight = this.pipeline(setEditFreight);
52
+
43
53
  /** 设置当前的编辑货物 */
44
54
  setEditGood = this.pipeline(setEditGood);
45
55
 
46
56
  /** 保存正在编辑的货物 */
47
57
  saveEditGood = this.pipeline<any>(saveEditGood);
48
58
 
59
+ /** 保存正在编辑的货物运输 */
60
+ saveEditFreight = this.pipeline<any>(saveEditFreight);
61
+
49
62
  /** 删除一个货物 */
50
63
  delGood = this.pipeline(delGood);
51
64
 
65
+ /** 删除一个货物运输 */
66
+ delFreight = this.pipeline(delFreight);
67
+
52
68
  /** 添加一个货物 */
53
69
  addGood = this.pipeline(addGood);
54
70
 
71
+ /** 添加一个货物运输 */
72
+ addFreight = this.pipeline(addFreight);
73
+
55
74
  /** 全单合并明细 */
56
75
  mergeDetails = this.pipeline(mergeDetails);
57
76
 
@@ -19,6 +19,8 @@ import StakeFarmerholder from './ui/digtal/StakeFarmerholder';
19
19
  import SignDigtal from './ui/digtal/Sign';
20
20
  import GoodsListDigtal from './ui/digtal/GoodsList';
21
21
  import RealEstateInfo from './ui/digtal/RealEstateInfo';
22
+ import Architecture from './ui/digtal/Architecture';
23
+ import FreightList from './ui/digtal/FreightList';
22
24
 
23
25
  import ImportBuyerDrawer from './ui/default/ImportBuyerDrawer';
24
26
  import ImportGoodsDrawer from './ui/default/ImportGoodsDrawer';
@@ -86,7 +88,7 @@ export default class Invoice extends React.PureComponent<IInvoiceProps> {
86
88
 
87
89
  /** 干系人(数电) */
88
90
  static readonly Stakeholder = Stakeholder;
89
-
91
+
90
92
  /** 农产品干系人(数电) */
91
93
  static readonly StakeFarmerholder = StakeFarmerholder;
92
94
 
@@ -95,6 +97,11 @@ export default class Invoice extends React.PureComponent<IInvoiceProps> {
95
97
 
96
98
  /** 特殊信息-不动产经营租赁服务(数电) */
97
99
  static readonly RealEstateInfo = RealEstateInfo;
100
+
101
+ /** 特殊信息-建筑服务(数电) */
102
+ static readonly Architecture = Architecture;
103
+
104
+ static readonly FreightList = FreightList;
98
105
 
99
106
  /** 货物列表(数电) */
100
107
  static readonly GoodsListDigtal = GoodsListDigtal;
@@ -6,4 +6,6 @@ import InvoiceController from '../../InvoiceController'
6
6
  export default function useToGenerateId(controller: InvoiceController) {
7
7
  const goodsList = controller.useMemo(s => s.goodsListState.goodsList, []);
8
8
  React.useEffect(() => { goodsList.forEach((e, i) => { e.serialNo = i + 1 }) }, [goodsList])
9
+ const freightList = controller.useMemo(s => s.freightListState.goodsList, []);
10
+ React.useEffect(() => { freightList.forEach((e, i) => { e.sortNumber = i + 1 }) }, [freightList])
9
11
  }
@@ -379,31 +379,30 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
379
379
  // s.value = info.node.taxRate
380
380
  // }
381
381
  // });
382
- let node = info.node || info;
382
+
383
383
  actions.setFieldState('taxClassificationCode', async s => {
384
- if(node.taxCategoryCode) {
385
- s.value = node.taxCategoryCode
384
+ if(info.taxCategoryCode) {
385
+ s.value = info.taxCategoryCode
386
386
  }
387
387
  });
388
388
 
389
389
  actions.setFieldState('shorthand', async (s) => {
390
- if (node.shorthand){
391
- s.value = node.shorthand
390
+ if (info.shorthand){
391
+ s.value = info.shorthand
392
392
  }
393
393
  });
394
394
  setOpen(false);
395
395
  }, [controller, actions]);
396
396
 
397
397
  const onSelect = React.useCallback((key: any, info: any) => {
398
- let node = info.node || info;
399
398
  if (controller.state.goodsListState.isUpdateGoodsTaxRateList) {
400
- if (node.taxRateList?.length) {
401
- setGoodsTaxRateList(node.taxRateList);
399
+ if (info.node.taxRateList?.length) {
400
+ setGoodsTaxRateList(info.node.taxRateList);
402
401
  }
403
402
  if (!readOnlyTaxRate) {
404
403
  actions.setFieldState('taxRate', async s => {
405
- if (node.taxRateList && node.taxRateList?.length === 1) {
406
- s.value = node.taxRateList[0]
404
+ if (info.node.taxRateList && info.node.taxRateList?.length === 1) {
405
+ s.value = info.node.taxRateList[0]
407
406
  } else {
408
407
  s.value = undefined
409
408
  }
@@ -454,7 +453,7 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
454
453
  info={info}
455
454
  onSelect={onSelect}
456
455
  onSubmit={onSubmit1}
457
- onCancel={()=> {setOpen(false); setInfo({})}}
456
+ onCancel={()=> {setOpen(false)}}
458
457
  onSearch={onSearch}
459
458
  onLoad={onLoad}
460
459
  />
@@ -0,0 +1,15 @@
1
+ .kts-invoice-operate-real-estate-info-digtal {
2
+ padding : 20px;
3
+ border-bottom: 2px solid #9F613E;
4
+ border-left : 2px solid #9F613E;
5
+ border-right : 2px solid #9F613E;
6
+
7
+ .real-estate-info-digtal-label {
8
+ color : #9F613E;
9
+ font-weight: bold;
10
+ }
11
+
12
+ .ktsAnt3x-row.ktsAnt3x-form-item {
13
+ margin-bottom: 0;
14
+ }
15
+ }
@@ -0,0 +1,166 @@
1
+
2
+ import React from "react";
3
+ import { decorator } from 'grey-react-box';
4
+ import { Form } from 'kts-components-antd-x3';
5
+ import { FormComponentProps } from 'kts-components-antd-x3/lib/form';
6
+ import Invoice from '../../..';
7
+ import './index.less';
8
+ import { Cascader, Col, Input, Row, Select } from "kts-components-antd-x4";
9
+ import moment from "moment";
10
+
11
+
12
+ export interface RealEstateInfoProps {
13
+ /**
14
+ * 建筑服务地址数据
15
+ */
16
+ addressOptions?: any[];
17
+
18
+ /**
19
+ * 建筑服务地址数据字段名
20
+ */
21
+ fieldNames?: any;
22
+ }
23
+
24
+ /** 特殊信息-建筑服务 */
25
+ export default decorator<RealEstateInfoProps, FormComponentProps & RealEstateInfoProps>(Form.create())(props => {
26
+
27
+ /** 控制器 */
28
+ const controller = Invoice.useInvoiceController();
29
+
30
+ const { form } = props;
31
+
32
+ const { getFieldDecorator } = form;
33
+
34
+ const model = controller.useMemo(s => s.model, []);
35
+
36
+ const readOnly = React.useMemo(() => model === 'readOnly', [model]);
37
+
38
+ // 注册 form
39
+ controller.useForm('realEstateInfo', form);
40
+
41
+ return (
42
+ <div className="kts-invoice-operate-real-estate-info-digtal">
43
+ <div className='real-estate-info-digtal-label' >特殊信息-建筑服务</div>
44
+ <Row gutter={[17, 0]}>
45
+ <Col span={6} >
46
+ <Form.Item label='土地增值税项目编号' >
47
+ {getFieldDecorator('landNumber', {
48
+ })(
49
+ readOnly
50
+ ? <MyDiv />
51
+ : <Input autoComplete='off' placeholder="请输入" />
52
+ )}
53
+ </Form.Item>
54
+ </Col>
55
+ <Col span={6} >
56
+ <Form.Item label='跨地(市)标志' >
57
+ {getFieldDecorator('crossCitiesSign', {
58
+ rules: readOnly ? [] : [
59
+ { required: true, message: '请选择跨地(市)标志' }
60
+ ]
61
+ })(
62
+ readOnly
63
+ ? <MyNY />
64
+ : <Select placeholder='请选择' style={{ width: '100%' }} >
65
+ <Select.Option value='Y'>是</Select.Option>
66
+ <Select.Option value='N'>否</Select.Option>
67
+ </Select>
68
+ )}
69
+ </Form.Item>
70
+ </Col>
71
+
72
+ <Col span={6} >
73
+ <Form.Item label='建筑服务发生地' >
74
+ {getFieldDecorator('constructAddress', {
75
+ rules: readOnly ? [] : [{ required: true, message: '请选择省市区县' }]
76
+ })(
77
+ readOnly
78
+ ? (<MyArrString />)
79
+ : (<Cascader
80
+ style={{ width: '100%' }}
81
+ options={props.addressOptions}
82
+ fieldNames={props.fieldNames}
83
+ placeholder="请选择省市区县"
84
+ />)
85
+ )}
86
+ </Form.Item>
87
+ </Col>
88
+ <Col span={6} >
89
+ <Form.Item label='详细地址' >
90
+ {getFieldDecorator('constructDetailAddress', {
91
+ rules: readOnly ? [] : [
92
+ { max: 200, message: '详细地址最多200个字符' },
93
+ ]
94
+ })(
95
+ readOnly
96
+ ? <MyDiv />
97
+ : <Input autoComplete='off' placeholder="请输入详细地址" />
98
+ )}
99
+ </Form.Item>
100
+ </Col>
101
+ <Col span={6} >
102
+ <Form.Item label='建筑项目名称' >
103
+ {getFieldDecorator('constructName', { rules: readOnly ? [] : [
104
+ { required: true, message: '请输入建筑项目名称' },
105
+ { max: 200, message: '建筑项目名称最多200个字符' },
106
+
107
+ ]
108
+ })(
109
+ readOnly
110
+ ? <MyDiv />
111
+ : <Input autoComplete='off' placeholder="请输入" />
112
+ )}
113
+ </Form.Item>
114
+ </Col>
115
+
116
+ </Row>
117
+ </div>
118
+ )
119
+ })
120
+
121
+ class MyDiv extends React.Component<{ value?: string, style?: React.CSSProperties }> {
122
+ render(): React.ReactNode {
123
+ return (
124
+ <div style={this.props.style}>{this.props.value}</div>
125
+ )
126
+ }
127
+ }
128
+
129
+ class MyArrString extends React.Component<{ value?: string[], style?: React.CSSProperties }> {
130
+ render(): React.ReactNode {
131
+ return (
132
+ <div style={this.props.style}>
133
+ {
134
+ this.props.value?.filter(e => !!e)
135
+ .join(',')
136
+ }
137
+ </div>
138
+ )
139
+ }
140
+ }
141
+
142
+ class MyArrMoment extends React.Component<{ value?: moment.Moment[], style?: React.CSSProperties }> {
143
+ render(): React.ReactNode {
144
+ const { value = [] } = this.props
145
+ return (
146
+ <div style={this.props.style}>
147
+ <span>{moment.isMoment(value[0]) && value[0].format('YYYY-MM-DD')}</span>
148
+ <span style={{ color: '#9F603D', fontWeight: 600 }} > - </span>
149
+ <span>{moment.isMoment(value[1]) && value[0].format('YYYY-MM-DD')}</span>
150
+ </div>
151
+ )
152
+ }
153
+ }
154
+
155
+ class MyNY extends React.Component<{ value?: 'Y' | 'N', style?: React.CSSProperties }> {
156
+ render(): React.ReactNode {
157
+ return (
158
+ <div style={this.props.style}>
159
+ {
160
+ this.props.value === 'Y' ? '是' : '否'
161
+ }
162
+ </div>
163
+ )
164
+ }
165
+ }
166
+