| | |
| | | }, |
| | | // 导入合同数据 |
| | | _importContractData: function () { |
| | | if (vc.component.contractCreateFeeInfo.excelFile == '') { |
| | | // 检查是否选择了文件 |
| | | if (!vc.component.contractCreateFeeInfo.excelFile || vc.component.contractCreateFeeInfo.excelFile == '') { |
| | | vc.toast('请选择导入文件'); |
| | | return; |
| | | } |
| | | |
| | | |
| | | // 添加文件验证 |
| | | if (!vc.component._checkFileValid(vc.component.contractCreateFeeInfo.excelFile)) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // 构建FormData,使用后端要求的参数格式 |
| | | var param = new FormData(); |
| | | param.append('uploadFile', vc.component.contractCreateFeeInfo.excelFile); // 后端要求的文件名参数 |
| | | param.append('communityId', vc.getCurrentCommunity().communityId); // 小区编号 |
| | | param.append('importAdapt', 'importContractV2'); // 后端提供的导入适配器 |
| | | param.append('importAdapt', 'importContract'); // 后端提供的导入适配器 |
| | | param.append('userId', vc.getData('/userInfo/userId')); // 操作员工编号 |
| | | |
| | | |
| | | // 显示导入进度提示 |
| | | vc.toast('正在导入中,请稍候...'); |
| | | |
| | | // 使用后端提供的完整接口地址 |
| | | vc.http.upload( |
| | | '/callComponent/upload/assetImport/importData', // 后端指定的完整接口地址 |
| | |
| | | } |
| | | vc.toast(_json.msg || '导入失败', 10000); |
| | | } catch (e) { |
| | | console.error('导入响应解析错误:', e); |
| | | vc.toast('导入失败:数据解析错误', 10000); |
| | | } |
| | | }, |
| | | function (errInfo, error) { |
| | | console.error('导入请求失败:', errInfo, error); |
| | | vc.toast('导入失败:' + (errInfo || '网络错误'), 10000); |
| | | } |
| | | ); |
| | |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">下载模板</label> |
| | | <label class="col-sm-2 col-form-label">文件说明</label> |
| | | <div class="col-sm-10"> |
| | | 请先下载 <a href="/import/住宅物业费 导入新模板.xlsx" target="_blank">住宅物业费模板</a> |
| | | 或 <a href="/import/商铺物业费 导入新模板 .csv" target="_blank">商铺物业费模板</a> |
| | | <span>准备数据后,上传导入</span> |
| | | <span>支持 Excel (.xlsx/.xls) 或 CSV 格式文件,字段包括:流转编码、小区编码、小区名称、日期、工程内容、管理处金额、是否盖章、业委会金额、审价金额、业委会是否盖章、签报部门、基金类型-一级分类、基金类型-二级分类、幢/全体、维修类型等</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | $that._listCostDetails(page, $that.costDetailInfo.paginationInfo.rows); |
| | | }, |
| | | _downloadTemplate: function () { |
| | | // 创建下载链接 |
| | | var link = document.createElement('a'); |
| | | link.href = '/pages/property/costDetail/Z三、模版签报收支款模板.xlsx'; |
| | | link.download = '三、模版签报收支款模板.xlsx'; |
| | | link.style.display = 'none'; |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | // vc.toast('下载模板'); |
| | | // 显示费用明细字段说明 |
| | | alert('费用明细导入字段说明:\n' + |
| | | '流转编码(flowNumber)\n' + |
| | | '小区编码(projectCode)\n' + |
| | | '小区名称(projectName)\n' + |
| | | '日期(date)\n' + |
| | | '工程内容(projectContent)\n' + |
| | | '管理处金额(managementAmount)\n' + |
| | | '是否盖章(managementStamped) - 可填写“是”或“否”\n' + |
| | | '业委会金额(committeeAmount)\n' + |
| | | '审价金额(appraisalAmount)\n' + |
| | | '业委会是否盖章(committeeStamped) - 可填写“是”或“否”\n' + |
| | | '签报部门(approvalDepartment)\n' + |
| | | '基金类型-一级分类(fundTypeLevel1)\n' + |
| | | '基金类型-二级分类(fundTypeLevel2)\n' + |
| | | '幢/全体(buildingType)\n' + |
| | | '维修类型(maintenanceType)'); |
| | | }, |
| | | // 打开导入弹窗 |
| | | _importCostDetail: function () { |
| | |
| | | }, |
| | | // 导入费用明细数据 |
| | | _importCostData: function () { |
| | | if ($that.costDetailInfo.excelFile == '') { |
| | | // 检查是否选择了文件 |
| | | if (!$that.costDetailInfo.excelFile || $that.costDetailInfo.excelFile == '') { |
| | | vc.toast('请选择导入文件'); |
| | | return; |
| | | } |
| | | |
| | | |
| | | // 参照房产导入,添加文件验证 |
| | | if (!$that._checkFileValid($that.costDetailInfo.excelFile)) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // 构建FormData,使用后端要求的参数格式 |
| | | var param = new FormData(); |
| | | param.append('uploadFile', $that.costDetailInfo.excelFile); // 后端要求的文件名参数 |
| | | param.append('communityId', $that.costDetailInfo.conditions.communityId); // 小区编号 |
| | | param.append('importAdapt', 'importReportMainV2'); // 后端提供的导入适配器 |
| | | param.append('userId', vc.getData('/userInfo/userId')); // 操作员工编号 |
| | | |
| | | |
| | | // 显示导入进度提示 |
| | | vc.toast('正在导入中,请稍候...'); |
| | | |
| | | // 使用后端提供的完整费用明细数据导入接口地址 |
| | | vc.http.upload( |
| | | '/callComponent/upload/assetImport/importData', // 后端指定的完整接口地址 |
| | |
| | | } |
| | | vc.toast(_json.msg || '导入失败', 10000); |
| | | } catch (e) { |
| | | console.error('导入响应解析错误:', e); |
| | | vc.toast('导入失败:数据解析错误', 10000); |
| | | } |
| | | }, |
| | | function (errInfo, error) { |
| | | console.error('导入请求失败:', errInfo, error); |
| | | vc.toast('导入失败:' + (errInfo || '网络错误'), 10000); |
| | | } |
| | | ); |
| | |
| | | var formattedData = []; |
| | | |
| | | _data.forEach(item => { |
| | | // 处理日期格式,支持多种日期格式 |
| | | var dateValue = item['日期'] || item['date'] || ''; |
| | | if (dateValue) { |
| | | // 如果是时间戳格式,转换为日期字符串 |
| | | if (/^\d+$/.test(dateValue) && dateValue.length === 13) { |
| | | var dateObj = new Date(parseInt(dateValue)); |
| | | dateValue = vc.dateFormat(dateObj, 'yyyy-MM-dd'); |
| | | } else if (typeof dateValue === 'object' && dateValue instanceof Date) { |
| | | dateValue = vc.dateFormat(dateValue, 'yyyy-MM-dd'); |
| | | } |
| | | } |
| | | |
| | | // 格式化单个数据项 |
| | | var formattedItem = { |
| | | communityId: vc.getCurrentCommunity().communityId, |
| | | projectCode: item['项目编码'] || '', |
| | | projectName: item['项目名称'] || '', |
| | | propertyType: item['物业类型'] || '', |
| | | propertyNature: item['物业性质(高层/高层一/多层/别墅/商铺/动迁房/商场/学校/政府项目)'] || '', |
| | | buildingNo: item['门号'] || '', |
| | | roomNo: item['室号'] || '', |
| | | doorRoomNo: item['门室号'] || '', |
| | | ownerAddress: item['业主地址'] || '', |
| | | propertyOwner: item['产权人'] || '', |
| | | monthlyPropertyFee: item['物业费/月'] || '', |
| | | monthlyUnitPrice: item['每月单价 平米/元'] || '', |
| | | residentialArea: item['住宅面积'] || '', |
| | | 催缴区间起始日期: item['催缴区间-起始日期'] || '', |
| | | 催缴区间终止日期: item['催缴区间-终止日期'] || '', |
| | | amount: item['金额(元)'] || '', |
| | | firstCollector: item['第一催缴人或单位'] || '', |
| | | secondCollector: item['第二催缴人-联系人'] || '', |
| | | secondCollectorPhone: item['第二催缴人-电话'] || '', |
| | | secondCollectorAddress: item['第二催缴人-地址'] || '', |
| | | note: item['备注'] || '', |
| | | flowNumber: item['流转编码'] || item['flowNumber'] || '', |
| | | projectCode: item['小区编码'] || item['projectCode'] || '', |
| | | projectName: item['小区名称'] || item['projectName'] || '', |
| | | date: dateValue, |
| | | projectContent: item['工程内容'] || item['projectContent'] || '', |
| | | managementOfficeAmount: parseFloat(item['管理处金额'] || item['managementAmount'] || 0), |
| | | managementOfficeSeal: item['是否盖章'] === '是' || item['managementStamped'] === '是' || item['managementStamped'] === '1' ? '是' : '否', |
| | | ownersCommitteeAmount: parseFloat(item['业委会金额'] || item['committeeAmount'] || 0), |
| | | auditAmount: parseFloat(item['审价金额'] || item['appraisalAmount'] || 0), |
| | | ownersCommitteeSeal: item['业委会是否盖章'] === '是' || item['committeeStamped'] === '是' || item['committeeStamped'] === '1' ? '是' : '否', |
| | | reportDepartment: item['签报部门'] || item['approvalDepartment'] || '', |
| | | fundTypeLevel1: item['基金类型-一级分类'] || item['fundTypeLevel1'] || '', |
| | | fundTypeLevel2: item['基金类型-二级分类'] || item['fundTypeLevel2'] || '', |
| | | buildingOrAll: item['幢/全体'] || item['buildingType'] || '', |
| | | maintenanceType: item['维修类型'] || item['maintenanceType'] || '', |
| | | createTime: vc.dateFormat(new Date(), 'yyyy-MM-dd HH:mm:ss') |
| | | }; |
| | | |