|
|
@@ -18,7 +18,7 @@ import {
|
|
|
Modal,
|
|
|
Checkbox,
|
|
|
ListView,
|
|
|
- SearchBar, PullToRefresh,
|
|
|
+ SearchBar,
|
|
|
} from 'antd-mobile'
|
|
|
import {
|
|
|
fetchGet,
|
|
|
@@ -105,6 +105,7 @@ class CurrencyDetail extends Component {
|
|
|
}
|
|
|
|
|
|
render () {
|
|
|
+ const { isDetail } = this.props
|
|
|
let formItems = this.getFormItems()
|
|
|
|
|
|
return (
|
|
|
@@ -116,16 +117,18 @@ class CurrencyDetail extends Component {
|
|
|
{formItems}
|
|
|
</List>
|
|
|
</div>
|
|
|
- {/*{formItems.length > 0 &&*/}
|
|
|
- {/*<Button type={'primary'}*/}
|
|
|
- {/* style={{*/}
|
|
|
- {/* margin: '18px 26px',*/}
|
|
|
- {/* height: '36px',*/}
|
|
|
- {/* lineHeight: '36px',*/}
|
|
|
- {/* fontSize: '16px',*/}
|
|
|
- {/* }}*/}
|
|
|
- {/* onClick={this.onSubmitClick}>提交</Button>}*/}
|
|
|
- {formItems.length > 0 && this.props.children}
|
|
|
+ {formItems.length > 0
|
|
|
+ && (this.props.children
|
|
|
+ || isDetail
|
|
|
+ || <Button
|
|
|
+ type={'primary'}
|
|
|
+ style={{
|
|
|
+ margin: '18px 26px',
|
|
|
+ height: '36px',
|
|
|
+ lineHeight: '36px',
|
|
|
+ fontSize: '16px',
|
|
|
+ }}
|
|
|
+ onClick={this.onSubmitClick}>提交</Button>)}
|
|
|
{this.getDbfindModal()}
|
|
|
</div>
|
|
|
)
|
|
|
@@ -951,8 +954,8 @@ class CurrencyDetail extends Component {
|
|
|
if (isObjNull(billModel)) {
|
|
|
continue
|
|
|
}
|
|
|
- if (isObjEmpty(this.getValue(billModel)) && billModel.isdefault ===
|
|
|
- -1 &&
|
|
|
+ if (isObjEmpty(this.getValue(billModel)) &&
|
|
|
+ billModel.isdefault &&
|
|
|
(billModel.allowBlank === 'necessaryField'
|
|
|
|| billModel.allowBlank === 'F')) {
|
|
|
message.error(`${billModel.caption}为必填项`)
|
|
|
@@ -978,7 +981,7 @@ class CurrencyDetail extends Component {
|
|
|
for (let j = 0; j < gridFields.length; j++) {
|
|
|
let billModel = gridFields[j]
|
|
|
if (isObjEmpty(this.getValue(billModel))
|
|
|
- && billModel.isdefault === -1
|
|
|
+ && billModel.isdefault
|
|
|
&& (billModel.allowBlank === 'necessaryField'
|
|
|
|| billModel.allowBlank === 'F')) {
|
|
|
message.error(`${billModel.caption}为必填项`)
|
|
|
@@ -1397,8 +1400,9 @@ class CurrencyDetail extends Component {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- isShow = (billModel) => (billModel.isdefault === -1 && billModel.type !==
|
|
|
- 'H')
|
|
|
+ isShow = (billModel) => (
|
|
|
+ billModel.isdefault && billModel.type !== 'H'
|
|
|
+ )
|
|
|
|
|
|
getAddModel = index => {
|
|
|
let addBillModel = new BillModel()
|