/**
|
* 柯礼钦<kelq@hugeinfo.com.cn>
|
* 2018年9月4日 16:00
|
*
|
*/
|
|
import React from "react";
|
// import { Modal } from 'antd-mobile';
|
import { Radio, Input, Button, message, Breadcrumb } from "antd";
|
import moment from "moment";
|
import BusDetailView from "../view/BusDetailView";
|
import LineView from "../view/LineView";
|
import HeadView from "../view/HeadView";
|
import Fetch from "../fetch";
|
|
const RadioGroup = Radio.Group;
|
const { TextArea } = Input;
|
function typeOfName(type) {
|
switch (type) {
|
case '0':
|
return "普通用户";
|
case '1':
|
return "律师";
|
case '2':
|
return "人大代表";
|
case '3':
|
return "政协委员";
|
case '4':
|
return "人民监督员";
|
case '5':
|
return "特约监察员";
|
default:
|
return "其他";
|
}
|
}
|
|
function sexOfName(sexOfName) {
|
switch (sexOfName) {
|
case '0':
|
return "未知"
|
case '1':
|
return '男'
|
case '2':
|
return '女'
|
}
|
}
|
|
function sexOfStatus(status) {
|
switch (status) {
|
case 2:
|
return "审核通过"
|
case 3:
|
return '审核不通过'
|
case 4:
|
return '待补充材料'
|
}
|
}
|
export default class BusDetail extends React.Component {
|
constructor(props) {
|
super(props);
|
this.state = {
|
inputValue: '',
|
userinfo: [],
|
auditList: [],
|
otherAttList: [],
|
formdata: {}
|
};
|
}
|
|
componentDidMount() {
|
const { id } = this.props.match.params;
|
console.log(id)
|
Fetch.getUserDetail(id).then(data => {
|
this.setState({
|
userinfo: data.user,
|
auditList: data.auditList,
|
otherAttList: data.otherAttList
|
});
|
});
|
document.title = "用户详情";
|
}
|
|
goBack = () => {
|
this.props.history.goBack();
|
};
|
|
onInputChange = e => {
|
this.setState({
|
inputValue: e.target.value
|
});
|
};
|
|
onChange = (name, value) => {
|
|
const formdata = {
|
...this.state.formdata,
|
[name]: value
|
};
|
this.setState({ formdata });
|
|
};
|
submitAudit = () => {
|
const { id } = this.props.match.params;
|
const { inputValue, formdata } = this.state;
|
const value = formdata.radio;
|
if (!value) {
|
message.warning("请选择审批结论!");
|
return;
|
}
|
const businessType = 15;
|
const busId = id;
|
Fetch.userAudit({ inputValue, value, businessType, busId }).then(res => {
|
if (res.code === 0) {
|
message.success("审批成功!", 2, () => {
|
this.props.history.goBack();
|
});
|
} else {
|
message.error("审批失败!", 2);
|
}
|
});
|
};
|
|
render() {
|
const { userinfo, auditList, otherAttList } = this.state;
|
const { flag } = this.props.match.params;
|
return (
|
<div className="app-page">
|
<HeadView history={this.props.history} />
|
<Breadcrumb style={{ padding: '20px' }}>
|
<Breadcrumb.Item><a href="">后台中心</a></Breadcrumb.Item>
|
<Breadcrumb.Item>用户审核</Breadcrumb.Item>
|
</Breadcrumb>
|
<BusDetailView type="用户信息">
|
<LineView
|
title='用户信息'
|
style="35vh"
|
lineHeight="34px"
|
>
|
<table>
|
<tbody>
|
<tr>
|
<td className="table-vaule1">姓名</td>
|
<td className="table-vaule2">
|
{userinfo.userName || "无"}
|
</td>
|
<td className="table-vaule3">手机号码</td>
|
<td className="table-vaule4">{userinfo.mobile || "无"}</td>
|
</tr>
|
<tr>
|
<td className="table-vaule1">身份证号</td>
|
<td className="table-vaule2">
|
{userinfo.idcard || "无"}
|
</td>
|
<td className="table-vaule3">性别</td>
|
<td className="table-vaule4">
|
{sexOfName(userinfo.wxSex) || "无"}
|
</td>
|
</tr>
|
<tr>
|
<td className="table-vaule1">出生日期</td>
|
<td className="table-vaule2">
|
{userinfo.birthday || "无"}
|
</td>
|
<td className="table-vaule3">现居住地</td>
|
<td className="table-vaule4">
|
{userinfo.address || "无 "}
|
</td>
|
</tr>
|
<tr>
|
<td className="table-vaule1">户籍所在地</td>
|
<td className="table-vaule2">
|
{userinfo.bornAddress || "无"}
|
</td>
|
<td className="table-vaule3">职业</td>
|
<td className="table-vaule4">
|
{userinfo.profession || "无"}
|
</td>
|
</tr>
|
<tr>
|
<td className="table-vaule1">民族</td>
|
<td className="table-vaule2">
|
{userinfo.nation || "无"}
|
</td>
|
<td className="table-vaule1">工作单位</td>
|
<td className="table-vaule2">
|
{userinfo.workPlace || "无"}
|
</td>
|
</tr>
|
<tr>
|
<td className="table-vaule1">用户类型</td>
|
<td className="table-vaule2">
|
{typeOfName(userinfo.userType) || "无"}
|
</td>
|
<td className="table-vaule1">电子邮箱</td>
|
<td className="table-vaule2">
|
{userinfo.email || "无"}
|
</td>
|
</tr>
|
{
|
userinfo.userType == 1 ?
|
<tr>
|
<td className="table-vaule1">律师事务所名称</td>
|
<td className="table-vaule2">
|
{userinfo.lawyerOffice || "无"}
|
</td>
|
<td className="table-vaule1">律师编号</td>
|
<td className="table-vaule2">
|
{userinfo.lawyerNo || "无"}
|
</td>
|
</tr>
|
: null}
|
{
|
userinfo.userType > 1 ?
|
<tr>
|
<td className="table-vaule1">监督员编号</td>
|
<td className="table-vaule2">
|
{userinfo.userTypeId || "无"}
|
</td>
|
</tr>
|
: null
|
}
|
|
<tr>
|
<td className="table-vaule1">身份证照片</td>
|
</tr>
|
</tbody>
|
</table>
|
<div className="apply-img-div">
|
{userinfo.attachments
|
? userinfo.attachments.map((data, key) => (
|
<div style={{ marginRight: "10px" }} key={key}>
|
<a href={data.path} target='_black'> <img
|
src={data.path}
|
width='70px'
|
height='70px'
|
/></a>
|
</div>
|
))
|
: null}
|
</div>
|
</LineView>
|
{
|
otherAttList.length > 0 ?
|
(
|
<LineView title="其他材料" style="15vh">
|
<div className="apply-img-div">
|
{otherAttList
|
? otherAttList.map((data, key) => (
|
<div style={{ marginRight: "10px" }} key={key}>
|
<a href={data.path} target='_black'> <img
|
src={data.path}
|
width='70px'
|
height='70px'
|
/></a>
|
</div>
|
))
|
: null}
|
</div>
|
</LineView>
|
) : null}
|
{
|
auditList.length > 0 ?
|
(
|
<LineView title="审核记录" style="15vh">
|
<colgroup span="4" />
|
{auditList
|
? auditList.map((data, key) => (
|
<table>
|
<tbody>
|
<tr>
|
<td>审批状态:</td>
|
<td>{sexOfStatus(data.approvalStatus)}</td>
|
<td>审批结论:</td>
|
<td>{data.opinion}</td>
|
</tr>
|
<tr>
|
<td>审核人:</td>
|
<td>{data.approverName}</td>
|
<td>审核时间:</td>
|
<td>{moment(data.createTime).format(
|
"YYYY-MM-DD HH:mm"
|
)}</td>
|
</tr>
|
</tbody>
|
</table>
|
))
|
: null}
|
</LineView>
|
) : null}
|
|
{/* 业务的审批操作 */}
|
{flag === "do" ? (
|
<LineView title="申诉审批" lineHeight="50px">
|
<table>
|
<tbody>
|
<tr>
|
<td>审批结论</td>
|
<td>
|
<RadioGroup
|
onChange={e => {
|
this.onChange("radio", e.target.value);
|
}}
|
value={this.state.formdata.radio}
|
>
|
<Radio value={2}>审批通过</Radio>
|
<Radio value={3}>审核不通过</Radio>
|
<Radio value={4}>补充相关证件</Radio>
|
</RadioGroup>
|
</td>
|
</tr>
|
<tr>
|
<td>审批结论</td>
|
<td>
|
<TextArea
|
placeholder="请输入审批意见及理由"
|
autosize={{ minRows: 2, maxRows: 6 }}
|
onChange={this.onInputChange}
|
/>
|
</td>
|
</tr>
|
</tbody>
|
</table>
|
<div>
|
<Button
|
type="primary"
|
className="app-btn"
|
onClick={this.submitAudit}
|
>
|
提交审核
|
</Button>
|
<Button className="app-btn" onClick={this.goBack}>
|
返回
|
</Button>
|
</div>
|
</LineView>
|
) : <div style={{ textAlign: 'center' }}><Button className="app-btn" onClick={this.goBack}>返回</Button></div>}
|
</BusDetailView>
|
</div>
|
);
|
}
|
}
|