123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- 'use strict';
- app.controller('wxDetailCtrl', ["$scope", "i18nService", "$rootScope", "$state","$stateParams", "$timeout", "$interval", "$modal", "SweetAlert", "uiGridConstants", "uiGridGroupingConstants", "Restangular", "api_bpm_data", "api_text", "api_user_data","api_wechatfile","api_bpm_domain", function($scope, i18nService, $rootScope, $state,$stateParams, $timeout, $interval, $modal, SweetAlert, uiGridConstants, uiGridGroupingConstants, Restangular, api_bpm_data, api_text, api_user_data,api_wechatfile,api_bpm_domain) {
- //保存报修主体
- $scope.repairMain = JSON.parse(sessionStorage.getItem("repair_main"));
- $scope.wxIncidentWithCmdb = JSON.parse(sessionStorage.getItem("wxIncidentWithCmdb"));//资产
- $scope.incidentWithConsumable = JSON.parse(sessionStorage.getItem("incidentWithConsumable"));//耗材
- //切换报修主体
- // $scope.repairMain.valueconfig = 2;
- $scope.model=JSON.parse($stateParams.model);
- console.log($scope.model)
- $scope.fileUrls=[];
- $scope.process=[];
- api_wechatfile.listAttachment('wechatRequesterIncident',$scope.model.id).then(function(res){
- $scope.fileUrls=res.data
- });
- if($scope.model.incident){
- api_bpm_domain.flowTracingCustom($scope.model.incident.processInstanceId).then(function(res){
- console.log(res);
- $scope.process=res.data
- })
- }
- $scope.back=function(){
- $state.go('app.desk.chart',{})
- }
- $scope.showBigImg=false;
- $scope.showBigImgCli=function(data){
- $scope.showBigImg=true;
- $scope.bigImgUrl=data
- }
- $scope.closeBigImg=function(){
- $scope.showBigImg=false
- }
- $scope.dialout = function (teleno) {
- // var gid = "@0";
- // var telephone = "9" + teleno;
- // $rootScope.callout = 2;
- // var agcount = tlwsa.tlaGetagentcount();
- // var agcountFlag = false;
- // console.log(teleno)
- // // 查询当前话机是否签入
- // for (var i = 0; i < agcount; i++) {
- // if (tlwsa.tlaGetagentwid(i) == $rootScope.phoneNumber) {
- // agcountFlag = true;
- // }
- // }
- if (localStorage.getItem('fenjiNumber')) {
- // var caller = localStorage.getItem('phoneNumber');//呼叫人
- // console.log(sessionStorage.getItem('phones'))
- // var phones = JSON.parse(sessionStorage.getItem('phones'));
- // var isHuajihao = phones.length?phones.some(v=>v == teleno):false;
- // console.log(isHuajihao)
- // if(isHuajihao){
- // tlwsa.tlaCallagc(teleno);
- // }else{
- // tlwsa.tlaCallout(teleno, caller, 0);
- // }
- // var caller = localStorage.getItem('fenjiNumber');//呼叫人
- $rootScope.toggle('off-sidebar');
- // tlwsa.tlaCallout(teleno, caller, 0);
- }else if(localStorage.getItem('hk_phone')){
- var gid = "@0";
- var telephone = '9' + teleno;
- if ($rootScope.takes) {
- $rootScope.isMask = true;
- api_text.dialout($rootScope.takes, gid, telephone).then(function (data) {
- $rootScope.isMask = false;
- if (data.errno == 0) {
- $rootScope.preStatus = $rootScope.callStatus;
- $rootScope.callStatus = 4;
- $rootScope.callout = 2;
- }else{
- new Notification("呼叫失败1!", {
- icon: './bower_components/HTML5-Desktop-Notifications/alert.ico',
- });
- }
- }, function(err){
- $rootScope.isMask = false;
- console.error('err', err);
- new Notification("呼叫失败2!", {
- icon: './bower_components/HTML5-Desktop-Notifications/alert.ico',
- });
- })
- } else {
- SweetAlert.swal({
- title: "呼叫失败",
- text: "请先签入呼叫中心!",
- type: "error",
- confirmButtonColor: "#DD6B55"
- });
- }
- } else {
- SweetAlert.swal({
- title: "呼叫失败",
- text: "请先签入呼叫中心!",
- type: "error",
- confirmButtonColor: "#DD6B55",
- });
- }
- };
- }]);
|