Audit.js
5.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
import React, { Component } from 'react';
import { connect } from 'dva';
import { routerRedux } from 'dva/router';
import { Tabs, Toast } from 'antd-mobile';
import MemberList from '../../components/MemberList/MemberList';
import { dataFilter } from '../../utils/dataFilter';
import shareHide from "../../utils/shareHide";
import css from './css.less';
class Audit extends Component{
constructor(props) {
super(props);
this.state = {
clientList: [],
cientListed: [],
storeclientList: [],
storecientListed: [],
isShowPassedInfo: false,
infoList: {},
show: false,
show1: false
}
}
componentDidMount() {
shareHide();
Toast.loading('loading...', 88);
this.getClientUnpassList();
}
getClientPassedList() {
Toast.loading('loading...',88);
const _this = this;
this.props.dispatch({
type: 'governortraining/getClientList',
payload: {
id: window.localStorage.getItem("id"),
auditedState: 1
},
callback(res) {
if (res.status) {
_this.setState({
cientListed: res.data,
storecientListed: res.data,
show: true
}, () => {
Toast.hide();
})
}
}
})
}
getClientUnpassList() {
const _this = this;
this.props.dispatch({
type: 'governortraining/getClientList',
payload: {
id: window.localStorage.getItem("id"),
auditedState: 0
},
callback(res) {
if (res.status) {
_this.setState({
clientList: res.data,
storeclientList: res.data,
show1: true
}, () => {
Toast.hide();
})
}
}
});
}
chooseClient(pass, item) {
localStorage.setItem('auditClientInfo', JSON.stringify({ ...item, isShowPassedInfo: pass }));
this.props.dispatch(routerRedux.push({
pathname: '/governortraining/auditinfo'
}));
}
render() {
return <div className={css.auditWrap}>
<Tabs
tabs={[{ title: '未审核', sub: '1' }, { title: '已审核', sub: '2' }]}
// page={1}
onChange={(t, i) => {
if (i === 0 && this.state.clientList.length === 0) { this.getClientUnpassList(); } else if (this.state.cientListed.length === 0){
this.getClientPassedList();
}
}}
>
<div>
{
this.state.clientList.length === 0 && this.state.show1 && < div >
<div className={css.splitline}></div>
<div className={css.noData}>
<div className={css.img}></div>
您当前客户均已审核完毕
</div>
</div>
}
{ this.state.clientList.length>0 && this.state.show1 && <MemberList
dataList={this.state.storeclientList}
renderType={['name']}
filterData={(keywords) => {
this.setState({
storeclientList: dataFilter(this.state.clientList, ['name'], keywords)
})
}}
renderItem={item => {
return <div className={css.clientItem}>
<span className={css.name}>{item.name}</span><span className={css.time}>{item.createTime.substr(0,16)}</span>
</div>
}}
chooseClient={this.chooseClient.bind(this,false)}
pTitle='未审核客户' />}
</div>
<div>
{
this.state.cientListed.length === 0 && this.state.show && < div >
<div className={css.splitline}></div>
<div className={css.noData}>
<div className={css.img}></div>
您当前没有已审核客户
</div>
</div>
}
{this.state.cientListed.length>0 && this.state.show && <MemberList
dataList={this.state.storecientListed}
renderType={['name']}
chooseClient={this.chooseClient.bind(this,true)}
filterData={(keywords) => {
this.setState({
storecientListed: dataFilter(this.state.cientListed, ['name'], keywords)
})
}}
renderItem={item => {
let status = '';
switch (item.currentState) {
case '2':
status = '审核退回';
break;
case '3':
status = '审核通过';
break;
case '4':
status = '已成单';
break;
case '5':
status = '已上传';
break;
case '6':
status = '跟进中';
break;
case '7':
status = '停止跟进';
break;
default:
}
return <div className={css.clientItem}>
<span className={css.name}>{item.name}</span>
<span className={css.time}>{item.createTime.substr(0, 16)}</span>
<span className={css.status}>{status}</span>
</div>
}}
pTitle='已审核客户' />}
</div>
</Tabs>
</div>
}
}
export default connect()(Audit);