/** 入驻小区 **/ (function (vc) { var DEFAULT_PAGE = 1; var DEFAULT_ROWS = 10; vc.extends({ data: { housekeepingSjServInfo: { housekeepingServs: [], total: 0, records: 1, moreCondition: false, servId: '', componentShow: 'housekeepingSjServ', housekeepingTypes: [], conditions: { repairWay: '', servName: '', hktId: '', state: '2002', createTime: '', //shopId:vc.getCurrentCommunity().shopId mallApiCode:'queryHousekeepingServBmoImpl' } } }, _initMethod: function () { $that._listHousekeepingServs(DEFAULT_PAGE, DEFAULT_ROWS); $that._listHousekeepingTypes(1,50); $that._initservSjtmentTimeInfo(); }, _initEvent: function () { vc.on('housekeepingSjServ', 'listHousekeepingServ', function (_param) { $that.housekeepingSjServInfo.componentShow ='housekeepingSjServ'; $that._listHousekeepingServs(DEFAULT_PAGE, DEFAULT_ROWS); }); vc.on('pagination', 'page_event', function (_currentPage) { $that._listHousekeepingServs(_currentPage, DEFAULT_ROWS); }); }, methods: { _listHousekeepingTypes: function (_page, _rows) { var param = { params: { page : _page, row : _rows, typeCd:1001, shopId:vc.getCurrentCommunity().shopId } }; //发送get请求 vc.http.apiGet('/housekeepingType/queryHousekeepingType', param, function (json, res) { var _housekeepingTypeManageInfo = JSON.parse(json); $that.housekeepingSjServInfo.housekeepingTypes = _housekeepingTypeManageInfo.data; }, function (errInfo, error) { console.log('请求失败处理'); } ); }, _listHousekeepingServs: function (_page, _rows) { $that.housekeepingSjServInfo.conditions.page = _page; $that.housekeepingSjServInfo.conditions.row = _rows; var param = { params: $that.housekeepingSjServInfo.conditions }; //发送get请求 vc.http.apiGet('/mall.getAdminMallOpenApi', param, function (json, res) { let _json = JSON.parse(json); $that.housekeepingSjServInfo.total = _json.total; $that.housekeepingSjServInfo.records = _json.records; $that.housekeepingSjServInfo.housekeepingServs = _json.data; console.log($that.housekeepingSjServInfo.housekeepingServs); vc.emit('pagination', 'init', { total: $that.housekeepingSjServInfo.records, dataCount: $that.housekeepingSjServInfo.total, currentPage: _page }); }, function (errInfo, error) { console.log('请求失败处理'); } ); }, _initservSjtmentTimeInfo: function () { $('.servSjtmentTime').datetimepicker({ language: 'zh-CN', fontAwesome: 'fa', format: 'yyyy-mm-dd hh:ii:ss', initTime: true, initialDate: new Date(), autoClose: 1, todayBtn: true }); $('.servSjtmentTime').datetimepicker() .on('changeDate', function (ev) { var value = $(".servSjtmentTime").val(); $that.housekeepingSjServInfo.conditions.createTime = value; }); }, _listHousekeepingServsToDay: function(){ $that.housekeepingSjServInfo.conditions.createTime = vc.dateTimeFormat(new Date().getTime()); $that._listHousekeepingServs(DEFAULT_PAGE, DEFAULT_ROWS); }, _listHousekeepingServsAll: function(){ $that.housekeepingSjServInfo.conditions.createTime = ''; $that._listHousekeepingServs(DEFAULT_PAGE, DEFAULT_ROWS); }, _openEditHousekeepingServModel: function (_housekeepingServ) { $that.housekeepingSjServInfo.componentShow = 'editHousekeepingServ'; vc.emit('editHousekeepingServ', 'openEditHousekeepingServModal', _housekeepingServ); }, _openDeleteHousekeepingServModel: function (_housekeepingServ) { vc.emit('deleteHousekeepingServ', 'openDeleteHousekeepingServModal', _housekeepingServ); }, _queryHousekeepingServMethod: function () { $that._listHousekeepingServs(DEFAULT_PAGE, DEFAULT_ROWS); }, _openAddHousekeepingFeeConfigRel: function(_servId,_servName){ vc.emit('addHousekeepingFeeConfigRel', 'openAddHousekeepingFeeConfigRelModel',{_servId,_servName}); }, _moreCondition: function () { if ($that.housekeepingSjServInfo.moreCondition) { $that.housekeepingSjServInfo.moreCondition = false; } else { $that.housekeepingSjServInfo.moreCondition = true; } } } }); })(window.vc);