(function (vc) { vc.extends({ propTypes: { emitChooseOwner: vc.propTypes.string, emitLoadData: vc.propTypes.string }, data: { searchOwnerInfo: { owners: [], _currentOwnerName: '', roomName: '', ownerTypeCd: '1001' } }, _initMethod: function () { }, _initEvent: function () { vc.on('searchOwner', 'openSearchOwnerModel', function (_param) { $('#searchOwnerModel').modal('show'); $that._refreshSearchOwnerData(); if (_param.hasOwnProperty('ownerTypeCd')) { $that.searchOwnerInfo.ownerTypeCd = _param.ownerTypeCd; } $that._loadAllOwnerInfo(1, 10); }); vc.on('searchOwner', 'paginationPlus', 'page_event', function (_currentPage) { $that._loadAllOwnerInfo(_currentPage, 10); }); }, methods: { _loadAllOwnerInfo: function (_page, _row) { let param = { params: { page: _page, row: _row, communityId: vc.getCurrentCommunity().communityId, name: $that.searchOwnerInfo._currentOwnerName.trim(), roomName: $that.searchOwnerInfo.roomName.trim(), ownerTypeCd: $that.searchOwnerInfo.ownerTypeCd } }; //发送get请求 vc.http.apiGet('/owner.queryOwners', param, function (json) { let _json = JSON.parse(json); $that.searchOwnerInfo.owners = _json.data; vc.emit('searchOwner', 'paginationPlus', 'init', { total: _json.records, dataCount: _json.total, currentPage: _page }); }, function () { console.log('请求失败处理'); } ); }, chooseOwner: function (_owner) { vc.emit($props.emitChooseOwner, 'chooseOwner', _owner); vc.emit($props.emitLoadData, 'listOwnerData', { ownerId: _owner.ownerId }); $('#searchOwnerModel').modal('hide'); }, //查询 searchOwners: function () { $that._loadAllOwnerInfo(1, 10, $that.searchOwnerInfo._currentOwnerName); }, //重置 resetOwners: function () { $that.searchOwnerInfo.roomName = ""; $that.searchOwnerInfo._currentOwnerName = ""; $that._loadAllOwnerInfo(1, 10, $that.searchOwnerInfo._currentOwnerName); }, _refreshSearchOwnerData: function () { $that.searchOwnerInfo = { owners: [], _currentOwnerName: '', roomName: '', ownerTypeCd: '1001' } } } }); })(window.vc);