diff --git a/src/apps/AppGridManagement/AddFamily.vue b/src/apps/AppGridManagement/AddFamily.vue index 1b859db2..edd7d864 100644 --- a/src/apps/AppGridManagement/AddFamily.vue +++ b/src/apps/AppGridManagement/AddFamily.vue @@ -117,7 +117,6 @@ export default { this.userId = option.id this.areaId = this.user.areaId this.areaName = this.user.areaName - console.log(this.userId) }, onShow() { document.title = '新增责任家庭' diff --git a/src/apps/AppGridManagement/FamilyList.vue b/src/apps/AppGridManagement/FamilyList.vue index ce1979e5..a2c7a896 100644 --- a/src/apps/AppGridManagement/FamilyList.vue +++ b/src/apps/AppGridManagement/FamilyList.vue @@ -1,10 +1,14 @@ @@ -34,6 +40,8 @@ export default { list:[], current:1, userId: '', + edit: true, + checked: true } }, methods: { @@ -47,6 +55,39 @@ export default { toAddFamily(){ uni.navigateTo({url: `./AddFamily?id=${this.userId}`}) }, + userClick(index) { + this.list[index].checked = !this.list[index].checked + this.$forceUpdate() + }, + // 点击删除 + delFamily(){ + var ids = [] + this.list.map((item) => { + if(item.checked) { + ids.push(item.gmrId) + } + }) + + if(!ids.length) { + return this.$u.toast('请选中需要删除的家庭户主') + } + this.$confirm(`是否删除这些关联家庭信息?`).then(() => { + this.$http.post(`/app/appgirdmemberresident/delete?ids=${ids.join(',')}`).then((res) => { + if (res.code == 0) { + this.$u.toast('删除成功') + uni.$emit('updateList') + this.$forceUpdate() + this.edit = true + } + }) + }) + }, + changeType() { + this.edit = false + this.list.map((item) => { + item.checked = false + }) + } }, onLoad(option) { this.userId = option.id @@ -70,6 +111,8 @@ export default {