10 changed files with 2607 additions and 89 deletions
@ -0,0 +1,403 @@ |
|||
<template> |
|||
<div> |
|||
<div> |
|||
<div v-show="!propertyFormShow"> |
|||
<el-form :inline="false" |
|||
:model="dataForm" |
|||
:rules="dataRule" |
|||
:disabled="formType==='detail'" |
|||
class="form"> |
|||
<el-form-item label="小区名称" |
|||
prop="neighborHoodName" |
|||
label-width="150px" |
|||
style="display:block"> |
|||
<el-input class="item_width_1" |
|||
maxlength="50" |
|||
show-word-limit |
|||
placeholder='请输入小区名称' |
|||
v-model="dataForm.neighborHoodName"> |
|||
</el-input> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="所属组织" |
|||
prop="agencyId" |
|||
label-width="150px" |
|||
style="display:block"> |
|||
<el-select class="item_width_1" |
|||
v-model="dataForm.agencyId" |
|||
placeholder="请选择" |
|||
@change="handleAgencyChanged" |
|||
clearable> |
|||
<el-option v-for="item in agencyList" |
|||
:key="item.agencyId" |
|||
:label="item.agencyName" |
|||
:value="item.agencyId"> |
|||
</el-option> |
|||
</el-select> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="所属网格" |
|||
prop="gridId" |
|||
label-width="150px" |
|||
style="display:block"> |
|||
<el-select class="item_width_1" |
|||
v-model="dataForm.gridId" |
|||
placeholder="请选择" |
|||
clearable> |
|||
<el-option v-for="item in gridList" |
|||
:key="item.gridId" |
|||
:label="item.gridName" |
|||
:value="item.gridId"> |
|||
</el-option> |
|||
</el-select> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="关联物业" |
|||
prop="propertyId" |
|||
label-width="150px" |
|||
style="display:block"> |
|||
<el-select class="item_width_2" |
|||
v-model="dataForm.propertyId" |
|||
placeholder="请选择" |
|||
clearable> |
|||
<el-option v-for="item in propertyList" |
|||
:key="item.propertyId" |
|||
:label="item.propertyName" |
|||
:value="item.propertyId"> |
|||
</el-option> |
|||
</el-select> |
|||
|
|||
<el-button style="margin-left:10px" |
|||
type="primary" |
|||
size="small" |
|||
@click="handleAddProperty">添加物业</el-button> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="详细地址" |
|||
prop="address" |
|||
label-width="150px" |
|||
style="display:block"> |
|||
<el-input class="item_width_1" |
|||
maxlength="50" |
|||
show-word-limit |
|||
placeholder='请输入详细地址' |
|||
v-model="dataForm.address"> |
|||
</el-input> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="备注" |
|||
prop="remark" |
|||
label-width="150px" |
|||
style="display:block"> |
|||
<el-input class="item_width_1" |
|||
type="textarea" |
|||
maxlength="500" |
|||
:rows="3" |
|||
placeholder='请输入备注,不超过500字' |
|||
v-model="dataForm.remark"></el-input> |
|||
|
|||
</el-form-item> |
|||
<!-- <el-form-item label="位置坐标" |
|||
prop="neighborHoodName" |
|||
label-width="150px" |
|||
style="display:block"> |
|||
<el-input class="item_width_1" |
|||
maxlength="50" |
|||
show-word-limit |
|||
placeholder='请输入小区名称' |
|||
v-model="dataForm.neighborHoodName"> |
|||
</el-input> |
|||
|
|||
</el-form-item> --> |
|||
|
|||
</el-form> |
|||
</div> |
|||
|
|||
<div v-show="propertyFormShow"> |
|||
<el-form :inline="false" |
|||
:model="propertyForm" |
|||
:rules="propertyRule" |
|||
class="form"> |
|||
<el-form-item label="物业名称" |
|||
prop="name" |
|||
label-width="150px" |
|||
style="display:block"> |
|||
<el-input class="item_width_1" |
|||
maxlength="50" |
|||
show-word-limit |
|||
placeholder='请输入小区名称' |
|||
v-model="propertyForm.name"> |
|||
</el-input> |
|||
|
|||
</el-form-item> |
|||
|
|||
</el-form> |
|||
|
|||
</div> |
|||
</div> |
|||
<div class="div_btn"> |
|||
<el-button @click="handleCancle">取 消</el-button> |
|||
<el-button v-if="formType!='detail'" |
|||
type="primary" |
|||
@click="handleComfirm">确 定</el-button> |
|||
</div> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapGetters } from 'vuex' |
|||
import { Loading } from 'element-ui' // 引入Loading服务 |
|||
import { requestPost } from "@/js/dai/request"; |
|||
|
|||
let loading // 加载动画 |
|||
export default { |
|||
data () { |
|||
return { |
|||
formType: 'add',//表单操作类型 add新增,edit编辑,detail详情 |
|||
|
|||
agencyList: [], |
|||
gridList: [], |
|||
propertyList: [], |
|||
|
|||
neighborHoodId: '',//小区ID |
|||
dataForm: { |
|||
neighborHoodName: '', // 小区名称【不超过50字】 |
|||
agencyId: '', // 所属组织ID |
|||
gridId: '', //所属网格ID |
|||
propertyId: '', //关联物业 |
|||
address: '', //详细地址 |
|||
remark: '', //备注【最大500字】 |
|||
location: '', //坐标位置 |
|||
longitude: '', //经度 |
|||
latitude: '', //纬度 |
|||
}, |
|||
|
|||
propertyFormShow: false, |
|||
propertyForm: { |
|||
name: '' |
|||
} |
|||
|
|||
} |
|||
}, |
|||
components: { |
|||
|
|||
}, |
|||
mounted () { |
|||
}, |
|||
|
|||
methods: { |
|||
async initForm (type, row) { |
|||
this.formType = type |
|||
if (row) { |
|||
this.neighborHoodId = row.neighborHoodId |
|||
this.dataForm = row |
|||
} |
|||
|
|||
await this.loadAgency() |
|||
await this.loadProperty() |
|||
}, |
|||
|
|||
async handleAgencyChanged () { |
|||
await this.loadGrid() |
|||
}, |
|||
|
|||
//加载组织 |
|||
async loadAgency () { |
|||
// const url = "/gov/org/agency/belongOrg" |
|||
const url = "http://yapi.elinkservice.cn/mock/245/gov/org/agency/belongOrg" |
|||
let params = {} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
|
|||
this.agencyList = data |
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
//加载网格 |
|||
async loadGrid () { |
|||
// const url = "/gov/org/grid/allgrids" |
|||
const url = "https://epmet-dev.elinkservice.cn:7082/api/apimock-v2/95518686fa128a53f64c678906848062/gov/org/grid/allgrids" |
|||
let params = { |
|||
agencyId: this.dataForm.agencyId |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
this.gridList = data |
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
//加载物业 |
|||
async loadProperty () { |
|||
// const url = "/gov/org/propertymanagement/list" |
|||
const url = "http://yapi.elinkservice.cn/mock/245/gov/org/propertymanagement/list" |
|||
let params = {} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
this.propertyList = data |
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
|
|||
handleAddProperty () { |
|||
this.propertyForm.name = '' |
|||
this.propertyFormShow = true |
|||
}, |
|||
|
|||
async handleComfirm () { |
|||
if (this.propertyFormShow) { |
|||
|
|||
this.addProperty() |
|||
} else { |
|||
this.addCommunity() |
|||
} |
|||
}, |
|||
async addCommunity () { |
|||
// let url = "/gov/org/neighborhood/neighborhoodadd" |
|||
let url = "http://yapi.elinkservice.cn/mock/245/gov/org/neighborhood/neighborhoodadd" |
|||
if (this.formType === 'add') { |
|||
// url = "/gov/org/neighborhood/neighborhoodadd" |
|||
url = "http://yapi.elinkservice.cn/mock/245/gov/org/neighborhood/neighborhoodadd" |
|||
} else { |
|||
// url = "/gov/org/neighborhood/neighborhoodadd" |
|||
url = "http://yapi.elinkservice.cn/mock/245/gov/org/neighborhood/neighborhoodadd" |
|||
this.dataForm.neighborHoodId = this.neighborHoodId |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, this.dataForm) |
|||
|
|||
if (code === 0) { |
|||
this.$message({ |
|||
type: "success", |
|||
message: "添加小区成功" |
|||
}); |
|||
|
|||
this.propertyFormShow = false |
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
|
|||
}, |
|||
async addProperty () { |
|||
// const url = "/gov/org/propertymanagement/add" |
|||
const url = "http://yapi.elinkservice.cn/mock/245/gov/org/propertymanagement/add" |
|||
let params = { |
|||
name: this.propertyForm.name |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
|
|||
this.$message({ |
|||
type: "success", |
|||
message: "添加物业成功" |
|||
}); |
|||
this.propertyForm.name = '' |
|||
this.propertyFormShow = false |
|||
this.loadProperty() |
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
|
|||
}, |
|||
handleCancle () { |
|||
if (this.propertyFormShow) { |
|||
this.propertyForm.name = '' |
|||
this.propertyFormShow = false |
|||
} else { |
|||
this.$emit('dialogCancle') |
|||
} |
|||
|
|||
|
|||
}, |
|||
resetData () { |
|||
|
|||
|
|||
}, |
|||
// 开启加载动画 |
|||
startLoading () { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: '正在加载……', // 加载中需要显示的文字 |
|||
background: 'rgba(0,0,0,.7)' // 背景颜色 |
|||
}) |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading () { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close() |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
neighborHoodName: [ |
|||
{ required: true, message: '小区名称不能为空', trigger: 'blur' }, |
|||
{ min: 1, max: 50, message: '小区名称长度在 1 到 50个字符', trigger: 'blur' } |
|||
], |
|||
agencyId: [ |
|||
{ required: true, message: '所属组织不能为空', trigger: 'blur' } |
|||
], |
|||
gridId: [ |
|||
{ required: true, message: '所属网格不能为空', trigger: 'blur' } |
|||
], |
|||
address: [ |
|||
{ required: true, message: '详细地址不能为空', trigger: 'blur' } |
|||
], |
|||
location: [ |
|||
{ required: true, message: '上架状态不能为空', trigger: 'blur' } |
|||
] |
|||
|
|||
} |
|||
}, |
|||
propertyRule () { |
|||
name: [ |
|||
{ required: true, message: '物业名称不能为空', trigger: 'blur' }, |
|||
// { min: 1, max: 50, message: '小区名称长度在 1 到 50个字符', trigger: 'blur' } |
|||
] |
|||
} |
|||
}, |
|||
props: { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
<style scoped > |
|||
.item_width_1 { |
|||
width: 500px; |
|||
} |
|||
.item_width_2 { |
|||
width: 400px; |
|||
} |
|||
|
|||
.div_btn { |
|||
display: flex; |
|||
justify-content: flex-end; |
|||
} |
|||
.el-tabs { |
|||
margin: 0 20px; |
|||
} |
|||
.el-upload__tip { |
|||
color: rgb(155, 155, 155); |
|||
margin: 0; |
|||
} |
|||
.form { |
|||
margin-top: 30px; |
|||
} |
|||
</style> |
@ -0,0 +1,365 @@ |
|||
<template> |
|||
<div> |
|||
<div class="div_search"> |
|||
<div class="resi-cell"> |
|||
<div class="resi-cell-label">房主姓名</div> |
|||
<div class="resi-cell-value"> |
|||
<el-input v-model="ownerName" |
|||
class="resi-cell-input" |
|||
size="small" |
|||
clearable |
|||
placeholder="请输入内容"> |
|||
</el-input> |
|||
|
|||
</div> |
|||
</div> |
|||
<div class="resi-cell"> |
|||
<div class="resi-cell-label">房主手机</div> |
|||
<div class="resi-cell-value"> |
|||
<el-input v-model="ownerPhone" |
|||
class="resi-cell-input" |
|||
size="small" |
|||
clearable |
|||
placeholder="请输入内容"> |
|||
</el-input> |
|||
|
|||
</div> |
|||
</div> |
|||
<el-button style="margin-left:10px" |
|||
type="primary" |
|||
size="small" |
|||
@click="handleSearch">查询</el-button> |
|||
</div> |
|||
<div class="div_btn"> |
|||
<el-button type="warning" |
|||
size="small" |
|||
@click="handleExport">导出</el-button> |
|||
<el-button type="success" |
|||
size="small" |
|||
@click="handleAdd">新增楼宇</el-button> |
|||
<el-button type="primary" |
|||
size="small" |
|||
@click="handleExportModule">下载楼宇模板</el-button> |
|||
<el-button type="danger" |
|||
size="small" |
|||
@click="handleInport">导入楼宇数据</el-button> |
|||
</div> |
|||
|
|||
<div class="div_table"> |
|||
<el-table :data="tableData" |
|||
border |
|||
style="width: 100%"> |
|||
<el-table-column prop="neighborHoodName" |
|||
label="小区名称" |
|||
width="180"> |
|||
</el-table-column> |
|||
<el-table-column prop="orgName" |
|||
label="所属组织" |
|||
width="160"> |
|||
</el-table-column> |
|||
<el-table-column prop="gridName" |
|||
label="所属网格" |
|||
width="140"> |
|||
</el-table-column> |
|||
<el-table-column prop="address" |
|||
label="详细地址"> |
|||
</el-table-column> |
|||
<el-table-column prop="remark" |
|||
label="备注"> |
|||
</el-table-column> |
|||
<el-table-column label="操作" |
|||
fixed="right" |
|||
width="140" |
|||
header-align="center" |
|||
align="center" |
|||
class="operate"> |
|||
<template slot-scope="scope"> |
|||
|
|||
<el-button type="text" |
|||
style="color:#1C6AFD;text-decoration: underline;" |
|||
size="small" |
|||
@click="handleDetail(scope.row)">查看</el-button> |
|||
<el-button type="text" |
|||
style="color:#00A7A9;text-decoration: underline;" |
|||
size="small" |
|||
@click="handleEdit(scope.row)">修改</el-button> |
|||
|
|||
<el-button type="text" |
|||
style="color:#D51010;text-decoration: underline;" |
|||
size="small" |
|||
@click="handleDelete(scope.row)">删除</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<div> |
|||
<el-pagination @size-change="handleSizeChange" |
|||
@current-change="handleCurrentChange" |
|||
:current-page.sync="params.pageNo" |
|||
:page-sizes="[20, 30, 50]" |
|||
:page-size="params.pageSize" |
|||
layout="sizes, prev, pager, next" |
|||
:total="total"> |
|||
</el-pagination> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- 修改弹出框 --> |
|||
<el-dialog :visible.sync="formShow" |
|||
:close-on-click-modal="false" |
|||
:close-on-press-escape="false" |
|||
:title="formTitle" |
|||
width="800px" |
|||
@closed="diaClose"> |
|||
<community-form ref="ref_form" |
|||
@dialogCancle="addFormCancle" |
|||
@dialogOk="addFormOk"></community-form> |
|||
</el-dialog> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
|
|||
import CommunityForm from './communityForm' |
|||
|
|||
import { requestPost } from "@/js/dai/request"; |
|||
import { mapGetters } from 'vuex' |
|||
import { Loading } from 'element-ui' // 引入Loading服务 |
|||
|
|||
let loading // 加载动画 |
|||
export default { |
|||
data () { |
|||
return { |
|||
loading: false, |
|||
total: 0, |
|||
params: { |
|||
pageSize: 20, |
|||
pageNo: 0, |
|||
ownerName: '', |
|||
ownerPhone: '' |
|||
}, |
|||
|
|||
ownerName: '', |
|||
ownerPhone: '', |
|||
tableData: [], |
|||
|
|||
//form相关 |
|||
formShow: false, |
|||
formTitle: '新增小区' |
|||
|
|||
} |
|||
}, |
|||
components: { |
|||
CommunityForm |
|||
}, |
|||
async mounted () { |
|||
|
|||
}, |
|||
computed: { |
|||
rowHeight () { |
|||
return (this.clientHeight - 200) + 'px' |
|||
}, |
|||
...mapGetters(['clientHeight']) |
|||
}, |
|||
methods: { |
|||
handleSearch () { |
|||
this.loadTable() |
|||
}, |
|||
async loadTable () { |
|||
// const url = "/gov/org/neighborhood/neighborhoodlist" |
|||
const url = "http://yapi.elinkservice.cn/mock/245/gov/org/neighborhood/neighborhoodlist" |
|||
let params = { |
|||
pageSize: this.pageSize, |
|||
pageNo: this.pageNo, |
|||
ownerName: this.ownerName, |
|||
ownerPhone: this.ownerPhone |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
this.total = data.total |
|||
this.tableData = data.list |
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
|
|||
diaClose () { |
|||
this.formShow = false |
|||
}, |
|||
|
|||
handleDetail (row) { |
|||
this.formTitle = '小区详情' |
|||
this.formShow = true |
|||
this.$nextTick(() => { |
|||
this.$refs.ref_form.initForm('detail', row) |
|||
}) |
|||
}, |
|||
|
|||
handleAdd () { |
|||
this.formTitle = '新增小区' |
|||
this.formShow = true |
|||
this.$nextTick(() => { |
|||
this.$refs.ref_form.initForm('add') |
|||
}) |
|||
}, |
|||
|
|||
handleEdit (row) { |
|||
this.formTitle = '修改小区' |
|||
this.formShow = true |
|||
this.$refs.ref_form.initForm('edit', row) |
|||
}, |
|||
|
|||
addFormCancle () { |
|||
this.formShow = false |
|||
}, |
|||
addFormOk () { |
|||
this.formShow = false |
|||
this.loadTable() |
|||
}, |
|||
|
|||
async handleDelete (row) { |
|||
|
|||
this.$confirm("确认删除?", "提示", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning" |
|||
}) |
|||
.then(() => { |
|||
this.deleteCommunity(row) |
|||
}) |
|||
.catch(err => { |
|||
if (err == "cancel") { |
|||
// this.$message({ |
|||
// type: "info", |
|||
// message: "已取消删除" |
|||
// }); |
|||
} |
|||
|
|||
}); |
|||
|
|||
|
|||
}, |
|||
|
|||
async deleteCommunity (row) { |
|||
// const url = "/gov/org/neighborhood/neighborhooddel" |
|||
const url = "http://yapi.elinkservice.cn/mock/245/gov/org/neighborhood/neighborhooddel" |
|||
let params = { |
|||
neighborHoodId: row.neighborHoodId |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
this.$message({ |
|||
type: "success", |
|||
message: "删除成功" |
|||
}); |
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
|
|||
handleExport () { |
|||
|
|||
}, |
|||
|
|||
|
|||
handleExportModule () { |
|||
|
|||
}, |
|||
handleInport () { |
|||
|
|||
}, |
|||
|
|||
|
|||
handleSizeChange (val) { |
|||
console.log(`每页 ${val} 条`) |
|||
}, |
|||
handleCurrentChange (val) { |
|||
console.log(`当前页: ${val}`) |
|||
}, |
|||
|
|||
// 开启加载动画 |
|||
startLoading () { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: '正在加载……', // 加载中需要显示的文字 |
|||
background: 'rgba(0,0,0,.7)' // 背景颜色 |
|||
}) |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading () { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close() |
|||
} |
|||
} |
|||
}, |
|||
watch: { |
|||
filterText (val) { |
|||
this.$refs.tree.filter(val); |
|||
} |
|||
}, |
|||
props: { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped > |
|||
.div_search { |
|||
display: flex; |
|||
|
|||
.resi-cell { |
|||
display: flex; |
|||
align-items: center; |
|||
.resi-cell-label { |
|||
width: 70px; |
|||
box-sizing: border-box; |
|||
margin-right: 15px; |
|||
text-align: right; |
|||
// line-height: 32; |
|||
} |
|||
|
|||
.resi-cell-input { |
|||
width: 180px; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.div_table { |
|||
margin-top: 20px; |
|||
} |
|||
.div_search { |
|||
display: flex; |
|||
|
|||
.resi-cell { |
|||
display: flex; |
|||
align-items: center; |
|||
.resi-cell-label { |
|||
width: 70px; |
|||
box-sizing: border-box; |
|||
margin-right: 15px; |
|||
text-align: right; |
|||
// line-height: 32; |
|||
} |
|||
|
|||
.resi-cell-input { |
|||
width: 180px; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.div_btn { |
|||
margin-top: 20px; |
|||
} |
|||
|
|||
.el-row { |
|||
/* margin-bottom: 20px; */ |
|||
display: flex; |
|||
flex-wrap: wrap; |
|||
margin-top: 10px; |
|||
margin-right: 50px; |
|||
} |
|||
</style> |
@ -0,0 +1,169 @@ |
|||
<template> |
|||
<div> |
|||
|
|||
<el-row class="row" |
|||
:gutter="10"> |
|||
<el-col :span="5"> |
|||
<el-card> |
|||
|
|||
<div :style="{height:rowHeight}" |
|||
class="div_tree"> |
|||
<el-input placeholder="输入关键字进行过滤" |
|||
v-model="filterText"> |
|||
</el-input> |
|||
|
|||
<el-tree ref="ref_tree" |
|||
class="filter-tree" |
|||
:data="treeData" |
|||
:props="defaultProps" |
|||
node-key="id" |
|||
:expand-on-click-node="false" |
|||
default-expand-all |
|||
:filter-node-method="filterNode" |
|||
@node-click="handleNodeClick"> |
|||
</el-tree> |
|||
|
|||
</div> |
|||
|
|||
</el-card> |
|||
</el-col> |
|||
|
|||
<el-col :span="19"> |
|||
<el-card> |
|||
<div :style="{height:rowHeight}"> |
|||
|
|||
<build-table v-if="selTreeLevel==='neighbourHood'" |
|||
ref="ref_communityTable"></build-table> |
|||
<room-table v-else-if="selTreeLevel==='building'" |
|||
ref="ref_communityTable"></room-table> |
|||
<community-table v-else |
|||
ref="ref_communityTable"></community-table> |
|||
|
|||
</div> |
|||
</el-card> |
|||
</el-col> |
|||
|
|||
</el-row> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import CDialog from '@c/CDialog' |
|||
import communityTable from './communityTable' |
|||
import buildTable from './buildTable' |
|||
import roomTable from './roomTable' |
|||
import { requestPost } from "@/js/dai/request"; |
|||
import { mapGetters } from 'vuex' |
|||
import { Loading } from 'element-ui' // 引入Loading服务 |
|||
|
|||
let loading // 加载动画 |
|||
export default { |
|||
data () { |
|||
return { |
|||
filterText: '', |
|||
treeData: [], |
|||
defaultProps: { |
|||
children: 'children', |
|||
label: 'label' |
|||
}, |
|||
|
|||
selTreeId: '', |
|||
selTreeLevel: '' |
|||
|
|||
} |
|||
}, |
|||
components: { |
|||
CDialog |
|||
}, |
|||
async mounted () { |
|||
await this.loadTree() |
|||
|
|||
await this.$refs['ref_communityTable'].loadTable(this.selTreeId, this.selTreeLevel) |
|||
}, |
|||
computed: { |
|||
rowHeight () { |
|||
return (this.clientHeight - 200) + 'px' |
|||
}, |
|||
...mapGetters(['clientHeight']) |
|||
}, |
|||
methods: { |
|||
async loadTree () { |
|||
const url = "/gov/org/building/treelist" |
|||
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/building/treelist" |
|||
let params = {} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
|
|||
this.treeData = data |
|||
if (data.length > 0) { |
|||
this.selTreeId = data[0].id |
|||
this.selTreeLevel = data[0].level |
|||
} |
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
|
|||
handleNodeClick (obj) { |
|||
this.$refs['ref_communityTable'].loadTable(obj.id, obj.level) |
|||
}, |
|||
|
|||
handleSizeChange (val) { |
|||
console.log(`每页 ${val} 条`) |
|||
}, |
|||
handleCurrentChange (val) { |
|||
console.log(`当前页: ${val}`) |
|||
}, |
|||
|
|||
filterNode (value, data) { |
|||
if (!value) return true; |
|||
return data.label.indexOf(value) !== -1; |
|||
}, |
|||
|
|||
// 开启加载动画 |
|||
startLoading () { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: '正在加载……', // 加载中需要显示的文字 |
|||
background: 'rgba(0,0,0,.7)' // 背景颜色 |
|||
}) |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading () { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close() |
|||
} |
|||
} |
|||
}, |
|||
watch: { |
|||
filterText (val) { |
|||
this.$refs.tree.filter(val); |
|||
} |
|||
}, |
|||
components: { |
|||
communityTable, buildTable, roomTable |
|||
} |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped > |
|||
.div_tree { |
|||
overflow-y: auto; |
|||
} |
|||
|
|||
.div_btn { |
|||
margin-top: 20px; |
|||
} |
|||
|
|||
.el-row { |
|||
/* margin-bottom: 20px; */ |
|||
display: flex; |
|||
flex-wrap: wrap; |
|||
margin-top: 10px; |
|||
margin-right: 50px; |
|||
} |
|||
</style> |
@ -0,0 +1,484 @@ |
|||
<template> |
|||
<div> |
|||
<div> |
|||
<div v-show="!propertyFormShow"> |
|||
<el-form :inline="false" |
|||
:model="dataForm" |
|||
:rules="dataRule" |
|||
:disabled="formType==='detail'" |
|||
class="form"> |
|||
<el-form-item label="小区名称" |
|||
prop="neighborHoodName" |
|||
label-width="150px" |
|||
style="display:block"> |
|||
<el-input class="item_width_1" |
|||
maxlength="50" |
|||
show-word-limit |
|||
placeholder='请输入小区名称' |
|||
v-model="dataForm.neighborHoodName"> |
|||
</el-input> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="所属组织" |
|||
label-width="150px" |
|||
style="display:block"> |
|||
<span>{{dataForm.agencyName}}</span> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="所属网格" |
|||
prop="gridId" |
|||
label-width="150px" |
|||
style="display:block"> |
|||
<el-select class="item_width_1" |
|||
v-model="dataForm.gridId" |
|||
placeholder="请选择" |
|||
clearable> |
|||
<el-option v-for="item in gridList" |
|||
:key="item.gridId" |
|||
:label="item.gridName" |
|||
:value="item.gridId"> |
|||
</el-option> |
|||
</el-select> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="关联物业" |
|||
prop="propertyId" |
|||
label-width="150px" |
|||
style="display:block"> |
|||
<el-select class="item_width_2" |
|||
v-model="dataForm.propertyId" |
|||
placeholder="请选择" |
|||
clearable> |
|||
<el-option v-for="item in propertyList" |
|||
:key="item.propertyId" |
|||
:label="item.propertyName" |
|||
:value="item.propertyId"> |
|||
</el-option> |
|||
</el-select> |
|||
|
|||
<el-button style="margin-left:10px" |
|||
type="primary" |
|||
size="small" |
|||
@click="handleAddProperty">添加物业</el-button> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="详细地址" |
|||
prop="address" |
|||
label-width="150px" |
|||
style="display:block"> |
|||
<el-input class="item_width_1" |
|||
maxlength="50" |
|||
show-word-limit |
|||
placeholder='请输入详细地址' |
|||
v-model="dataForm.address"> |
|||
</el-input> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="备注" |
|||
prop="remark" |
|||
label-width="150px" |
|||
style="display:block"> |
|||
<el-input class="item_width_1" |
|||
type="textarea" |
|||
maxlength="500" |
|||
show-word-limit |
|||
:rows="3" |
|||
placeholder='请输入备注,不超过500字' |
|||
v-model="dataForm.remark"></el-input> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="位置坐标" |
|||
prop="longitude" |
|||
label-width="150px" |
|||
style="display:block"> |
|||
|
|||
<el-input class="item_width_3" |
|||
maxlength="50" |
|||
placeholder='请输入关键字' |
|||
v-model="keyWords"> |
|||
|
|||
</el-input> |
|||
<el-button style="margin-left:10px" |
|||
type="primary" |
|||
size="small" |
|||
@click="handleSearchMap">查询</el-button> |
|||
<div id="app" |
|||
class="div_map"> |
|||
</div> |
|||
<div style="margin-top:10px"> |
|||
<span>经度</span> |
|||
<el-input class="item_width_3" |
|||
maxlength="50" |
|||
placeholder='请输入经度' |
|||
v-model="dataForm.longitude"> |
|||
</el-input> |
|||
<span style="margin-left:20px">纬度</span> |
|||
<el-input class="item_width_3" |
|||
maxlength="50" |
|||
placeholder='请输入纬度' |
|||
v-model="dataForm.latitude"> |
|||
</el-input> |
|||
</div> |
|||
|
|||
</el-form-item> |
|||
|
|||
</el-form> |
|||
|
|||
</div> |
|||
|
|||
<div v-show="propertyFormShow"> |
|||
<el-form :inline="false" |
|||
:model="propertyForm" |
|||
:rules="propertyRule" |
|||
class="form"> |
|||
<el-form-item label="物业名称" |
|||
prop="name" |
|||
label-width="150px" |
|||
style="display:block"> |
|||
<el-input class="item_width_1" |
|||
maxlength="50" |
|||
show-word-limit |
|||
placeholder='请输入小区名称' |
|||
v-model="propertyForm.name"> |
|||
</el-input> |
|||
|
|||
</el-form-item> |
|||
|
|||
</el-form> |
|||
|
|||
</div> |
|||
</div> |
|||
<div class="div_btn"> |
|||
<el-button @click="handleCancle">取 消</el-button> |
|||
<el-button v-if="formType!='detail'" |
|||
type="primary" |
|||
@click="handleComfirm">确 定</el-button> |
|||
</div> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapGetters } from 'vuex' |
|||
import { Loading } from 'element-ui' // 引入Loading服务 |
|||
import { requestPost } from "@/js/dai/request"; |
|||
var map; |
|||
var search; |
|||
var markers; |
|||
var infoWindowList |
|||
let loading // 加载动画 |
|||
export default { |
|||
data () { |
|||
return { |
|||
formType: 'add',//表单操作类型 add新增,edit编辑,detail详情 |
|||
|
|||
gridList: [], |
|||
propertyList: [], |
|||
|
|||
neighborHoodId: '',//小区ID |
|||
dataForm: { |
|||
neighborHoodName: '', // 小区名称【不超过50字】 |
|||
agencyId: '', // 所属组织ID |
|||
agencyName: '', |
|||
gridId: '', //所属网格ID |
|||
propertyId: '', //关联物业 |
|||
address: '', //详细地址 |
|||
remark: '', //备注【最大500字】 |
|||
location: '', //坐标位置 |
|||
longitude: '', //经度 |
|||
latitude: '', //纬度 |
|||
}, |
|||
|
|||
propertyFormShow: false, |
|||
propertyForm: { |
|||
name: '' |
|||
}, |
|||
|
|||
keyWords: '' |
|||
|
|||
|
|||
} |
|||
}, |
|||
components: { |
|||
|
|||
}, |
|||
mounted () { |
|||
this.initMap() |
|||
}, |
|||
|
|||
methods: { |
|||
// 地图初始化函数,本例取名为init,开发者可根据实际情况定义 |
|||
initMap () { |
|||
// 定义地图中心点坐标 |
|||
var center = new window.TMap.LatLng(39.984120, 116.307484) |
|||
// 定义map变量,调用 TMap.Map() 构造函数创建地图 |
|||
map = new window.TMap.Map(document.getElementById('app'), { |
|||
center: center, // 设置地图中心点坐标 |
|||
zoom: 17.2, // 设置地图缩放级别 |
|||
pitch: 43.5, // 设置俯仰角 |
|||
rotation: 45 // 设置地图旋转角度 |
|||
}) |
|||
console.log(map) |
|||
console.log(window) |
|||
search = new window.TMap.service.Search({ pageSize: 10 }); |
|||
// 新建一个地点搜索类 |
|||
markers = new TMap.MultiMarker({ |
|||
map: map, |
|||
geometries: [], |
|||
}); |
|||
infoWindowList = Array(10); |
|||
}, |
|||
|
|||
handleSearchMap () { |
|||
infoWindowList.forEach((infoWindow) => { |
|||
infoWindow.close(); |
|||
}); |
|||
infoWindowList.length = 0; |
|||
markers.setGeometries([]); |
|||
// 在地图显示范围内以给定的关键字搜索地点 |
|||
search |
|||
.searchRectangle({ |
|||
keyword: this.keyWords, |
|||
bounds: map.getBounds(), |
|||
}) |
|||
.then((result) => { |
|||
result.data.forEach((item, index) => { |
|||
var geometries = markers.getGeometries(); |
|||
var infoWindow = new window.TMap.InfoWindow({ |
|||
map: map, |
|||
position: item.location, |
|||
content: `<h3>${item.title}</h3><p>地址:${item.address}</p><p>电话:${item.tel}</p>`, |
|||
offset: { x: 0, y: -50 }, |
|||
}); // 新增信息窗体显示地标的名称与地址、电话等信息 |
|||
infoWindow.close(); |
|||
infoWindowList[index] = infoWindow; |
|||
geometries.push({ |
|||
id: String(index), // 点标注数据数组 |
|||
position: item.location, |
|||
}); |
|||
markers.updateGeometries(geometries); // 绘制地点标注 |
|||
markers.on('click', (e) => { |
|||
infoWindowList[Number(e.geometry.id)].open(); |
|||
}); // 点击标注显示信息窗体 |
|||
}); |
|||
}); |
|||
}, |
|||
async initForm (type, row) { |
|||
this.formType = type |
|||
if (row) { |
|||
this.neighborHoodId = row.neighborHoodId |
|||
this.dataForm = row |
|||
} |
|||
|
|||
await this.loadAgency() |
|||
await this.loadGrid() |
|||
// await this.loadProperty() |
|||
}, |
|||
|
|||
//加载组织 |
|||
async loadAgency () { |
|||
const url = "/epmetuser/customerstaff/staffbasicinfo" |
|||
let params = {} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
this.dataForm.agencyId = data.agencyId |
|||
this.dataForm.agencyName = data.agencyName |
|||
|
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
//加载网格 |
|||
async loadGrid () { |
|||
const url = "/gov/org/grid/allgrids" |
|||
// const url = "https://epmet-dev.elinkservice.cn:7082/api/apimock-v2/95518686fa128a53f64c678906848062/gov/org/grid/allgrids" |
|||
let params = { |
|||
agencyId: this.dataForm.agencyId |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
this.gridList = data |
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
//加载物业 |
|||
async loadProperty () { |
|||
const url = "/gov/org/propertymanagement/list" |
|||
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/propertymanagement/list" |
|||
let params = {} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
this.propertyList = data |
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
|
|||
handleAddProperty () { |
|||
this.propertyForm.name = '' |
|||
this.propertyFormShow = true |
|||
}, |
|||
|
|||
async handleComfirm () { |
|||
if (this.propertyFormShow) { |
|||
|
|||
this.addProperty() |
|||
} else { |
|||
this.addCommunity() |
|||
} |
|||
}, |
|||
async addCommunity () { |
|||
|
|||
let url = "" |
|||
if (this.formType === 'add') { |
|||
url = "/gov/org/neighborhood/neighborhoodadd" |
|||
// url = "http://yapi.elinkservice.cn/mock/245/gov/org/neighborhood/neighborhoodadd" |
|||
} else { |
|||
url = "/gov/org/neighborhood/neighborhoodupdate" |
|||
|
|||
this.dataForm.neighborHoodId = this.neighborHoodId |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, this.dataForm) |
|||
|
|||
if (code === 0) { |
|||
this.$message({ |
|||
type: "success", |
|||
message: "添加小区成功" |
|||
}); |
|||
|
|||
this.propertyFormShow = false |
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
|
|||
}, |
|||
async addProperty () { |
|||
const url = "/gov/org/propertymanagement/add" |
|||
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/propertymanagement/add" |
|||
let params = { |
|||
name: this.propertyForm.name |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
|
|||
this.$message({ |
|||
type: "success", |
|||
message: "添加物业成功" |
|||
}); |
|||
this.propertyForm.name = '' |
|||
this.propertyFormShow = false |
|||
this.loadProperty() |
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
|
|||
}, |
|||
handleCancle () { |
|||
if (this.propertyFormShow) { |
|||
this.propertyForm.name = '' |
|||
this.propertyFormShow = false |
|||
} else { |
|||
this.$emit('dialogCancle') |
|||
} |
|||
|
|||
|
|||
}, |
|||
resetData () { |
|||
|
|||
|
|||
}, |
|||
// 开启加载动画 |
|||
startLoading () { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: '正在加载……', // 加载中需要显示的文字 |
|||
background: 'rgba(0,0,0,.7)' // 背景颜色 |
|||
}) |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading () { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close() |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
neighborHoodName: [ |
|||
{ required: true, message: '小区名称不能为空', trigger: 'blur' }, |
|||
{ min: 1, max: 50, message: '小区名称长度在 1 到 50个字符', trigger: 'blur' } |
|||
], |
|||
agencyId: [ |
|||
{ required: true, message: '所属组织不能为空', trigger: 'blur' } |
|||
], |
|||
gridId: [ |
|||
{ required: true, message: '所属网格不能为空', trigger: 'blur' } |
|||
], |
|||
address: [ |
|||
{ required: true, message: '详细地址不能为空', trigger: 'blur' } |
|||
], |
|||
longitude: [ |
|||
{ required: true, message: '坐标不能为空', trigger: 'blur' } |
|||
] |
|||
|
|||
} |
|||
}, |
|||
propertyRule () { |
|||
name: [ |
|||
{ required: true, message: '物业名称不能为空', trigger: 'blur' }, |
|||
// { min: 1, max: 50, message: '小区名称长度在 1 到 50个字符', trigger: 'blur' } |
|||
] |
|||
} |
|||
}, |
|||
props: { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
<style scoped > |
|||
.item_width_1 { |
|||
width: 500px; |
|||
} |
|||
.item_width_2 { |
|||
width: 400px; |
|||
} |
|||
.item_width_3 { |
|||
margin-left: 10px; |
|||
width: 200px; |
|||
} |
|||
|
|||
.div_map { |
|||
margin-top: 10px; |
|||
} |
|||
|
|||
.div_btn { |
|||
display: flex; |
|||
justify-content: flex-end; |
|||
} |
|||
.el-tabs { |
|||
margin: 0 20px; |
|||
} |
|||
.el-upload__tip { |
|||
color: rgb(155, 155, 155); |
|||
margin: 0; |
|||
} |
|||
.form { |
|||
margin-top: 30px; |
|||
} |
|||
</style> |
@ -0,0 +1,374 @@ |
|||
<template> |
|||
<div> |
|||
<div class="div_search"> |
|||
<div class="resi-cell"> |
|||
<div class="resi-cell-label">房主姓名</div> |
|||
<div class="resi-cell-value"> |
|||
<el-input v-model="ownerName" |
|||
class="resi-cell-input" |
|||
size="small" |
|||
clearable |
|||
placeholder="请输入内容"> |
|||
</el-input> |
|||
|
|||
</div> |
|||
</div> |
|||
<div class="resi-cell"> |
|||
<div class="resi-cell-label">房主手机</div> |
|||
<div class="resi-cell-value"> |
|||
<el-input v-model="ownerPhone" |
|||
class="resi-cell-input" |
|||
size="small" |
|||
clearable |
|||
placeholder="请输入内容"> |
|||
</el-input> |
|||
|
|||
</div> |
|||
</div> |
|||
<el-button style="margin-left:10px" |
|||
type="primary" |
|||
size="small" |
|||
@click="handleSearch">查询</el-button> |
|||
</div> |
|||
<div class="div_btn"> |
|||
<el-button type="warning" |
|||
size="small" |
|||
@click="handleExport">导出</el-button> |
|||
<el-button type="success" |
|||
size="small" |
|||
@click="handleAdd">新增小区</el-button> |
|||
<el-button type="primary" |
|||
size="small" |
|||
@click="handleExportModule">下载小区模板</el-button> |
|||
<el-button type="danger" |
|||
size="small" |
|||
@click="handleInport">导入小区数据</el-button> |
|||
</div> |
|||
|
|||
<div class="div_table"> |
|||
<el-table :data="tableData" |
|||
border |
|||
style="width: 100%"> |
|||
<el-table-column prop="neighborHoodName" |
|||
label="小区名称" |
|||
width="180"> |
|||
</el-table-column> |
|||
<el-table-column prop="orgName" |
|||
label="所属组织" |
|||
width="160"> |
|||
</el-table-column> |
|||
<el-table-column prop="gridName" |
|||
label="所属网格" |
|||
width="140"> |
|||
</el-table-column> |
|||
<el-table-column prop="address" |
|||
label="详细地址"> |
|||
</el-table-column> |
|||
<el-table-column prop="remark" |
|||
label="备注"> |
|||
</el-table-column> |
|||
<el-table-column label="操作" |
|||
fixed="right" |
|||
width="140" |
|||
header-align="center" |
|||
align="center" |
|||
class="operate"> |
|||
<template slot-scope="scope"> |
|||
|
|||
<el-button type="text" |
|||
style="color:#1C6AFD;text-decoration: underline;" |
|||
size="small" |
|||
@click="handleDetail(scope.row)">查看</el-button> |
|||
<el-button type="text" |
|||
style="color:#00A7A9;text-decoration: underline;" |
|||
size="small" |
|||
@click="handleEdit(scope.row)">修改</el-button> |
|||
|
|||
<el-button type="text" |
|||
style="color:#D51010;text-decoration: underline;" |
|||
size="small" |
|||
@click="handleDelete(scope.row)">删除</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<div> |
|||
<el-pagination @size-change="handleSizeChange" |
|||
@current-change="handleCurrentChange" |
|||
:current-page.sync="params.pageNo" |
|||
:page-sizes="[20, 30, 50]" |
|||
:page-size="params.pageSize" |
|||
layout="sizes, prev, pager, next" |
|||
:total="total"> |
|||
</el-pagination> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- 修改弹出框 --> |
|||
<el-dialog :visible.sync="formShow" |
|||
:close-on-click-modal="false" |
|||
:close-on-press-escape="false" |
|||
:title="formTitle" |
|||
width="800px" |
|||
top='5' |
|||
@closed="diaClose"> |
|||
<community-form ref="ref_form" |
|||
@dialogCancle="addFormCancle" |
|||
@dialogOk="addFormOk"></community-form> |
|||
</el-dialog> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
|
|||
import CommunityForm from './communityForm' |
|||
|
|||
import { requestPost } from "@/js/dai/request"; |
|||
import { mapGetters } from 'vuex' |
|||
import { Loading } from 'element-ui' // 引入Loading服务 |
|||
|
|||
let loading // 加载动画 |
|||
export default { |
|||
data () { |
|||
return { |
|||
loading: false, |
|||
total: 0, |
|||
params: { |
|||
pageSize: 20, |
|||
pageNo: 0, |
|||
ownerName: '', |
|||
ownerPhone: '' |
|||
}, |
|||
|
|||
selTreeId: '', |
|||
selTreeLevel: '', |
|||
ownerName: '', |
|||
ownerPhone: '', |
|||
tableData: [], |
|||
|
|||
//form相关 |
|||
formShow: false, |
|||
formTitle: '新增小区' |
|||
|
|||
} |
|||
}, |
|||
components: { |
|||
CommunityForm |
|||
}, |
|||
async mounted () { |
|||
|
|||
}, |
|||
computed: { |
|||
rowHeight () { |
|||
return (this.clientHeight - 200) + 'px' |
|||
}, |
|||
...mapGetters(['clientHeight']) |
|||
}, |
|||
methods: { |
|||
handleSearch () { |
|||
this.loadTable() |
|||
}, |
|||
async loadTable (selTreeId, selTreeLevel) { |
|||
if (selTreeId && selTreeLevel) { |
|||
this.selTreeId = selTreeId |
|||
this.selTreeLevel = selTreeLevel |
|||
} |
|||
const url = "/gov/org/neighborhood/neighborhoodlist" |
|||
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/neighborhood/neighborhoodlist" |
|||
let params = { |
|||
pageSize: this.pageSize, |
|||
pageNo: this.pageNo, |
|||
ownerName: this.ownerName, |
|||
ownerPhone: this.ownerPhone, |
|||
level: this.selTreeId, |
|||
id: this.selTreeLevel |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
this.total = data.total |
|||
this.tableData = data.list |
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
|
|||
diaClose () { |
|||
this.formShow = false |
|||
}, |
|||
|
|||
handleDetail (row) { |
|||
this.formTitle = '小区详情' |
|||
this.formShow = true |
|||
this.$nextTick(() => { |
|||
this.$refs.ref_form.initForm('detail', row) |
|||
}) |
|||
}, |
|||
|
|||
handleAdd () { |
|||
this.formTitle = '新增小区' |
|||
this.formShow = true |
|||
this.$nextTick(() => { |
|||
this.$refs.ref_form.initForm('add') |
|||
}) |
|||
}, |
|||
|
|||
handleEdit (row) { |
|||
this.formTitle = '修改小区' |
|||
this.formShow = true |
|||
this.$refs.ref_form.initForm('edit', row) |
|||
}, |
|||
|
|||
addFormCancle () { |
|||
this.formShow = false |
|||
}, |
|||
addFormOk () { |
|||
this.formShow = false |
|||
this.loadTable() |
|||
}, |
|||
|
|||
async handleDelete (row) { |
|||
|
|||
this.$confirm("确认删除?", "提示", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning" |
|||
}) |
|||
.then(() => { |
|||
this.deleteCommunity(row) |
|||
}) |
|||
.catch(err => { |
|||
if (err == "cancel") { |
|||
// this.$message({ |
|||
// type: "info", |
|||
// message: "已取消删除" |
|||
// }); |
|||
} |
|||
|
|||
}); |
|||
|
|||
|
|||
}, |
|||
|
|||
async deleteCommunity (row) { |
|||
const url = "/gov/org/neighborhood/neighborhooddel" |
|||
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/neighborhood/neighborhooddel" |
|||
let params = { |
|||
neighborHoodId: row.neighborHoodId |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
this.$message({ |
|||
type: "success", |
|||
message: "删除成功" |
|||
}); |
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
|
|||
handleExport () { |
|||
|
|||
}, |
|||
|
|||
|
|||
handleExportModule () { |
|||
|
|||
}, |
|||
handleInport () { |
|||
|
|||
}, |
|||
|
|||
|
|||
handleSizeChange (val) { |
|||
console.log(`每页 ${val} 条`) |
|||
}, |
|||
handleCurrentChange (val) { |
|||
console.log(`当前页: ${val}`) |
|||
}, |
|||
|
|||
// 开启加载动画 |
|||
startLoading () { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: '正在加载……', // 加载中需要显示的文字 |
|||
background: 'rgba(0,0,0,.7)' // 背景颜色 |
|||
}) |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading () { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close() |
|||
} |
|||
} |
|||
}, |
|||
watch: { |
|||
filterText (val) { |
|||
this.$refs.tree.filter(val); |
|||
} |
|||
}, |
|||
props: { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped > |
|||
.div_search { |
|||
display: flex; |
|||
|
|||
.resi-cell { |
|||
display: flex; |
|||
align-items: center; |
|||
.resi-cell-label { |
|||
width: 70px; |
|||
box-sizing: border-box; |
|||
margin-right: 15px; |
|||
text-align: right; |
|||
// line-height: 32; |
|||
} |
|||
|
|||
.resi-cell-input { |
|||
width: 180px; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.div_table { |
|||
margin-top: 20px; |
|||
} |
|||
.div_search { |
|||
display: flex; |
|||
|
|||
.resi-cell { |
|||
display: flex; |
|||
align-items: center; |
|||
.resi-cell-label { |
|||
width: 70px; |
|||
box-sizing: border-box; |
|||
margin-right: 15px; |
|||
text-align: right; |
|||
// line-height: 32; |
|||
} |
|||
|
|||
.resi-cell-input { |
|||
width: 180px; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.div_btn { |
|||
margin-top: 20px; |
|||
} |
|||
|
|||
.el-row { |
|||
/* margin-bottom: 20px; */ |
|||
display: flex; |
|||
flex-wrap: wrap; |
|||
margin-top: 10px; |
|||
margin-right: 50px; |
|||
} |
|||
</style> |
@ -0,0 +1,403 @@ |
|||
<template> |
|||
<div> |
|||
<div> |
|||
<div v-show="!propertyFormShow"> |
|||
<el-form :inline="false" |
|||
:model="dataForm" |
|||
:rules="dataRule" |
|||
:disabled="formType==='detail'" |
|||
class="form"> |
|||
<el-form-item label="小区名称" |
|||
prop="neighborHoodName" |
|||
label-width="150px" |
|||
style="display:block"> |
|||
<el-input class="item_width_1" |
|||
maxlength="50" |
|||
show-word-limit |
|||
placeholder='请输入小区名称' |
|||
v-model="dataForm.neighborHoodName"> |
|||
</el-input> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="所属组织" |
|||
prop="agencyId" |
|||
label-width="150px" |
|||
style="display:block"> |
|||
<el-select class="item_width_1" |
|||
v-model="dataForm.agencyId" |
|||
placeholder="请选择" |
|||
@change="handleAgencyChanged" |
|||
clearable> |
|||
<el-option v-for="item in agencyList" |
|||
:key="item.agencyId" |
|||
:label="item.agencyName" |
|||
:value="item.agencyId"> |
|||
</el-option> |
|||
</el-select> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="所属网格" |
|||
prop="gridId" |
|||
label-width="150px" |
|||
style="display:block"> |
|||
<el-select class="item_width_1" |
|||
v-model="dataForm.gridId" |
|||
placeholder="请选择" |
|||
clearable> |
|||
<el-option v-for="item in gridList" |
|||
:key="item.gridId" |
|||
:label="item.gridName" |
|||
:value="item.gridId"> |
|||
</el-option> |
|||
</el-select> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="关联物业" |
|||
prop="propertyId" |
|||
label-width="150px" |
|||
style="display:block"> |
|||
<el-select class="item_width_2" |
|||
v-model="dataForm.propertyId" |
|||
placeholder="请选择" |
|||
clearable> |
|||
<el-option v-for="item in propertyList" |
|||
:key="item.propertyId" |
|||
:label="item.propertyName" |
|||
:value="item.propertyId"> |
|||
</el-option> |
|||
</el-select> |
|||
|
|||
<el-button style="margin-left:10px" |
|||
type="primary" |
|||
size="small" |
|||
@click="handleAddProperty">添加物业</el-button> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="详细地址" |
|||
prop="address" |
|||
label-width="150px" |
|||
style="display:block"> |
|||
<el-input class="item_width_1" |
|||
maxlength="50" |
|||
show-word-limit |
|||
placeholder='请输入详细地址' |
|||
v-model="dataForm.address"> |
|||
</el-input> |
|||
|
|||
</el-form-item> |
|||
<el-form-item label="备注" |
|||
prop="remark" |
|||
label-width="150px" |
|||
style="display:block"> |
|||
<el-input class="item_width_1" |
|||
type="textarea" |
|||
maxlength="500" |
|||
:rows="3" |
|||
placeholder='请输入备注,不超过500字' |
|||
v-model="dataForm.remark"></el-input> |
|||
|
|||
</el-form-item> |
|||
<!-- <el-form-item label="位置坐标" |
|||
prop="neighborHoodName" |
|||
label-width="150px" |
|||
style="display:block"> |
|||
<el-input class="item_width_1" |
|||
maxlength="50" |
|||
show-word-limit |
|||
placeholder='请输入小区名称' |
|||
v-model="dataForm.neighborHoodName"> |
|||
</el-input> |
|||
|
|||
</el-form-item> --> |
|||
|
|||
</el-form> |
|||
</div> |
|||
|
|||
<div v-show="propertyFormShow"> |
|||
<el-form :inline="false" |
|||
:model="propertyForm" |
|||
:rules="propertyRule" |
|||
class="form"> |
|||
<el-form-item label="物业名称" |
|||
prop="name" |
|||
label-width="150px" |
|||
style="display:block"> |
|||
<el-input class="item_width_1" |
|||
maxlength="50" |
|||
show-word-limit |
|||
placeholder='请输入小区名称' |
|||
v-model="propertyForm.name"> |
|||
</el-input> |
|||
|
|||
</el-form-item> |
|||
|
|||
</el-form> |
|||
|
|||
</div> |
|||
</div> |
|||
<div class="div_btn"> |
|||
<el-button @click="handleCancle">取 消</el-button> |
|||
<el-button v-if="formType!='detail'" |
|||
type="primary" |
|||
@click="handleComfirm">确 定</el-button> |
|||
</div> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapGetters } from 'vuex' |
|||
import { Loading } from 'element-ui' // 引入Loading服务 |
|||
import { requestPost } from "@/js/dai/request"; |
|||
|
|||
let loading // 加载动画 |
|||
export default { |
|||
data () { |
|||
return { |
|||
formType: 'add',//表单操作类型 add新增,edit编辑,detail详情 |
|||
|
|||
agencyList: [], |
|||
gridList: [], |
|||
propertyList: [], |
|||
|
|||
neighborHoodId: '',//小区ID |
|||
dataForm: { |
|||
neighborHoodName: '', // 小区名称【不超过50字】 |
|||
agencyId: '', // 所属组织ID |
|||
gridId: '', //所属网格ID |
|||
propertyId: '', //关联物业 |
|||
address: '', //详细地址 |
|||
remark: '', //备注【最大500字】 |
|||
location: '', //坐标位置 |
|||
longitude: '', //经度 |
|||
latitude: '', //纬度 |
|||
}, |
|||
|
|||
propertyFormShow: false, |
|||
propertyForm: { |
|||
name: '' |
|||
} |
|||
|
|||
} |
|||
}, |
|||
components: { |
|||
|
|||
}, |
|||
mounted () { |
|||
}, |
|||
|
|||
methods: { |
|||
async initForm (type, row) { |
|||
this.formType = type |
|||
if (row) { |
|||
this.neighborHoodId = row.neighborHoodId |
|||
this.dataForm = row |
|||
} |
|||
|
|||
await this.loadAgency() |
|||
await this.loadProperty() |
|||
}, |
|||
|
|||
async handleAgencyChanged () { |
|||
await this.loadGrid() |
|||
}, |
|||
|
|||
//加载组织 |
|||
async loadAgency () { |
|||
// const url = "/gov/org/agency/belongOrg" |
|||
const url = "http://yapi.elinkservice.cn/mock/245/gov/org/agency/belongOrg" |
|||
let params = {} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
|
|||
this.agencyList = data |
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
//加载网格 |
|||
async loadGrid () { |
|||
// const url = "/gov/org/grid/allgrids" |
|||
const url = "https://epmet-dev.elinkservice.cn:7082/api/apimock-v2/95518686fa128a53f64c678906848062/gov/org/grid/allgrids" |
|||
let params = { |
|||
agencyId: this.dataForm.agencyId |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
this.gridList = data |
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
//加载物业 |
|||
async loadProperty () { |
|||
// const url = "/gov/org/propertymanagement/list" |
|||
const url = "http://yapi.elinkservice.cn/mock/245/gov/org/propertymanagement/list" |
|||
let params = {} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
this.propertyList = data |
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
|
|||
handleAddProperty () { |
|||
this.propertyForm.name = '' |
|||
this.propertyFormShow = true |
|||
}, |
|||
|
|||
async handleComfirm () { |
|||
if (this.propertyFormShow) { |
|||
|
|||
this.addProperty() |
|||
} else { |
|||
this.addCommunity() |
|||
} |
|||
}, |
|||
async addCommunity () { |
|||
// let url = "/gov/org/neighborhood/neighborhoodadd" |
|||
let url = "http://yapi.elinkservice.cn/mock/245/gov/org/neighborhood/neighborhoodadd" |
|||
if (this.formType === 'add') { |
|||
// url = "/gov/org/neighborhood/neighborhoodadd" |
|||
url = "http://yapi.elinkservice.cn/mock/245/gov/org/neighborhood/neighborhoodadd" |
|||
} else { |
|||
// url = "/gov/org/neighborhood/neighborhoodadd" |
|||
url = "http://yapi.elinkservice.cn/mock/245/gov/org/neighborhood/neighborhoodadd" |
|||
this.dataForm.neighborHoodId = this.neighborHoodId |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, this.dataForm) |
|||
|
|||
if (code === 0) { |
|||
this.$message({ |
|||
type: "success", |
|||
message: "添加小区成功" |
|||
}); |
|||
|
|||
this.propertyFormShow = false |
|||
|
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
|
|||
}, |
|||
async addProperty () { |
|||
// const url = "/gov/org/propertymanagement/add" |
|||
const url = "http://yapi.elinkservice.cn/mock/245/gov/org/propertymanagement/add" |
|||
let params = { |
|||
name: this.propertyForm.name |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
|
|||
this.$message({ |
|||
type: "success", |
|||
message: "添加物业成功" |
|||
}); |
|||
this.propertyForm.name = '' |
|||
this.propertyFormShow = false |
|||
this.loadProperty() |
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
|
|||
}, |
|||
handleCancle () { |
|||
if (this.propertyFormShow) { |
|||
this.propertyForm.name = '' |
|||
this.propertyFormShow = false |
|||
} else { |
|||
this.$emit('dialogCancle') |
|||
} |
|||
|
|||
|
|||
}, |
|||
resetData () { |
|||
|
|||
|
|||
}, |
|||
// 开启加载动画 |
|||
startLoading () { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: '正在加载……', // 加载中需要显示的文字 |
|||
background: 'rgba(0,0,0,.7)' // 背景颜色 |
|||
}) |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading () { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close() |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
neighborHoodName: [ |
|||
{ required: true, message: '小区名称不能为空', trigger: 'blur' }, |
|||
{ min: 1, max: 50, message: '小区名称长度在 1 到 50个字符', trigger: 'blur' } |
|||
], |
|||
agencyId: [ |
|||
{ required: true, message: '所属组织不能为空', trigger: 'blur' } |
|||
], |
|||
gridId: [ |
|||
{ required: true, message: '所属网格不能为空', trigger: 'blur' } |
|||
], |
|||
address: [ |
|||
{ required: true, message: '详细地址不能为空', trigger: 'blur' } |
|||
], |
|||
location: [ |
|||
{ required: true, message: '上架状态不能为空', trigger: 'blur' } |
|||
] |
|||
|
|||
} |
|||
}, |
|||
propertyRule () { |
|||
name: [ |
|||
{ required: true, message: '物业名称不能为空', trigger: 'blur' }, |
|||
// { min: 1, max: 50, message: '小区名称长度在 1 到 50个字符', trigger: 'blur' } |
|||
] |
|||
} |
|||
}, |
|||
props: { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
<style scoped > |
|||
.item_width_1 { |
|||
width: 500px; |
|||
} |
|||
.item_width_2 { |
|||
width: 400px; |
|||
} |
|||
|
|||
.div_btn { |
|||
display: flex; |
|||
justify-content: flex-end; |
|||
} |
|||
.el-tabs { |
|||
margin: 0 20px; |
|||
} |
|||
.el-upload__tip { |
|||
color: rgb(155, 155, 155); |
|||
margin: 0; |
|||
} |
|||
.form { |
|||
margin-top: 30px; |
|||
} |
|||
</style> |
@ -0,0 +1,383 @@ |
|||
<template> |
|||
<div> |
|||
<div class="div_search"> |
|||
<div class="resi-cell"> |
|||
<div class="resi-cell-label">房主姓名</div> |
|||
<div class="resi-cell-value"> |
|||
<el-input v-model="ownerName" |
|||
class="resi-cell-input" |
|||
size="small" |
|||
clearable |
|||
placeholder="请输入内容"> |
|||
</el-input> |
|||
|
|||
</div> |
|||
</div> |
|||
<div class="resi-cell"> |
|||
<div class="resi-cell-label">房主手机</div> |
|||
<div class="resi-cell-value"> |
|||
<el-input v-model="ownerPhone" |
|||
class="resi-cell-input" |
|||
size="small" |
|||
clearable |
|||
placeholder="请输入内容"> |
|||
</el-input> |
|||
|
|||
</div> |
|||
</div> |
|||
<el-button style="margin-left:10px" |
|||
type="primary" |
|||
size="small" |
|||
@click="handleSearch">查询</el-button> |
|||
</div> |
|||
<div class="div_btn"> |
|||
<el-button type="warning" |
|||
size="small" |
|||
@click="handleExport">导出</el-button> |
|||
<el-button type="success" |
|||
size="small" |
|||
@click="handleAdd">新增房屋</el-button> |
|||
<el-button type="primary" |
|||
size="small" |
|||
@click="handleExportModule">下载房屋模板</el-button> |
|||
<el-button type="danger" |
|||
size="small" |
|||
@click="handleInport">导入房屋数据</el-button> |
|||
</div> |
|||
|
|||
<div class="div_table"> |
|||
<el-table :data="tableData" |
|||
border |
|||
style="width: 100%"> |
|||
<el-table-column prop="neighborHoodName" |
|||
label="房屋名称" |
|||
width="180"> |
|||
</el-table-column> |
|||
<el-table-column prop="orgName" |
|||
label="所属小区" |
|||
width="160"> |
|||
</el-table-column> |
|||
<el-table-column prop="gridName" |
|||
label="所属楼栋" |
|||
width="140"> |
|||
</el-table-column> |
|||
<el-table-column prop="address" |
|||
label="单元号"> |
|||
</el-table-column> |
|||
<el-table-column prop="remark" |
|||
label="门牌号"> |
|||
</el-table-column> |
|||
<el-table-column prop="remark" |
|||
label="房屋类型"> |
|||
</el-table-column> |
|||
<el-table-column prop="remark" |
|||
label="房屋用途"> |
|||
</el-table-column> |
|||
<el-table-column prop="remark" |
|||
label="是否出租"> |
|||
</el-table-column> |
|||
<el-table-column prop="remark" |
|||
label="房主姓名"> |
|||
</el-table-column> |
|||
<el-table-column prop="remark" |
|||
label="房主电话"> |
|||
</el-table-column> |
|||
<el-table-column prop="remark" |
|||
label="身份证号码"> |
|||
</el-table-column> |
|||
<el-table-column label="操作" |
|||
fixed="right" |
|||
width="140" |
|||
header-align="center" |
|||
align="center" |
|||
class="operate"> |
|||
<template slot-scope="scope"> |
|||
|
|||
<el-button type="text" |
|||
style="color:#1C6AFD;text-decoration: underline;" |
|||
size="small" |
|||
@click="handleDetail(scope.row)">查看</el-button> |
|||
<el-button type="text" |
|||
style="color:#00A7A9;text-decoration: underline;" |
|||
size="small" |
|||
@click="handleEdit(scope.row)">修改</el-button> |
|||
|
|||
<el-button type="text" |
|||
style="color:#D51010;text-decoration: underline;" |
|||
size="small" |
|||
@click="handleDelete(scope.row)">删除</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<div> |
|||
<el-pagination @size-change="handleSizeChange" |
|||
@current-change="handleCurrentChange" |
|||
:current-page.sync="params.pageNo" |
|||
:page-sizes="[20, 30, 50]" |
|||
:page-size="params.pageSize" |
|||
layout="sizes, prev, pager, next" |
|||
:total="total"> |
|||
</el-pagination> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- 修改弹出框 --> |
|||
<el-dialog :visible.sync="formShow" |
|||
:close-on-click-modal="false" |
|||
:close-on-press-escape="false" |
|||
:title="formTitle" |
|||
width="800px" |
|||
@closed="diaClose"> |
|||
<community-form ref="ref_form" |
|||
@dialogCancle="addFormCancle" |
|||
@dialogOk="addFormOk"></community-form> |
|||
</el-dialog> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
|
|||
import CommunityForm from './communityForm' |
|||
|
|||
import { requestPost } from "@/js/dai/request"; |
|||
import { mapGetters } from 'vuex' |
|||
import { Loading } from 'element-ui' // 引入Loading服务 |
|||
|
|||
let loading // 加载动画 |
|||
export default { |
|||
data () { |
|||
return { |
|||
loading: false, |
|||
total: 0, |
|||
params: { |
|||
pageSize: 20, |
|||
pageNo: 0, |
|||
ownerName: '', |
|||
ownerPhone: '' |
|||
}, |
|||
|
|||
ownerName: '', |
|||
ownerPhone: '', |
|||
tableData: [], |
|||
|
|||
//form相关 |
|||
formShow: false, |
|||
formTitle: '新增小区' |
|||
|
|||
} |
|||
}, |
|||
components: { |
|||
CommunityForm |
|||
}, |
|||
async mounted () { |
|||
|
|||
}, |
|||
computed: { |
|||
rowHeight () { |
|||
return (this.clientHeight - 200) + 'px' |
|||
}, |
|||
...mapGetters(['clientHeight']) |
|||
}, |
|||
methods: { |
|||
handleSearch () { |
|||
this.loadTable() |
|||
}, |
|||
async loadTable () { |
|||
// const url = "/gov/org/neighborhood/neighborhoodlist" |
|||
const url = "http://yapi.elinkservice.cn/mock/245/gov/org/neighborhood/neighborhoodlist" |
|||
let params = { |
|||
pageSize: this.pageSize, |
|||
pageNo: this.pageNo, |
|||
ownerName: this.ownerName, |
|||
ownerPhone: this.ownerPhone |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
this.total = data.total |
|||
this.tableData = data.list |
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
|
|||
diaClose () { |
|||
this.formShow = false |
|||
}, |
|||
|
|||
handleDetail (row) { |
|||
this.formTitle = '小区详情' |
|||
this.formShow = true |
|||
this.$nextTick(() => { |
|||
this.$refs.ref_form.initForm('detail', row) |
|||
}) |
|||
}, |
|||
|
|||
handleAdd () { |
|||
this.formTitle = '新增小区' |
|||
this.formShow = true |
|||
this.$nextTick(() => { |
|||
this.$refs.ref_form.initForm('add') |
|||
}) |
|||
}, |
|||
|
|||
handleEdit (row) { |
|||
this.formTitle = '修改小区' |
|||
this.formShow = true |
|||
this.$refs.ref_form.initForm('edit', row) |
|||
}, |
|||
|
|||
addFormCancle () { |
|||
this.formShow = false |
|||
}, |
|||
addFormOk () { |
|||
this.formShow = false |
|||
this.loadTable() |
|||
}, |
|||
|
|||
async handleDelete (row) { |
|||
|
|||
this.$confirm("确认删除?", "提示", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning" |
|||
}) |
|||
.then(() => { |
|||
this.deleteCommunity(row) |
|||
}) |
|||
.catch(err => { |
|||
if (err == "cancel") { |
|||
// this.$message({ |
|||
// type: "info", |
|||
// message: "已取消删除" |
|||
// }); |
|||
} |
|||
|
|||
}); |
|||
|
|||
|
|||
}, |
|||
|
|||
async deleteCommunity (row) { |
|||
// const url = "/gov/org/neighborhood/neighborhooddel" |
|||
const url = "http://yapi.elinkservice.cn/mock/245/gov/org/neighborhood/neighborhooddel" |
|||
let params = { |
|||
neighborHoodId: row.neighborHoodId |
|||
} |
|||
|
|||
const { data, code, msg } = await requestPost(url, params) |
|||
|
|||
if (code === 0) { |
|||
this.$message({ |
|||
type: "success", |
|||
message: "删除成功" |
|||
}); |
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
}, |
|||
|
|||
handleExport () { |
|||
|
|||
}, |
|||
|
|||
|
|||
handleExportModule () { |
|||
|
|||
}, |
|||
handleInport () { |
|||
|
|||
}, |
|||
|
|||
|
|||
handleSizeChange (val) { |
|||
console.log(`每页 ${val} 条`) |
|||
}, |
|||
handleCurrentChange (val) { |
|||
console.log(`当前页: ${val}`) |
|||
}, |
|||
|
|||
// 开启加载动画 |
|||
startLoading () { |
|||
loading = Loading.service({ |
|||
lock: true, // 是否锁定 |
|||
text: '正在加载……', // 加载中需要显示的文字 |
|||
background: 'rgba(0,0,0,.7)' // 背景颜色 |
|||
}) |
|||
}, |
|||
// 结束加载动画 |
|||
endLoading () { |
|||
// clearTimeout(timer); |
|||
if (loading) { |
|||
loading.close() |
|||
} |
|||
} |
|||
}, |
|||
watch: { |
|||
filterText (val) { |
|||
this.$refs.tree.filter(val); |
|||
} |
|||
}, |
|||
props: { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped > |
|||
.div_search { |
|||
display: flex; |
|||
|
|||
.resi-cell { |
|||
display: flex; |
|||
align-items: center; |
|||
.resi-cell-label { |
|||
width: 70px; |
|||
box-sizing: border-box; |
|||
margin-right: 15px; |
|||
text-align: right; |
|||
// line-height: 32; |
|||
} |
|||
|
|||
.resi-cell-input { |
|||
width: 180px; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.div_table { |
|||
margin-top: 20px; |
|||
} |
|||
.div_search { |
|||
display: flex; |
|||
|
|||
.resi-cell { |
|||
display: flex; |
|||
align-items: center; |
|||
.resi-cell-label { |
|||
width: 70px; |
|||
box-sizing: border-box; |
|||
margin-right: 15px; |
|||
text-align: right; |
|||
// line-height: 32; |
|||
} |
|||
|
|||
.resi-cell-input { |
|||
width: 180px; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.div_btn { |
|||
margin-top: 20px; |
|||
} |
|||
|
|||
.el-row { |
|||
/* margin-bottom: 20px; */ |
|||
display: flex; |
|||
flex-wrap: wrap; |
|||
margin-top: 10px; |
|||
margin-right: 50px; |
|||
} |
|||
</style> |
Loading…
Reference in new issue