kts-component-invoice-operate 3.2.257 → 3.2.259
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/Invoice-digtal/_test/passenger/index.d.ts +4 -0
- package/dist/Invoice/InvoiceController/InvoiceControllerState/PassengerListState/IColumnsReplenish/index.d.ts +6 -0
- package/dist/Invoice/InvoiceController/InvoiceControllerState/PassengerListState/IGood/index.d.ts +24 -0
- package/dist/Invoice/InvoiceController/InvoiceControllerState/PassengerListState/index.d.ts +44 -0
- package/dist/Invoice/InvoiceController/InvoiceControllerState/index.d.ts +5 -0
- package/dist/Invoice/InvoiceController/fns/addPassenger.d.ts +6 -0
- package/dist/Invoice/InvoiceController/fns/delPassenger.d.ts +6 -0
- package/dist/Invoice/InvoiceController/fns/saveEditPassenger.d.ts +6 -0
- package/dist/Invoice/InvoiceController/fns/setEditPassenger.d.ts +6 -0
- package/dist/Invoice/InvoiceController/index.d.ts +12 -0
- package/dist/Invoice/index.d.ts +2 -0
- package/dist/Invoice/ui/components/CustomCascader/index.d.ts +20 -0
- package/dist/Invoice/ui/default/ImportPassengerDrawer/index.d.ts +3 -0
- package/dist/Invoice/ui/digtal/PassengerList/hook/useColumns/index.d.ts +3 -0
- package/dist/Invoice/ui/digtal/PassengerList/hook/useColumns/ui/TitleText/index.d.ts +8 -0
- package/dist/Invoice/ui/digtal/PassengerList/hook/useOnRow/index.d.ts +8 -0
- package/dist/Invoice/ui/digtal/PassengerList/hook/useRowSelection/index.d.ts +8 -0
- package/dist/Invoice/ui/digtal/PassengerList/hook/useWindowClick/index.d.ts +8 -0
- package/dist/Invoice/ui/digtal/PassengerList/index.d.ts +18 -0
- package/dist/Invoice/ui/digtal/PassengerList/ui/AddRowButton/index.d.ts +3 -0
- package/dist/Invoice/ui/digtal/PassengerList/ui/BatchImportButton/index.d.ts +3 -0
- package/dist/Invoice/ui/digtal/PassengerList/ui/BulkMenu/hooks/useDelRowButton/index.d.ts +6 -0
- package/dist/Invoice/ui/digtal/PassengerList/ui/BulkMenu/hooks/useEmptyRefill/index.d.ts +6 -0
- package/dist/Invoice/ui/digtal/PassengerList/ui/TableRow/index.d.ts +3 -0
- package/dist/Invoice/ui/digtal/PassengerList/ui/TableVirtual/index.d.ts +4 -0
- package/dist/Invoice/ui/digtal/Stakeholder/index.d.ts +2 -0
- package/dist/index.esm.js +3501 -45
- package/dist/index.js +3491 -35
- package/package.json +1 -1
- package/src/Invoice/Invoice-digtal/_test/freight/index.tsx +12 -0
- package/src/Invoice/Invoice-digtal/_test/passenger/index.tsx +14602 -0
- package/src/Invoice/Invoice-digtal/index.md +3 -0
- package/src/Invoice/InvoiceController/InvoiceControllerForm/index.ts +11 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/PassengerListState/IColumnsReplenish/index.ts +10 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/PassengerListState/IGood/index.ts +34 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/PassengerListState/index.ts +179 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/index.ts +8 -2
- package/src/Invoice/InvoiceController/fns/addPassenger.ts +11 -0
- package/src/Invoice/InvoiceController/fns/delPassenger.ts +38 -0
- package/src/Invoice/InvoiceController/fns/saveEditPassenger.ts +24 -0
- package/src/Invoice/InvoiceController/fns/setEditPassenger.ts +16 -0
- package/src/Invoice/InvoiceController/index.ts +23 -1
- package/src/Invoice/index.tsx +5 -0
- package/src/Invoice/ui/components/CustomCascader/index.tsx +356 -0
- package/src/Invoice/ui/default/ImportPassengerDrawer/index.tsx +214 -0
- package/src/Invoice/ui/digtal/PassengerList/hook/useColumns/index.tsx +428 -0
- package/src/Invoice/ui/digtal/PassengerList/hook/useColumns/ui/TitleText/index.tsx +20 -0
- package/src/Invoice/ui/digtal/PassengerList/hook/useOnRow/index.tsx +37 -0
- package/src/Invoice/ui/digtal/PassengerList/hook/useRowSelection/index.tsx +120 -0
- package/src/Invoice/ui/digtal/PassengerList/hook/useWindowClick/index.tsx +23 -0
- package/src/Invoice/ui/digtal/PassengerList/index.less +73 -0
- package/src/Invoice/ui/digtal/PassengerList/index.tsx +152 -0
- package/src/Invoice/ui/digtal/PassengerList/ui/AddRowButton/index.tsx +75 -0
- package/src/Invoice/ui/digtal/PassengerList/ui/BatchImportButton/index.tsx +74 -0
- package/src/Invoice/ui/digtal/PassengerList/ui/BulkMenu/hooks/useDelRowButton/index.tsx +50 -0
- package/src/Invoice/ui/digtal/PassengerList/ui/BulkMenu/hooks/useEmptyRefill/index.tsx +37 -0
- package/src/Invoice/ui/digtal/PassengerList/ui/TableRow/index.less +29 -0
- package/src/Invoice/ui/digtal/PassengerList/ui/TableRow/index.tsx +21 -0
- package/src/Invoice/ui/digtal/PassengerList/ui/TableVirtual/index.less +39 -0
- package/src/Invoice/ui/digtal/PassengerList/ui/TableVirtual/index.tsx +109 -0
- package/src/Invoice/ui/digtal/Stakeholder/index.tsx +22 -17
|
@@ -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.passengerListState.form) {
|
|
63
|
+
try {
|
|
64
|
+
await this.state.passengerListState.form?.validateFields()
|
|
65
|
+
} catch (error: any) {
|
|
66
|
+
_errors.set('passengerList', error.errors);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
_values.set('passengerList', this.state.passengerListState.goodsList.slice());
|
|
71
|
+
|
|
61
72
|
//支付
|
|
62
73
|
if (this.state.payListState.form) {
|
|
63
74
|
try {
|
package/src/Invoice/InvoiceController/InvoiceControllerState/PassengerListState/IGood/index.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export default interface IGood {
|
|
2
|
+
/** 数据索引 */
|
|
3
|
+
$index: string;
|
|
4
|
+
/** 出行人序号 */
|
|
5
|
+
cxrxh?: number;
|
|
6
|
+
|
|
7
|
+
/** 出行人 */
|
|
8
|
+
cxr?: string;
|
|
9
|
+
|
|
10
|
+
/** 证件类型 */
|
|
11
|
+
cxrzjlxDm?: string;
|
|
12
|
+
|
|
13
|
+
/** 有效身份证件号 */
|
|
14
|
+
sfzjhm?: string;
|
|
15
|
+
|
|
16
|
+
/** 出行日期 */
|
|
17
|
+
chuxrq?: string;
|
|
18
|
+
|
|
19
|
+
/** 旅客出发地 */
|
|
20
|
+
cfd?: string[];
|
|
21
|
+
|
|
22
|
+
/** 旅客到达地 */
|
|
23
|
+
ddd?: string[];
|
|
24
|
+
|
|
25
|
+
/** 等级 */
|
|
26
|
+
zwdj?: string;
|
|
27
|
+
|
|
28
|
+
/** 交通工具类型列表 */
|
|
29
|
+
jtgjlxDm?: string;
|
|
30
|
+
|
|
31
|
+
/** 地区 */
|
|
32
|
+
area?: string[];
|
|
33
|
+
|
|
34
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import IGood from './IGood';
|
|
2
|
+
import { WrappedFormUtils } from 'kts-components-antd-x3/lib/form/Form';
|
|
3
|
+
import { PaginationConfig } from 'kts-components-antd-x3/lib/pagination';
|
|
4
|
+
|
|
5
|
+
const CertificateTypeList = [
|
|
6
|
+
{ value: 'COMPANY', label: '单位' },
|
|
7
|
+
{ value: 'ORGANIZATION_CODE', label: '组织机构代码证' },
|
|
8
|
+
{ value: 'BUSINESS_LICENSE', label: '营业执照' },
|
|
9
|
+
{ value: 'TAX_REGISTRATION_CERTIFICATE', label: '税务登记证' },
|
|
10
|
+
{ value: 'OTHER_COMPANY_CERTIFICATE', label: '其他单位证件' },
|
|
11
|
+
{ value: 'INDIVIDUAL', label: '个人' },
|
|
12
|
+
{ value: 'RESIDENT_ID_CARD', label: '居民身份证' },
|
|
13
|
+
{ value: 'OFFICER_ID_CARD', label: '军官证' },
|
|
14
|
+
{ value: 'ARMED_POLICE_ID_CARD', label: '武警警官证' },
|
|
15
|
+
{ value: 'SOLDIER_ID_CARD', label: '士兵证' },
|
|
16
|
+
{ value: 'RETIRED_MILITARY_CADRE_CERTIFICATE', label: '军队离退休干部证' },
|
|
17
|
+
{ value: 'DISABLED_PERSON_CERTIFICATE', label: '残疾人证' },
|
|
18
|
+
{ value: 'DISABLED_SOLDIER_CERTIFICATE', label: '残疾军人证(1-8级)' },
|
|
19
|
+
{ value: 'FOREIGN_PASSPORT', label: '外国护照' },
|
|
20
|
+
{ value: 'HOME_RETURN_PERMIT', label: '港澳同胞回乡证' },
|
|
21
|
+
{ value: 'HONG_KONG_MACAO_MAINLAND_PERMIT', label: '港澳居民来往内地通行证' },
|
|
22
|
+
{ value: 'TAIWAN_COMPATRIOT_PERMIT', label: '台胞证' },
|
|
23
|
+
{ value: 'HONG_KONG_MACAO_PERMIT', label: '中华人民共和国往来港澳通行证' },
|
|
24
|
+
{ value: 'TAIWAN_MAINLAND_PERMIT', label: '台湾居民来往大陆通行证' },
|
|
25
|
+
{ value: 'MAINLAND_TAIWAN_PERMIT', label: '大陆居民往来台湾通行证' },
|
|
26
|
+
{ value: 'FOREIGN_RESIDENCE_PERMIT', label: '外国人居留证' },
|
|
27
|
+
{ value: 'DIPLOMATIC_ID_CARD', label: '外交官证' },
|
|
28
|
+
{ value: 'CONSULATE_ID_CARD', label: '使(领事)馆证' },
|
|
29
|
+
{ value: 'SEAMAN_BOOK', label: '海员证' },
|
|
30
|
+
{ value: 'HONG_KONG_PERMANENT_ID_CARD', label: '香港永久性居民身份证' },
|
|
31
|
+
{ value: 'TAIWAN_ID_CARD', label: '台湾身份证' },
|
|
32
|
+
{ value: 'MACAO_PERMANENT_ID_CARD', label: '澳门特别行政区永久性居民身份证' },
|
|
33
|
+
{ value: 'FOREIGNER_ID_CARD', label: '外国人身份证件' },
|
|
34
|
+
{ value: 'GRADUATE_STARTUP_CERTIFICATE', label: '高校毕业生自主创业证' },
|
|
35
|
+
{ value: 'EMPLOYMENT_UNEMPLOYMENT_CERTIFICATE', label: '就业失业登记证' },
|
|
36
|
+
{ value: 'RETIREMENT_CERTIFICATE', label: '退休证' },
|
|
37
|
+
{ value: 'RETIRED_CADRE_CERTIFICATE', label: '离休证' },
|
|
38
|
+
{ value: 'CHINESE_PASSPORT', label: '中国护照' },
|
|
39
|
+
{ value: 'RETIRED_SOLDIER_SELF_EMPLOYMENT_CERTIFICATE', label: '城镇退役士兵自谋职业证' },
|
|
40
|
+
{ value: 'MILITARY_FAMILY_IDENTITY_CERTIFICATE', label: '随军家属身份证明' },
|
|
41
|
+
{ value: 'MILITARY_OFFICER_TRANSFER_CERTIFICATE', label: '中国人民解放军军官转业证书' },
|
|
42
|
+
{ value: 'MILITARY_CONSCRIPT_RETIREMENT_CERTIFICATE', label: '中国人民解放军义务兵退出现役证' },
|
|
43
|
+
{ value: 'MILITARY_NCO_RETIREMENT_CERTIFICATE', label: '中国人民解放军士官退出现役证' },
|
|
44
|
+
{ value: 'FOREIGN_PERMANENT_RESIDENCE_ID_CARD', label: '外国人永久居留身份证(外国人永久居留证)' },
|
|
45
|
+
{ value: 'EMPLOYMENT_ENTREPRENEURSHIP_CERTIFICATE', label: '就业创业证' },
|
|
46
|
+
{ value: 'HONG_KONG_PASSPORT', label: '香港特别行政区护照' },
|
|
47
|
+
{ value: 'MACAO_PASSPORT', label: '澳门特别行政区护照' },
|
|
48
|
+
{ value: 'HONG_KONG_MACAO_RESIDENCE_PERMIT', label: '中华人民共和国港澳居民居住证' },
|
|
49
|
+
{ value: 'TAIWAN_RESIDENCE_PERMIT', label: '中华人民共和国台湾居民居住证' },
|
|
50
|
+
{ value: 'FOREIGN_WORK_PERMIT_A', label: '中华人民共和国外国人工作许可证(A类)' },
|
|
51
|
+
{ value: 'FOREIGN_WORK_PERMIT_B', label: '中华人民共和国外国人工作许可证(B类)' },
|
|
52
|
+
{ value: 'FOREIGN_WORK_PERMIT_C', label: '中华人民共和国外国人工作许可证(C类)' },
|
|
53
|
+
{ value: 'BIRTH_MEDICAL_CERTIFICATE', label: '出生医学证明' },
|
|
54
|
+
{ value: 'OTHER_INDIVIDUAL_CERTIFICATE', label: '其他个人证件' }
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
// 在 Antd 中使用方式:
|
|
58
|
+
// <Select options={options} />
|
|
59
|
+
|
|
60
|
+
const VehicleTypeList = [
|
|
61
|
+
{ value: 'AIRCRAFT', label: '飞机' },
|
|
62
|
+
{ value: 'TRAIN', label: '火车' },
|
|
63
|
+
{ value: 'LONG_DISTANCE_BUS', label: '长途汽车' },
|
|
64
|
+
{ value: 'PUBLIC_TRANSPORT', label: '公共交通' },
|
|
65
|
+
{ value: 'TAXI', label: '出租车' },
|
|
66
|
+
{ value: 'AUTOMOBILE', label: '汽车' },
|
|
67
|
+
{ value: 'SHIP', label: '船舶' },
|
|
68
|
+
{ value: 'OTHER', label: '其他' }
|
|
69
|
+
];
|
|
70
|
+
|
|
71
|
+
export default class PassengerListState {
|
|
72
|
+
|
|
73
|
+
/** 产品最大数 */
|
|
74
|
+
goodMax?: number;
|
|
75
|
+
|
|
76
|
+
/** 正在编辑的货物 */
|
|
77
|
+
editGood?: IGood;
|
|
78
|
+
|
|
79
|
+
/** 是否可以添加行 */
|
|
80
|
+
isAddRow = true;
|
|
81
|
+
|
|
82
|
+
/** 是否可以删除行 */
|
|
83
|
+
isRemRow = true;
|
|
84
|
+
|
|
85
|
+
/** 是否可以批量导入 */
|
|
86
|
+
isBatchImport = true;
|
|
87
|
+
/** 批量导入弹窗 */
|
|
88
|
+
isVisibleDrawer = false;
|
|
89
|
+
|
|
90
|
+
/** 货物字典 */
|
|
91
|
+
goodsMap = new Map<string, IGood>();
|
|
92
|
+
|
|
93
|
+
/** 被编辑行的form对象 */
|
|
94
|
+
form?: WrappedFormUtils;
|
|
95
|
+
|
|
96
|
+
/** 证件类型列表 */
|
|
97
|
+
certificateTypeList: any[] = CertificateTypeList;
|
|
98
|
+
|
|
99
|
+
/** 交通工具类型列表 */
|
|
100
|
+
vehicleTypeList: any[] = VehicleTypeList;
|
|
101
|
+
|
|
102
|
+
/** 货物列表 */
|
|
103
|
+
goodsList: IGood[] = [];
|
|
104
|
+
|
|
105
|
+
/** 列表选中的货物索引列表 */
|
|
106
|
+
selectedGoodIndex: string[] = [];
|
|
107
|
+
|
|
108
|
+
/** 地区 */
|
|
109
|
+
area: any[] = [];
|
|
110
|
+
|
|
111
|
+
addressFieldNames: IFieldNames = { label: 'label', value: 'value', children: 'children' }
|
|
112
|
+
|
|
113
|
+
/** 批量导入列表 */
|
|
114
|
+
dataSource: any[] = [];
|
|
115
|
+
|
|
116
|
+
/** 分页数据 */
|
|
117
|
+
pagination: PaginationConfig = {};
|
|
118
|
+
|
|
119
|
+
/** 表头 */
|
|
120
|
+
columns: any[] = [
|
|
121
|
+
{
|
|
122
|
+
title: '序号',
|
|
123
|
+
dataIndex: 'i',
|
|
124
|
+
key: 'i',
|
|
125
|
+
render: (t:any, record:any, index: any) => {
|
|
126
|
+
return index + 1;
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
title: '出行人',
|
|
131
|
+
dataIndex: 'cxr',
|
|
132
|
+
key: 'cxr',
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
title: '出行日期',
|
|
136
|
+
dataIndex: 'chuxrq',
|
|
137
|
+
key: 'chuxrq',
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
title: '出行人证件类型',
|
|
141
|
+
dataIndex: 'cxrzjlxDm',
|
|
142
|
+
key: 'cxrzjlxDm',
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
title: '出行人证件号码',
|
|
146
|
+
dataIndex: 'sfzjhm',
|
|
147
|
+
key: 'sfzjhm',
|
|
148
|
+
render: (text: any) => {
|
|
149
|
+
return CertificateTypeList.find(e => e.value === text)?.label || '';
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
title: '出发点',
|
|
154
|
+
dataIndex: 'cfd',
|
|
155
|
+
key: 'cfd',
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
title: '到达地',
|
|
159
|
+
dataIndex: 'ddd',
|
|
160
|
+
key: 'ddd',
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
title: '交通工具类型',
|
|
164
|
+
dataIndex: 'jtgjlxDm',
|
|
165
|
+
key: 'jtgjlxDm',
|
|
166
|
+
render: (text: any) => {
|
|
167
|
+
return VehicleTypeList.find(e => e.value === text)?.label || '';
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
title: '等级',
|
|
172
|
+
dataIndex: 'zwdj',
|
|
173
|
+
key: 'zwdj',
|
|
174
|
+
},
|
|
175
|
+
];
|
|
176
|
+
}
|
|
177
|
+
interface IFieldNames {
|
|
178
|
+
label: string; value: string; children: string
|
|
179
|
+
}
|
|
@@ -6,6 +6,7 @@ import Stakeholder from './Stakeholder';
|
|
|
6
6
|
import { IInvoiceTypeModalProps } from '../../../InvoiceTypeModal';
|
|
7
7
|
import { TaxClassificationProps } from '../../../TaxClassificationCodeModal';
|
|
8
8
|
import AutoComplete from './AutoComplete';
|
|
9
|
+
import PassengerListState from './PassengerListState';
|
|
9
10
|
|
|
10
11
|
export default class InvoiceControllerState {
|
|
11
12
|
|
|
@@ -69,8 +70,13 @@ export default class InvoiceControllerState {
|
|
|
69
70
|
* 货物运输列表
|
|
70
71
|
*/
|
|
71
72
|
freightListState = new FreightListState();
|
|
72
|
-
|
|
73
|
-
payListState=new PayListState();
|
|
73
|
+
|
|
74
|
+
payListState = new PayListState();
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* 旅客运输列表
|
|
78
|
+
*/
|
|
79
|
+
passengerListState = new PassengerListState();
|
|
74
80
|
|
|
75
81
|
addGoodsCheck?: any;
|
|
76
82
|
}
|
|
@@ -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.passengerListState.goodsList = [...state.passengerListState.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.passengerListState.goodsList.filter((e) => e.$index === $index)[0];
|
|
10
|
+
if (!goods) return;
|
|
11
|
+
|
|
12
|
+
// 如果正在编辑 就取消编辑
|
|
13
|
+
if (state.passengerListState.editGood && state.passengerListState.editGood.$index === $index) {
|
|
14
|
+
state.passengerListState.editGood = undefined;
|
|
15
|
+
}
|
|
16
|
+
const goodsList = state.passengerListState.goodsList;
|
|
17
|
+
const goodsMap = state.passengerListState.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.passengerListState.goodsList = [...goodsList];
|
|
37
|
+
state.passengerListState.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.passengerListState.editGood;
|
|
9
|
+
const form = state.passengerListState.form;
|
|
10
|
+
|
|
11
|
+
if (!editGood || !form ) return;
|
|
12
|
+
if ((await validateFields(form)).err) return;
|
|
13
|
+
|
|
14
|
+
state.passengerListState.goodsList = state.passengerListState.goodsList.map((e) =>
|
|
15
|
+
e.$index === editGood.$index ? { ...e, ...editGood } : e,
|
|
16
|
+
);
|
|
17
|
+
state.passengerListState.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.passengerListState.editGood as IGood2;
|
|
9
|
+
state.passengerListState = {
|
|
10
|
+
...state.passengerListState,
|
|
11
|
+
editGood: { ...editGood, ...newEditGood },
|
|
12
|
+
};
|
|
13
|
+
} else {
|
|
14
|
+
state.passengerListState = { ...state.passengerListState, editGood: undefined };
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -6,6 +6,7 @@ import { IGetGoodsListOption } from './InvoiceControllerState/GoodsListState/Imp
|
|
|
6
6
|
import setEditGood from './fns/setEditGood';
|
|
7
7
|
import setEditFreight from './fns/setEditFreight';
|
|
8
8
|
import setEditPay from './fns/setEditPay';
|
|
9
|
+
import setEditPassenger from './fns/setEditPassenger';
|
|
9
10
|
|
|
10
11
|
import setGoods from './fns/setGoods';
|
|
11
12
|
import setFreight from './fns/setFreight';
|
|
@@ -14,17 +15,20 @@ import setPay from './fns/setPay';
|
|
|
14
15
|
import delGood from './fns/delGood';
|
|
15
16
|
import delFreight from './fns/delFreight';
|
|
16
17
|
import delPay from './fns/delPay';
|
|
18
|
+
import delPassenger from './fns/delPassenger';
|
|
17
19
|
|
|
18
20
|
import addGoodDiscount from './fns/addGoodDiscount';
|
|
19
21
|
import addGoodDiscountV2 from './fns/addGoodDiscountV2';
|
|
20
22
|
|
|
21
23
|
import addGood from './fns/addGood';
|
|
22
24
|
import addFreight from './fns/addFreight';
|
|
25
|
+
import addPassenger from './fns/addPassenger';
|
|
23
26
|
import addPay from './fns/addPay';
|
|
24
27
|
|
|
25
28
|
import saveEditGood from './fns/saveEditGood';
|
|
26
29
|
import saveEditFreight from './fns/saveEditFreight';
|
|
27
30
|
import saveEditPay from './fns/saveEditPay';
|
|
31
|
+
import saveEditPassenger from './fns/saveEditPassenger';
|
|
28
32
|
|
|
29
33
|
import getGoodsSearch from './fns/getGoodsSearch';
|
|
30
34
|
import mergeDetails from './fns/mergeDetails';
|
|
@@ -37,6 +41,8 @@ export { default as IGood } from './InvoiceControllerState/GoodsListState/IGood'
|
|
|
37
41
|
export { default as LineAttributeType } from './InvoiceControllerState/GoodsListState/LineAttributeType';
|
|
38
42
|
export { default as IGood2 } from './InvoiceControllerState/FreightListState/IGood';
|
|
39
43
|
export { default as IGood3 } from './InvoiceControllerState/PayListState/IGood';
|
|
44
|
+
export { default as IGoodPassenger } from './InvoiceControllerState/PassengerListState/IGood';
|
|
45
|
+
|
|
40
46
|
export default class InvoiceController extends InvoiceControllerForm {
|
|
41
47
|
constructor(state = new InvoiceControllerState()) {
|
|
42
48
|
super(state);
|
|
@@ -64,6 +70,8 @@ export default class InvoiceController extends InvoiceControllerForm {
|
|
|
64
70
|
|
|
65
71
|
setEditFreight = this.pipeline(setEditFreight);
|
|
66
72
|
|
|
73
|
+
setEditPassenger = this.pipeline(setEditPassenger);
|
|
74
|
+
|
|
67
75
|
setEditPay = this.pipeline(setEditPay);
|
|
68
76
|
|
|
69
77
|
/** 设置当前的编辑货物 */
|
|
@@ -75,13 +83,19 @@ export default class InvoiceController extends InvoiceControllerForm {
|
|
|
75
83
|
/** 保存正在编辑的货物运输 */
|
|
76
84
|
saveEditFreight = this.pipeline<any>(saveEditFreight);
|
|
77
85
|
|
|
78
|
-
|
|
86
|
+
/** 保存正在编辑的旅客运输 */
|
|
87
|
+
saveEditPassenger = this.pipeline(saveEditPassenger);
|
|
88
|
+
|
|
89
|
+
saveEditPay = this.pipeline<any>(saveEditPay);
|
|
79
90
|
/** 删除一个货物 */
|
|
80
91
|
delGood = this.pipeline(delGood);
|
|
81
92
|
|
|
82
93
|
/** 删除一个货物运输 */
|
|
83
94
|
delFreight = this.pipeline(delFreight);
|
|
84
95
|
|
|
96
|
+
/** 删除一个货物运输 */
|
|
97
|
+
delPassenger = this.pipeline(delPassenger);
|
|
98
|
+
|
|
85
99
|
delPay = this.pipeline(delPay);
|
|
86
100
|
|
|
87
101
|
/** 添加一个货物 */
|
|
@@ -90,6 +104,9 @@ export default class InvoiceController extends InvoiceControllerForm {
|
|
|
90
104
|
/** 添加一个货物运输 */
|
|
91
105
|
addFreight = this.pipeline(addFreight);
|
|
92
106
|
|
|
107
|
+
/** 添加一个旅客运输 */
|
|
108
|
+
addPassenger = this.pipeline(addPassenger);
|
|
109
|
+
|
|
93
110
|
addPay = this.pipeline(addPay);
|
|
94
111
|
|
|
95
112
|
/** 全单合并明细 */
|
|
@@ -124,4 +141,9 @@ export default class InvoiceController extends InvoiceControllerForm {
|
|
|
124
141
|
|
|
125
142
|
/** 商品列表配置器 */
|
|
126
143
|
setColumnsConfig?: (columns: any[]) => any[];
|
|
144
|
+
|
|
145
|
+
/** 下载模板 */
|
|
146
|
+
downloadPassengerTpt?: () => Promise<any>;
|
|
147
|
+
/** 获取 商品 列表 */
|
|
148
|
+
uploadPassenger?: (file: any) => Promise<any>;
|
|
127
149
|
}
|
package/src/Invoice/index.tsx
CHANGED
|
@@ -26,9 +26,11 @@ import PayList from './ui/digtal/PayList';
|
|
|
26
26
|
|
|
27
27
|
import ImportBuyerDrawer from './ui/default/ImportBuyerDrawer';
|
|
28
28
|
import ImportGoodsDrawer from './ui/default/ImportGoodsDrawer';
|
|
29
|
+
import ImportPassengerDrawer from './ui/default/ImportPassengerDrawer';
|
|
29
30
|
import EndowCodeDrawer from './ui/default/EndowCodeDrawer';
|
|
30
31
|
import AddComparisonDrawer from './ui/default/AddComparisonDrawer';
|
|
31
32
|
import MeiTanModal from './ui/default/MeiTanModal';
|
|
33
|
+
import PassengerList from './ui/digtal/PassengerList';
|
|
32
34
|
// import { create, all } from 'mathjs';
|
|
33
35
|
// const config = {
|
|
34
36
|
// number: 'BigNumber',
|
|
@@ -116,6 +118,8 @@ export default class Invoice extends React.PureComponent<IInvoiceProps> {
|
|
|
116
118
|
|
|
117
119
|
static readonly FreightList = FreightList;
|
|
118
120
|
|
|
121
|
+
static readonly PassengerList = PassengerList;
|
|
122
|
+
|
|
119
123
|
static readonly PayList = PayList;
|
|
120
124
|
|
|
121
125
|
/** 货物列表(数电) */
|
|
@@ -202,6 +206,7 @@ const Digtal = (props: IInvoiceProps) => {
|
|
|
202
206
|
</div>
|
|
203
207
|
|
|
204
208
|
<ImportGoodsDrawer />{ /** 导入货品的抽屉 */}
|
|
209
|
+
<ImportPassengerDrawer />{ /** 导入旅客运输的抽屉 */}
|
|
205
210
|
<EndowCodeDrawer />{ /** 给货品赋码的抽屉 */}
|
|
206
211
|
<MeiTanModal /> {/* 煤炭类弹框 */}
|
|
207
212
|
</InvoiceContext.Provider>
|