6 changed files with 442 additions and 389 deletions
@ -1,67 +1,75 @@ |
|||||
import {getPotentialDissatisfiedCountDetail, maporg} from "../../../../utils/statisticsApi"; |
import { getPotentialDissatisfiedCountDetail, maporg } from "../../../../utils/statisticsApi"; |
||||
|
|
||||
Page({ |
Page({ |
||||
data: { |
data: { |
||||
orgList: [], |
orgList: [], |
||||
orgIndex: 0, |
orgIndex: 0, |
||||
pageNo: 1, |
pageNo: 1, |
||||
pageSize: 10, |
pageSize: 10, |
||||
list: [], |
list: [], |
||||
total: 0, |
total: 0, |
||||
mobile: "", |
mobile: "", |
||||
name: "" |
name: "" |
||||
}, |
}, |
||||
|
|
||||
onLoad(options) { |
onLoad(options) { |
||||
this.getOrg() |
this.getOrg() |
||||
}, |
}, |
||||
getOrg() { |
getOrg() { |
||||
|
|
||||
maporg().then(async ({data}) => { |
maporg().then(async ({ data }) => { |
||||
let parent = {value: data.id, label: data.name} |
let parent = { value: data.id, label: data.name } |
||||
this.setData({ |
this.setData({ |
||||
orgList: [ |
orgList: [ |
||||
parent, ...data.children.map(item => { |
parent, ...data.children.map(item => { |
||||
return { |
return { |
||||
value: item.id, |
value: item.id, |
||||
label: item.name |
label: item.name |
||||
} |
} |
||||
}) |
}) |
||||
] |
] |
||||
}) |
}) |
||||
this.getList() |
this.getList() |
||||
}) |
}) |
||||
}, |
}, |
||||
|
|
||||
gotopage({currentTarget: {dataset}}) { |
gotopage({ currentTarget: { dataset } }) { |
||||
const {url} = dataset; |
const { url } = dataset; |
||||
wx.navigateTo({url}) |
wx.navigateTo({ url }) |
||||
}, |
}, |
||||
setVal(e) { |
setVal(e) { |
||||
this.setData({ |
this.setData({ |
||||
[e.currentTarget.dataset.key]: e.detail.value |
[e.currentTarget.dataset.key]: e.detail.value |
||||
}) |
}) |
||||
}, |
}, |
||||
getList() { |
search() { |
||||
getPotentialDissatisfiedCountDetail({ |
this.setData({ |
||||
pageNo: this.data.pageNo, |
pageNo: 1, |
||||
pageSize: this.data.pageSize, |
list: [], |
||||
agencyId: this.data.orgList[this.data.orgIndex].value, |
total: 0, |
||||
name: this.data.name, |
}) |
||||
mobile: this.data.mobile, |
this.getList() |
||||
}).then(({data}) => { |
}, |
||||
this.setData({ |
getList() { |
||||
list: this.data.list.concat(data.list), |
getPotentialDissatisfiedCountDetail({ |
||||
total: data.total |
pageNo: this.data.pageNo, |
||||
}) |
pageSize: this.data.pageSize, |
||||
}); |
agencyId: this.data.orgList[this.data.orgIndex].value, |
||||
}, |
name: this.data.name, |
||||
onReachBottom() { |
mobile: this.data.mobile, |
||||
if (this.data.list.length < this.data.total) { |
}).then(({ data }) => { |
||||
this.setData({ |
this.setData({ |
||||
pageNo: this.data.pageNo + 1 |
list: this.data.list.concat(data.list), |
||||
}) |
total: data.total |
||||
this.getList() |
}) |
||||
} |
}); |
||||
|
}, |
||||
|
onReachBottom() { |
||||
|
if (this.data.list.length < this.data.total) { |
||||
|
this.setData({ |
||||
|
pageNo: this.data.pageNo + 1 |
||||
|
}) |
||||
|
this.getList() |
||||
} |
} |
||||
|
} |
||||
}) |
}) |
Loading…
Reference in new issue