diff --git a/src/assets/scss/modules/management/list-main.scss b/src/assets/scss/modules/management/list-main.scss index a2af675ac..132b39be1 100644 --- a/src/assets/scss/modules/management/list-main.scss +++ b/src/assets/scss/modules/management/list-main.scss @@ -2,6 +2,9 @@ .div_main { width: 100%; + .marginl-20{ + margin-left: 16px; + } .div_search { background: #ffffff; diff --git a/src/assets/scss/modules/shequzhili/event-info.scss b/src/assets/scss/modules/shequzhili/event-info.scss index 39f48b609..ad8cad49b 100644 --- a/src/assets/scss/modules/shequzhili/event-info.scss +++ b/src/assets/scss/modules/shequzhili/event-info.scss @@ -396,7 +396,8 @@ display: flex; .detail-field { - width: 100px; + flex:0 0 100px; + text-align: justify; text-align-last: justify; } diff --git a/src/assets/scss/modules/visual/communityManage.scss b/src/assets/scss/modules/visual/communityManage.scss index a1323dab9..a7a7499a1 100644 --- a/src/assets/scss/modules/visual/communityManage.scss +++ b/src/assets/scss/modules/visual/communityManage.scss @@ -49,7 +49,7 @@ .div_btn { display: flex; - margin-top: 20px; + margin-top: 10px; .btn_upload { margin-left: 10px; diff --git a/src/mixins/view-module.js b/src/mixins/view-module.js index d8f48fa0b..dcfabd2ed 100644 --- a/src/mixins/view-module.js +++ b/src/mixins/view-module.js @@ -42,17 +42,18 @@ export default { methods: { // 获取数据列表 query () { - const params = { - order: this.order, - orderField: this.orderField, - page: this.mixinViewModuleOptions.getDataListIsPage ? this.page : null, - limit: this.mixinViewModuleOptions.getDataListIsPage ? this.limit : null, - ...this.dataForm - } - this.post = true - this.$http.post( - this.mixinViewModuleOptions.getDataListURL, - params + this.dataListLoading = true + this.$http.get( + this.mixinViewModuleOptions.getDataListURL, + { + params: { + order: this.order, + orderField: this.orderField, + page: this.mixinViewModuleOptions.getDataListIsPage ? this.page : null, + limit: this.mixinViewModuleOptions.getDataListIsPage ? this.limit : null, + ...this.dataForm + } + } ).then(({ data: res }) => { this.dataListLoading = false if (res.code !== 0) { diff --git a/src/mixins/view-post.js b/src/mixins/view-post.js new file mode 100644 index 000000000..ba5b51bec --- /dev/null +++ b/src/mixins/view-post.js @@ -0,0 +1,167 @@ +import Cookies from 'js-cookie' +import qs from 'qs' +export default { + data () { + /* eslint-disable */ + return { + // 设置属性 + mixinViewModuleOptions: { + createdIsNeed: true, // 此页面是否在创建时,调用查询数据列表接口? + activatedIsNeed: false, // 此页面是否在激活(进入)时,调用查询数据列表接口? + getDataListURL: '', // 数据列表接口,API地址 + getDataListIsPage: false, // 数据列表接口,是否需要分页? + deleteURL: '', // 删除接口,API地址 + deleteIsBatch: false, // 删除接口,是否需要批量? + deleteIsBatchKey: 'id', // 删除接口,批量状态下由那个key进行标记操作?比如:pid,uid... + exportURL: '' // 导出接口,API地址 + }, + // 默认属性 + dataForm: {}, // 查询条件 + dataList: [], // 数据列表 + order: '', // 排序,asc/desc + orderField: '', // 排序,字段 + page: 1, // 当前页码 + limit: 10, // 每页数 + total: 0, // 总条数 + dataListLoading: false, // 数据列表,loading状态 + dataListSelections: [], // 数据列表,多选项 + addOrUpdateVisible: false // 新增/更新,弹窗visible状态 + } + /* eslint-enable */ + }, + created () { + if (this.mixinViewModuleOptions.createdIsNeed) { + this.query() + } + }, + activated () { + if (this.mixinViewModuleOptions.activatedIsNeed) { + this.query() + } + }, + methods: { + // 获取数据列表 + query () { + this.dataListLoading = true + const params = { + order: this.order, + orderField: this.orderField, + page: this.mixinViewModuleOptions.getDataListIsPage ? this.page : null, + limit: this.mixinViewModuleOptions.getDataListIsPage ? this.limit : null, + ...this.dataForm + } + this.$http.post( + this.mixinViewModuleOptions.getDataListURL, + params + ).then(({ data: res }) => { + this.dataListLoading = false + if (res.code !== 0) { + this.dataList = [] + this.total = 0 + return this.$message.error(res.msg) + } + this.dataList = this.mixinViewModuleOptions.getDataListIsPage ? res.data.list : res.data + this.total = this.mixinViewModuleOptions.getDataListIsPage ? res.data.total : 0 + this.dataList.forEach(item => { + if (item.gender) { + item.gender = item.gender == '0' ? '女' : item.gender == '1' ? '男' : item.gender + } + }) + }).catch(() => { + this.dataListLoading = false + }) + }, + // 多选 + dataListSelectionChangeHandle (val) { + this.dataListSelections = val + }, + // 排序 + dataListSortChangeHandle (data) { + if (!data.order || !data.prop) { + this.order = '' + this.orderField = '' + return false + } + this.order = data.order.replace(/ending$/, '') + this.orderField = data.prop.replace(/([A-Z])/g, '_$1').toLowerCase() + this.query() + }, + // 分页, 每页条数 + pageSizeChangeHandle (val) { + this.page = 1 + this.limit = val + this.query() + }, + // 分页, 当前页 + pageCurrentChangeHandle (val) { + this.page = val + this.query() + }, + getDataList: function () { + this.page = 1 + this.query() + }, + // 新增 / 修改 + addOrUpdateHandle (id) { + this.addOrUpdateVisible = true + this.$nextTick(() => { + this.$refs.addOrUpdate.dataForm.id = id + this.$refs.addOrUpdate.init() + }) + }, + // 删除 + deleteHandle (id) { + if (this.mixinViewModuleOptions.deleteIsBatch && !id && this.dataListSelections.length <= 0) { + return this.$message({ + message: this.$t('prompt.deleteBatch'), + type: 'warning', + duration: 500 + }) + } + this.$confirm(this.$t('prompt.info', { 'handle': this.$t('delete') }), this.$t('prompt.title'), { + confirmButtonText: this.$t('confirm'), + cancelButtonText: this.$t('cancel'), + type: 'warning' + }).then(() => { + this.$http.delete( + `${this.mixinViewModuleOptions.deleteURL}${this.mixinViewModuleOptions.deleteIsBatch ? '' : '/' + id}`, + this.mixinViewModuleOptions.deleteIsBatch ? { + 'data': id ? [id] : this.dataListSelections.map(item => item[this.mixinViewModuleOptions.deleteIsBatchKey]) + } : {} + ).then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } + this.$message({ + message: this.$t('prompt.success'), + type: 'success', + duration: 500, + onClose: () => { + this.query() + } + }) + }).catch(() => {}) + }).catch(() => {}) + }, + // 导出 + exportHandle () { + var params = qs.stringify({ + 'token': localStorage.getItem('token'), + ...this.dataForm + }) + window.location.href = `${window.SITE_CONFIG['apiURL']}${this.mixinViewModuleOptions.exportURL}?${params}` + }, + // 时间段控件取值变化事件-清空一个其他都清空 + changeTime (dateValue) { + var startTimeIsNull = this.dataForm.startTime === '' || this.dataForm.startTime === 'null' || this.dataForm.startTime === null + var endTimeIsNull = this.dataForm.endTime === '' || this.dataForm.endTime === 'null' || this.dataForm.endTime === null + if (dateValue === null || dateValue === '' || dateValue === 'null') { + this.dataForm.startTime = '' + this.dataForm.endTime = '' + } else if (startTimeIsNull || endTimeIsNull) { + this.dataForm.startTime = dateValue + this.dataForm.endTime = dateValue + } + } + } +} diff --git a/src/views/components/editResi.vue b/src/views/components/editResi.vue index d3b243f5f..05e086d92 100644 --- a/src/views/components/editResi.vue +++ b/src/views/components/editResi.vue @@ -1,92 +1,120 @@ + + + + + + - - - - diff --git a/src/views/modules/base/community/communityTable.vue b/src/views/modules/base/community/communityTable.vue index 5eb4596f7..bbdb0db2c 100644 --- a/src/views/modules/base/community/communityTable.vue +++ b/src/views/modules/base/community/communityTable.vue @@ -236,7 +236,7 @@ export default { }, computed: { tableHeight () { - return this.$store.state.inIframe ? this.clientHeight - 310 + this.iframeHeight : this.clientHeight - 310 + return this.$store.state.inIframe ? this.clientHeight - 425 + this.iframeHeight : this.clientHeight - 425 }, @@ -583,6 +583,10 @@ export default { ownerName: this.ownerName, ownerPhone: this.ownerPhone, rentFlag: this.rentFlag, + purpose: this.purpose, + remark: this.remark, + updateStartDate: this.updateStartDate, + updateEndDate: this.updateEndDate, } if (this.agencyObj.level === 'grid') { @@ -777,6 +781,22 @@ export default { type: String, default: '', }, + purpose: { + type: String, + default: '', + }, + remark: { + type: String, + default: '', + }, + updateStartDate: { + type: String, + default: '', + }, + updateEndDate: { + type: String, + default: '', + }, } } diff --git a/src/views/modules/base/community/roomTable.vue b/src/views/modules/base/community/roomTable.vue index daea171b1..4f87e3f31 100644 --- a/src/views/modules/base/community/roomTable.vue +++ b/src/views/modules/base/community/roomTable.vue @@ -109,6 +109,10 @@ label="身份证" width="170"> + + - import roomForm from './roomForm' - - import { requestPost } from "@/js/dai/request"; - import { mapGetters } from 'vuex' - import { Loading } from 'element-ui' // 引入Loading服务 - - let loading // 加载动画 - export default { - data () { - return { - source: 'tree',//来源 - importRoomLoading: false, - total: 0, - pageSize: 20, - pageNo: 0, - sortType: 'asc',//asc:正,desc:倒 - tableLoading: true, +import roomForm from './roomForm' - // showImportBtn: false,//是否显示操作按钮,根据登录人所属组织判断 +import { requestPost } from "@/js/dai/request"; +import { mapGetters } from 'vuex' +import { Loading } from 'element-ui' // 引入Loading服务 - agencyObj: {},//树所选的小区对象 +let loading // 加载动画 +export default { + data () { + return { + source: 'tree',//来源 + importRoomLoading: false, + total: 0, + pageSize: 20, + pageNo: 0, + sortType: 'asc',//asc:正,desc:倒 + tableLoading: true, + // showImportBtn: false,//是否显示操作按钮,根据登录人所属组织判断 - validTableDataNum: 0,//有效的数据数量,即有权限操作的数据数量 - selection: [], - showDeletBtn: false, + agencyObj: {},//树所选的小区对象 - tableData: [], - //form相关 - formShow: false, - formTitle: '新增房屋', + validTableDataNum: 0,//有效的数据数量,即有权限操作的数据数量 + selection: [], + showDeletBtn: false, - rentList: [ - { - value: '1', - label: '出租' - }, - { - value: '2', - label: '闲置' - }, - { - value: '0', - label: '自住' - }, - ], + tableData: [], - yihuyidangDisabled: false, + //form相关 + formShow: false, + formTitle: '新增房屋', - - } + rentList: [ + { + value: '1', + label: '出租' }, - components: { - roomForm + { + value: '2', + label: '闲置' }, - async mounted () { - + { + value: '0', + label: '自住' }, - computed: { - tableHeight () { - return this.$store.state.inIframe ? this.clientHeight - 310 + this.iframeHeight : this.clientHeight - 310 + ], - }, + yihuyidangDisabled: false, - ...mapGetters(['clientHeight', 'iframeHeight']) - }, - methods: { - indexMethod (index) { - return index + 1; - }, - handleSortOrderChange (value) { - this.sortType = value.order === 'ascending' ? 'asc' : 'desc' - this.loadTable() - - }, - handleSortChange (value) { - - this.sortType = value.order === 'ascending' ? 'asc' : 'desc' - this.loadTable() - - }, + } + }, + components: { + roomForm + }, + async mounted () { - handleEditSort (row) { - if (!row.isChange) { - row.isChange = true - } + }, + computed: { + tableHeight () { + return this.$store.state.inIframe ? this.clientHeight - 425 + this.iframeHeight : this.clientHeight - 425 - }, + }, - async handleChangeSort (row, index) { - // row.isChange = false + ...mapGetters(['clientHeight', 'iframeHeight']) + }, + methods: { + indexMethod (index) { + return index + 1; + }, + handleSortOrderChange (value) { - let params = { - id: row.houseId, - sort: row.sort, - type: 'house', - } + this.sortType = value.order === 'ascending' ? 'asc' : 'desc' + this.loadTable() - let url = '/gov/org/house/update-sort' + }, + handleSortChange (value) { - const { data, code, msg } = await requestPost(url, params) + this.sortType = value.order === 'ascending' ? 'asc' : 'desc' + this.loadTable() - if (code === 0) { - // this.$message({ - // type: 'success', - // message: '修改成功' - // }) + }, + handleEditSort (row) { + if (!row.isChange) { + row.isChange = true + } - } else { + }, - this.$message.error(msg) - } + async handleChangeSort (row, index) { + // row.isChange = false + let params = { + id: row.houseId, + sort: row.sort, + type: 'house', + } + + let url = '/gov/org/house/update-sort' + + const { data, code, msg } = await requestPost(url, params) + + if (code === 0) { + // this.$message({ + // type: 'success', + // message: '修改成功' + // }) - }, - checkSelect (row, index) { - let isChecked = false; - if (row.showBtn) { // 判断里面是否存在某个参数 - isChecked = true - } else { - isChecked = false - } - return isChecked - }, - - loadTreeFromSearch () { - - }, + } else { + + this.$message.error(msg) + } + + + }, - async loadTable (source, treeObj) { - - this.source = source - this.tableLoading = true - - if (source === 'tree') {//来源于tree,查询数据清空 - this.sortType = 'asc' - this.agencyObj = treeObj - - } else if (source === 'search') {//来源于查询 - this.agencyObj = treeObj - - } - - // if (fromTree) { - // this.agencyObj = treeObj - - // } - let params = { - pageSize: this.pageSize, - pageNo: this.pageNo, - level: this.agencyObj.level, - id: this.agencyObj.id, - ownerName: this.ownerName, - ownerPhone: this.ownerPhone, - rentFlag: this.rentFlag, - purpose: this.purpose, - remark: this.remark, - sortType: this.sortType, - } - - const url = "/gov/org/house/houselist" - - const { data, code, msg } = await requestPost(url, params) - - if (code === 0) { - this.total = data.total - this.validTableDataNum = 0 - data.list.forEach(item => { - item.sort = parseInt(item.sort) || 0; - item.sort = item.sort.toFixed(2) - item.isChange = false - item.houseNameShow = item.neighborHoodName + item.buildingName + item.unitNum + item.doorName - - if (item.agencyId === this.staffAgencyId) { - item.showBtn = true - this.validTableDataNum++ - } else { - item.showBtn = false - } - - }); - this.tableData = data.list - } else { - this.$message.error(msg) - } - this.tableLoading = false - }, - - diaClose () { - this.$refs.ref_form.resetData() - this.formShow = false - }, - - handleDetail (row) { - this.formTitle = '房屋详情' - this.formShow = true - this.$nextTick(() => { - - this.$refs.ref_form.initForm('detail', row, this.agencyObj) - }) - }, - - handleAdd () { - - this.formTitle = '新增房屋' - this.formShow = true - this.$nextTick(() => { - - this.$refs.ref_form.initForm('add', null, this.agencyObj) - }) - }, - - handleEdit (row) { - this.formTitle = '修改房屋' - this.formShow = true - this.$nextTick(() => { - this.$refs.ref_form.initForm('edit', row, this.agencyObj) - }) - }, - - addFormCancle () { - this.formShow = false - }, - addFormOk () { - this.formShow = false - this.loadTable() - }, - - - deleteBatch () { - if (this.selection.length > 0) { - this.$confirm("确认删除选择的房屋?", "提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning" - }) - .then(() => { - this.deleteCommunityBatch() - }) - .catch(err => { - if (err == "cancel") { - // this.$message({ - // type: "info", - // message: "已取消删除" - // }); - } - - }); - } else { - this.$message.warning('请先选择要删除的房屋') - } - }, - selectAll (selection) { - this.selection = selection - - }, - selectionChange (selection) { - this.selection = selection - - }, - - async handleDelete (row) { - - this.$confirm("确认删除?", "提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning" - }) - .then(() => { - this.deleteRoom(row) - }) - .catch(err => { - if (err == "cancel") { - // this.$message({ - // type: "info", - // message: "已取消删除" - // }); - } - - }); - - - }, - - async deleteCommunityBatch () { - let ids = [] - this.selection.forEach(element => { - - ids.push(element.houseId) - }); - - const url = "/gov/org/house/delete" - - let params = { - type: 'house', - ids: ids - } - - const { data, code, msg } = await requestPost(url, params) - - if (code === 0) { - this.$message({ - type: "success", - message: "删除成功" - }); - this.$emit('refreshTree') - this.loadTable() - } else if (code > 8000) { - this.$message({ - showClose: true, - message: msg, - duration: 0 - }) - this.$emit('refreshTree') - this.loadTable() - } else { - this.$message.error(msg) - } - }, - - async deleteRoom (row) { - const url = "/gov/org/house/housedel" - - let params = { - houseId: row.houseId - } - - const { data, code, msg } = await requestPost(url, params) - - if (code === 0) { - this.$message({ - type: "success", - message: "删除成功" - }); - this.$emit('refreshTree') - this.loadTable() - } else { - this.$message.error(msg) - } - }, - - //导出表格 - async handleExport () { - let title = this.agencyObj.label - title = title + '—房屋列表' - - const url = "/gov/org/house/exporthouseinfo" - let params = { - ownerName: this.ownerName, - ownerPhone: this.ownerPhone, - rentFlag: this.rentFlag, - purpose: this.purpose, - remark: this.remark, - buildingId: this.agencyObj.id - } - - app.ajax.exportFilePost( - url, - params, - (data, rspMsg) => { - - this.download(data, title + '.xls') - }, - (rspMsg, data) => { - this.$message.error(rspMsg); - } - ); - - }, - - // 下载文件 - download (data, fileName) { - if (!data) { - return - } - - var csvData = new Blob([data]) - - if (window.navigator && window.navigator.msSaveOrOpenBlob) { - window.navigator.msSaveOrOpenBlob(csvData, fileName); - } - // for Non-IE (chrome, firefox etc.) - else { - var a = document.createElement('a'); - document.body.appendChild(a); - a.style = 'display: none'; - var url = window.URL.createObjectURL(csvData); - a.href = url; - a.download = fileName; - a.click(); - a.remove(); - window.URL.revokeObjectURL(url); - } - - }, - - handleExportModule () { - let title = '' - title = '房屋模板' - - const url = "/gov/org/house/exporttemplate" - let params = {} - - app.ajax.exportFilePost( - url, - params, - (data, rspMsg) => { - - this.download(data, title + '.xls') - }, - (rspMsg, data) => { - this.$message.error(rspMsg); - } - ); - }, - - //导出一户一档 - handleExportYihuyidang () { - this.yihuyidangDisabled = true - let title = this.agencyObj.label - title = title + '-一户一档' - let url = "/gov/org/house/exportHouseUser" - - - - let params = { - agencyId: '', - gridId: '', - ownerName: this.ownerName, - ownerPhone: this.ownerPhone, - rentFlag: this.rentFlag, - purpose: this.purpose, - remark: this.remark, - buildingId: '', - neighborHoodId: '' - } - - if (this.agencyObj.level === 'grid') { - params.gridId = this.agencyObj.id - params.agencyId = '' - params.buildingId = '' - params.neighborHoodId = '' - } else if (this.agencyObj.level === 'neighborHood') { - params.neighborHoodId = this.agencyObj.id - params.agencyId = '' - params.buildingId = '' - params.gridId = '' - } else if (this.agencyObj.level === 'building') { - params.buildingId = this.agencyObj.id - params.agencyId = '' - params.neighborHoodId = '' - params.gridId = '' - } else { - - params.agencyId = this.agencyObj.id - params.buildingId = '' - params.neighborHoodId = '' - params.gridId = '' - } - - app.ajax.exportFilePost( - url, - params, - (data, rspMsg) => { - - this.download(data, title + '.xls') - this.yihuyidangDisabled = false - }, - (rspMsg, data) => { - this.$message.error(rspMsg); - this.yihuyidangDisabled = false - } - ); - }, - // 上传文件之前的钩子 - beforeUpload (file) { - this.files = file; - - const isText = file.type === 'application/vnd.ms-excel' - const isTextComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' - - if (!isText && !isTextComputer) { - this.$message.error('请选择正确格式的文件') - return false - } else { - this.fileName = file.name; - return true - } - - }, - // 上传文件个数超过定义的数量 - handleExceed (files, fileList) { - this.$message.warning(`当前限制选择 1 个文件,请删除后继续上传`) - }, - - async uploadFile () { - - - if (this.fileName == "") { - this.$message.warning('请选择要上传的文件!') - return false - } - - this.$message({ - showClose: true, - message: '导入中,请到系统管理-导入记录中查看进度', - duration: 0 - }) - - //清空上传列表 - this.$refs['upload'].clearFiles() - - var url = '/gov/org/house/houseimport' - - let fileFormData = new FormData(); - fileFormData.append('file', this.files);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名 - fileFormData.append('orgId', this.agencyObj.id);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名 - fileFormData.append('orgType', this.agencyObj.level);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名 - - this.importRoomLoading = true - window.app.ajax.post2(url, fileFormData, - (data, rspMsg) => { - - if (data.code === 0 && data.msg == 'success') { - // this.$message.success('导入成功') - } else { - // this.$message({ - // showClose: true, - // message: rspMsg, - // duration: 0, - // type: "error" - // }) - // this.$message.error(rspMsg) - } - this.$emit('refreshTree') - this.loadTable() - this.importRoomLoading = false - }, - (rspMsg, data) => { - this.importRoomLoading = false - }, { headers: { 'Content-Type': 'multipart/form-data' } }) - - - }, - - showMessage (msg) { - this.$alert(msg, '操作结果', { - confirmButtonText: '关闭', - callback: action => { - this.$emit('refreshTree') - this.loadTable() - - } - }); - }, - - handleSizeChange (val) { - this.pageSize = val - this.pageNo = 1 - this.loadTable() - }, - handleCurrentChange (val) { - this.pageNo = val - this.loadTable() - }, - - // 开启加载动画 - startLoading () { - loading = Loading.service({ - lock: true, // 是否锁定 - text: '正在加载……', // 加载中需要显示的文字 - background: 'rgba(0,0,0,.7)' // 背景颜色 - }) - }, - // 结束加载动画 - endLoading () { - // clearTimeout(timer); - if (loading) { - loading.close() - } + checkSelect (row, index) { + let isChecked = false; + if (row.showBtn) { // 判断里面是否存在某个参数 + isChecked = true + } else { + isChecked = false + } + return isChecked + }, + + loadTreeFromSearch () { + + }, + + async loadTable (source, treeObj) { + + this.source = source + this.tableLoading = true + + if (source === 'tree') {//来源于tree,查询数据清空 + this.sortType = 'asc' + this.agencyObj = treeObj + + } else if (source === 'search') {//来源于查询 + this.agencyObj = treeObj + + } + + // if (fromTree) { + // this.agencyObj = treeObj + + // } + let params = { + pageSize: this.pageSize, + pageNo: this.pageNo, + level: this.agencyObj.level, + id: this.agencyObj.id, + ownerName: this.ownerName, + ownerPhone: this.ownerPhone, + rentFlag: this.rentFlag, + purpose: this.purpose, + remark: this.remark, + sortType: this.sortType, + updateStartDate: this.updateStartDate, + updateEndDate: this.updateEndDate, + } + + const url = "/gov/org/house/houselist" + + const { data, code, msg } = await requestPost(url, params) + + if (code === 0) { + this.total = data.total + this.validTableDataNum = 0 + data.list.forEach(item => { + item.sort = parseInt(item.sort) || 0; + item.sort = item.sort.toFixed(2) + item.isChange = false + item.houseNameShow = item.neighborHoodName + item.buildingName + item.unitNum + item.doorName + + if (item.agencyId === this.staffAgencyId) { + item.showBtn = true + this.validTableDataNum++ + } else { + item.showBtn = false + } + + }); + this.tableData = data.list + } else { + this.$message.error(msg) + } + this.tableLoading = false + }, + + diaClose () { + this.$refs.ref_form.resetData() + this.formShow = false + }, + + handleDetail (row) { + this.formTitle = '房屋详情' + this.formShow = true + this.$nextTick(() => { + + this.$refs.ref_form.initForm('detail', row, this.agencyObj) + }) + }, + + handleAdd () { + + this.formTitle = '新增房屋' + this.formShow = true + this.$nextTick(() => { + + this.$refs.ref_form.initForm('add', null, this.agencyObj) + }) + }, + + handleEdit (row) { + this.formTitle = '修改房屋' + this.formShow = true + this.$nextTick(() => { + this.$refs.ref_form.initForm('edit', row, this.agencyObj) + }) + }, + + addFormCancle () { + this.formShow = false + }, + addFormOk () { + this.formShow = false + this.loadTable() + }, + + + deleteBatch () { + if (this.selection.length > 0) { + this.$confirm("确认删除选择的房屋?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }) + .then(() => { + this.deleteCommunityBatch() + }) + .catch(err => { + if (err == "cancel") { + // this.$message({ + // type: "info", + // message: "已取消删除" + // }); } + + }); + } else { + this.$message.warning('请先选择要删除的房屋') + } + }, + selectAll (selection) { + this.selection = selection + + }, + selectionChange (selection) { + this.selection = selection + + }, + + async handleDelete (row) { + + this.$confirm("确认删除?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }) + .then(() => { + this.deleteRoom(row) + }) + .catch(err => { + if (err == "cancel") { + // this.$message({ + // type: "info", + // message: "已取消删除" + // }); + } + + }); + + + }, + + async deleteCommunityBatch () { + let ids = [] + this.selection.forEach(element => { + + ids.push(element.houseId) + }); + + const url = "/gov/org/house/delete" + + let params = { + type: 'house', + ids: ids + } + + const { data, code, msg } = await requestPost(url, params) + + if (code === 0) { + this.$message({ + type: "success", + message: "删除成功" + }); + this.$emit('refreshTree') + this.loadTable() + } else if (code > 8000) { + this.$message({ + showClose: true, + message: msg, + duration: 0 + }) + this.$emit('refreshTree') + this.loadTable() + } else { + this.$message.error(msg) + } + }, + + async deleteRoom (row) { + const url = "/gov/org/house/housedel" + + let params = { + houseId: row.houseId + } + + const { data, code, msg } = await requestPost(url, params) + + if (code === 0) { + this.$message({ + type: "success", + message: "删除成功" + }); + this.$emit('refreshTree') + this.loadTable() + } else { + this.$message.error(msg) + } + }, + + //导出表格 + async handleExport () { + let title = this.agencyObj.label + title = title + '—房屋列表' + + const url = "/gov/org/house/exporthouseinfo" + let params = { + ownerName: this.ownerName, + ownerPhone: this.ownerPhone, + rentFlag: this.rentFlag, + purpose: this.purpose, + remark: this.remark, + updateStartDate: this.updateStartDate, + updateEndDate: this.updateEndDate, + buildingId: this.agencyObj.id + } + + app.ajax.exportFilePost( + url, + params, + (data, rspMsg) => { + + this.download(data, title + '.xls') }, - watch: { - selection (val) { - - if (val.length > 0) { - this.showDeletBtn = true - } else { - this.showDeletBtn = false - } - } + (rspMsg, data) => { + this.$message.error(rspMsg); + } + ); + + }, + + // 下载文件 + download (data, fileName) { + if (!data) { + return + } + + var csvData = new Blob([data]) + + if (window.navigator && window.navigator.msSaveOrOpenBlob) { + window.navigator.msSaveOrOpenBlob(csvData, fileName); + } + // for Non-IE (chrome, firefox etc.) + else { + var a = document.createElement('a'); + document.body.appendChild(a); + a.style = 'display: none'; + var url = window.URL.createObjectURL(csvData); + a.href = url; + a.download = fileName; + a.click(); + a.remove(); + window.URL.revokeObjectURL(url); + } + + }, + + handleExportModule () { + let title = '' + title = '房屋模板' + + const url = "/gov/org/house/exporttemplate" + let params = {} + + app.ajax.exportFilePost( + url, + params, + (data, rspMsg) => { + + this.download(data, title + '.xls') }, - props: { - staffAgencyId: { - type: String, - default: '', - }, - showImportBtn: { - type: Boolean, - default: false, - }, - ownerName: { - type: String, - default: '', - }, - ownerPhone: { - type: String, - default: '', - }, - rentFlag: { - type: String, - default: '', - }, - purpose: { - type: String, - default: '', - }, - remark: { - type: String, - default: '', - }, + (rspMsg, data) => { + this.$message.error(rspMsg); } - } - - diff --git a/src/views/modules/base/resi.vue b/src/views/modules/base/resi.vue index f1f84829a..10efef011 100644 --- a/src/views/modules/base/resi.vue +++ b/src/views/modules/base/resi.vue @@ -849,7 +849,8 @@ export default { childGroup.itemList.forEach(async (item) => { if (item.optionSourceType === 'remote') { await this.getOptionsList(item.optionSourceValue).then((res) => { - item.options = res + item.options = this.getTreeData(res) + }) // console.log('') } diff --git a/src/views/modules/communityParty/members/cpts/record.vue b/src/views/modules/communityParty/members/cpts/record.vue index 4236f0e88..cc7d8795a 100644 --- a/src/views/modules/communityParty/members/cpts/record.vue +++ b/src/views/modules/communityParty/members/cpts/record.vue @@ -64,7 +64,7 @@
{{ scope.row.startDate + ' - ' + scope.row.endDate }}
- + @@ -239,6 +241,7 @@ export default { queryEndTime: '', categoryCode: '', tableOrgId: '', + tableOrgType: '', eventId: '', processStatus: '' } @@ -400,6 +403,7 @@ export default { value: item.total, name: item.orgName, orgId: item.orgId, + orgType: item.orgType, color: colorArray[colIndex], selected: index == 0 ? true : false } @@ -416,7 +420,7 @@ export default { const url = '/gov/project/icEvent/processAnalysis/eventList' let params = { orgId: this.tableOrgId ? this.tableOrgId : this.orgId, - orgType: this.orgType, + orgType: this.tableOrgType ? this.tableOrgType : this.orgType, queryStartTime: this.queryStartTime, queryEndTime: this.queryEndTime, processStatus: this.processStatus, // 处理状态,processing,closed_case。可为空,为空查询所有状态的事件列表 @@ -538,6 +542,7 @@ export default { // this.$refs.pieChart.hideLoading() this.$refs.pieChart.setOption(this.pieOption) this.tableOrgId = '' + this.tableOrgType = '' this.demand.pageNo = 1 this.getGridPieData() }, @@ -603,6 +608,8 @@ export default { } } this.tableOrgId = element.orgId + this.tableOrgType = element.orgType + console.log(element) } else { element.label = { show: false, diff --git a/src/views/modules/visual/communityParty/community.vue b/src/views/modules/visual/communityParty/community.vue index 3194f8ee1..79f533a5c 100644 --- a/src/views/modules/visual/communityParty/community.vue +++ b/src/views/modules/visual/communityParty/community.vue @@ -109,7 +109,7 @@ -
+
联建活动分类统计
@@ -1187,6 +1187,7 @@ export default { .box-right { flex: 1; height: 100%; + margin-left: 10px; overflow: hidden; .pagination { margin-top: 0; @@ -1255,10 +1256,11 @@ export default { } } .table-h { - height: 320px; + height: calc(100vh - 630px); } .calc-h { height: calc(100vh - 240px); + padding-bottom: 20px; } .wd50 { width: 50%; @@ -1297,7 +1299,7 @@ export default { .mt0 { margin: 0; } -.mt20 { - margin-top: 20px; +.mt40 { + margin-top: 40px; } diff --git a/src/views/modules/visual/communityParty/dialogInfo.vue b/src/views/modules/visual/communityParty/dialogInfo.vue index db6d95418..c4160ff69 100644 --- a/src/views/modules/visual/communityParty/dialogInfo.vue +++ b/src/views/modules/visual/communityParty/dialogInfo.vue @@ -46,11 +46,11 @@ 活动时间: {{ info.activityTime }}
-
+
活动地址: {{ info.address }} diff --git a/src/views/modules/visual/communityParty/gridParty.vue b/src/views/modules/visual/communityParty/gridParty.vue index 180fc9382..bd73c11ca 100644 --- a/src/views/modules/visual/communityParty/gridParty.vue +++ b/src/views/modules/visual/communityParty/gridParty.vue @@ -365,6 +365,8 @@ export default { const _arr = this.selectAgency[this.selectAgency.length - 1].split('-') const orgType = _arr[1] !== 'grid' ? 'agency': 'grid' this.pageNo = 1 + this.pageSize = 10; + this.eduList = [] this.getEduList(isClick && _code || '') this.getMapData(isClick && _code || '') } @@ -496,25 +498,25 @@ export default { }, // 获取位置信息 - getMapData () { - const url = '/epmetuser/icVolunteerPoly/mapData' + async getMapData () { + const url = "/epmetuser/icVolunteerPoly/mapData" let params = { agencyId: this.agencyId, code: this.eduCode } - window.app.ajax.post( - url, - params, - (data, rspMsg) => { + const { data, code, internalMsg } = await requestPost(url, params) + if (code === 0) { this.unitMapList = data this.loadMap() this.isfirstInit = false this.$refs.map.handleClosePopup() - }, - (rspMsg, data) => { - this.$message.error(rspMsg) - } - ) + } else { + this.$message.error(internalMsg) + this.unitMapList = [] + this.loadMap() + this.isfirstInit = false + this.$refs.map.handleClosePopup() + } }, //点击项目 async clickProject (feature) { @@ -522,31 +524,40 @@ export default { const featureInfo = feature.values_.properties.info this.userId = feature.values_.properties.info.id let coordinate = [featureInfo.longitude, featureInfo.latitude] + let {name, gridName, houseName, mobile, idCard, gzdw, rhzk, icResiUser} = feature.values_.properties.info + name = name ? name : '--' + gridName = gridName ? gridName : '--' + houseName = houseName ? houseName : '--' + mobile = mobile ? mobile : '--' + idCard = idCard ? idCard : '--' + gzdw = gzdw ? gzdw : '--' + rhzk = rhzk ? rhzk : '--' let showData = `
个人信息
姓名: - `+ feature.values_.properties.info.name + ` + `+ name + `
所属网格: - `+ feature.values_.properties.info.gridName + ` + `+ gridName + `
所属房屋: - `+ feature.values_.properties.info.houseName + ` + `+ houseName + `
手机号: - `+ feature.values_.properties.info.mobile + ` + `+ mobile + `
身份证号: - `+ feature.values_.properties.info.idCard + ` + `+ idCard + `
工作单位: - `+ feature.values_.properties.info.gzdw + ` + `+ gzdw + `
人户状况: - `+ feature.values_.properties.info.rhzk + ` + `+ rhzk + `
` - this.$refs.map.handleShowPopup(showData, coordinate, true) + const isShowMore = icResiUser ? true : false + this.$refs.map.handleShowPopup(showData, coordinate, isShowMore) }, lookMore(e) { this.userId = this.userId