incidentCtrl.js 123 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014
  1. 'use strict';
  2. app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScope", "$state", "$timeout", "moment", "$interval", "$modal", "$stateParams", "SweetAlert", "uiGridConstants", "uiGridGroupingConstants", "Restangular", "api_bpm_domain", "api_text", "api_bpm_data", "api_user_data", "api_configure_data", '$parse', "$injector", "$aside", 'toaster', "api_configure_form", "api_cmdb", 'api_bpm', 'api_wechatfile','api_search_area', function ($scope, $http, i18nService, $rootScope, $state, $timeout, moment, $interval, $modal, $stateParams, SweetAlert, uiGridConstants, uiGridGroupingConstants, Restangular, api_bpm_domain, api_text, api_bpm_data, api_user_data, api_configure_data, $parse, $injector, $aside, toaster, api_configure_form, api_cmdb, api_bpm, api_wechatfile,api_search_area) {
  3. //保存报修主体
  4. $scope.repairMain = JSON.parse(sessionStorage.getItem("repair_main"));
  5. // ----------------分割线 start-----------------
  6. console.log($state)
  7. // 故障地点下拉
  8. // $scope.addressModel = '';//文本输入内容
  9. $scope.address_arr = [];//故障地点所有数据
  10. $scope.addressFlag = false;//默认下拉框列表隐藏
  11. //点击文本框
  12. $scope.addressClickHandle = function () {
  13. $scope.searchkeys.houseNumber = $scope.searchkeys.houseNumber === undefined?'':$scope.searchkeys.houseNumber;
  14. $scope.getDepartmentList();
  15. angular.element('#bx_address_ul').scrollTop(0);
  16. }
  17. //修改文字,实时监听
  18. $scope.addressChangeHandle = _.debounce(function () {
  19. $scope.getDepartmentList();
  20. angular.element('#bx_address_ul').scrollTop(0);
  21. }, 500)
  22. //获取故障地点seimin
  23. $scope.getDepartmentList = function () {
  24. api_search_area.getAreaList({ "searchKey": $scope.searchkeys.houseNumber })
  25. .then(res => {
  26. if (res.state == 200) {
  27. $scope.address_arr = res.result;
  28. $scope.addressFlag = true;//显示
  29. }
  30. })
  31. .catch(err => {
  32. console.log(err);
  33. })
  34. }
  35. //下拉框列表选中
  36. $scope.addressItemClick = function (obj) {
  37. $scope.addressFlag = false;//隐藏
  38. $scope.searchkeys.houseNumber = obj.place ? obj.area.area + obj.place : obj.area;//文本框赋值
  39. }
  40. //点击空白处隐藏
  41. angular.element(document).on('click', function (e) {
  42. if (e.target !== angular.element('#bx_address').get(0)) {
  43. $scope.addressFlag = false;//隐藏
  44. }
  45. })
  46. // -----------------分割线 end----------------
  47. // 是否逾期seimin
  48. $scope.selectType = [
  49. { id: '2', name: '是' },
  50. { id: '0', name: '否' }
  51. ];
  52. // /是否逾期
  53. $scope.langs = i18nService.getAllLangs();
  54. $scope.lang = 'zh-cn';
  55. i18nService.setCurrentLang($scope.lang);
  56. $scope.myData = [];
  57. var loginUser = $rootScope.user;
  58. console.log(loginUser);
  59. $scope.daochu = false;
  60. for (var i = 0; i < loginUser.menu.length; i++) {
  61. if (loginUser.menu[i].link == "shijianliebiao_daochu") {
  62. $scope.daochu = true
  63. }
  64. }
  65. var loginuserGroup = "";
  66. for (var i = 0; i < $rootScope.user.group.length; i++) {
  67. if (i == 0) {
  68. loginuserGroup = $rootScope.user.group[i].id;
  69. } else {
  70. loginuserGroup = loginuserGroup + "," + $rootScope.user.group[i].id;
  71. }
  72. }
  73. //新增事件seimin
  74. $scope.goToAddIncident = function () {
  75. $state.go('app.incident.editor', {});
  76. }
  77. //全部事件权限
  78. // $scope.allright = false;
  79. // $scope.allrightnot = true;
  80. // for (var obj in $rootScope.user.role) {
  81. // if ($rootScope.user.role[obj].rolecode == 'incident manager' || $rootScope.user.role[obj].rolecode == 'call center') {
  82. // $scope.allright = true;
  83. // $scope.allrightnot = false;
  84. // }
  85. // }
  86. // 处理人,受理人,转派人
  87. var acceptUser;
  88. var pdKey = $state.current.pdKey;
  89. $scope.gridOptions = {};
  90. $scope.gridOptions.data = 'myData';
  91. $scope.gridOptions.enableColumnResizing = true;
  92. $scope.gridOptions.enableFiltering = false;
  93. $scope.gridOptions.enableGridMenu = true;
  94. $scope.gridOptions.enableSelectAll = true;
  95. $scope.gridOptions.enableRowSelection = true;
  96. $scope.gridOptions.showGridFooter = true;
  97. $scope.gridOptions.showColumnFooter = false;
  98. $scope.gridOptions.fastWatch = true;
  99. $scope.gridOptions.enableSorting = true;
  100. $scope.gridOptions.useExternalSorting = true;
  101. $scope.gridOptions.useExternalFiltering = false;
  102. $scope.gridOptions.useExternalPagination = true;
  103. $scope.gridOptions.paginationPageSizes = [10, 20, 50, 100];
  104. $scope.gridOptions.paginationPageSize = 10;
  105. $scope.gridOptions.multiSelect = true;
  106. var mun = $scope.gridOptions.paginationPageSize;
  107. $scope.gridOptions.rowTemplate = "<div ng-click=\"onDblClick(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>";
  108. $scope.gridOptions.rowIdentity = function (row) {
  109. return row.id;
  110. };
  111. $scope.gridOptions.getRowIdentity = function (row) {
  112. return row.id;
  113. };
  114. $scope.states = [
  115. {
  116. id: "all",
  117. name: '全部的事件'
  118. },
  119. {
  120. id: "todo",
  121. name: '待我处理的事件'
  122. },
  123. {
  124. id: "create",
  125. name: '我创建的事件'
  126. },
  127. {
  128. id: "done",
  129. name: '我处理过的事件'
  130. }
  131. ];
  132. // for (var obj = 0; obj < $rootScope.user.role.length; obj++) {
  133. // if ($rootScope.user.role[obj].rolecode == 'incident manager' || $rootScope.user.role[obj].rolecode == 'call center') {
  134. // $scope.states = [
  135. // { id: "all", name: '全部的事件' },
  136. // { id: "todo", name: '待我处理的事件' },
  137. // { id: "create", name: '我创建的事件' },
  138. // { id: "done", name: '我处理过的事件' }
  139. // ];
  140. // }
  141. // }
  142. $scope.transferColor = function (item) {
  143. var color = "icon iconfont icon-zhengchang greenfont";
  144. if (item.colourInfo) {
  145. if (item.colourInfo.id == 1583) {
  146. color = "icon iconfont icon-yiyuqi redfont";
  147. } else if (item.colourInfo.id == 1584) {
  148. color = "iconfont icon-yuqixinxiu orangefont";
  149. }
  150. }
  151. return color;
  152. }
  153. $scope.transfertip = function (item) {
  154. var tip = "正常";
  155. if (item.colourInfo) {
  156. if (item.colourInfo.id == 1583) {
  157. tip = "已逾期";
  158. } else if (item.colourInfo.id == 1584) {
  159. tip = "即将逾期";
  160. } else if (item.colourInfo.id == 1586) {
  161. tip = "正常";
  162. }
  163. } else {
  164. // color = "white";
  165. }
  166. return tip;
  167. }
  168. $scope.transferstatus = function (item) {
  169. var statecolor = "#fc4c58";
  170. if (item.id == 2) { //待处理
  171. statecolor = "#fc4c58";
  172. } else if (item.id == 7) { //待审核
  173. statecolor = "#fcb44c";
  174. } else if (item.id == 3) { //请求重新指派
  175. statecolor = "#ebf902";
  176. } else if (item.id == 4) { //处理中
  177. statecolor = "#0aa5f5";
  178. } else if (item.id == 5) { //已解决
  179. statecolor = "#2edbb8";
  180. } else if (item.id == 6) { //已关闭
  181. statecolor = "#bbbbbb";
  182. }
  183. return statecolor;
  184. }
  185. if($scope.repairMain.valueconfig == 1){//报修人
  186. $scope.gridOptions.columnDefs = [
  187. {
  188. name: 'id',
  189. displayName: '',
  190. width: 35,
  191. cellTemplate: '<div>' +
  192. '<div class="ui-grid-cell-contents" tooltip={{grid.appScope.transfertip(row.entity)}} tooltip-placement="right"><i style="font-size: 18px !important;" class="{{grid.appScope.transferColor(row.entity)}}"></i></div></div>' +
  193. '</div>'
  194. },
  195. {
  196. name: 'item',
  197. displayName: '序号',
  198. width: 45,
  199. cellTemplate: '<div>' +
  200. '<div class="ui-grid-cell-contents">{{row.entity.item}}</div>' +
  201. '</div>'
  202. },
  203. {
  204. name: 'incidentsign',
  205. displayName: '事件单号',
  206. width: 120,
  207. cellTemplate: '<div>' +
  208. '<div class="ui-grid-cell-contents">{{row.entity.incidentsign}}</div>' +
  209. '</div>'
  210. },
  211. {
  212. name: 'requester.name',
  213. displayName: '报修人',
  214. width: '6%',
  215. minWidth: '90',
  216. enableSorting: false,
  217. cellTemplate: '<div>' +
  218. '<div class="ui-grid-cell-contents" >{{row.entity.requester.name}}</div>' +
  219. '</div>'
  220. },
  221. {
  222. name: 'contactsInformation',
  223. displayName: '联系电话',
  224. width: '105',
  225. cellTemplate: '<div>' +
  226. '<div class="ui-grid-cell-contents">{{row.entity.contactsInformation}}</div>' +
  227. '</div>'
  228. },
  229. {
  230. name: 'category',
  231. displayName: '事件分类',
  232. width: '10%',
  233. enableSorting: false,
  234. cellTemplate: '<div>' +
  235. '<div class="ui-grid-cell-contents">{{row.entity.category.category}}</div>' +
  236. '</div>'
  237. },
  238. {
  239. name: 'houseNumber',
  240. displayName: '区域地点',
  241. width: '14%',
  242. enableFiltering: false,
  243. cellTemplate: '<div><div class="ui-grid-cell-contents">{{grid.appScope.areaplace(row.entity)}}</div></div>'
  244. },
  245. {
  246. name: 'acceptUser.name',
  247. displayName: '受理人',
  248. width: '7%',
  249. minWidth: '80',
  250. enableSorting: false,
  251. cellTemplate: '<div>' +
  252. '<div class="ui-grid-cell-contents" >{{row.entity.acceptUser.name}}</div>' +
  253. '</div>'
  254. },
  255. {
  256. name: 'acceptDate',
  257. displayName: '登记时间',
  258. width: '10%',
  259. minWidth: '140',
  260. enableFiltering: false,
  261. cellTemplate: '<div><div class="ui-grid-cell-contents">{{grid.appScope.transferTime(row.entity.acceptDate)}}</div></div>'
  262. },
  263. {
  264. name: 'groupORHandlerUser',
  265. displayName: '处理人/组',
  266. width: '10%',
  267. enableFiltering: false,
  268. cellTemplate: '<div>' +
  269. '<div class="ui-grid-cell-contents">' +
  270. '{{row.entity.groupORHandlerUser}}</div>' +
  271. '</div>'
  272. },
  273. {
  274. name: 'state.name',
  275. displayName: '状态',
  276. width: '7%',
  277. minWidth: '70',
  278. enableSorting: false,
  279. cellTemplate: '<div>' +
  280. '<div class="ui-grid-cell-contents" >{{row.entity.state.name}}</div>' +
  281. '</div>'
  282. },
  283. {
  284. name: '操作',
  285. enableSorting: false,
  286. width: 400,
  287. cellTemplate: '<incidentoperator style="background-color:{{row.entity.colourInfo.rgb}}" item="row.entity" colobject="col">',
  288. enableFiltering: false
  289. },
  290. ];
  291. }else if($scope.repairMain.valueconfig == 2){//报修科室
  292. $scope.gridOptions.columnDefs = [
  293. {
  294. name: 'id',
  295. displayName: '',
  296. width: 35,
  297. cellTemplate: '<div>' +
  298. '<div class="ui-grid-cell-contents" tooltip={{grid.appScope.transfertip(row.entity)}} tooltip-placement="right"><i style="font-size: 18px !important;" class="{{grid.appScope.transferColor(row.entity)}}"></i></div></div>' +
  299. '</div>'
  300. },
  301. {
  302. name: 'item',
  303. displayName: '序号',
  304. width: 45,
  305. cellTemplate: '<div>' +
  306. '<div class="ui-grid-cell-contents">{{row.entity.item}}</div>' +
  307. '</div>'
  308. },
  309. {
  310. name: 'incidentsign',
  311. displayName: '事件单号',
  312. width: 120,
  313. cellTemplate: '<div>' +
  314. '<div class="ui-grid-cell-contents">{{row.entity.incidentsign}}</div>' +
  315. '</div>'
  316. },
  317. {
  318. name: 'department.dept',
  319. displayName: '报修科室',
  320. width: '6%',
  321. minWidth: '90',
  322. enableSorting: false,
  323. cellTemplate: '<div>' +
  324. '<div class="ui-grid-cell-contents" >{{row.entity.department.dept}}</div>' +
  325. '</div>'
  326. },
  327. {
  328. name: 'department.phone',
  329. displayName: '联系电话',
  330. width: '105',
  331. cellTemplate: '<div>' +
  332. '<div class="ui-grid-cell-contents">{{row.entity.department.phone}}</div>' +
  333. '</div>'
  334. },
  335. {
  336. name: 'category',
  337. displayName: '事件分类',
  338. width: '10%',
  339. enableSorting: false,
  340. cellTemplate: '<div>' +
  341. '<div class="ui-grid-cell-contents">{{row.entity.category.category}}</div>' +
  342. '</div>'
  343. },
  344. {
  345. name: 'houseNumber',
  346. displayName: '故障地点',
  347. width: '14%',
  348. enableFiltering: false,
  349. cellTemplate: '<div><div class="ui-grid-cell-contents">{{row.entity.houseNumber}}</div></div>'
  350. },
  351. {
  352. name: 'acceptUser.name',
  353. displayName: '受理人',
  354. width: '7%',
  355. minWidth: '80',
  356. enableSorting: false,
  357. cellTemplate: '<div>' +
  358. '<div class="ui-grid-cell-contents" >{{row.entity.acceptUser.name}}</div>' +
  359. '</div>'
  360. },
  361. {
  362. name: 'acceptDate',
  363. displayName: '登记时间',
  364. width: '10%',
  365. minWidth: '140',
  366. enableFiltering: false,
  367. cellTemplate: '<div><div class="ui-grid-cell-contents">{{grid.appScope.transferTime(row.entity.acceptDate)}}</div></div>'
  368. },
  369. {
  370. name: 'groupORHandlerUser',
  371. displayName: '处理人/组',
  372. width: '10%',
  373. enableFiltering: false,
  374. cellTemplate: '<div>' +
  375. '<div class="ui-grid-cell-contents">' +
  376. '{{row.entity.groupORHandlerUser}}</div>' +
  377. '</div>'
  378. },
  379. {
  380. name: 'state.name',
  381. displayName: '状态',
  382. width: '7%',
  383. minWidth: '70',
  384. enableSorting: false,
  385. cellTemplate: '<div>' +
  386. '<div class="ui-grid-cell-contents" >{{row.entity.state.name}}</div>' +
  387. '</div>'
  388. },
  389. {
  390. name: '操作',
  391. enableSorting: false,
  392. width: 400,
  393. cellTemplate: '<incidentoperator style="background-color:{{row.entity.colourInfo.rgb}}" item="row.entity" colobject="col">',
  394. enableFiltering: false
  395. },
  396. ];
  397. }
  398. $scope.value = 10;
  399. $scope.decrement = function () {
  400. $scope.value = $scope.value - 1;
  401. };
  402. $scope.record = function () {
  403. api_text.record($rootScope.takes).then(function (data) {
  404. if (data.errno == 0) {
  405. $scope.busy = false;
  406. }
  407. })
  408. };
  409. $scope.transferTime = function (time) {
  410. return moment(time).format('YYYY-MM-DD HH:mm');
  411. }
  412. $scope.parameters = null;
  413. $scope.open = function ($event) {
  414. $event.preventDefault();
  415. $event.stopPropagation();
  416. $scope.opened = !$scope.opened;
  417. };
  418. $scope.endOpen = function ($event) {
  419. $event.preventDefault();
  420. $event.stopPropagation();
  421. $scope.startOpened = false;
  422. $scope.endOpened = !$scope.endOpened;
  423. };
  424. $scope.startOpen = function ($event) {
  425. $event.preventDefault();
  426. $event.stopPropagation();
  427. $scope.endOpened = false;
  428. $scope.startOpened = !$scope.startOpened;
  429. };
  430. $scope.othcode = {};
  431. $scope.searchkeys = {};
  432. // $scope.searchkeys = {selectType:{id:2,name:'是'}};//seimin
  433. // 事件分类
  434. var apple_selected, tree, treedata_avm, treedata_geography;
  435. $scope.my_tree_handler = function (branch) {
  436. //var _ref;
  437. var classify = $scope.classify = branch.prefix.toLowerCase() + branch.sign;
  438. api_cmdb.query({ 'sign': classify }).then(function (data) {
  439. var myData = Restangular.stripRestangular(data);
  440. // console.log(myData.data.node);
  441. if (myData.data && myData.status == 200) {
  442. var ret = myData.data;
  443. redrawSvg(myData);
  444. }
  445. });
  446. };
  447. $scope.my_data = [];
  448. function convertListToTree(data, treeMap) {
  449. var idToNodeMap = {}; //Keeps track of nodes using id as key, for fast lookup
  450. var root = null; //Initially set our loop to null
  451. var parentNode = null;
  452. //loop over data
  453. for (var i = 0; i < data.length; i++) {
  454. var datum = data[i];
  455. //each node will have children, so let's give it a "children" poperty
  456. datum.children = [];
  457. //add an entry for this node to the map so that any future children can
  458. //lookup the parent
  459. idToNodeMap[datum.id] = datum;
  460. //Does this node have a parent?
  461. if (typeof datum.parent === "undefined" || datum.parent == null) {
  462. //Doesn't look like it, so this node is the root of the tree
  463. root = datum;
  464. treeMap[datum.id] = root;
  465. } else {
  466. //This node has a parent, so let's look it up using the id
  467. parentNode = idToNodeMap[datum.parent.id];
  468. //We don't need this property, so let's delete it.
  469. delete datum.parent;
  470. //Let's add the current node as a child of the parent node.
  471. parentNode.children.push(datum);
  472. }
  473. }
  474. return root;
  475. }
  476. function convertParentToChildList(data) {
  477. var treeMap = {};
  478. var list = [];
  479. convertListToTree(data, treeMap);
  480. angular.forEach(treeMap, function (item) {
  481. list.push(item);
  482. });
  483. return list;
  484. }
  485. $scope.my_tree = tree = {};
  486. // $scope.try_async_load = function() {
  487. // $scope.my_data = [];
  488. // $scope.select_treedata = [];
  489. // $scope.doing_async = true;
  490. // api_configure_data.fetchDataList('ciclassify', { 'idx': 0, 'sum': 100 }).then(function(result) {
  491. // $scope.my_tree = result['list'];
  492. // $scope.select_treedata = $scope.my_data = convertParentToChildList(result['list']);
  493. // $scope.doing_async = false;
  494. // // tree.expand_all();
  495. // //console.log(treelist);
  496. // });
  497. // };
  498. $scope.select_treedata = [];
  499. $scope.propTypeOptions = [];
  500. // $scope.try_async_load();
  501. // $scope.onFilterCallback = function(item) {
  502. // console.log(item);
  503. // if (angular.isDefined(item.children) && item.children.length >= 1) {
  504. // //not valid
  505. // } else {
  506. // var tempclassify = (item.item?item.item.prefix.toLowerCase():item.prefix.toLowerCase()) + (item.item?item.item.sign:item.sign);
  507. // $scope.gridApi.grid.options.paginationCurrentPage = 1;
  508. // $scope.cifilter_classic = tempclassify;
  509. // var memoryfilterData = {
  510. // "sign": tempclassify,
  511. // "idx": 0,
  512. // "sum": $scope.gridOptions.paginationPageSize
  513. // }
  514. // angular.extend($scope.memoryfilterData, memoryfilterData);
  515. // $scope.fileData["sign"]=tempclassify;
  516. // // $scope.memoryfilterData=memoryfilterData;
  517. // $scope.refreshData('expand-right', $scope.fileData);
  518. // // 专有属性
  519. // api_configure_form.renderTabForm(tempclassify).then(function(data) {
  520. // var myData = Restangular.stripRestangular(data);
  521. // angular.forEach(myData, function(item, index) {
  522. // if (index == 0) {
  523. // $scope.propTypeOptions = myData[0].form.fields;
  524. // } else {
  525. // angular.forEach(item.form.fields, function(itemdata) {
  526. // $scope.propTypeOptions.push(itemdata)
  527. // })
  528. // }
  529. // })
  530. // // $scope.propTypeOptions = myData[2].form.fields;
  531. // console.log($scope.propTypeOptions)
  532. // });
  533. // }
  534. // }
  535. // 报修科室
  536. $scope.getDept = function (key) {
  537. var postData = {
  538. "idx": 0,
  539. "sum": 10
  540. }
  541. if (key) {
  542. postData.department = { dept: key }
  543. }
  544. api_user_data.fetchDataList('department', postData).then(function (response) {
  545. if (response) {
  546. if (response.status = 200) {
  547. $scope.department = response.list;
  548. }
  549. }
  550. })
  551. }
  552. $scope.getDept();
  553. var apple_selected, tree, treedata_avm, treedata_geography;
  554. $scope.my_tree_handler = function (branch) {
  555. //var _ref;
  556. var classify = $scope.classify = branch.prefix.toLowerCase() + branch.sign;
  557. api_cmdb.query({
  558. 'sign': classify
  559. }).then(function (data) {
  560. var myData = Restangular.stripRestangular(data);
  561. // console.log(myData.data.node);
  562. if (myData.data && myData.status == 200) {
  563. var ret = myData.data;
  564. redrawSvg(myData);
  565. }
  566. });
  567. };
  568. //树形图
  569. // $scope.inspecttype = {};
  570. // 将事件分类搜索结果返回的数据整理成children模式
  571. function transform(nodes) {
  572. var treeConverter = {
  573. result: null, //转化后的结果,是根节点,所有节点都是从根节点长出来的
  574. attributeName: 'id', //节点唯一标识符
  575. needFind: true, //是否查询节点在result中已经存在,为了优化效率
  576. transform: function (node) { //转化递归函数,参数:一个待插入节点
  577. if (node.parent != null) { //该节点有父节点
  578. var newNode = this.transform(node.parent); //递归进入,返回值为一个节点,用作父节点,该父节点必然存在于result中,这点由下面的算法可以控制
  579. if (this.needFind) {
  580. for (var i = 0; i < newNode.children.length; i++) { //查找要插入的node子节点是否在newNode这个父节点中存在
  581. if (newNode.children[i][this.attributeName] === node[this.attributeName]) {
  582. return newNode.children[i]; //存在的话直接返回newNode父节点内的该子节点,该子节点必然存在于result中,作为返回值它将被用作上级递归的newNode,因此newNode必然存在于result中
  583. }
  584. }
  585. }
  586. this.needFind = false; //不存在的话,关闭之后递归的循环判断,因为待插入node节点不存在于result中,故而它的子节点一定不存在于result中,不用再循环判断
  587. // delete node.parent; //删除该节点的parent属性,如果有的话
  588. node.children = []; //因为确定是要新插入的节点,没有children:[]属性,故给该节点增加children:[]属性
  589. newNode.children.push(node); //将该node节点push进newNode的子节点数组中
  590. return node; //return该新插入节点,作为递归返回值给上层,用作newNode父节点,node存在于result中故newNode存在于result中
  591. } else if (node.parent == null) { //该叶节点没有父节点,即为根节点
  592. // delete node.parent; //删除该节点的parent属性,如果有的话
  593. if (this.result == null) { //根节点不存在
  594. node.children = []; //给该节点增加children:[]属性
  595. return this.result = node; //该节点赋给result,并return根节点,作为返回值它将被用作上级递归的newNode,因此newNode必然存在于result中
  596. } else {
  597. node.children = [];
  598. // 顶级去重
  599. for (var i = 0; i < this.result.children.length; i++) {
  600. if (this.result.children[i][this.attributeName] === node[this.attributeName]) {
  601. return this.result.children[i];
  602. }
  603. }
  604. this.result.children.push(node)
  605. return node // 直接return根节点,作为返回值它将被用作上级递归的newNode,因此newNode必然存在于result中
  606. }
  607. }
  608. },
  609. getWhole: function (nodes, attributeName) { //传入整个叶子节点数组,attributeName作为节点唯一标识符属性,返回整个转化结果
  610. var _node = {};
  611. _node.children = [];
  612. this.result = _node; //重置根节点
  613. this.attributeName = attributeName == null ? 'id' : attributeName; //唯一标识符默认为“id”
  614. nodes = JSON.parse(JSON.stringify(nodes)); //复制出一个新的节点对象作为参数,保证不改变原有数据
  615. nodes.forEach(item => { //循环调用转化方法
  616. this.needFind = true; //重置开启节点是否已存在判断,保证不插入重复节点
  617. this.transform(item);
  618. })
  619. return this.result; //返回根节点
  620. }
  621. }
  622. var result = treeConverter.getWhole(nodes); //调用
  623. return result;
  624. }
  625. $scope.my_tree = {};
  626. $rootScope.bala1 = $scope.try_async_load = function (s, fn) {
  627. if (s) {
  628. var filterKeyword = s.filterKeyword;
  629. }
  630. var postData = {
  631. "idx": 0,
  632. "sum": 1000
  633. }
  634. if (filterKeyword) {
  635. postData.incidentcategory = { selectType: "pinyin_qs", category: filterKeyword }
  636. }
  637. $scope.my_data = [];
  638. $scope.doing_async = true;
  639. api_bpm_data.fetchDataList('incidentcategory', postData).then(function (response) {
  640. if (response.status == 200) {
  641. var data = response.list;
  642. if (filterKeyword) {
  643. data.forEach(e => {
  644. e.isExpanded = true;
  645. })
  646. var li = transform(data).children;
  647. console.log(li)
  648. fn(li)
  649. return;
  650. } else {
  651. var objects = [];
  652. for (var i = 0; i < data.length; i++) {
  653. var object = {};
  654. object.id = data[i].id;
  655. object.parent = data[i].parent;
  656. // if (data[i].parent && data[i].parent.id != 0) {
  657. // object.parent = data[i].parent.id;
  658. // }
  659. object.category = data[i].category;
  660. object.isExpanded = true;
  661. objects.push(object);
  662. }
  663. $scope.my_data = convertParentToChildList(objects);
  664. $scope.select_treedata = angular.copy($scope.my_data);
  665. }
  666. if ($scope.my_data.length > 0) {
  667. $scope.doing_async = false;
  668. }
  669. } else {
  670. SweetAlert.swal({
  671. title: "系统错误!",
  672. text: "请刷新重试!",
  673. type: "error"
  674. });
  675. }
  676. });
  677. };
  678. $scope.my_data = [];
  679. function convertListToTree(data, treeMap) {
  680. var idToNodeMap = {}; //Keeps track of nodes using id as key, for fast lookup
  681. var root = null; //Initially set our loop to null
  682. var parentNode = null;
  683. //loop over data
  684. for (var i = 0; i < data.length; i++) {
  685. var datum = data[i];
  686. //each node will have children, so let's give it a "children" poperty
  687. datum.children = [];
  688. //add an entry for this node to the map so that any future children can
  689. //lookup the parent
  690. idToNodeMap[datum.id] = datum;
  691. //Does this node have a parent?
  692. if (typeof datum.parent === "undefined" || datum.parent == null) {
  693. //Doesn't look like it, so this node is the root of the tree
  694. root = datum;
  695. treeMap[datum.id] = root;
  696. } else {
  697. //This node has a parent, so let's look it up using the id
  698. parentNode = idToNodeMap[datum.parent.id];
  699. //We don't need this property, so let's delete it.
  700. delete datum.parent;
  701. //Let's add the current node as a child of the parent node.
  702. parentNode.children.push(datum);
  703. }
  704. }
  705. return root;
  706. console.log(root)
  707. }
  708. function convertParentToChildList(data) {
  709. var treeMap = {};
  710. var list = [];
  711. convertListToTree(data, treeMap);
  712. angular.forEach(treeMap, function (item) {
  713. list.push(item);
  714. });
  715. return list;
  716. }
  717. $scope.try_async_load();
  718. // $scope.select_treedata = [];
  719. $scope.propTypeOptions = [];
  720. $scope.deselectItem = function (item) {
  721. console.log(item)
  722. console.log($scope)
  723. }
  724. // 事件分类
  725. $scope.onFilterCallback = function (item) {
  726. // $scope.searchkeys.category={};
  727. console.log(item);
  728. if (item.item) {
  729. $scope.searchkeys.category = item = undefined;
  730. } else {
  731. $scope.searchkeys.category = item;
  732. }
  733. // if (angular.isDefined(item.children) && item.children.length >= 1) {
  734. // //not valid
  735. // } else {
  736. // var tempclassify = item.prefix.toLowerCase() + item.sign;
  737. // $scope.gridApi.grid.options.paginationCurrentPage = 1;
  738. // $scope.cifilter_classic = tempclassify;
  739. // var memoryfilterData = {
  740. // "sign": tempclassify,
  741. // "idx": 0,
  742. // "sum": $scope.gridOptions.paginationPageSize
  743. // }
  744. // angular.extend($scope.memoryfilterData, memoryfilterData)
  745. // // $scope.memoryfilterData=memoryfilterData;
  746. // $scope.refreshData('expand-right', $scope.memoryfilterData);
  747. // // 专有属性
  748. // var postData={
  749. // idx:0,
  750. // sum:1000
  751. // }
  752. // api_bpm_data.fetchDataList('incidentcategory',postData).then(function(data){
  753. // console.log(data)
  754. // var myData = Restangular.stripRestangular(data);
  755. // $scope.propTypeOptions = myData[2].form.fields;
  756. // // console.log($scope.propTypeOptions)
  757. // });
  758. // }
  759. }
  760. //状态
  761. $scope.state = [];
  762. // api_bpm_data.fetchDataList('incidentstatus', { "idx": 0, "sum": 100 }).then(function(response) {
  763. api_wechatfile.getDictionary({
  764. "type": "list",
  765. "key": "incident_status"
  766. }).then(function (response) {
  767. if (response) {
  768. if (response.status = 200) {
  769. $scope.state = response;
  770. if (sessionStorage.searchincident && JSON.parse(sessionStorage.getItem("searchincident")).incident) {
  771. angular.forEach($scope.state, function (item) {
  772. if (item.id == JSON.parse(sessionStorage.getItem("searchincident")).incident.statusId) {
  773. $scope.othcode = {
  774. "state": item
  775. };
  776. }
  777. })
  778. }
  779. }
  780. }
  781. })
  782. if (sessionStorage.searchincident && JSON.parse(sessionStorage.getItem("searchincident")).incident) {
  783. // angular.forEach($scope.state, function(item) {
  784. // if (item.code == JSON.parse(sessionStorage.getItem("searchincident")).incident.statusId) {
  785. // $scope.othcode = item.id;
  786. // }
  787. // })
  788. // $scope.othcode = JSON.parse(sessionStorage.getItem("searchincident")).incident.statusId;
  789. if (JSON.parse(sessionStorage.getItem("searchincident")).incident) {
  790. $scope.searchkeys = JSON.parse(sessionStorage.getItem("searchincident")).incident;
  791. }
  792. if ($scope.searchkeys.acceptDate) {
  793. $scope.searchkeys.acceptDate = new Date($scope.searchkeys.acceptDate);
  794. }
  795. if ($scope.searchkeys.acceptDateEnd) {
  796. $scope.searchkeys.acceptDateEnd = new Date($scope.searchkeys.acceptDateEnd);
  797. }
  798. // $scope.gridOptions.paginationCurrentPage = 1 + JSON.parse(sessionStorage.getItem("searchincident")).idx;
  799. }
  800. $scope.clear = function () {
  801. $scope.propTypeOptions = [];
  802. $scope.searchkeys = {};
  803. $scope.searchstate = JSON.parse(sessionStorage.getItem("searchincident")).searchType;
  804. $scope.othcode = {};
  805. $scope.try_async_load();
  806. var fildata = {
  807. "assignee": loginUser.id,
  808. "candidateGroups": loginuserGroup,
  809. "searchType": JSON.parse(sessionStorage.getItem("searchincident")).searchType,
  810. "idx": JSON.parse(sessionStorage.getItem("searchincident")).idx,
  811. "sum": JSON.parse(sessionStorage.getItem("searchincident")).sum
  812. }
  813. sessionStorage.removeItem("searchincident");
  814. fildata.assignee = loginUser.id;
  815. $scope.memoryfilterData = fildata;
  816. $scope.refreshData('expand-right', fildata);
  817. $interval.cancel($scope.timer);
  818. $scope.timer = $interval(function () {
  819. $scope.jry_refresh()
  820. }, $rootScope.refreshTime);
  821. }
  822. // 刷新
  823. $scope.jry_refresh = function () {
  824. var fildata = {};
  825. if (sessionStorage.searchincident) {
  826. fildata = JSON.parse(sessionStorage.getItem("searchincident"));
  827. } else {
  828. fildata = defaultFilterData;
  829. }
  830. if (fildata.incident && fildata.incident.category) {
  831. delete fildata.incident.category
  832. }
  833. fildata.idx = $scope.jry_idx;
  834. fildata.sum = $scope.jry_sum;
  835. $scope.refreshData2('expand-right', fildata);
  836. console.log($scope.cifilter_classic);
  837. }
  838. // 搜索
  839. $scope.chiceIncident = function (item, stateid) {
  840. if (stateid && stateid.id) {
  841. item.statusId = stateid.id;
  842. } else {
  843. item.statusId = undefined;
  844. }
  845. console.log(item)
  846. var fildata = {};
  847. if (sessionStorage.searchincident) {
  848. fildata = JSON.parse(sessionStorage.getItem("searchincident"));
  849. $scope.gridOptions.paginationCurrentPage = 1;
  850. fildata.idx = 0;
  851. } else {
  852. fildata = defaultFilterData;
  853. }
  854. // $scope.memoryfilterData = fildata;
  855. if (!fildata.incident) {
  856. fildata['incident'] = {};
  857. }
  858. // $scope.gridOptions.paginationCurrentPage = 1;
  859. if (item.acceptDate) {
  860. item.acceptDate = moment(item.acceptDate).format('YYYY-MM-DD 00:00:00');
  861. }
  862. if (item.acceptDateEnd) {
  863. // item.acceptDateEnd = moment(item.acceptDateEnd).format('YYYY-MM-DD 00:00:00');
  864. item.acceptDateEnd = moment(item.acceptDateEnd).format('YYYY-MM-DD 23:59:59')
  865. }
  866. // if (parameters) {
  867. // angular.extend(fildata, { 'idx': 0, 'sum': $scope.gridOptions.paginationPageSize })
  868. // angular.extend(fildata.incident, { 'acceptDate': moment(parameters.paramDateFrom).format('YYYY-MM-DD 00:00:00'), 'acceptDateEnd': moment(parameters.paramDateTo).format('YYYY-MM-DD 23:59:59') })
  869. // }
  870. var transitiondata = angular.copy(item);
  871. angular.extend(fildata.incident, transitiondata)
  872. sessionStorage['searchincident'] = JSON.stringify(fildata);
  873. $scope.memoryfilterData = fildata;
  874. fildata.assignee = loginUser.id;
  875. // seimin
  876. console.log(fildata,78777);
  877. if(fildata.searchType === 'all'){
  878. if(fildata.incident&&fildata.incident.selectType){
  879. fildata.incident.selectType = fildata.incident.selectType.id;
  880. }
  881. }else{
  882. if(fildata.incident&&fildata.incident.selectType){
  883. delete fildata.incident.selectType;
  884. }
  885. }
  886. // /seimin
  887. $scope.refreshData('expand-right', fildata);
  888. $interval.cancel($scope.timer);
  889. $scope.timer = $interval(function () {
  890. $scope.jry_refresh()
  891. }, $rootScope.refreshTime);
  892. }
  893. //区域地点过滤
  894. $scope.key = {};
  895. api_user_data.fetchDataList('area', {
  896. "idx": 0,
  897. "sum": 1000
  898. }).then(function (response) {
  899. if (response) {
  900. if (response.status = 200) {
  901. $scope.outarea = response.list;
  902. }
  903. }
  904. })
  905. //报修人
  906. var getRequester = function () {
  907. api_user_data.fetchDataList('requester', {
  908. idx: 0,
  909. sum: 100
  910. }).then(function (data) {
  911. // console.log(data);
  912. $scope.requester = data.list
  913. });
  914. }
  915. getRequester();
  916. //受理人,处理人
  917. var getUser = function (fieldatas, it) {
  918. api_user_data.fetchDataList('user', fieldatas).then(function (data) {
  919. // console.log(data);
  920. if (it == 1) {
  921. $scope.acceptUser = data.list;
  922. acceptUser = $scope.acceptUser;
  923. } else if (it == 2) {
  924. $scope.handlingPersonnelUser = data.list;
  925. // } else if (it == 3) {
  926. // $scope.acceptUser = data.list;
  927. // $scope.handlingPersonnelUser = data.list;
  928. }
  929. });
  930. }
  931. //受理人过滤
  932. $scope.onChangeacceptUser = function (key) {
  933. console.log(key)
  934. var filuser = {
  935. "idx": 0,
  936. "sum": 10,
  937. "user": {
  938. "name": key,
  939. 'selectType': "pinyin_qs"
  940. }
  941. }
  942. getUser(filuser, 1);
  943. }
  944. //处理人过滤
  945. $scope.onChangehandling = function (key) {
  946. var filuser = {
  947. "idx": 0,
  948. "sum": 10,
  949. "user": {
  950. "name": key,
  951. 'selectType': "pinyin_qs"
  952. }
  953. }
  954. getUser(filuser, 2);
  955. }
  956. //报修科室过滤
  957. $scope.onChangeDept = function (key) {
  958. $scope.getDept(key)
  959. }
  960. //地点区域过滤
  961. $scope.onChangearea = function (data) {
  962. delete $scope.searchkeys.place;
  963. if ($scope.memoryfilterData.incident) {
  964. delete $scope.memoryfilterData.incident.place;
  965. }
  966. var fildata = {
  967. "idx": 0,
  968. "sum": 1000,
  969. "place": {
  970. area: {
  971. id: data.area.id
  972. }
  973. }
  974. };
  975. api_user_data.fetchDataList('place', fildata).then(function (response) {
  976. if (response) {
  977. if (response.status = 200) {
  978. $scope.outplace = response.list;
  979. }
  980. }
  981. })
  982. };
  983. $scope.starttime = function (data) {
  984. return moment(new Date(data)).format('YYYY-MM-DD')
  985. }
  986. $scope.overtime = function (data) {
  987. return moment(new Date(data)).format('YYYY-MM-DD HH:mm')
  988. }
  989. $scope.areaplace = function (data) {
  990. // if (data.area && data.place) {
  991. // if (data.houseNumber) {
  992. var str = ' ';
  993. str += ' ' + (data.place ? (data.place.area ? data.place.area.area : ' ') : ' ');
  994. str += ' ' + (data.place ? (data.place.place ? data.place.place : ' ') : ' ');
  995. str += ' ' + (data.houseNumber ? data.houseNumber : ' ');
  996. return str;
  997. // } else {
  998. // return data.area.area + ' ' + data.place.place;
  999. // }
  1000. // } else if (data.area && !data.place) {
  1001. // if (data.houseNumber) {
  1002. // return data.area.area + ' ' + data.houseNumber;
  1003. // } else {
  1004. // return data.area.area;
  1005. // }
  1006. // } else if (!data.area && data.place) {
  1007. // if (data.houseNumber) {
  1008. // return data.place.place + ' ' + data.houseNumber;
  1009. // } else {
  1010. // return data.place.place;
  1011. // }
  1012. // }
  1013. }
  1014. //录音
  1015. $scope.play = function (data) {
  1016. // console.log($scope.item.callID)
  1017. var modalInstance = $modal.open({
  1018. backdrop: "static",
  1019. templateUrl: 'assets/views/incident/tpl/audio.html',
  1020. controller: function ($rootScope, $scope, $modalInstance, $sce, $http, api_playservice) {
  1021. $rootScope.setbusy();
  1022. $scope.datasurl = "";
  1023. $http({
  1024. url: callIp + "/recording/recording?callID=" + data.callID,
  1025. method: 'GET',
  1026. headers: {},
  1027. }).success(function (data, status, headers, config) {
  1028. $scope.data = {
  1029. "name": "视频",
  1030. "url": $sce.trustAsResourceUrl("http://" + data.rrpath)
  1031. };
  1032. $scope.datasurl = data.rrpath;
  1033. }).error(function (data, status, headers, config) { });
  1034. $scope.download = function (contentId, filename) {
  1035. $http({
  1036. url: "http://" + $scope.datasurl,
  1037. method: 'GET',
  1038. headers: {
  1039. 'Content-type': 'application/octet-stream',
  1040. },
  1041. responseType: 'arraybuffer'
  1042. }).success(function (data, status, headers, config) {
  1043. var file = new Blob([data], {
  1044. type: 'application/octet-stream'
  1045. });
  1046. //trick to download store a file having its URL
  1047. var fileURL = URL.createObjectURL(file);
  1048. var a = document.createElement('a');
  1049. a.href = fileURL;
  1050. a.target = '_blank';
  1051. a.download = filename;
  1052. document.body.appendChild(a);
  1053. a.click();
  1054. }).error(function (data, status, headers, config) {
  1055. // console.log(data);
  1056. });
  1057. }
  1058. $scope.cancel = function () {
  1059. $modalInstance.dismiss('cancel');
  1060. };
  1061. $modalInstance.close();
  1062. }
  1063. });
  1064. modalInstance.result.then(function (result) {
  1065. // $rootScope.setidle();
  1066. }, function (reason) {
  1067. $rootScope.setidle();
  1068. });
  1069. };
  1070. $scope.jry_paging = "";
  1071. //列表排序
  1072. // sessionStorage.idx = 0;
  1073. $scope.gridOptions.onRegisterApi = function (gridApi) {
  1074. $scope.gridApi = gridApi;
  1075. var index = 0;
  1076. var oldheader = {};
  1077. gridApi.grid.sortColumn = function (gridApi) {
  1078. if (oldheader.field) {
  1079. if (oldheader.field == gridApi.field) {
  1080. // index = 0;
  1081. } else {
  1082. index = 0;
  1083. }
  1084. }
  1085. index++;
  1086. oldheader = gridApi;
  1087. var fildata = $scope.memoryfilterData;
  1088. if (index % 3 == 0) {
  1089. delete $scope.memoryfilterData.incident;
  1090. fildata = $scope.memoryfilterData;
  1091. } else if (index % 3 == 1) {
  1092. if (fildata.incident) {
  1093. if (gridApi.field == "acceptDate") {
  1094. angular.extend(fildata.incident, {
  1095. "sort": gridApi.field
  1096. });
  1097. } else {
  1098. angular.extend(fildata.incident, {
  1099. "sort": gridApi.field + " desc , _incident.acceptDate"
  1100. });
  1101. }
  1102. } else {
  1103. if (gridApi.field == "acceptDate") {
  1104. angular.extend(fildata, {
  1105. 'incident': {
  1106. "sort": gridApi.field
  1107. }
  1108. });
  1109. } else {
  1110. angular.extend(fildata, {
  1111. 'incident': {
  1112. "sort": gridApi.field + " desc , _incident.acceptDate"
  1113. }
  1114. });
  1115. }
  1116. }
  1117. } else if (index % 3 == 2) {
  1118. if (fildata.incident) {
  1119. if (gridApi.field == "acceptDate") {
  1120. angular.extend(fildata.incident, {
  1121. "sort": gridApi.field,
  1122. "order": "asc"
  1123. });
  1124. } else {
  1125. angular.extend(fildata.incident, {
  1126. "sort": gridApi.field + " asc , _incident.acceptDate"
  1127. });
  1128. }
  1129. } else {
  1130. if (gridApi.field == "acceptDate") {
  1131. angular.extend(fildata, {
  1132. 'incident': {
  1133. "sort": gridApi.field,
  1134. "order": "asc"
  1135. }
  1136. });
  1137. } else {
  1138. angular.extend(fildata.incident, {
  1139. "sort": gridApi.field + " asc , _incident.acceptDate"
  1140. });
  1141. }
  1142. }
  1143. // angular.extend(fildata, { 'incident': { "sort": gridApi.field, "order": "asc" } });
  1144. }
  1145. fildata.assignee = loginUser.id;
  1146. $scope.refreshData('expand-right', fildata);
  1147. }
  1148. $scope.jry_idx = 0;
  1149. $scope.jry_sum = 10;
  1150. gridApi.pagination.on.paginationChanged($scope, function (newPage, pageSize) {
  1151. var filtersData = $scope.memoryfilterData;
  1152. filtersData.idx = newPage - 1;
  1153. $scope.jry_paging = newPage - 1;
  1154. $scope.jry_idx = newPage - 1;
  1155. filtersData.sum = pageSize;
  1156. $scope.jry_sum = pageSize;
  1157. if (JSON.parse(sessionStorage.getItem("searchincident")).idx != filtersData.idx || JSON.parse(sessionStorage.getItem("searchincident")).sum != filtersData.sum) {
  1158. filtersData.assignee = loginUser.id;
  1159. $scope.refreshData('expand-right', filtersData);
  1160. }
  1161. // $scope.refreshData('expand-right', {"assignee":$rootScope.user.id, "candidateGroups":$rootScope.user.group[0].id, "idx":newPage-1,"sum":pageSize});
  1162. });
  1163. // gridApi.selection.on.rowSelectionChanged($scope, function(data) {
  1164. // data.grid.appScope.selected.items = data.entity
  1165. // });
  1166. $scope.Change = function (upTypes) {
  1167. if (angular.isDefined($scope.selected.items)) {
  1168. if (angular.isDefined(upTypes) && upTypes == 'upincident') {
  1169. var data = {
  1170. cancelUrl: 'app.incident.list',
  1171. model: {
  1172. problem: {
  1173. title: $scope.selected.items.title,
  1174. des: $scope.selected.items.description,
  1175. proposePerson: $scope.selected.items.handlerUser,
  1176. source: {
  1177. id: 1,
  1178. code: 1,
  1179. name: ' 事件 '
  1180. },
  1181. incident: $scope.selected.items
  1182. }
  1183. }
  1184. }
  1185. $state.go('app.problem.incident', {
  1186. pdKey: 'incident',
  1187. dataId: $scope.selected.items.id,
  1188. processInstanceId: $scope.selected.items.processInstanceId,
  1189. 'model': JSON.stringify(data)
  1190. });
  1191. } else if (angular.isDefined(upTypes) && upTypes == 'upchange') {
  1192. var data = {
  1193. cancelUrl: 'app.incident.list',
  1194. model: {
  1195. change: {
  1196. title: $scope.selected.items.title,
  1197. description: $scope.selected.items.description,
  1198. requestingPerson: $scope.selected.items.handlerUser,
  1199. source: {
  1200. id: 1,
  1201. code: 1,
  1202. name: ' 事件 '
  1203. },
  1204. incident: $scope.selected.items
  1205. }
  1206. }
  1207. }
  1208. // var data={cancelUrl:'app.incident.list'}
  1209. $state.go('app.change.incident', {
  1210. pdKey: 'incident',
  1211. dataId: $scope.selected.items.id,
  1212. processInstanceId: $scope.selected.items.processInstanceId,
  1213. 'model': JSON.stringify(data)
  1214. });
  1215. }
  1216. }
  1217. }
  1218. $scope.selected = {
  1219. items: []
  1220. }
  1221. gridApi.core.on.filterChanged($scope, function () {
  1222. var grid = this.grid;
  1223. if ($rootScope.user.group) {
  1224. var filtersData = {
  1225. "assignee": loginUser.id,
  1226. "candidateGroups": loginuserGroup,
  1227. idx: 0,
  1228. sum: mun
  1229. };
  1230. } else {
  1231. var filtersData = {
  1232. "assignee": loginUser.id,
  1233. idx: 0,
  1234. sum: mun
  1235. };
  1236. }
  1237. angular.forEach(grid.columns, function (item) {
  1238. if (item.enableFiltering) {
  1239. if (angular.isDefined(item.filters[0].term) && item.filters[0].term != '') {
  1240. filtersData = $scope.memoryfilterData
  1241. if (angular.isUndefined(filtersData['incident'])) {
  1242. filtersData['incident'] = {};
  1243. }
  1244. if (item.field == 'department.dept') {
  1245. filtersData['incident']['department'] = {};
  1246. filtersData.incident.department['department'] = item.filters[0].term;
  1247. } else if (item.field == 'handlingPersonnelUser.name') {
  1248. filtersData['incident']['handlingPersonnelUser'] = {};
  1249. filtersData.incident.handlingPersonnelUser['name'] = item.filters[0].term;
  1250. } else if (item.field == 'requester.account') {
  1251. filtersData['incident']['requester'] = {};
  1252. filtersData.incident.requester['account'] = item.filters[0].term;
  1253. } else if (item.field == 'acceptUser.name') {
  1254. filtersData['incident']['acceptUser'] = {};
  1255. filtersData.incident.acceptUser['name'] = item.filters[0].term;
  1256. } else {
  1257. filtersData['incident'][item.field] = item.filters[0].term;
  1258. }
  1259. }
  1260. }
  1261. });
  1262. filtersData.idx = 0;
  1263. filtersData.assignee = loginUser.id;
  1264. $scope.memoryfilterData = filtersData;
  1265. $scope.refreshData('expand-right', filtersData);
  1266. });
  1267. };
  1268. //当前人是否分组
  1269. if ($rootScope.user.group) {
  1270. if ($rootScope.user.group.length == 0) {
  1271. SweetAlert.swal("访问失败!", "当前登录人未分配工作组,无权限访问,请添加工作组后重试。", "error");
  1272. } else {
  1273. $scope.memoryfilterData = defaultFilterData = {
  1274. "assignee": loginUser.id,
  1275. "candidateGroups": loginuserGroup,
  1276. "searchType": "todo",
  1277. "idx": 0,
  1278. "sum": mun
  1279. };
  1280. }
  1281. } else {
  1282. $scope.memoryfilterData = defaultFilterData = {
  1283. "assignee": loginUser.id,
  1284. "searchType": "todo",
  1285. "idx": 0,
  1286. "sum": mun
  1287. };
  1288. }
  1289. //打印
  1290. $scope.open = function (data) {
  1291. var modalInstance = $modal.open({
  1292. templateUrl: 'assets/views/incident/tpl/print.html',
  1293. controller: function ($scope, $modalInstance) {
  1294. $scope.printdata = data;
  1295. if (!data.emergency) {
  1296. data['emergency'] = {};
  1297. }
  1298. if (!data.influence) {
  1299. data['influence'] = {};
  1300. }
  1301. if (!data.place) {
  1302. data['place'] = {};
  1303. }
  1304. if (!data.influence) {
  1305. data['influence'] = {};
  1306. }
  1307. if (!data.emergency) {
  1308. data['emergency'] = {};
  1309. }
  1310. if (!data.influence) {
  1311. data['influence'] = {};
  1312. }
  1313. var height = $(".groundborder").height()
  1314. // console.log(height)
  1315. $scope.printrequest = [{
  1316. name: "事件单号",
  1317. value: data.incidentsign
  1318. },
  1319. {
  1320. name: "事件主题",
  1321. value: data.title
  1322. },
  1323. {
  1324. name: "事件分类",
  1325. value: data.category.category
  1326. },
  1327. {
  1328. name: "紧急度",
  1329. value: data.emergency.name
  1330. },
  1331. {
  1332. name: "影响度",
  1333. value: data.influence.name
  1334. },
  1335. {
  1336. name: "优先级",
  1337. value: data.priority.name
  1338. }
  1339. ];
  1340. $scope.printrequest['requester'] = [{
  1341. nameone: "用户姓名",
  1342. valueone: data.requester.name,
  1343. nametwo: "联系电话",
  1344. valuetwo: data.requester.mphone
  1345. },
  1346. {
  1347. nameone: "故障地点",
  1348. valueone: data.place.place,
  1349. nametwo: "申报时间",
  1350. valuetwo: data.acceptDate
  1351. }
  1352. ];
  1353. // $scope.printrequest['requester']=[{name:"用户姓名",value:data.requester.name},
  1354. // {name:"联系电话",value:data.requester.mphone},
  1355. // {name:"故障地点",value:data.place.place},
  1356. // {name:"申报时间",value:data.responseTime}];
  1357. $scope.printrequest['incident'] = [{
  1358. nameone: "故障工单",
  1359. valueone: data.incidentsign,
  1360. nametwo: "故障分类",
  1361. valuetwo: data.category.category
  1362. }];
  1363. $scope.printrequest['handler'] = [{
  1364. name: "故障描述",
  1365. value: data.description
  1366. },
  1367. {
  1368. name: "处理人",
  1369. value: data.handlingPersonnelUser ? data.handlingPersonnelUser.name : ''
  1370. },
  1371. // { name: "处理人", value: data.requester ? data.requester.name : '' }
  1372. ];
  1373. // {name:"处理结果",value:data.handleResult}];
  1374. // {name:"用户评价",value:''},
  1375. // {name:"满意度",value:''},
  1376. // {name:"用户签字",value:''}];
  1377. $scope.cancel = function () {
  1378. $modalInstance.dismiss('cancel');
  1379. };
  1380. },
  1381. size: 'lg'
  1382. });
  1383. }
  1384. //新建事件
  1385. $scope.newincident = function (data) {
  1386. $state.go('app.incident.editor', {});
  1387. };
  1388. //编辑
  1389. $scope.selectRowFunction = function (data) {
  1390. $state.go('app.incident.editor', {
  1391. taskId: data.taskId,
  1392. processInstanceId: data.processInstanceId,
  1393. dataId: data.id,
  1394. // type:1
  1395. });
  1396. };
  1397. // //双击查看详情
  1398. // $scope.onDblClick = function (data) {
  1399. // console.log(data);
  1400. // // console.log('data='+JSON.stringify(data));
  1401. // //$state.go('app.detail',{taskId:data.taskId,processInstanceId: data.processInstanceId});
  1402. // $state.go('app.incident.detail', {
  1403. // formKey: 'incident_back',
  1404. // pdKey: 'incident',
  1405. // dataId: data.entity.id,
  1406. // taskId: data.entity.taskId,
  1407. // processInstanceId: data.entity.processInstanceId
  1408. // });
  1409. // };
  1410. //修改
  1411. $scope.changeClick = function (data) {
  1412. $state.go('app.incident.detail', {
  1413. formKey: 'incident_change',
  1414. pdKey: 'incident',
  1415. dataId: data.id,
  1416. taskId: data.taskId,
  1417. processInstanceId: data.processInstanceId
  1418. });
  1419. };
  1420. //回访
  1421. $scope.visit = function (data) {
  1422. $state.go('app.incident.detail', {
  1423. formKey: 'incident_visit',
  1424. pdKey: 'incident',
  1425. dataId: data.id,
  1426. taskId: data.taskId,
  1427. processInstanceId: data.processInstanceId
  1428. });
  1429. };
  1430. //查看
  1431. $scope.followFunction = function (data) {
  1432. //console.log('data='+JSON.stringify(data));
  1433. console.log(data);
  1434. $state.go('app.detail', {
  1435. formKey: 'statusform',
  1436. pdKey: 'incident',
  1437. dataId: data.id,
  1438. processInstanceId: data.processInstanceId
  1439. });
  1440. };
  1441. // 升级
  1442. $scope.upgrade = function (data) {
  1443. console.log(data);
  1444. console.log('升级');
  1445. // 弹窗下拉菜单单选
  1446. } // 转派
  1447. $scope.rotate = function (data) {
  1448. console.log(data);
  1449. console.log('转派');
  1450. // 弹窗下拉菜单单选
  1451. } // 协同
  1452. $scope.cooperate = function (data) {
  1453. console.log(data);
  1454. console.log('协同');
  1455. // 弹窗下拉菜单多选
  1456. }
  1457. // 升级问题
  1458. $scope.problem = function (data) {
  1459. // console.log(data);
  1460. delete data.item;
  1461. delete data.chaozuoPower;
  1462. delete data.coordination;
  1463. delete data.listen;
  1464. // console.log(data);
  1465. $state.go('app.problem.incident', {
  1466. 'model': JSON.stringify(data)
  1467. });
  1468. }
  1469. //变更升级
  1470. $scope.configuration = function (data) {
  1471. $state.go('app.change.incident', {
  1472. 'model': JSON.stringify(data)
  1473. });
  1474. };
  1475. //协同人
  1476. $scope.coordination = function (data) {
  1477. var modalInstance = $modal.open({
  1478. templateUrl: 'assets/views/customform/tpl/checktable-modal-content.html',
  1479. controller: function ($scope, $modalInstance, i18nService, $timeout, api_bpm_domain, api_user_data) {
  1480. $scope.langs = i18nService.getAllLangs();
  1481. $scope.lang = 'zh-cn';
  1482. i18nService.setCurrentLang($scope.lang);
  1483. $scope.gridOptions = {};
  1484. $scope.gridOptions.data = 'myData';
  1485. $scope.gridOptions.enableColumnResizing = true;
  1486. $scope.gridOptions.enableFiltering = true;
  1487. $scope.gridOptions.enableGridMenu = true;
  1488. $scope.gridOptions.showGridFooter = true;
  1489. $scope.gridOptions.showColumnFooter = true;
  1490. $scope.gridOptions.fastWatch = true;
  1491. $scope.gridOptions.useExternalFiltering = true;
  1492. $scope.gridOptions.useExternalPagination = true;
  1493. $scope.gridOptions.paginationPageSizes = [10];
  1494. $scope.gridOptions.paginationPageSize = 10;
  1495. $scope.gridOptions.multiSelect = false;
  1496. $scope.gridOptions.rowIdentity = function (row) {
  1497. return row.id;
  1498. };
  1499. $scope.gridOptions.getRowIdentity = function (row) {
  1500. return row.id;
  1501. };
  1502. $scope.gridOptions.columnDefs = [
  1503. // { name:'id', width:80, enableFiltering:false},
  1504. {
  1505. name: 'account',
  1506. displayName: '账号',
  1507. width: 140
  1508. },
  1509. {
  1510. name: 'name',
  1511. displayName: '名称',
  1512. width: 100
  1513. },
  1514. {
  1515. name: 'gender',
  1516. displayName: '性别',
  1517. width: 140,
  1518. enableFiltering: false
  1519. },
  1520. {
  1521. name: 'phone',
  1522. displayName: '电话',
  1523. width: 100,
  1524. enableFiltering: false
  1525. },
  1526. {
  1527. name: 'email',
  1528. displayName: '邮件',
  1529. width: 100,
  1530. enableFiltering: false
  1531. },
  1532. {
  1533. name: 'dept.dept',
  1534. displayName: '科室',
  1535. width: 100,
  1536. enableFiltering: false
  1537. },
  1538. {
  1539. name: 'group[0].groupName',
  1540. displayName: '职位',
  1541. width: 100,
  1542. enableFiltering: false
  1543. }
  1544. ];
  1545. $scope.gridOptions.onRegisterApi = function (gridApi) {
  1546. $scope.gridApi = gridApi;
  1547. gridApi.pagination.on.paginationChanged($scope, function (newPage, pageSize) {
  1548. var filtersData = $scope.memoryfilterData;
  1549. filtersData.idx = newPage - 1;
  1550. filtersData.sum = pageSize;
  1551. $scope.loadData(filtersData);
  1552. // $scope.loadData({"idx":newPage-1,"sum":pageSize});
  1553. });
  1554. gridApi.selection.on.rowSelectionChanged($scope, function (scope) {
  1555. scope.grid.appScope.selected.items[0] = scope.entity;
  1556. // $scope.selected.items[0] = scope.entity;
  1557. });
  1558. gridApi.core.on.filterChanged($scope, function () {
  1559. var grid = this.grid;
  1560. var filtersData = {
  1561. idx: 0,
  1562. sum: 10,
  1563. "user": {
  1564. "roledata": {
  1565. "rolecode": options.model.currentRole
  1566. },
  1567. "selectType": "1"
  1568. }
  1569. };
  1570. angular.forEach(grid.columns, function (item) {
  1571. if (item.enableFiltering) {
  1572. //console.log("filtersData="+JSON.stringify(filtersData))
  1573. if (angular.isDefined(item.filters[0].term) && item.filters[0].term != '') {
  1574. if (angular.isUndefined(filtersData['user'])) {
  1575. filtersData['user'] = {};
  1576. }
  1577. filtersData['user'][item.field] = item.filters[0].term;
  1578. }
  1579. }
  1580. });
  1581. $scope.memoryfilterData = filtersData;
  1582. $scope.loadData(filtersData);
  1583. });
  1584. };
  1585. $scope.selected = {
  1586. items: []
  1587. }
  1588. var filterData = {
  1589. "idx": 0,
  1590. "sum": 10,
  1591. "user": {
  1592. "roledata": {
  1593. "rolecode": 'first-line support'
  1594. },
  1595. "selectType": "1"
  1596. }
  1597. }
  1598. $scope.loadData = function (filterData) {
  1599. // console.log(" filtersData['user'][item.field]=111"+JSON.stringify(filterData));
  1600. api_user_data.fetchDataList('user', filterData).then(function (data) {
  1601. var myData = Restangular.stripRestangular(data);
  1602. $scope.gridOptions.totalItems = myData.totalNum;
  1603. $scope.myData = myData.list;
  1604. });
  1605. };
  1606. $scope.loadData({
  1607. idx: 0,
  1608. sum: 10,
  1609. "user": {
  1610. "roledata": {
  1611. "rolecode": 'first-line support'
  1612. },
  1613. "selectType": "1"
  1614. }
  1615. });
  1616. $scope.ok = function () {
  1617. $modalInstance.close($scope.selected.items);
  1618. };
  1619. $scope.cancel = function () {
  1620. $modalInstance.dismiss('cancel');
  1621. };
  1622. },
  1623. size: 'lg'
  1624. });
  1625. modalInstance.result.then(function (selectedItem) {
  1626. if (selectedItem) {
  1627. var filterData = {
  1628. "assginee": selectedItem[0].id
  1629. }
  1630. api_bpm_domain.delegateTask(data.taskId, filterData).then(function (data) {
  1631. if (data && data.status == 200) {
  1632. SweetAlert.swal("添加成功!", "添加协同人成功", "success");
  1633. $scope.memoryfilterData.assignee = loginUser.id;
  1634. $scope.refreshData('expand-right', $scope.memoryfilterData);
  1635. } else {
  1636. SweetAlert.swal("添加失败!", "请稍候重试", "error");
  1637. }
  1638. // var myData = Restangular.stripRestangular(data);
  1639. // $scope.gridOptions.totalItems = myData.totalNum;
  1640. // $scope.myData = myData.list;
  1641. });
  1642. }
  1643. });
  1644. }
  1645. // $scope.onDblClick = function(row){
  1646. // console.log(row.entity);
  1647. // if($rootScope.user.id==row.entity.handlerUser.id){$state.go('app.incident.editor',{taskId:row.entity.taskId,processInstanceId: row.entity.processInstanceId});}
  1648. // else{$state.go('app.detail', { formKey:'incident_back', pdKey:'incident', dataId: row.entity.id});}
  1649. // };
  1650. /*
  1651. appScopeProvider: {
  1652. onDblClick : function(row) {
  1653. var url = '//google.com';
  1654. $window.open(url, "_blank", "height=600,width=800,toolbar=no,location=no,menubar=no,titlebar=no");
  1655. }
  1656. },
  1657. rowTemplate: "<div ng-dblclick=\"grid.appScope.onDblClick(row)\" ng-repeat=\"(colRenderIndex, col) in colContainer.renderedColumns track by col.colDef.name\" class=\"ui-grid-cell\" ng-class=\"{ 'ui-grid-row-header-cell': col.isRowHeader }\" ui-grid-cell ></div>"
  1658. */
  1659. //删除
  1660. $scope.eventDeleted = function (event) {
  1661. SweetAlert.swal({
  1662. title: "确认删除?",
  1663. text: "删除的数据不可恢复,请确认继续操作!",
  1664. type: "warning",
  1665. showCancelButton: true,
  1666. confirmButtonColor: "#DD6B55",
  1667. confirmButtonText: "继续删除",
  1668. cancelButtonText: "取消操作",
  1669. closeOnConfirm: false,
  1670. closeOnCancel: false
  1671. }, function (isConfirm) {
  1672. if (isConfirm) {
  1673. api_bpm_schedule.remove([event.id]).then(function (response) {
  1674. if (response.status == 200) {
  1675. $scope.events.splice(event.id, 1); //有修改的一行
  1676. SweetAlert.swal("操作成功!", "数据已经被删除.", "success");
  1677. } else {
  1678. SweetAlert.swal("操作失败!", "数据暂时无法被删除,请稍候重试", "error");
  1679. }
  1680. });
  1681. } else {
  1682. SweetAlert.swal("操作取消", "数据安全", "error");
  1683. }
  1684. });
  1685. };
  1686. //导出
  1687. $scope.export = function () {
  1688. // api_bpm_data.downDataModel("incident", 3, $scope.memoryfilterData).then(function(data) {
  1689. // console.log(data)
  1690. // var file = new Blob([data], {
  1691. // // type: 'application/octet-stream'
  1692. // type: 'application/vnd.ms-excel'
  1693. // });
  1694. // //trick to download store a file having its URL
  1695. // var fileURL = URL.createObjectURL(file);
  1696. // var a = document.createElement('a');
  1697. // a.href = fileURL;
  1698. // a.target = '_blank';
  1699. // a.download = '事件列表.xls';
  1700. // document.body.appendChild(a);
  1701. // a.click();
  1702. // })
  1703. // $scope.ldloading[style.replace('-', '_')] = true;
  1704. console.log($scope.memoryfilterData)
  1705. var filadata = angular.copy($scope.memoryfilterData);
  1706. filadata.sum = 10000;
  1707. console.log($scope.filadata)
  1708. $http({
  1709. url: api_bpm_data.downDataModel("incident", 3).getRequestedUrl(),
  1710. method: 'POST',
  1711. data: JSON.stringify(filadata),
  1712. headers: {
  1713. // 'Content-type': 'application/xls',
  1714. 'Accept': '*/*'
  1715. },
  1716. responseType: 'arraybuffer'
  1717. }).success(function (data, status, headers, config) {
  1718. // $scope.ldloading.zoom_in = false;
  1719. var file = new Blob([data], {
  1720. type: 'application/vnd.ms-excel'
  1721. });
  1722. //trick to download store a file having its URL
  1723. var fileURL = URL.createObjectURL(file);
  1724. var a = document.createElement('a');
  1725. a.href = fileURL;
  1726. a.target = '_blank';
  1727. a.download = '事件列表.xls';
  1728. document.body.appendChild(a);
  1729. a.click();
  1730. }).error(function (data, status, headers, config) {
  1731. // $scope.ldloading.zoom_in = false;
  1732. console.log(data);
  1733. });
  1734. }
  1735. //事件提取
  1736. $scope.acceptTaskAction = function (model) {
  1737. var modalInstance = $modal.open({
  1738. templateUrl: 'assets/views/incident/tpl/acceptTask.tpl.html',
  1739. controller: function ($scope, $modalInstance, APIService, modelData, currentUserId, Alert) {
  1740. var receiveTask = function (receive_code, modelData) {
  1741. var data = {
  1742. 'receive_code': receive_code
  1743. };
  1744. if (modelData) {
  1745. return {
  1746. taskId: modelData.taskId,
  1747. data: data
  1748. };
  1749. } else {
  1750. return 'error';
  1751. }
  1752. };
  1753. $scope.title = "提示";
  1754. $scope.connect = "确认抢单?";
  1755. $scope.ok = function () {
  1756. //接收任务//请求重新指派
  1757. var data = receiveTask($scope.receive_code, modelData);
  1758. APIService.claimAndCompletedTask(data.taskId, {
  1759. userId: currentUserId,
  1760. receive_code: "handler"
  1761. }).then(function (response) {
  1762. if (response.status == 200) {
  1763. Alert.swal({
  1764. title: "操作成功!",
  1765. confirmButtonColor: "#007AFF",
  1766. type: "success"
  1767. });
  1768. $modalInstance.close('success');
  1769. } else if (response.status == 500) {
  1770. Alert.swal({
  1771. title: "操作失败",
  1772. text: "该事件已被提取,请刷新页面!",
  1773. type: "error"
  1774. });
  1775. $modalInstance.close('success');
  1776. } else {
  1777. Alert.swal({
  1778. title: "操作失败",
  1779. text: "操作失败, 请稍后再试!",
  1780. type: "error"
  1781. });
  1782. }
  1783. });
  1784. }
  1785. $scope.cancel = function () {
  1786. $modalInstance.dismiss('cancel');
  1787. }
  1788. },
  1789. size: 'sm',
  1790. resolve: {
  1791. APIService: function () {
  1792. return api_bpm_domain;
  1793. },
  1794. modelData: function () {
  1795. return model;
  1796. },
  1797. currentUserId: function () {
  1798. return loginUser.id;
  1799. },
  1800. Alert: function () {
  1801. return SweetAlert;
  1802. }
  1803. }
  1804. });
  1805. modalInstance.result.then(function (selectedItem) {
  1806. if (selectedItem == 'success') {
  1807. defaultFilterData.assignee = loginUser.id;
  1808. $scope.refreshData('expand-right', defaultFilterData);
  1809. }
  1810. });
  1811. }
  1812. // 升级弹窗
  1813. $scope.upgrade = function (model) {
  1814. console.log(model)
  1815. var modalInstance = $modal.open({
  1816. templateUrl: 'assets/views/incident/tpl/upgrade.tpl.html',
  1817. controller: function ($scope, $modalInstance, api_bpm, modelData, currentUserId, Alert, api_user_data) {
  1818. console.log(model);
  1819. $scope.roleList = {
  1820. 'idx': 0,
  1821. 'sum': 100,
  1822. 'user': {
  1823. 'roledata': {
  1824. 'rolecode': ''
  1825. },
  1826. 'groupdata': {
  1827. 'id': ''
  1828. },
  1829. 'selectType': 1
  1830. }
  1831. }
  1832. for (var i = 0; i < loginUser.role.length; i++) {
  1833. // console.log(loginUser.role[i])
  1834. if (loginUser.role[i].role == '一线支持人员') {
  1835. $scope.roleList.user.roledata.rolecode = loginUser.role[i].rolecode;
  1836. $scope.upRole = '二线支持人员';
  1837. }
  1838. if (loginUser.role[i].role == '二线支持人员') {
  1839. $scope.roleList.user.roledata.rolecode = loginUser.role[i].rolecode;
  1840. $scope.upRole = '事件经理';
  1841. }
  1842. }
  1843. var userId = loginUser.id;
  1844. var taskId = model.taskId;
  1845. var postData = {};
  1846. var formKey = model.formKey;
  1847. var processInstanceId = model.processInstanceId;
  1848. $scope.choosUser = {};
  1849. api_configure_form.renderForm(formKey, userId, processInstanceId).then(function (data) {
  1850. postData = data.model;
  1851. })
  1852. $scope.choosUser = {};
  1853. api_user_data.fetchDataList('group', {
  1854. "idx": 0,
  1855. "sum": 100
  1856. }).then(function (data) {
  1857. $scope.group = data.list;
  1858. })
  1859. $scope.onChangeGroup = function (item) {
  1860. $scope.user = [];
  1861. console.log(item);
  1862. console.log($scope.choosUser.group)
  1863. $scope.roleList.user.groupdata.id = $scope.choosUser.group.id
  1864. console.log($scope.roleList)
  1865. if ($scope.choosUser.group) {
  1866. api_user_data.fetchDataList('user', $scope.roleList).then(function (data) {
  1867. console.log(data);
  1868. if (data.list.length == 0) {
  1869. Alert.swal({
  1870. title: "暂无处理人数据",
  1871. text: "该工作组暂无升级对象!",
  1872. type: "error"
  1873. });
  1874. return;
  1875. } else {
  1876. $scope.user = data.list;
  1877. }
  1878. })
  1879. }
  1880. }
  1881. $scope.ok = function () {
  1882. if ($scope.choosUser.handlerUser) {
  1883. postData.handler_code = 'function';
  1884. postData.incident.handlerUser = $scope.choosUser.handlerUser;
  1885. postData.incident.assignee = postData.assignee = $scope.choosUser.handlerUser.id;
  1886. console.log(postData);
  1887. } else {
  1888. Alert.swal({
  1889. title: "操作失败",
  1890. text: "请选择升级对象信息!",
  1891. type: "error"
  1892. });
  1893. return;
  1894. }
  1895. api_bpm.upgrade(postData, taskId, userId, 'completeTask').then(function (response) {
  1896. console.log(response)
  1897. if (response.status == 200) {
  1898. Alert.swal({
  1899. title: "操作成功!",
  1900. confirmButtonColor: "#007AFF",
  1901. type: "success"
  1902. });
  1903. $modalInstance.close('success');
  1904. } else if (response.status == 500) {
  1905. Alert.swal({
  1906. title: "操作失败",
  1907. text: "该事件已被提取,请刷新页面!",
  1908. type: "error"
  1909. });
  1910. $modalInstance.close('success');
  1911. } else {
  1912. Alert.swal({
  1913. title: "操作失败",
  1914. text: "操作失败, 请稍后再试!",
  1915. type: "error"
  1916. });
  1917. }
  1918. });
  1919. }
  1920. $scope.cancel = function () {
  1921. $modalInstance.dismiss('cancel');
  1922. }
  1923. },
  1924. size: 'sm',
  1925. resolve: {
  1926. api_bpm: function () {
  1927. return api_bpm;
  1928. },
  1929. modelData: function () {
  1930. return model;
  1931. },
  1932. currentUserId: function () {
  1933. return loginUser.id;
  1934. },
  1935. Alert: function () {
  1936. return SweetAlert;
  1937. },
  1938. api_user_data: function () {
  1939. return api_user_data;
  1940. }
  1941. }
  1942. });
  1943. modalInstance.result.then(function (selectedItem) {
  1944. if (selectedItem == 'success') {
  1945. defaultFilterData.assignee = loginUser.id;
  1946. $scope.refreshData('expand-right', defaultFilterData);
  1947. }
  1948. });
  1949. }
  1950. // 转派弹窗
  1951. $scope.rotate = function (model) {
  1952. console.log(model)
  1953. var modalInstance = $modal.open({
  1954. templateUrl: 'assets/views/incident/tpl/rotate.tpl.html',
  1955. controller: function ($scope, $modalInstance, api_bpm, modelData, currentUserId, Alert, api_user_data) {
  1956. console.log(model);
  1957. $scope.roleList = {
  1958. 'idx': 0,
  1959. 'sum': 100,
  1960. 'user': {
  1961. 'roledata': {
  1962. 'rolecode': ''
  1963. },
  1964. 'groupdata': {
  1965. 'id': ''
  1966. },
  1967. 'selectType': 1
  1968. }
  1969. }
  1970. for (var i = 0; i < loginUser.role.length; i++) {
  1971. // console.log(loginUser.role[i])
  1972. if (loginUser.role[i].role == '一线支持人员') {
  1973. $scope.roleList.user.roledata.rolecode = loginUser.role[i].rolecode;
  1974. $scope.upRole = loginUser.role[i].role;
  1975. }
  1976. if (loginUser.role[i].role == '二线支持人员') {
  1977. $scope.roleList.user.roledata.rolecode = loginUser.role[i].rolecode;
  1978. $scope.upRole = loginUser.role[i].role;
  1979. }
  1980. if (loginUser.role[i].role == '事件经理') {
  1981. $scope.roleList.user.roledata.rolecode = loginUser.role[i].rolecode;
  1982. $scope.upRole = loginUser.role[i].role;
  1983. }
  1984. }
  1985. var userId = loginUser.id;
  1986. var taskId = model.taskId;
  1987. var postData = {};
  1988. var formKey = model.formKey;
  1989. var processInstanceId = model.processInstanceId;
  1990. $scope.choosUser = {};
  1991. api_configure_form.renderForm(formKey, userId, processInstanceId).then(function (data) {
  1992. postData = data.model;
  1993. })
  1994. api_user_data.fetchDataList('group', {
  1995. "idx": 0,
  1996. "sum": 100
  1997. }).then(function (data) {
  1998. $scope.group = data.list;
  1999. })
  2000. $scope.onChangeGroup = function (item) {
  2001. $scope.roleList.user.groupdata.id = $scope.choosUser.group.id
  2002. console.log($scope.choosUser);
  2003. if ($scope.choosUser.group) {
  2004. api_user_data.fetchDataList('user', $scope.roleList).then(function (data) {
  2005. console.log(data);
  2006. if (data.list.length == 0) {
  2007. Alert.swal({
  2008. title: "暂无处理人数据",
  2009. text: "该工作组暂无转派对象!",
  2010. type: "error"
  2011. });
  2012. return;
  2013. } else {
  2014. $scope.user = data.list;
  2015. }
  2016. })
  2017. }
  2018. }
  2019. $scope.ok = function () {
  2020. if ($scope.choosUser.handlerUser) {
  2021. postData.handler_code = 'forward';
  2022. postData.incident.handlerUser = $scope.choosUser.handlerUser;
  2023. postData.incident.assignee = postData.assignee = $scope.choosUser.handlerUser.id;
  2024. console.log(postData);
  2025. } else {
  2026. Alert.swal({
  2027. title: "操作失败",
  2028. text: "请选择转派对象信息!",
  2029. type: "error"
  2030. });
  2031. return;
  2032. }
  2033. api_bpm.upgrade(postData, taskId, userId, 'completeTask').then(function (response) {
  2034. console.log(response)
  2035. if (response.status == 200) {
  2036. Alert.swal({
  2037. title: "操作成功!",
  2038. confirmButtonColor: "#007AFF",
  2039. type: "success"
  2040. });
  2041. $modalInstance.close('success');
  2042. } else if (response.status == 500) {
  2043. Alert.swal({
  2044. title: "操作失败",
  2045. text: "该事件已被提取,请刷新页面!",
  2046. type: "error"
  2047. });
  2048. $modalInstance.close('success');
  2049. } else {
  2050. Alert.swal({
  2051. title: "操作失败",
  2052. text: "操作失败, 请稍后再试!",
  2053. type: "error"
  2054. });
  2055. }
  2056. });
  2057. }
  2058. $scope.cancel = function () {
  2059. $modalInstance.dismiss('cancel');
  2060. }
  2061. },
  2062. size: 'sm',
  2063. resolve: {
  2064. api_bpm: function () {
  2065. return api_bpm;
  2066. },
  2067. modelData: function () {
  2068. return model;
  2069. },
  2070. currentUserId: function () {
  2071. return loginUser.id;
  2072. },
  2073. Alert: function () {
  2074. return SweetAlert;
  2075. },
  2076. api_user_data: function () {
  2077. return api_user_data;
  2078. }
  2079. }
  2080. });
  2081. modalInstance.result.then(function (selectedItem) {
  2082. if (selectedItem == 'success') {
  2083. defaultFilterData.assignee = loginUser.id;
  2084. $scope.refreshData('expand-right', defaultFilterData);
  2085. }
  2086. });
  2087. }
  2088. // 指派弹窗baba
  2089. $scope.toAssign = function (model) {
  2090. console.log(model)
  2091. var modalInstance = $modal.open({
  2092. templateUrl: 'assets/views/incident/tpl/toAssign.tpl.html',
  2093. controller: function ($scope, $modalInstance, api_bpm_domain, modelData, currentUserId, Alert, api_user_data) {
  2094. console.log(model,loginUser);
  2095. $scope.assignUser = null;
  2096. $scope.user = [];
  2097. api_user_data.fetchDataList('user', {
  2098. "idx": 0,
  2099. "sum": 100,
  2100. user: {
  2101. roledata: { rolecode: "first-line support" },
  2102. roledata2: { rolecode: "second-line support" },
  2103. selectType: "1"
  2104. }
  2105. }).then(function (data) {
  2106. $scope.user = data.list;
  2107. })
  2108. $scope.onChangeRotateUser = function(item){
  2109. $scope.assignUser = item.id;
  2110. }
  2111. $scope.ok = function () {
  2112. if (!$scope.assignUser){
  2113. Alert.swal({
  2114. title: "操作失败",
  2115. text: "请选择转派对象信息!",
  2116. type: "error"
  2117. });
  2118. return;
  2119. }
  2120. api_bpm_domain.delegateTask(model.taskId, {assginee:$scope.assignUser}).then(function (response) {
  2121. console.log(response)
  2122. if (response.status == 200) {
  2123. Alert.swal({
  2124. title: "操作成功!",
  2125. confirmButtonColor: "#007AFF",
  2126. type: "success"
  2127. });
  2128. $modalInstance.close('success');
  2129. } else {
  2130. Alert.swal({
  2131. title: "操作失败",
  2132. text: "操作失败, 请稍后再试!",
  2133. type: "error"
  2134. });
  2135. }
  2136. });
  2137. }
  2138. $scope.cancel = function () {
  2139. $modalInstance.dismiss('cancel');
  2140. }
  2141. },
  2142. size: 'sm',
  2143. resolve: {
  2144. api_bpm: function () {
  2145. return api_bpm;
  2146. },
  2147. modelData: function () {
  2148. return model;
  2149. },
  2150. currentUserId: function () {
  2151. return loginUser.id;
  2152. },
  2153. Alert: function () {
  2154. return SweetAlert;
  2155. },
  2156. api_user_data: function () {
  2157. return api_user_data;
  2158. }
  2159. }
  2160. });
  2161. modalInstance.result.then(function (selectedItem) {
  2162. if (selectedItem == 'success') {
  2163. defaultFilterData.assignee = loginUser.id;
  2164. $scope.refreshData('expand-right', defaultFilterData);
  2165. }
  2166. });
  2167. }
  2168. // 新增处理日志弹窗baba
  2169. $scope.toHandlerLog = function (model) {
  2170. console.log(model)
  2171. var modalInstance = $modal.open({
  2172. templateUrl: 'assets/views/incident/tpl/toHandlerLog.tpl.html',
  2173. controller: function ($scope, $modalInstance, api_bpm_domain,api_bpm_data, modelData, currentUserId, Alert, api_user_data) {
  2174. console.log(model,loginUser);
  2175. $scope.handlerLog = '';
  2176. $scope.user = [];
  2177. $scope.ok = function () {
  2178. if (!$scope.handlerLog.trim()){
  2179. Alert.swal({
  2180. title: "操作失败",
  2181. text: "请填写处理日志!",
  2182. type: "error"
  2183. });
  2184. return;
  2185. }
  2186. api_bpm_data.addData('operationLog',{operationLog:{opType:'handlerLog',opValue:$scope.handlerLog,extra1:model.id}}).then(function(response){
  2187. console.log(response)
  2188. if (response.status == 200) {
  2189. Alert.swal({
  2190. title: "操作成功!",
  2191. confirmButtonColor: "#007AFF",
  2192. type: "success"
  2193. });
  2194. $modalInstance.close('success');
  2195. } else {
  2196. Alert.swal({
  2197. title: "操作失败",
  2198. text: "操作失败, 请稍后再试!",
  2199. type: "error"
  2200. });
  2201. }
  2202. });
  2203. }
  2204. $scope.cancel = function () {
  2205. $modalInstance.dismiss('cancel');
  2206. }
  2207. },
  2208. size: 'sm',
  2209. resolve: {
  2210. api_bpm: function () {
  2211. return api_bpm;
  2212. },
  2213. modelData: function () {
  2214. return model;
  2215. },
  2216. currentUserId: function () {
  2217. return loginUser.id;
  2218. },
  2219. Alert: function () {
  2220. return SweetAlert;
  2221. },
  2222. api_user_data: function () {
  2223. return api_user_data;
  2224. }
  2225. }
  2226. });
  2227. modalInstance.result.then(function (selectedItem) {
  2228. if (selectedItem == 'success') {
  2229. defaultFilterData.assignee = loginUser.id;
  2230. $scope.refreshData('expand-right', defaultFilterData);
  2231. }
  2232. });
  2233. }
  2234. // 协同弹窗
  2235. $scope.cooperate = function (model) {
  2236. console.log(model)
  2237. var modalInstance = $modal.open({
  2238. templateUrl: 'assets/views/incident/tpl/cooperate.tpl.html',
  2239. controller: function ($scope, $modalInstance, APIService, modelData, currentUserId, Alert) {
  2240. var receiveTask = function (receive_code, modelData) {
  2241. var data = {
  2242. 'receive_code': receive_code
  2243. };
  2244. if (modelData) {
  2245. return {
  2246. taskId: modelData.taskId,
  2247. data: data
  2248. };
  2249. } else {
  2250. return 'error';
  2251. }
  2252. };
  2253. $scope.title = "提示";
  2254. // $scope.connect = "升级单选组件";
  2255. $scope.ok = function () {
  2256. //接收任务//请求重新指派
  2257. var data = receiveTask($scope.receive_code, modelData);
  2258. APIService.claimAndCompletedTask(data.taskId, {
  2259. userId: currentUserId,
  2260. receive_code: "handler"
  2261. }).then(function (response) {
  2262. if (response.status == 200) {
  2263. Alert.swal({
  2264. title: "操作成功!",
  2265. confirmButtonColor: "#007AFF",
  2266. type: "success"
  2267. });
  2268. $modalInstance.close('success');
  2269. } else if (response.status == 500) {
  2270. Alert.swal({
  2271. title: "操作失败",
  2272. text: "该事件已被提取,请刷新页面!",
  2273. type: "error"
  2274. });
  2275. $modalInstance.close('success');
  2276. } else {
  2277. Alert.swal({
  2278. title: "操作失败",
  2279. text: "操作失败, 请稍后再试!",
  2280. type: "error"
  2281. });
  2282. }
  2283. });
  2284. }
  2285. $scope.cancel = function () {
  2286. $modalInstance.dismiss('cancel');
  2287. }
  2288. },
  2289. size: 'sm',
  2290. resolve: {
  2291. APIService: function () {
  2292. return api_bpm_domain;
  2293. },
  2294. modelData: function () {
  2295. return model;
  2296. },
  2297. currentUserId: function () {
  2298. return loginUser.id;
  2299. },
  2300. Alert: function () {
  2301. return SweetAlert;
  2302. }
  2303. }
  2304. });
  2305. modalInstance.result.then(function (selectedItem) {
  2306. if (selectedItem == 'success') {
  2307. defaultFilterData.assignee = loginUser.id;
  2308. $scope.refreshData('expand-right', defaultFilterData);
  2309. }
  2310. });
  2311. }
  2312. if ($stateParams.model) {
  2313. if (JSON.parse($stateParams.model).searchType && JSON.parse($stateParams.model).searchType != null) {
  2314. $scope.searchType = JSON.parse($stateParams.model).searchType;
  2315. } else {
  2316. $scope.searchType = "todo";
  2317. }
  2318. } else {
  2319. $scope.searchType = "todo";
  2320. }
  2321. // if (JSON.parse($stateParams.model).searchType) {
  2322. // if ($rootScope.user.group) {
  2323. // var defaultFilterData = {
  2324. // "assignee": $rootScope.user.id,
  2325. // "candidateGroups": loginuserGroup,
  2326. // "searchType": JSON.parse($stateParams.model).searchType,
  2327. // "idx": 0,
  2328. // "sum": mun
  2329. // };
  2330. // } else {
  2331. // var defaultFilterData = {
  2332. // "assignee": $rootScope.user.id,
  2333. // "searchType": JSON.parse($stateParams.model).searchType,
  2334. // "idx": 0,
  2335. // "sum": mun
  2336. // };
  2337. // }
  2338. // } else {
  2339. if ($rootScope.user.group) {
  2340. var defaultFilterData = {
  2341. "assignee": loginUser.id,
  2342. "candidateGroups": loginuserGroup,
  2343. "searchType": "todo",
  2344. "idx": 0,
  2345. "sum": mun
  2346. };
  2347. } else {
  2348. var defaultFilterData = {
  2349. "assignee": $rootScope.user.id,
  2350. "searchType": "todo",
  2351. "idx": 0,
  2352. "sum": mun
  2353. };
  2354. }
  2355. // }
  2356. // var defaultFilterData = {
  2357. // "assignee":$rootScope.user.id,
  2358. // "candidateGroups":$rootScope.user.group[0].id,
  2359. // "idx":0,
  2360. // "sum":mun
  2361. // };
  2362. if (angular.isDefined($rootScope.search) && angular.isDefined($rootScope.search.incident)) {
  2363. defaultFilterData['searchType'] = $rootScope.search.incident;
  2364. $scope.searchType = $rootScope.search.incident;
  2365. }
  2366. // if ($rootScope['cmdbs'] != 'incident') { $rootScope.idx = 1 }
  2367. // if (angular.isDefined($rootScope.idx) && $rootScope.cmdbs != "false") {
  2368. // $rootScope['cmdbs'] = 'incident';
  2369. // defaultFilterData.idx = $rootScope.idx - 1;
  2370. // } else { $rootScope.cmdbs = ""; }
  2371. $scope.ldloading = {};
  2372. // $scope.Change= function(upTypes){
  2373. // if(angular.isDefined(upTypes)&&upTypes=='upincident'){
  2374. // $state.go('app.problem.incident',{});
  2375. // }
  2376. // else if(angular.isDefined(upTypes)&&upTypes=='upchange'){
  2377. // $state.go('app.change.incident',{});
  2378. // }
  2379. // }
  2380. //事件类型筛选
  2381. console.log($state);
  2382. if($state.params.tab){
  2383. $scope.searchstate = $state.params.tab;
  2384. }else{
  2385. $scope.searchstate = 'todo';//baba
  2386. }
  2387. $scope.onChange = function (searchType) {
  2388. // console.log(defaultFilterData,'fanbu')
  2389. if(defaultFilterData.incident){
  2390. var lsObject = defaultFilterData.incident;
  2391. }
  2392. $scope.searchstate = searchType;
  2393. defaultFilterData = $scope.memoryfilterData;
  2394. defaultFilterData.incident = lsObject;
  2395. defaultFilterData['searchType'] = searchType;
  2396. defaultFilterData.assignee = loginUser.id;
  2397. // -----------seimin-------------
  2398. if(searchType!=='all'){
  2399. $scope.searchkeys = {selectType:{}};//seimin
  2400. }
  2401. if(searchType!== 'all'&&defaultFilterData.incident&&defaultFilterData.incident.selectType){
  2402. delete defaultFilterData.incident.selectType;
  2403. }
  2404. if(searchType== 'all'){
  2405. if(!defaultFilterData.incident||!defaultFilterData.incident.selectType){
  2406. $scope.searchkeys = {selectType:{id:'0',name:'否'}};//seimin
  2407. }
  2408. }
  2409. if(Object.prototype.toString.call(defaultFilterData.incident) == "[object Object]"&&Object.keys(defaultFilterData.incident).length == 0){
  2410. delete defaultFilterData.incident;
  2411. }
  2412. // -----------seimin-------------
  2413. $scope.refreshData('expand-right', defaultFilterData);
  2414. $interval.cancel($scope.timer);
  2415. $scope.timer = $interval(function () {
  2416. $scope.jry_refresh()
  2417. }, $rootScope.refreshTime);
  2418. }
  2419. // 是否逾期下拉框选择seimin
  2420. $scope.selectTypeChange = function(){
  2421. console.log($scope.searchkeys.selectType,66666);
  2422. if(window.sessionStorage.getItem('isGoyuqi') == 'yes'){
  2423. $scope.searchkeys.selectType = {id:'2',name:'是'};
  2424. // window.sessionStorage.removeItem('isGoyuqi');//seimin
  2425. }
  2426. var ids = $scope.searchkeys.selectType.id
  2427. if(defaultFilterData.incident){
  2428. defaultFilterData.incident.selectType = ids;//seimin
  2429. }else{
  2430. defaultFilterData.incident = {
  2431. selectType:ids
  2432. };
  2433. }
  2434. defaultFilterData.searchType = 'all';
  2435. console.log(defaultFilterData,2222)
  2436. $scope.onChange('all');
  2437. }
  2438. //获取列表数据
  2439. $scope.refreshData = function (style, filterData) {
  2440. console.log(filterData,9090)
  2441. if (filterData && filterData.incident && filterData.incident.area) {
  2442. filterData.incident.place = {
  2443. id: filterData.incident.place ? filterData.incident.place.id : '',
  2444. area: filterData.incident.area
  2445. }
  2446. delete filterData.incident.area
  2447. }
  2448. $scope.ldloading[style.replace('-', '_')] = true;
  2449. if (angular.isUndefined(filterData)) {
  2450. if (sessionStorage.searchincident) {
  2451. filterData = JSON.parse(sessionStorage.getItem("searchincident"));
  2452. if ($scope.searchType) {
  2453. filterData.searchType = $scope.searchType;
  2454. }
  2455. $scope.gridOptions.paginationCurrentPage = 1 + filterData.idx;
  2456. if($state.params.tab){
  2457. $scope.searchstate = $state.params.tab;
  2458. filterData.searchType = $state.params.tab;
  2459. sessionStorage.setItem('searchincident',JSON.stringify(filterData));
  2460. }else{
  2461. $scope.searchstate = filterData.searchType;
  2462. }
  2463. if($state.params.date == 'today'){
  2464. $scope.othcode = {};
  2465. $scope.searchkeys.acceptDate = new Date();
  2466. $scope.searchkeys.acceptDateEnd = new Date();
  2467. filterData.incident = {acceptDate:moment().format('YYYY-MM-DD 00:00:00'),acceptDateEnd:moment().format('YYYY-MM-DD 23:59:59')};
  2468. sessionStorage.setItem("searchincident",JSON.stringify(filterData));
  2469. }
  2470. if($state.params.state){
  2471. $scope.searchkeys.acceptDate = null;
  2472. $scope.searchkeys.acceptDateEnd = null;
  2473. var obj = $scope.state.find(function(v){return $state.params.state == v.id});
  2474. $scope.othcode = {state:obj};
  2475. filterData.incident = {statusId: $state.params.state};
  2476. sessionStorage.setItem("searchincident",JSON.stringify(filterData));
  2477. }
  2478. if (filterData.incident && filterData.incident.category) {
  2479. delete filterData.incident.category
  2480. }
  2481. } else {
  2482. filterData = defaultFilterData;
  2483. if ($scope.searchType) {
  2484. filterData.searchType = $scope.searchType;
  2485. if (filterData.searchType == 'overDate') {
  2486. $scope.searchstate = 'overDate';
  2487. }
  2488. }
  2489. if($state.params.tab){
  2490. $scope.searchstate = $state.params.tab;
  2491. filterData.searchType = $state.params.tab;
  2492. sessionStorage.setItem('searchincident',JSON.stringify(filterData));
  2493. }else{
  2494. $scope.searchstate = filterData.searchType;
  2495. }
  2496. if($state.params.date == 'today'){
  2497. $scope.othcode = {};
  2498. $scope.searchkeys.acceptDate = new Date();
  2499. $scope.searchkeys.acceptDateEnd = new Date();
  2500. filterData.incident = {acceptDate:moment().format('YYYY-MM-DD 00:00:00'),acceptDateEnd:moment().format('YYYY-MM-DD 23:59:59')};
  2501. sessionStorage.setItem("searchincident",JSON.stringify(filterData));
  2502. }
  2503. if($state.params.state){
  2504. $scope.searchkeys.acceptDate = null;
  2505. $scope.searchkeys.acceptDateEnd = null;
  2506. var obj = $scope.state.find(function(v){return $state.params.state == v.id});
  2507. $scope.othcode = {state:obj};
  2508. filterData.incident = {statusId: $state.params.state};
  2509. sessionStorage.setItem("searchincident",JSON.stringify(filterData));
  2510. }
  2511. }
  2512. }
  2513. // if (angular.isDefined($scope.searchTypes)) {
  2514. // $rootScope['search'] = {};
  2515. // filterData['searchType'] = $scope.searchTypes;
  2516. // $rootScope['search']['incident'] = $scope.searchTypes;
  2517. // }
  2518. // if (sessionStorage.idx) {
  2519. // filterData.idx = Number(sessionStorage.idx);
  2520. // $scope.gridOptions.idx = Number(sessionStorage.idx) + 1;
  2521. // }
  2522. console.log(filterData,11111);
  2523. if(window.sessionStorage.getItem('isGoyuqi') == 'yes'){
  2524. $scope.searchkeys.selectType = {id:'2',name:'是'};
  2525. if(filterData.incident&&filterData.incident.selectType){
  2526. filterData.incident.selectType = '2';
  2527. }else{
  2528. filterData.incident = {
  2529. selectType : '2'
  2530. }
  2531. }
  2532. window.sessionStorage.removeItem('isGoyuqi');//seimin
  2533. }
  2534. $scope.myData = [];
  2535. sessionStorage['searchincident'] = angular.copy(JSON.stringify(filterData));
  2536. // $scope.gridOptions.paginationCurrentPage = 1 + filterData.idx;
  2537. //var start = new Date();
  2538. //var sec = $interval(function () {
  2539. //$scope.callsPending++;
  2540. $scope.memoryfilterData = filterData;
  2541. $scope.gridOptions['sum'] = filterData.sum;
  2542. api_bpm_domain.fetchtask(pdKey, filterData).then(function (data) {
  2543. if (data.data) {
  2544. // if(filterData.searchType == 'all'){
  2545. // //跳到全部seimin
  2546. // $scope.searchstate = 'all';
  2547. // }
  2548. var myData = Restangular.stripRestangular(data);
  2549. var list = [];
  2550. $scope.gridOptions['totalItems'] = myData.resultCount;
  2551. $scope.myData = myData.data;
  2552. for (var i = 0; i < $scope.myData.length; i++) {
  2553. $scope.myData[i]['item'] = i + 1 + filterData.idx * filterData.sum
  2554. }
  2555. } else {
  2556. SweetAlert.swal({
  2557. title: "系统错误",
  2558. text: "请稍后再试!",
  2559. type: "error"
  2560. });
  2561. }
  2562. $scope.ldloading[style.replace('-', '_')] = false;
  2563. }, function () {
  2564. $scope.ldloading[style.replace('-', '_')] = false;
  2565. });
  2566. };
  2567. $scope.refreshData2 = function (style, filterData) {
  2568. $scope.ldloading[style.replace('-', '_')] = true;
  2569. if (angular.isUndefined(filterData)) {
  2570. if (sessionStorage.searchincident) {
  2571. filterData = JSON.parse(sessionStorage.getItem("searchincident"));
  2572. if ($scope.searchType) {
  2573. filterData.searchType = $scope.searchType;
  2574. }
  2575. $scope.gridOptions.paginationCurrentPage = 1 + filterData.idx;
  2576. // $scope.searchstate = filterData.searchType;
  2577. if($state.params.tab){
  2578. $scope.searchstate = $state.params.tab;
  2579. filterData.searchType = $state.params.tab;
  2580. sessionStorage.setItem('searchincident',JSON.stringify(filterData));
  2581. }else{
  2582. $scope.searchstate = filterData.searchType;
  2583. }
  2584. if($state.params.date == 'today'){
  2585. $scope.othcode = {};
  2586. $scope.searchkeys.acceptDate = new Date();
  2587. $scope.searchkeys.acceptDateEnd = new Date();
  2588. filterData.incident = {acceptDate:moment().format('YYYY-MM-DD 00:00:00'),acceptDateEnd:moment().format('YYYY-MM-DD 23:59:59')};
  2589. sessionStorage.setItem("searchincident",JSON.stringify(filterData));
  2590. }
  2591. if($state.params.state){
  2592. $scope.searchkeys.acceptDate = null;
  2593. $scope.searchkeys.acceptDateEnd = null;
  2594. var obj = $scope.state.find(function(v){return $state.params.state == v.id});
  2595. $scope.othcode = {state:obj};
  2596. filterData.incident = {statusId: $state.params.state};
  2597. sessionStorage.setItem("searchincident",JSON.stringify(filterData));
  2598. }
  2599. if (filterData.incident && filterData.incident.category) {
  2600. delete filterData.incident.category
  2601. }
  2602. } else {
  2603. filterData = defaultFilterData;
  2604. if ($scope.searchType) {
  2605. filterData.searchType = $scope.searchType;
  2606. if (filterData.searchType == 'overDate') {
  2607. $scope.searchstate = 'overDate';
  2608. }
  2609. }
  2610. }
  2611. }
  2612. // if (angular.isDefined($scope.searchTypes)) {
  2613. // $rootScope['search'] = {};
  2614. // filterData['searchType'] = $scope.searchTypes;
  2615. // $rootScope['search']['incident'] = $scope.searchTypes;
  2616. // }
  2617. // if (sessionStorage.idx) {
  2618. // filterData.idx = Number(sessionStorage.idx);
  2619. // $scope.gridOptions.idx = Number(sessionStorage.idx) + 1;
  2620. // }
  2621. // $scope.myData = [];
  2622. sessionStorage['searchincident'] = angular.copy(JSON.stringify(filterData));
  2623. // $scope.gridOptions.paginationCurrentPage = 1 + filterData.idx;
  2624. //var start = new Date();
  2625. //var sec = $interval(function () {
  2626. //$scope.callsPending++;
  2627. $scope.memoryfilterData = filterData;
  2628. $scope.gridOptions['sum'] = filterData.sum;
  2629. api_bpm_domain.fetchtask(pdKey, filterData).then(function (data) {
  2630. if (data.data) {
  2631. var myData = Restangular.stripRestangular(data);
  2632. var list = [];
  2633. $scope.gridOptions['totalItems'] = myData.resultCount;
  2634. $scope.myData = myData.data;
  2635. for (var i = 0; i < $scope.myData.length; i++) {
  2636. $scope.myData[i]['item'] = i + 1 + filterData.idx * filterData.sum
  2637. }
  2638. } else {
  2639. SweetAlert.swal({
  2640. title: "系统错误",
  2641. text: "请稍后再试!",
  2642. type: "error"
  2643. });
  2644. }
  2645. $scope.ldloading[style.replace('-', '_')] = false;
  2646. }, function () {
  2647. $scope.ldloading[style.replace('-', '_')] = false;
  2648. });
  2649. };
  2650. // 进入页面时111
  2651. if(window.sessionStorage.getItem('searchincident')){
  2652. var varLin = JSON.parse(window.sessionStorage.getItem('searchincident'));
  2653. if(varLin.incident&&varLin.incident.selectType){
  2654. if(varLin.incident.selectType == '2'){
  2655. console.log(defaultFilterData)
  2656. $scope.searchkeys.selectType = {id:'2',name:'是'};
  2657. }else if(varLin.incident.selectType == '0'){
  2658. console.log(defaultFilterData)
  2659. $scope.searchkeys.selectType = {id:'0',name:'否'};
  2660. }
  2661. }
  2662. }
  2663. if(window.sessionStorage.getItem('isGoyuqi') === 'yes'){
  2664. $scope.selectTypeChange();
  2665. }else{
  2666. $scope.refreshData('expand-right');
  2667. }
  2668. $scope.timer = $interval(function () {
  2669. $scope.jry_refresh()
  2670. }, $rootScope.refreshTime);
  2671. $scope.$on('$destroy', function () {
  2672. $interval.cancel($scope.timer)
  2673. });
  2674. }]);
  2675. //操作按钮权限控制
  2676. app.controller('IncidentOperCtrl', ['$rootScope', '$http', '$scope', '$modal', '$state', 'api_bpm_data', function ($rootScope, $http, $scope, $modal, $state, api_bpm_data) {
  2677. // console.log('$rootScope.user3='+JSON.stringify($scope.item));
  2678. // console.log($scope.item)
  2679. var loginUser = $rootScope.user;
  2680. console.log(loginUser.role)
  2681. $scope.chuli = false;
  2682. $scope.qiangdan = false;
  2683. $scope.dayin = false;
  2684. $scope.huifang = false;
  2685. $scope.assign = false;
  2686. if(loginUser.role.length){
  2687. $scope.assign = loginUser.role.some(function(v){
  2688. return v.rolecode === "incident-category-manager"||v.rolecode === 'incident manager';
  2689. })
  2690. }
  2691. for (var i = 0; i < loginUser.menu.length; i++) {
  2692. if (loginUser.menu[i].link == "shijianliebiao_chuli") {
  2693. $scope.chuli = true
  2694. }
  2695. if (loginUser.menu[i].link == "shijianliebiao_qiangdan") {
  2696. $scope.qiangdan = true
  2697. }
  2698. if (loginUser.menu[i].link == "shijianliebiao_dayin") {
  2699. $scope.dayin = true
  2700. }
  2701. if (loginUser.menu[i].link == "shijianliebiao_huifang") {
  2702. $scope.huifang = true
  2703. }
  2704. }
  2705. $scope.up = true;
  2706. $scope.fuwutaiRenYuan = false;//服务台人员
  2707. for (var i = 0; i < $rootScope.user.role.length; i++) {
  2708. // console.log($rootScope.user.role[i])
  2709. if ($rootScope.user.role[i].role == '事件经理') {
  2710. $scope.up = false;
  2711. }
  2712. if ($rootScope.user.role[i].id == 29701) {
  2713. $scope.fuwutaiRenYuan = true;
  2714. }
  2715. }
  2716. if ($scope.item.state.id != null && $scope.item.handlerUser != null) {
  2717. // 当前登陆人和当前处理人相同,并且状态非已关闭
  2718. if ($rootScope.user.id == $scope.item.handlerUser.id && $scope.item.state.id != 1546) {
  2719. $scope.item.chaozuoPower = true;
  2720. // if ($scope.item.state.id == 1544) {
  2721. // $scope.item.coordination = true;
  2722. // }
  2723. }
  2724. }
  2725. $rootScope.callid = $scope.item.callID;
  2726. if ($scope.item.callID) {
  2727. $scope.item.listen = true;
  2728. } else {
  2729. $scope.item.listen = false;
  2730. }
  2731. // 抢单操作权限
  2732. // if ($scope.item.state.id != 1546 && $scope.item.handlerUser == null) {
  2733. // angular.forEach($rootScope.user.group, function (item) {
  2734. // if (item.id == $scope.item.candidateGroups) {
  2735. // $scope.item.tiquPower = true;
  2736. // }
  2737. // })
  2738. $rootScope.user.group.forEach(function (item, v) {
  2739. if (item.id == $scope.item.candidateGroups) {
  2740. $scope.item.tiquPower = true;
  2741. }
  2742. })
  2743. // }
  2744. //修改页面显示判断
  2745. $scope.jry_modify = function () {
  2746. var jry_role = false;
  2747. for (var i = 0; i < $rootScope.user.role.length; i++) {
  2748. if ($rootScope.user.role[i].role == "服务台" && $rootScope.user.role[i].rolecode == "call center") {
  2749. jry_role = true
  2750. }
  2751. }
  2752. if (jry_role) {
  2753. return true
  2754. } else {
  2755. return false
  2756. }
  2757. }
  2758. // 回访操作权限
  2759. for (var obj in $rootScope.user.role) {
  2760. // console.log($rootScope.user.role[obj].rolecode)
  2761. if ($rootScope.user.role[obj].rolecode == 'call center') {
  2762. if ($scope.item.state.id == 1546) {
  2763. $scope.item.huifang = true;
  2764. } else {
  2765. // $scope.item.xiugai = true;
  2766. }
  2767. }
  2768. }
  2769. // 评价操作权限
  2770. $scope.jry_evaluateShow = function () {
  2771. var jry_role = false;
  2772. for (var i = 0; i < $rootScope.user.role.length; i++) {
  2773. if ($rootScope.user.role[i].role == "事件经理" && $rootScope.user.role[i].rolecode == "incident manager") {
  2774. jry_role = true
  2775. }
  2776. }
  2777. // if($scope.item.groupScore!=undefined){
  2778. if ($scope.item.state.id == 1546 && jry_role && $scope.item.groupScore.id == 220) {
  2779. return true
  2780. } else {
  2781. return false
  2782. }
  2783. // }
  2784. }
  2785. $scope.coordination = function () {
  2786. $scope.colobject.grid.appScope.coordination($scope.item);
  2787. }
  2788. $scope.look = function () {
  2789. //$state.go('app.detail', { formKey:'incident_back', pdKey:'incident', dataId: $scope.item.id});
  2790. $scope.colobject.grid.appScope.lookFunction($scope.item);
  2791. // console.log('$scope.item='+JSON.stringify($scope.item));
  2792. //$scope.doEdit($scope.item.id);
  2793. }
  2794. $scope.edit = function () {
  2795. // console.log($scope.item)
  2796. $scope.colobject.grid.appScope.selectRowFunction($scope.item);
  2797. // console.log('$scope.item='+JSON.stringify($scope.item));
  2798. // $scope.doEdit($scope.item.id);
  2799. }
  2800. $scope.configuration = function () {
  2801. console.log($scope.item);
  2802. $scope.colobject.grid.appScope.configuration($scope.item)
  2803. }
  2804. $scope.changeCenter = function () {
  2805. $scope.colobject.grid.appScope.changeClick($scope.item);
  2806. }
  2807. $scope.visit = function () {
  2808. $scope.colobject.grid.appScope.visit($scope.item);
  2809. }
  2810. $scope.print = function () { //print
  2811. api_bpm_data.fetchData('incident', $scope.item.id).then(function (res) {
  2812. $scope.colobject.grid.appScope.open(res.data);
  2813. })
  2814. // $scope.colobject.grid.appScope.open($scope.item);
  2815. }
  2816. // 升级
  2817. $scope.upgrade = function () { //print
  2818. $scope.colobject.grid.appScope.upgrade($scope.item);
  2819. // $scope.doEdit($scope.item.id);
  2820. }
  2821. // 转派
  2822. $scope.rotate = function () { //print
  2823. $scope.colobject.grid.appScope.rotate($scope.item);
  2824. // $scope.doEdit($scope.item.id);
  2825. }
  2826. // 指派
  2827. $scope.toAssign = function () { //print
  2828. $scope.colobject.grid.appScope.toAssign($scope.item);
  2829. // $scope.doEdit($scope.item.id);
  2830. }
  2831. // 新增处理日志
  2832. $scope.toHandlerLog = function () { //print
  2833. $scope.colobject.grid.appScope.toHandlerLog($scope.item);
  2834. // $scope.doEdit($scope.item.id);
  2835. }
  2836. // 协同
  2837. $scope.cooperate = function () { //print
  2838. $scope.colobject.grid.appScope.cooperate($scope.item);
  2839. // $scope.doEdit($scope.item.id);
  2840. }
  2841. // 升级问题
  2842. $scope.problem = function () {
  2843. console.log($scope.item)
  2844. console.log($scope.colobject.grid.appScope)
  2845. $scope.colobject.grid.appScope.problem($scope.item)
  2846. }
  2847. $scope.record = function () { //record
  2848. $scope.colobject.grid.appScope.play($scope.item);
  2849. // $scope.doEdit($scope.item.id);
  2850. }
  2851. $scope.handler = function () {
  2852. $scope.colobject.grid.appScope.acceptTaskAction($scope.item);
  2853. $scope.doComment($scope.item.id);
  2854. }
  2855. $scope.follow = function () {
  2856. $scope.colobject.grid.appScope.followFunction($scope.item);
  2857. }
  2858. //查看
  2859. $scope.toDetail = function (data) {
  2860. //console.log('data='+JSON.stringify(data));
  2861. console.log(data);
  2862. window.open(location.origin+'/#/app/incident/detail/incident_back/incident/'+data.id+'/'+data.taskId+'/'+data.processInstanceId+'//');
  2863. // $state.go('app.incident.detail', {
  2864. // formKey: 'incident_back',
  2865. // pdKey: 'incident',
  2866. // dataId: data.id,
  2867. // taskId: data.taskId,
  2868. // processInstanceId: data.processInstanceId
  2869. // });
  2870. };
  2871. // $scope.play = function() {
  2872. // // console.log($scope.item.callID)
  2873. // var modalInstance = $modal.open({
  2874. // templateUrl: 'assets/views/incident/tpl/audio.html',
  2875. // controller: function($scope, $modalInstance,$sce){
  2876. // $scope.data={
  2877. // "name":"视频",
  2878. // "url":"http://192.168.3.69:8088/recording/recording?callID="+$rootScope.callid
  2879. // };
  2880. // $scope.data.url = $sce.trustAsResourceUrl($scope.data.url);
  2881. // // $scope.audiourl={url:$sce.trustAsResourceUrl("http://192.168.3.69:8088/recording/recording?callID=218147232")};
  2882. // $scope.cancel = function() {
  2883. // $modalInstance.dismiss('cancel');
  2884. // };
  2885. // $modalInstance.close();
  2886. // }
  2887. // });
  2888. // };
  2889. }]);
  2890. //操作按钮
  2891. app.directive('incidentoperator', function () {
  2892. return {
  2893. restrict: 'E',
  2894. scope: {
  2895. item: '=',
  2896. colobject: '='
  2897. },
  2898. controller: 'IncidentOperCtrl',
  2899. template: '<div><div class="cl-effect-1 ui-grid-cell-contents pull-left" >' +
  2900. // '<a ng-click="look()" tooltip="查看" tooltip-placement="left"><i class="ti-eye"></i></a>'+
  2901. '<a ng-click="handler()" ng-show="{{item.state.id != 1546 &&!item.handlerUser&&item.tiquPower&&qiangdan}}" class="bianjifont" >抢单</a>' +
  2902. // '<a ng-click="changeCenter()" ng-show="jry_modify()" class="luyinfont">修改</a>' +
  2903. '<a ng-click="edit()" ng-show="{{item.chaozuoPower&&chuli}}" class="bianjifont">处理</a>' +
  2904. '<a ng-click="visit()" ng-show="{{item.huifang&&huifang}}" class="bianjifont">回访</a>' +
  2905. '<a ng-click="print()" ng-show="dayin" class="bianjifont" >打印</a>' +
  2906. '<a ng-click="toDetail(item)" class="bianjifont" >查看</a>' +
  2907. // '<a ng-click="jry_evaluate()" ng-show="jry_evaluateShow()" class="luyinfont" >评价</a>' +
  2908. // '<a ng-click="record()" ng-show="{{item.listen}}" class="luyinfont" >录音</a>' +
  2909. // '<a ng-click="rotate()" ng-show="{{item.state.id==4}}" class="rotate" >转派</a>' +
  2910. '<a ng-click="toAssign()" ng-show="{{(item.state.id==1543||item.state.id==1544)&&assign&&item.assignee}}" class="assign" >指派</a>' +
  2911. '<a ng-click="toHandlerLog()" ng-show="{{item.state.id==1544}}" class="assign" >新增处理日志</a>' +
  2912. // '<a ng-click="upgrade()" ng-show="{{up&&item.state.id==4&&item.currentRole!=' + "'incident manager'" + '}}" class="upgrade" >升级</a>' +
  2913. // '<a ng-click="problem()" ng-show="{{item.state.id==5&&item.currentRole!=' + "'incident manager'" + '}}" class="upgrade" >问题升级</a>' +
  2914. // '<a ng-click="configuration()" ng-show="{{item.state.id==5}}" class="bianjifont">变更升级</a>' +
  2915. // '<a ng-click="cooperate()" ng-show="{{item.state.id==4}}" class="cooperate" >协同</a>' +
  2916. // '<a ng-click="coordination()" ng-show="{{item.coordination}}" tooltip="添加协同人" tooltip-placement="left"><i class="icon iconfont icon-tianjiarenyuan adduserfont"></i></a>' +
  2917. // '<a class="ui-grid-cell-contents" ng-click="grid.appScope.open(row.entity)" tooltip="打印" tooltip-placement="left"><i class="ti-printer"></i></a>'+
  2918. // '<a ng-click="grid.appScope.play(row.entity)"ng-if="row.entity.callID" tooltip="播放录音" tooltip-placement="left"><i class="ti-microphone"></i></a>'+
  2919. // '<a ng-click="follow()" tooltip="状态跟踪" tooltip-placement="left"><i class="fa fa-location-arrow"></i></a>'+
  2920. '</div></div>'
  2921. };
  2922. });