epmet 工作端 小程序
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.

179 lines
5.3 KiB

import {
communityselforganizationlist,
getGridMemberListByAgencyId,
icpartyunitList,
publicWelfarePost, volunteer
} from "../../utils/statisticsApi";
const App = getApp();
Component({
options: {
styleIsolation: 'shared',
},
properties: {
visible: {
type: Boolean,
value: false
},
},
data: {
options: [
{
label: '人资源',
children: [
{
label: "网格员",
value: "staffGrid",
},
{
label: "公益岗",
value: "publicWelfareNum",
},
{
label: "志愿者",
value: "volunteer",
},
{
label: "社区自组织",
value: "4",
},
{
label: "联建单位",
value: "5",
},
/* {
label: "15分钟生活圈商家",
value: "6",
}*/
]
},
{
label: '物资源',
children: []
},
{
label: '场所资源',
children: []
}
],
typeIndex: 0,
subTypeOptions: [],
subTypeIndex: 0,
isShowViews: false,
pageNo: 1,
viewData: {}
},
ready: function () {
this.typeChange()
this.getList();
},
methods: {
close() {
this.triggerEvent('close')
},
typeChange() {
this.setData({
subTypeIndex: 0,
subTypeOptions: this.data.options[this.data.typeIndex].children
})
},
handleViews(e) {
let data = e.currentTarget.dataset.obj
let peopleType = this.data.subTypeOptions[this.data.subTypeIndex].value
let type = peopleType === 'volunteer' ? 1 :
peopleType === '5' ? 2 :
peopleType === '4' ? 3 :
peopleType === 'staffGrid' ? 4 :
peopleType === 'publicWelfareNum' ? 5 : ''
this.setData({
viewData: {
type,
id: type === 3 ? data.orgId : data.id,
data
},
isShowViews: true,
})
},
handleDispatchOrder(e) {
let data = e.currentTarget.dataset.obj
this.triggerEvent('dispatchOrder', data)
},
handleCallPhone(e) {
wx.makePhoneCall({
phoneNumber: e.currentTarget.dataset.mobile
})
},
viewsClose() {
this.setData({
isShowViews: false
})
},
search() {
this.setData({
pageNo: 1,
list: []
})
this.getList()
},
getList() {
console.log(this.data.subTypeIndex)
let subTypeIndex = this.data.subTypeOptions[this.data.subTypeIndex].value
if (subTypeIndex === 'staffGrid' || subTypeIndex === 'publicWelfareNum' || subTypeIndex === 'volunteer') {
this.getGridList()
}
if (subTypeIndex === '4') {
this.getsqzz()
}
if (subTypeIndex === '5') {
this.getljdw()
}
},
getsqzz() {
communityselforganizationlist({
agencyId: this.data.agencyId || App.globalData.user.agencyId,
pageNo: this.data.pageNo,
pageSize: 5
}).then(res => {
this.setData({
list: this.data.list.concat(res.data.list),
total: res.data.total
})
})
},
getljdw() {
icpartyunitList({
agencyId: this.data.agencyId || App.globalData.user.agencyId,
pageNo: this.data.pageNo,
pageSize: 5
}).then(res => {
this.setData({
list: this.data.list.concat(res.data.list),
total: res.data.total
})
})
},
getGridList() {
getGridMemberListByAgencyId({
orgId: this.data.agencyId || App.globalData.user.agencyId,
level: 'agency',
personnelType: this.data.subTypeOptions[this.data.subTypeIndex].value
}).then(res => {
this.setData({
list: res.data.personnelInfoVOList
})
})
},
scrolltolower() {
let subTypeIndex = this.data.subTypeOptions[this.data.subTypeIndex].value
if (subTypeIndex === '4' || subTypeIndex === '5') {
if (this.data.list.length < this.data.total) {
this.setData({
pageNo: this.data.pageNo + 1
})
this.getList()
}
}
}
}
});