Browse Source

居民信息冗余代码,房屋信息更多按钮展示内容

feature
mk 2 years ago
parent
commit
a0618f5210
  1. 363
      src/views/modules/base/community/buildTable.vue
  2. 373
      src/views/modules/base/community/roomTable.vue
  3. 257
      src/views/modules/base/resi.vue

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

@ -3,135 +3,75 @@
<div class="u-table-btn2">
<div class="u-table-btn2-left">
<el-button style=""
class="diy-button--blue"
icon="el-icon-plus"
size="small"
:disabled="addDisabled"
@click="handleAdd">新增楼栋</el-button>
<el-button style="" class="diy-button--blue" icon="el-icon-plus" size="small" :disabled="addDisabled"
@click="handleAdd">新增楼栋</el-button>
<div class="u-btn-upload"
v-if="showImportBtn">
<div class="u-btn-upload" v-if="showImportBtn">
<el-popover popper-class="btn-popper"
placement="bottom"
width="20"
trigger="hover">
<el-popover popper-class="btn-popper" placement="bottom" width="20" trigger="hover">
<div class="table-more-btn">
<el-upload :headers="$getElUploadHeaders()"
style="text-align: center"
ref="upload_building"
:multiple='false'
:show-file-list='false'
:before-upload="((file)=>{beforeUpload(file, 'building')})"
action=""
accept=".xls,.xlsx"
:http-request="(()=>{uploadFile( 'building')})">
<el-button style=""
size="small"
type="text"
class="diy-button--other">导入楼栋数据</el-button>
<el-upload :headers="$getElUploadHeaders()" style="text-align: center" ref="upload_building"
:multiple='false' :show-file-list='false' :before-upload="((file) => { beforeUpload(file, 'building') })"
action="" accept=".xls,.xlsx" :http-request="(() => { uploadFile('building') })">
<el-button style="" size="small" type="text" class="diy-button--other">导入楼栋数据</el-button>
</el-upload>
</div>
<div class="table-more-btn">
<el-upload :headers="$getElUploadHeaders()"
style="text-align: center"
ref="upload_room"
:multiple='false'
:show-file-list='false'
:before-upload="((file)=>{beforeUpload(file, 'room')})"
action=""
accept=".xls,.xlsx"
:http-request="(()=>{uploadFile( 'room')})">
<el-button size="small"
type="text"
class="diy-button--other">导入房屋数据</el-button>
<el-upload :headers="$getElUploadHeaders()" style="text-align: center" ref="upload_room" :multiple='false'
:show-file-list='false' :before-upload="((file) => { beforeUpload(file, 'room') })" action=""
accept=".xls,.xlsx" :http-request="(() => { uploadFile('room') })">
<el-button size="small" type="text" class="diy-button--other">导入房屋数据</el-button>
</el-upload>
</div>
<el-button size="small"
style="float:right"
class="diy-button--white"
slot="reference">导入<i class="el-icon-arrow-down el-icon--right"></i></el-button>
<el-button size="small" style="float:right" class="diy-button--white" slot="reference">导入<i
class="el-icon-arrow-down el-icon--right"></i></el-button>
</el-popover>
</div>
<el-button style="margin-left:10px"
class="diy-button--white"
size="small"
@click="handleExport">导出</el-button>
<el-button style="margin-left:10px"
class="diy-button--white"
size="small"
@click="deleteBatch">批量删除</el-button>
<el-button style="margin-left:10px" class="diy-button--white" size="small" @click="handleExport">导出</el-button>
<el-button style="margin-left:10px" class="diy-button--white" size="small" @click="deleteBatch">批量删除</el-button>
</div>
<div>
<el-popover popper-class="btn-popper"
placement="bottom"
style="margin-left: 10px"
width="20"
trigger="hover">
<div v-if="showImportBtn"
class="table-more-btn">
<el-button :headers="$getElUploadHeaders()"
style=""
class="diy-button--other"
size="small"
type="text"
@click="handleExportModule('building')">下载楼栋模板</el-button>
<el-popover popper-class="btn-popper" placement="bottom" style="margin-left: 10px" width="20" trigger="hover">
<div class="table-more-btn">
<el-button :headers="$getElUploadHeaders()" style="" class="diy-button--other" size="small" type="text"
@click="handleExportModule('community')">下载小区模板</el-button>
</div>
<!-- v-if="showImportBtn" -->
<div class="table-more-btn">
<el-button :headers="$getElUploadHeaders()" style="" class="diy-button--other" size="small" type="text"
@click="handleExportModule('building')">下载楼栋模板</el-button>
</div>
<div v-if="showImportBtn"
class="table-more-btn">
<el-button :headers="$getElUploadHeaders()"
style=""
class="diy-button--other"
size="small"
type="text"
@click="handleExportModule('room')">下载房屋模板</el-button>
<!-- v-if="showImportBtn" -->
<div class="table-more-btn">
<el-button :headers="$getElUploadHeaders()" style="" class="diy-button--other" size="small" type="text"
@click="handleExportModule('room')">下载房屋模板</el-button>
</div>
<div class="table-more-btn">
<el-button style=""
class="diy-button--other"
size="small"
type="text"
:disabled="yihuyidangDisabled"
@click="handleExportYihuyidang()">导出一户一档</el-button>
<el-button style="" class="diy-button--other" size="small" type="text" :disabled="yihuyidangDisabled"
@click="handleExportYihuyidang()">导出一户一档</el-button>
</div>
<div v-if="displayedBaobiaoBtn"
class="table-more-btn">
<el-button size="small"
type="text"
class="diy-button--other"
@click="reportForm">智能填报</el-button>
<div v-if="displayedBaobiaoBtn" class="table-more-btn">
<el-button size="small" type="text" class="diy-button--other" @click="reportForm">智能填报</el-button>
</div>
<el-button size="small"
style="float:right"
class="diy-button--white"
slot="reference">更多<i class="el-icon-arrow-down el-icon--right"></i></el-button>
<el-button size="small" style="float:right" class="diy-button--white" slot="reference">更多<i
class="el-icon-arrow-down el-icon--right"></i></el-button>
</el-popover>
</div>
</div>
<div class="m-table-item">
<el-table ref="ref_table"
:data="tableData"
border
@sort-change="handleSortOrderChange"
:show-overflow-tooltip="true"
:height="tableHeight"
v-loading="tableLoading"
style="width: 100%"
@select-all="selectAll"
@selection-change="selectionChange">
<el-table-column type="selection"
:selectable="checkSelect"
width="55">
<el-table ref="ref_table" :data="tableData" border @sort-change="handleSortOrderChange"
:show-overflow-tooltip="true" :height="tableHeight" v-loading="tableLoading" style="width: 100%"
@select-all="selectAll" @selection-change="selectionChange">
<el-table-column type="selection" :selectable="checkSelect" width="55">
</el-table-column>
<!-- <el-table-column fixed="left"
width="70"
@ -142,150 +82,70 @@
:index="indexMethod">
</el-table-column> -->
<el-table-column prop="buildingName"
fixed="left"
label="楼栋名称"
header-align="left"
align="left"
min-width="180">
<el-table-column prop="buildingName" fixed="left" label="楼栋名称" header-align="left" align="left" min-width="180">
<template slot-scope="scope">
<a class="name-a"
@click="handleToNextLevel(scope.row)">
<a class="name-a" @click="handleToNextLevel(scope.row)">
{{ scope.row.buildingName }}
</a>
</template>
</el-table-column>
<el-table-column prop="neighborHoodName"
label="所属小区"
header-align="left"
align="left"
min-width="160">
<el-table-column prop="neighborHoodName" label="所属小区" header-align="left" align="left" min-width="160">
</el-table-column>
<el-table-column prop="buildingType"
label="楼栋类型"
header-align="left"
align="left"
width="90">
<el-table-column prop="buildingType" label="楼栋类型" header-align="left" align="left" width="90">
</el-table-column>
<el-table-column prop="buildingLeaderName"
label="楼长姓名"
header-align="left"
align="left"
min-width="90">
<el-table-column prop="buildingLeaderName" label="楼长姓名" header-align="left" align="left" min-width="90">
</el-table-column>
<el-table-column prop="buildingLeaderMobile"
label="楼长电话"
header-align="left"
align="left"
min-width="110">
<el-table-column prop="buildingLeaderMobile" label="楼长电话" header-align="left" align="left" min-width="110">
</el-table-column>
<el-table-column prop="totalUnitNum"
header-align="left"
align="left"
label="单元数">
<el-table-column prop="totalUnitNum" header-align="left" align="left" label="单元数">
</el-table-column>
<el-table-column prop="totalFloorNum"
header-align="left"
align="left"
label="层数">
<el-table-column prop="totalFloorNum" header-align="left" align="left" label="层数">
</el-table-column>
<el-table-column prop="realTotalHouseNum"
header-align="left"
align="left"
width="90"
label="实际录入">
<el-table-column prop="realTotalHouseNum" header-align="left" align="left" width="90" label="实际录入">
</el-table-column>
<el-table-column prop="totalHouseNum"
header-align="left"
align="left"
label="总户数">
<el-table-column prop="totalHouseNum" header-align="left" align="left" label="总户数">
</el-table-column>
<el-table-column prop="sort"
sortable="custom"
header-align="left"
align="left"
min-width="100"
label="排序">
<el-table-column prop="sort" sortable="custom" header-align="left" align="left" min-width="100" label="排序">
<template slot-scope="scope">
<div @click="handleEditSort(scope.row)">
<span v-if="!scope.row.isChange">{{scope.row.sort}}</span>
<el-input-number v-else
@change="handleChangeSort(scope.row)"
v-model="scope.row.sort"
class="item_width_4"
size="small"
:min="0"
:max="9999"
label="描述文字"></el-input-number>
<span v-if="!scope.row.isChange">{{ scope.row.sort }}</span>
<el-input-number v-else @change="handleChangeSort(scope.row)" v-model="scope.row.sort" class="item_width_4"
size="small" :min="0" :max="9999" label="描述文字"></el-input-number>
</div>
</template>
</el-table-column>
<el-table-column label="操作"
fixed="right"
width="220"
header-align="center"
align="center"
class="operate">
<el-table-column label="操作" fixed="right" width="220" header-align="center" align="center" class="operate">
<template slot-scope="scope">
<el-button type="text"
class="div-table-button--blue"
size="small"
@click="handleDetail(scope.row)">查看</el-button>
<el-button v-if="scope.row.showBtn"
type="text"
class="div-table-button--blue"
size="small"
@click="handleEdit(scope.row)">编辑</el-button>
<el-button v-if="scope.row.showBtn"
type="text"
class="div-table-button--blue"
size="small"
@click="handleDelete(scope.row)">删除</el-button>
<el-button type="text" class="div-table-button--blue" size="small"
@click="handleDetail(scope.row)">查看</el-button>
<el-button v-if="scope.row.showBtn" type="text" class="div-table-button--blue" size="small"
@click="handleEdit(scope.row)">编辑</el-button>
<el-button v-if="scope.row.showBtn" type="text" class="div-table-button--blue" 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="pageNo"
:page-sizes="[20, 50, 100, 200]"
:page-size="pageSize"
layout="sizes, prev, pager, next, total"
:total="total">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="pageNo"
:page-sizes="[20, 50, 100, 200]" :page-size="pageSize" layout="sizes, prev, pager, next, total" :total="total">
</el-pagination>
</div>
</div>
<!-- 修改弹出框 -->
<el-dialog :visible.sync="formShow"
v-if="formShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="formTitle"
top="5vh"
width="670px"
class="dialog-h"
@closed="diaClose">
<build-form ref="ref_form"
@dialogCancle="addFormCancle"
@dialogOk="addFormOk"></build-form>
<el-dialog :visible.sync="formShow" v-if="formShow" :close-on-click-modal="false" :close-on-press-escape="false"
:title="formTitle" top="5vh" width="670px" class="dialog-h" @closed="diaClose">
<build-form ref="ref_form" @dialogCancle="addFormCancle" @dialogOk="addFormOk"></build-form>
</el-dialog>
<!-- 详情弹出框 -->
<el-dialog :visible.sync="detailShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="'楼栋详情'"
top="5vh"
width="670px"
class="dialog-h"
@closed="detailFormCancle">
<build-detail ref="ref_form_detail"
@diaDetailClose="detailFormCancle"></build-detail>
<el-dialog :visible.sync="detailShow" :close-on-click-modal="false" :close-on-press-escape="false" :title="'楼栋详情'"
top="5vh" width="670px" class="dialog-h" @closed="detailFormCancle">
<build-detail ref="ref_form_detail" @diaDetailClose="detailFormCancle"></build-detail>
</el-dialog>
<baobiao ref="baobiao" />
@ -304,7 +164,7 @@ import baobiao from "@/views/modules/cpts/baobiao";
let loading //
export default {
data () {
data() {
return {
searchHeight: 190,//
importBuildingLoading: false,
@ -338,7 +198,7 @@ export default {
BuildForm,
BuildDetail
},
async mounted () {
async mounted() {
// this.displayedBaobiaoBtn = await this.$refs.baobiao.existsTemplate({
// elseParams: {
// categoryKeys: ['house_info'], categoryKey: 'house_info',
@ -346,7 +206,7 @@ export default {
// });
},
computed: {
tableHeight () {
tableHeight() {
let height = this.searchHeight + 270
return this.$store.state.inIframe ? this.clientHeight - height + this.iframeHeight : this.clientHeight - height
@ -356,7 +216,7 @@ export default {
...mapGetters(['clientHeight', 'iframeHeight'])
},
methods: {
reportForm () {
reportForm() {
let paramMap = {
pageSize: this.pageSize,
pageNo: this.pageNo,
@ -378,10 +238,10 @@ export default {
})
},
indexMethod (index) {
indexMethod(index) {
return index + 1;
},
handleSortOrderChange (value) {
handleSortOrderChange(value) {
this.sortType = value.order === 'ascending' ? 'asc' : 'desc'
this.loadTable()
@ -391,7 +251,7 @@ export default {
// },
handleEditSort (row) {
handleEditSort(row) {
if (!row.isChange) {
row.isChange = true
}
@ -399,7 +259,7 @@ export default {
},
async handleChangeSort (row, index) {
async handleChangeSort(row, index) {
// row.isChange = false
let params = {
@ -427,7 +287,7 @@ export default {
},
checkSelect (row, index) {
checkSelect(row, index) {
let isChecked = false;
if (row.showBtn) { //
isChecked = true
@ -437,7 +297,7 @@ export default {
return isChecked
},
async loadTable (fromTree, treeObj) {
async loadTable(fromTree, treeObj) {
this.addDisabled = true
this.tableLoading = true
if (fromTree) {
@ -485,12 +345,12 @@ export default {
this.tableLoading = false
},
diaClose () {
diaClose() {
this.$refs.ref_form.resetData()
this.formShow = false
},
async handleDetail (row) {
async handleDetail(row) {
// this.formTitle = ''
// this.formShow = true
// const _data = await this.detail(row)
@ -506,12 +366,12 @@ export default {
})
},
detailFormCancle () {
detailFormCancle() {
this.$refs.ref_form_detail.diaDestroy()
this.detailShow = false
},
handleAdd () {
handleAdd() {
this.formTitle = '新增楼栋'
this.formShow = true
this.$nextTick(() => {
@ -520,7 +380,7 @@ export default {
})
},
async handleEdit (row) {
async handleEdit(row) {
this.formTitle = '修改楼栋'
this.formShow = true
const _data = await this.detail(row)
@ -529,21 +389,21 @@ export default {
})
},
handleToNextLevel (row) {
handleToNextLevel(row) {
this.$emit('toNextLevel', row, 'building')
},
addFormCancle () {
addFormCancle() {
this.formShow = false
},
addFormOk () {
addFormOk() {
this.formShow = false
this.loadTable()
this.$emit('refreshTree')
},
deleteBatch () {
deleteBatch() {
if (this.selection.length > 0) {
this.$confirm("确认删除选择的楼栋?", "提示", {
confirmButtonText: "确定",
@ -566,15 +426,15 @@ export default {
this.$message.warning('请先选择要删除的楼栋')
}
},
selectAll (selection) {
selectAll(selection) {
this.selection = selection
},
selectionChange (selection) {
selectionChange(selection) {
this.selection = selection
},
async handleDelete (row) {
async handleDelete(row) {
this.$confirm("确认删除?", "提示", {
confirmButtonText: "确定",
@ -597,7 +457,7 @@ export default {
},
async deleteCommunityBatch () {
async deleteCommunityBatch() {
let ids = []
this.selection.forEach(element => {
@ -633,7 +493,7 @@ export default {
}
},
async deleteBuild (row) {
async deleteBuild(row) {
const url = "/actual/base/communityBuilding/deleteBuilding"
let params = {
@ -653,7 +513,7 @@ export default {
// this.$message.error(msg)
}
},
async detail (row) {
async detail(row) {
const url = "/actual/base/communityBuilding/getBuildingDetail/" + row.buildingId
@ -667,7 +527,7 @@ export default {
},
//
async handleExport () {
async handleExport() {
let title = this.agencyObj.label
title = title + '—楼栋列表'
@ -692,7 +552,7 @@ export default {
},
//
download (data, fileName) {
download(data, fileName) {
if (!data) {
return
}
@ -717,11 +577,14 @@ export default {
},
handleExportModule (type) {
handleExportModule(type) {
let title = ''
let url = ""
if (type === 'building') {
if (type === "community") {
title = "小区导入模板";
url = "/gov/org/neighborhood/exporttemplate";
} else if (type === 'building') {
title = '楼栋导入模板'
url = '/gov/org/building/exporttemplate'
@ -747,7 +610,7 @@ export default {
},
//
handleExportYihuyidang () {
handleExportYihuyidang() {
this.yihuyidangDisabled = true
let title = this.agencyObj.label
title = title + '-一户一档'
@ -786,7 +649,7 @@ export default {
//
beforeUpload (file, type) {
beforeUpload(file, type) {
this.files = file;
const isText = file.type === 'application/vnd.ms-excel'
@ -804,11 +667,11 @@ export default {
},
//
handleExceed (files, fileList) {
handleExceed(files, fileList) {
this.$message.warning(`当前限制选择 1 个文件,请删除后继续上传`)
},
async uploadFile (type) {
async uploadFile(type) {
if (this.fileName == "") {
this.$message.warning('请选择要上传的文件!')
return false
@ -884,7 +747,7 @@ export default {
},
showMessage (msg) {
showMessage(msg) {
this.$alert(msg, '操作结果', {
confirmButtonText: '关闭',
callback: action => {
@ -894,18 +757,18 @@ export default {
});
},
handleSizeChange (val) {
handleSizeChange(val) {
this.pageSize = val
this.pageNo = 1
this.loadTable()
},
handleCurrentChange (val) {
handleCurrentChange(val) {
this.pageNo = val
this.loadTable()
},
//
startLoading () {
startLoading() {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
@ -913,7 +776,7 @@ export default {
})
},
//
endLoading () {
endLoading() {
// clearTimeout(timer);
if (loading) {
loading.close()
@ -923,7 +786,7 @@ export default {
watch: {
'$store.state.sidebarFold': {
handler (newVal, oldVal) {
handler(newVal, oldVal) {
if (newVal) {//
this.searchHeight = 155
@ -989,10 +852,12 @@ export default {
/deep/.el-input-number--medium .el-input-number__increase {
width: 26px;
}
/deep/.el-input-number--medium .el-input__inner {
padding-left: 0px;
padding-right: 0px;
}
::v-deep .el-dialog__body {
padding: 0;
}

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

@ -3,116 +3,74 @@
<div class="u-table-btn2">
<div class="u-table-btn2-left">
<!-- v-show="btnAuths.ic_house_add" -->
<el-button v-if="agencyObj.level === 'building' || source !== 'search'"
class="diy-button--blue"
icon="el-icon-plus"
size="small"
:disabled="addDisabled"
@click="handleAdd">新增房屋</el-button>
<el-button v-if="agencyObj.level === 'building' || source !== 'search'" class="diy-button--blue"
icon="el-icon-plus" size="small" :disabled="addDisabled" @click="handleAdd">新增房屋</el-button>
<div class="u-btn-upload"
v-if="showImportBtn">
<div class="u-btn-upload" v-if="showImportBtn">
<el-popover popper-class="btn-popper"
placement="bottom"
width="20"
trigger="hover">
<el-popover popper-class="btn-popper" placement="bottom" width="20" trigger="hover">
<div class="table-more-btn">
<!-- v-if="btnAuths.ic_house_import" -->
<el-upload ref="upload"
:multiple="false"
style="text-align: center"
:show-file-list="false"
:before-upload="beforeUpload"
action=""
accept=".xls,.xlsx"
:limit="1"
:on-exceed="handleExceed"
:http-request="uploadFile">
<el-button style=""
size="small"
type="text"
class="diy-button--other">导入房屋数据</el-button>
<el-upload ref="upload" :multiple="false" style="text-align: center" :show-file-list="false"
:before-upload="beforeUpload" action="" accept=".xls,.xlsx" :limit="1" :on-exceed="handleExceed"
:http-request="uploadFile">
<el-button style="" size="small" type="text" class="diy-button--other">导入房屋数据</el-button>
</el-upload>
</div>
<el-button size="small"
style="float:right"
class="diy-button--white"
slot="reference">导入<i class="el-icon-arrow-down el-icon--right"></i></el-button>
<el-button size="small" style="float:right" class="diy-button--white" slot="reference">导入<i
class="el-icon-arrow-down el-icon--right"></i></el-button>
</el-popover>
</div>
<!-- v-if="btnAuths.ic_house_export" -->
<el-button style="float: left; margin-left: 10px"
class="diy-button--white"
size="small"
@click="handleExport">导出</el-button>
<el-button style="float: left; margin-left: 10px" class="diy-button--white" size="small"
@click="handleExport">导出</el-button>
<!-- v-if="btnAuths.ic_house_batch_del" -->
<el-button style="float: left; margin-left: 10px"
class="diy-button--white"
size="small"
@click="deleteBatch">批量删除</el-button>
<el-button style="float: left; margin-left: 10px" class="diy-button--white" size="small"
@click="deleteBatch">批量删除</el-button>
</div>
<div>
<el-popover popper-class="btn-popper"
placement="bottom"
style="margin-left: 10px"
width="20"
trigger="hover">
<div v-if="showImportBtn"
class="table-more-btn">
<el-popover popper-class="btn-popper" placement="bottom" style="margin-left: 10px" width="20" trigger="hover">
<div class="table-more-btn">
<!-- v-if="btnAuths.ic_house_import" -->
<el-button :headers="$getElUploadHeaders()" class="diy-button--other" size="small" type="text"
@click="handleExportModule('community')">下载小区模板</el-button>
</div>
<div class="table-more-btn">
<!-- v-if="btnAuths.ic_house_import" -->
<el-button :headers="$getElUploadHeaders()"
class="diy-button--other"
size="small"
type="text"
@click="handleExportModule">下载房屋模板</el-button>
<el-button :headers="$getElUploadHeaders()" class="diy-button--other" size="small" type="text"
@click="handleExportModule('building')">下载楼栋模板</el-button>
</div>
<div class="table-more-btn">
<!-- v-if="btnAuths.ic_house_import" -->
<el-button :headers="$getElUploadHeaders()" class="diy-button--other" size="small" type="text"
@click="handleExportModule('room')">下载房屋模板</el-button>
</div>
<!-- v-if="btnAuths.ic_house_export_yhyd" -->
<div class="table-more-btn">
<el-button style=""
class="diy-button--other"
size="small"
type="text"
:disabled="yihuyidangDisabled"
@click="handleExportYihuyidang()">导出一户一档</el-button>
<el-button style="" class="diy-button--other" size="small" type="text" :disabled="yihuyidangDisabled"
@click="handleExportYihuyidang()">导出一户一档</el-button>
</div>
<!-- btnAuths.ic_house_smart_import && -->
<div v-if=" displayedBaobiaoBtn"
class="table-more-btn">
<el-button size="small"
class="diy-button--other"
type="text"
@click="reportForm">智能填报</el-button>
<div v-if="displayedBaobiaoBtn" class="table-more-btn">
<el-button size="small" class="diy-button--other" type="text" @click="reportForm">智能填报</el-button>
</div>
<el-button size="small"
style="float:right"
class="diy-button--white"
slot="reference">更多<i class="el-icon-arrow-down el-icon--right"></i></el-button>
<el-button size="small" style="float:right" class="diy-button--white" slot="reference">更多<i
class="el-icon-arrow-down el-icon--right"></i></el-button>
</el-popover>
</div>
</div>
<div class="m-table-item">
<el-table ref="ref_table"
:data="tableData"
v-loading="tableLoading"
@sort-change="handleSortOrderChange"
border
:height="tableHeight"
style="width: 100%"
@select-all="selectAll"
@selection-change="selectionChange">
<el-table-column type="selection"
:selectable="checkSelect"
width="55">
<el-table ref="ref_table" :data="tableData" v-loading="tableLoading" @sort-change="handleSortOrderChange" border
:height="tableHeight" style="width: 100%" @select-all="selectAll" @selection-change="selectionChange">
<el-table-column type="selection" :selectable="checkSelect" width="55">
</el-table-column>
<!-- <el-table-column fixed="left"
width="70"
@ -123,166 +81,73 @@
:index="indexMethod">
</el-table-column> -->
<el-table-column prop="houseNameShow"
header-align="left"
align="left"
label="房屋名称"
fixed="left"
min-width="160">
<el-table-column prop="houseNameShow" header-align="left" align="left" label="房屋名称" fixed="left" min-width="160">
</el-table-column>
<el-table-column prop="neighborHoodName"
label="所属小区"
header-align="left"
align="left"
min-width="150">
<el-table-column prop="neighborHoodName" label="所属小区" header-align="left" align="left" min-width="150">
</el-table-column>
<el-table-column prop="buildingName"
label="所属楼栋"
header-align="left"
align="left"
width="90">
<el-table-column prop="buildingName" label="所属楼栋" header-align="left" align="left" width="90">
</el-table-column>
<el-table-column prop="unitNum"
label="单元号"
header-align="left"
align="left"
width="80">
<el-table-column prop="unitNum" label="单元号" header-align="left" align="left" width="80">
</el-table-column>
<el-table-column prop="doorName"
label="门牌号"
header-align="left"
align="left"
width="80">
<el-table-column prop="doorName" label="门牌号" header-align="left" align="left" width="80">
</el-table-column>
<el-table-column prop="houseType"
label="类型"
header-align="left"
align="left"
width="70">
<el-table-column prop="houseType" label="类型" header-align="left" align="left" width="70">
</el-table-column>
<el-table-column prop="purpose"
label="用途"
header-align="left"
align="left"
width="70">
<el-table-column prop="purpose" label="用途" header-align="left" align="left" width="70">
</el-table-column>
<el-table-column prop="rentFlag"
label="房屋状态"
header-align="left"
align="left"
width="90">
<el-table-column prop="rentFlag" label="房屋状态" header-align="left" align="left" width="90">
</el-table-column>
<el-table-column prop="ownerName"
label="房主姓名"
header-align="left"
align="left"
width="90">
<el-table-column prop="ownerName" label="房主姓名" header-align="left" align="left" width="90">
</el-table-column>
<el-table-column prop="ownerPhone"
label="联系方式"
header-align="left"
align="left"
width="110">
<el-table-column prop="ownerPhone" label="联系方式" header-align="left" align="left" width="110">
</el-table-column>
<el-table-column prop="ownerIdCard"
label="证件号"
header-align="left"
align="left"
width="170">
<el-table-column prop="ownerIdCard" label="证件号" header-align="left" align="left" width="170">
</el-table-column>
<el-table-column prop="remark"
label="备注"
header-align="left"
align="left"
width="170">
<el-table-column prop="remark" label="备注" header-align="left" align="left" width="170">
</el-table-column>
<el-table-column prop="sort"
sortable="custom"
min-width="100"
header-align="left"
align="left"
label="排序">
<el-table-column prop="sort" sortable="custom" min-width="100" header-align="left" align="left" label="排序">
<template slot-scope="scope">
<div @click="handleEditSort(scope.row)">
<span v-if="!scope.row.isChange">{{ scope.row.sort }}</span>
<!-- :precision="2" -->
<el-input-number v-else
@change="handleChangeSort(scope.row)"
v-model="scope.row.sort"
class="item_width_4"
size="small"
:min="0"
:max="9999"
label="描述文字"></el-input-number>
<el-input-number v-else @change="handleChangeSort(scope.row)" v-model="scope.row.sort" class="item_width_4"
size="small" :min="0" :max="9999" label="描述文字"></el-input-number>
</div>
</template>
</el-table-column>
<el-table-column label="操作"
fixed="right"
width="220"
header-align="center"
align="center"
class="operate">
<el-table-column label="操作" fixed="right" width="220" header-align="center" align="center" class="operate">
<template slot-scope="scope">
<!-- v-if="btnAuths.ic_house_view" -->
<el-button type="text"
class="div-table-button--blue"
size="small"
@click="handleDetail(scope.row)">查看</el-button>
<el-button type="text" class="div-table-button--blue" size="small"
@click="handleDetail(scope.row)">查看</el-button>
<!-- btnAuths.ic_house_update && -->
<el-button v-if=" scope.row.showBtn"
type="text"
class="div-table-button--blue"
size="small"
@click="handleEdit(scope.row)">编辑</el-button>
<el-button v-if="scope.row.showBtn" type="text" class="div-table-button--blue" size="small"
@click="handleEdit(scope.row)">编辑</el-button>
<!-- btnAuths.ic_house_del && -->
<el-button v-if=" scope.row.showBtn"
type="text"
class="div-table-button--blue"
size="small"
@click="handleDelete(scope.row)">删除</el-button>
<el-button v-if="scope.row.showBtn" type="text" class="div-table-button--blue" 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="pageNo"
:page-sizes="[20, 50, 100, 200]"
:page-size="pageSize"
layout="sizes, prev, pager, next, total"
:total="total">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="pageNo"
:page-sizes="[20, 50, 100, 200]" :page-size="pageSize" layout="sizes, prev, pager, next, total" :total="total">
</el-pagination>
</div>
</div>
<!-- 修改弹出框 -->
<el-dialog :visible.sync="formShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="formTitle"
width="670px"
top="5vh"
class="dialog-h"
@closed="diaClose">
<room-form ref="ref_form"
@dialogCancle="addFormCancle"
@dialogOk="addFormOk"></room-form>
<el-dialog :visible.sync="formShow" :close-on-click-modal="false" :close-on-press-escape="false" :title="formTitle"
width="670px" top="5vh" class="dialog-h" @closed="diaClose">
<room-form ref="ref_form" @dialogCancle="addFormCancle" @dialogOk="addFormOk"></room-form>
</el-dialog>
<!-- 详情弹出框 -->
<el-dialog :visible.sync="detailShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="'查看房屋'"
width="820px"
top="5vh"
class="dialog-h"
@closed="detailFormCancle">
<el-dialog :visible.sync="detailShow" :close-on-click-modal="false" :close-on-press-escape="false" :title="'查看房屋'"
width="820px" top="5vh" class="dialog-h" @closed="detailFormCancle">
<!-- :view_real_data="btnAuths.ic_house_view_real_data" -->
<room-detail ref="ref_form_detail"
@diaDetailClose="detailFormCancle"></room-detail>
<room-detail ref="ref_form_detail" @diaDetailClose="detailFormCancle"></room-detail>
</el-dialog>
<baobiao ref="baobiao" />
@ -299,7 +164,7 @@ import baobiao from "@/views/modules/cpts/baobiao";
let loading; //
export default {
data () {
data() {
return {
searchHeight: 190,//
source: "tree", //
@ -366,7 +231,7 @@ export default {
roomForm,
roomDetail,
},
async mounted () {
async mounted() {
this.updateBtnAuths();
// this.displayedBaobiaoBtn = await this.$refs.baobiao.existsTemplate({
@ -377,7 +242,7 @@ export default {
// });
},
computed: {
tableHeight () {
tableHeight() {
console.log(this.searchHeight)
let height = this.searchHeight + 270
return this.$store.state.inIframe ? this.clientHeight - height + this.iframeHeight : this.clientHeight - height
@ -388,7 +253,7 @@ export default {
},
methods: {
//
updateBtnAuths () {
updateBtnAuths() {
let rot = this.$route;
if (Array.isArray(rot.meta.btns)) {
rot.meta.btns.forEach((item) => {
@ -397,7 +262,7 @@ export default {
}
},
reportForm () {
reportForm() {
let paramMap = {
pageSize: this.pageSize,
pageNo: this.pageNo,
@ -425,25 +290,25 @@ export default {
});
},
indexMethod (index) {
indexMethod(index) {
return index + 1;
},
handleSortOrderChange (value) {
handleSortOrderChange(value) {
this.sortType = value.order === "ascending" ? "asc" : "desc";
this.loadTable();
},
handleSortChange (value) {
handleSortChange(value) {
this.sortType = value.order === "ascending" ? "asc" : "desc";
this.loadTable();
},
handleEditSort (row) {
handleEditSort(row) {
if (!row.isChange) {
row.isChange = true;
}
},
async handleChangeSort (row, index) {
async handleChangeSort(row, index) {
// row.isChange = false
let params = {
@ -466,7 +331,7 @@ export default {
}
},
checkSelect (row, index) {
checkSelect(row, index) {
let isChecked = false;
if (row.showBtn) {
//
@ -477,9 +342,9 @@ export default {
return isChecked;
},
loadTreeFromSearch () { },
loadTreeFromSearch() { },
async loadTable (source, treeObj) {
async loadTable(source, treeObj) {
this.source = source;
this.tableLoading = true;
this.addDisabled = true
@ -560,12 +425,12 @@ export default {
this.tableLoading = false;
},
diaClose () {
diaClose() {
this.$refs.ref_form.resetData();
this.formShow = false;
},
handleDetail (row) {
handleDetail(row) {
this.detailShow = true;
// const _data = await this.detail(row)
@ -574,12 +439,12 @@ export default {
});
},
detailFormCancle () {
detailFormCancle() {
// this.$refs.ref_form_detail.diaDestroy()
this.detailShow = false;
},
handleAdd () {
handleAdd() {
this.formTitle = "新增房屋";
this.formShow = true;
this.$nextTick(() => {
@ -587,7 +452,7 @@ export default {
});
},
handleEdit (row) {
handleEdit(row) {
this.formTitle = "修改房屋";
this.formShow = true;
this.$nextTick(() => {
@ -595,16 +460,16 @@ export default {
});
},
addFormCancle () {
addFormCancle() {
this.formShow = false;
},
addFormOk () {
addFormOk() {
this.formShow = false;
this.loadTable();
this.$emit('refreshTree')
},
deleteBatch () {
deleteBatch() {
if (this.selection.length > 0) {
this.$confirm("确认删除选择的房屋?", "提示", {
confirmButtonText: "确定",
@ -626,14 +491,14 @@ export default {
this.$message.warning("请先选择要删除的房屋");
}
},
selectAll (selection) {
selectAll(selection) {
this.selection = selection;
},
selectionChange (selection) {
selectionChange(selection) {
this.selection = selection;
},
async handleDelete (row) {
async handleDelete(row) {
this.$confirm("确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@ -652,7 +517,7 @@ export default {
});
},
async deleteCommunityBatch () {
async deleteCommunityBatch() {
let ids = [];
this.selection.forEach((element) => {
ids.push(element.houseId);
@ -687,7 +552,7 @@ export default {
}
},
async deleteRoom (row) {
async deleteRoom(row) {
const url = "/actual/base/communityHouse/deleteHouse";
let params = {
@ -709,7 +574,7 @@ export default {
},
//
async handleExport () {
async handleExport() {
let title = this.agencyObj.label;
title = title + "—房屋列表";
@ -764,7 +629,7 @@ export default {
},
//
download (data, fileName) {
download(data, fileName) {
if (!data) {
return;
}
@ -788,18 +653,31 @@ export default {
}
},
handleExportModule () {
let title = "";
title = "房屋模板";
handleExportModule(type) {
let title = ''
let url = ""
if (type === "community") {
title = "小区导入模板";
url = "/gov/org/neighborhood/exporttemplate";
} else if (type === 'building') {
title = '楼栋导入模板'
url = '/gov/org/building/exporttemplate'
} else if (type === 'room') {
title = '房屋导入模板'
url = '/gov/org/house/exporttemplate'
}
const url = "/gov/org/house/exporttemplate";
let params = {};
let params = {}
app.ajax.exportFilePost(
url,
params,
(data, rspMsg) => {
this.download(data, title + ".xls");
this.download(data, title + '.xls')
},
(rspMsg, data) => {
this.$message.error(rspMsg);
@ -808,7 +686,7 @@ export default {
},
//
handleExportYihuyidang () {
handleExportYihuyidang() {
this.yihuyidangDisabled = true;
let title = this.agencyObj.label;
title = title + "-一户一档";
@ -868,7 +746,7 @@ export default {
);
},
//
beforeUpload (file) {
beforeUpload(file) {
this.files = file;
const isText = file.type === "application/vnd.ms-excel";
@ -885,11 +763,11 @@ export default {
}
},
//
handleExceed (files, fileList) {
handleExceed(files, fileList) {
this.$message.warning(`当前限制选择 1 个文件,请删除后继续上传`);
},
async uploadFile () {
async uploadFile() {
if (this.fileName == "") {
this.$message.warning("请选择要上传的文件!");
return false;
@ -943,7 +821,7 @@ export default {
);
},
showMessage (msg) {
showMessage(msg) {
this.$alert(msg, "操作结果", {
confirmButtonText: "关闭",
callback: (action) => {
@ -953,18 +831,18 @@ export default {
});
},
handleSizeChange (val) {
handleSizeChange(val) {
this.pageSize = val;
this.pageNo = 1;
this.loadTable();
},
handleCurrentChange (val) {
handleCurrentChange(val) {
this.pageNo = val;
this.loadTable();
},
//
startLoading () {
startLoading() {
loading = Loading.service({
lock: true, //
text: "正在加载……", //
@ -972,7 +850,7 @@ export default {
});
},
//
endLoading () {
endLoading() {
// clearTimeout(timer);
if (loading) {
loading.close();
@ -980,7 +858,7 @@ export default {
},
},
watch: {
selection (val) {
selection(val) {
if (val.length > 0) {
this.showDeletBtn = true;
} else {
@ -988,7 +866,7 @@ export default {
}
},
'$store.state.sidebarFold': {
handler (newVal, oldVal) {
handler(newVal, oldVal) {
if (newVal) {//
this.searchHeight = 155
@ -1071,6 +949,7 @@ export default {
/deep/.el-input-number--medium .el-input-number__increase {
width: 26px;
}
/deep/.el-input-number--medium .el-input__inner {
padding-left: 0px;
padding-right: 0px;

257
src/views/modules/base/resi.vue

@ -341,7 +341,6 @@
<resi-form v-if="dialogVisible"
ref="baseForm"
:fixed="true"
:form-list="formList"
:resi-id="editUserId"
@changegroup="handleChangeGroup" />
</div>
@ -466,8 +465,6 @@ import { requestPost } from "@/js/dai/request";
import resiChangeTransfer from "../../components/resiChangeTransfer.vue";
import resideathAdd from "../plugins/change/resideathAdd.vue";
import util from "@/js/util";
import dateFormat from "dai-js/tools/dateFormat";
export default {
components: {
@ -513,15 +510,9 @@ export default {
tableData: [],
searchList: [],
exportList: [],
editForm: {
GRID_ID: "",
VILLAGE_ID: "",
BUILD_ID: "",
HOME_ID: "",
},
editTableName: {},
formName: "",
formList: [],
tableHeader: [
{ columnName: "name", label: "姓名", width: 80 },
{ columnName: "birthday", label: "生日", width: 100 },
@ -1095,64 +1086,7 @@ export default {
}
this.tabsList = [...list];
},
formetForm () {
const _baseForm = this.$refs.baseForm.handleForm();
let arr = [];
if (_baseForm.length === 0) return false;
arr.push([..._baseForm]);
this.tabsList.forEach((item) => {
arr.push([
...this.$refs["group" + item.groupId][0].handleForm(),
]);
});
let arr2 = arr.reduce(function (a, b) {
return a.concat(b);
});
let noChange = true;
arr2.forEach((item) => {
if (item.list.length !== 0) noChange = false;
});
console.log("arr2", arr2);
if (noChange) {
this.$message.warning("您还没有做任何修改");
return false;
}
// tableName
let hash = {};
let i = 0;
let res = [];
let finalArr = [];
arr2.forEach(function (item) {
let name = item.tableName;
if (hash[name]) {
res[hash[name] - 1].list.push(...item.list);
} else {
hash[name] = ++i;
res.push({
list: [...item.list],
supportAdd: item.supportAdd,
tableName: name,
});
}
});
console.log("res", res);
// listlist
res.forEach((item) => {
let _form = {};
item.list.length > 0 &&
item.list.forEach((n) => {
_form = { ..._form, ...n };
});
if (item.list.length > 0) {
finalArr.push({
tableName: item.tableName,
list: item.supportAdd ? [...item.list] : [{ ..._form }],
});
}
});
console.log("finalArr", finalArr);
return finalArr;
},
async handleEditSUbmit () {
this.handleSUbmit();
},
@ -1276,21 +1210,7 @@ export default {
return this.$message.error("网络错误");
});
},
handleFormatUrl (url) {
return url.includes("?");
},
handlerEditCancle () {
this.$refs.baseForm.resetForm();
this.tabsList.forEach((item) => {
this.$refs["group" + item.groupId][0].resetForm();
});
this.dialogEditVisible = false;
},
handlerCancle () {
// this.$refs.baseForm.resetForm();
// this.tabsList.forEach((item) => {
// this.$refs["group" + item.groupId][0].resetForm();
// });
this.dialogVisible = false;
},
async submitAdd (arr) {
@ -1320,29 +1240,6 @@ export default {
this.btnLoading = false;
this.handleSearchFrom();
},
async submitEdit (arr) {
this.btnLoading = true;
await this.$http
.post("/epmetuser/icresiuser/edit", arr)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
this.$message.success("提交成功");
// this.$refs[formName].resetFields();
this.$refs.baseForm.resetForm();
this.tabsList.forEach((item) => {
this.$refs["group" + item.groupId][0].resetForm();
});
this.getTableData();
this.dialogEditVisible = false;
}
})
.catch(() => {
return this.$message.error("网络错误");
});
this.btnLoading = false;
},
async getTableData (obj) {
console.log(this.currentPage);
@ -1366,107 +1263,7 @@ export default {
}
},
// async getQueryConditions() {
// let params = {
// formCode: "resident_base_info",
// customerId: this.$store.state.user.customerId,
// };
//
// const { data } = await this.$http.post(
// "/oper/customize/icform/queryItems",
// params
// );
//
// if (data.code === 0) {
// this.queryConditions = data.data.map((item) => {
// return {
// ...item,
// humpName: util.capitalToHump(item.columnName),
// };
// });
// console.log(this.queryConditions);
// } else {
// this.$message.error(data.msg);
// }
// },
getrowInfo (id) {
let params = {
formCode: "resident_base_info",
icResiUserId: id,
};
this.$http
.post("/epmetuser/icresiuser/detail", params)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
// console.log('getrowInfo----', res.data)
let info = res.data;
this.editTableName = { ...info };
let list = info[this.formList[0].tableName][0];
for (let n in list) {
this.editForm[n] = list[n];
}
this.formList.forEach((item) => {
item.columnValue = list[item.columnName];
item.ID = list.ID;
if (
item.columnValue == "1" &&
item.itemType === "radio" &&
item.childGroup
) {
this.tabsList.push(item.childGroup);
}
// if (item.childGroup && info[item.childGroup.tableName]) {
// }
});
this.tabsList.forEach((item) => {
let _info = info[item.tableName];
if (item.supportAdd) {
// console.log('tabsList---333', item.label)
const _list = [...item.itemList];
let mutiList = [];
if (_info) {
_info.forEach((fo, index) => {
// console.log('mutiList----555' + index, mutiList, _list)
mutiList.splice(index, 0, {
row: index,
itemList: _list.map((m) => {
// console.log('itemList---item' + index, m)
return {
...m,
ID: fo.ID,
columnValue:
fo[m.columnName],
};
}),
});
// console.log('mutiList----666' + index, mutiList)
});
}
item.mutiList = mutiList;
} else {
if (_info) {
item.itemList.forEach((n) => {
n.ID = _info[0].ID;
n.columnValue = _info[0][n.columnName];
});
}
}
});
// console.log('getrowInfo---formname', this.tabsList)
this.dialogEditVisible = true;
}
})
.catch((err) => {
console.log("getrowInfo---formnameerr", err);
return this.$message.error("网络错误");
});
},
async getOptionsList (url) {
let options = [];
// console.log('getOptionsList----', url)
@ -1505,56 +1302,6 @@ export default {
return arr;
},
async getFormList (type) {
await this.$http
.post("/oper/customize/icform/getcustomerform", {
formCode: "resident_base_info",
dynamic: true,
})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
console.log(res.data, "res.data");
console.log("获取详情成功getFormList");
let { itemList, groupList, formName } = res.data;
this.formName = formName;
this.activeName =
"group" + res.data.groupList[0].groupId;
if (type !== "edit") {
itemList.forEach(async (item) => {
if (item.optionSourceType === "remote") {
await this.getOptionsList(
item.optionSourceValue
).then((res) => {
item.options = this.getTreeData(res);
});
}
});
}
groupList.forEach((item) => {
item.itemList.forEach(async (n) => {
n.tableName = item.tableName;
if (
n.optionSourceType === "remote" &&
type !== "edit"
) {
await this.getOptionsList(
n.optionSourceValue
).then((res) => {
n.options = this.getTreeData(res);
});
}
});
});
this.formList = itemList;
this.tabsList = groupList;
}
})
.catch(() => {
return this.$message.error("网络错误");
});
},
async getExportList (type) {
const url = "/oper/customize/icformitemgroup/list";
let params = {

Loading…
Cancel
Save