Browse Source

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

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

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

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

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

@ -341,7 +341,6 @@
<resi-form v-if="dialogVisible" <resi-form v-if="dialogVisible"
ref="baseForm" ref="baseForm"
:fixed="true" :fixed="true"
:form-list="formList"
:resi-id="editUserId" :resi-id="editUserId"
@changegroup="handleChangeGroup" /> @changegroup="handleChangeGroup" />
</div> </div>
@ -466,8 +465,6 @@ import { requestPost } from "@/js/dai/request";
import resiChangeTransfer from "../../components/resiChangeTransfer.vue"; import resiChangeTransfer from "../../components/resiChangeTransfer.vue";
import resideathAdd from "../plugins/change/resideathAdd.vue"; import resideathAdd from "../plugins/change/resideathAdd.vue";
import util from "@/js/util";
import dateFormat from "dai-js/tools/dateFormat";
export default { export default {
components: { components: {
@ -513,15 +510,9 @@ export default {
tableData: [], tableData: [],
searchList: [], searchList: [],
exportList: [], exportList: [],
editForm: {
GRID_ID: "",
VILLAGE_ID: "",
BUILD_ID: "",
HOME_ID: "",
},
editTableName: {}, editTableName: {},
formName: "", formName: "",
formList: [],
tableHeader: [ tableHeader: [
{ columnName: "name", label: "姓名", width: 80 }, { columnName: "name", label: "姓名", width: 80 },
{ columnName: "birthday", label: "生日", width: 100 }, { columnName: "birthday", label: "生日", width: 100 },
@ -1095,64 +1086,7 @@ export default {
} }
this.tabsList = [...list]; 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 () { async handleEditSUbmit () {
this.handleSUbmit(); this.handleSUbmit();
}, },
@ -1276,21 +1210,7 @@ export default {
return this.$message.error("网络错误"); 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 () { handlerCancle () {
// this.$refs.baseForm.resetForm();
// this.tabsList.forEach((item) => {
// this.$refs["group" + item.groupId][0].resetForm();
// });
this.dialogVisible = false; this.dialogVisible = false;
}, },
async submitAdd (arr) { async submitAdd (arr) {
@ -1320,29 +1240,6 @@ export default {
this.btnLoading = false; this.btnLoading = false;
this.handleSearchFrom(); 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) { async getTableData (obj) {
console.log(this.currentPage); 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) { async getOptionsList (url) {
let options = []; let options = [];
// console.log('getOptionsList----', url) // console.log('getOptionsList----', url)
@ -1505,56 +1302,6 @@ export default {
return arr; 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) { async getExportList (type) {
const url = "/oper/customize/icformitemgroup/list"; const url = "/oper/customize/icformitemgroup/list";
let params = { let params = {

Loading…
Cancel
Save