kts-component-invoice-operate 3.2.217 → 3.2.219-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
44
  <div className='real-estate-info-digtal-label' >特殊信息-不动产经营租赁服务</div>
191
- {getList()}
192
-
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
  }
@@ -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', {