提交 b55438df authored 作者: zhouhuan's avatar zhouhuan

权利人信息详情

上级 8aa630e1
...@@ -8,4 +8,5 @@ ...@@ -8,4 +8,5 @@
# For customization when using a Version Control System, please read the # For customization when using a Version Control System, please read the
# header note. # header note.
#Fri Oct 27 18:29:04 CST 2017 #Fri Oct 27 18:29:04 CST 2017
sdk.dir=D\:\\Android\\sdk sdk.dir=D\:\\AppData\\Local\\Android\\sdk1
# sdk.dir=D\:\\Android\\sdk
...@@ -6,36 +6,56 @@ import { getData } from '../../utils/DataTemplate'; ...@@ -6,36 +6,56 @@ import { getData } from '../../utils/DataTemplate';
export default { export default {
namespace: 'obligeeInfo', namespace: 'obligeeInfo',
state: { state: {
sourceData: [], sourceData: {},
detailData: {},
isDetail: false,
}, },
effects: { effects: {
*getObligeeInfo({ payload }, { take, put, call, select }) { *getObligeeInfo({ payload }, { put, call, select }) {
console.log('come on ~~');
if (payload === 'clear') { if (payload === 'clear') {
yield put({ type: 'clearList', payload: {} }); yield put({ type: 'clearList', payload: {} });
} }
const { sourceData } = yield select(state => state.obligeeInfo); const { sourceData } = yield select(state => state.obligeeInfo);
console.log(sourceData);
const size = sourceData.length; const size = sourceData.length;
const coordinate = { const coordinate = {
containerType: 'module', containerType: 'module',
containerName: 'query-DSRInfo', containerName: 'query-DSRInfo',
datasourceName: 'QueryDSRInfoTable', datasourceName: 'QueryDSRInfoTable',
}; };
const result = yield call(getData, coordinate, { pst: size, psz: 10 }); const result = yield call(getData, coordinate, { pst: size, psz: 10, params: { pID: payload } });
console.log(result); const singularData = result[0];
for (const row of result) { yield put({ type: 'setDSRList', payload: { ...singularData } });
yield put({ type: 'addDSR', payload: row });
yield take('addDSR/@@end');
}
}, },
*addDSR({ payload }, { put }) { *getObligeeDetail({ payload }, { put, call, select }) {
yield put({ type: 'setDSRList', payload: { arrayData: [payload] } }); const coordinate = {
containerType: 'module',
containerName: 'query-DSRInfo',
datasourceName: 'QueryDSRInfoDetails',
};
const result = yield call(getData, coordinate, { params: { pID: payload } });
console.log(result);
yield put({ type: 'getDSRDetail', payload: { ...result[0] } });
yield put({ type: 'setDetail', payload: true });
}, },
}, },
reducers: { reducers: {
setDSRList(state, { payload: { arrayData } }) { getDSRDetail(state, { payload }) {
return { ...state, sourceData: [...state.sourceData, ...arrayData] }; return {
...state,
detailData: payload,
};
},
setDSRList(state, { payload }) {
return {
...state,
sourceData: payload,
};
},
setDetail(state, { payload }) {
return {
...state,
isDetail: payload,
};
}, },
}, },
}; };
......
import { NavigationActions } from 'react-navigation';
import { getData } from '../../utils/DataTemplate'; import { getData } from '../../utils/DataTemplate';
export default { export default {
namespace: 'ListHouse', namespace: 'ListHouse',
state: { state: {
sourceData: [], sourceData: [],
houseID: '',
}, },
reducers: { reducers: {
setHouseID(state, { payload }) {
return {
...state,
houseID: payload,
};
},
setList(state, { payload: { arrayData } }) { setList(state, { payload: { arrayData } }) {
return { ...state, sourceData: [...state.sourceData, ...arrayData] }; return { ...state, sourceData: [...state.sourceData, ...arrayData] };
}, },
...@@ -15,12 +23,17 @@ export default { ...@@ -15,12 +23,17 @@ export default {
}, },
}, },
effects: { effects: {
*jumpPage({ payload: id }, { put }) {
yield put({ type: 'setHouseID', payload: id });
yield put(NavigationActions.navigate({
routeName: 'HouseDetail',
}));
},
*getHouseList({ payload }, { take, put, call, select }) { *getHouseList({ payload }, { take, put, call, select }) {
if (payload === 'clear') { if (payload === 'clear') {
yield put({ type: 'clearList', payload: {} }); yield put({ type: 'clearList', payload: {} });
} }
const { sourceData } = yield select(state => state.ListHouse); const { sourceData } = yield select(state => state.ListHouse);
console.info(sourceData);
const size = sourceData.length; const size = sourceData.length;
const coordinate = { const coordinate = {
containerType: 'module', containerType: 'module',
......
...@@ -5,18 +5,18 @@ import { createForm } from 'rc-form'; ...@@ -5,18 +5,18 @@ import { createForm } from 'rc-form';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { createAction } from '../../../utils/index'; import { createAction } from '../../../utils/index';
@connect(({ HouseDetail }) => ({ HouseDetail })) @connect(({ HouseDetail, ListHouse }) => ({ HouseDetail, ListHouse }))
class HouseDetail extends Component { class HouseDetail extends Component {
componentDidMount() { componentDidMount() {
const { dispatch, navigation } = this.props; const { dispatch, ListHouse } = this.props;
dispatch(createAction('HouseDetail/getHouseDetail')(navigation.state.params.id)); dispatch(createAction('HouseDetail/getHouseDetail')(ListHouse.houseID));
} }
onSubmit = () => { onSubmit = () => {
this.props.form.validateFields({ force: true }, (error, value) => { this.props.form.validateFields({ force: true }, (error, value) => {
if (!error) { if (!error) {
// 校验成功执行这里的代码 // 校验成功执行这里的代码
console.info({ id: this.props.navigation.state.params.id, singularData: value }); console.info({ id: this.props.navigation.state.params.id, singularData: value });
this.props.dispatch(createAction('HouseDetail/updateHouseDetail')({ id: this.props.navigation.state.params.id, singularData: value })); this.props.dispatch(createAction('HouseDetail/updateHouseDetail')({ id: this.props.ListHouse.houseID, singularData: value }));
console.log(this.props.form.getFieldsValue()); console.log(this.props.form.getFieldsValue());
} else { } else {
// 执行出现错误,弹出错处理 // 执行出现错误,弹出错处理
......
...@@ -2,98 +2,143 @@ ...@@ -2,98 +2,143 @@
* Created by zhouhuan on 2017/10/30. * Created by zhouhuan on 2017/10/30.
*/ */
import React from 'react'; import React from 'react';
import { createForm } from 'rc-form';
import { View, StyleSheet, FlatList, Text, ScrollView } from 'react-native'; import { View, StyleSheet, FlatList, Text, ScrollView } from 'react-native';
import { Card, WingBlank, WhiteSpace } from 'antd-mobile'; import { Card, WingBlank, WhiteSpace, Button, List, InputItem } from 'antd-mobile';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { createAction } from '../../../utils'; import { createAction } from '../../../utils';
@connect(({ obligeeInfo }) => ({ obligeeInfo })) @connect(({ obligeeInfo, ListHouse }) => ({ obligeeInfo, ListHouse }))
class ObligeeInfo extends React.Component { class ObligeeInfo extends React.Component {
componentDidMount() { componentDidMount() {
this.props.dispatch(createAction('obligeeInfo/getObligeeInfo')()); const { houseID } = this.props.ListHouse;
this.props.dispatch(createAction('obligeeInfo/getObligeeInfo')(houseID));
} }
onPress = () => {
const ID = this.props.obligeeInfo.sourceData.id;
this.props.dispatch(createAction('obligeeInfo/getObligeeDetail')(ID));
};
render() { render() {
const { sourceData } = this.props.obligeeInfo; const { sourceData, isDetail, detailData } = this.props.obligeeInfo;
console.log(sourceData); console.log(detailData);
const { getFieldProps } = this.props.form;
if (isDetail === false) {
return ( return (
<ScrollView > <ScrollView >
<WingBlank size="lg"> <WingBlank size="lg">
<WhiteSpace size="lg" /> <WhiteSpace size="lg" />
<Card> <Card>
<Card.Header <Card.Header
title="张三" title={sourceData.dangShiRenXingMing}
extra={<Text style={Styles.cardText}>&gt;&gt;详情</Text>} extra={<Text style={Styles.cardText} onPress={this.onPress}>&gt;&gt;详情</Text>}
/> />
<Card.Body> <Card.Body>
<Text style={Styles.cardBodyText}>性别:<Text style={Styles.cardBodyText2}></Text></Text> <Text style={Styles.cardBodyText}>当事人编号:<Text style={Styles.cardBodyText2}>{sourceData.dangShiRenBianHao}</Text></Text>
<Text style={Styles.cardBodyText}>证件号码:<Text style={Styles.cardBodyText2}>350502199210236034</Text></Text> <Text style={Styles.cardBodyText}>证件号码:<Text style={Styles.cardBodyText2}>{sourceData.dangShiRenIdentityCard}</Text></Text>
<Text style={Styles.cardBodyText}>与户主关系:<Text style={Styles.cardBodyText2}>户主</Text></Text>
</Card.Body>
</Card>
<WhiteSpace size="lg" />
</WingBlank>
<WingBlank size="lg">
<WhiteSpace size="lg" />
<Card>
<Card.Header
title="张三"
extra={<Text style={Styles.cardText}>&gt;&gt;详情</Text>}
/>
<Card.Body>
<Text style={Styles.cardBodyText}>性别:</Text>
<Text style={Styles.cardBodyText}>证件号码:350502199210236034</Text>
<Text style={Styles.cardBodyText}>与户主关系:户主</Text>
</Card.Body>
</Card>
<WhiteSpace size="lg" />
</WingBlank>
<WingBlank size="lg">
<WhiteSpace size="lg" />
<Card>
<Card.Header
title="张三"
extra={<Text style={Styles.cardText}>&gt;&gt;详情</Text>}
/>
<Card.Body>
<Text style={Styles.cardBodyText}>性别:</Text>
<Text style={Styles.cardBodyText}>证件号码:350502199210236034</Text>
<Text style={Styles.cardBodyText}>与户主关系:户主</Text>
</Card.Body>
</Card>
<WhiteSpace size="lg" />
</WingBlank>
<WingBlank size="lg">
<WhiteSpace size="lg" />
<Card>
<Card.Header
title="张三"
extra={<Text style={Styles.cardText}>&gt;&gt;详情</Text>}
/>
<Card.Body>
<Text style={Styles.cardBodyText}>性别:</Text>
<Text style={Styles.cardBodyText}>证件号码:350502199210236034</Text>
<Text style={Styles.cardBodyText}>与户主关系:户主</Text>
</Card.Body>
</Card>
<WhiteSpace size="lg" />
</WingBlank>
<WingBlank size="lg">
<WhiteSpace size="lg" />
<Card>
<Card.Header
title="张三"
extra={<Text style={Styles.cardText}>&gt;&gt;详情</Text>}
/>
<Card.Body>
<Text style={Styles.cardBodyText}>性别:</Text>
<Text style={Styles.cardBodyText}>证件号码:350502199210236034</Text>
<Text style={Styles.cardBodyText}>与户主关系:户主</Text>
</Card.Body> </Card.Body>
</Card> </Card>
<WhiteSpace size="lg" /> <WhiteSpace size="lg" />
</WingBlank> </WingBlank>
</ScrollView > </ScrollView >
); );
} else {
return (
<ScrollView>
<List>
<InputItem
{...getFieldProps('dangShiRenXingMing', {
initialValue: detailData.dangShiRenXingMing,
rules: [
{ required: true, message: '不允许为空' },
{ validator: this.validateFWBianMa },
],
})}
clear
placeholder="请输入"
ref={(el) => { this.customFocusInst = el; }}
>
姓名
</InputItem>
<InputItem
{...getFieldProps('dangShiRenXingBie', {
initialValue: detailData.dangShiRenXingBie,
})}
clear
placeholder="请输入"
ref={(el) => { this.customFocusInst = el; }}
>
性别
</InputItem>
<InputItem
{...getFieldProps('dangShiRenTelephone', {
initialValue: detailData.dangShiRenTelephone,
})}
clear
placeholder="请输入"
ref={(el) => { this.customFocusInst = el; }}
>
电话号码
</InputItem>
<InputItem
{...getFieldProps('dangShiRenIdentityCard', {
initialValue: detailData.dangShiRenIdentityCard,
})}
clear
placeholder="请输入"
ref={(el) => { this.customFocusInst = el; }}
>
身份证号码
</InputItem>
<InputItem
{...getFieldProps('dangShiRenIdentityCardbak', {
initialValue: detailData.dangShiRenIdentityCardbak,
})}
clear
placeholder="请输入"
ref={(el) => { this.customFocusInst = el; }}
>
身份证类型
</InputItem>
<InputItem
{...getFieldProps('dangShiRenAddress', {
initialValue: detailData.dangShiRenAddress,
})}
clear
placeholder="请输入"
ref={(el) => { this.customFocusInst = el; }}
>
地址
</InputItem>
<InputItem
{...getFieldProps('DSRMaritalStatus', {
initialValue: detailData.DSRMaritalStatus,
})}
clear
placeholder="请输入"
ref={(el) => { this.customFocusInst = el; }}
>
婚姻状态
</InputItem>
<InputItem
{...getFieldProps('DSRCensusType', {
initialValue: detailData.DSRCensusType,
})}
clear
placeholder="请输入"
ref={(el) => { this.customFocusInst = el; }}
>
是否原村民
</InputItem>
<List.Item>
<View style={{ flexDirection: 'row' }}>
<Button type="primary" onClick={this.onEdit}>编辑</Button>
<Button onClick={this.onReset}>返回</Button>
</View>
</List.Item>
</List>
</ScrollView>
);
}
} }
} }
const Styles = StyleSheet.create({ const Styles = StyleSheet.create({
...@@ -106,4 +151,4 @@ const Styles = StyleSheet.create({ ...@@ -106,4 +151,4 @@ const Styles = StyleSheet.create({
marginLeft: 13, marginLeft: 13,
}, },
}); });
export default ObligeeInfo; export default createForm()(ObligeeInfo);
...@@ -20,7 +20,8 @@ class ListHouContent extends Component { ...@@ -20,7 +20,8 @@ class ListHouContent extends Component {
} }
}; };
onPressItem = (id) => { onPressItem = (id) => {
this.props.navigation.navigate('HouseDetail', { id }); // this.props.navigation.navigate('HouseDetail', { id });
this.props.dispatch(createAction('ListHouse/jumpPage')(id));
}; };
getItemLayout = (data, index) => ( getItemLayout = (data, index) => (
{ length: 120, offset: (120 + 1) * index, index } { length: 120, offset: (120 + 1) * index, index }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论