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