From da5465a5ede29f52a2610392f70930f94023175e Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Wed, 9 Mar 2022 15:43:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exportFeeImportExcel.html | 45 +++++ .../exportFeeImportExcel.js | 168 ++++++++++++++++++ public/img/logo_hc.png | Bin 0 -> 1197 bytes .../property/roomCreateFee/roomCreateFee.html | 16 +- .../property/roomCreateFee/roomCreateFee.js | 21 +-- 5 files changed, 230 insertions(+), 20 deletions(-) create mode 100644 public/components/property/exportFeeImportExcel/exportFeeImportExcel.html create mode 100644 public/components/property/exportFeeImportExcel/exportFeeImportExcel.js create mode 100644 public/img/logo_hc.png diff --git a/public/components/property/exportFeeImportExcel/exportFeeImportExcel.html b/public/components/property/exportFeeImportExcel/exportFeeImportExcel.html new file mode 100644 index 000000000..99439f30c --- /dev/null +++ b/public/components/property/exportFeeImportExcel/exportFeeImportExcel.html @@ -0,0 +1,45 @@ + \ No newline at end of file diff --git a/public/components/property/exportFeeImportExcel/exportFeeImportExcel.js b/public/components/property/exportFeeImportExcel/exportFeeImportExcel.js new file mode 100644 index 000000000..4d4b5bd35 --- /dev/null +++ b/public/components/property/exportFeeImportExcel/exportFeeImportExcel.js @@ -0,0 +1,168 @@ +(function(vc) { + vc.extends({ + data: { + exportFeeImportExcelInfo: { + communityId: vc.getCurrentCommunity().communityId, + isFloorAll: true, + isConfigAll: true, + configIds: [], + configs: [], + floorIds: [], + floors: [], + } + }, + _initMethod: function() {}, + _initEvent: function() { + vc.on('exportFeeImportExcel', 'openExportFeeImportExcelModal', function(_param) { + $that._loadExportFloors(); + $that._listExportFeeConfigs(); + $('#exportFeeImportExcelModel').modal('show'); + }); + }, + methods: { + _importData: function() { + + // 导入数据 + if (!vc.component.checkOwnerFileType(vc.component.exportFeeImportExcelInfo.excelTemplate.name.split('.')[1])) { + vc.toast('不是有效的Excel格式'); + return; + } + if (!vc.component.checkOwnerFileSize(vc.component.exportFeeImportExcelInfo.excelTemplate.size)) { + vc.toast('Excel文件大小不能超过2M'); + return; + } + var param = new FormData(); + param.append("uploadFile", vc.component.exportFeeImportExcelInfo.excelTemplate); + param.append('communityId', vc.component.exportFeeImportExcelInfo.communityId); + // param.append('feeTypeCd', vc.component.importRoomFeeInfo.feeTypeCd); + // param.append('objType', $that.importRoomFeeInfo.objType); + vc.http.upload( + 'exportFeeImportExcel', + 'importData', + param, { + emulateJSON: true, + //添加请求头 + headers: { + "Content-Type": "multipart/form-data" + } + }, + function(json, res) { + //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); + let _json = JSON.parse(json); + if (_json.code == 0) { + //关闭model + vc.toast(_json.data); + $('#exportFeeImportExcelModel').modal('hide'); + // vc.jumpToPage('/#/pages/property/listOwner') + vc.emit('room', 'listRoom', {}); + return; + } + vc.toast(_json.msg, 10000); + }, + function(errInfo, error) { + console.log('请求失败处理'); + vc.toast(errInfo, 10000); + }); + }, + clearAddFeeConfigInfo: function() { + // var _feeTypeCds = vc.component.importRoomFeeInfo.feeTypeCds; + vc.component.exportFeeImportExcelInfo = { + communityId: vc.getCurrentCommunity().communityId, + isFloorAll: true, + isConfigAll: true, + configIds: [], + configs: [], + floorIds: [], + floors: [], + }; + }, + + changeItemConfig: function() { + if ($that.exportFeeImportExcelInfo.configIds.length < $that.exportFeeImportExcelInfo.configs.length) { + $that.exportFeeImportExcelInfo.isConfigAll = false; + return; + } + $that.exportFeeImportExcelInfo.isConfigAll = true; + }, + + changeItemFloor: function() { + if ($that.exportFeeImportExcelInfo.floorIds.length < $that.exportFeeImportExcelInfo.floors.length) { + $that.exportFeeImportExcelInfo.isFloorAll = false; + return; + } + $that.exportFeeImportExcelInfo.isFloorAll = true; + }, + + _loadExportFloors: function() { + var param = { + params: { + page: 1, + row: 150, + communityId: vc.getCurrentCommunity().communityId + } + }; + + //发送get请求 + vc.http.get('listFloor', + 'list', + param, + function(json, res) { + let listFloorData = JSON.parse(json); + $that.exportFeeImportExcelInfo.floors = listFloorData.apiFloorDataVoList; + listFloorData.apiFloorDataVoList.forEach(item => { + $that.exportFeeImportExcelInfo.floorIds.push(item.floorId); + }); + }, + function(errInfo, error) { + console.log('请求失败处理'); + } + ); + }, + _listExportFeeConfigs: function() { + var param = { + params: { + page: 1, + row: 100, + communityId: vc.getCurrentCommunity().communityId + } + }; + + //发送get请求 + vc.http.get('feeConfigManage', 'list', param, + function(json, res) { + let _feeConfigManageInfo = JSON.parse(json); + $that.exportFeeImportExcelInfo.configs = _feeConfigManageInfo.feeConfigs; + + _feeConfigManageInfo.feeConfigs.forEach(item => { + $that.exportFeeImportExcelInfo.configIds.push(item.configId); + }); + + }, + function(errInfo, error) { + console.log('请求失败处理'); + }); + }, + + changeAllConfig: function() { + $that.exportFeeImportExcelInfo.configIds = []; + if (!$that.exportFeeImportExcelInfo.isConfigAll) { + return; + } + + $that.exportFeeImportExcelInfo.configs.forEach(item => { + $that.exportFeeImportExcelInfo.configIds.push(item.configId); + }); + }, + changeAllFloors: function() { + $that.exportFeeImportExcelInfo.floorIds = []; + if (!$that.exportFeeImportExcelInfo.isFloorAll) { + return; + } + + $that.exportFeeImportExcelInfo.floors.forEach(item => { + $that.exportFeeImportExcelInfo.floorIds.push(item.floorId); + }); + }, + } + }); +})(window.vc); \ No newline at end of file diff --git a/public/img/logo_hc.png b/public/img/logo_hc.png new file mode 100644 index 0000000000000000000000000000000000000000..f90ec30f6003cd76d1acc1e0b6091eda8ee1df97 GIT binary patch literal 1197 zcmeAS@N?(olHy`uVBq!ia0y~yVAKJ!16Y`WWZ;od4EDivduNKuM5aFhlv>|1L^tXJ!iS4mEz)vC4c& z>H`J_=3kyJjv*Cu-p+8$7IqXlo}Rqj_fmjxbAsc-4OId*H)?Z*S9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