Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
manager-app-sz
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
ReactNative
manager-app-sz
Commits
b50ca662
提交
b50ca662
authored
10月 31, 2017
作者:
zhouhuan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
权利人信息修改保存
上级
b55438df
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
99 行增加
和
7 行删除
+99
-7
ObligeeInfo.js
src/models/houseinfo/ObligeeInfo.js
+56
-1
ObligeeInfo.js
src/routes/main/houseinfo/ObligeeInfo.js
+43
-6
没有找到文件。
src/models/houseinfo/ObligeeInfo.js
浏览文件 @
b50ca662
/**
* Created by zhouhuan on 2017/10/30.
*/
import
{
NavigationActions
}
from
'react-navigation'
;
import
{
getData
}
from
'../../utils/DataTemplate'
;
import
{
datasourceApi
}
from
'../../services/datasource'
;
export
default
{
namespace
:
'obligeeInfo'
,
...
...
@@ -9,6 +11,7 @@ export default {
sourceData
:
{},
detailData
:
{},
isDetail
:
false
,
editable
:
false
,
},
effects
:
{
*
getObligeeInfo
({
payload
},
{
put
,
call
,
select
})
{
...
...
@@ -26,7 +29,7 @@ export default {
const
singularData
=
result
[
0
];
yield
put
({
type
:
'setDSRList'
,
payload
:
{
...
singularData
}
});
},
*
getObligeeDetail
({
payload
},
{
put
,
call
,
select
})
{
*
getObligeeDetail
({
payload
},
{
put
,
call
})
{
const
coordinate
=
{
containerType
:
'module'
,
containerName
:
'query-DSRInfo'
,
...
...
@@ -37,6 +40,52 @@ export default {
yield
put
({
type
:
'getDSRDetail'
,
payload
:
{
...
result
[
0
]
}
});
yield
put
({
type
:
'setDetail'
,
payload
:
true
});
},
*
updateDSRDetail
({
payload
},
{
call
,
put
})
{
console
.
log
(
'update'
);
console
.
log
(
payload
);
const
coordinate
=
{
containerType
:
'module'
,
containerName
:
'query-DSRInfo'
,
datasourceName
:
'QueryDSRInfoDetails'
,
};
const
api
=
datasourceApi
(
coordinate
);
yield
call
(
api
.
update
,
payload
.
id
,
payload
.
singularData
);
yield
put
(
NavigationActions
.
navigate
({
routeName
:
'ObligeeInfo'
,
}));
yield
put
({
type
:
'setEdit'
,
payload
:
false
});
},
*
onSBack
({
payload
},
{
put
,
call
})
{
console
.
log
(
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
(
NavigationActions
.
navigate
({
routeName
:
'ObligeeInfo'
,
}));
yield
put
({
type
:
'setDetail'
,
payload
:
true
});
yield
put
({
type
:
'setEdit'
,
payload
:
false
});
},
*
onEBack
({
payload
},
{
put
,
call
})
{
console
.
log
(
payload
);
const
coordinate
=
{
containerType
:
'module'
,
containerName
:
'query-DSRInfo'
,
datasourceName
:
'QueryDSRInfoTable'
,
};
const
result
=
yield
call
(
getData
,
coordinate
,
{
params
:
{
pID
:
payload
}
});
const
singularData
=
result
[
0
];
yield
put
({
type
:
'setDSRList'
,
payload
:
{
...
singularData
}
});
yield
put
(
NavigationActions
.
navigate
({
routeName
:
'ObligeeInfo'
,
}));
yield
put
({
type
:
'setDetail'
,
payload
:
false
});
},
},
reducers
:
{
getDSRDetail
(
state
,
{
payload
})
{
...
...
@@ -57,6 +106,12 @@ export default {
isDetail
:
payload
,
};
},
setEdit
(
state
,
{
payload
})
{
return
{
...
state
,
editable
:
payload
,
};
},
},
};
src/routes/main/houseinfo/ObligeeInfo.js
浏览文件 @
b50ca662
...
...
@@ -18,10 +18,42 @@ class ObligeeInfo extends React.Component {
const
ID
=
this
.
props
.
obligeeInfo
.
sourceData
.
id
;
this
.
props
.
dispatch
(
createAction
(
'obligeeInfo/getObligeeDetail'
)(
ID
));
};
onEdit
=
()
=>
{
console
.
log
(
'detail'
);
this
.
props
.
dispatch
(
createAction
(
'obligeeInfo/setEdit'
)(
true
));
};
onSubmit
=
()
=>
{
console
.
log
(
'submit'
);
this
.
props
.
form
.
validateFields
({
force
:
true
},
(
error
,
value
)
=>
{
console
.
log
(
value
);
if
(
!
error
)
{
this
.
props
.
dispatch
(
createAction
(
'obligeeInfo/updateDSRDetail'
)({
id
:
this
.
props
.
obligeeInfo
.
sourceData
.
id
,
singularData
:
value
}));
}
else
{
console
.
log
(
'Validation failed'
);
}
});
}
onEditBack
=
()
=>
{
console
.
log
(
'onEditBack'
);
const
{
houseID
}
=
this
.
props
.
ListHouse
;
console
.
log
(
houseID
);
this
.
props
.
dispatch
(
createAction
(
'obligeeInfo/onEBack'
)(
houseID
));
}
onSaveBack
=
()
=>
{
console
.
log
(
'onSaveBack'
);
const
{
houseID
}
=
this
.
props
.
ListHouse
;
this
.
props
.
dispatch
(
createAction
(
'obligeeInfo/onSBack'
)(
houseID
));
}
render
()
{
const
{
sourceData
,
isDetail
,
detailData
}
=
this
.
props
.
obligeeInfo
;
console
.
log
(
detailData
);
const
{
sourceData
,
isDetail
,
detailData
,
editable
}
=
this
.
props
.
obligeeInfo
;
console
.
log
(
this
.
props
.
obligeeInfo
);
const
{
getFieldProps
}
=
this
.
props
.
form
;
let
btnView
if
(
editable
===
false
)
{
btnView
=
(
<
View
style
=
{{
flexDirection
:
'row'
}}
><
Button
type
=
"primary"
onClick
=
{
this
.
onEdit
}
>
编辑
<
/Button><Button onClick={this.onEditBack}>返回</
Button
><
/View>
)
;
}
else
{
btnView
=
(
<
View
style
=
{{
flexDirection
:
'row'
}}
><
Button
type
=
"primary"
onClick
=
{
this
.
onSubmit
}
>
保存
<
/Button><Button onClick={this.onSaveBack}>返回</
Button
><
/View>
)
;
}
if
(
isDetail
===
false
)
{
return
(
<
ScrollView
>
...
...
@@ -55,6 +87,7 @@ class ObligeeInfo extends React.Component {
})}
clear
placeholder
=
"请输入"
editable
=
{
editable
}
ref
=
{(
el
)
=>
{
this
.
customFocusInst
=
el
;
}}
>
姓名
...
...
@@ -65,6 +98,7 @@ class ObligeeInfo extends React.Component {
})}
clear
placeholder
=
"请输入"
editable
=
{
editable
}
ref
=
{(
el
)
=>
{
this
.
customFocusInst
=
el
;
}}
>
性别
...
...
@@ -75,6 +109,7 @@ class ObligeeInfo extends React.Component {
})}
clear
placeholder
=
"请输入"
editable
=
{
editable
}
ref
=
{(
el
)
=>
{
this
.
customFocusInst
=
el
;
}}
>
电话号码
...
...
@@ -85,6 +120,7 @@ class ObligeeInfo extends React.Component {
})}
clear
placeholder
=
"请输入"
editable
=
{
editable
}
ref
=
{(
el
)
=>
{
this
.
customFocusInst
=
el
;
}}
>
身份证号码
...
...
@@ -95,6 +131,7 @@ class ObligeeInfo extends React.Component {
})}
clear
placeholder
=
"请输入"
editable
=
{
editable
}
ref
=
{(
el
)
=>
{
this
.
customFocusInst
=
el
;
}}
>
身份证类型
...
...
@@ -105,6 +142,7 @@ class ObligeeInfo extends React.Component {
})}
clear
placeholder
=
"请输入"
editable
=
{
editable
}
ref
=
{(
el
)
=>
{
this
.
customFocusInst
=
el
;
}}
>
地址
...
...
@@ -115,6 +153,7 @@ class ObligeeInfo extends React.Component {
})}
clear
placeholder
=
"请输入"
editable
=
{
editable
}
ref
=
{(
el
)
=>
{
this
.
customFocusInst
=
el
;
}}
>
婚姻状态
...
...
@@ -125,15 +164,13 @@ class ObligeeInfo extends React.Component {
})}
clear
placeholder
=
"请输入"
editable
=
{
editable
}
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
>
{
btnView
}
<
/List.Item
>
<
/List
>
<
/ScrollView
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论