diff --git a/src/views/modules/base/community/buildTable.vue b/src/views/modules/base/community/buildTable.vue index 0375a5498..2ea077f2e 100644 --- a/src/views/modules/base/community/buildTable.vue +++ b/src/views/modules/base/community/buildTable.vue @@ -3,135 +3,75 @@
- 新增楼栋 + 新增楼栋 -
+
- +
- - 导入楼栋数据 + + 导入楼栋数据
- - 导入房屋数据 + + 导入房屋数据
- 导入 + 导入
- 导出 - 批量删除 + 导出 + 批量删除
- - -
- 下载楼栋模板 + + +
+ 下载小区模板 +
+ +
+ 下载楼栋模板
-
- 下载房屋模板 + +
+ 下载房屋模板
- 导出一户一档 + 导出一户一档
-
- 智能填报 +
+ 智能填报
- 更多 + 更多
- - + + - + - + - + - + - + - + - + - + - + - + - +
- +
- - + + - - + + @@ -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; } diff --git a/src/views/modules/base/community/roomTable.vue b/src/views/modules/base/community/roomTable.vue index 5b806443d..e17aee375 100644 --- a/src/views/modules/base/community/roomTable.vue +++ b/src/views/modules/base/community/roomTable.vue @@ -3,116 +3,74 @@
- 新增房屋 + 新增房屋 -
+
- +
- - 导入房屋数据 + + 导入房屋数据
- 导入 + 导入
- 导出 + 导出 - 批量删除 + 批量删除
- - -
+ +
+ + 下载小区模板 +
+
- 下载房屋模板 + 下载楼栋模板 +
+
+ + 下载房屋模板
- 导出一户一档 + 导出一户一档
-
- 智能填报 +
+ 智能填报
- 更多 + 更多
- - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - +
- +
- - + + - + - + @@ -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; diff --git a/src/views/modules/base/resi.vue b/src/views/modules/base/resi.vue index 2c911b0f2..99932647d 100644 --- a/src/views/modules/base/resi.vue +++ b/src/views/modules/base/resi.vue @@ -341,7 +341,6 @@
@@ -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); - // 多个list合并成一个list子集 - 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 = {