|
|
@@ -130,6 +130,7 @@ export default class ApprovalAdd extends Component {
|
|
|
<FormInput billModel={billModel} groupIndex={g}
|
|
|
childIndex={i}
|
|
|
baseUrl={mBaseUrl}
|
|
|
+ onMapChange={this.onMapChange.bind(this)}
|
|
|
onTextChange={this.onTextChange.bind(this)}
|
|
|
onInputClick={this.onInputClick.bind(this)}/>,
|
|
|
)
|
|
|
@@ -773,6 +774,49 @@ export default class ApprovalAdd extends Component {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ onMapChange = (groupIndex, childIndex, info, billModel) => {
|
|
|
+ //获取关联关系dbfinds
|
|
|
+ const { billGroupModelList } = this.state
|
|
|
+ if (!isObjNull(billGroupModelList) &&
|
|
|
+ !isObjNull(billGroupModelList[groupIndex])) {
|
|
|
+ let billGroup = billGroupModelList[groupIndex]
|
|
|
+ let condition = '1=1'
|
|
|
+ let params = {
|
|
|
+ which: billGroup.isForm == true ? 'form' : 'grid',
|
|
|
+ caller: billGroup.billCaller,
|
|
|
+ field: billModel.field,
|
|
|
+ condition: condition,
|
|
|
+ page: 1,
|
|
|
+ pageSize: 0,
|
|
|
+ }
|
|
|
+ fetchGet(mBaseUrl + '/uapproval/common/dbfind.action',
|
|
|
+ params).then(response => {
|
|
|
+ Toast.hide()
|
|
|
+ let dbfinds = response.dbfinds || response.gridDbfinds;
|
|
|
+ dbfinds.forEach((item, index) => {
|
|
|
+ if(item.field != billModel.field){
|
|
|
+ if(!isObjNull(billGroup.showBillFields)){
|
|
|
+ billGroup.showBillFields.forEach((detail, index) => {
|
|
|
+ if(detail.field == item.field && info.address){
|
|
|
+ detail.value = info.address;
|
|
|
+ this.setState({
|
|
|
+ billGroupModelList,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch(error => {
|
|
|
+ if (typeof error === 'string') {
|
|
|
+ message.error(error)
|
|
|
+ } else {
|
|
|
+ message.error('无关联数据')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
onSubmitClick = () => {
|
|
|
const { billGroupModelList } = this.state
|
|
|
if (!isObjEmpty(billGroupModelList)) {
|