123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- 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: "服务器错误"
- });
- })
- }
- })
|