kts-component-invoice-operate 3.2.219 → 3.2.220-chinaship

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.
@@ -1,5 +1,5 @@
1
1
 
2
- import React, { useEffect } from "react";
2
+ import React from "react";
3
3
  import { decorator } from 'grey-react-box';
4
4
  import { Form } from 'kts-components-antd-x3';
5
5
  import { FormComponentProps } from 'kts-components-antd-x3/lib/form';
@@ -36,160 +36,110 @@ export default decorator<RealEstateInfoProps, FormComponentProps & RealEstateInf
36
36
 
37
37
  const readOnly = React.useMemo(() => model === 'readOnly', [model]);
38
38
 
39
- const goodsList = controller.useMemo(s => s.goodsListState.goodsList, []);
40
- const indexRef = React.useRef<any>([]);
41
- useEffect(() => {
42
- const dd = goodsList?.reduce((acc: any, cur: any) => {
43
- if (cur.lineAttribute !==1) {
44
- acc.push(cur.$index)
45
- }
46
- return acc
47
- }, [])
48
- indexRef.current = dd;
49
- }, [goodsList, indexRef])
50
39
  // 注册 form
51
-
52
40
  controller.useForm('realEstateInfo', form);
53
- const getList = () => {
54
- const decrease = indexRef.current.length > goodsList.length
55
- if (decrease) {
56
- //已删行列表
57
- const diff = indexRef.current.filter((item: any) => !goodsList.find(i => i.$index === item));
58
-
59
- const formData: any[] = form.getFieldValue('realEstateDataDto');
60
- if (Array.isArray(formData) && diff.length > 0) {
61
-
62
- const newForm = formData?.filter(item => !diff.find((i: any) => i === item.$index));
63
-
64
- form.setFieldsValue({
65
- realEstateDataDto: newForm
66
- });
67
- } else {
68
- form.setFieldsValue({
69
- realEstateDataDto: undefined
70
- });
71
- }
72
- }
73
- console.log('goodsList',goodsList)
74
- return goodsList.filter(item=>item.lineAttribute !== 1).map((item, index) => {
75
- if (item.lineAttribute !== 1) {
76
- return <Row gutter={[17, 0]} >
77
- <Col span={6} >
78
- <Form.Item style={{ display: 'none' }}>
79
- {getFieldDecorator(`realEstateDataDto[${index}].$index`, {
80
- initialValue: item.$index,
81
- })(
82
- <Input />
83
- )}
84
- </Form.Item>
85
- <Form.Item label='不动产地址'>
86
- {getFieldDecorator(`realEstateDataDto[${index}].realEstateAddress`, {
87
- rules: readOnly ? [] : [{ required: true, message: '请选择不动产地址' }]
88
- })(
89
- readOnly
90
- ? (<MyArrString />)
91
- : (<Cascader
92
- style={{ width: '100%' }}
93
- options={props.realEstateAddressOptions}
94
- fieldNames={props.realEstateAddressFieldNames}
95
- placeholder="请选择省市区县"
96
- />)
97
- )}
98
- </Form.Item>
99
- </Col>
100
- <Col span={6} >
101
- <Form.Item label='详细地址' >
102
- {getFieldDecorator(`realEstateDataDto[${index}].realEstateDetailedAddress`, {
103
- rules: readOnly ? [] : [
104
- { required: true, message: '请输入详细地址' },
105
- { max: 120, message: '详细地址最多120个字符' },
106
- {
107
- validator: async (_, value, callback) => {
108
- const pattern = /街|路|村|乡|镇|道|巷|号/;
109
- if (pattern.test(value)) {
110
- callback()
111
- } else {
112
- callback('地址必须包含“街”、“路”、“村”、“乡”、“镇”、“道”、“巷”、“号”等任意一个关键词')
113
- }
114
- }
115
- }
116
- ]
117
- })(
118
- readOnly
119
- ? <MyDiv />
120
- : <Input autoComplete='off' placeholder="请输入详细地址" />
121
- )}
122
- </Form.Item>
123
- </Col>
124
- <Col span={6} >
125
- <Form.Item label='租赁期起止' >
126
- {getFieldDecorator(`realEstateDataDto[${index}].leaseTerm`, {
127
- rules: readOnly ? [] : [{ required: true, message: '请输入租赁期' }]
128
- })(
129
- readOnly
130
- ? <MyArrMoment />
131
- : <RangePicker style={{ width: '100%' }} />
132
- )}
133
- </Form.Item>
134
- </Col>
135
- <Col span={6} >
136
- <Form.Item label='跨地(市)标志' >
137
- {getFieldDecorator(`realEstateDataDto[${index}].crossCitiesSign`, {
138
- rules: readOnly ? [] : [
139
- { required: true, message: '请选择跨地(市)标志' }
140
- ]
141
- })(
142
- readOnly
143
- ? <MyNY />
144
- : <Select placeholder='请选择' style={{ width: '100%' }} >
145
- <Select.Option value='Y'>是</Select.Option>
146
- <Select.Option value='N'>否</Select.Option>
147
- </Select>
148
- )}
149
- </Form.Item>
150
- </Col>
151
- <Col span={6} >
152
- <Form.Item label='产权证书/不动产权证号' >
153
- {getFieldDecorator(`realEstateDataDto[${index}].realEstateNumber`, {
154
- rules: readOnly ? [] : [
155
- { required: true, message: '请输入证书编号,若没有证书填写“无”' },
156
- { max: 40, message: '证书编号最多40个字符' },
157
- ]
158
- })(
159
- readOnly
160
- ? <MyDiv />
161
- : <Input autoComplete='off' placeholder="请输入证书编号,若没有证书填写“无”" />
162
- )}
163
- </Form.Item>
164
- </Col>
165
- <Col span={6} >
166
- <Form.Item label='面积单位' >
167
- {getFieldDecorator(`realEstateDataDto[${index}].realEstateUnit`, {
168
- rules: readOnly ? [] : [{ required: true, message: '请选择面积单位' }]
169
- })(
170
- readOnly
171
- ? <MyDiv />
172
- : <Select placeholder='请选择' style={{ width: '100%' }} >
173
- <Select.Option value="平方千米">平方千米</Select.Option>
174
- <Select.Option value="平方米">平方米</Select.Option>
175
- <Select.Option value="公顷">公顷</Select.Option>
176
- <Select.Option value="亩">亩</Select.Option>
177
- <Select.Option value="h㎡">h㎡</Select.Option>
178
- <Select.Option value="k㎡">k㎡</Select.Option>
179
- <Select.Option value="㎡">㎡</Select.Option>
180
- </Select>
181
- )}
182
- </Form.Item>
183
- </Col>
184
- </Row>
185
- }
186
- })
187
- }
41
+
188
42
  return (
189
43
  <div className="kts-invoice-operate-real-estate-info-digtal">
190
- <div className='real-estate-info-digtal-label' >特定信息-不动产经营租赁服务</div>
191
- {getList()}
192
-
44
+ <div className='real-estate-info-digtal-label' >特殊信息-不动产经营租赁服务</div>
45
+ <Row gutter={[17, 0]}>
46
+ <Col span={6} >
47
+ <Form.Item label='不动产地址' >
48
+ {getFieldDecorator('realEstateAddress', {
49
+ rules: readOnly ? [] : [{ required: true, message: '请选择不动产地址' }]
50
+ })(
51
+ readOnly
52
+ ? (<MyArrString />)
53
+ : (<Cascader
54
+ style={{ width: '100%' }}
55
+ options={props.realEstateAddressOptions}
56
+ fieldNames={props.realEstateAddressFieldNames}
57
+ placeholder="请选择省市区县"
58
+ />)
59
+ )}
60
+ </Form.Item>
61
+ </Col>
62
+ <Col span={6} >
63
+ <Form.Item label='详细地址' >
64
+ {getFieldDecorator('realEstateDetailedAddress', {
65
+ rules: readOnly ? [] : [
66
+ { required: true, message: '请输入详细地址' },
67
+ { max: 120, message: '详细地址最多120个字符' },
68
+ {
69
+ validator: (_, value) => {
70
+ const pattern = /街|路|村|乡|镇|道|巷|号/;
71
+ return pattern.test(value) ? Promise.resolve() : Promise.reject('地址必须包含“街”、“路”、“村”、“乡”、“镇”、“道”、“巷”、“号”等任意一个关键词');
72
+ }
73
+ }
74
+ ]
75
+ })(
76
+ readOnly
77
+ ? <MyDiv />
78
+ : <Input autoComplete='off' placeholder="请输入详细地址" />
79
+ )}
80
+ </Form.Item>
81
+ </Col>
82
+ <Col span={6} >
83
+ <Form.Item label='租赁期起止' >
84
+ {getFieldDecorator('leaseTerm', {
85
+ rules: readOnly ? [] : [{ required: true, message: '请输入租赁期' }]
86
+ })(
87
+ readOnly
88
+ ? <MyArrMoment />
89
+ : <RangePicker style={{ width: '100%' }} />
90
+ )}
91
+ </Form.Item>
92
+ </Col>
93
+ <Col span={6} >
94
+ <Form.Item label='跨地(市)标志' >
95
+ {getFieldDecorator('crossCitiesSign', {
96
+ rules: readOnly ? [] : [
97
+ { required: true, message: '请选择跨地(市)标志' }
98
+ ]
99
+ })(
100
+ readOnly
101
+ ? <MyNY />
102
+ : <Select placeholder='请选择' style={{ width: '100%' }} >
103
+ <Select.Option value='Y'>是</Select.Option>
104
+ <Select.Option value='N'>否</Select.Option>
105
+ </Select>
106
+ )}
107
+ </Form.Item>
108
+ </Col>
109
+ <Col span={6} >
110
+ <Form.Item label='产权证书/不动产权证号' >
111
+ {getFieldDecorator('realEstateNumber', {
112
+ rules: readOnly ? [] : [
113
+ { required: true, message: '请输入证书编号,若没有证书填写“无”' },
114
+ { max: 40, message: '证书编号最多40个字符' },
115
+ ]
116
+ })(
117
+ readOnly
118
+ ? <MyDiv />
119
+ : <Input autoComplete='off' placeholder="请输入证书编号,若没有证书填写“无”" />
120
+ )}
121
+ </Form.Item>
122
+ </Col>
123
+ <Col span={6} >
124
+ <Form.Item label='面积单位' >
125
+ {getFieldDecorator('realEstateUnit', {
126
+ rules: readOnly ? [] : [{ required: true, message: '请选择面积单位' }]
127
+ })(
128
+ readOnly
129
+ ? <MyDiv />
130
+ : <Select placeholder='请选择' style={{ width: '100%' }} >
131
+ <Select.Option value="平方千米">平方千米</Select.Option>
132
+ <Select.Option value="平方米">平方米</Select.Option>
133
+ <Select.Option value="公顷">公顷</Select.Option>
134
+ <Select.Option value="亩">亩</Select.Option>
135
+ <Select.Option value="h㎡">h㎡</Select.Option>
136
+ <Select.Option value="k㎡">k㎡</Select.Option>
137
+ <Select.Option value="㎡">㎡</Select.Option>
138
+ </Select>
139
+ )}
140
+ </Form.Item>
141
+ </Col>
142
+ </Row>
193
143
  </div>
194
144
  )
