1 changed files with 228 additions and 0 deletions
@ -0,0 +1,228 @@ |
|||
<template> |
|||
<div> |
|||
<el-form :inline="true" ref="dataForm" :model="dataForm" label-width="100px"> |
|||
<el-form-item label="组织名称"> |
|||
<el-input clearable v-model="dataForm.name" style = "width:260px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="是否绑定网格"> |
|||
<el-select clearable v-model="dataForm.isBind" placeholder="请选择活动区域"> |
|||
<el-option label="是" value="1"></el-option> |
|||
<el-option label="否" value="0"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" @click="conditionQuery" >查询</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-table |
|||
:data="dataList" |
|||
style="width: 100%;margin-bottom: 20px;margin-left:20px" |
|||
border> |
|||
<el-table-column |
|||
prop="streetName" |
|||
label="街道名字" |
|||
width="180"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="communityName" |
|||
label="社区名字" |
|||
width="180"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="gridName" |
|||
label="网格名字" |
|||
width="180"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="caStreetName" |
|||
label="街道名字(综治)" |
|||
width="180"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="caCommunityName" |
|||
label="社区名字(综治)" |
|||
width="180"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="caGridName" |
|||
label="网格名字(综治)" |
|||
width="180"> |
|||
</el-table-column> |
|||
<el-table-column label="操作"> |
|||
<template slot-scope="scop"> |
|||
<el-button |
|||
size="mini" |
|||
@click="handleBind(scop.row)"> |
|||
绑定 |
|||
</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-pagination |
|||
:current-page="page" |
|||
:page-sizes="[10, 20, 50, 100]" |
|||
:page-size="limit" |
|||
:total="total" |
|||
layout="total, sizes, prev, pager, next, jumper" |
|||
@size-change="handleSizeChange" |
|||
@current-change="handleCurrentChange"> |
|||
</el-pagination> |
|||
<el-dialog |
|||
title="确认绑定" |
|||
:visible.sync="dialogVisible" |
|||
width="30%" |
|||
:before-close="handleClose"> |
|||
<el-form :model="BindForm"> |
|||
<el-form-item label="要绑定的网格" prop="gridId"> |
|||
<el-cascader |
|||
:options="caLouDongOptions" |
|||
clearable |
|||
@change="handlePartyChange"> |
|||
</el-cascader> |
|||
</el-form-item> |
|||
</el-form> |
|||
<span slot="footer" class="dialog-footer"> |
|||
<el-button @click="dialogVisible = false">取 消</el-button> |
|||
<el-button type="primary" @click="bindSubmitForm">确 定</el-button> |
|||
</span> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import mixinViewModule from '@/mixins/view-module' |
|||
export default { |
|||
mixins: [mixinViewModule], |
|||
data(){ |
|||
return { |
|||
dataForm:{ |
|||
name:"", |
|||
isBind:"" |
|||
}, |
|||
dataList:[], |
|||
dialogVisible: false, |
|||
caLouDongOptions:[], |
|||
BindForm:{ |
|||
gridId:"", |
|||
id:"" |
|||
}, |
|||
echoForm:{ |
|||
id:"" |
|||
}, |
|||
limit:10, |
|||
page:1, |
|||
total:0, |
|||
mixinViewModuleOptions: { |
|||
activatedIsNeed: false, |
|||
getDataListURL: '/sys/dept/getPage', |
|||
getDataListIsPage: true, |
|||
}, |
|||
} |
|||
}, |
|||
created: function () { |
|||
this.mixinViewModuleOptions.getDataListURL = '/sys/dept/getPage' |
|||
this.mixinViewModuleOptions.getDataListIsPage = true |
|||
this.getDataList() |
|||
}, |
|||
activated(){ |
|||
this.getDataList() |
|||
}, |
|||
created(){ |
|||
this.getCascadeMenu() |
|||
}, |
|||
methods:{ |
|||
getCascadeMenu(){ |
|||
this.$http.post(`/sys/dept/getCascadeMenu`).then(resp => { |
|||
if(resp.data.code === 0) { |
|||
this.caLouDongOptions = this.removeEmptySubOrgList(resp.data.data) |
|||
} |
|||
}).catch(error => { |
|||
this.$message.error(error) |
|||
}) |
|||
}, |
|||
removeEmptySubOrgList (orgArray) { |
|||
orgArray.forEach((orgInfo) => { |
|||
if (orgInfo && orgInfo.children) { |
|||
if (orgInfo.children.length === 0) { |
|||
orgInfo.children = undefined |
|||
} else { |
|||
this.removeEmptySubOrgList(orgInfo.children) |
|||
} |
|||
} |
|||
}) |
|||
return orgArray; |
|||
}, |
|||
|
|||
// getTreeList(){ |
|||
// this.$http.post(`/dept/getTreeList`).then(resp => { |
|||
// this.tableData = resp.data.data |
|||
// }).catch(error => { |
|||
// this.$message.error(error) |
|||
// }) |
|||
// }, |
|||
// getPage(){ |
|||
// this.$http.get(`/sys/dept/getPage`).then(resp => { |
|||
// this.tableData = resp.data.data |
|||
// this.total = resp.data.data.total |
|||
// }).catch(error => { |
|||
// this.$message.error(error) |
|||
// }) |
|||
// }, |
|||
conditionQuery(){ |
|||
this.getDataList() |
|||
}, |
|||
bindSubmitForm(){ |
|||
this.$http.post(`/sys/dept/bindCascade`,this.BindForm).then(resp => { |
|||
if(resp.data.code === 0){ |
|||
this.$message.success("绑定成功") |
|||
this.dialogVisible = false |
|||
} |
|||
}).catch(error => { |
|||
this.$message.error(error) |
|||
}) |
|||
}, |
|||
handleBind(row){ |
|||
this.casCadeEcho() |
|||
this.dialogVisible = true |
|||
this.BindForm.id = row.id |
|||
this.echoForm.id = row.id |
|||
}, |
|||
casCadeEcho(){ |
|||
this.$http.post(`/sys/dept/casCadeEcho`,this.echoForm).then(resp => { |
|||
console.log(resp) |
|||
this.BindForm.gridId = resp.data.data |
|||
console.log(":::::::::::::",this.BindForm.gridId) |
|||
}).catch(error => { |
|||
this.$message.error(error) |
|||
}) |
|||
}, |
|||
handleClose(done) { |
|||
this.$confirm('确认关闭?') |
|||
.then(_ => { |
|||
done(); |
|||
}) |
|||
.catch(_ => {}); |
|||
}, |
|||
handlePartyChange(val) { |
|||
console.log('val------pp', val) |
|||
this.BindForm.gridId = val[val.length - 1] |
|||
}, |
|||
handleSizeChange(val){ |
|||
/* 更改每页记录数 */ |
|||
this.limit = val |
|||
/* 回显 因为每页记录数更改了 */ |
|||
this.getDataList() |
|||
}, |
|||
handleCurrentChange(val){ |
|||
/* 给当前页重新赋值 */ |
|||
this.page = val |
|||
/* 回显,因为当前页变了 */ |
|||
this.getDataList() |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
Loading…
Reference in new issue