Browse Source

小区管理

shibei_master
jiangyy 4 years ago
parent
commit
bdff5f1cb7
  1. 61
      src/assets/scss/buttonstyle.scss
  2. 104
      src/assets/scss/common.scss
  3. 26
      src/views/modules/base/community/buildForm.vue
  4. 49
      src/views/modules/base/community/buildTable.vue
  5. 145
      src/views/modules/base/community/community.vue
  6. 18
      src/views/modules/base/community/communityForm.vue
  7. 53
      src/views/modules/base/community/communityTable.vue
  8. 34
      src/views/modules/base/community/roomForm.vue
  9. 42
      src/views/modules/base/community/roomTable.vue

61
src/assets/scss/buttonstyle.scss

@ -0,0 +1,61 @@
.el-button--green {
color: #fff;
background-color: #22c1c3;
border-color: #22c1c3;
}
.el-button--green:hover {
color: #fff;
background-color: #05b1b4;
border-color: #05b1b4;
}
.el-button--green:focus {
color: #fff;
background-color: #22c1c3;
border-color: #22c1c3;
}
.el-button--yellow:hover {
color: #fff;
background-color: #fa9200;
border-color: #fa9200;
}
.el-button--yellow:focus {
color: #fff;
background-color: #feb349;
border-color: #feb349;
}
.el-button--yellow {
color: #fff;
background-color: #feb349;
border-color: #feb349;
}
.el-button--blue:focus {
color: #fff;
background-color: #2195fe;
border-color: #2195fe;
}
.el-button--blue:hover {
color: #fff;
background-color: #0083fd;
border-color: #0083fd;
}
.el-button--blue {
color: #fff;
background-color: #2195fe;
border-color: #2195fe;
}
.el-button--red:focus {
color: #fff;
background-color: #fe6252;
border-color: #fe6252;
}
.el-button--red:hover {
color: #fff;
background-color: #fd341e;
border-color: #fd341e;
}
.el-button--red {
color: #fff;
background-color: #fe6252;
border-color: #fe6252;
}

104
src/assets/scss/common.scss

