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({ |
|||
data: { |
|||
orgList: [], |
|||
orgIndex: 0, |
|||
pageNo: 1, |
|||
pageSize: 10, |
|||
list: [], |
|||
total: 0, |
|||
mobile: "", |
|||
name: "" |
|||
}, |
|||
data: { |
|||
orgList: [], |
|||
orgIndex: 0, |
|||
pageNo: 1, |
|||
pageSize: 10, |
|||
list: [], |
|||
total: 0, |
|||
mobile: "", |
|||
name: "" |
|||
}, |
|||
|
|||
onLoad(options) { |
|||
this.getOrg() |
|||
}, |
|||
getOrg() { |
|||
onLoad(options) { |
|||
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() |
|||
}) |
|||
}, |
|||
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 |
|||
}) |
|||
}, |
|||
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, |
|||
}).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() |
|||
} |
|||
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, |
|||
}).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() |
|||
} |
|||
} |
|||
}) |
Loading…
Reference in new issue