Browse Source

小区管理bug

origin/bugfix_relocation
jiangyy 4 years ago
parent
commit
5ddc09a484
  1. 35
      src/views/modules/base/community/buildTable.vue
  2. 4
      src/views/modules/base/community/community.vue
  3. 33
      src/views/modules/base/community/communityTable.vue
  4. 3
      src/views/modules/base/community/roomForm.vue
  5. 35
      src/views/modules/base/community/roomTable.vue

35
src/views/modules/base/community/buildTable.vue

@ -164,10 +164,12 @@
<div v-if="tableData.length>0" <div v-if="tableData.length>0"
class="div_del"> class="div_del">
<el-checkbox :indeterminate="isIndeterminate" <el-checkbox style="height:32px"
:indeterminate="isIndeterminate"
v-model="selAllFlag" v-model="selAllFlag"
@change="handleSelectAll">全选</el-checkbox> @change="handleSelectAll">全选</el-checkbox>
<el-button style="margin-left:15px" <el-button v-show="showDeletBtn"
style="margin-left:15px"
type="red" type="red"
size="small" size="small"
@click="deleteBatch">批量删除</el-button> @click="deleteBatch">批量删除</el-button>
@ -216,7 +218,9 @@ export default {
agencyObj: {},// agencyObj: {},//
ownerName: '', ownerName: '',
ownerPhone: '', ownerPhone: '',
tableData: [], validTableDataNum: 0,//
selection: [],
showDeletBtn: false,
//form //form
formShow: false, formShow: false,
@ -282,10 +286,12 @@ export default {
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
if (code === 0) { if (code === 0) {
this.validTableDataNum = 0
this.total = data.total this.total = data.total
data.list.forEach(item => { data.list.forEach(item => {
if (item.agencyId === this.staffAgencyId) { if (item.agencyId === this.staffAgencyId) {
item.showBtn = true item.showBtn = true
this.validTableDataNum++
} else { } else {
item.showBtn = false item.showBtn = false
} }
@ -376,7 +382,7 @@ export default {
selectAll (selection) { selectAll (selection) {
this.selection = selection this.selection = selection
if (selection.length > 0) { if (selection.length === this.validTableDataNum) {
this.selAllFlag = true this.selAllFlag = true
} else { } else {
this.selAllFlag = false this.selAllFlag = false
@ -385,19 +391,15 @@ export default {
}, },
selectionChange (selection) { selectionChange (selection) {
this.selection = selection this.selection = selection
this.isIndeterminate = false
if (selection.length === this.tableData.length) { if (selection.length === this.validTableDataNum) {
this.selAllFlag = true this.selAllFlag = true
this.isIndeterminate = false
} else if (selection.length > 0) {
this.selAllFlag = false
this.isIndeterminate = true
} else { } else {
this.selAllFlag = false this.selAllFlag = false
this.isIndeterminate = false
} }
}, },
async handleDelete (row) { async handleDelete (row) {
this.$confirm("确认删除?", "提示", { this.$confirm("确认删除?", "提示", {
@ -691,8 +693,13 @@ export default {
} }
}, },
watch: { watch: {
filterText (val) { selection (val) {
this.$refs.tree.filter(val);
if (val.length > 0) {
this.showDeletBtn = true
} else {
this.showDeletBtn = false
}
} }
}, },
props: { props: {

4
src/views/modules/base/community/community.vue

@ -215,6 +215,10 @@ export default {
let agencyNode = this.$refs.ref_tree.getNode(gridNode.data.pid)// let agencyNode = this.$refs.ref_tree.getNode(gridNode.data.pid)//
obj.agencyId = agencyNode.data.id obj.agencyId = agencyNode.data.id
obj.agencyName = agencyNode.data.label obj.agencyName = agencyNode.data.label
obj.gridId = gridNode.data.id
obj.gridName = gridNode.data.label
obj.neighborHoodId = neighborHoodNode.data.id
obj.neighborHoodName = neighborHoodNode.data.label
if (obj.agencyId === this.staffAgencyId) { if (obj.agencyId === this.staffAgencyId) {
this.showImportBtn = true this.showImportBtn = true
} else { } else {

33
src/views/modules/base/community/communityTable.vue

@ -185,10 +185,12 @@
<div v-if="tableData.length>0" <div v-if="tableData.length>0"
class="div_del"> class="div_del">
<el-checkbox :indeterminate="isIndeterminate" <el-checkbox style="height:32px"
:indeterminate="isIndeterminate"
v-model="selAllFlag" v-model="selAllFlag"
@change="handleSelectAll">全选</el-checkbox> @change="handleSelectAll">全选</el-checkbox>
<el-button style="margin-left:15px" <el-button v-show="showDeletBtn"
style="margin-left:15px"
type="red" type="red"
size="small" size="small"
@click="deleteBatch">批量删除</el-button> @click="deleteBatch">批量删除</el-button>
@ -238,7 +240,9 @@ export default {
ownerName: '', ownerName: '',
ownerPhone: '', ownerPhone: '',
tableData: [], tableData: [],
validTableDataNum: 0,//
selection: [], selection: [],
showDeletBtn: false,
//form //form
@ -309,10 +313,12 @@ export default {
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
if (code === 0) { if (code === 0) {
this.validTableDataNum = 0
this.total = data.total this.total = data.total
data.list.forEach(item => { data.list.forEach(item => {
if (item.agencyId === this.staffAgencyId) { if (item.agencyId === this.staffAgencyId) {
item.showBtn = true item.showBtn = true
this.validTableDataNum++
} else { } else {
item.showBtn = false item.showBtn = false
} }
@ -412,9 +418,10 @@ export default {
} }
}, },
selectAll (selection) { selectAll (selection) {
this.selection = selection this.selection = selection
if (selection.length > 0) { if (selection.length === this.validTableDataNum) {
this.selAllFlag = true this.selAllFlag = true
} else { } else {
this.selAllFlag = false this.selAllFlag = false
@ -423,16 +430,13 @@ export default {
}, },
selectionChange (selection) { selectionChange (selection) {
this.selection = selection this.selection = selection
this.isIndeterminate = false
if (selection.length === this.tableData.length) { if (selection.length === this.validTableDataNum) {
this.selAllFlag = true this.selAllFlag = true
this.isIndeterminate = false
} else if (selection.length > 0) {
this.selAllFlag = false
this.isIndeterminate = true
} else { } else {
this.selAllFlag = false this.selAllFlag = false
this.isIndeterminate = false
} }
}, },
@ -739,8 +743,13 @@ export default {
} }
}, },
watch: { watch: {
filterText (val) { selection (val) {
this.$refs.tree.filter(val);
if (val.length > 0) {
this.showDeletBtn = true
} else {
this.showDeletBtn = false
}
} }
}, },
props: { props: {

3
src/views/modules/base/community/roomForm.vue

@ -163,9 +163,10 @@ export default {
methods: { methods: {
async initForm (type, row, agencyObj) { async initForm (type, row, agencyObj) {
debugger
this.$refs.ref_form.resetFields(); this.$refs.ref_form.resetFields();
this.agencyObj = agencyObj this.agencyObj = agencyObj
this.dataForm.neighborHoodId = agencyObj.communityId this.dataForm.neighborHoodId = agencyObj.neighborHoodId
this.dataForm.buildingId = agencyObj.id this.dataForm.buildingId = agencyObj.id
this.formType = type this.formType = type

35
src/views/modules/base/community/roomTable.vue

@ -156,10 +156,12 @@
<div v-if="tableData.length>0" <div v-if="tableData.length>0"
class="div_del"> class="div_del">
<el-checkbox :indeterminate="isIndeterminate" <el-checkbox style="height:32px"
:indeterminate="isIndeterminate"
v-model="selAllFlag" v-model="selAllFlag"
@change="handleSelectAll">全选</el-checkbox> @change="handleSelectAll">全选</el-checkbox>
<el-button style="margin-left:15px" <el-button v-show="showDeletBtn"
style="margin-left:15px"
type="red" type="red"
size="small" size="small"
@click="deleteBatch">批量删除</el-button> @click="deleteBatch">批量删除</el-button>
@ -206,7 +208,9 @@ export default {
agencyObj: {},// agencyObj: {},//
ownerName: '', ownerName: '',
ownerPhone: '', ownerPhone: '',
tableData: [], validTableDataNum: 0,//
selection: [],
showDeletBtn: false,
//form //form
formShow: false, formShow: false,
@ -282,9 +286,11 @@ export default {
if (code === 0) { if (code === 0) {
this.total = data.total this.total = data.total
this.validTableDataNum = 0
data.list.forEach(item => { data.list.forEach(item => {
if (item.agencyId === this.staffAgencyId) { if (item.agencyId === this.staffAgencyId) {
item.showBtn = true item.showBtn = true
this.validTableDataNum++
} else { } else {
item.showBtn = false item.showBtn = false
} }
@ -370,8 +376,7 @@ export default {
}, },
selectAll (selection) { selectAll (selection) {
this.selection = selection this.selection = selection
if (selection.length === this.validTableDataNum) {
if (selection.length > 0) {
this.selAllFlag = true this.selAllFlag = true
} else { } else {
this.selAllFlag = false this.selAllFlag = false
@ -380,16 +385,13 @@ export default {
}, },
selectionChange (selection) { selectionChange (selection) {
this.selection = selection this.selection = selection
this.isIndeterminate = false
if (selection.length === this.tableData.length) { if (selection.length === this.validTableDataNum) {
this.selAllFlag = true this.selAllFlag = true
this.isIndeterminate = false
} else if (selection.length > 0) {
this.selAllFlag = false
this.isIndeterminate = true
} else { } else {
this.selAllFlag = false this.selAllFlag = false
this.isIndeterminate = false
} }
}, },
@ -654,8 +656,13 @@ export default {
} }
}, },
watch: { watch: {
filterText (val) { selection (val) {
this.$refs.tree.filter(val);
if (val.length > 0) {
this.showDeletBtn = true
} else {
this.showDeletBtn = false
}
} }
}, },
props: { props: {

Loading…
Cancel
Save