jry_emergencyCtrl.js 26 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051
  1. 'use strict';
  2. app.controller('jry_emergencyCtrl', ["$scope", "i18nService", "$rootScope", "$state", "$timeout", "$interval", "$modal", "SweetAlert", "uiGridConstants", "uiGridGroupingConstants", "Restangular", "api_bpm_data", "api_text", 'moment','api_wechatfile',
  3. function($scope, i18nService, $rootScope, $state, $timeout, $interval, $modal, SweetAlert, uiGridConstants, uiGridGroupingConstants, Restangular, api_bpm_data, api_text, moment,api_wechatfile) {
  4. console.log($scope);
  5. $scope.langs = i18nService.getAllLangs();
  6. $scope.lang = 'zh-cn';
  7. i18nService.setCurrentLang($scope.lang);
  8. // $(window).resize(function() {
  9. // // console.log("1111")
  10. // });
  11. var loginUser = $rootScope.user;
  12. // var voiceurl=$rootScope.audioiIp;
  13. // delete $rootScope.user.authority;
  14. var pdKey = $state.current.pdKey;
  15. $scope.gridOptions = {};
  16. $scope.gridOptions.data = 'myData';
  17. $scope.gridOptions.enableColumnResizing = true;
  18. $scope.gridOptions.enableFiltering = false;
  19. $scope.gridOptions.enableGridMenu = true;
  20. $scope.gridOptions.enableSelectAll = true;
  21. $scope.gridOptions.enableRowSelection = true;
  22. $scope.gridOptions.showGridFooter = true;
  23. $scope.gridOptions.showColumnFooter = false;
  24. $scope.gridOptions.fastWatch = true;
  25. $scope.gridOptions.enableSorting = true;
  26. $scope.gridOptions.useExternalSorting = true;
  27. $scope.gridOptions.useExternalFiltering = false;
  28. $scope.gridOptions.useExternalPagination = true;
  29. $scope.gridOptions.paginationPageSizes = [10, 15, 20, 50, 100];
  30. $scope.gridOptions.paginationPageSize = 15;
  31. $scope.gridOptions.multiSelect = true;
  32. var mun = $scope.gridOptions.paginationPageSize;
  33. // $scope.gridOptions.rowTemplate = "<div ng-click=\"lookFunction(row)\" ng-repeat=\"(colRenderIndex, col) in colContainer.renderedColumns track by col.uid\" ui-grid-one-bind-id-grid=\"rowRenderIndex + '-' + col.uid + '-cell'\" class=\"ui-grid-cell\" ng-class=\"{ 'ui-grid-row-header-cell': col.isRowHeader }\" role=\"{{col.isRowHeader ? 'rowheader' : 'gridcell'}}\" ui-grid-cell></div>";
  34. $scope.gridOptions.rowIdentity = function(row) {
  35. return row.id;
  36. };
  37. $scope.gridOptions.getRowIdentity = function(row) {
  38. return row.id;
  39. };
  40. $scope.gridOptions.columnDefs = [
  41. {
  42. name: 'item',
  43. displayName: '序号',
  44. width: 50,
  45. cellTemplate: '<div>' +
  46. '<div class="ui-grid-cell-contents">{{row.entity.item}}</div>' +
  47. '</div>'
  48. },
  49. {
  50. name: 'alarmId',
  51. displayName: '告警ID',
  52. width: '10%',
  53. cellTemplate: '<div>' +
  54. '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.alarm.alarmId}}</div>' +
  55. '</div>'
  56. },
  57. {
  58. name: 'equipment',
  59. displayName: '告警来源',
  60. width: '10%',
  61. cellTemplate: '<div>' +
  62. '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.alarm.equipment}}</div>' +
  63. '</div>'
  64. }, {
  65. name: 'incidentDescription',
  66. displayName: '告警内容',
  67. width: '20%',
  68. cellTemplate: '<div>' +
  69. '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.alarm.alarmContent}}</div>' +
  70. '</div>'
  71. },
  72. // {
  73. // name: 'requester.name',
  74. // displayName: '故障现象报修',
  75. // width: '10%',
  76. // cellTemplate: '<div>' +
  77. // '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.alarm.alarmType}}</div>' +
  78. // '</div>'
  79. // },
  80. {
  81. name: 'alarmStatus',
  82. displayName: '告警状态',
  83. width: '8%',
  84. cellTemplate: '<div>' +
  85. '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.alarm.alarmStatus}}</div>' +
  86. '</div>'
  87. }, {
  88. name: 'state',
  89. displayName: '工单状态',
  90. width: '8%',
  91. cellTemplate: '<div>' +
  92. '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.state.name}}</div>' +
  93. '</div>'
  94. }, {
  95. name: 'address',
  96. displayName: '告警IP',
  97. width: '13%',
  98. maxWidth:'120',
  99. cellTemplate: '<div>' +
  100. '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" > {{row.entity.alarm.alarmIp}}</div>' +
  101. '</div>'
  102. }, {
  103. name: 'contactsInformation',
  104. displayName: '紧急度',
  105. width: '6%',
  106. cellTemplate: '<div>' +
  107. '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{row.entity.alarm.alarmSeverity}}</div>' +
  108. '</div>'
  109. },
  110. {
  111. name: 'createTime',
  112. displayName: '告警时间',
  113. width: '140',
  114. cellTemplate: '<div>' +
  115. '<div class="ui-grid-cell-contents" style="cursor:pointer;text-align:center" >{{grid.appScope.transferTime(row.entity.alarm.alarmActiveTime)}}</div>' +
  116. '</div>'
  117. // },
  118. // {
  119. // name: '生成事件',
  120. // width: 80,
  121. // cellTemplate: '<div class="links cl-effect-1">' +
  122. // '<a ng-click="grid.appScope.selectRowFunction(row.entity)" tooltip="新建事件" tooltip-placement="left"><i class="fa fa-pencil-square-o"></i></a>' +
  123. // '</div>'
  124. },
  125. {
  126. name: '操作',
  127. enableSorting: false,
  128. enableFiltering: false,
  129. width: 295,
  130. cellTemplate: '<wechatoperator2 item="row.entity" colobject="col">'
  131. // '<div class="links cl-effect-1 ui-grid-cell-contents pull-left" >' +
  132. // // '<a ng-click="edit()" ng-show="{{handle}}" tooltip="生成事件" tooltip-placement="left"><i class="icon iconfont icon-bianji bianjifont"></i></a>' +
  133. // '<a ng-click="edit()" ng-if="handle" class="bianjifont">建单</a>' + '<a ng-click="notAccept ()" class="bianjifont">不受理</a>' + '<a ng-click="being ()" class="bianjifont">暂不处理</a>' +
  134. // // '<a ng-click="look()" ng-show="{{!handle}}" tooltip="查看" tooltip-placement="right"><i class="ti-eye"></i></a>' +
  135. // '</div>'
  136. }
  137. ];
  138. // console.log(row);
  139. $scope.wtwt = function(row) {
  140. console.log(row)
  141. }
  142. $scope.value = 10;
  143. $scope.decrement = function(row) {
  144. $scope.value = $scope.value - 1;
  145. };
  146. $scope.transferTime = function(time) {
  147. if(time){
  148. return moment(time).format('YYYY-MM-DD HH:mm');
  149. }else{
  150. return '无';
  151. }
  152. }
  153. // $scope.record = function() {
  154. // api_text.record($rootScope.takes).then(function(data){
  155. // if(data.errno==0){
  156. // $scope.busy=false;
  157. // }
  158. // })
  159. // };
  160. $scope.gridOptions.onRegisterApi = function(gridApi) {
  161. // console.log(row);
  162. $scope.gridApi = gridApi;
  163. // var index = 0;
  164. // var oldheader = {};
  165. // gridApi.grid.sortColumn = function(gridApi) {
  166. // if (oldheader.field) {
  167. // if (oldheader.field == gridApi.field) {
  168. // // index = 0;
  169. // } else {
  170. // index = 0;
  171. // }
  172. // }
  173. // index++;
  174. // oldheader = gridApi;
  175. // var fildata = $scope.memoryfilterData;
  176. // if (index % 3 == 0) {
  177. // delete $scope.memoryfilterData.incident;
  178. // fildata = $scope.memoryfilterData;
  179. // } else if (index % 3 == 1) {
  180. // angular.extend(fildata, { 'incident': { "sort": gridApi.field } });
  181. // } else if (index % 3 == 2) {
  182. // angular.extend(fildata, { 'incident': { "sort": gridApi.field, "order": "asc" } });
  183. // }
  184. // $scope.refreshData('expand-right', fildata);
  185. // }
  186. gridApi.pagination.on.paginationChanged($scope, function(newPage, pageSize) {
  187. var filtersData = $scope.memoryfilterData;
  188. filtersData.idx = newPage - 1;
  189. filtersData.sum = pageSize;
  190. $scope.fileData.idx=newPage - 1;
  191. $scope.fileData.sum=pageSize;
  192. $scope.refreshData('expand-right', $scope.fileData);
  193. // $scope.refreshData('expand-right', {"assignee":$rootScope.user.id, "candidateGroups":$rootScope.user.group[0].id, "idx":newPage-1,"sum":pageSize});
  194. });
  195. $scope.selected = {
  196. items: []
  197. }
  198. };
  199. $scope.memoryfilterData = defaultFilterData = {
  200. // "assignee":$rootScope.user.id,
  201. // "candidateGroups":$rootScope.user.group[0].id,
  202. "idx": 0,
  203. "sum": mun,
  204. 'alarmIncident': {
  205. "state": ''
  206. }
  207. };
  208. $scope.selectRowFunction = function(data) {
  209. console.log(data)
  210. var login_requester = JSON.parse(localStorage.getItem('login_requester'));
  211. var formdata = {
  212. // 'model': {
  213. // 'incident': {
  214. // 'requester': data.requester,
  215. // 'area': data.area,
  216. // 'place': data.place,
  217. // 'houseNumber': data.address,
  218. // 'contacts': data.contacts,
  219. // 'contactsInformation': data.contactsInformation,
  220. // // 'category': data.wxIncidentClassifyDTO.category,
  221. // 'description': data.incidentDescription,
  222. // 'source': { 'id': 4 },
  223. // 'sourceType': data.sourceType,
  224. // 'fileUrl': data.fileUrl
  225. // },
  226. // 'networkInformation': data.requester,
  227. // 'flow': data.id
  228. // }
  229. 'model':{
  230. 'incident':{
  231. 'description': 'ID:'+(data.alarm.alarmId||'')+'\r\n'+ '来源:'+(data.alarm.equipment||'')+'\r\n'+ '时间:'+(data.alarm.alarmActiveTime||'')+'\r\n'+ '紧急度:'+(data.alarm.alarmSeverity||'')+'\r\n'+ '内容:'+(data.alarm.alarmContent||'')+'\r\n'+ '描述:'+(data.alarm.alarmDescription||'')+'\r\n'+ 'IP:'+(data.alarm.alarmIp||'') +'\r\n'+ '地址:'+(data.alarm.alarmLocation||'')+'\r\n',
  232. 'alarm': data.alarm
  233. }
  234. },
  235. 'alarmIncident': data
  236. }
  237. if(login_requester){
  238. formdata.model.incident.requester = login_requester;
  239. formdata.model.incident.area = login_requester.place.area;
  240. formdata.model.incident.place = login_requester.place;
  241. formdata.model.incident.contacts = login_requester.name;
  242. formdata.model.incident.contactsInformation = login_requester.mphone;
  243. formdata.model.incident.source = { 'id': 1550 };
  244. }
  245. console.log(formdata)
  246. // if (formdata.alarmIncident.state == '未建单') {
  247. // formdata.alarmIncident.state = 0;
  248. // }
  249. delete(formdata.alarmIncident.item);
  250. console.log(formdata);
  251. // if (data.requester.requesterTypeDTO && data.requester.requesterTypeDTO.id == 2) {
  252. // angular.extend(formdata.model.incident, { 'priority': { 'id': 2 } });
  253. // }
  254. if (formdata.alarmIncident.alarm.alarmExtension) {
  255. formdata.alarmIncident.alarm.alarmExtension = formdata.alarmIncident.alarm.alarmExtension.replace('{', "");
  256. formdata.alarmIncident.alarm.alarmExtension = formdata.alarmIncident.alarm.alarmExtension.replace('}', "");
  257. // formdata.alarmIncident.alarm.alarmExtension = formdata.alarmIncident.alarm.alarmExtension.replace(/,/g, '\n');
  258. }
  259. console.log(formdata);
  260. $state.go('app.incident.chart', { 'model': JSON.stringify(formdata) });
  261. };
  262. $scope.lookFunction = function(data) {
  263. var modelfile = { model: { incident: data } };
  264. // $state.go('app.incident.detail', { formKey: 'incident_back', pdKey: 'incident', dataId: data.id, taskId: data.taskId, processInstanceId: data.processInstanceId });
  265. if (data.state == "未受理") {
  266. angular.extend(modelfile.model.incident, { status: 1 })
  267. } else {
  268. angular.extend(modelfile.model.incident, { status: 0 })
  269. }
  270. $state.go('app.desk.form_editor', { formKey: 'desk_detail', service: 'api_user_data', model: JSON.stringify(modelfile) });
  271. };
  272. // $scope.followFunction = function(data){
  273. // //console.log('data='+JSON.stringify(data));
  274. // $state.go('app.detail', { formKey:'statusform', pdKey:'incident', dataId: data.id,processInstanceId: data.processInstanceId});
  275. // };
  276. $scope.onDblClick = function(row) {
  277. if(!row.entity){
  278. row.entity = angular.copy(row);
  279. }
  280. console.log(row)
  281. if (row.entity.alarm.alarmExtension) {
  282. row.entity.alarm.alarmExtension = row.entity.alarm.alarmExtension.replace('{', "");
  283. row.entity.alarm.alarmExtension = row.entity.alarm.alarmExtension.replace('}', "");
  284. row.entity.alarm.alarmExtension = row.entity.alarm.alarmExtension.replace(/,/g, '\n');
  285. }
  286. event.stopPropagation();
  287. var modelfile = { model: row.entity };
  288. // if (row.entity.state == "未受理") {
  289. // angular.extend(modelfile.model.incident, { status: 1 })
  290. // } else {
  291. // angular.extend(modelfile.model.incident, { status: 0 })
  292. // }
  293. console.log(modelfile)
  294. $state.go('app.desk.form_editor', { formKey: 'desk_emergency', service: 'api_user_data', model: JSON.stringify(modelfile) });
  295. };
  296. var defaultFilterData = {
  297. // "assignee":$rootScope.user.id,
  298. // "candidateGroups":$rootScope.user.group[0].id,
  299. "idx": 0,
  300. "sum": 15,
  301. alarmIncident: {
  302. state: '未处理',
  303. }
  304. };
  305. // if(angular.isDefined($rootScope.search)&&angular.isDefined($rootScope.search.incident)){
  306. // defaultFilterData['searchType']=$rootScope.search.incident;
  307. // $scope.searchTypes=$rootScope.search.incident;
  308. // }
  309. // if($rootScope['cmdbs']!='incident'){$rootScope.idx=1}
  310. // if(angular.isDefined($rootScope.idx)&&$rootScope.cmdbs!="false"){
  311. // $rootScope['cmdbs']='incident';
  312. // defaultFilterData.idx=$rootScope.idx-1;
  313. // }else{$rootScope.cmdbs="";}
  314. $scope.ldloading = {};
  315. // $scope.Change= function(upTypes){
  316. // if(angular.isDefined(upTypes)&&upTypes=='upincident'){
  317. // $state.go('app.problem.incident',{});
  318. // }
  319. // else if(angular.isDefined(upTypes)&&upTypes=='upchange'){
  320. // $state.go('app.change.incident',{});
  321. // }
  322. // }
  323. // $scope.submit = function(searchType) {
  324. // api_apply.wxIncidentReject(1, { "rejectRemark": "不受理" }).then(function(data) {
  325. // if (data && data.status == 200) {
  326. // SweetAlert.swal({
  327. // title: "提交成功",
  328. // text: '不受理提交成功',
  329. // type: "success",
  330. // }, function() {
  331. // $scope.reload();
  332. // });
  333. // } else {
  334. // SweetAlert.swal({
  335. // title: "提交失败",
  336. // text: '不受理提交失败',
  337. // type: "error"
  338. // });
  339. // }
  340. // });
  341. // }
  342. $scope.onChange = function(searchType) {
  343. // console.log(searchType)
  344. // $scope.searchstate = searchType;
  345. // defaultFilterData = $scope.memoryfilterData;
  346. // defaultFilterData['searchType'] = searchType;
  347. // defaultFilterData.alarmIncident.state = searchType
  348. // console.log(defaultFilterData)
  349. $scope.searchstate=searchType;
  350. $scope.fileData.alarmIncident.state=searchType;
  351. $scope.refreshData('expand-right',$scope.fileData);
  352. }
  353. $scope.refreshData = function(style, filterData) {
  354. // $scope.ldloading[style.replace('-', '_')] = true;
  355. // if (angular.isUndefined(filterData)) {
  356. // filterData = defaultFilterData;
  357. // }
  358. // console.log($scope.searchstate);
  359. // filterData.alarmIncident.state = $scope.searchstate
  360. // console.log(filterData);
  361. console.log(filterData);
  362. $scope.myData = [];
  363. $scope.gridOptions['sum'] = filterData.sum;
  364. api_bpm_data.fetchDataList("alarmIncident", filterData, 'alarmIncident').then(function(data) {
  365. console.log(data)
  366. var myData6 = Restangular.stripRestangular(data);
  367. $scope.gridOptions['totalItems'] = myData6.totalNum;
  368. $scope.myData = myData6.list;
  369. for (var i = 0; i < $scope.myData.length; i++) {
  370. $scope.myData[i]['item'] = i + 1 + filterData.idx * filterData.sum
  371. }
  372. // $scope.handle = false;
  373. // $scope.notBeing = false;
  374. // for (var i = 0; i < $scope.myData.length; i++) {
  375. // $scope.myData[i]['item'] = i + 1 + filterData.idx * filterData.sum;
  376. // // $scope.TIME = $scope.myData[i].alarm['alarmActiveTime'];
  377. // // $scope.myData[i].alarm.alarmActiveTime = moment($scope.TIME).format("YYYY-MM-DD HH:mm:ss");
  378. // console.log($scope.myData[i]['state'])
  379. // if ($scope.myData[i]['state'] == '未处理') {
  380. // $scope.handle = true;
  381. // $scope.notBeing = true;
  382. // }
  383. // else {
  384. // $scope.handle = false;
  385. // }
  386. // if ($scope.myData[i]['state'] == '暂不处理') {
  387. // $scope.notBeing = false;
  388. // $scope.handle = true;
  389. // }
  390. // }
  391. // $scope.ldloading[style.replace('-', '_')] = false;
  392. }, function() {
  393. // $scope.ldloading[style.replace('-', '_')] = false;
  394. });
  395. };
  396. $scope.dictionaryData=[];
  397. $scope.getDictionary=function(){
  398. var data={
  399. "key":"alarmincident_state",
  400. "type":"list"
  401. }
  402. api_wechatfile.getDictionary(data).then(function(res){
  403. $scope.dictionaryData=res;
  404. $scope.fileData={
  405. "idx":0,
  406. "sum":mun,
  407. "alarmIncident":{
  408. "state":$scope.dictionaryData[0]
  409. }
  410. };
  411. $scope.searchstate = $scope.dictionaryData[0];
  412. $scope.refreshData('expand-right', $scope.fileData);
  413. })
  414. } ;
  415. $scope.getDictionary();
  416. }
  417. ]);
  418. app.controller('WechatOperCtrl2', ['$rootScope', '$http', '$scope', '$modal', 'SweetAlert', '$state', 'api_bpm_data', function($rootScope, $http, $scope, $modal, SweetAlert, $state, api_bpm_data) {
  419. $scope.handle = false;
  420. var loginUser = $rootScope.user;
  421. console.log($scope.item);
  422. if ($scope.item.state.name == '未处理') {
  423. $scope.handle = true;
  424. $scope.notBeing = true;
  425. } else {
  426. $scope.handle = false;
  427. }
  428. if ($scope.item.state.name == '暂不处理') {
  429. $scope.notBeing = false;
  430. $scope.handle = true;
  431. }
  432. // if ($scope.item.alarm.alarmStatus == '恢复') {
  433. // $scope.notBeing = false;
  434. // $scope.handle = false;
  435. // }
  436. // console.log($scope.notBeing);
  437. // 查看
  438. $scope.look = function() {
  439. $scope.colobject.grid.appScope.onDblClick($scope.item);
  440. }
  441. // 处理 --wt
  442. $scope.edit = function() {
  443. $scope.colobject.grid.appScope.selectRowFunction($scope.item);
  444. // $scope.doEdit($scope.item.id);
  445. // console.log($scope.item)
  446. }
  447. // 不处理 --wt
  448. $scope.notAccept = function() {
  449. console.log($scope.item);
  450. var modalInstance = $modal.open({
  451. templateUrl: 'assets/views/desk/emergencyReason.html',
  452. controller: function($scope, $modalInstance, SweetAlert, item, $scope1, style, filterData) {
  453. $scope.ok = function() {
  454. console.log(item)
  455. console.log($scope1.colobject.grid.appScope);
  456. if ($scope.rejectRemark) {
  457. item.rejectRemark = $scope.rejectRemark;
  458. item.oprator = $rootScope.user.name;
  459. delete(item.item);
  460. console.log(item);
  461. // item.state = "不受理";
  462. item.state.id=1605;
  463. // item = { alarmIncident: item };
  464. item={"alarmIncident":item};
  465. api_bpm_data.updData("alarmIncident",item).then(function(data) {
  466. console.log(data);
  467. console.log(item)
  468. SweetAlert.swal({
  469. title: "提交成功!",
  470. confirmButtonColor: "#007AFF"
  471. });
  472. $modalInstance.dismiss('cancel');
  473. $scope1.colobject.grid.appScope.refreshData('expand-right', $scope1.colobject.grid.appScope.fileData);
  474. })
  475. } else {
  476. SweetAlert.swal({
  477. title: "不受理原因为空!",
  478. confirmButtonColor: "#007AFF"
  479. });
  480. }
  481. // $state.go('app.desk.emergency', {});
  482. };
  483. $scope.cancel = function() {
  484. $modalInstance.dismiss('cancel');
  485. };
  486. },
  487. size: 'sm',
  488. resolve: {
  489. item: function() {
  490. return $scope.item;
  491. },
  492. $scope1: function() {
  493. return $scope;
  494. },
  495. style: function() {
  496. return $rootScope.stylewt;
  497. },
  498. filterData: function() {
  499. return $rootScope.filterDatawt;
  500. }
  501. }
  502. });
  503. // $scope.colobject.grid.appScope.lookFunction($scope.item);
  504. // $scope.doEdit($scope.item.id);
  505. };
  506. // 暂不处理 --wt
  507. $scope.being = function() {
  508. console.log($scope.item);
  509. console.log($scope.colobject.grid.appScope)
  510. $scope.item.oprator = $rootScope.user.name;
  511. // $scope.item.state = '暂不处理'
  512. $scope.item.state.id=1606;
  513. delete($scope.item.item);
  514. console.log($scope.item)
  515. $scope.item = { alarmIncident: $scope.item };
  516. api_bpm_data.updData("alarmIncident",$scope.item).then(function(data) {
  517. console.log(data)
  518. if (data.status == 200) {
  519. $scope.notBeing = false;
  520. SweetAlert.swal({
  521. title: "提交成功!",
  522. confirmButtonColor: "#007AFF"
  523. });
  524. $scope.colobject.grid.appScope.refreshData('expand-right', $scope.colobject.grid.appScope.fileData);
  525. }
  526. })
  527. }
  528. console.log($scope.handle)
  529. }]);
  530. app.directive('wechatoperator2', function() {
  531. return {
  532. restrict: 'E',
  533. scope: {
  534. item: '=',
  535. colobject: '='
  536. },
  537. controller: 'WechatOperCtrl2',
  538. template: '<div class="links cl-effect-1 ui-grid-cell-contents pull-left" >' +
  539. // '<a ng-click="edit()" ng-show="{{handle}}" tooltip="生成事件" tooltip-placement="left"><i class="icon iconfont icon-bianji bianjifont"></i></a>' +
  540. '<a ng-click="look()" tooltip="查看" tooltip-placement="right">查看</a>' +
  541. '<a ng-click="edit()" ng-show="{{handle}}" class="bianjifont">建单</a>' + '<a ng-click="notAccept ()" ng-show="{{handle}}" class="bianjifont">不受理</a>' + '<a ng-click="being ()" ng-show="{{notBeing}}" class="bianjifont">暂不处理</a>' +
  542. // '<a ng-click="look()" ng-show="{{!handle}}" tooltip="查看" tooltip-placement="right"><i class="ti-eye"></i></a>' +
  543. '</div>'
  544. };
  545. });