Audit.js
3.56 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
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';
const stateName = ['未提交','已提交','已提交','已提交','已成单','已上传','跟进中','停止跟进']
class Audit extends Component{
constructor(props) {
super(props);
this.state = {
clientList: [],
cientListed: [],
storeclientList: [],
storecientListed: [],
isShowPassedInfo: false,
infoList: {},
show: false,
show1: false
}
}
componentDidMount() {
document.title = '我的客户';
shareHide();
// Toast.loading('loading...', 88);
this.getClientUnpassList();
// this.getClientPassedList();
}
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'
// }));
this.props.history.push({pathname: '/governortraining/auditinfo'})
}
render() {
return <div className={css.auditWrap}>
<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
id="audit"
height='86vh'
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.commitTime ? item.commitTime.substr(0,16) : ""}</span>
<span className={css.status}>{stateName[item.currentState]}</span>
</div>
}}
chooseClient={this.chooseClient.bind(this,false)}
pTitle='客户' />}
</div>
</div>
}
}
export default connect()(Audit);