kts-component-invoice-operate 3.2.264 → 3.2.265
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/DifferenceInputModal/demo.d.ts +4 -0
- package/dist/DifferenceInputModal/index.d.ts +67 -0
- package/dist/Invoice/Invoice-digtal/_test/differenceInput/index.d.ts +4 -0
- package/dist/Invoice/InvoiceController/InvoiceControllerState/DifferenceInputState/index.d.ts +9 -0
- package/dist/Invoice/InvoiceController/InvoiceControllerState/index.d.ts +3 -0
- package/dist/Invoice/_test/differenceInput/index.d.ts +4 -0
- package/dist/Invoice/ui/digtal/DifferenceInput/index.d.ts +3 -0
- package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/ItemNameInput/index.d.ts +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.esm.js +892 -114
- package/dist/index.js +889 -110
- package/package.json +1 -1
- package/src/DifferenceInputModal/demo.tsx +22 -0
- package/src/DifferenceInputModal/index.less +102 -0
- package/src/DifferenceInputModal/index.md +5 -0
- package/src/DifferenceInputModal/index.tsx +450 -0
- package/src/Invoice/Invoice-digtal/_test/differenceInput/index.tsx +31 -0
- package/src/Invoice/Invoice-digtal/index.md +4 -1
- package/src/Invoice/InvoiceController/InvoiceControllerForm/index.ts +8 -2
- package/src/Invoice/InvoiceController/InvoiceControllerState/DifferenceInputState/index.ts +13 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/index.ts +4 -0
- package/src/Invoice/_test/differenceInput/index.tsx +25 -0
- package/src/Invoice/index.md +3 -0
- package/src/Invoice/index.tsx +18 -6
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/ItemNameInput/index.tsx +7 -2
- package/src/Invoice/ui/default/GoodsList/ui/AddRowButton/index.tsx +4 -0
- package/src/Invoice/ui/digtal/DifferenceInput/index.tsx +39 -0
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/ItemNameInput/index.tsx +15 -4
- package/src/Invoice/ui/digtal/GoodsList/ui/AddRowButton/index.tsx +7 -7
- package/src/TaxClassificationCodeModal/index.tsx +2 -0
- package/src/index.ts +3 -0
package/package.json
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button } from 'kts-xui';
|
|
3
|
+
import { DifferenceInputModal } from './index';
|
|
4
|
+
import 'kts-components-antd-x4/dist/kts-components-antd-x4.css';
|
|
5
|
+
|
|
6
|
+
export default () => {
|
|
7
|
+
const [open, setOpen] = React.useState(false);
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<div style={{ padding: 24 }}>
|
|
11
|
+
<Button type="primary" onClick={() => setOpen(true)}>
|
|
12
|
+
打开差额录入
|
|
13
|
+
</Button>
|
|
14
|
+
|
|
15
|
+
<DifferenceInputModal
|
|
16
|
+
open={open}
|
|
17
|
+
onCancel={() => setOpen(false)}
|
|
18
|
+
onOk={() => setOpen(false)}
|
|
19
|
+
/>
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
.kts-difference-modal {
|
|
2
|
+
color: rgba(0, 0, 0, 0.85);
|
|
3
|
+
font-size: 14px;
|
|
4
|
+
|
|
5
|
+
&-item {
|
|
6
|
+
flex: 1 1 240px;
|
|
7
|
+
min-width: 200px;
|
|
8
|
+
margin-right: 16px;
|
|
9
|
+
|
|
10
|
+
&:last-child {
|
|
11
|
+
margin-right: 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.ktsAntX-form-item-label > label {
|
|
15
|
+
color: rgba(0, 0, 0, 0.85);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&-mode {
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
margin: 4px 0 12px;
|
|
23
|
+
|
|
24
|
+
&-label {
|
|
25
|
+
margin-right: 12px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&-tip {
|
|
29
|
+
margin-left: 12px;
|
|
30
|
+
color: rgba(0, 0, 0, 0.45);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&-form {
|
|
35
|
+
.ktsAntX-form-item {
|
|
36
|
+
margin-bottom: 12px;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&-row {
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-wrap: wrap;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&-cell {
|
|
46
|
+
flex: 1 1 180px;
|
|
47
|
+
min-width: 160px;
|
|
48
|
+
margin-right: 16px;
|
|
49
|
+
|
|
50
|
+
&:last-child {
|
|
51
|
+
margin-right: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&-remark {
|
|
55
|
+
flex: 2 1 260px;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&-total {
|
|
60
|
+
display: flex;
|
|
61
|
+
justify-content: flex-end;
|
|
62
|
+
margin: 4px 0 8px;
|
|
63
|
+
|
|
64
|
+
&-item {
|
|
65
|
+
margin-left: 24px;
|
|
66
|
+
|
|
67
|
+
b {
|
|
68
|
+
font-weight: 600;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&-table {
|
|
74
|
+
/* kts-xui 全局表格样式(padding: 6px 20px; height: 50px; font-size: 12px)特异性更高,这里提高特异性覆盖。
|
|
75
|
+
内边距收窄到 10px,避免列宽较窄时表头文字折行(纳税人识别号等)。 */
|
|
76
|
+
.ktsAntX-table.ktsAntX-table-small > .ktsAntX-table-container > .ktsAntX-table-content > table > .ktsAntX-table-thead > tr > th {
|
|
77
|
+
padding: 0 10px;
|
|
78
|
+
height: 40px;
|
|
79
|
+
background: #fafafa;
|
|
80
|
+
color: rgba(0, 0, 0, 0.85);
|
|
81
|
+
font-size: 14px;
|
|
82
|
+
font-weight: 500;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.ktsAntX-table.ktsAntX-table-small > .ktsAntX-table-container > .ktsAntX-table-content > table > .ktsAntX-table-tbody > tr > td {
|
|
86
|
+
padding: 0 10px;
|
|
87
|
+
height: 32px;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** 底部按钮区:与 body 内容对齐(body 左右各 20px 内边距) */
|
|
93
|
+
.kts-difference-modal-footer {
|
|
94
|
+
display: flex;
|
|
95
|
+
justify-content: flex-end;
|
|
96
|
+
gap: 8px;
|
|
97
|
+
margin: 0 20px;
|
|
98
|
+
|
|
99
|
+
button {
|
|
100
|
+
margin-left: 0;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Modal, Form, Input, InputNumber, Select, Radio, Table, DatePicker, Space, Row, Col, Card } from 'kts-components-antd-x4';
|
|
3
|
+
import type { ColumnsType } from 'kts-components-antd-x4/es/table';
|
|
4
|
+
import { Button } from 'kts-xui';
|
|
5
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
6
|
+
import moment from 'moment';
|
|
7
|
+
import './index.less';
|
|
8
|
+
|
|
9
|
+
/** 合计行 */
|
|
10
|
+
export interface IDifferenceTotal {
|
|
11
|
+
/** 凭证合计金额总计 */
|
|
12
|
+
voucherTotal: number;
|
|
13
|
+
|
|
14
|
+
/** 本次扣除金额总计 */
|
|
15
|
+
deductTotal: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** 明细行 */
|
|
19
|
+
export interface IDifferenceRow {
|
|
20
|
+
|
|
21
|
+
/** 唯一标识 */
|
|
22
|
+
$index?: string;
|
|
23
|
+
|
|
24
|
+
/** 合计金额 */
|
|
25
|
+
voucherTotalAmt?: number;
|
|
26
|
+
|
|
27
|
+
/** 本次扣除金额 */
|
|
28
|
+
currentDeductAmt?: number;
|
|
29
|
+
|
|
30
|
+
/** 凭证类型 */
|
|
31
|
+
voucherType?: string;
|
|
32
|
+
|
|
33
|
+
/** 凭证号码 */
|
|
34
|
+
deductVoucherNo?: string;
|
|
35
|
+
|
|
36
|
+
/** 开具日期 */
|
|
37
|
+
issueDate?: string;
|
|
38
|
+
|
|
39
|
+
/** 备注 */
|
|
40
|
+
remark?: string;
|
|
41
|
+
|
|
42
|
+
/** 来源 */
|
|
43
|
+
source?: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface IData {
|
|
47
|
+
|
|
48
|
+
/** 申报项目代码 */
|
|
49
|
+
projectCode?: string;
|
|
50
|
+
|
|
51
|
+
/** 凭证合计金额总计 */
|
|
52
|
+
voucherTotal: number;
|
|
53
|
+
|
|
54
|
+
/** 本次扣除金额总计 */
|
|
55
|
+
deductTotal: number;
|
|
56
|
+
|
|
57
|
+
/** 明细数据 */
|
|
58
|
+
rows?: IDifferenceRow[];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface IDifferenceInputModalProps {
|
|
62
|
+
/** 是否可见 */
|
|
63
|
+
open?: boolean;
|
|
64
|
+
|
|
65
|
+
/** 合计 */
|
|
66
|
+
total?: IDifferenceTotal;
|
|
67
|
+
|
|
68
|
+
/** 点击取消 */
|
|
69
|
+
onCancel?: () => void;
|
|
70
|
+
|
|
71
|
+
value?: IData;
|
|
72
|
+
|
|
73
|
+
/** 点击确定 */
|
|
74
|
+
onOk?: (data: IData) => void;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** 数据来源枚举 */
|
|
78
|
+
export enum DataSrcEnum {
|
|
79
|
+
/** 手工录入 */
|
|
80
|
+
MANUAL = 1,
|
|
81
|
+
/** 勾选录入 */
|
|
82
|
+
CHECK = 2,
|
|
83
|
+
/** 模板录入 */
|
|
84
|
+
TEMPLATE = 3,
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export const dataSrcOptions = [
|
|
88
|
+
{ value: DataSrcEnum.MANUAL, label: '手工录入' },
|
|
89
|
+
{ value: DataSrcEnum.CHECK, label: '勾选录入' },
|
|
90
|
+
{ value: DataSrcEnum.TEMPLATE, label: '模板录入' },
|
|
91
|
+
];
|
|
92
|
+
|
|
93
|
+
/** 静态的表格列定义(表头按参考图,待确认) */
|
|
94
|
+
const columns: ColumnsType<IDifferenceRow> = [
|
|
95
|
+
{ title: '序号', dataIndex: 'sortNumber', key: 'sortNumber', width: 55, fixed: 'left', render: (text, record, index) => index + 1 },
|
|
96
|
+
{ title: '合计金额', dataIndex: 'voucherTotalAmt', key: 'voucherTotalAmt', width: 90, align: 'right', render: (text) => text ? text.toFixed(2) : '0.00' },
|
|
97
|
+
{ title: '扣除金额', dataIndex: 'currentDeductAmt', key: 'currentDeductAmt', width: 90, align: 'right', render: (text) => text ? text.toFixed(2) : '0.00' },
|
|
98
|
+
{ title: '凭证类型', dataIndex: 'voucherType', key: 'voucherType', width: 110, render: (text) => voucherTypeOptions.find((item) => item.value === text)?.label },
|
|
99
|
+
// { title: '数电票号码', dataIndex: 'xxx', key: 'xxx', width: 110 },
|
|
100
|
+
{ title: '凭证代码', dataIndex: 'deductVoucherCode', key: 'deductVoucherCode', width: 80 },
|
|
101
|
+
// { title: '发票号码', dataIndex: 'invoiceNumber', key: 'invoiceNumber', width: 80 },
|
|
102
|
+
{ title: '凭证号码', dataIndex: 'deductVoucherNo', key: 'deductVoucherNo', width: 80 },
|
|
103
|
+
{ title: '开具日期', dataIndex: 'issueDate', key: 'issueDate', width: 120, render: (text) => text ? moment(text).format('YYYY-MM-DD') : '' },
|
|
104
|
+
{ title: '备注', dataIndex: 'remark', key: 'remark', width: 80 },
|
|
105
|
+
{ title: '来源', dataIndex: 'dataSrc', key: 'dataSrc', width: 80, render: (text) => dataSrcOptions.find((item) => item.value === text)?.label },
|
|
106
|
+
];
|
|
107
|
+
|
|
108
|
+
/** 凭证类型候枚举 */
|
|
109
|
+
enum VoucherType {
|
|
110
|
+
/** 专用发票 */
|
|
111
|
+
SPECIAL_INVOICE = '10',
|
|
112
|
+
/** 普通发票 */
|
|
113
|
+
COMMON_INVOICE = '11',
|
|
114
|
+
/** 海关进口增值税专用缴款书 */
|
|
115
|
+
CUSTOMS_IMPORT_VAT_PAYMENT_BOOK = '12',
|
|
116
|
+
/** 航空运输电子客票行程单 */
|
|
117
|
+
AIR_TRANSPORT_ELECTRONIC_TICKET = '13',
|
|
118
|
+
/** 铁路电子客票 */
|
|
119
|
+
RAILWAY_ELECTRONIC_TICKET = '14',
|
|
120
|
+
/** 税收完税证明(契税) */
|
|
121
|
+
TAX_PAYMENT_CERTIFICATE = '15',
|
|
122
|
+
/** 中央非税收入统一票据(土地出让金) */
|
|
123
|
+
CENTRAL_NON_TAX_REVENUE_UNIFIED_RECEIPT = '16',
|
|
124
|
+
/** 财政票据 */
|
|
125
|
+
FINANCIAL_BILL = '05',
|
|
126
|
+
/** 法院裁决书 */
|
|
127
|
+
COURT_DECISION = '06',
|
|
128
|
+
/** 其他扣除凭证 */
|
|
129
|
+
OTHER_DEDUCTION_VOUCHER = '09',
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** 凭证类型候选项 */
|
|
133
|
+
const voucherTypeOptions = [
|
|
134
|
+
{ value: VoucherType.SPECIAL_INVOICE, label: '专用发票' },
|
|
135
|
+
{ value: VoucherType.COMMON_INVOICE, label: '普通发票' },
|
|
136
|
+
{ value: VoucherType.CUSTOMS_IMPORT_VAT_PAYMENT_BOOK, label: '海关进口增值税专用缴款书' },
|
|
137
|
+
{ value: VoucherType.AIR_TRANSPORT_ELECTRONIC_TICKET, label: '航空运输电子客票行程单' },
|
|
138
|
+
{ value: VoucherType.RAILWAY_ELECTRONIC_TICKET, label: '铁路电子客票' },
|
|
139
|
+
{ value: VoucherType.TAX_PAYMENT_CERTIFICATE, label: '税收完税证明(契税)' },
|
|
140
|
+
{ value: VoucherType.CENTRAL_NON_TAX_REVENUE_UNIFIED_RECEIPT, label: '中央非税收入统一票据(土地出让金)' },
|
|
141
|
+
{ value: VoucherType.FINANCIAL_BILL, label: '财政票据' },
|
|
142
|
+
{ value: VoucherType.COURT_DECISION, label: '法院裁决书' },
|
|
143
|
+
{ value: VoucherType.OTHER_DEDUCTION_VOUCHER, label: '其他扣除凭证' },
|
|
144
|
+
];
|
|
145
|
+
|
|
146
|
+
/** 凭证类型候 - 规则字典 */
|
|
147
|
+
const voucherTypeRules: Record<string, Record<string, { required: boolean }[]>> = {
|
|
148
|
+
// 专用发票
|
|
149
|
+
[VoucherType.SPECIAL_INVOICE]: {
|
|
150
|
+
'deductVoucherNo': [{ required: true }],
|
|
151
|
+
'issueDate': [{ required: true }],
|
|
152
|
+
'voucherTotalAmt': [{ required: true }],
|
|
153
|
+
'currentDeductAmt': [{ required: true }],
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
// 普通发票
|
|
157
|
+
[VoucherType.COMMON_INVOICE]: {
|
|
158
|
+
'deductVoucherNo': [{ required: true }],
|
|
159
|
+
'issueDate': [{ required: true }],
|
|
160
|
+
'voucherTotalAmt': [{ required: true }],
|
|
161
|
+
'currentDeductAmt': [{ required: true }],
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
// 海关进口增值税专用缴款书
|
|
165
|
+
[VoucherType.CUSTOMS_IMPORT_VAT_PAYMENT_BOOK]: {
|
|
166
|
+
'deductVoucherNo': [{ required: true }],
|
|
167
|
+
'issueDate': [{ required: true }],
|
|
168
|
+
'voucherTotalAmt': [{ required: true }],
|
|
169
|
+
'currentDeductAmt': [{ required: true }],
|
|
170
|
+
},
|
|
171
|
+
|
|
172
|
+
// 航空运输电子客票行程单
|
|
173
|
+
[VoucherType.AIR_TRANSPORT_ELECTRONIC_TICKET]: {
|
|
174
|
+
'deductVoucherNo': [{ required: true }],
|
|
175
|
+
'issueDate': [{ required: true }],
|
|
176
|
+
'voucherTotalAmt': [{ required: true }],
|
|
177
|
+
'currentDeductAmt': [{ required: true }],
|
|
178
|
+
},
|
|
179
|
+
|
|
180
|
+
// 铁路电子客票
|
|
181
|
+
[VoucherType.RAILWAY_ELECTRONIC_TICKET]: {
|
|
182
|
+
'deductVoucherNo': [{ required: true }],
|
|
183
|
+
'issueDate': [{ required: true }],
|
|
184
|
+
'voucherTotalAmt': [{ required: true }],
|
|
185
|
+
'currentDeductAmt': [{ required: true }],
|
|
186
|
+
},
|
|
187
|
+
|
|
188
|
+
// 税收完税证明(契税)
|
|
189
|
+
[VoucherType.TAX_PAYMENT_CERTIFICATE]: {
|
|
190
|
+
'deductVoucherNo': [{ required: true }],
|
|
191
|
+
'voucherTotalAmt': [{ required: true }],
|
|
192
|
+
'currentDeductAmt': [{ required: true }],
|
|
193
|
+
},
|
|
194
|
+
|
|
195
|
+
// 中央非税收入统一票据(土地出让金)
|
|
196
|
+
[VoucherType.CENTRAL_NON_TAX_REVENUE_UNIFIED_RECEIPT]: {
|
|
197
|
+
'deductVoucherCode': [{ required: true }],
|
|
198
|
+
'deductVoucherNo': [{ required: true }],
|
|
199
|
+
'voucherTotalAmt': [{ required: true }],
|
|
200
|
+
'currentDeductAmt': [{ required: true }],
|
|
201
|
+
},
|
|
202
|
+
|
|
203
|
+
// 财政票据
|
|
204
|
+
[VoucherType.FINANCIAL_BILL]: {
|
|
205
|
+
'deductVoucherNo': [{ required: true }],
|
|
206
|
+
'voucherTotalAmt': [{ required: true }],
|
|
207
|
+
'currentDeductAmt': [{ required: true }],
|
|
208
|
+
},
|
|
209
|
+
|
|
210
|
+
// 法院裁决书
|
|
211
|
+
[VoucherType.COURT_DECISION]: {
|
|
212
|
+
'deductVoucherNo': [{ required: true }],
|
|
213
|
+
'voucherTotalAmt': [{ required: true }],
|
|
214
|
+
'currentDeductAmt': [{ required: true }],
|
|
215
|
+
},
|
|
216
|
+
|
|
217
|
+
// 其他扣除凭证
|
|
218
|
+
[VoucherType.OTHER_DEDUCTION_VOUCHER]: {
|
|
219
|
+
'voucherTotalAmt': [{ required: true }],
|
|
220
|
+
'currentDeductAmt': [{ required: true }],
|
|
221
|
+
'remark': [{ required: true }],
|
|
222
|
+
},
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
/** 静态的申报项目名称候选项 */
|
|
227
|
+
const projectOptions = [
|
|
228
|
+
{ value: 'KC0209', label: '小规模纳税人销售其取得(不含自建)的不动产(不含个人销售购买的住房)' },
|
|
229
|
+
{ value: 'KC0210', label: '一般纳税人销售其取得(不含自建)的2016年4月30日前取得的不动产' },
|
|
230
|
+
{ value: 'KC0211', label: '房地产开发企业销售房地产项目' },
|
|
231
|
+
{ value: 'KC0212', label: '银行业金融机构、金融资产管理公司中的增值税一般纳税人处置抵债不动产' },
|
|
232
|
+
];
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* 差额录入弹窗(静态)
|
|
236
|
+
*/
|
|
237
|
+
export function DifferenceInputModal(props: IDifferenceInputModalProps) {
|
|
238
|
+
const { open = true, onCancel, onOk } = props;
|
|
239
|
+
const [form] = Form.useForm();
|
|
240
|
+
const [dataSource, setDataSource] = React.useState<IDifferenceRow[]>([]);
|
|
241
|
+
const voucherType: VoucherType = Form.useWatch('voucherType', form) || form.getFieldValue('voucherType');
|
|
242
|
+
const [projectCode, setProjectCode] = React.useState<string>('');
|
|
243
|
+
|
|
244
|
+
/** 扣除额 (明细汇总) */
|
|
245
|
+
const deductTotal = React.useMemo(() => {
|
|
246
|
+
return dataSource.reduce((acc, curr) => acc + (curr.currentDeductAmt || 0), 0);
|
|
247
|
+
}, [dataSource]);
|
|
248
|
+
|
|
249
|
+
/** 合计金额(明细汇总) */
|
|
250
|
+
const voucherTotal = React.useMemo(() => {
|
|
251
|
+
return dataSource.reduce((acc, curr) => acc + (curr.voucherTotalAmt || 0), 0);
|
|
252
|
+
}, [dataSource]);
|
|
253
|
+
|
|
254
|
+
const total = props.total || { voucherTotal: 0, deductTotal: 0 };
|
|
255
|
+
|
|
256
|
+
const onFinish = React.useCallback((values: any) => {
|
|
257
|
+
setDataSource([...dataSource, { ...values, $index: uuidv4(), dataSrc: DataSrcEnum.MANUAL }]);
|
|
258
|
+
form.resetFields();
|
|
259
|
+
}, [dataSource, form]);
|
|
260
|
+
|
|
261
|
+
React.useEffect(() => {
|
|
262
|
+
console.log('DifferenceInputModal props.value ===>', props.value)
|
|
263
|
+
if (open) {
|
|
264
|
+
form.resetFields();
|
|
265
|
+
setDataSource(props.value?.rows || []);
|
|
266
|
+
setProjectCode(props.value?.projectCode || '');
|
|
267
|
+
}
|
|
268
|
+
}, [open, props.value]);
|
|
269
|
+
|
|
270
|
+
return (
|
|
271
|
+
<Modal
|
|
272
|
+
title="差额录入"
|
|
273
|
+
destroyOnClose={true}
|
|
274
|
+
width={1000}
|
|
275
|
+
open={open}
|
|
276
|
+
onCancel={onCancel}
|
|
277
|
+
footer={
|
|
278
|
+
<Space align="end" className="kts-difference-modal-footer">
|
|
279
|
+
<Button onClick={onCancel}>取消</Button>
|
|
280
|
+
<Button type="primary" onClick={() => onOk?.({ voucherTotal, deductTotal, rows: dataSource, projectCode })}>
|
|
281
|
+
确定
|
|
282
|
+
</Button>
|
|
283
|
+
</Space>
|
|
284
|
+
}
|
|
285
|
+
>
|
|
286
|
+
<div className="kts-difference-modal">
|
|
287
|
+
{/* 顶部:含税销售额、扣除额、申报项目名称 */}
|
|
288
|
+
<div className="kts-difference-modal-top">
|
|
289
|
+
<Form layout='horizontal' className="kts-difference-modal-top-form" labelCol={{ flex: '100px' }}>
|
|
290
|
+
<Row>
|
|
291
|
+
<Col span={12} >
|
|
292
|
+
<Form.Item label="含税销售额" className="kts-difference-modal-item">
|
|
293
|
+
<InputNumber style={{ width: '100%' }} disabled placeholder="请输入含税销售额" value={voucherTotal || 0} />
|
|
294
|
+
</Form.Item>
|
|
295
|
+
</Col>
|
|
296
|
+
|
|
297
|
+
<Col span={12} >
|
|
298
|
+
<Form.Item label="扣除额" className="kts-difference-modal-item">
|
|
299
|
+
<InputNumber style={{ width: '100%' }} disabled placeholder="请输入扣除额" value={deductTotal || 0} />
|
|
300
|
+
</Form.Item>
|
|
301
|
+
</Col>
|
|
302
|
+
|
|
303
|
+
<Col span={24} >
|
|
304
|
+
<Form.Item label="申报项目名称" className="kts-difference-modal-item">
|
|
305
|
+
<Select options={projectOptions} placeholder="请选择申报项目名称"
|
|
306
|
+
onChange={(value) => { setProjectCode(value) }}
|
|
307
|
+
value={projectCode}
|
|
308
|
+
/>
|
|
309
|
+
</Form.Item>
|
|
310
|
+
</Col>
|
|
311
|
+
|
|
312
|
+
<Col span={24} >
|
|
313
|
+
<Form.Item label="录入方式" className="kts-difference-modal-item">
|
|
314
|
+
<Radio.Group
|
|
315
|
+
value={'manual'}
|
|
316
|
+
optionType='button'
|
|
317
|
+
options={[
|
|
318
|
+
{ label: '手工录入', value: 'manual' },
|
|
319
|
+
{ label: '勾选录入', value: '1', disabled: true },
|
|
320
|
+
{ label: '模板录入', value: '2', disabled: true },
|
|
321
|
+
]}
|
|
322
|
+
/>
|
|
323
|
+
</Form.Item>
|
|
324
|
+
</Col>
|
|
325
|
+
</Row>
|
|
326
|
+
</Form>
|
|
327
|
+
</div>
|
|
328
|
+
|
|
329
|
+
{/* 凭证明细录入 */}
|
|
330
|
+
<Card className="kts-difference-modal-form" bodyStyle={{ padding: '20px 20px 10px 0' }} >
|
|
331
|
+
<Form form={form} layout="horizontal" labelCol={{ flex: '110px' }} onFinish={onFinish}>
|
|
332
|
+
<Row className="kts-difference-modal-row">
|
|
333
|
+
<Col span={24 / 3} >
|
|
334
|
+
<Form.Item name='voucherType' label="凭证类型" className="kts-difference-modal-cell" rules={[{ required: true, message: '请选择凭证类型' }]}>
|
|
335
|
+
<Select options={voucherTypeOptions} placeholder="请选择凭证类型" />
|
|
336
|
+
</Form.Item>
|
|
337
|
+
</Col>
|
|
338
|
+
|
|
339
|
+
{/* <Col span={24 / 3} >
|
|
340
|
+
<Form.Item name='' label="数电票号码" className="kts-difference-modal-cell" >
|
|
341
|
+
<Input placeholder="请输入数电票号码" />
|
|
342
|
+
</Form.Item>
|
|
343
|
+
</Col> */}
|
|
344
|
+
|
|
345
|
+
<Col span={24 / 3} >
|
|
346
|
+
<Form.Item name='issueDate' label="开具时间" className="kts-difference-modal-cell"
|
|
347
|
+
rules={voucherTypeRules[voucherType]?.['issueDate']}
|
|
348
|
+
>
|
|
349
|
+
<DatePicker style={{ width: '100%' }} placeholder="请输入开具时间" />
|
|
350
|
+
</Form.Item>
|
|
351
|
+
</Col>
|
|
352
|
+
|
|
353
|
+
<Col span={24 / 3} >
|
|
354
|
+
<Form.Item name='deductVoucherNo' label="凭证号码" className="kts-difference-modal-cell"
|
|
355
|
+
rules={voucherTypeRules[voucherType]?.['deductVoucherNo']}
|
|
356
|
+
>
|
|
357
|
+
<Input placeholder="请输入凭证号码" />
|
|
358
|
+
</Form.Item>
|
|
359
|
+
</Col>
|
|
360
|
+
|
|
361
|
+
<Col span={24 / 3} >
|
|
362
|
+
<Form.Item name='deductVoucherCode' label="凭证代码" className="kts-difference-modal-cell"
|
|
363
|
+
rules={voucherTypeRules[voucherType]?.['deductVoucherCode']}
|
|
364
|
+
>
|
|
365
|
+
<Input placeholder="请输入凭证代码" />
|
|
366
|
+
</Form.Item>
|
|
367
|
+
</Col>
|
|
368
|
+
|
|
369
|
+
{/* <Col span={24 / 3} >
|
|
370
|
+
<Form.Item name='invoiceNumber' label="发票号码" className="kts-difference-modal-cell"
|
|
371
|
+
rules={voucherTypeRules[voucherType]?.['invoiceNumber']}
|
|
372
|
+
>
|
|
373
|
+
<Input placeholder="请输入发票号码" />
|
|
374
|
+
</Form.Item>
|
|
375
|
+
</Col> */}
|
|
376
|
+
|
|
377
|
+
<Col span={24 / 3} >
|
|
378
|
+
<Form.Item name='voucherTotalAmt' label="凭证合计金额" className="kts-difference-modal-cell"
|
|
379
|
+
rules={voucherTypeRules[voucherType]?.['voucherTotalAmt']}
|
|
380
|
+
>
|
|
381
|
+
<InputNumber style={{ width: '100%' }} placeholder="请输入凭证合计金额" />
|
|
382
|
+
</Form.Item>
|
|
383
|
+
</Col>
|
|
384
|
+
|
|
385
|
+
<Col span={24 / 3} >
|
|
386
|
+
<Form.Item name='currentDeductAmt' label="本次扣除金额" className="kts-difference-modal-cell"
|
|
387
|
+
rules={voucherTypeRules[voucherType]?.['currentDeductAmt']}
|
|
388
|
+
>
|
|
389
|
+
<InputNumber style={{ width: '100%' }} placeholder="请输入本次扣除金额" />
|
|
390
|
+
</Form.Item>
|
|
391
|
+
</Col>
|
|
392
|
+
|
|
393
|
+
<Col span={24 / 3} >
|
|
394
|
+
<Form.Item name='remark' label="备注" className="kts-difference-modal-cell"
|
|
395
|
+
rules={voucherTypeRules[voucherType]?.['remark']}
|
|
396
|
+
>
|
|
397
|
+
<Input placeholder="请输入备注" />
|
|
398
|
+
</Form.Item>
|
|
399
|
+
</Col>
|
|
400
|
+
|
|
401
|
+
<Col span={24} >
|
|
402
|
+
<div style={{ display: 'flex', justifyContent: 'center', gap: 10 }} >
|
|
403
|
+
<Button type='primary' size='small' onClick={() => form.resetFields()}>清楚</Button>
|
|
404
|
+
<Button type='primary' size='small' onClick={() => form.submit()}>添加并继续</Button>
|
|
405
|
+
</div>
|
|
406
|
+
</Col>
|
|
407
|
+
</Row>
|
|
408
|
+
</Form>
|
|
409
|
+
</Card >
|
|
410
|
+
|
|
411
|
+
{/* 合计 */}
|
|
412
|
+
<div className="kts-difference-modal-total" style={{ marginTop: 30 }}>
|
|
413
|
+
<span className="kts-difference-modal-total-item">
|
|
414
|
+
凭证合计金额总计:<b>{total.voucherTotal.toFixed(2)}</b> 元
|
|
415
|
+
</span>
|
|
416
|
+
<span className="kts-difference-modal-total-item">
|
|
417
|
+
本次扣除金额总计:<b>{total.deductTotal.toFixed(2)}</b> 元
|
|
418
|
+
</span>
|
|
419
|
+
</div>
|
|
420
|
+
|
|
421
|
+
{/* 明细列表 */}
|
|
422
|
+
<Table
|
|
423
|
+
className="kts-difference-modal-table"
|
|
424
|
+
bordered
|
|
425
|
+
size="small"
|
|
426
|
+
rowKey="voucherNo"
|
|
427
|
+
columns={[...columns, {
|
|
428
|
+
title: '操作',
|
|
429
|
+
dataIndex: 'action',
|
|
430
|
+
key: 'action',
|
|
431
|
+
width: 80,
|
|
432
|
+
fixed: 'right',
|
|
433
|
+
render: (text, record) => <Button type='link' size='small' onClick={() => setDataSource(dataSource.filter((item) => item.$index !== record.$index))}>删除</Button>,
|
|
434
|
+
}]}
|
|
435
|
+
dataSource={dataSource}
|
|
436
|
+
scroll={{ x: 1000 }}
|
|
437
|
+
pagination={{
|
|
438
|
+
pageSize: 10,
|
|
439
|
+
total: dataSource.length,
|
|
440
|
+
showSizeChanger: false,
|
|
441
|
+
showQuickJumper: false,
|
|
442
|
+
showTotal: (total) => `共 ${total} 条`,
|
|
443
|
+
}}
|
|
444
|
+
/>
|
|
445
|
+
</div>
|
|
446
|
+
</Modal>
|
|
447
|
+
);
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
export default DifferenceInputModal;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Invoice from '../../..';
|
|
3
|
+
import 'antd/dist/antd.css';
|
|
4
|
+
import { Button } from 'kts-components-antd-x4';
|
|
5
|
+
|
|
6
|
+
export default () => {
|
|
7
|
+
|
|
8
|
+
const controller = React.useMemo(() => new Invoice.InvoiceController(), []);
|
|
9
|
+
const enabled = controller.useMemo((s) => s.differenceInputState.enabled, []);
|
|
10
|
+
const [loading, setLoading] = React.useState(false);
|
|
11
|
+
|
|
12
|
+
React.useEffect(() => {
|
|
13
|
+
controller.run(async s => {
|
|
14
|
+
|
|
15
|
+
})
|
|
16
|
+
}, [controller])
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div>
|
|
20
|
+
<Button loading={loading} onClick={ async () => {
|
|
21
|
+
setLoading(true);
|
|
22
|
+
await controller.pipeline(async (s) => {
|
|
23
|
+
s.differenceInputState.enabled = !s.differenceInputState.enabled;
|
|
24
|
+
})();
|
|
25
|
+
setLoading(false);
|
|
26
|
+
}}>{enabled ? '关闭差额开票' : '开启差额开票'}</Button>
|
|
27
|
+
|
|
28
|
+
<Invoice invoiceType='digtal' controller={controller} />
|
|
29
|
+
</div>
|
|
30
|
+
)
|
|
31
|
+
};
|
|
@@ -45,8 +45,14 @@ export default class InvoiceControllerForm extends GreyReactBox<InvoiceControlle
|
|
|
45
45
|
_errors.set('goodsList', error.errors);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
|
|
49
|
-
_values.set('goodsList', this.state.goodsListState.goodsList.slice()
|
|
48
|
+
|
|
49
|
+
_values.set('goodsList', this.state.goodsListState.goodsList.slice().map(e => {
|
|
50
|
+
return {
|
|
51
|
+
...e,
|
|
52
|
+
deductAmount: this.state?.differenceInputState?.data?.deductTotal || 0
|
|
53
|
+
}
|
|
54
|
+
}));
|
|
55
|
+
|
|
50
56
|
//货物运输列表
|
|
51
57
|
if (this.state.freightListState.form) {
|
|
52
58
|
try {
|
|
@@ -7,6 +7,7 @@ import { IInvoiceTypeModalProps } from '../../../InvoiceTypeModal';
|
|
|
7
7
|
import { TaxClassificationProps } from '../../../TaxClassificationCodeModal';
|
|
8
8
|
import AutoComplete from './AutoComplete';
|
|
9
9
|
import PassengerListState from './PassengerListState';
|
|
10
|
+
import DifferenceInputState from './DifferenceInputState';
|
|
10
11
|
|
|
11
12
|
export default class InvoiceControllerState {
|
|
12
13
|
|
|
@@ -78,5 +79,8 @@ export default class InvoiceControllerState {
|
|
|
78
79
|
*/
|
|
79
80
|
passengerListState = new PassengerListState();
|
|
80
81
|
|
|
82
|
+
/** 差额开票 */
|
|
83
|
+
differenceInputState = new DifferenceInputState();
|
|
84
|
+
|
|
81
85
|
addGoodsCheck?: any;
|
|
82
86
|
}
|