195
145
  })
@@ -222,7 +172,7 @@ class MyArrMoment extends React.Component<{ value?: moment.Moment[], style?: Rea
222
172
  <div style={this.props.style}>
223
173
  <span>{moment.isMoment(value[0]) && value[0].format('YYYY-MM-DD')}</span>
224
174
  <span style={{ color: '#9F603D', fontWeight: 600 }} > - </span>
225
- <span>{moment.isMoment(value[1]) && value[1].format('YYYY-MM-DD')}</span>
175
+ <span>{moment.isMoment(value[1]) && value[0].format('YYYY-MM-DD')}</span>
226
176
  </div>
227
177
  )
228
178
  }
@@ -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+riskspanW} style={{ display: isExpand ? undefined : 'none' }} >
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+riskspanW} style={{ display: isExpand ? undefined : 'none' }} >
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
- valuePropName: 'checked',
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+riskspanW} style={{ display: isExpand ? undefined : 'none' }} >
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+riskspanW} style={{ display: isExpand ? undefined : 'none' }} >
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 colon={false}>
363
+ <Form.Item colon={false}>
350
364
  {getFieldDecorator('buyerBankAccountFlag', {
351
365
  valuePropName: 'checked',
352
- })(<Checkbox onChange={props?.invoiceMarkCallback} disabled={isReadOnly('buyerBankAccountFlag')} style={{whiteSpace:'nowrap'}}>是否展示</Checkbox>)}
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
  }