@ -4,8 +4,8 @@
box-sizing: border-box; box-sizing: border-box;
} }
body { body {
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB',
sans-serif; 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
font-size: $--font-size-base; font-size: $--font-size-base;
line-height: $base--line-height; line-height: $base--line-height;
color: $--color-text-primary; color: $--color-text-primary;
@ -35,7 +35,7 @@ img {
} }
.clearfix:before, .clearfix:before,
.clearfix:after { .clearfix:after {
content: " "; content: ' ';
display: table; display: table;
} }
.clearfix:after { .clearfix:after {
@ -144,8 +144,8 @@ img {
background-color: transparent; background-color: transparent;
} }
&-add { &-add {
> span > *[class*="el-icon-"], > span > *[class*='el-icon-'],
> span > *[class*="icon"] { > span > *[class*='icon'] {
vertical-align: middle; vertical-align: middle;
font-size: 18px; font-size: 18px;
margin-right: 5px; margin-right: 5px;
@ -383,7 +383,7 @@ img {
&::after { &::after {
position: absolute; position: absolute;
content: ""; content: '';
right: 0; right: 0;
top: 0; top: 0;
bottom: 0; bottom: 0;
@ -448,8 +448,8 @@ img {
} }
} }
&__search { &__search {
> *[class*="el-icon-"], > *[class*='el-icon-'],
> *[class*="icon"] { > *[class*='icon'] {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
} }
@ -572,7 +572,9 @@ img {
min-height: calc(#{$content--fill-height} - 2px); min-height: calc(#{$content--fill-height} - 2px);
} }
> .aui-card--fill > .el-card__header + .el-card__body { > .aui-card--fill > .el-card__header + .el-card__body {
min-height: calc(#{$content--fill-height} - #{$content--card-header-height} - 2px); min-height: calc(
#{$content--fill-height} - #{$content--card-header-height} - 2px
);
} }
&--tabs { &--tabs {
padding: $content--tabs-header-height 0 0; padding: $content--tabs-header-height 0 0;
@ -644,7 +646,7 @@ img {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: 0; left: 0;
content: ""; content: '';
width: 100%; width: 100%;
height: 2px; height: 2px;
background-color: $--color-primary; background-color: $--color-primary;
@ -677,10 +679,15 @@ img {
min-height: calc(#{$content--fill-height-tabs} - 2px); min-height: calc(#{$content--fill-height-tabs} - 2px);
} }
> .aui-card--fill > .el-card__header + .el-card__body { > .aui-card--fill > .el-card__header + .el-card__body {
min-height: calc(#{$content--fill-height-tabs} - #{$content--card-header-height} - 2px); min-height: calc(
#{$content--fill-height-tabs} - #{$content--card-header-height} -
2px
);
} }
&.is-iframe { &.is-iframe {
height: calc(#{$content--fill-height-tabs} + #{$content--padding * 2}); height: calc(
#{$content--fill-height-tabs} + #{$content--padding * 2}
);
margin: -$content--padding; margin: -$content--padding;
min-height: auto; min-height: auto;
> .aui-card--fill { > .aui-card--fill {
@ -699,7 +706,10 @@ img {
background-color: #fff; background-color: #fff;
} }
> .aui-card--fill > .el-card__header + .el-card__body { > .aui-card--fill > .el-card__header + .el-card__body {
height: calc(#{$content--fill-height-tabs} - #{$content--card-header-height} - 2px); height: calc(
#{$content--fill-height-tabs} - #{$content--card-header-height} -
2px
);
} }
} }
} }
@ -729,7 +739,7 @@ img {
/* Page /* Page
------------------------------ */ ------------------------------ */
*[class*="aui-page__"] { *[class*='aui-page__'] {
padding-top: 0; padding-top: 0;
.aui-content { .aui-content {
min-height: auto; min-height: auto;
@ -741,7 +751,71 @@ img {
min-height: calc(100vh - #{$content--padding * 2} - 2px); min-height: calc(100vh - #{$content--padding * 2} - 2px);
} }
> .aui-card--fill > .el-card__header + .el-card__body { > .aui-card--fill > .el-card__header + .el-card__body {
min-height: calc(100vh - #{$content--padding * 2} - #{$content--card-header-height} - 2px); min-height: calc(
100vh - #{$content--padding * 2} - #{$content--card-header-height} - 2px
);
} }
} }
} }
.el-button--green {
color: #fff;
background-color: #22c1c3;
border-color: #22c1c3;
}
.el-button--green:hover {
color: #fff;
background-color: #05b1b4;
border-color: #05b1b4;
}
.el-button--green:focus {
color: #fff;
background-color: #22c1c3;
border-color: #22c1c3;
}
.el-button--yellow:hover {
color: #fff;
background-color: #fa9200;
border-color: #fa9200;
}
.el-button--yellow:focus {
color: #fff;
background-color: #feb349;
border-color: #feb349;
}
.el-button--yellow {
color: #fff;
background-color: #feb349;
border-color: #feb349;
}
.el-button--blue:focus {
color: #fff;
background-color: #2195fe;
border-color: #2195fe;
}
.el-button--blue:hover {
color: #fff;
background-color: #0083fd;
border-color: #0083fd;
}
.el-button--blue {
color: #fff;
background-color: #2195fe;
border-color: #2195fe;
}
.el-button--red:focus {
color: #fff;
background-color: #fe6252;
border-color: #fe6252;
}
.el-button--red:hover {
color: #fff;
background-color: #fd341e;
border-color: #fd341e;
}
.el-button--red {
color: #fff;
background-color: #fe6252;
border-color: #fe6252;
}

26
src/views/modules/base/community/buildForm.vue

@ -35,14 +35,14 @@
<el-radio :label="'3'">别墅</el-radio> <el-radio :label="'3'">别墅</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="排序" <!-- <el-form-item label="排序"
prop="sort" prop="sort"
style="display: block" style="display: block"
label-width="150px"> label-width="150px">
<el-input-number class="item_width_1" <el-input-number class="item_width_1"
v-model="dataForm.sort" v-model="dataForm.sort"
label="排序"></el-input-number> label="排序"></el-input-number>
</el-form-item> </el-form-item> -->
<el-form-item label="单元数" <el-form-item label="单元数"
style="display: block" style="display: block"
prop="totalUnitNum" prop="totalUnitNum"
@ -75,7 +75,7 @@
prop="longitude" prop="longitude"
label-width="150px" label-width="150px"
style="display: block"> style="display: block">
<el-input class="item_width_3" <el-input class="item_width_4"
maxlength="50" maxlength="50"
placeholder="请输入关键字" placeholder="请输入关键字"
v-model="keyWords"> v-model="keyWords">
@ -108,6 +108,7 @@
<el-button @click="handleCancle"> </el-button> <el-button @click="handleCancle"> </el-button>
<el-button v-if="formType != 'detail'" <el-button v-if="formType != 'detail'"
type="primary" type="primary"
:disabled="btnDisable"
@click="handleComfirm"> </el-button> @click="handleComfirm"> </el-button>
</div> </div>
</div> </div>
@ -126,7 +127,7 @@ export default {
data () { data () {
return { return {
formType: 'add', // addeditdetail formType: 'add', // addeditdetail
btnDisable: false,
buildingId: '', //ID buildingId: '', //ID
buildType: "1", buildType: "1",
dataForm: { dataForm: {
@ -135,7 +136,7 @@ export default {
gridId: '', //ID gridId: '', //ID
neighborHoodId: '',//id neighborHoodId: '',//id
buildingName: '',// buildingName: '',//
sort: 0,// // sort: 0,//
totalUnitNum: 0,// totalUnitNum: 0,//
totalFloorNum: 0,// totalFloorNum: 0,//
totalHouseNum: 0,// totalHouseNum: 0,//
@ -176,9 +177,14 @@ export default {
}, },
async handleComfirm () { async handleComfirm () {
this.btnDisable = true
setTimeout(() => {
this.btnDisable = false
}, 10000)
this.dataForm.type = this.buildType this.dataForm.type = this.buildType
this.$refs['ref_form'].validate((valid, messageObj) => { this.$refs['ref_form'].validate((valid, messageObj) => {
if (!valid) { if (!valid) {
this.btnDisable = false
app.util.validateRule(messageObj) app.util.validateRule(messageObj)
} else { } else {
this.addBuild() this.addBuild()
@ -187,6 +193,7 @@ export default {
}) })
}, },
async addBuild () { async addBuild () {
let url = '' let url = ''
if (this.formType === 'add') { if (this.formType === 'add') {
url = '/gov/org/building/buildingadd' url = '/gov/org/building/buildingadd'
@ -196,7 +203,6 @@ export default {
this.dataForm.buildingId = this.buildingId this.dataForm.buildingId = this.buildingId
} }
const { data, code, msg } = await requestPost(url, this.dataForm) const { data, code, msg } = await requestPost(url, this.dataForm)
if (code === 0) { if (code === 0) {
@ -205,8 +211,11 @@ export default {
message: '操作成功' message: '操作成功'
}) })
this.resetData() this.resetData()
this.btnDisable = false
this.$emit('dialogOk') this.$emit('dialogOk')
} else { } else {
this.btnDisable = false
this.$message.error(msg) this.$message.error(msg)
} }
@ -305,7 +314,7 @@ export default {
gridId: '', //ID gridId: '', //ID
neighborHoodId: '',//id neighborHoodId: '',//id
buildingName: '',// buildingName: '',//
sort: 0,// // sort: 0,//
totalUnitNum: 0,// totalUnitNum: 0,//
totalFloorNum: 0,// totalFloorNum: 0,//
totalHouseNum: 0,// totalHouseNum: 0,//
@ -376,6 +385,9 @@ export default {
margin-left: 10px; margin-left: 10px;
width: 200px; width: 200px;
} }
.item_width_4 {
width: 200px;
}
.div_map { .div_map {
margin-top: 10px; margin-top: 10px;

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

@ -61,6 +61,7 @@
<div class="div_table"> <div class="div_table">
<el-table :data="tableData" <el-table :data="tableData"
border border
:height="tableHeight"
v-loading="tableLoading" v-loading="tableLoading"
style="width: 100%"> style="width: 100%">
<el-table-column prop="buildingName" <el-table-column prop="buildingName"
@ -87,12 +88,15 @@
<el-table-column label="操作" <el-table-column label="操作"
fixed="right" fixed="right"
width="140" width="170"
header-align="center" header-align="center"
align="center" align="center"
class="operate"> class="operate">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text"
style="color:#feb349;text-decoration: underline;"
size="small"
@click="handleToNextLevel(scope.row)">进入</el-button>
<el-button type="text" <el-button type="text"
style="color:#1C6AFD;text-decoration: underline;" style="color:#1C6AFD;text-decoration: underline;"
size="small" size="small"
@ -113,9 +117,9 @@
<el-pagination @size-change="handleSizeChange" <el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page.sync="pageNo" :current-page.sync="pageNo"
:page-sizes="[20, 30, 50]" :page-sizes="[10, 20, 50]"
:page-size="pageSize" :page-size="pageSize"
layout="sizes, prev, pager, next" layout="sizes, prev, pager, next, total"
:total="total"> :total="total">
</el-pagination> </el-pagination>
</div> </div>
@ -151,7 +155,7 @@ export default {
return { return {
loading: false, loading: false,
total: 0, total: 0,
pageSize: 20, pageSize: 10,
pageNo: 0, pageNo: 0,
tableLoading: true, tableLoading: true,
@ -173,9 +177,12 @@ export default {
console.log('building11111111111111111111111111') console.log('building11111111111111111111111111')
}, },
computed: { computed: {
rowHeight () { tableHeight () {
return (this.clientHeight - 200) + 'px'
return (this.clientHeight - 220)
}, },
...mapGetters(['clientHeight']) ...mapGetters(['clientHeight'])
}, },
methods: { methods: {
@ -238,6 +245,9 @@ export default {
this.$refs.ref_form.initForm('edit', row, this.agencyObj) this.$refs.ref_form.initForm('edit', row, this.agencyObj)
}) })
}, },
handleToNextLevel (row) {
this.$emit('toNextLevel', row, 'building')
},
addFormCancle () { addFormCancle () {
this.formShow = false this.formShow = false
@ -403,6 +413,10 @@ export default {
const { data, code, msg } = await requestPost(url, fileFormData) const { data, code, msg } = await requestPost(url, fileFormData)
if (code === 0) { if (code === 0) {
this.$message({
type: "success",
message: "导入成功"
});
this.$emit('refreshTree') this.$emit('refreshTree')
this.loadTable() this.loadTable()
} else { } else {
@ -450,26 +464,7 @@ export default {
} }
</script> </script>
<style lang="scss" scoped > <style lang="scss" scoped >
.el-button--green { @import "@/assets/scss/buttonstyle.scss";
color: #fff;
background-color: #22c1c3;
border-color: #22c1c3;
}
.el-button--yellow {
color: #fff;
background-color: #feb349;
border-color: #feb349;
}
.el-button--blue {
color: #fff;
background-color: #2195fe;
border-color: #2195fe;
}
.el-button--red {
color: #fff;
background-color: #fe6252;
border-color: #fe6252;
}
.div_search { .div_search {
display: flex; display: flex;

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

@ -1,54 +1,45 @@
<template> <template>
<div> <div class="div_main">
<el-row class="row" <div :style="{height:rowHeight}"
:gutter="10"> class="div_tree">
<el-col :span="5"> <el-input placeholder="输入关键字进行过滤"
<el-card> v-model="filterText">
</el-input>
<div :style="{height:rowHeight}" <el-scrollbar :style="{height:treeHeight}"
class="div_tree"> class="scrollar">
<el-input placeholder="输入关键字进行过滤" <el-tree ref="ref_tree"
v-model="filterText"> v-loading="treeLoading"
</el-input> class="filter_tree"
:data="treeData"
<el-tree ref="ref_tree" :props="defaultProps"
v-loading="treeLoading" :highlight-current="true"
class="filter-tree" node-key="id"
:data="treeData" :expand-on-click-node="false"
:props="defaultProps" default-expand-all
:highlight-current="true" :filter-node-method="filterNode"
node-key="id" @node-click="handleNodeClick">
:expand-on-click-node="false" </el-tree>
default-expand-all </el-scrollbar>
:filter-node-method="filterNode"
@node-click="handleNodeClick"> </div>
</el-tree>
<div :style="{height:rowHeight}"
</div> class="div_table">
</el-card> <build-table v-if="selTreeObj.level==='neighbourHood'"
</el-col> ref="ref_neighTable"
@toNextLevel="toNextLevel"
<el-col :span="19"> @refreshTree="refreshTree"></build-table>
<el-card> <room-table v-else-if="selTreeObj.level==='building'"
<div :style="{height:rowHeight}"> ref="ref_buildingTable"
@refreshTree="refreshTree"></room-table>
<build-table v-if="selTreeObj.level==='neighbourHood'" <community-table v-else
ref="ref_neighTable" @toNextLevel="toNextLevel"
@refreshTree="refreshTree"></build-table> ref="ref_communityTable"
<room-table v-else-if="selTreeObj.level==='building'" @refreshTree="refreshTree"></community-table>
ref="ref_buildingTable"
@refreshTree="refreshTree"></room-table> </div>
<community-table v-else
ref="ref_communityTable"
@refreshTree="refreshTree"></community-table>
</div>
</el-card>
</el-col>
</el-row>
</div> </div>
</template> </template>
@ -99,7 +90,10 @@ export default {
}, },
computed: { computed: {
rowHeight () { rowHeight () {
return (this.clientHeight - 180) + 'px' return (this.clientHeight - 140) + 'px'
},
treeHeight () {
return (this.clientHeight - 200) + 'px'
}, },
...mapGetters(['clientHeight']) ...mapGetters(['clientHeight'])
}, },
@ -151,7 +145,6 @@ export default {
}, },
handleNodeClick (obj) { handleNodeClick (obj) {
this.getTreeObj(obj) this.getTreeObj(obj)
this.$nextTick(() => { this.$nextTick(() => {
@ -179,6 +172,23 @@ export default {
this.treeLoading = false this.treeLoading = false
}, },
//
toNextLevel (row, level) {
if (level === 'community') {
this.selTreeObj = this.$refs.ref_tree.getNode(row.neighborHoodId).data
} else {
this.selTreeObj = this.$refs.ref_tree.getNode(row.buildingId).data
}
this.handleNodeClick(this.selTreeObj)
this.$nextTick(() => {
// ref_tree ref value node-key
this.$refs.ref_tree.setCurrentKey(this.selTreeObj.id);
});
},
// //
getTreeObj (obj) { getTreeObj (obj) {
// //
@ -246,8 +256,30 @@ export default {
} }
</script> </script>
<style lang="scss" scoped > <style lang="scss" scoped >
.div_main {
display: flex;
}
.scrollar {
margin-top: 10px;
}
.div_tree { .div_tree {
overflow-y: auto; flex: 0 0 400px;
background-color: #ffffff;
border-radius: 5px;
padding: 10px;
overflow-y: hidden;
}
.filter_tree {
overflow-x: auto;
}
.div_table {
margin-left: 15px;
width: calc(100vw - 680px);
background-color: #ffffff;
border-radius: 5px;
padding: 10px;
} }
.div_btn { .div_btn {
@ -263,4 +295,11 @@ export default {
.aui-content > .el-tabs > .el-tabs__content { .aui-content > .el-tabs > .el-tabs__content {
padding: 0px; padding: 0px;
} }
.el-scrollbar__wrap {
overflow-x: hidden !important;
}
.el-tree-node:focus > .el-tree-node__content {
/* background-color: #ccc !important; */
color: #2195fe;
}
</style> </style>

18
src/views/modules/base/community/communityForm.vue

@ -48,6 +48,7 @@
<el-select class="item_width_2" <el-select class="item_width_2"
v-model="dataForm.propertyId" v-model="dataForm.propertyId"
placeholder="请选择" placeholder="请选择"
filterable
clearable> clearable>
<el-option v-for="item in propertyList" <el-option v-for="item in propertyList"
:key="item.propertyId" :key="item.propertyId"
@ -88,7 +89,7 @@
prop="longitude" prop="longitude"
label-width="150px" label-width="150px"
style="display: block"> style="display: block">
<el-input class="item_width_3" <el-input class="item_width_4"
maxlength="50" maxlength="50"
placeholder="请输入关键字" placeholder="请输入关键字"
v-model="keyWords"> v-model="keyWords">
@ -139,6 +140,7 @@
<el-button @click="handleCancle"> </el-button> <el-button @click="handleCancle"> </el-button>
<el-button v-if="formType != 'detail'" <el-button v-if="formType != 'detail'"
type="primary" type="primary"
:disabled="btnDisable"
@click="handleComfirm"> </el-button> @click="handleComfirm"> </el-button>
</div> </div>
</div> </div>
@ -160,6 +162,7 @@ export default {
gridList: [], gridList: [],
propertyList: [], propertyList: [],
btnDisable: false,
neighborHoodId: '', //ID neighborHoodId: '', //ID
dataForm: { dataForm: {
@ -339,14 +342,20 @@ export default {
}, },
async handleComfirm () { async handleComfirm () {
if (this.propertyFormShow) { if (this.propertyFormShow) {
this.addProperty() this.addProperty()
} else { } else {
this.btnDisable = true
setTimeout(() => {
this.btnDisable = false
}, 10000)
this.$refs['ref_form'].validate((valid, messageObj) => { this.$refs['ref_form'].validate((valid, messageObj) => {
if (!valid) { if (!valid) {
app.util.validateRule(messageObj) app.util.validateRule(messageObj)
this.btnDisable = false
} else { } else {
this.addCommunity() this.addCommunity()
} }
@ -376,7 +385,9 @@ export default {
}) })
this.resetData() this.resetData()
this.$emit('dialogOk') this.$emit('dialogOk')
this.btnDisable = false
} else { } else {
this.btnDisable = false
this.$message.error(msg) this.$message.error(msg)
} }
@ -400,7 +411,7 @@ export default {
if (code === 0) { if (code === 0) {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '添加物业成功' message: '操作成功'
}) })
this.dataForm.propertyId = data.propertyId this.dataForm.propertyId = data.propertyId
this.propertyForm.name = '' this.propertyForm.name = ''
@ -498,6 +509,9 @@ export default {
margin-left: 10px; margin-left: 10px;
width: 200px; width: 200px;
} }
.item_width_4 {
width: 200px;
}
.div_map { .div_map {
margin-top: 10px; margin-top: 10px;

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

@ -63,6 +63,7 @@
<div class="div_table"> <div class="div_table">
<el-table :data="tableData" <el-table :data="tableData"
border border
:height="tableHeight"
v-loading="tableLoading" v-loading="tableLoading"
style="width: 100%"> style="width: 100%">
<el-table-column prop="neighborHoodName" <el-table-column prop="neighborHoodName"
@ -85,16 +86,16 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" <el-table-column label="操作"
fixed="right" fixed="right"
width="140" width="170"
header-align="center" header-align="center"
align="center" align="center"
class="operate"> class="operate">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button type="text" <el-button type="text"
style="color:#00A7A9;text-decoration: underline;" style="color:#feb349;text-decoration: underline;"
size="small" size="small"
@click="handleToBuild(scope.row)">进入</el-button> --> @click="handleToNextLevel(scope.row)">进入</el-button>
<el-button type="text" <el-button type="text"
style="color:#1C6AFD;text-decoration: underline;" style="color:#1C6AFD;text-decoration: underline;"
size="small" size="small"
@ -115,9 +116,9 @@
<el-pagination @size-change="handleSizeChange" <el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page.sync="pageNo" :current-page.sync="pageNo"
:page-sizes="[20, 30, 50]" :page-sizes="[10, 20, 50]"
:page-size="pageSize" :page-size="pageSize"
layout="sizes, prev, pager, next" layout="sizes, prev, pager, next, total"
:total="total"> :total="total">
</el-pagination> </el-pagination>
</div> </div>
@ -153,7 +154,7 @@ export default {
return { return {
loading: false, loading: false,
total: 0, total: 0,
pageSize: 20, pageSize: 10,
pageNo: 0, pageNo: 0,
tableLoading: true, tableLoading: true,
@ -179,6 +180,11 @@ export default {
}, },
computed: { computed: {
tableHeight () {
return (this.clientHeight - 320)
},
rowHeight () { rowHeight () {
return (this.clientHeight - 200) + 'px' return (this.clientHeight - 200) + 'px'
}, },
@ -246,6 +252,10 @@ export default {
}) })
}, },
handleToNextLevel (row) {
this.$emit('toNextLevel', row, 'community')
},
addFormCancle () { addFormCancle () {
this.formShow = false this.formShow = false
}, },
@ -405,13 +415,13 @@ export default {
var url = '/gov/org/neighborhood/import' var url = '/gov/org/neighborhood/import'
let fileFormData = new FormData(); let fileFormData = new FormData();
fileFormData.append('file', this.files);//filenamefiletest.zip fileFormData.append('file', this.files);//filenamefiletest.zip
// let params = {
// file: this.files
// }
const { data, code, msg } = await requestPost(url, fileFormData) const { data, code, msg } = await requestPost(url, fileFormData)
if (code === 0) { if (code === 0) {
this.$message({
type: "success",
message: "导入成功"
});
this.$emit('refreshTree') this.$emit('refreshTree')
this.loadTable() this.loadTable()
} else { } else {
@ -458,26 +468,7 @@ export default {
} }
</script> </script>
<style lang="scss" scoped > <style lang="scss" scoped >
.el-button--green { @import "@/assets/scss/buttonstyle.scss";
color: #fff;
background-color: #22c1c3;
border-color: #22c1c3;
}
.el-button--yellow {
color: #fff;
background-color: #feb349;
border-color: #feb349;
}
.el-button--blue {
color: #fff;
background-color: #2195fe;
border-color: #2195fe;
}
.el-button--red {
color: #fff;
background-color: #fe6252;
border-color: #fe6252;
}
.div_search { .div_search {
display: flex; display: flex;

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

@ -115,6 +115,7 @@
<el-button @click="handleCancle"> </el-button> <el-button @click="handleCancle"> </el-button>
<el-button v-if="formType != 'detail'" <el-button v-if="formType != 'detail'"
type="primary" type="primary"
:disabled="btnDisable"
@click="handleComfirm"> </el-button> @click="handleComfirm"> </el-button>
</div> </div>
</div> </div>
@ -130,7 +131,7 @@ export default {
data () { data () {
return { return {
formType: 'add', // addeditdetail formType: 'add', // addeditdetail
btnDisable: false,
unitList: [], unitList: [],
houseId: '', //ID houseId: '', //ID
@ -206,11 +207,17 @@ export default {
}, },
async handleComfirm () { async handleComfirm () {
this.btnDisable = true
setTimeout(() => {
this.btnDisable = false
}, 10000)
this.dataForm.houseType = this.houseType this.dataForm.houseType = this.houseType
this.dataForm.purpose = this.purpose this.dataForm.purpose = this.purpose
this.dataForm.rentFlag = this.rentFlag this.dataForm.rentFlag = this.rentFlag
this.$refs['ref_form'].validate((valid, messageObj) => { this.$refs['ref_form'].validate((valid, messageObj) => {
if (!valid) { if (!valid) {
this.btnDisable = false
app.util.validateRule(messageObj) app.util.validateRule(messageObj)
} else { } else {
this.addRoom() this.addRoom()
@ -220,6 +227,25 @@ export default {
}, },
async addRoom () { async addRoom () {
const regCard = /(^\d{15}$)|(^\d{17}(\d|X)$)/; //1518151817X
if (regCard.test(this.dataForm.ownerIdCard) === false) {
this.btnDisable = false
this.$message({
type: 'warning',
message: '请输入正确的身份证号码'
})
return false;
}
const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; //
if (regPhone.test(this.dataForm.ownerPhone) === false) {
this.btnDisable = false
this.$message({
type: 'warning',
message: '请输入正确的手机号码'
})
return false;
}
let url = '' let url = ''
if (this.formType === 'add') { if (this.formType === 'add') {
@ -229,10 +255,8 @@ export default {
this.dataForm.houseId = this.houseId this.dataForm.houseId = this.houseId
} }
const { data, code, msg } = await requestPost(url, this.dataForm) const { data, code, msg } = await requestPost(url, this.dataForm)
this.btnDisable = false
if (code === 0) { if (code === 0) {
this.$message({ this.$message({
type: 'success', type: 'success',
@ -240,7 +264,9 @@ export default {
}) })
this.resetData() this.resetData()
this.$emit('dialogOk') this.$emit('dialogOk')
} else { } else {
this.$message.error(msg) this.$message.error(msg)
} }

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

@ -81,10 +81,10 @@
label="门牌号"> label="门牌号">
</el-table-column> </el-table-column>
<el-table-column prop="houseType" <el-table-column prop="houseType"
label="房屋类型"> label="类型">
</el-table-column> </el-table-column>
<el-table-column prop="purpose" <el-table-column prop="purpose"
label="房屋用途"> label="用途">
</el-table-column> </el-table-column>
<el-table-column prop="rentFlag" <el-table-column prop="rentFlag"
label="是否出租"> label="是否出租">
@ -93,10 +93,12 @@
label="房主姓名"> label="房主姓名">
</el-table-column> </el-table-column>
<el-table-column prop="ownerPhone" <el-table-column prop="ownerPhone"
label="房主电话"> label="房主电话"
width="110">
</el-table-column> </el-table-column>
<el-table-column prop="ownerIdCard" <el-table-column prop="ownerIdCard"
label="身份证"> label="身份证"
width="160">
</el-table-column> </el-table-column>
<el-table-column label="操作" <el-table-column label="操作"
fixed="right" fixed="right"
@ -126,9 +128,9 @@
<el-pagination @size-change="handleSizeChange" <el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page.sync="pageNo" :current-page.sync="pageNo"
:page-sizes="[20, 30, 50]" :page-sizes="[10, 20, 50]"
:page-size="pageSize" :page-size="pageSize"
layout="sizes, prev, pager, next" layout="sizes, prev, pager, next, total"
:total="total"> :total="total">
</el-pagination> </el-pagination>
</div> </div>
@ -163,7 +165,7 @@ export default {
return { return {
loading: false, loading: false,
total: 0, total: 0,
pageSize: 20, pageSize: 10,
pageNo: 0, pageNo: 0,
tableLoading: true, tableLoading: true,
@ -415,7 +417,10 @@ export default {
const { data, code, msg } = await requestPost(url, fileFormData) const { data, code, msg } = await requestPost(url, fileFormData)
if (code === 0) { if (code === 0) {
this.$message({
type: "success",
message: "导入成功"
});
this.$emit('refreshTree') this.$emit('refreshTree')
this.loadTable() this.loadTable()
} else { } else {
@ -462,26 +467,7 @@ export default {
} }
</script> </script>
<style lang="scss" scoped > <style lang="scss" scoped >
.el-button--green { @import "@/assets/scss/buttonstyle.scss";
color: #fff;
background-color: #22c1c3;
border-color: #22c1c3;
}
.el-button--yellow {
color: #fff;
background-color: #feb349;
border-color: #feb349;
}
.el-button--blue {
color: #fff;
background-color: #2195fe;
border-color: #2195fe;
}
.el-button--red {
color: #fff;
background-color: #fe6252;
border-color: #fe6252;
}
.div_search { .div_search {
display: flex; display: flex;

Loading…
Cancel
Save