kts-component-invoice-operate 3.2.221 → 3.2.223
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/InvoiceController/InvoiceControllerState/GoodsListState/IGood/index.d.ts +1 -0
- package/dist/index.esm.js +334 -37
- package/dist/index.js +334 -37
- package/package.json +1 -1
- package/src/Invoice/Invoice-digtal/_test/realEstateInfo/index.tsx +47 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood/index.ts +2 -0
- package/src/Invoice/InvoiceController/fns/saveEditGood.ts +2 -2
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/index.tsx +18 -13
- package/src/Invoice/ui/digtal/GoodsList/ui/TableVirtual/index.tsx +11 -6
- package/src/Invoice/ui/digtal/RealEstateInfo/index.tsx +239 -36
- package/src/Invoice/ui/digtal/StakeFarmerholder/index.tsx +29 -15
- package/src/Invoice/ui/digtal/Stakeholder/index.tsx +22 -4
|
@@ -4,10 +4,10 @@ import { InvoiceControllerState } from '../';
|
|
|
4
4
|
* 保存正在编辑的货物
|
|
5
5
|
*/
|
|
6
6
|
export default async (state: InvoiceControllerState) => {
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
const editGood = state.goodsListState.editGood;
|
|
9
9
|
const form = state.goodsListState.form;
|
|
10
|
-
|
|
10
|
+
// const isValidateGood = state.goodsListState.isValidateGood
|
|
11
11
|
if (!editGood || !form || state.goodsListState.importGoods.isVisibleDrawer || state.calculatingField) return;
|
|
12
12
|
if ((await validateFields(form)).err) return;
|
|
13
13
|
|
|
@@ -257,11 +257,16 @@ export default (form: WrappedFormUtils) => {
|
|
|
257
257
|
{ pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '数量必须为数字' },
|
|
258
258
|
{
|
|
259
259
|
validator: async (_, value, callback) => {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
260
|
+
|
|
261
|
+
if (isValidateGood) {
|
|
262
|
+
await controller.wait();
|
|
263
|
+
const isvalue = !!value || value === 0;
|
|
264
|
+
const isPrice = !!getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') || getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') === 0;
|
|
265
|
+
if (isvalue || isPrice === isvalue) return;
|
|
266
|
+
callback('请输入数量');
|
|
267
|
+
} else {
|
|
268
|
+
callback();
|
|
269
|
+
}
|
|
265
270
|
}
|
|
266
271
|
}
|
|
267
272
|
],
|
|
@@ -416,7 +421,7 @@ export default (form: WrappedFormUtils) => {
|
|
|
416
421
|
</Form.Item>
|
|
417
422
|
);
|
|
418
423
|
} else {
|
|
419
|
-
return <span style={{ padding: '0 10px' }}>{formatSearch(parseFloat(value).toFixed(2), searchValue)}</span>;
|
|
424
|
+
return <span style={{ padding: '0 10px' }}>{value && formatSearch(parseFloat(value).toFixed(2), searchValue)}</span>;
|
|
420
425
|
}
|
|
421
426
|
},
|
|
422
427
|
},
|
|
@@ -458,7 +463,7 @@ export default (form: WrappedFormUtils) => {
|
|
|
458
463
|
</Form.Item>
|
|
459
464
|
);
|
|
460
465
|
} else {
|
|
461
|
-
return <span style={{ padding: '0 10px' }}>{formatSearch(parseFloat(value).toFixed(2), searchValue)}</span>;
|
|
466
|
+
return <span style={{ padding: '0 10px' }}>{value && formatSearch(parseFloat(value).toFixed(2), searchValue)}</span>;
|
|
462
467
|
}
|
|
463
468
|
},
|
|
464
469
|
},
|
|
@@ -503,7 +508,7 @@ export default (form: WrappedFormUtils) => {
|
|
|
503
508
|
</Form.Item>
|
|
504
509
|
);
|
|
505
510
|
} else {
|
|
506
|
-
if (value || value === '0') {
|
|
511
|
+
if (value || value === '0' || value === 0) {
|
|
507
512
|
return <span style={{ padding: '0 10px' }}>{isDutyFree(record) ? '免税' : `${value}%`}</span>;
|
|
508
513
|
} else {
|
|
509
514
|
return ''
|
|
@@ -518,7 +523,7 @@ export default (form: WrappedFormUtils) => {
|
|
|
518
523
|
align: 'right',
|
|
519
524
|
width: 119,
|
|
520
525
|
render: (value: string, record: IGood) => {
|
|
521
|
-
if (editGood?.$index === record.$index && !disableds.includes('taxAmount')&& model !== 'prefab') {
|
|
526
|
+
if (editGood?.$index === record.$index && !disableds.includes('taxAmount') && model !== 'prefab') {
|
|
522
527
|
return (
|
|
523
528
|
<Form.Item>
|
|
524
529
|
{getFieldDecorator('taxAmount', {
|
|
@@ -532,13 +537,13 @@ export default (form: WrappedFormUtils) => {
|
|
|
532
537
|
const lineAmountIncludeTax = editGood?.lineAmountIncludeTax || 0;
|
|
533
538
|
//不含税金额
|
|
534
539
|
// const lineAmountExcludeTax = lineAmountIncludeTax-value;
|
|
535
|
-
const lineAmountExcludeTax = chain(bignumber(lineAmountIncludeTax||0)).subtract(bignumber(value||0));
|
|
540
|
+
const lineAmountExcludeTax = chain(bignumber(lineAmountIncludeTax || 0)).subtract(bignumber(value || 0));
|
|
536
541
|
const taxRate = editGood?.taxRate;
|
|
537
542
|
if (lineAmountExcludeTax && taxRate && lineAmountIncludeTax) {
|
|
538
543
|
// const total = bignumber(lineAmountExcludeTax * taxRate / 100);
|
|
539
|
-
const total = lineAmountExcludeTax.multiply(bignumber(taxRate||0)).divide(bignumber(100));
|
|
544
|
+
const total = lineAmountExcludeTax.multiply(bignumber(taxRate || 0)).divide(bignumber(100));
|
|
540
545
|
// if (Number(Math.abs(Number(total) - Number(value)).toFixed(4)) <= 0.01) {
|
|
541
|
-
if (Math.abs(total.subtract(bignumber(value||0)).done().toNumber()) <= 0.01) {
|
|
546
|
+
if (Math.abs(total.subtract(bignumber(value || 0)).done().toNumber()) <= 0.01) {
|
|
542
547
|
callback();
|
|
543
548
|
} else {
|
|
544
549
|
callback('税额填写错误,请重新输入')
|
|
@@ -568,7 +573,7 @@ export default (form: WrappedFormUtils) => {
|
|
|
568
573
|
</Form.Item>
|
|
569
574
|
)
|
|
570
575
|
} else {
|
|
571
|
-
return <span style={{ padding: '0 10px' }}>{isDutyFree(record) ? '***' : parseFloat(value).toFixed(2)}</span>;
|
|
576
|
+
return <span style={{ padding: '0 10px' }}>{isDutyFree(record) ? '***' : value && parseFloat(value).toFixed(2)}</span>;
|
|
572
577
|
}
|
|
573
578
|
},
|
|
574
579
|
},
|
|
@@ -40,8 +40,9 @@ export default function <T extends object = any>(props: TableProps<T>) {
|
|
|
40
40
|
|
|
41
41
|
// 设置占位dom的搞
|
|
42
42
|
const placeholderHeight = React.useMemo(() => {
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
const { dataSource = [] } = props
|
|
44
|
+
if (!self || !rowHeight || !dataSource || !placeholder) return;
|
|
45
|
+
const placeholderHeight = rowHeight * dataSource.length;
|
|
45
46
|
placeholder.style.height = `${placeholderHeight}px`;
|
|
46
47
|
return placeholderHeight;
|
|
47
48
|
}, [self, rowHeight, props.dataSource, placeholder]);
|
|
@@ -80,19 +81,23 @@ export default function <T extends object = any>(props: TableProps<T>) {
|
|
|
80
81
|
|
|
81
82
|
// 移动列表
|
|
82
83
|
React.useEffect(() => {
|
|
83
|
-
if (!self) return
|
|
84
|
+
if (!self) return
|
|
84
85
|
|
|
85
86
|
const table = self.querySelector('.ktsAntX-table .ktsAntX-table-body>table') as HTMLDivElement;
|
|
87
|
+
|
|
86
88
|
if (!table) return;
|
|
89
|
+
if ((props.dataSource?.length || 0) < 10) {
|
|
90
|
+
table.style.top = '0px';
|
|
91
|
+
} else {
|
|
92
|
+
table.style.top = `${pointer * rowHeight}px`;
|
|
93
|
+
}
|
|
87
94
|
|
|
88
|
-
|
|
89
|
-
}, [pointer, self, rowHeight]);
|
|
95
|
+
}, [pointer, self, rowHeight, props.dataSource?.length]);
|
|
90
96
|
|
|
91
97
|
React.useEffect(() => {
|
|
92
98
|
if (!self) return;
|
|
93
99
|
const cont = self.querySelector('.kts-invoice-operate-goods-table-virtual .ktsAntX-table-body');
|
|
94
100
|
if (!cont) return;
|
|
95
|
-
|
|
96
101
|
cont.scrollTop = 0;
|
|
97
102
|
}, [props.dataSource?.length])
|
|
98
103
|
|
|
@@ -5,7 +5,7 @@ import { Form } from 'kts-components-antd-x3';
|
|
|
5
5
|
import { FormComponentProps } from 'kts-components-antd-x3/lib/form';
|
|
6
6
|
import Invoice from '../../..';
|
|
7
7
|
import './index.less';
|
|
8
|
-
import { Cascader, Col, DatePicker, Input, Row, Select } from "kts-components-antd-x4";
|
|
8
|
+
import { Button, Cascader, Col, DatePicker, Input, Row, Select } from "kts-components-antd-x4";
|
|
9
9
|
import moment from "moment";
|
|
10
10
|
|
|
11
11
|
const { RangePicker } = DatePicker;
|
|
@@ -37,10 +37,24 @@ export default decorator<RealEstateInfoProps, FormComponentProps & RealEstateInf
|
|
|
37
37
|
const readOnly = React.useMemo(() => model === 'readOnly', [model]);
|
|
38
38
|
|
|
39
39
|
const goodsList = controller.useMemo(s => s.goodsListState.goodsList, []);
|
|
40
|
+
//outcome-104 任务 https://wiki.dev.kingxunlian.com/pages/viewpage.action?pageId=180355189
|
|
41
|
+
//商品和服务税收分类合并编码为“3040502020200000000”时,视为停车费业务,针对停车费业务,蓝字发票增加以下判断:
|
|
42
|
+
// 单位必须为“平方米”;
|
|
43
|
+
// 项目名称必须为“车辆停放服务”;
|
|
44
|
+
// 车牌号必填,最多支持填写3个车牌号;除该场景车牌号必须为空;
|
|
45
|
+
// 租赁期起止格式必须为“yyyy-MM-dd HH:mm(租赁期起)”+“空格”+“yyyy-MM-dd HH:mm(租赁期止)。
|
|
46
|
+
const isParkFee = React.useCallback((taxClassificationCode?: string) => {
|
|
47
|
+
if (taxClassificationCode === '3040502020200000000') {
|
|
48
|
+
return false
|
|
49
|
+
} else {
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
}, [])
|
|
53
|
+
|
|
40
54
|
const indexRef = React.useRef<any>([]);
|
|
41
55
|
useEffect(() => {
|
|
42
56
|
const dd = goodsList?.reduce((acc: any, cur: any) => {
|
|
43
|
-
if (cur.lineAttribute !==1) {
|
|
57
|
+
if (cur.lineAttribute !== 1) {
|
|
44
58
|
acc.push(cur.$index)
|
|
45
59
|
}
|
|
46
60
|
return acc
|
|
@@ -48,7 +62,7 @@ export default decorator<RealEstateInfoProps, FormComponentProps & RealEstateInf
|
|
|
48
62
|
indexRef.current = dd;
|
|
49
63
|
}, [goodsList, indexRef])
|
|
50
64
|
// 注册 form
|
|
51
|
-
|
|
65
|
+
|
|
52
66
|
controller.useForm('realEstateInfo', form);
|
|
53
67
|
const getList = () => {
|
|
54
68
|
const decrease = indexRef.current.length > goodsList.length
|
|
@@ -70,9 +84,9 @@ export default decorator<RealEstateInfoProps, FormComponentProps & RealEstateInf
|
|
|
70
84
|
});
|
|
71
85
|
}
|
|
72
86
|
}
|
|
73
|
-
|
|
74
|
-
return goodsList.filter(item=>item.lineAttribute !== 1).map((item, index) => {
|
|
87
|
+
return goodsList.filter(item => item.lineAttribute !== 1).map((item, index) => {
|
|
75
88
|
if (item.lineAttribute !== 1) {
|
|
89
|
+
const isParkFeeItem = isParkFee(item.taxClassificationCode)
|
|
76
90
|
return <Row gutter={[17, 0]} >
|
|
77
91
|
<Col span={6} >
|
|
78
92
|
<Form.Item style={{ display: 'none' }}>
|
|
@@ -121,17 +135,31 @@ export default decorator<RealEstateInfoProps, FormComponentProps & RealEstateInf
|
|
|
121
135
|
)}
|
|
122
136
|
</Form.Item>
|
|
123
137
|
</Col>
|
|
124
|
-
|
|
125
|
-
<
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
138
|
+
{!isParkFeeItem &&
|
|
139
|
+
<Col span={6} >
|
|
140
|
+
<Form.Item label='租赁期起止' >
|
|
141
|
+
{getFieldDecorator(`realEstateDataDto[${index}].leaseTerm`, {
|
|
142
|
+
rules: readOnly ? [] : [{ required: true, message: '请输入租赁期' }]
|
|
143
|
+
})(
|
|
144
|
+
readOnly
|
|
145
|
+
? <MyArrMoment />
|
|
146
|
+
: <RangePicker style={{ width: '100%' }} />
|
|
147
|
+
)}
|
|
148
|
+
</Form.Item>
|
|
149
|
+
</Col>}
|
|
150
|
+
{isParkFeeItem &&
|
|
151
|
+
<Col span={6} >
|
|
152
|
+
<Form.Item label='租赁期起止' >
|
|
153
|
+
{getFieldDecorator(`realEstateDataDto[${index}].leaseTerm`, {
|
|
154
|
+
rules: readOnly ? [] : [{ required: true, message: '请输入租赁期' }]
|
|
155
|
+
})(
|
|
156
|
+
readOnly
|
|
157
|
+
? <MyArrMomentTime />
|
|
158
|
+
: <RangePicker style={{ width: '100%' }} showTime={{ format: 'HH:mm' }} format="YYYY-MM-DD HH:mm" />
|
|
159
|
+
)}
|
|
160
|
+
</Form.Item>
|
|
161
|
+
</Col>
|
|
162
|
+
}
|
|
135
163
|
<Col span={6} >
|
|
136
164
|
<Form.Item label='跨地(市)标志' >
|
|
137
165
|
{getFieldDecorator(`realEstateDataDto[${index}].crossCitiesSign`, {
|
|
@@ -162,25 +190,56 @@ export default decorator<RealEstateInfoProps, FormComponentProps & RealEstateInf
|
|
|
162
190
|
)}
|
|
163
191
|
</Form.Item>
|
|
164
192
|
</Col>
|
|
165
|
-
|
|
166
|
-
<
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
<Select
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
193
|
+
{!isParkFeeItem &&
|
|
194
|
+
<Col span={6} >
|
|
195
|
+
<Form.Item label='面积单位' >
|
|
196
|
+
{getFieldDecorator(`realEstateDataDto[${index}].realEstateUnit`, {
|
|
197
|
+
rules: readOnly ? [] : [{ required: true, message: '请选择面积单位' }]
|
|
198
|
+
})(
|
|
199
|
+
readOnly
|
|
200
|
+
? <MyDiv />
|
|
201
|
+
: <Select placeholder='请选择' style={{ width: '100%' }} >
|
|
202
|
+
<Select.Option value="平方千米">平方千米</Select.Option>
|
|
203
|
+
<Select.Option value="平方米">平方米</Select.Option>
|
|
204
|
+
<Select.Option value="公顷">公顷</Select.Option>
|
|
205
|
+
<Select.Option value="亩">亩</Select.Option>
|
|
206
|
+
<Select.Option value="h㎡">h㎡</Select.Option>
|
|
207
|
+
<Select.Option value="k㎡">k㎡</Select.Option>
|
|
208
|
+
<Select.Option value="㎡">㎡</Select.Option>
|
|
209
|
+
</Select>
|
|
210
|
+
)}
|
|
211
|
+
</Form.Item>
|
|
212
|
+
</Col>
|
|
213
|
+
}
|
|
214
|
+
{isParkFeeItem &&
|
|
215
|
+
<Col span={6} >
|
|
216
|
+
<Form.Item label='面积单位' >
|
|
217
|
+
{getFieldDecorator(`realEstateDataDto[${index}].realEstateUnit`, {
|
|
218
|
+
rules: readOnly ? [] : [{ required: true, message: '请选择面积单位' }]
|
|
219
|
+
})(
|
|
220
|
+
readOnly
|
|
221
|
+
? <MyDiv />
|
|
222
|
+
: <Select placeholder='请选择' style={{ width: '100%' }} >
|
|
223
|
+
<Select.Option value="平方米">平方米</Select.Option>
|
|
224
|
+
</Select>
|
|
225
|
+
)}
|
|
226
|
+
</Form.Item>
|
|
227
|
+
</Col>
|
|
228
|
+
}
|
|
229
|
+
{isParkFeeItem &&
|
|
230
|
+
<LicensePlateNumber form={form} index={index} cd={item.cd} />
|
|
231
|
+
// <Col span={6} >
|
|
232
|
+
// <Form.Item label='车牌号' >
|
|
233
|
+
// {getFieldDecorator(`realEstateDataDto[${index}].licensePlateNumber`, {
|
|
234
|
+
// rules: readOnly ? [] : [{ required: true, message: '请选择面积单位' }]
|
|
235
|
+
// })(
|
|
236
|
+
// readOnly
|
|
237
|
+
// ? <MyDiv />
|
|
238
|
+
// : <LicensePlateNumber form={form}/>
|
|
239
|
+
// )}
|
|
240
|
+
// </Form.Item>
|
|
241
|
+
// </Col>
|
|
242
|
+
}
|
|
184
243
|
</Row>
|
|
185
244
|
}
|
|
186
245
|
})
|
|
@@ -227,7 +286,18 @@ class MyArrMoment extends React.Component<{ value?: moment.Moment[], style?: Rea
|
|
|
227
286
|
)
|
|
228
287
|
}
|
|
229
288
|
}
|
|
230
|
-
|
|
289
|
+
class MyArrMomentTime extends React.Component<{ value?: moment.Moment[], style?: React.CSSProperties }> {
|
|
290
|
+
render(): React.ReactNode {
|
|
291
|
+
const { value = [] } = this.props
|
|
292
|
+
return (
|
|
293
|
+
<div style={this.props.style}>
|
|
294
|
+
<span>{moment.isMoment(value[0]) && value[0].format('YYYY-MM-DD HH:mm')}</span>
|
|
295
|
+
<span style={{ color: '#9F603D', fontWeight: 600 }} > - </span>
|
|
296
|
+
<span>{moment.isMoment(value[1]) && value[1].format('YYYY-MM-DD HH:mm')}</span>
|
|
297
|
+
</div>
|
|
298
|
+
)
|
|
299
|
+
}
|
|
300
|
+
}
|
|
231
301
|
class MyNY extends React.Component<{ value?: 'Y' | 'N', style?: React.CSSProperties }> {
|
|
232
302
|
render(): React.ReactNode {
|
|
233
303
|
return (
|
|
@@ -239,4 +309,137 @@ class MyNY extends React.Component<{ value?: 'Y' | 'N', style?: React.CSSPropert
|
|
|
239
309
|
)
|
|
240
310
|
}
|
|
241
311
|
}
|
|
312
|
+
interface PriceInputProps {
|
|
313
|
+
// value?: string[];
|
|
314
|
+
// style?: React.CSSProperties
|
|
315
|
+
// onChange?: (value: string[]) => void;
|
|
316
|
+
form: any,
|
|
317
|
+
index: number
|
|
318
|
+
cd?: number
|
|
319
|
+
}
|
|
320
|
+
const LicensePlateNumber: React.FC<PriceInputProps> = (props) => {
|
|
321
|
+
|
|
322
|
+
const { form } = props;
|
|
323
|
+
|
|
324
|
+
const { getFieldDecorator } = form;
|
|
325
|
+
const licenceLimit = 3; // 最多支持填写3个车牌号
|
|
326
|
+
const formData: any[] = form.getFieldValue('realEstateDataDto');
|
|
327
|
+
const [value, setVal] = React.useState(new Array(props.cd || 1).fill(''));
|
|
328
|
+
const cd = React.useMemo(() => formData[props.index]?.cd, [formData[props.index]?.cd])
|
|
329
|
+
// useEffect(() => {
|
|
330
|
+
// if (cd) {
|
|
331
|
+
// const dd = value.concat(new Array(cd.length-1).fill(''))
|
|
332
|
+
// setVal(dd);
|
|
333
|
+
// }
|
|
334
|
+
// }, [cd])
|
|
335
|
+
const onAdd = () => {
|
|
336
|
+
if (value.length < licenceLimit) {
|
|
337
|
+
setVal([...value, '']);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
// 删除车牌号
|
|
341
|
+
const onDelete = () => {
|
|
342
|
+
if (value.length > 0) {
|
|
343
|
+
const dd = value.slice(0, -1)
|
|
344
|
+
setVal(dd);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
console.log(value.length)
|
|
349
|
+
return <>
|
|
350
|
+
{
|
|
351
|
+
value.length > 0 && value.map((item: string[], key: number) => {
|
|
352
|
+
|
|
353
|
+
return <Col span={6} ><Form.Item label='车牌号' key={key}>
|
|
354
|
+
{getFieldDecorator(`realEstateDataDto[${props.index}].cphList[${key}]`, {
|
|
355
|
+
rules: [{ required: true, message: '请输入车牌号' }]
|
|
356
|
+
})(
|
|
357
|
+
<Input style={{ width: '100%' }} autoComplete='off' placeholder="请输入车牌号" />
|
|
358
|
+
)}
|
|
359
|
+
</Form.Item>
|
|
360
|
+
</Col>
|
|
361
|
+
})
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
}
|
|
365
|
+
{/* <Col span={6} style={{ display: 'none' }}><Form.Item label='长度' >
|
|
366
|
+
{getFieldDecorator(`realEstateDataDto[${props.index}].cd`, {
|
|
367
|
+
|
|
368
|
+
})(
|
|
369
|
+
<Select />
|
|
370
|
+
)}
|
|
371
|
+
</Form.Item>
|
|
372
|
+
</Col> */}
|
|
373
|
+
<Col span={6} >
|
|
374
|
+
<Form.Item >
|
|
375
|
+
<div style={{ color: 'white' }}>1</div>
|
|
376
|
+
<a style={{ marginRight: 10 }} onClick={onAdd}>添加车牌号</a>
|
|
377
|
+
{value.length > 1 && <a onClick={onDelete}>删除</a>}
|
|
378
|
+
</Form.Item>
|
|
379
|
+
</Col>
|
|
380
|
+
</>
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
// const LicensePlateNumber: React.FC<PriceInputProps> = (props) => {
|
|
385
|
+
|
|
386
|
+
// const { form } = props;
|
|
387
|
+
|
|
388
|
+
// const { getFieldDecorator } = form;
|
|
389
|
+
// const licenceLimit = 3; // 最多支持填写3个车牌号
|
|
390
|
+
// // const { value = [] } = this.props;
|
|
391
|
+
// const [value, setVal] = React.useState(props.value || ['']);
|
|
392
|
+
// // const newArr = value.filter(e => !!e);
|
|
393
|
+
// const newArrLength = value.length;
|
|
394
|
+
// console.log(value, newArrLength)
|
|
395
|
+
// // 新增车牌号
|
|
396
|
+
// const onAdd = () => {
|
|
397
|
+
// if (newArrLength < licenceLimit) {
|
|
398
|
+
// setVal([...value, '']);
|
|
399
|
+
// props.onChange?.([...value, ''])
|
|
400
|
+
// }
|
|
401
|
+
// }
|
|
402
|
+
// // 删除车牌号
|
|
403
|
+
// const onDelete = () => {
|
|
404
|
+
// if (newArrLength > 0) {
|
|
405
|
+
// const dd = value.slice(0, -1)
|
|
406
|
+
// setVal(dd);
|
|
407
|
+
// props.onChange?.(dd)
|
|
408
|
+
// }
|
|
409
|
+
// }
|
|
410
|
+
// const onInputChange = (e: React.ChangeEvent<HTMLInputElement>, index: number) => {
|
|
411
|
+
// console.log(e.target.value);
|
|
412
|
+
// const dd = value.map((item, i) => {
|
|
413
|
+
// if (i === index) {
|
|
414
|
+
// return e.target.value
|
|
415
|
+
// }
|
|
416
|
+
// return item
|
|
417
|
+
// })
|
|
418
|
+
// setVal(dd);
|
|
419
|
+
// props.onChange?.(dd)
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
// }
|
|
423
|
+
// return (
|
|
424
|
+
|
|
425
|
+
// <>
|
|
426
|
+
// {newArrLength > 0 && value.map((item, index) => {
|
|
427
|
+
// return
|
|
428
|
+
// <Form.Item label='车牌号' >
|
|
429
|
+
// {getFieldDecorator(`realEstateDataDto[${index}].licensePlateNumber`, {
|
|
430
|
+
// rules: [{ required: true, }]
|
|
431
|
+
// })(
|
|
432
|
+
// <Input onChange={(e) => { onInputChange(e, index) }} key={index} style={{ width: '100%' }} autoComplete='off' placeholder="请输入车牌号" />
|
|
433
|
+
// )}
|
|
434
|
+
// </Form.Item>
|
|
435
|
+
// // <Col span={6} >
|
|
436
|
+
// // <Input onChange={(e) => { onInputChange(e, index) }} key={index} style={{ width: '100%' }} autoComplete='off' placeholder="请输入车牌号" />
|
|
437
|
+
// // </Col>
|
|
438
|
+
// })}
|
|
439
|
+
|
|
440
|
+
// <Button type="link" onClick={onAdd}>添加车牌号</Button>
|
|
441
|
+
// {newArrLength > 1 && <Button type="link" onClick={onDelete}>删除</Button>}
|
|
442
|
+
// </>
|
|
242
443
|
|
|
444
|
+
// )
|
|
445
|
+
// }
|
|
@@ -30,7 +30,7 @@ const RULES = {
|
|
|
30
30
|
{ pattern: /^[0-9\s\-\+]+$/g, message: `${label}仅能数字、空格、-、+` }
|
|
31
31
|
],
|
|
32
32
|
sellerTelPhone: (label: string) => [
|
|
33
|
-
|
|
33
|
+
|
|
34
34
|
{ max: 100, message: `${label}内容超长` },
|
|
35
35
|
{ pattern: /^[0-9\s\-\+]+$/g, message: `${label}仅能数字、空格、-、+` }
|
|
36
36
|
],
|
|
@@ -206,7 +206,7 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
|
|
|
206
206
|
</Form.Item>
|
|
207
207
|
</Col>
|
|
208
208
|
|
|
209
|
-
<Col span={10+
|
|
209
|
+
<Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
|
|
210
210
|
<Form.Item label='销售方地址' colon={false}>
|
|
211
211
|
{getFieldDecorator('sellerAddress', {
|
|
212
212
|
rules: getRules('sellerAddress', [{ max: 300, message: '销售方地址内容超长' }])
|
|
@@ -214,7 +214,7 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
|
|
|
214
214
|
</Form.Item>
|
|
215
215
|
</Col>
|
|
216
216
|
|
|
217
|
-
<Col span={10+
|
|
217
|
+
<Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
|
|
218
218
|
<Form.Item label='电话' colon={false} className='telephone' >
|
|
219
219
|
{getFieldDecorator('sellerPhone', {
|
|
220
220
|
rules: getRules('sellerPhone', RULES.sellerTelPhone('销售方电话'))
|
|
@@ -229,7 +229,15 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
|
|
|
229
229
|
})(<MyInput readOnly={isReadOnly('sellerBank')} placeholder="请输入销售方开户银行" autoComplete="off" />)}
|
|
230
230
|
</Form.Item>
|
|
231
231
|
</Col>
|
|
232
|
-
|
|
232
|
+
{(props.leqi) &&
|
|
233
|
+
<Col span={4} style={{ display: isExpand ? undefined : 'none' }}>
|
|
234
|
+
<Form.Item colon={false}>
|
|
235
|
+
{getFieldDecorator('sellerAddressPhoneFlag', {
|
|
236
|
+
valuePropName: 'checked',
|
|
237
|
+
})(<Checkbox onChange={props?.invoiceMarkCallback} disabled={isReadOnly('sellerAddressPhoneFlag')} style={{ whiteSpace: 'nowrap' }}>是否展示</Checkbox>)}
|
|
238
|
+
</Form.Item>
|
|
239
|
+
</Col>
|
|
240
|
+
}
|
|
233
241
|
<Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
|
|
234
242
|
<Form.Item label='银行账号' colon={false}>
|
|
235
243
|
{getFieldDecorator('sellerAccount', {
|
|
@@ -241,8 +249,8 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
|
|
|
241
249
|
<Col span={4} style={{ display: isExpand ? undefined : 'none' }}>
|
|
242
250
|
<Form.Item colon={false}>
|
|
243
251
|
{getFieldDecorator('sellerBankAccountFlag', {
|
|
244
|
-
|
|
245
|
-
})(<Checkbox onChange={props?.invoiceMarkCallback} disabled={isReadOnly('sellerBankAccountFlag')} style={{whiteSpace:'nowrap'}}>是否展示</Checkbox>)}
|
|
252
|
+
valuePropName: 'checked',
|
|
253
|
+
})(<Checkbox onChange={props?.invoiceMarkCallback} disabled={isReadOnly('sellerBankAccountFlag')} style={{ whiteSpace: 'nowrap' }}>是否展示</Checkbox>)}
|
|
246
254
|
</Form.Item>
|
|
247
255
|
</Col>
|
|
248
256
|
}
|
|
@@ -313,7 +321,7 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
|
|
|
313
321
|
</Form.Item>
|
|
314
322
|
</Col>
|
|
315
323
|
|
|
316
|
-
<Col span={10+
|
|
324
|
+
<Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
|
|
317
325
|
<Form.Item label='购买方地址' colon={false}>
|
|
318
326
|
{getFieldDecorator('buyerAddress', {
|
|
319
327
|
rules: getRules('buyerAddress', [{ max: 100, message: '购买方地址内容超长' }])
|
|
@@ -321,14 +329,20 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
|
|
|
321
329
|
</Form.Item>
|
|
322
330
|
</Col>
|
|
323
331
|
|
|
324
|
-
<Col span={10+
|
|
332
|
+
<Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
|
|
325
333
|
<Form.Item label='电话' colon={false} className='telephone'>
|
|
326
334
|
{getFieldDecorator('buyerPhone', {
|
|
327
335
|
rules: getRules('buyerPhone', RULES.buyerTelPhone('购买方电话'))
|
|
328
336
|
})(<MyInput readOnly={isReadOnly('buyerPhone')} placeholder="请输入电话" autoComplete="off" />)}
|
|
329
337
|
</Form.Item>
|
|
330
338
|
</Col>
|
|
331
|
-
|
|
339
|
+
<Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
|
|
340
|
+
<Form.Item label='购买方开户银行' colon={false}>
|
|
341
|
+
{getFieldDecorator('buyerBank', {
|
|
342
|
+
rules: getRules('buyerBank', RULES.bankName('购买方开户银行'))
|
|
343
|
+
})(<MyInput readOnly={isReadOnly('buyerBank')} placeholder="请输入购买方开户银行" autoComplete="off" />)}
|
|
344
|
+
</Form.Item>
|
|
345
|
+
</Col>
|
|
332
346
|
<Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
|
|
333
347
|
<Form.Item label='购买方开户银行' colon={false}>
|
|
334
348
|
{getFieldDecorator('buyerBank', {
|
|
@@ -346,10 +360,10 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
|
|
|
346
360
|
</Col>
|
|
347
361
|
{(props.leqi || props.riskData?.code === 'success') &&
|
|
348
362
|
<Col span={4} style={{ display: isExpand ? undefined : 'none' }}>
|
|
349
|
-
<Form.Item
|
|
363
|
+
<Form.Item colon={false}>
|
|
350
364
|
{getFieldDecorator('buyerBankAccountFlag', {
|
|
351
365
|
valuePropName: 'checked',
|
|
352
|
-
})(<Checkbox onChange={props?.invoiceMarkCallback} disabled={isReadOnly('buyerBankAccountFlag')}
|
|
366
|
+
})(<Checkbox onChange={props?.invoiceMarkCallback} disabled={isReadOnly('buyerBankAccountFlag')} style={{ whiteSpace: 'nowrap' }}>是否展示</Checkbox>)}
|
|
353
367
|
</Form.Item>
|
|
354
368
|
</Col>
|
|
355
369
|
}
|
|
@@ -414,19 +428,19 @@ function BuyerNameInput(props: InputProps & { fieldName: string; myform: Wrapped
|
|
|
414
428
|
const onSearch = React.useCallback(async (searchText: string) => {
|
|
415
429
|
await Discontinue.start();
|
|
416
430
|
try {
|
|
417
|
-
if (fieldName === 'buyerName'
|
|
431
|
+
if (fieldName === 'buyerName') {
|
|
418
432
|
if (autoComplete.onBuyerNameSearch) {
|
|
419
433
|
setOptions(await autoComplete.onBuyerNameSearch(searchText));
|
|
420
434
|
}
|
|
421
|
-
} else if (fieldName === 'buyerTaxId'
|
|
435
|
+
} else if (fieldName === 'buyerTaxId') {
|
|
422
436
|
if (autoComplete.onBuyerTaxIdSearch) {
|
|
423
437
|
setOptions(await autoComplete.onBuyerTaxIdSearch(searchText));
|
|
424
438
|
}
|
|
425
|
-
}else if(fieldName === 'supplierName'){
|
|
439
|
+
} else if (fieldName === 'supplierName') {
|
|
426
440
|
if (autoComplete.onSupplierNameSearch) {
|
|
427
441
|
setOptions(await autoComplete.onSupplierNameSearch(searchText));
|
|
428
442
|
}
|
|
429
|
-
}else if(fieldName === 'supplierTaxId'){
|
|
443
|
+
} else if (fieldName === 'supplierTaxId') {
|
|
430
444
|
if (autoComplete.onSupplierTaxIdSearch) {
|
|
431
445
|
setOptions(await autoComplete.onSupplierTaxIdSearch(searchText));
|
|
432
446
|
}
|