|
|
@@ -22,7 +22,7 @@ const Contact = props => {
|
|
|
const [state, setState] = useState({
|
|
|
data: [],
|
|
|
journal: [],
|
|
|
- servicelog:[],
|
|
|
+ servicelog: [],
|
|
|
total: 0,
|
|
|
id: '',
|
|
|
visible: false
|
|
|
@@ -31,6 +31,20 @@ const Contact = props => {
|
|
|
visible: false,
|
|
|
loading: false
|
|
|
})
|
|
|
+ const initData = async payload => {
|
|
|
+ const {
|
|
|
+ code = -1,
|
|
|
+ data: { client = [], log = [], serviceLog = [], total = 0 } = {
|
|
|
+ client: [],
|
|
|
+ log: [],
|
|
|
+ serviceLog: [],
|
|
|
+ total: 0
|
|
|
+ }
|
|
|
+ } = await queryContact(payload)
|
|
|
+ if (code === consts.RET_CODE.SUCCESS) {
|
|
|
+ setState({ ...state, data: client, journal: log, servicelist: serviceLog, total })
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
const handleAddClient = async values => {
|
|
|
setAddClient({ ...addClient, loading: true })
|
|
|
@@ -43,15 +57,7 @@ const Contact = props => {
|
|
|
setAddClient({ ...addClient, loading: false, visible: false })
|
|
|
await initData()
|
|
|
}
|
|
|
- const initData = async payload => {
|
|
|
- const {
|
|
|
- code = -1,
|
|
|
- data: { client = [], log = [], serviceLog = [], total = 0 } = { client: [], log: [], serviceLog: [], total: 0 }
|
|
|
- } = await queryContact(payload)
|
|
|
- if (code === consts.RET_CODE.SUCCESS) {
|
|
|
- setState({ ...state, data: client, journal: log, servicelist: serviceLog, total })
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
// 展示drawer
|
|
|
const showDrawer = id => {
|
|
|
// console.log(id);
|
|
|
@@ -341,7 +347,7 @@ const Contact = props => {
|
|
|
initData({ search: value })
|
|
|
}
|
|
|
|
|
|
- const handleOnselect = payload => {
|
|
|
+ const onDistrictChange = payload => {
|
|
|
initData({ ...payload })
|
|
|
}
|
|
|
return (
|
|
|
@@ -365,7 +371,7 @@ const Contact = props => {
|
|
|
onSearch: handleSearch
|
|
|
},
|
|
|
actions: [
|
|
|
- <LazyCascader onSelect={handleOnselect} key="LazyCascader" />,
|
|
|
+ <LazyCascader onChange={onDistrictChange} key="LazyCascader" />,
|
|
|
<Button
|
|
|
key="button"
|
|
|
type="primary"
|