@@ -200,7 +200,7 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
200
200
  </Form.Item>
201
201
  </Col>
202
202
 
203
- <Col span={10+riskspanW} style={{ display: isExpand ? undefined : 'none' }} >
203
+ <Col span={10+leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
204
204
  <Form.Item label='购买方地址' colon={false}>
205
205
  {getFieldDecorator('buyerAddress', {
206
206
  rules: getRules('buyerAddress', [{ max: 100, message: '购买方地址内容超长' }])
@@ -208,13 +208,22 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
208
208
  </Form.Item>
209
209
  </Col>
210
210
 
211
- <Col span={10+riskspanW} style={{ display: isExpand ? undefined : 'none' }} >
211
+ <Col span={10+leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
212
212
  <Form.Item label='电话' colon={false} className='telephone'>
213
213
  {getFieldDecorator('buyerPhone', {
214
214
  rules: getRules('buyerPhone', RULES.buyerTelPhone('购买方电话'))
215
215
  })(<MyInput readOnly={isReadOnly('buyerPhone')} placeholder="请输入电话" autoComplete="off" />)}
216
216
  </Form.Item>
217
217
  </Col>
218
+ {(props.leqi) &&
219
+ <Col span={4} style={{ display: isExpand ? undefined : 'none' }}>
220
+ <Form.Item colon={false}>
221
+ {getFieldDecorator('buyerAddressPhoneFlag', {
222
+ valuePropName: 'checked',
223
+ })(<Checkbox onChange={props?.invoiceMarkCallback} disabled={isReadOnly('buyerAddressPhoneFlag')} style={{whiteSpace:'nowrap'}}>是否展示</Checkbox>)}
224
+ </Form.Item>
225
+ </Col>
226
+ }
218
227
  <Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
219
228
  <Form.Item label='购买方开户银行' colon={false}>
220
229
  {getFieldDecorator('buyerBank', {
@@ -281,7 +290,7 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
281
290
  </Form.Item>
282
291
  </Col>
283
292
 
284
- <Col span={10+riskspanW} style={{ display: isExpand ? undefined : 'none' }} >
293
+ <Col span={10+leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
285
294
  <Form.Item label='销售方地址' colon={false}>
286
295
  {getFieldDecorator('sellerAddress', {
287
296
  rules: getRules('sellerAddress', [{ max: 300, message: '销售方地址内容超长' }])
@@ -289,13 +298,22 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
289
298
  </Form.Item>
290
299
  </Col>
291
300
 
292
- <Col span={10+riskspanW} style={{ display: isExpand ? undefined : 'none' }} >
301
+ <Col span={10+leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
293
302
  <Form.Item label='电话' colon={false} className='telephone' >
294
303
  {getFieldDecorator('sellerPhone', {
295
304
  rules: getRules('sellerPhone', RULES.sellerTelPhone('销售方电话'))
296
305
  })(<MyInput readOnly={isReadOnly('sellerPhone')} placeholder="请输入电话" autoComplete="off" />)}
297
306
  </Form.Item>
298
307
  </Col>
308
+ {(props.leqi) &&
309
+ <Col span={4} style={{ display: isExpand ? undefined : 'none' }}>
310
+ <Form.Item colon={false}>
311
+ {getFieldDecorator('sellerAddressPhoneFlag', {
312
+ valuePropName: 'checked',
313
+ })(<Checkbox onChange={props?.invoiceMarkCallback} disabled={isReadOnly('sellerAddressPhoneFlag')} style={{whiteSpace:'nowrap'}}>是否展示</Checkbox>)}
314
+ </Form.Item>
315
+ </Col>
316
+ }
299
317
  <Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
300
318
  <Form.Item label='销售方开户银行' colon={false}>
301
319
  {getFieldDecorator('sellerBank', {