| | |
| | | }, |
| | | data: { |
| | | addMeterWaterInfo: { |
| | | // 地址相关字段(使用后端给的字段名) |
| | | floorNum: '', // 弄 |
| | | unitNum: '', // 门 |
| | | roomNum: '', // 室 |
| | | // 收费区间字段(使用后端给的字段名) |
| | | chargeStart: '', // 收费区间-起始日期 |
| | | chargeEtart: '', // 收费区间-终止日期 |
| | | waterId: '', |
| | | meterType: '', |
| | | preDegrees: '', |
| | |
| | | latePaymentSurcharge: '', |
| | | feePaymentStatus: '', |
| | | carryOverBalance: '', |
| | | totalPayableAmount: '' |
| | | totalPayableAmount: '', |
| | | // 其他缺失字段 |
| | | statusCd: '', |
| | | meterTypeName: '', |
| | | feeId: '', |
| | | roadName: '', |
| | | createTime: '' |
| | | } |
| | | }, |
| | | _initMethod: function () { |
| | | $that._initAddMeterWaterDateInfo(); |
| | | $that._listAddMeterTypes(); |
| | | }, |
| | | _initEvent: function () { |
| | | _initEvent: function () { |
| | | vc.on('addMeterWater', 'openAddMeterWaterModal', function (_param) { |
| | | $that.clearAddMeterWaterInfo(); |
| | | if (_param.hasOwnProperty("objType")) { |
| | |
| | | $that.addMeterWaterInfo.hasRoom = true; |
| | | $that.addMeterWaterInfo.roomId = _param.roomId; |
| | | $that.addMeterWaterInfo.objId = _param.roomId; |
| | | $that.addMeterWaterInfo.objName = _param.roomName.replace('0单元', ''); //处理商铺 |
| | | // $that.addMeterWaterInfo.objName = $that.transRoomName(_param.roomName); |
| | | // $that.addMeterWaterInfo.objName = _param.roomName.replace('0单元', ''); //处理商铺 |
| | | $that.addMeterWaterInfo.objName = $that.transRoomName(_param.roomName); |
| | | let _ownerName = _param.roomName; |
| | | if (_param.ownerName) { |
| | | _ownerName += ('(' + _param.ownerName + ')'); |
| | |
| | | if (_param.hasOwnProperty("roomId") && _param.roomId != "") { |
| | | $that.addMeterWaterInfo.roomId = _param.roomId; |
| | | $that.addMeterWaterInfo.objId = _param.roomId; |
| | | $that.addMeterWaterInfo.objName = _param.name.replace('0单元', ''); //处理商铺; |
| | | // $that.addMeterWaterInfo.objName = $that.transRoomName(_param.name); |
| | | // $that.addMeterWaterInfo.objName = _param.name.replace('0单元', ''); //处理商铺; |
| | | $that.addMeterWaterInfo.objName = $that.transRoomName(_param.name); |
| | | $that._queryPreMeterWater(_param.roomId); |
| | | } |
| | | }); |
| | |
| | | _changeAddMeterWaterFeeTypeCd: function (_feeTypeCd) { |
| | | $that.addMeterWaterInfo.secondaryFeeTypeCd = ''; |
| | | $that.addMeterWaterInfo.configId = ''; |
| | | |
| | | // 获取社区ID |
| | | let communityId = vc.getCurrentCommunity().communityId; |
| | | console.log('当前社区ID:', communityId); |
| | | |
| | | let param = { |
| | | params: { |
| | | feeTypeCd: _feeTypeCd, |
| | | feeTypeCd: _feeTypeCd |
| | | } |
| | | }; |
| | | |
| | | // 只有当社区ID有效时,才添加到参数中 |
| | | if (communityId && communityId.trim() !== '') { |
| | | param.params.communityId = communityId; |
| | | } |
| | | |
| | | console.log('请求参数:', JSON.stringify(param)); |
| | | |
| | | vc.http.apiGet('/secondaryFeeTypeCdGl.list.show', param, |
| | | function (json, res) { |
| | | let result = JSON.parse(json); |
| | | if (result.length ) { |
| | | $that.$set($that.addMeterWaterInfo, 'secondaryFeeTypeCds', result); |
| | | } else { |
| | | $that.$set($that.addMeterWaterInfo, 'secondaryFeeTypeCds', [{ |
| | | console.log('费用子类型API返回:', json); |
| | | try { |
| | | let _json = JSON.parse(json); |
| | | if (_json.length) { |
| | | $that.addMeterWaterInfo.secondaryFeeTypeCds = _json; |
| | | } else { |
| | | $that.addMeterWaterInfo.secondaryFeeTypeCds = [{ |
| | | secondaryFeeTypeCd: "", |
| | | secondaryFeeTypeName: "无关联子类型,请直接选择收费项目" |
| | | }]; |
| | | } |
| | | } catch (e) { |
| | | console.error('解析费用子类型失败:', e, json); |
| | | vc.toast('获取费用子类型失败: 数据格式错误'); |
| | | $that.addMeterWaterInfo.secondaryFeeTypeCds = [{ |
| | | secondaryFeeTypeCd: "", |
| | | secondaryFeeTypeName: "无关联子类型,请直接选择收费项目" |
| | | }]); |
| | | }]; |
| | | } finally { |
| | | // 无论费用子类型是否加载成功,都直接加载收费项目 |
| | | console.log('直接加载收费项目,费用类型:', _feeTypeCd); |
| | | $that._changeSecondaryFeeTypeCdz(_feeTypeCd, ''); |
| | | } |
| | | }, |
| | | function (errInfo, error) { |
| | | console.log('请求失败处理'); |
| | | vc.toast(errInfo); |
| | | console.error('获取费用子类型失败:', errInfo, error); |
| | | vc.toast('获取费用子类型失败: ' + errInfo); |
| | | $that.addMeterWaterInfo.secondaryFeeTypeCds = [{ |
| | | secondaryFeeTypeCd: "", |
| | | secondaryFeeTypeName: "无关联子类型,请直接选择收费项目" |
| | | }]; |
| | | // 即使费用子类型加载失败,也要加载收费项目 |
| | | console.log('费用子类型加载失败,直接加载收费项目,费用类型:', _feeTypeCd); |
| | | $that._changeSecondaryFeeTypeCdz(_feeTypeCd, ''); |
| | | } |
| | | ); |
| | | $that._changeSecondaryFeeTypeCdz(_feeTypeCd, ''); |
| | | }, |
| | | _changeSecondaryFeeTypeCdz: function (_feeTypeCd, _secondaryFeeTypeCd) { |
| | | $that.addMeterWaterInfo.configId = ''; |
| | | |
| | | // 获取社区ID |
| | | let communityId = vc.getCurrentCommunity().communityId; |
| | | console.log('当前社区ID:', communityId); |
| | | |
| | | var param = { |
| | | params: { |
| | | page: 1, |
| | | row: 20, |
| | | communityId: vc.getCurrentCommunity().communityId, |
| | | row: 50, |
| | | feeTypeCd: _feeTypeCd, |
| | | secondaryFeeTypeCd: _secondaryFeeTypeCd, |
| | | isDefault: 'F', |
| | | valid: '1' |
| | | } |
| | | }; |
| | | |
| | | // 只有当社区ID有效时,才添加到参数中 |
| | | if (communityId && communityId.trim() !== '') { |
| | | param.params.communityId = communityId; |
| | | } |
| | | |
| | | console.log('请求参数:', JSON.stringify(param)); |
| | | |
| | | //发送get请求 |
| | | vc.http.apiGet('/feeConfig.listFeeConfigs', param, |
| | | function (json, res) { |
| | | var _feeConfigManageInfo = JSON.parse(json); |
| | | $that.addMeterWaterInfo.feeConfigs = _feeConfigManageInfo.feeConfigs; |
| | | console.log('收费项目API返回:', json); |
| | | try { |
| | | var _feeConfigManageInfo = JSON.parse(json); |
| | | $that.addMeterWaterInfo.feeConfigs = _feeConfigManageInfo.feeConfigs || []; |
| | | |
| | | if ($that.addMeterWaterInfo.feeConfigs.length === 0) { |
| | | vc.toast('未找到对应收费项目,请先设置费用项目'); |
| | | } |
| | | } catch (e) { |
| | | console.error('解析收费项目失败:', e, json); |
| | | vc.toast('获取收费项目失败: 数据格式错误'); |
| | | $that.addMeterWaterInfo.feeConfigs = []; |
| | | } |
| | | }, |
| | | function (errInfo, error) { |
| | | console.log('请求失败处理'); |
| | | }); |
| | | console.error('获取收费项目失败:', errInfo, error); |
| | | vc.toast('获取收费项目失败: ' + errInfo); |
| | | $that.addMeterWaterInfo.feeConfigs = []; |
| | | } |
| | | ); |
| | | }, |
| | | _changeAddMeterType: function () { |
| | | $that._queryPreMeterWater($that.addMeterWaterInfo.roomId); |
| | |
| | | $that.addMeterWaterInfo.curDegrees = ""; |
| | | } |
| | | }, |
| | | _listAddMeterTypes: function (_page, _rows) { |
| | | _listAddMeterTypes: function (_page, _rows) { |
| | | var param = { |
| | | params: { |
| | | page: 1, |
| | |
| | | communityId: vc.getCurrentCommunity().communityId |
| | | } |
| | | }; |
| | | //发送get请求 |
| | | vc.http.apiGet('meterType.listMeterType', |
| | | |
| | | vc.http.apiGet('meterType.listMeterType', |
| | | param, |
| | | function (json, res) { |
| | | if (json) { |
| | | var _meterTypeManageInfo = JSON.parse(json); |
| | | if (_meterTypeManageInfo && $that.addMeterWaterInfo) { |
| | | $that.addMeterWaterInfo.meterTypes = _meterTypeManageInfo.data || []; |
| | | } |
| | | } |
| | | var _meterTypeManageInfo = JSON.parse(json); |
| | | $that.addMeterWaterInfo.meterTypes = _meterTypeManageInfo.data; |
| | | }, |
| | | function (errInfo, error) { |
| | | console.log('请求失败处理'); |
| | |
| | | ); |
| | | }, |
| | | clearAddMeterWaterInfo: function () { |
| | | var meterTypes = $that.addMeterWaterInfo.meterTypes || []; |
| | | |
| | | $that.addMeterWaterInfo = { |
| | | floorNum: '', // 弄 |
| | | unitNum: '', // 门 |
| | | roomNum: '', // 室 |
| | | chargeStart: '', // 收费区间-起始日期 |
| | | chargeEtart: '', // 收费区间-终止日期 |
| | | waterId: '', |
| | | meterType: '', |
| | | preDegrees: '', |
| | |
| | | objType: '3333', |
| | | hasRoom: false, |
| | | ownerName: '', |
| | | meterTypes: [], |
| | | meterTypes: meterTypes, // 保留抄表类型数据 |
| | | computingFormula: '', |
| | | price: 0, |
| | | powerSupplyBureau: '', |
| | |
| | | remark2: '', |
| | | address: '', |
| | | writeTime: '', |
| | | writer: '' |
| | | writer: '', |
| | | // 水费专用字段 |
| | | checkApplyCompanyName: '', |
| | | checkApplyDeptProject: '', |
| | | waterFeePayer: '', |
| | | accountNumber: '', |
| | | meterReadBookNo: '', |
| | | waterConsumption: '', |
| | | sewageTreatmentWater: '', |
| | | collectionStandard: '', |
| | | arrearsUnpaid: '', |
| | | latePaymentFine: '', |
| | | latePaymentSurcharge: '', |
| | | feePaymentStatus: '', |
| | | carryOverBalance: '', |
| | | totalPayableAmount: '', |
| | | // 其他缺失字段 |
| | | statusCd: '', |
| | | meterTypeName: '', |
| | | feeId: '', |
| | | roadName: '', |
| | | createTime: '' |
| | | }; |
| | | }, |
| | | changeFeeConfig: function () { |