TeclcontractlistCtrl.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. angular.module('push')
  2. .controller('TeclcontractlistCtrl', function ($scope, SelfcheckService,$ionicActionSheet,ConfigService,
  3. UserService, CommentService, UtilService, $timeout, CommonService) {
  4. $scope.rewardHollLists = [
  5. {title: '待初审', selected: true, type: 0},
  6. {title: '已退回', selected: false, type: 2},
  7. {title: '已通过', selected: false, type: 1},
  8. ]
  9. entrylist(0)
  10. function entrylist(type) {
  11. var params = {
  12. userId:'',
  13. status:type
  14. }
  15. SelfcheckService.getcontractlist(params).then(function (res) {
  16. console.log(res)
  17. if (res.code == 3350) {
  18. res.data.forEach((item)=>{
  19. if(item.url){
  20. item.url = JSON.parse(item.url)
  21. }
  22. })
  23. $scope.checkList = res.data;
  24. }
  25. })
  26. }
  27. $scope.shouBigImage = function (val) { //传递一个参数(图片的URl)
  28. window.open(ConfigService.imgurl + val);
  29. return;
  30. };
  31. $scope.changeSelecteds = function (index, type) {
  32. angular.forEach($scope.rewardHollLists, function (val) {
  33. val.selected = false;
  34. })
  35. $scope.rewardHollLists[index].selected = true;
  36. entrylist($scope.rewardHollLists[index].type)
  37. }
  38. $scope.onstate=function (row,type){
  39. $scope.showLoadingToastUtilEnd();
  40. let pams={
  41. id:row.id,
  42. status:type,
  43. userId:row.creater
  44. }
  45. SelfcheckService.getcontaudit(pams).then((res)=>{
  46. $scope.hideLoadingToast();
  47. console.log(res)
  48. if(res.code==3350){
  49. CommonService.prompt('操作成功');
  50. entrylist(0)
  51. }else {
  52. $ionicPopup.alert({
  53. title: '提示',
  54. template: res.message
  55. });
  56. }
  57. }).catch(function () {
  58. $ionicPopup.alert({
  59. title: '提示',
  60. template: "服务器错误"
  61. });
  62. })
  63. }
  64. });