angular.module('push') .controller('BusinessdataCtrl', function ($scope,SelfcheckService,$stateParams,UserService,$ionicPopup,AccountService, $timeout,$ionicModal,$ionicActionSheet,ionicDatePicker,$ionicScrollDelegate) { $scope.isShowSearchButton = true; $scope.keyfilter='' $scope.CaseDatalist =function (orgname){ $scope.showLoadingToastUtilEnd(); console.log(orgname) let params= { keyWord: this.keyfilter, org: [{code: "", name: ""}], pageNo: 0, pageSize: 0, userId: UserService.id } AccountService.getmarketgetByName(params).then(function (res){ $scope.hideLoadingToast(); console.log(res) if(res.code==3350){ $scope.list=res.data if(!res.data){ $ionicPopup.alert({ title: '提示', template: '没有当前数据!' }); } }else { $ionicPopup.alert({ title: '提示', template: res.message }); } }).catch(function (res){ $scope.hideLoadingToast(); $ionicPopup.alert({ title: '提示', template: "服务器错误" }); }) } $scope.showSearchButtonLeft = function () { $scope.isShowSearchButton = false; $timeout(function () { $(".showSearchInput").focus(); }, 300) }; $scope.clearSearch = function () { $scope.isShowSearchButton = true; $scope.keyfilter= ''; $scope.list=[] // $scope.CaseDatalist('0'); } //更新所有数据 $scope.oninputs=function (){ let params= { keyWord: "", org: [{code: "", name: ""}], pageNo: 0, pageSize: 0, userId: UserService.id } $scope.showLoadingToastUtilEnd(); AccountService.getmarketcompareAll(params).then((res)=>{ $scope.hideLoadingToast(); console.log(res) if(res.code==3350){ $ionicPopup.alert({ title: '提示', template: '导入成功' }); }else { $ionicPopup.alert({ title: '提示', template: res.message }); } }).catch(function (res){ $scope.hideLoadingToast(); $ionicPopup.alert({ title: '提示', template: "服务器错误" }); }) } $scope.clickResource=function (item){ item.isselected=!item.isselected } //导入选择数据 $scope.onimport=function (){ let params= { keyWord: "", org: [], list:[], pageNo: 0, pageSize: 0, userId: UserService.id } $scope.list.forEach((row)=>{ if(row.isselected){ params.list.push(row) } }) $scope.showLoadingToastUtilEnd(); AccountService.getmarketcompareBatch(params).then((res)=>{ $scope.hideLoadingToast(); console.log(res) if(res.code==3350){ $ionicPopup.alert({ title: '提示', template: '导入成功' }); }else { $ionicPopup.alert({ title: '提示', template: res.message }); } }).catch(function (res){ $scope.hideLoadingToast(); $ionicPopup.alert({ title: '提示', template: "服务器错误" }); }) } })