党员认证

This commit is contained in:
shijingjing
2022-11-11 15:08:54 +08:00
parent cbd1484160
commit 91c4b50066
4 changed files with 56 additions and 70 deletions

View File

@@ -40,20 +40,16 @@
slectList: [],
userList: [],
parentId: '',
isFormMap: 0, //1为网格地图 一级不允许选中
}
},
onLoad(option) {
if (option.isFormMap) {
this.isFormMap = option.isFormMap
}
onLoad() {
this.getPartyOrg()
this.SelectParty = uni.getStorageSync("lastSelectedParty") || {}
},
methods: {
getPartyOrg() {
this.$instance.post(`/app/partyOrganization/queryPartyOrganizationServiceList`).then((res) => {
if (res?.data) {
console.log(res);
let parents = res.data.map(e => e.parentId)
this.allData = res.data.map(e => ({...e, hasChildren: parents.includes(e.id)}))
this.treeInit()
@@ -61,23 +57,22 @@
})
},
treeInit() {
// let last = uni.getStorageSync("lastSelectedParty")
// if (last) {
// this.$instance.post("/app/appgirdinfo/listFatherGirdInfo", null, {
// params: {id: last}
// }).then(res => {
// if (res?.data) {
// this.slectList = [{name: '可选范围', id: ''}, res.data].flat()
// this.getPartyAndParent({id: last})
// }
// })
// this.getPartyAndParent({id: last})
// } else {
this.treeList = this.allData.filter(e => !e.parentId)
this.treeList.map((item) => item.isChecked = false)
let obj = {name: '可选范围', id: ''}
this.slectList.push(obj)
// }
let last = uni.getStorageSync("lastSelectedParty")
if (last) {
console.log(last);
this.allData.map((item) => {
if(item.id == last.id) {
item.isChecked = true
} else {
item.isChecked = false
}
})
} else {
this.allData.map((item) => item.isChecked = false)
}
this.treeList = this.allData.filter(e => !e.parentId)
let obj = {name: '可选范围', id: ''}
this.slectList.push(obj)
},
itemClick(row) {
if (row.hasChildren) {
@@ -125,8 +120,8 @@
},
submit() {
console.log(this.SelectParty);
if (this.SelectParty.id != null) {
uni.setStorageSync("lastSelectedParty", this.SelectParty.parentId)
if (this.SelectParty.id) {
uni.setStorageSync("lastSelectedParty", this.SelectParty)
uni.navigateBack({
success: () => {
uni.$emit("pagePicker:custom", this.SelectParty)