|
|
|
@ -2,39 +2,9 @@ |
|
|
|
<el-card shadow="never" class="aui-card--fill"> |
|
|
|
<div class="mod-news__group}"> |
|
|
|
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> |
|
|
|
<el-form-item label="街道"> |
|
|
|
<el-select v-model="dataForm.streetId" |
|
|
|
placeholder="请选择" |
|
|
|
clearable |
|
|
|
@change="getCommunityList"> |
|
|
|
<el-option v-for="item in streetOptions" |
|
|
|
:key="item.id" |
|
|
|
:label="item.name" |
|
|
|
:value="item.id"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="社区"> |
|
|
|
<el-select v-model="dataForm.communityId" |
|
|
|
placeholder="请选择" |
|
|
|
clearable |
|
|
|
@change="getGridList"> |
|
|
|
<el-option v-for="item in communityOptions" |
|
|
|
:key="item.id" |
|
|
|
:label="item.name" |
|
|
|
:value="item.id"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="网格"> |
|
|
|
<el-select v-model="dataForm.gridId" clearable |
|
|
|
placeholder="请选择"> |
|
|
|
<el-option v-for="item in gridOptions" |
|
|
|
:key="item.id" |
|
|
|
:label="item.name" |
|
|
|
:value="item.id"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
<el-form-item label="所属机构"> |
|
|
|
<el-cascader v-model="ids" :options="options" :props="{ checkStrictly: true }" clearable> |
|
|
|
</el-cascader> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="状态"> |
|
|
|
<el-select v-model="dataForm.state" clearable |
|
|
|
@ -108,9 +78,8 @@ export default { |
|
|
|
id: '', |
|
|
|
state: 0 |
|
|
|
}, |
|
|
|
streetOptions: [], |
|
|
|
communityOptions: [], |
|
|
|
gridOptions: [], |
|
|
|
ids: [], |
|
|
|
options: [], |
|
|
|
stateOptions: [{ |
|
|
|
id: '0', |
|
|
|
name: '待审核' |
|
|
|
@ -134,7 +103,23 @@ export default { |
|
|
|
GroupApprove |
|
|
|
}, |
|
|
|
created: function () { |
|
|
|
this.getStreetList() |
|
|
|
this.getOptions() |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
'ids': function (val) { |
|
|
|
if (val.length === 1){ |
|
|
|
this.dataForm.streetId = this.ids[0] |
|
|
|
} |
|
|
|
if (val.length === 2){ |
|
|
|
this.dataForm.streetId = this.ids[0] |
|
|
|
this.dataForm.communityId = this.ids[1] |
|
|
|
} |
|
|
|
if (val.length === 3){ |
|
|
|
this.dataForm.streetId = this.ids[0] |
|
|
|
this.dataForm.communityId = this.ids[1] |
|
|
|
this.dataForm.gridId = this.ids[2] |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
formatState: function (row, column) { |
|
|
|
@ -219,44 +204,13 @@ export default { |
|
|
|
this.$refs.groupApprove.init() |
|
|
|
}) |
|
|
|
}, |
|
|
|
getStreetList () { |
|
|
|
this.$http.get(`/sys/dept/sublist/` + (localStorage.getItem('street') === null ? '1169154711480528897' : localStorage.getItem('street'))).then(({ data: res }) => { |
|
|
|
getOptions () { |
|
|
|
this.$http.get(`/sys/user/deptOptions/getByLoginUser`).then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
this.streetOptions = res.data |
|
|
|
}).catch(() => { }) |
|
|
|
}, |
|
|
|
getCommunityList () { |
|
|
|
if (this.dataForm.streetId === '') { |
|
|
|
this.communityOptions = [] |
|
|
|
this.gridOptions = [] |
|
|
|
this.dataForm.communityId = '' |
|
|
|
this.dataForm.gridId = '' |
|
|
|
return |
|
|
|
} |
|
|
|
this.dataForm.communityId = '' |
|
|
|
this.dataForm.gridId = '' |
|
|
|
this.$http.get(`/sys/dept/sublist/` + this.dataForm.streetId).then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
this.communityOptions = res.data |
|
|
|
}).catch(() => { }) |
|
|
|
}, |
|
|
|
getGridList () { |
|
|
|
if (this.dataForm.communityId === '') { |
|
|
|
this.gridOptions = [] |
|
|
|
this.dataForm.gridId = '' |
|
|
|
return |
|
|
|
} |
|
|
|
this.dataForm.gridId = '' |
|
|
|
this.$http.get(`/sys/dept/sublist/` + this.dataForm.communityId).then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
this.gridOptions = res.data |
|
|
|
}).catch(() => { }) |
|
|
|
this.options = res.data.options |
|
|
|
}).catch(() => {}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|