| | |
| | | }, |
| | | methods: { |
| | | _initDate: function () { |
| | | // 年份输入框不需要特殊初始化,使用 v-model 双向绑定即可 |
| | | }, |
| | | _loadCommunityList: function () { |
| | | // 获取所有小区列表 |
| | | var communityInfos = vc.getCommunitys(); |
| | | if (communityInfos && Array.isArray(communityInfos) && communityInfos.length > 0) { |
| | | $that.costDetailInfo.communityList = communityInfos; |
| | | // 默认选择第一个小区 |
| | | $that.costDetailInfo.conditions.communityName = communityInfos[0].name; |
| | | } else { |
| | | // 如果获取不到列表,使用当前小区 |
| | | var currentCommunity = vc.getCurrentCommunity(); |
| | | if (currentCommunity && currentCommunity.name) { |
| | | $that.costDetailInfo.communityList = [currentCommunity]; |
| | | $that.costDetailInfo.conditions.communityName = currentCommunity.name; |
| | | } |
| | | } |
| | | // 加载数据 |
| | | $that._listCostDetails(DEFAULT_PAGE, DEFAULT_ROWS); |
| | | }, |
| | | _listCostDetails: function (_page, _rows) { |
| | | // 使用选中的小区名称,如果没有选中则使用当前小区名称 |
| | | var selectedCommunityName = $that.costDetailInfo.conditions.communityName || vc.getCurrentCommunity().name; |
| | | var params = { |
| | | communityName: selectedCommunityName, |
| | |
| | | row: _rows |
| | | }; |
| | | |
| | | // 添加可选查询参数 |
| | | if ($that.costDetailInfo.conditions.flowNumber) { |
| | | params.flowNumber = $that.costDetailInfo.conditions.flowNumber; |
| | | } |
| | |
| | | $that._listCostDetails(DEFAULT_PAGE, $that.costDetailInfo.paginationInfo.rows); |
| | | }, |
| | | _resetQuery: function () { |
| | | // 重置时恢复为第一个小区 |
| | | if ($that.costDetailInfo.communityList && $that.costDetailInfo.communityList.length > 0) { |
| | | $that.costDetailInfo.conditions.communityName = $that.costDetailInfo.communityList[0].name; |
| | | } else { |
| | |
| | | $that._listCostDetails(page, $that.costDetailInfo.paginationInfo.rows); |
| | | }, |
| | | _downloadTemplate: function () { |
| | | // 下载模板 |
| | | vc.toast('模板下载功能'); |
| | | }, |
| | | _importCostDetail: function () { |
| | | // 打开本地文件 |
| | | vc.toast('费用导入功能'); |
| | | }, |
| | | _addCostDetail: function () { |
| | | // 跳转到添加页面 |
| | | vc.jumpToPage('/#/pages/property/costDetail/add'); |
| | | }, |
| | | _viewCostDetail: function (_item) { |
| | | // 查看详情 |
| | | vc.jumpToPage('/#/pages/property/costDetail/detail?costDetailId=' + _item.costDetailId); |
| | | }, |
| | | _viewMore: function (_item) { |
| | | // 查看更多 |
| | | vc.jumpToPage('/#/pages/property/costDetail/more?costDetailId=' + _item.costDetailId); |
| | | }, |
| | | _editCostDetail: function (_item) { |
| | | // 编辑 |
| | | vc.jumpToPage('/#/pages/property/costDetail/edit?costDetailId=' + _item.costDetailId); |
| | | }, |
| | | _deleteCostDetail: function (_item) { |
| | |
| | | ); |
| | | }); |
| | | } else { |
| | | // 如果 vc.confirm 不存在,使用 window.confirm 作为后备方案 |
| | | if (window.confirm('确定要删除这条费用明细吗?')) { |
| | | var param = { |
| | | id: _item.costDetailId, |