You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
1.6 KiB
80 lines
1.6 KiB
import { getPotentialDissatisfiedCountDetail, maporg } from "../../../../utils/statisticsApi";
|
|
|
|
Page({
|
|
data: {
|
|
orgList: [],
|
|
orgIndex: 0,
|
|
pageNo: 1,
|
|
pageSize: 10,
|
|
list: [],
|
|
total: 0,
|
|
mobile: "",
|
|
name: "",
|
|
countType: ''
|
|
},
|
|
|
|
onLoad(options) {
|
|
this.setData({
|
|
countType: options.countType
|
|
})
|
|
this.getOrg()
|
|
},
|
|
getOrg() {
|
|
|
|
maporg().then(async ({ data }) => {
|
|
let parent = { value: data.id, label: data.name }
|
|
this.setData({
|
|
orgList: [
|
|
parent, ...data.children.map(item => {
|
|
return {
|
|
value: item.id,
|
|
label: item.name
|
|
}
|
|
})
|
|
]
|
|
})
|
|
this.getList()
|
|
})
|
|
},
|
|
|
|
gotopage({ currentTarget: { dataset } }) {
|
|
const { url } = dataset;
|
|
wx.navigateTo({ url })
|
|
},
|
|
setVal(e) {
|
|
this.setData({
|
|
[e.currentTarget.dataset.key]: e.detail.value
|
|
})
|
|
},
|
|
search() {
|
|
this.setData({
|
|
pageNo: 1,
|
|
list: [],
|
|
total: 0,
|
|
})
|
|
this.getList()
|
|
},
|
|
getList() {
|
|
getPotentialDissatisfiedCountDetail({
|
|
pageNo: this.data.pageNo,
|
|
pageSize: this.data.pageSize,
|
|
agencyId: this.data.orgList[this.data.orgIndex].value,
|
|
name: this.data.name,
|
|
mobile: this.data.mobile,
|
|
countType: this.data.countType
|
|
}).then(({ data }) => {
|
|
this.setData({
|
|
list: this.data.list.concat(data.list),
|
|
total: data.total
|
|
})
|
|
});
|
|
},
|
|
onReachBottom() {
|
|
if (this.data.list.length < this.data.total) {
|
|
this.setData({
|
|
pageNo: this.data.pageNo + 1
|
|
})
|
|
this.getList()
|
|
}
|
|
}
|
|
})
|