123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405 |
- /**
- * Created by pushkeji on 2018/8/10.
- */
- angular.module('push')
- .controller('technicalCheckDetailCtrl', ['$scope', '$stateParams', 'AccountService', '$q', 'UserService', '$ionicPopup', '$ionicSlideBoxDelegate', '$timeout', 'dataToolsService', 'ConfigService',function ($scope, $stateParams, AccountService, $q, UserService, $ionicPopup, $ionicSlideBoxDelegate, $timeout,dataToolsService,ConfigService) {
- $scope.defaultLan = UserService.defaultLan;
- $scope.imageList1 = [];
- $scope.imageList2 = [];
- $scope.imageList3 = [];
- $scope.comefrom = $stateParams.comefrom;
- $scope.checkData = {};
- $scope.node = UserService.node;
- if ($scope.node == '330122000') {
- $scope.agree = 1;
- } else {
- $scope.agree = true;
- }
- $scope.org = {};
- var getTechDemandDetail = function () {
- AccountService.getTechDemandDetail($stateParams.id).then(function (res) {
- if (res.code == 3350) {
- var data = res.data;
- $scope.applyname = data.sysUsersInfo.applyname;
- $scope.certificate = data.sysUsersInfo.brokercertificate;
- $scope.tel = data.sysUsersInfo.tel;
- $scope.orgname = data.orgName;
- $scope.org.orguser = data.demandReward.orguser;
- $scope.org.orgtel = data.demandReward.orgtel;
- $scope.projectname = data.sysUsersTaskInfo.projectname;
- $scope.capitalScale = data.sysUsersTaskInfo.capitalScale;
- $scope.cooperationmodel = data.sysUsersTaskInfo.cooperationmodel;
- $scope.taskintroduction = data.sysUsersTaskInfo.taskintroduction;
- $scope.demandstatus = data.demandReward.demandstatus;
- $scope.refusereason = data.demandReward.refusereason;
- $scope.node = data.demandReward.node;
- $scope.abutList = data.companyAbutLkList;
- $scope.technical = data.technicalContractList[0];
- dataToolsService.getCooperationmodelByCode($scope.cooperationmodel).then(function (newRes) {
- if (newRes.code == 3350) {
- $scope.cooperationmodelInfo = newRes.data;
- }
- })
- angular.forEach(data.systemPictureList, function(val, index){
- if(val.title == "上传合作双方认可证明"){
- $scope.imageList1.push(val)
- }
- if(val.title == "上传发票"){
- $scope.imageList2.push(val)
- }
- if(val.title == "上传转账凭证"){
- $scope.imageList3.push(val)
- }
- })
- console.log($scope.imageList1);
- console.log($scope.imageList2);
- console.log($scope.imageList3);
- }
- })
- }
- getTechDemandDetail();
- $scope.seeTechnicalInfo = function (technical) {
- $scope.go('signDemandContractDetail', {contract: technical});
- }
- $scope.agreeClick = function () {
- if ($scope.node != '330122000') {
- $scope.agree = true;
- } else {
- $scope.agree = 1;
- }
- }
- $scope.rollClick = function () {
- $scope.agree = -2;
- }
- $scope.rejectClick = function () {
- if ($scope.node != '330122000') {
- $scope.agree = false;
- } else {
- $scope.agree = -1;
- }
- }
- $scope.checkDemandReward = function () {
- var value = 0;
- if ($scope.node != '330122000') {
- if ($scope.agree) {
- value = 1;
- } else {
- value = -1;
- }
- } else {
- if ($scope.agree == 1) {
- value = 1;
- }
- if ($scope.agree == -1) {
- value = -1;
- }
- if ($scope.agree == -2) {
- value = -2;
- }
- }
- if (value == -1 || value == -2) {
- if ($scope.checkData.refusereason == "" || $scope.checkData.refusereason == null) {
- if (value == -1) {
- $ionicPopup.alert({
- title: '确定',
- template: '请填写拒绝理由'
- });
- }
- if (value == -2) {
- $ionicPopup.alert({
- title: '确定',
- template: '请填写退回理由'
- });
- }
- return;
- }
- }
- AccountService.submitDemandReward($stateParams.id, value, $scope.checkData.refusereason).then(function (res) {
- if (res.code == 3350) {
- $scope.go('technicalRewardCheck');
- }
- })
- }
- //重置失败状态,失败原因没有实际作用(仅仅便于调一个接口)
- $scope.checkDemandRewardAgain = function () {
- AccountService.submitDemandReward($stateParams.id, 0, "1").then(function (res) {
- if (res.code == 3350) {
- $scope.go('technicalRewardCheck');
- }
- })
- }
- $scope.goOnContractInfo = function (contract) {
- $scope.go('signDemandContractDetail', {contract: contract});
- }
- $scope.bigImage = false; //初始默认大图是隐藏的
- $scope.hideBigImage = function () {
- if ($scope.app) {
- $scope.setStatusBar(0);
- }
- $scope.bigImage = false;
- }
- $scope.shouBigImage = function (outindex, innerindex) {
- if ($scope.app) {
- $scope.setStatusBar(1);
- }
- $scope.bigImageList = $scope.abutList[outindex].photoList;
- $scope.bigImage = true; //显示大图
- $(function () {
- $('div.pinch-zoom').each(function () {
- new RTP.PinchZoom($(this), {});
- });
- });
- $ionicSlideBoxDelegate.update();//重绘,让图片显示出来
- //图片总数量
- setTimeout(function () {
- $ionicSlideBoxDelegate.$getByHandle('slide_detail').slide(innerindex, 0);
- //获取图片
- var imgObj = document.getElementsByClassName('bigimage');
- var n;
- for (n = 0; n < imgObj.length; n++) {
- // 获取图片的原始高度和宽度
- var oldWid = imgObj[n].naturalWidth;
- var oldHei = imgObj[n].naturalHeight;
- var screen = document.body.offsetWidth;
- var screenH = window.innerHeight;
- // console.log(oldWid/oldHei);
- // console.log(screen );
- var rate = oldWid / oldHei;
- if (oldWid >= screen && oldHei >= screenH) {
- var tw = screen;
- var th = tw / rate;
- if (th < screenH) {
- imgObj[n].style.width = tw + 'px';
- imgObj[n].style.height = th + 'px';
- imgObj[n].style.marginTop = (screenH - th) / 2 + 'px';
- } else {
- imgObj[n].style.width = screenH * rate + 'px';
- imgObj[n].style.height = screenH + 'px';
- imgObj[n].style.marginLeft = (screen - screenH * rate) / 2 + 'px';
- }
- } else if (oldWid >= screen && oldHei <= screenH) {
- imgObj[n].style.width = screen + 'px';
- imgObj[n].style.height = screen / rate + 'px';
- imgObj[n].style.marginTop = (screenH - screen / rate) / 2 + 'px';
- } else if (oldWid <= screen && oldHei >= screenH) {
- // var hh=screenH;
- // var ww=screenH*rate;
- imgObj[n].style.width = screenH * rate + 'px';
- imgObj[n].style.height = screenH + 'px';
- imgObj[n].style.marginLeft = (screen - screenH * rate) / 2 + 'px';
- } else {
- imgObj[n].style.width = oldWid + 'px';
- imgObj[n].style.height = oldHei + 'px';
- imgObj[n].style.marginLeft = (screen - oldWid) / 2 + 'px';
- imgObj[n].style.marginTop = (screenH - oldHei) / 2 + 'px';
- }
- }
- }, 500);
- }
- $scope.shouBigImage1 = function (index,url) {
- if(url.indexOf('.pdf')!=-1){
- window.open(ConfigService.imgurl + url)
- return
- }
- if ($scope.app) {
- $scope.setStatusBar(1);
- }
- $scope.bigImageList = $scope.imageList1;
- $scope.bigImage = true; //显示大图
- $(function () {
- $('div.pinch-zoom').each(function () {
- new RTP.PinchZoom($(this), {});
- });
- });
- $ionicSlideBoxDelegate.update();//重绘,让图片显示出来
- //图片总数量
- setTimeout(function () {
- $ionicSlideBoxDelegate.$getByHandle('slide_detail').slide(index, 0);
- //获取图片
- var imgObj = document.getElementsByClassName('bigimage');
- var n;
- for (n = 0; n < imgObj.length; n++) {
- // 获取图片的原始高度和宽度
- var oldWid = imgObj[n].naturalWidth;
- var oldHei = imgObj[n].naturalHeight;
- var screen = document.body.offsetWidth;
- var screenH = window.innerHeight;
- // console.log(oldWid/oldHei);
- // console.log(screen );
- var rate = oldWid / oldHei;
- if (oldWid >= screen && oldHei >= screenH) {
- var tw = screen;
- var th = tw / rate;
- if (th < screenH) {
- imgObj[n].style.width = tw + 'px';
- imgObj[n].style.height = th + 'px';
- imgObj[n].style.marginTop = (screenH - th) / 2 + 'px';
- } else {
- imgObj[n].style.width = screenH * rate + 'px';
- imgObj[n].style.height = screenH + 'px';
- imgObj[n].style.marginLeft = (screen - screenH * rate) / 2 + 'px';
- }
- } else if (oldWid >= screen && oldHei <= screenH) {
- imgObj[n].style.width = screen + 'px';
- imgObj[n].style.height = screen / rate + 'px';
- imgObj[n].style.marginTop = (screenH - screen / rate) / 2 + 'px';
- } else if (oldWid <= screen && oldHei >= screenH) {
- // var hh=screenH;
- // var ww=screenH*rate;
- imgObj[n].style.width = screenH * rate + 'px';
- imgObj[n].style.height = screenH + 'px';
- imgObj[n].style.marginLeft = (screen - screenH * rate) / 2 + 'px';
- } else {
- imgObj[n].style.width = oldWid + 'px';
- imgObj[n].style.height = oldHei + 'px';
- imgObj[n].style.marginLeft = (screen - oldWid) / 2 + 'px';
- imgObj[n].style.marginTop = (screenH - oldHei) / 2 + 'px';
- }
- }
- }, 500);
- }
- $scope.shouBigImage2 = function (index,url) {
- if(url.indexOf('.pdf')!=-1){
- console.log( url)
- window.open(ConfigService.imgurl + url)
- return
- }
- if ($scope.app) {
- $scope.setStatusBar(1);
- }
- $scope.bigImageList = $scope.imageList2;
- $scope.bigImage = true; //显示大图
- $(function () {
- $('div.pinch-zoom').each(function () {
- new RTP.PinchZoom($(this), {});
- });
- });
- $ionicSlideBoxDelegate.update();//重绘,让图片显示出来
- //图片总数量
- setTimeout(function () {
- $ionicSlideBoxDelegate.$getByHandle('slide_detail').slide(index, 0);
- //获取图片
- var imgObj = document.getElementsByClassName('bigimage');
- var n;
- for (n = 0; n < imgObj.length; n++) {
- // 获取图片的原始高度和宽度
- var oldWid = imgObj[n].naturalWidth;
- var oldHei = imgObj[n].naturalHeight;
- var screen = document.body.offsetWidth;
- var screenH = window.innerHeight;
- // console.log(oldWid/oldHei);
- // console.log(screen );
- var rate = oldWid / oldHei;
- if (oldWid >= screen && oldHei >= screenH) {
- var tw = screen;
- var th = tw / rate;
- if (th < screenH) {
- imgObj[n].style.width = tw + 'px';
- imgObj[n].style.height = th + 'px';
- imgObj[n].style.marginTop = (screenH - th) / 2 + 'px';
- } else {
- imgObj[n].style.width = screenH * rate + 'px';
- imgObj[n].style.height = screenH + 'px';
- imgObj[n].style.marginLeft = (screen - screenH * rate) / 2 + 'px';
- }
- } else if (oldWid >= screen && oldHei <= screenH) {
- imgObj[n].style.width = screen + 'px';
- imgObj[n].style.height = screen / rate + 'px';
- imgObj[n].style.marginTop = (screenH - screen / rate) / 2 + 'px';
- } else if (oldWid <= screen && oldHei >= screenH) {
- // var hh=screenH;
- // var ww=screenH*rate;
- imgObj[n].style.width = screenH * rate + 'px';
- imgObj[n].style.height = screenH + 'px';
- imgObj[n].style.marginLeft = (screen - screenH * rate) / 2 + 'px';
- } else {
- imgObj[n].style.width = oldWid + 'px';
- imgObj[n].style.height = oldHei + 'px';
- imgObj[n].style.marginLeft = (screen - oldWid) / 2 + 'px';
- imgObj[n].style.marginTop = (screenH - oldHei) / 2 + 'px';
- }
- }
- }, 500);
- }
- $scope.shouBigImage3 = function (index,url) {
- if(url.indexOf('.pdf')!=-1){
- window.open(ConfigService.imgurl + url)
- return
- }
- if ($scope.app) {
- $scope.setStatusBar(1);
- }
- $scope.bigImageList = $scope.imageList3;
- $scope.bigImage = true; //显示大图
- $(function () {
- $('div.pinch-zoom').each(function () {
- new RTP.PinchZoom($(this), {});
- });
- });
- $ionicSlideBoxDelegate.update();//重绘,让图片显示出来
- //图片总数量
- setTimeout(function () {
- $ionicSlideBoxDelegate.$getByHandle('slide_detail').slide(index, 0);
- //获取图片
- var imgObj = document.getElementsByClassName('bigimage');
- var n;
- for (n = 0; n < imgObj.length; n++) {
- // 获取图片的原始高度和宽度
- var oldWid = imgObj[n].naturalWidth;
- var oldHei = imgObj[n].naturalHeight;
- var screen = document.body.offsetWidth;
- var screenH = window.innerHeight;
- // console.log(oldWid/oldHei);
- // console.log(screen );
- var rate = oldWid / oldHei;
- if (oldWid >= screen && oldHei >= screenH) {
- var tw = screen;
- var th = tw / rate;
- if (th < screenH) {
- imgObj[n].style.width = tw + 'px';
- imgObj[n].style.height = th + 'px';
- imgObj[n].style.marginTop = (screenH - th) / 2 + 'px';
- } else {
- imgObj[n].style.width = screenH * rate + 'px';
- imgObj[n].style.height = screenH + 'px';
- imgObj[n].style.marginLeft = (screen - screenH * rate) / 2 + 'px';
- }
- } else if (oldWid >= screen && oldHei <= screenH) {
- imgObj[n].style.width = screen + 'px';
- imgObj[n].style.height = screen / rate + 'px';
- imgObj[n].style.marginTop = (screenH - screen / rate) / 2 + 'px';
- } else if (oldWid <= screen && oldHei >= screenH) {
- // var hh=screenH;
- // var ww=screenH*rate;
- imgObj[n].style.width = screenH * rate + 'px';
- imgObj[n].style.height = screenH + 'px';
- imgObj[n].style.marginLeft = (screen - screenH * rate) / 2 + 'px';
- } else {
- imgObj[n].style.width = oldWid + 'px';
- imgObj[n].style.height = oldHei + 'px';
- imgObj[n].style.marginLeft = (screen - oldWid) / 2 + 'px';
- imgObj[n].style.marginTop = (screenH - oldHei) / 2 + 'px';
- }
- }
- }, 500);
- }
- }]);
|