incidentCtrl.js 100 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492
  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','api_bpm_schedule','api_statistic','api_flow', 'api_simple', 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,api_bpm_schedule,api_statistic,api_flow,api_simple) {
  3. //保存报修主体
  4. $scope.repairMain = JSON.parse(sessionStorage.getItem("repair_main"));
  5. $scope.wxIncidentWithCmdb = JSON.parse(sessionStorage.getItem("wxIncidentWithCmdb"));//资产
  6. $scope.incidentWithConsumable = JSON.parse(sessionStorage.getItem("incidentWithConsumable"));//耗材
  7. $rootScope.isFuwutai = JSON.parse(localStorage.getItem("isFuwutai")) ? true : false;
  8. // ----------------分割线 start-----------------
  9. console.log($state)
  10. // 显示隐藏
  11. $scope.isDeployment = false;
  12. $scope.deploymentHandler = function(){
  13. $scope.isDeployment = !$scope.isDeployment;
  14. console.log($('#filterSearch .incidentsearch:gt(7)'));
  15. if($scope.isDeployment){
  16. $('#filterSearch .incidentsearch:gt(7)').css('display', 'inline-block');
  17. }else{
  18. $('#filterSearch .incidentsearch:gt(7)').css('display', 'none');
  19. }
  20. }
  21. // -----------------分割线 end----------------
  22. // 是否逾期seimin
  23. $scope.selectType = [
  24. // { id: '2', name: '是' },
  25. // { id: '0', name: '否' }
  26. ];
  27. $scope.getOverdueState = function () {
  28. var data = {
  29. key: "overdue_state",
  30. type: "list",
  31. };
  32. api_wechatfile.getDictionary(data).then(function (res) {
  33. $scope.selectType = res;
  34. });
  35. };
  36. $scope.getOverdueState();
  37. $scope.tabs = [
  38. // {key: 'all', value: '全部事件', num: ''},
  39. {key: 'todo', value: '待我接单', num: ''},
  40. {key: 'doing', value: '待我处理', num: ''},
  41. // {key: 'reassign', value: '重新指派', num: ''},
  42. // {key: 'callback', value: '待我回访', num: ''},
  43. {key: 'resolve', value: '由我解决', num: ''},
  44. {key: 'owns', value: '与我关联', num: ''},
  45. {key: 'storage', value: '暂存', num: ''},
  46. ]
  47. // /是否逾期
  48. $scope.langs = i18nService.getAllLangs();
  49. $scope.lang = 'zh-cn';
  50. i18nService.setCurrentLang($scope.lang);
  51. $scope.myData = [];
  52. var loginUser = $rootScope.user;
  53. $scope.allFlag = false;//全部事件
  54. $scope.daochu = false;//导出
  55. $scope.huifang = false;//回访
  56. for (var i = 0; i < loginUser.menu.length; i++) {
  57. if (loginUser.menu[i].link == "shijianliebiao_all") {
  58. $scope.allFlag = true;
  59. $scope.tabs.splice(0, 0 , {key: 'all', value: '全部事件', num: ''});
  60. }
  61. if (loginUser.menu[i].link == "shijianliebiao_huifang") {
  62. $scope.huifang = true;
  63. let index = $scope.tabs.findIndex(v => v.key == 'resolve');
  64. $scope.tabs.splice(index, 0 , {key: 'callback', value: '待我回访', num: ''});
  65. }
  66. if (loginUser.menu[i].link == "shijianliebiao_reassign") {
  67. $scope.huifang = true;
  68. let index = $scope.tabs.findIndex(v => v.key == 'doing');
  69. $scope.tabs.splice(index + 1, 0 , {key: 'reassign', value: '重新指派', num: ''});
  70. }
  71. if (loginUser.menu[i].link == "shijianliebiao_daochu") {
  72. $scope.daochu = true
  73. }
  74. }
  75. var loginuserGroup = "";
  76. for (var i = 0; i < $rootScope.user.group.length; i++) {
  77. if (i == 0) {
  78. loginuserGroup = $rootScope.user.group[i].id;
  79. } else {
  80. loginuserGroup = loginuserGroup + "," + $rootScope.user.group[i].id;
  81. }
  82. }
  83. // 处理人,受理人,转派人
  84. var pdKey = $state.current.pdKey;
  85. $scope.gridOptions = {};
  86. $scope.gridOptions.data = 'myData';
  87. $scope.gridOptions.rowHeight = 54;
  88. $scope.gridOptions.enableColumnResizing = true;
  89. $scope.gridOptions.enableFiltering = false;
  90. $scope.gridOptions.enableGridMenu = true;
  91. $scope.gridOptions.enableSelectAll = true;
  92. $scope.gridOptions.enableRowSelection = true;
  93. $scope.gridOptions.showGridFooter = true;
  94. $scope.gridOptions.showColumnFooter = false;
  95. $scope.gridOptions.fastWatch = true;
  96. $scope.gridOptions.enableSorting = true;
  97. $scope.gridOptions.useExternalSorting = true;
  98. $scope.gridOptions.useExternalFiltering = false;
  99. $scope.gridOptions.useExternalPagination = true;
  100. $scope.gridOptions.paginationPageSizes = [10, 20, 50, 100];
  101. $scope.gridOptions.paginationPageSize = 10;
  102. $scope.gridOptions.multiSelect = true;
  103. var mun = $scope.gridOptions.paginationPageSize;
  104. $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>";
  105. $scope.gridOptions.rowIdentity = function (row) {
  106. return row.id;
  107. };
  108. $scope.gridOptions.getRowIdentity = function (row) {
  109. return row.id;
  110. };
  111. $scope.transferColor = function (item) {
  112. var color = "icon iconfont icon-zhengchang greenfont";
  113. if (item.colourInfo) {
  114. if (item.colourInfo.id == 1583) {
  115. color = "icon iconfont icon-yiyuqi redfont";
  116. } else if (item.colourInfo.id == 1584) {
  117. color = "iconfont icon-yuqixinxiu orangefont";
  118. }
  119. }
  120. return color;
  121. }
  122. $scope.transfertip = function (item) {
  123. var tip = "正常";
  124. if (item.colourInfo) {
  125. if (item.colourInfo.id == 1583) {
  126. tip = "已逾期";
  127. } else if (item.colourInfo.id == 1584) {
  128. tip = "即将逾期";
  129. } else if (item.colourInfo.id == 1586) {
  130. tip = "正常";
  131. }
  132. }
  133. return tip;
  134. }
  135. $scope.transferstatus = function (item) {
  136. var statecolor = "#fc4c58";
  137. if (item.id == 2) { //待处理
  138. statecolor = "#fc4c58";
  139. } else if (item.id == 7) { //待审核
  140. statecolor = "#fcb44c";
  141. } else if (item.id == 3) { //请求重新指派
  142. statecolor = "#ebf902";
  143. } else if (item.id == 4) { //处理中
  144. statecolor = "#0aa5f5";
  145. } else if (item.id == 5) { //已解决
  146. statecolor = "#2edbb8";
  147. } else if (item.id == 6) { //已关闭
  148. statecolor = "#bbbbbb";
  149. }
  150. return statecolor;
  151. }
  152. if($scope.repairMain.valueconfig == 1){//报修人
  153. $scope.gridOptions.columnDefs = [
  154. {
  155. name: 'id',
  156. displayName: '',
  157. width: 35,
  158. cellTemplate: '<div>' +
  159. '<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>' +
  160. '</div>'
  161. },
  162. {
  163. name: 'item',
  164. displayName: '序号',
  165. width: 45,
  166. cellTemplate: '<div>' +
  167. '<div class="ui-grid-cell-contents">{{row.entity.item}}</div>' +
  168. '</div>'
  169. },
  170. {
  171. name: 'incidentsign',
  172. displayName: '事件单号',
  173. width: 120,
  174. cellTemplate: '<div>' +
  175. '<div class="ui-grid-cell-contents">{{row.entity.incidentsign}}</div>' +
  176. '</div>'
  177. },
  178. {
  179. name: 'requester.name',
  180. displayName: '报修人',
  181. width: '6%',
  182. minWidth: '90',
  183. enableSorting: false,
  184. cellTemplate: '<div>' +
  185. '<div class="ui-grid-cell-contents" >{{row.entity.requester.name}}</div>' +
  186. '</div>'
  187. },
  188. {
  189. name: 'requester.account',
  190. displayName: '学工号',
  191. width: '6%',
  192. minWidth: '90',
  193. enableSorting: false,
  194. cellTemplate: '<div>' +
  195. '<div class="ui-grid-cell-contents" >{{row.entity.requester.account}}</div>' +
  196. '</div>'
  197. },
  198. {
  199. name: 'contactsInformation',
  200. displayName: '联系电话',
  201. width: '105',
  202. cellTemplate: '<div>' +
  203. '<div class="ui-grid-cell-contents">{{row.entity.contactsInformation}}</div>' +
  204. '</div>'
  205. },
  206. {
  207. name: 'category',
  208. displayName: '故障现象',
  209. width: '10%',
  210. enableSorting: false,
  211. cellTemplate: '<div>' +
  212. '<div class="ui-grid-cell-contents">{{row.entity.category.category}}</div>' +
  213. '</div>'
  214. },
  215. {
  216. name: 'houseNumber',
  217. displayName: '区域地点',
  218. width: '14%',
  219. enableFiltering: false,
  220. cellTemplate: '<div><div class="ui-grid-cell-contents" ng-bind-html="grid.appScope.areaplace(row.entity)"></div></div>'
  221. },
  222. {
  223. name: 'acceptUser.name',
  224. displayName: '受理人',
  225. width: '7%',
  226. minWidth: '80',
  227. enableSorting: false,
  228. cellTemplate: '<div>' +
  229. '<div class="ui-grid-cell-contents" >{{row.entity.acceptUser.name}}</div>' +
  230. '</div>'
  231. },
  232. {
  233. name: 'acceptDate',
  234. displayName: '登记时间',
  235. width: '10%',
  236. minWidth: '140',
  237. enableFiltering: false,
  238. cellTemplate: '<div><div class="ui-grid-cell-contents">{{grid.appScope.transferTime(row.entity.acceptDate)}}</div></div>'
  239. },
  240. {
  241. name: 'groupORHandlerUser',
  242. displayName: '处理人/组',
  243. width: '10%',
  244. enableFiltering: false,
  245. cellTemplate: '<div>' +
  246. '<div class="ui-grid-cell-contents">' +
  247. '{{row.entity.groupORHandlerUser}}</div>' +
  248. '</div>'
  249. },
  250. {
  251. name: 'state.name',
  252. displayName: '状态',
  253. width: '7%',
  254. minWidth: '70',
  255. enableSorting: false,
  256. cellTemplate: '<div>' +
  257. '<div class="ui-grid-cell-contents" >{{row.entity.state.name}}</div>' +
  258. '</div>'
  259. },
  260. {
  261. name: '操作',
  262. enableSorting: false,
  263. width: 500,
  264. cellTemplate: '<incidentoperator style="background-color:{{row.entity.colourInfo.rgb}}" item="row.entity" colobject="col">',
  265. enableFiltering: false
  266. },
  267. ];
  268. if($scope.wxIncidentWithCmdb==1){
  269. let index = $scope.gridOptions.columnDefs.findIndex(v=>v.name == 'contactsInformation');
  270. $scope.gridOptions.columnDefs.splice(index,0,{
  271. name: 'assetId',
  272. displayName: '资产',
  273. width: 120
  274. },)
  275. }
  276. }else if($scope.repairMain.valueconfig == 2){//报修科室
  277. $scope.gridOptions.columnDefs = [
  278. {
  279. name: 'id',
  280. displayName: '',
  281. width: 35,
  282. cellTemplate: '<div style="width: 100%;">' +
  283. '<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>' +
  284. '</div>'
  285. },
  286. {
  287. name: 'row1',
  288. displayName: '序号',
  289. width: 45,
  290. cellTemplate: '<div style="width: 100%;">' +
  291. '<div class="ui-grid-cell-contents">{{row.entity.item}}</div>' +
  292. '</div>'
  293. },
  294. {
  295. name: 'row2',
  296. displayName: '单号|报修科室',
  297. width: 150,
  298. cellTemplate: '<div style="width: 100%;">' +
  299. '<div class="ui-grid-cell-contents">{{row.entity.incidentsign || "无"}}<br>{{row.entity.department ? row.entity.department.dept : "无"}}</div>' +
  300. '</div>'
  301. },
  302. {
  303. name: 'row3',
  304. displayName: '报修人|来电电话',
  305. width: 150,
  306. cellTemplate: '<div style="width: 100%;">' +
  307. '<div class="ui-grid-cell-contents">{{row.entity.requester ? row.entity.requester.name : "无"}}<br>{{row.entity.incomingPhone || "无"}}<a ng-click="grid.appScope.play(row.entity)" ng-if="row.entity.callID" tooltip="播放录音" tooltip-placement="left"><i class="ti-microphone"></i></a></div>' +
  308. '</div>'
  309. },
  310. {
  311. name: 'row5',
  312. displayName: '故障现象|区域地点',
  313. width: 350,
  314. cellTemplate: '<div style="width: 100%;">' +
  315. '<div class="ui-grid-cell-contents"><span title="{{row.entity.description}}">{{row.entity.description}}</span><br><span ng-bind-html="grid.appScope.areaplace(row.entity)"></span></div>' +
  316. '</div>'
  317. },
  318. {
  319. name: 'row6',
  320. displayName: '受理人|处理人/组',
  321. width: 150,
  322. cellTemplate: '<div style="width: 100%;">' +
  323. '<div class="ui-grid-cell-contents">{{row.entity.acceptUser ? row.entity.acceptUser.name : "无"}}<br><span tooltip="{{grid.appScope.transferSynergetic(row.entity)}}" tooltip-placement="top">{{grid.appScope.transferSynergetic(row.entity)}}</span></div>' +
  324. '</div>'
  325. },
  326. {
  327. name: 'row7',
  328. displayName: '登记时间|接单时间',
  329. width: 150,
  330. cellTemplate: '<div style="width: 100%;">' +
  331. '<div class="ui-grid-cell-contents">{{grid.appScope.transferTime(row.entity.acceptDate)}}<br>{{grid.appScope.transferTime(row.entity.responseHandleTime)}}</div>' +
  332. '</div>'
  333. },
  334. {
  335. name: 'row9',
  336. displayName: '状态|解决时间',
  337. width: 150,
  338. cellTemplate: '<div style="width: 100%;">' +
  339. '<div class="ui-grid-cell-contents" ><span ng-switch="row.entity.state.value"><span ng-switch-when="pending" style="color:orange;">{{row.entity.state.name}}</span><span ng-switch-when="resolved" style="color:green;">{{row.entity.state.name}}</span><span ng-switch-when="handler" style="font-weight:bold;">{{row.entity.state.name}}</span><span ng-switch-default>{{row.entity.state.name}}</span></span><br>{{grid.appScope.transferTime(row.entity.handleTime)}}</div>' +
  340. '</div>'
  341. },
  342. {
  343. name: 'row10',
  344. displayName: '最近维修记录',
  345. width: 140,
  346. cellTemplate: '<div style="width: 100%;">' +
  347. '<div class="ui-grid-cell-contents" ng-bind-html="grid.appScope.transferHandlerLog(row.entity.currentLog)"></div>' +
  348. '</div>'
  349. },
  350. {
  351. name: '操作',
  352. enableSorting: false,
  353. width: 196,
  354. cellTemplate: '<incidentoperator style="background-color:{{row.entity.colourInfo.rgb}}" item="row.entity" colobject="col">',
  355. enableFiltering: false
  356. },
  357. ];
  358. }
  359. $scope.transferTime = function (time) {
  360. if(time){
  361. return moment(time).format('YYYY-MM-DD HH:mm');
  362. }else{
  363. return '无';
  364. }
  365. }
  366. // 转换协同人
  367. $scope.transferSynergetic = function(incidentData){
  368. let str = incidentData.groupORHandlerUser || "";
  369. if(incidentData.synergetic && incidentData.synergetic.length){
  370. str += ',' + incidentData.synergetic.map(v => v.name).join(',');
  371. }
  372. return str;
  373. }
  374. $scope.transferHandlerLog = function (currentLog) {
  375. if(!currentLog){
  376. return '无';
  377. }
  378. currentLog = angular.copy(currentLog);
  379. if(currentLog.extra1DTO && currentLog.extra2 && currentLog.startTime){
  380. return currentLog.extra1DTO.name+"<br>"+ moment(currentLog.startTime).add(+currentLog.extra2, 'days').format('MM月DD日前完成');
  381. }else{
  382. return '无';
  383. }
  384. }
  385. $scope.endOpen = function ($event) {
  386. $event.preventDefault();
  387. $event.stopPropagation();
  388. $scope.startOpened = false;
  389. $scope.endOpened = !$scope.endOpened;
  390. };
  391. $scope.startOpen = function ($event) {
  392. $event.preventDefault();
  393. $event.stopPropagation();
  394. $scope.endOpened = false;
  395. $scope.startOpened = !$scope.startOpened;
  396. };
  397. $scope.othcode = {};
  398. $scope.searchkeys = {};
  399. // 是否选择已删除
  400. $scope.selectDeleted = function(e){
  401. console.log($scope.searchkeys.deleteFlag);
  402. $scope.chiceIncident($scope.searchkeys,$scope.othcode.state);
  403. }
  404. $scope.my_data = [];
  405. function convertListToTree(data, treeMap) {
  406. var idToNodeMap = {}; //Keeps track of nodes using id as key, for fast lookup
  407. var root = null; //Initially set our loop to null
  408. var parentNode = null;
  409. //loop over data
  410. for (var i = 0; i < data.length; i++) {
  411. var datum = data[i];
  412. //each node will have children, so let's give it a "children" poperty
  413. datum.children = [];
  414. //add an entry for this node to the map so that any future children can
  415. //lookup the parent
  416. idToNodeMap[datum.id] = datum;
  417. //Does this node have a parent?
  418. if (typeof datum.parent === "undefined" || datum.parent == null) {
  419. //Doesn't look like it, so this node is the root of the tree
  420. root = datum;
  421. treeMap[datum.id] = root;
  422. } else {
  423. //This node has a parent, so let's look it up using the id
  424. parentNode = idToNodeMap[datum.parent.id];
  425. //We don't need this property, so let's delete it.
  426. delete datum.parent;
  427. //Let's add the current node as a child of the parent node.
  428. parentNode.children.push(datum);
  429. }
  430. }
  431. return root;
  432. }
  433. function convertParentToChildList(data) {
  434. var treeMap = {};
  435. var list = [];
  436. convertListToTree(data, treeMap);
  437. angular.forEach(treeMap, function (item) {
  438. list.push(item);
  439. });
  440. return list;
  441. }
  442. $scope.my_tree = {};
  443. $scope.select_treedata = [];
  444. // 报修科室
  445. $scope.getDept = function (key) {
  446. var postData = {
  447. "idx": 0,
  448. "sum": 10
  449. }
  450. if (key) {
  451. postData.department = { dept: key }
  452. }
  453. api_user_data.fetchDataList('department', postData).then(function (response) {
  454. if (response) {
  455. if (response.status = 200) {
  456. $scope.department = response.list;
  457. }
  458. }
  459. })
  460. }
  461. $scope.getDept();
  462. //树形图
  463. // 将故障现象搜索结果返回的数据整理成children模式
  464. function transform(nodes) {
  465. var treeConverter = {
  466. result: null, //转化后的结果,是根节点,所有节点都是从根节点长出来的
  467. attributeName: 'id', //节点唯一标识符
  468. needFind: true, //是否查询节点在result中已经存在,为了优化效率
  469. transform: function (node) { //转化递归函数,参数:一个待插入节点
  470. if (node.parent != null) { //该节点有父节点
  471. var newNode = this.transform(node.parent); //递归进入,返回值为一个节点,用作父节点,该父节点必然存在于result中,这点由下面的算法可以控制
  472. if (this.needFind) {
  473. for (var i = 0; i < newNode.children.length; i++) { //查找要插入的node子节点是否在newNode这个父节点中存在
  474. if (newNode.children[i][this.attributeName] === node[this.attributeName]) {
  475. return newNode.children[i]; //存在的话直接返回newNode父节点内的该子节点,该子节点必然存在于result中,作为返回值它将被用作上级递归的newNode,因此newNode必然存在于result中
  476. }
  477. }
  478. }
  479. this.needFind = false; //不存在的话,关闭之后递归的循环判断,因为待插入node节点不存在于result中,故而它的子节点一定不存在于result中,不用再循环判断
  480. // delete node.parent; //删除该节点的parent属性,如果有的话
  481. node.children = []; //因为确定是要新插入的节点,没有children:[]属性,故给该节点增加children:[]属性
  482. newNode.children.push(node); //将该node节点push进newNode的子节点数组中
  483. return node; //return该新插入节点,作为递归返回值给上层,用作newNode父节点,node存在于result中故newNode存在于result中
  484. } else if (node.parent == null) { //该叶节点没有父节点,即为根节点
  485. // delete node.parent; //删除该节点的parent属性,如果有的话
  486. if (this.result == null) { //根节点不存在
  487. node.children = []; //给该节点增加children:[]属性
  488. return this.result = node; //该节点赋给result,并return根节点,作为返回值它将被用作上级递归的newNode,因此newNode必然存在于result中
  489. } else {
  490. node.children = [];
  491. // 顶级去重
  492. for (var i = 0; i < this.result.children.length; i++) {
  493. if (this.result.children[i][this.attributeName] === node[this.attributeName]) {
  494. return this.result.children[i];
  495. }
  496. }
  497. this.result.children.push(node)
  498. return node // 直接return根节点,作为返回值它将被用作上级递归的newNode,因此newNode必然存在于result中
  499. }
  500. }
  501. },
  502. getWhole: function (nodes, attributeName) { //传入整个叶子节点数组,attributeName作为节点唯一标识符属性,返回整个转化结果
  503. var _node = {};
  504. _node.children = [];
  505. this.result = _node; //重置根节点
  506. this.attributeName = attributeName == null ? 'id' : attributeName; //唯一标识符默认为“id”
  507. nodes = JSON.parse(JSON.stringify(nodes)); //复制出一个新的节点对象作为参数,保证不改变原有数据
  508. nodes.forEach(item => { //循环调用转化方法
  509. this.needFind = true; //重置开启节点是否已存在判断,保证不插入重复节点
  510. this.transform(item);
  511. })
  512. return this.result; //返回根节点
  513. }
  514. }
  515. var result = treeConverter.getWhole(nodes); //调用
  516. return result;
  517. }
  518. $scope.my_tree = {};
  519. $rootScope.bala1 = $scope.try_async_load = function (s, fn) {
  520. if (s) {
  521. var filterKeyword = s.filterKeyword;
  522. }
  523. var postData = {
  524. "idx": 0,
  525. "sum": 1000,
  526. "incidentcategory": {},
  527. }
  528. if (filterKeyword) {
  529. postData.incidentcategory = { selectType: "pinyin_qs", category: filterKeyword }
  530. }
  531. // 当前所属院区或责任科室
  532. if($rootScope.user.duty){
  533. postData.incidentcategory.duty = $rootScope.user.duty.id;
  534. }else if($rootScope.user.branch){
  535. postData.incidentcategory.branch = $rootScope.user.branch.id;
  536. }
  537. $scope.my_data = [];
  538. $scope.doing_async = true;
  539. api_bpm_data.fetchDataList('incidentcategory', postData).then(function (response) {
  540. if (response.status == 200) {
  541. var data = response.list;
  542. if (filterKeyword) {
  543. data.forEach(e => {
  544. e.isExpanded = true;
  545. })
  546. var li = transform(data).children;
  547. console.log(li)
  548. fn(li)
  549. return;
  550. } else {
  551. var objects = [];
  552. for (var i = 0; i < data.length; i++) {
  553. var object = {};
  554. object.id = data[i].id;
  555. object.parent = data[i].parent;
  556. object.category = data[i].category;
  557. object.isExpanded = true;
  558. objects.push(object);
  559. }
  560. $scope.my_data = convertParentToChildList(objects);
  561. $scope.select_treedata = angular.copy($scope.my_data);
  562. }
  563. if ($scope.my_data.length > 0) {
  564. $scope.doing_async = false;
  565. }
  566. } else {
  567. SweetAlert.swal({
  568. title: "系统错误!",
  569. text: "请刷新重试!",
  570. type: "error"
  571. });
  572. }
  573. });
  574. };
  575. $scope.my_data = [];
  576. function convertListToTree(data, treeMap) {
  577. var idToNodeMap = {}; //Keeps track of nodes using id as key, for fast lookup
  578. var root = null; //Initially set our loop to null
  579. var parentNode = null;
  580. //loop over data
  581. for (var i = 0; i < data.length; i++) {
  582. var datum = data[i];
  583. //each node will have children, so let's give it a "children" poperty
  584. datum.children = [];
  585. //add an entry for this node to the map so that any future children can
  586. //lookup the parent
  587. idToNodeMap[datum.id] = datum;
  588. //Does this node have a parent?
  589. if (typeof datum.parent === "undefined" || datum.parent == null) {
  590. //Doesn't look like it, so this node is the root of the tree
  591. root = datum;
  592. treeMap[datum.id] = root;
  593. } else {
  594. //This node has a parent, so let's look it up using the id
  595. parentNode = idToNodeMap[datum.parent.id];
  596. //We don't need this property, so let's delete it.
  597. delete datum.parent;
  598. //Let's add the current node as a child of the parent node.
  599. parentNode.children.push(datum);
  600. }
  601. }
  602. return root;
  603. }
  604. function convertParentToChildList(data) {
  605. var treeMap = {};
  606. var list = [];
  607. convertListToTree(data, treeMap);
  608. angular.forEach(treeMap, function (item) {
  609. list.push(item);
  610. });
  611. return list;
  612. }
  613. $scope.try_async_load();
  614. // 故障现象
  615. $scope.onFilterCallback = function (item) {
  616. console.log(item);
  617. if (item.item) {
  618. $scope.searchkeys.levelCategory = item = undefined;
  619. } else {
  620. $scope.searchkeys.levelCategory = item;
  621. }
  622. }
  623. //状态
  624. $scope.state = [];
  625. $scope.getIncidentStatus = function(){
  626. api_wechatfile.getDictionary({
  627. "type": "list",
  628. "key": "incident_status"
  629. }).then(function (response) {
  630. $scope.state = response || [];
  631. if(window.sessionStorage.getItem('isGoyuqi') === 'yes'){
  632. $scope.selectTypeChange(true);
  633. }else{
  634. $scope.refreshData('expand-right', undefined, true);
  635. }
  636. })
  637. }
  638. $scope.clear = function () {
  639. $scope.searchkeys = {};
  640. $scope.othcode = {};
  641. $scope.try_async_load();
  642. defaultFilterData = {
  643. idx: 0,
  644. sum: mun
  645. }
  646. $scope.refreshData('expand-right');
  647. $interval.cancel($scope.timer);
  648. $scope.timer = $interval(function () {
  649. $scope.jry_refresh()
  650. }, $rootScope.refreshTime);
  651. }
  652. // 刷新
  653. $scope.jry_refresh = function () {
  654. var fildata = defaultFilterData;
  655. if (fildata.incident && fildata.incident.category) {
  656. delete fildata.incident.category
  657. }
  658. fildata.idx = $scope.jry_idx;
  659. fildata.sum = $scope.jry_sum;
  660. $scope.refreshData('expand-right', fildata);
  661. console.log($scope.cifilter_classic);
  662. }
  663. // 搜索
  664. $scope.chiceIncident = function (item, stateid, isInit) {
  665. if (stateid && stateid.id) {
  666. item.statusId = stateid.id;
  667. } else {
  668. item.statusId = undefined;
  669. }
  670. console.log(item)
  671. var fildata = defaultFilterData;
  672. if (!fildata.incident) {
  673. fildata['incident'] = {};
  674. }
  675. if (item.acceptDate) {
  676. item.acceptDate = moment(item.acceptDate).format('YYYY-MM-DD 00:00:00');
  677. }
  678. if (item.acceptDateEnd) {
  679. item.acceptDateEnd = moment(item.acceptDateEnd).format('YYYY-MM-DD 23:59:59')
  680. }
  681. var transitiondata = angular.copy(item);
  682. angular.extend(fildata.incident, transitiondata)
  683. $scope.memoryfilterData = fildata;
  684. console.log(fildata,78777);
  685. if($scope.searchstate === 'all'){
  686. if(fildata.incident&&fildata.incident.selectType){
  687. fildata.incident.selectType = fildata.incident.selectType.id;
  688. }
  689. }else{
  690. if(fildata.incident&&fildata.incident.selectType){
  691. delete fildata.incident.selectType;
  692. }
  693. }
  694. // /seimin
  695. $scope.refreshData('expand-right', fildata, isInit);
  696. $interval.cancel($scope.timer);
  697. $scope.timer = $interval(function () {
  698. $scope.jry_refresh()
  699. }, $rootScope.refreshTime);
  700. }
  701. //区域地点过滤
  702. api_user_data.fetchDataList('area', {
  703. "idx": 0,
  704. "sum": 1000
  705. }).then(function (response) {
  706. if (response) {
  707. if (response.status = 200) {
  708. $scope.outarea = response.list;
  709. }
  710. }
  711. })
  712. //报修人
  713. var getRequester = function () {
  714. api_user_data.fetchDataList('user', {
  715. idx: 0,
  716. sum: 100,
  717. user:{
  718. engineer: undefined,
  719. }
  720. }).then(function (data) {
  721. // console.log(data);
  722. $scope.requester = data.list
  723. });
  724. }
  725. $scope.repairMain.valueconfig == 1 && getRequester();
  726. //受理人,处理人
  727. var getUser = function (fieldatas, it) {
  728. api_user_data.fetchDataList('user', fieldatas).then(function (data) {
  729. if (it == 1) {
  730. $scope.acceptUser = data.list;
  731. } else if (it == 2) {
  732. $scope.handlingPersonnelUser = data.list;
  733. }
  734. });
  735. }
  736. //受理人过滤
  737. $scope.onChangeacceptUser = function (key) {
  738. console.log(key)
  739. var filuser = {
  740. "idx": 0,
  741. "sum": 10,
  742. "user": {
  743. "name": key,
  744. 'selectType': "pinyin_qs",
  745. engineer: 1,
  746. }
  747. }
  748. getUser(filuser, 1);
  749. }
  750. //处理人过滤
  751. $scope.onChangehandling = function (key) {
  752. var filuser = {
  753. "idx": 0,
  754. "sum": 10,
  755. "user": {
  756. "name": key,
  757. 'selectType': "pinyin_qs",
  758. engineer: 1,
  759. }
  760. }
  761. getUser(filuser, 2);
  762. }
  763. //报修科室过滤
  764. $scope.onChangeDept = function (key) {
  765. $scope.getDept(key)
  766. }
  767. //地点区域过滤
  768. $scope.onChangearea = function (data) {
  769. delete $scope.searchkeys.place;
  770. if ($scope.memoryfilterData.incident) {
  771. delete $scope.memoryfilterData.incident.place;
  772. }
  773. var fildata = {
  774. "idx": 0,
  775. "sum": 1000,
  776. "place": {
  777. area: {
  778. id: data.area.id
  779. }
  780. }
  781. };
  782. api_user_data.fetchDataList('place', fildata).then(function (response) {
  783. if (response) {
  784. if (response.status = 200) {
  785. $scope.outplace = response.list;
  786. }
  787. }
  788. })
  789. };
  790. $scope.starttime = function (data) {
  791. return moment(new Date(data)).format('YYYY-MM-DD')
  792. }
  793. $scope.overtime = function (data) {
  794. return moment(new Date(data)).format('YYYY-MM-DD HH:mm')
  795. }
  796. $scope.areaplace = function (data) {
  797. var str = '';
  798. str += '<strong>' + data.branchName + '</strong>';
  799. str += (data.place ? (data.place.area ? data.place.area.area : '') : '');
  800. str += (data.place ? (data.place.place ? data.place.place : '') : '');
  801. str += (data.houseNumber ? data.houseNumber : '');
  802. return str || '无';
  803. }
  804. //录音
  805. $scope.play = function (data) {
  806. console.log(data.callID)
  807. var modalInstance = $modal.open({
  808. backdrop: "static",
  809. templateUrl: 'assets/views/incident/tpl/audio.html',
  810. controller: function ($rootScope, $scope, $modalInstance, $sce, $http, api_bpm_data) {
  811. // $rootScope.setbusy();
  812. $scope.datasurl = "";
  813. api_bpm_data.fetchDataList("callrecord", {idx: 0, sum: 1, callrecord: {callAccept: data.callID}}).then(function(data) {
  814. if(data.status == 200){
  815. data.list = data.list || [];
  816. if(data.list.length){
  817. $scope.audioUrl = $sce.trustAsResourceUrl(callIp+data.list[0].recordingFileName);
  818. }
  819. }
  820. });
  821. $scope.download = function (contentId, filename) {
  822. $http({
  823. url: "http://" + $scope.datasurl,
  824. method: 'GET',
  825. headers: {
  826. 'Content-type': 'application/octet-stream',
  827. },
  828. responseType: 'arraybuffer'
  829. }).success(function (data, status, headers, config) {
  830. var file = new Blob([data], {
  831. type: 'application/octet-stream'
  832. });
  833. //trick to download store a file having its URL
  834. var fileURL = URL.createObjectURL(file);
  835. var a = document.createElement('a');
  836. a.href = fileURL;
  837. a.target = '_blank';
  838. a.download = filename;
  839. document.body.appendChild(a);
  840. a.click();
  841. }).error(function (data, status, headers, config) {
  842. // console.log(data);
  843. });
  844. }
  845. $scope.cancel = function () {
  846. $modalInstance.dismiss('cancel');
  847. };
  848. $modalInstance.close();
  849. },
  850. });
  851. modalInstance.result.then(function (result) {}, function (reason) {});
  852. };
  853. //列表排序
  854. $scope.gridOptions.onRegisterApi = function (gridApi) {
  855. $scope.gridApi = gridApi;
  856. var index = 0;
  857. var oldheader = {};
  858. gridApi.grid.sortColumn = function (gridApi) {
  859. if (oldheader.field) {
  860. if (oldheader.field == gridApi.field) {
  861. } else {
  862. index = 0;
  863. }
  864. }
  865. index++;
  866. oldheader = gridApi;
  867. var fildata = $scope.memoryfilterData;
  868. if (index % 3 == 0) {
  869. delete $scope.memoryfilterData.incident;
  870. fildata = $scope.memoryfilterData;
  871. } else if (index % 3 == 1) {
  872. if (fildata.incident) {
  873. if (gridApi.field == "acceptDate") {
  874. angular.extend(fildata.incident, {
  875. "sort": gridApi.field
  876. });
  877. } else {
  878. angular.extend(fildata.incident, {
  879. "sort": gridApi.field + " desc , _incident.acceptDate"
  880. });
  881. }
  882. } else {
  883. if (gridApi.field == "acceptDate") {
  884. angular.extend(fildata, {
  885. 'incident': {
  886. "sort": gridApi.field
  887. }
  888. });
  889. } else {
  890. angular.extend(fildata, {
  891. 'incident': {
  892. "sort": gridApi.field + " desc , _incident.acceptDate"
  893. }
  894. });
  895. }
  896. }
  897. } else if (index % 3 == 2) {
  898. if (fildata.incident) {
  899. if (gridApi.field == "acceptDate") {
  900. angular.extend(fildata.incident, {
  901. "sort": gridApi.field,
  902. "order": "asc"
  903. });
  904. } else {
  905. angular.extend(fildata.incident, {
  906. "sort": gridApi.field + " asc , _incident.acceptDate"
  907. });
  908. }
  909. } else {
  910. if (gridApi.field == "acceptDate") {
  911. angular.extend(fildata, {
  912. 'incident': {
  913. "sort": gridApi.field,
  914. "order": "asc"
  915. }
  916. });
  917. } else {
  918. angular.extend(fildata.incident, {
  919. "sort": gridApi.field + " asc , _incident.acceptDate"
  920. });
  921. }
  922. }
  923. }
  924. $scope.refreshData('expand-right', fildata);
  925. }
  926. $scope.jry_idx = 0;
  927. $scope.jry_sum = 10;
  928. gridApi.pagination.on.paginationChanged($scope, function (newPage, pageSize) {
  929. var filtersData = $scope.memoryfilterData;
  930. filtersData.idx = newPage - 1;
  931. $scope.jry_idx = newPage - 1;
  932. filtersData.sum = pageSize;
  933. $scope.jry_sum = pageSize;
  934. $scope.refreshData('expand-right', filtersData);
  935. });
  936. $scope.Change = function (upTypes) {
  937. if (angular.isDefined($scope.selected.items)) {
  938. if (angular.isDefined(upTypes) && upTypes == 'upincident') {
  939. var data = {
  940. cancelUrl: 'app.incident.list',
  941. model: {
  942. problem: {
  943. title: $scope.selected.items.title,
  944. des: $scope.selected.items.description,
  945. proposePerson: $scope.selected.items.handlerUser,
  946. source: {
  947. id: 1,
  948. code: 1,
  949. name: ' 事件 '
  950. },
  951. incident: $scope.selected.items
  952. }
  953. }
  954. }
  955. $state.go('app.problem.incident', {
  956. pdKey: 'incident',
  957. dataId: $scope.selected.items.id,
  958. processInstanceId: $scope.selected.items.processInstanceId,
  959. 'model': JSON.stringify(data)
  960. });
  961. } else if (angular.isDefined(upTypes) && upTypes == 'upchange') {
  962. var data = {
  963. cancelUrl: 'app.incident.list',
  964. model: {
  965. change: {
  966. title: $scope.selected.items.title,
  967. description: $scope.selected.items.description,
  968. requestingPerson: $scope.selected.items.handlerUser,
  969. source: {
  970. id: 1,
  971. code: 1,
  972. name: ' 事件 '
  973. },
  974. incident: $scope.selected.items
  975. }
  976. }
  977. }
  978. // var data={cancelUrl:'app.incident.list'}
  979. $state.go('app.change.incident', {
  980. pdKey: 'incident',
  981. dataId: $scope.selected.items.id,
  982. processInstanceId: $scope.selected.items.processInstanceId,
  983. 'model': JSON.stringify(data)
  984. });
  985. }
  986. }
  987. }
  988. $scope.selected = {
  989. items: []
  990. }
  991. gridApi.core.on.filterChanged($scope, function () {
  992. var grid = this.grid;
  993. if ($rootScope.user.group) {
  994. var filtersData = {
  995. idx: 0,
  996. sum: mun
  997. };
  998. } else {
  999. var filtersData = {
  1000. idx: 0,
  1001. sum: mun
  1002. };
  1003. }
  1004. angular.forEach(grid.columns, function (item) {
  1005. if (item.enableFiltering) {
  1006. if (angular.isDefined(item.filters[0].term) && item.filters[0].term != '') {
  1007. filtersData = $scope.memoryfilterData
  1008. if (angular.isUndefined(filtersData['incident'])) {
  1009. filtersData['incident'] = {};
  1010. }
  1011. if (item.field == 'department.dept') {
  1012. filtersData['incident']['department'] = {};
  1013. filtersData.incident.department['department'] = item.filters[0].term;
  1014. } else if (item.field == 'handlingPersonnelUser.name') {
  1015. filtersData['incident']['handlingPersonnelUser'] = {};
  1016. filtersData.incident.handlingPersonnelUser['name'] = item.filters[0].term;
  1017. } else if (item.field == 'requester.account') {
  1018. filtersData['incident']['requester'] = {};
  1019. filtersData.incident.requester['account'] = item.filters[0].term;
  1020. } else if (item.field == 'acceptUser.name') {
  1021. filtersData['incident']['acceptUser'] = {};
  1022. filtersData.incident.acceptUser['name'] = item.filters[0].term;
  1023. } else {
  1024. filtersData['incident'][item.field] = item.filters[0].term;
  1025. }
  1026. }
  1027. }
  1028. });
  1029. filtersData.idx = 0;
  1030. $scope.memoryfilterData = filtersData;
  1031. $scope.refreshData('expand-right', filtersData);
  1032. });
  1033. };
  1034. //处理
  1035. $scope.selectRowFunction = function (model) {
  1036. console.log(model)
  1037. var modalInstance = $modal.open({
  1038. backdrop: false,
  1039. templateUrl: 'assets/views/incident/tpl/doing.tpl.html',
  1040. controller: function ($scope,$rootScope, $modalInstance, api_bpm_domain, modelData, currentUserId, Alert, api_user_data,api_category) {
  1041. console.log(model,loginUser);
  1042. $scope.model = model;
  1043. $scope.postData = {
  1044. handleCategory: undefined,
  1045. closecode: undefined,
  1046. handleDescription: '',
  1047. synergetic: [],
  1048. }
  1049. $scope.incidentHandleCategoryList = [];
  1050. $scope.incidentClosecodeList = [];
  1051. $scope.synergeticList = [];
  1052. // 获取处理方式
  1053. $scope.getIncidentHandleCategory = function(){
  1054. api_wechatfile.getDictionary({"key":"incident_handleCategory","type":"list"}).then(function (data) {
  1055. $scope.incidentHandleCategoryList = data || [];
  1056. if(!$scope.postData.handleCategory){
  1057. let handleCategory = $scope.incidentHandleCategoryList.find(v => v.value == 'SUPPORT');
  1058. $scope.postData.handleCategory = handleCategory || undefined;
  1059. }
  1060. })
  1061. }
  1062. // 获取处理结果
  1063. $scope.getIncidentClosecode = function(){
  1064. api_wechatfile.getDictionary({"key":"incident_closecode","type":"list"}).then(function (data) {
  1065. $scope.incidentClosecodeList = data || [];
  1066. if(!$scope.postData.closecode){
  1067. let closecode = $scope.incidentClosecodeList.find(v => v.value == '060');
  1068. $scope.postData.closecode = closecode || undefined;
  1069. }
  1070. })
  1071. }
  1072. // 获取协同人
  1073. $scope.getSynergeticList = function(keyword = ''){
  1074. let postData = {
  1075. "idx":0,
  1076. "sum":10,
  1077. "user":{
  1078. currentDuty: model.duty ? model.duty.id : undefined,
  1079. name: keyword,
  1080. selectType: "pinyin_qs",
  1081. engineer: 1,
  1082. roledata: {
  1083. "rolecode": "first-line support"
  1084. },
  1085. }
  1086. };
  1087. api_simple.fetchDataList("user", postData).then(result => {
  1088. if(result.status == 200){
  1089. $scope.synergeticList = result.list || [];
  1090. }else{
  1091. $scope.synergeticList = [];
  1092. }
  1093. })
  1094. }
  1095. // 初始化
  1096. $scope.getIncidentHandleCategory();
  1097. $scope.getIncidentClosecode();
  1098. $scope.getSynergeticList();
  1099. $scope.ok = function () {
  1100. if (!$scope.postData.handleCategory){
  1101. Alert.swal({
  1102. title: "操作失败",
  1103. text: "请选择处理方式!",
  1104. type: "error"
  1105. });
  1106. return;
  1107. }
  1108. if ($scope.model.category.hasSimple != 1 &&!$scope.postData.closecode){
  1109. Alert.swal({
  1110. title: "操作失败",
  1111. text: "请选择处理结果!",
  1112. type: "error"
  1113. });
  1114. return;
  1115. }
  1116. if ($scope.model.category.hasSimple != 1 &&!$scope.postData.handleDescription){
  1117. Alert.swal({
  1118. title: "操作失败",
  1119. text: "请填写处理方案!",
  1120. type: "error"
  1121. });
  1122. return;
  1123. }
  1124. let postData = {incident: {...model, ...{
  1125. handleCategory: $scope.postData.handleCategory,
  1126. closecode: $scope.postData.closecode,
  1127. handleDescription: $scope.postData.handleDescription,
  1128. synergetic: $scope.postData.synergetic.length ? $scope.postData.synergetic : undefined,
  1129. }}};
  1130. $rootScope.isMask = true;
  1131. api_flow.accept("doing", postData).then(function (response) {
  1132. console.log(response)
  1133. $rootScope.isMask = false;
  1134. if (response.state == 200) {
  1135. Alert.swal({
  1136. title: "操作成功!",
  1137. confirmButtonColor: "#007AFF",
  1138. type: "success"
  1139. });
  1140. $modalInstance.close('success');
  1141. } else {
  1142. Alert.swal({
  1143. title: "操作失败",
  1144. text: "操作失败, 请稍后再试!",
  1145. type: "error"
  1146. });
  1147. }
  1148. });
  1149. }
  1150. $scope.cancel = function () {
  1151. $modalInstance.dismiss('cancel');
  1152. }
  1153. },
  1154. size: 'sm',
  1155. resolve: {
  1156. api_bpm: function () {
  1157. return api_bpm;
  1158. },
  1159. modelData: function () {
  1160. return model;
  1161. },
  1162. currentUserId: function () {
  1163. return loginUser.id;
  1164. },
  1165. Alert: function () {
  1166. return SweetAlert;
  1167. },
  1168. api_user_data: function () {
  1169. return api_user_data;
  1170. }
  1171. }
  1172. });
  1173. modalInstance.result.then(function (selectedItem) {
  1174. if (selectedItem == 'success') {
  1175. $scope.refreshData('expand-right', defaultFilterData);
  1176. }
  1177. });
  1178. };
  1179. //修改
  1180. $scope.changeClick = function (data) {
  1181. // $state.go('app.incident.detail', {
  1182. // formKey: 'incident_change',
  1183. // pdKey: 'incident',
  1184. // dataId: data.id,
  1185. // taskId: data.taskId,
  1186. // processInstanceId: data.processInstanceId
  1187. // });
  1188. $rootScope.newOrder({
  1189. incident: data,
  1190. },'edit')
  1191. };
  1192. //回访
  1193. $scope.visit = function (model) {
  1194. console.log(model)
  1195. var modalInstance = $modal.open({
  1196. backdrop: false,
  1197. templateUrl: 'assets/views/incident/tpl/callback.tpl.html',
  1198. controller: function ($scope,$rootScope, $modalInstance, api_bpm_domain, modelData, currentUserId, Alert, api_user_data,api_category) {
  1199. console.log(model,loginUser);
  1200. $scope.model = model;
  1201. $scope.postData = {
  1202. degree: undefined,
  1203. visitRemarks: '',
  1204. }
  1205. $scope.degreeList = [];
  1206. // 获取满意度评价
  1207. $scope.getDegree = function(){
  1208. api_wechatfile.getDictionary({"key":"incident_degree","type":"list"}).then(function (data) {
  1209. $scope.degreeList = data || [];
  1210. })
  1211. }
  1212. // 获取结果类型
  1213. $scope.getHandleResult = function(){
  1214. api_wechatfile.getDictionary({"key":"incident_handleresult","type":"list"}).then(function (data) {
  1215. $scope.handleResultList = data || [];
  1216. })
  1217. }
  1218. // 初始化
  1219. $scope.getDegree();
  1220. $scope.getHandleResult();
  1221. $scope.ok = function () {
  1222. if (!$scope.postData.degree){
  1223. Alert.swal({
  1224. title: "操作失败",
  1225. text: "请选择满意度评价!",
  1226. type: "error"
  1227. });
  1228. return;
  1229. }
  1230. if (!$scope.postData.handleResult){
  1231. Alert.swal({
  1232. title: "操作失败",
  1233. text: "请选择结果类型!",
  1234. type: "error"
  1235. });
  1236. return;
  1237. }
  1238. let postData = {incident: {...model, ...{
  1239. degree: $scope.postData.degree,
  1240. handleResult: $scope.postData.handleResult,
  1241. visitRemarks: $scope.postData.visitRemarks,
  1242. }}};
  1243. $rootScope.isMask = true;
  1244. api_flow.accept("callback", postData).then(function (response) {
  1245. console.log(response)
  1246. $rootScope.isMask = false;
  1247. if (response.state == 200) {
  1248. Alert.swal({
  1249. title: "操作成功!",
  1250. confirmButtonColor: "#007AFF",
  1251. type: "success"
  1252. });
  1253. $modalInstance.close('success');
  1254. } else {
  1255. Alert.swal({
  1256. title: "操作失败",
  1257. text: "操作失败, 请稍后再试!",
  1258. type: "error"
  1259. });
  1260. }
  1261. });
  1262. }
  1263. $scope.cancel = function () {
  1264. $modalInstance.dismiss('cancel');
  1265. }
  1266. },
  1267. size: 'sm',
  1268. resolve: {
  1269. api_bpm: function () {
  1270. return api_bpm;
  1271. },
  1272. modelData: function () {
  1273. return model;
  1274. },
  1275. currentUserId: function () {
  1276. return loginUser.id;
  1277. },
  1278. Alert: function () {
  1279. return SweetAlert;
  1280. },
  1281. api_user_data: function () {
  1282. return api_user_data;
  1283. }
  1284. }
  1285. });
  1286. modalInstance.result.then(function (selectedItem) {
  1287. if (selectedItem == 'success') {
  1288. $scope.refreshData('expand-right', defaultFilterData);
  1289. }
  1290. });
  1291. };
  1292. //导出
  1293. $scope.export = function () {
  1294. console.log($scope.memoryfilterData)
  1295. var filadata = angular.copy($scope.memoryfilterData);
  1296. filadata.sum = 10000;
  1297. console.log($scope.filadata)
  1298. $http({
  1299. url: api_bpm_data.downDataModel("incident", 3).getRequestedUrl(),
  1300. method: 'POST',
  1301. data: JSON.stringify(filadata),
  1302. headers: {
  1303. 'Accept': '*/*'
  1304. },
  1305. responseType: 'arraybuffer'
  1306. }).success(function (data, status, headers, config) {
  1307. var file = new Blob([data], {
  1308. type: 'application/vnd.ms-excel'
  1309. });
  1310. //trick to download store a file having its URL
  1311. var fileURL = URL.createObjectURL(file);
  1312. var a = document.createElement('a');
  1313. a.href = fileURL;
  1314. a.target = '_blank';
  1315. a.download = '工单列表.xls';
  1316. document.body.appendChild(a);
  1317. a.click();
  1318. }).error(function (data, status, headers, config) {
  1319. // $scope.ldloading.zoom_in = false;
  1320. console.log(data);
  1321. });
  1322. }
  1323. //接单
  1324. $scope.acceptTaskAction = function (model) {
  1325. var modalInstance = $modal.open({
  1326. templateUrl: 'assets/views/incident/tpl/acceptTask.tpl.html',
  1327. controller: function ($scope, $modalInstance, modelData, currentUserId, Alert) {
  1328. $scope.title = "提示";
  1329. $scope.connect = "确认接单?";
  1330. $scope.ok = function () {
  1331. console.log(model);
  1332. $rootScope.isMask = true;
  1333. api_flow.accept("receive", {incident: model}).then(function (response) {
  1334. $rootScope.isMask = false;
  1335. if (response.state == 200) {
  1336. Alert.swal({
  1337. title: "操作成功!",
  1338. confirmButtonColor: "#007AFF",
  1339. type: "success"
  1340. });
  1341. $modalInstance.close('success');
  1342. } else {
  1343. Alert.swal({
  1344. title: "操作失败",
  1345. text: "操作失败, 请稍后再试!",
  1346. type: "error"
  1347. });
  1348. }
  1349. });
  1350. }
  1351. $scope.cancel = function () {
  1352. $modalInstance.dismiss('cancel');
  1353. }
  1354. },
  1355. size: 'sm',
  1356. resolve: {
  1357. modelData: function () {
  1358. return model;
  1359. },
  1360. currentUserId: function () {
  1361. return loginUser.id;
  1362. },
  1363. Alert: function () {
  1364. return SweetAlert;
  1365. }
  1366. }
  1367. });
  1368. modalInstance.result.then(function (selectedItem) {
  1369. if (selectedItem == 'success') {
  1370. $scope.refreshData('expand-right', defaultFilterData);
  1371. }
  1372. });
  1373. }
  1374. // 指派弹窗
  1375. $scope.toAssign = function (model) {
  1376. console.log(model)
  1377. var modalInstance = $modal.open({
  1378. backdrop: false,
  1379. templateUrl: 'assets/views/incident/tpl/toAssign.tpl.html',
  1380. controller: function ($scope,$rootScope, $modalInstance, api_bpm_domain, modelData, currentUserId, Alert, api_user_data,api_category) {
  1381. console.log(model,loginUser);
  1382. //获取组下面的用户
  1383. $scope.getUsers = function(groupId){
  1384. $scope.user = [];
  1385. var postData = {};
  1386. if(groupId){
  1387. postData = {
  1388. "idx": 0,
  1389. "sum": 100,
  1390. user: {
  1391. groupdata:{id:groupId},
  1392. roledata: { rolecode: "first-line support" },
  1393. roledata2: { rolecode: "second-line support" },
  1394. selectType: "1",
  1395. selectDetails:1,
  1396. simple: true,
  1397. }
  1398. }
  1399. }else{
  1400. postData = {
  1401. "idx": 0,
  1402. "sum": 100,
  1403. user: {
  1404. roledata: { rolecode: "first-line support" },
  1405. roledata2: { rolecode: "second-line support" },
  1406. selectType: "1",
  1407. selectDetails:1,
  1408. simple: true,
  1409. engineer: 1,
  1410. }
  1411. }
  1412. }
  1413. api_user_data.fetchDataList('user', postData).then(function (data) {
  1414. $scope.user = data.list;
  1415. })
  1416. }
  1417. $scope.assign = {
  1418. branch:undefined,
  1419. duty:undefined,
  1420. user:undefined,
  1421. group:undefined,
  1422. isRadioUser: 0,
  1423. }
  1424. $scope.hospitalList = [];
  1425. $scope.dutyDeptList = [];
  1426. $scope.user = [];
  1427. $scope.group = [];
  1428. $scope.isShowRadioUser = false;
  1429. // 修改是否指派到人
  1430. $scope.changeRadioUser = function(){
  1431. $scope.assign.user = undefined;
  1432. }
  1433. // 获取院区
  1434. $scope.getHospitals = function(){
  1435. //跨科室转派
  1436. api_user_data.fetchDataList('branch', {
  1437. "idx": 0,
  1438. "sum": 100
  1439. }).then(function (data) {
  1440. if(data.status == 200){
  1441. $scope.hospitalList = data.list;
  1442. if($scope.assign.duty){
  1443. $scope.assign.branch = $scope.hospitalList.find(v=>v.id == $scope.assign.duty.branch);
  1444. }else{
  1445. if($rootScope.user.duty){
  1446. // 当前的所属责任科室
  1447. $scope.assign.branch = $scope.hospitalList.find(v=>v.id == $rootScope.user.duty.branch);
  1448. $scope.assign.duty = $rootScope.user.duty;
  1449. $scope.changeDuty();
  1450. }else if($rootScope.user.branch){
  1451. // 当前的所属院区
  1452. $scope.assign.branch = $scope.hospitalList.find(v=>v.id == $rootScope.user.branch.id);
  1453. }
  1454. }
  1455. }else{
  1456. SweetAlert.swal({
  1457. title: "系统错误!",
  1458. text: "请刷新重试!",
  1459. type: "error"
  1460. });
  1461. }
  1462. })
  1463. }
  1464. $scope.getHospitals();
  1465. // 修改院区
  1466. $scope.changeBranch = function(keyword){
  1467. if(keyword === undefined){
  1468. $scope.assign.duty = undefined;
  1469. $scope.dutyDeptList = [];
  1470. $scope.assign.group = undefined;
  1471. $scope.group = [];
  1472. $scope.assign.user = undefined;
  1473. $scope.user = [];
  1474. }
  1475. if(!$scope.assign.branch){
  1476. $scope.dutyDeptList = [];
  1477. return;
  1478. }
  1479. api_user_data.fetchDataList('dutyDepartment', {
  1480. "idx": 0,
  1481. "sum": 100,
  1482. "dutyDepartment":{
  1483. branch:$scope.assign.branch.id,
  1484. dept:keyword,
  1485. selectType: "pinyin_qs"
  1486. }
  1487. }).then(function (data) {
  1488. if(data.status == 200){
  1489. $scope.dutyDeptList = data.list;
  1490. }else{
  1491. SweetAlert.swal({
  1492. title: "系统错误!",
  1493. text: "请刷新重试!",
  1494. type: "error"
  1495. });
  1496. }
  1497. })
  1498. }
  1499. // 修改责任科室
  1500. $scope.changeDuty = function(keyword){
  1501. if(keyword === undefined){
  1502. $scope.assign.user = undefined;
  1503. $scope.user = [];
  1504. $scope.assign.group = undefined;
  1505. $scope.group = [];
  1506. }
  1507. api_user_data.fetchDataList('group', {
  1508. "idx": 0,
  1509. "sum": 9999,
  1510. "group":{
  1511. duty:$scope.assign.duty,
  1512. selectType: "nouser"
  1513. }
  1514. }).then(function (data) {
  1515. if(data.status == 200){
  1516. $scope.group = data.list;
  1517. }else{
  1518. SweetAlert.swal({
  1519. title: "系统错误!",
  1520. text: "请刷新重试!",
  1521. type: "error"
  1522. });
  1523. }
  1524. })
  1525. }
  1526. $scope.changeGroup = function(item){
  1527. // $scope.assign.group = item.id;
  1528. $scope.assign.user = undefined;
  1529. $scope.user = [];
  1530. $scope.getUsers(item.id)
  1531. }
  1532. $scope.ok = function () {
  1533. if ($scope.assign.isRadioUser == 1 && !$scope.assign.user){
  1534. Alert.swal({
  1535. title: "操作失败",
  1536. text: "请选择转派对象信息!",
  1537. type: "error"
  1538. });
  1539. return;
  1540. }
  1541. if ($scope.assign.isRadioUser == 0 && !$scope.assign.group){
  1542. Alert.swal({
  1543. title: "操作失败",
  1544. text: "请选择工作组!",
  1545. type: "error"
  1546. });
  1547. return;
  1548. }
  1549. let postData = {};
  1550. if($scope.assign.user && $scope.assign.user.id){
  1551. // 派人
  1552. postData ={ incident: {...model, ...{assignee: $scope.assign.user.id, duty: $scope.assign.duty}} };
  1553. } else if($scope.assign.group && $scope.assign.group.id){
  1554. // 派组
  1555. postData ={ incident: {...model, ...{candidateGroups: $scope.assign.group.id, duty: $scope.assign.duty}} };
  1556. }
  1557. $rootScope.isMask = true;
  1558. api_flow.accept("assign", postData).then(function (response) {
  1559. console.log(response)
  1560. $rootScope.isMask = false;
  1561. if (response.state == 200) {
  1562. Alert.swal({
  1563. title: "操作成功!",
  1564. confirmButtonColor: "#007AFF",
  1565. type: "success"
  1566. });
  1567. $modalInstance.close('success');
  1568. } else {
  1569. Alert.swal({
  1570. title: "操作失败",
  1571. text: "操作失败, 请稍后再试!",
  1572. type: "error"
  1573. });
  1574. }
  1575. });
  1576. }
  1577. $scope.cancel = function () {
  1578. $modalInstance.dismiss('cancel');
  1579. }
  1580. },
  1581. size: 'sm',
  1582. resolve: {
  1583. api_bpm: function () {
  1584. return api_bpm;
  1585. },
  1586. modelData: function () {
  1587. return model;
  1588. },
  1589. currentUserId: function () {
  1590. return loginUser.id;
  1591. },
  1592. Alert: function () {
  1593. return SweetAlert;
  1594. },
  1595. api_user_data: function () {
  1596. return api_user_data;
  1597. }
  1598. }
  1599. });
  1600. modalInstance.result.then(function (selectedItem) {
  1601. if (selectedItem == 'success') {
  1602. $scope.refreshData('expand-right', defaultFilterData);
  1603. }
  1604. });
  1605. }
  1606. // 转派弹窗
  1607. $scope.toTransfer = function (model) {
  1608. console.log(model)
  1609. var modalInstance = $modal.open({
  1610. backdrop: false,
  1611. templateUrl: 'assets/views/incident/tpl/toTransfer.tpl.html',
  1612. controller: function ($scope,$rootScope, $modalInstance, api_bpm_domain, modelData, currentUserId, Alert, api_user_data,api_category) {
  1613. console.log(model,loginUser);
  1614. $scope.assign = {
  1615. duty:model.duty,
  1616. user:undefined,
  1617. group:undefined,
  1618. isRadioGroup: 0,
  1619. }
  1620. $scope.user = [];
  1621. $scope.group = [];
  1622. //获取责任科室下面的用户
  1623. $scope.getUsers = function(){
  1624. $scope.user = [];
  1625. var postData = {
  1626. "idx": 0,
  1627. "sum": 9999,
  1628. user: {
  1629. currentDuty: $scope.assign.duty.id,
  1630. roledata: { rolecode: "first-line support" },
  1631. roledata2: { rolecode: "second-line support" },
  1632. selectType: "1",
  1633. selectDetails:1,
  1634. simple: true,
  1635. engineer: 1,
  1636. }
  1637. }
  1638. api_user_data.fetchDataList('user', postData).then(function (data) {
  1639. $scope.user = data.list;
  1640. })
  1641. }
  1642. $scope.getUsers();
  1643. //获取责任科室下面的组
  1644. $scope.getGroups = function(){
  1645. $scope.group = [];
  1646. var postData = {
  1647. "idx": 0,
  1648. "sum": 9999,
  1649. group: {
  1650. duty: $scope.assign.duty,
  1651. selectType: "nouser",
  1652. }
  1653. }
  1654. api_user_data.fetchDataList('group', postData).then(function (data) {
  1655. $scope.group = data.list;
  1656. })
  1657. }
  1658. $scope.getGroups();
  1659. // 修改是否转派到组
  1660. $scope.changeRadioGroup = function(){
  1661. $scope.assign.group = undefined;
  1662. $scope.assign.user = undefined;
  1663. }
  1664. $scope.ok = function () {
  1665. if ($scope.assign.isRadioGroup == 0 && !$scope.assign.user){
  1666. Alert.swal({
  1667. title: "操作失败",
  1668. text: "请选择转派对象信息!",
  1669. type: "error"
  1670. });
  1671. return;
  1672. }
  1673. if ($scope.assign.isRadioGroup == 1 && !$scope.assign.group){
  1674. Alert.swal({
  1675. title: "操作失败",
  1676. text: "请选择工作组!",
  1677. type: "error"
  1678. });
  1679. return;
  1680. }
  1681. let postData = {};
  1682. if($scope.assign.user && $scope.assign.user.id){
  1683. // 派人
  1684. postData ={ incident: {...model, ...{assignee: $scope.assign.user.id}} };
  1685. } else if($scope.assign.group && $scope.assign.group.id){
  1686. // 派组
  1687. postData ={ incident: {...model, ...{candidateGroups: $scope.assign.group.id}} };
  1688. }
  1689. $rootScope.isMask = true;
  1690. api_flow.accept("redeploy", postData).then(function (response) {
  1691. console.log(response)
  1692. $rootScope.isMask = false;
  1693. if (response.state == 200) {
  1694. Alert.swal({
  1695. title: "操作成功!",
  1696. confirmButtonColor: "#007AFF",
  1697. type: "success"
  1698. });
  1699. $modalInstance.close('success');
  1700. } else {
  1701. Alert.swal({
  1702. title: "操作失败",
  1703. text: "操作失败, 请稍后再试!",
  1704. type: "error"
  1705. });
  1706. }
  1707. });
  1708. }
  1709. $scope.cancel = function () {
  1710. $modalInstance.dismiss('cancel');
  1711. }
  1712. },
  1713. size: 'sm',
  1714. resolve: {
  1715. api_bpm: function () {
  1716. return api_bpm;
  1717. },
  1718. modelData: function () {
  1719. return model;
  1720. },
  1721. currentUserId: function () {
  1722. return loginUser.id;
  1723. },
  1724. Alert: function () {
  1725. return SweetAlert;
  1726. },
  1727. api_user_data: function () {
  1728. return api_user_data;
  1729. }
  1730. }
  1731. });
  1732. modalInstance.result.then(function (selectedItem) {
  1733. if (selectedItem == 'success') {
  1734. $scope.refreshData('expand-right', defaultFilterData);
  1735. }
  1736. });
  1737. }
  1738. // 删除事件
  1739. $scope.delSj = function(model){
  1740. console.log(model);
  1741. SweetAlert.swal({
  1742. title: "确认删除?",
  1743. text: "删除的数据不可恢复,请确认继续操作!",
  1744. type: "warning",
  1745. showCancelButton: true,
  1746. confirmButtonColor: "#DD6B55",
  1747. confirmButtonText: "继续删除",
  1748. cancelButtonText: "取消操作",
  1749. closeOnConfirm: false,
  1750. closeOnCancel: false
  1751. }, function (isConfirm) {
  1752. if (isConfirm) {
  1753. api_bpm_schedule.del(model.id).then(function (response) {
  1754. if (response.status == 200) {
  1755. SweetAlert.swal("操作成功!", "数据已经被删除.", "success");
  1756. $scope.refreshData('expand-right');
  1757. } else {
  1758. SweetAlert.swal("操作失败!", "数据暂时无法被删除,请稍候重试", "error");
  1759. }
  1760. });
  1761. } else {
  1762. SweetAlert.swal("操作取消", "数据安全", "error");
  1763. }
  1764. });
  1765. }
  1766. // 继续创建
  1767. $scope.storageSj = function(model){
  1768. console.log(model);
  1769. $rootScope.newOrder({incident: model});
  1770. }
  1771. // 新增延期处理弹窗
  1772. $scope.toHandlerLog = function (model) {
  1773. console.log(model)
  1774. var modalInstance = $modal.open({
  1775. backdrop: false,
  1776. templateUrl: 'assets/views/incident/tpl/toHandlerLog.tpl.html',
  1777. controller: function ($scope, $modalInstance, api_bpm_domain,api_bpm_data, modelData, currentUserId, Alert, api_user_data,api_statistic) {
  1778. console.log(model,loginUser);
  1779. $scope.f = {
  1780. maintenanceMode: '',
  1781. estimatedNumberOfDays: ''
  1782. }
  1783. $scope.handlerLog = '';
  1784. $scope.user = [];
  1785. $scope.logs = [];
  1786. $scope.modes = [];
  1787. $scope.getModes=function(){
  1788. var data={
  1789. "idx":0,
  1790. "sum":999,
  1791. dictionary:{key:'repair_type'}
  1792. }
  1793. api_statistic.tableData(data,"dictionary").then(function(res){
  1794. $scope.modes=res.list
  1795. })
  1796. }
  1797. $scope.getModes();
  1798. $scope.getLogs=function(){
  1799. var data={
  1800. "idx":0,
  1801. "sum":999,
  1802. dictionary:{key:'processingLog'}
  1803. }
  1804. api_statistic.tableData(data,"dictionary").then(function(res){
  1805. $scope.logs=res.list
  1806. })
  1807. }
  1808. $scope.getLogs();
  1809. $scope.copyTo = function(value){
  1810. $scope.handlerLog += value;
  1811. }
  1812. $scope.ok = function () {
  1813. if (!$scope.f.maintenanceMode){
  1814. Alert.swal({
  1815. title: "操作失败",
  1816. text: "请选择延期原因!",
  1817. type: "error"
  1818. });
  1819. return;
  1820. }
  1821. if (!$scope.f.estimatedNumberOfDays){
  1822. Alert.swal({
  1823. title: "操作失败",
  1824. text: "请选择延期天数!",
  1825. type: "error"
  1826. });
  1827. return;
  1828. }
  1829. if (!$scope.handlerLog.trim()){
  1830. Alert.swal({
  1831. title: "操作失败",
  1832. text: "请填写延期说明!",
  1833. type: "error"
  1834. });
  1835. return;
  1836. }
  1837. $rootScope.isMask = true;
  1838. api_flow.accept("overtime", {
  1839. incident: {
  1840. ...model,
  1841. ...{
  1842. currentLog: {
  1843. remark: $scope.handlerLog,
  1844. extra1: $scope.f.maintenanceMode.id,
  1845. extra2: $scope.f.estimatedNumberOfDays,
  1846. }
  1847. }
  1848. }
  1849. }).then(function(response){
  1850. console.log(response)
  1851. $rootScope.isMask = false;
  1852. if (response.state == 200) {
  1853. Alert.swal({
  1854. title: "操作成功!",
  1855. confirmButtonColor: "#007AFF",
  1856. type: "success"
  1857. });
  1858. $modalInstance.close('success');
  1859. } else {
  1860. Alert.swal({
  1861. title: "操作失败",
  1862. text: "操作失败, 请稍后再试!",
  1863. type: "error"
  1864. });
  1865. }
  1866. });
  1867. }
  1868. $scope.cancel = function () {
  1869. $modalInstance.dismiss('cancel');
  1870. }
  1871. },
  1872. size: 'lg',
  1873. resolve: {
  1874. api_bpm: function () {
  1875. return api_bpm;
  1876. },
  1877. modelData: function () {
  1878. return model;
  1879. },
  1880. currentUserId: function () {
  1881. return loginUser.id;
  1882. },
  1883. Alert: function () {
  1884. return SweetAlert;
  1885. },
  1886. api_user_data: function () {
  1887. return api_user_data;
  1888. },
  1889. api_statistic: function () {
  1890. return api_statistic;
  1891. }
  1892. }
  1893. });
  1894. modalInstance.result.then(function (selectedItem) {
  1895. if (selectedItem == 'success') {
  1896. $scope.refreshData('expand-right', defaultFilterData);
  1897. }
  1898. });
  1899. }
  1900. // 设置责任科室
  1901. $scope.setDuty = function (model) {
  1902. console.log(model)
  1903. var modalInstance = $modal.open({
  1904. backdrop: false,
  1905. templateUrl: 'assets/views/incident/tpl/setDuty.tpl.html',
  1906. controller: function ($scope,$rootScope, $modalInstance, api_bpm_domain, modelData, currentUserId, Alert, api_user_data,api_category) {
  1907. console.log(model,loginUser);
  1908. $scope.assign = {
  1909. branch:undefined,
  1910. duty:undefined,
  1911. }
  1912. $scope.hospitalList = [];
  1913. $scope.dutyDeptList = [];
  1914. // 获取院区
  1915. $scope.getHospitals = function(){
  1916. //跨科室转派
  1917. api_user_data.fetchDataList('branch', {
  1918. "idx": 0,
  1919. "sum": 100
  1920. }).then(function (data) {
  1921. if(data.status == 200){
  1922. $scope.hospitalList = data.list;
  1923. if($scope.assign.duty){
  1924. $scope.assign.branch = $scope.hospitalList.find(v=>v.id == $scope.assign.duty.branch);
  1925. }else{
  1926. if($rootScope.user.duty){
  1927. // 当前的所属责任科室
  1928. $scope.assign.branch = $scope.hospitalList.find(v=>v.id == $rootScope.user.duty.branch);
  1929. $scope.assign.duty = $rootScope.user.duty;
  1930. }else if($rootScope.user.branch){
  1931. // 当前的所属院区
  1932. $scope.assign.branch = $scope.hospitalList.find(v=>v.id == $rootScope.user.branch.id);
  1933. }
  1934. }
  1935. }else{
  1936. SweetAlert.swal({
  1937. title: "系统错误!",
  1938. text: "请刷新重试!",
  1939. type: "error"
  1940. });
  1941. }
  1942. })
  1943. }
  1944. $scope.getHospitals();
  1945. // 修改院区
  1946. $scope.changeBranch = function(keyword){
  1947. if(keyword === undefined){
  1948. $scope.assign.duty = undefined;
  1949. $scope.dutyDeptList = [];
  1950. }
  1951. if(!$scope.assign.branch){
  1952. $scope.dutyDeptList = [];
  1953. return;
  1954. }
  1955. api_user_data.fetchDataList('dutyDepartment', {
  1956. "idx": 0,
  1957. "sum": 100,
  1958. "dutyDepartment":{
  1959. branch:$scope.assign.branch.id,
  1960. dept:keyword,
  1961. selectType: "pinyin_qs"
  1962. }
  1963. }).then(function (data) {
  1964. if(data.status == 200){
  1965. $scope.dutyDeptList = data.list;
  1966. }else{
  1967. SweetAlert.swal({
  1968. title: "系统错误!",
  1969. text: "请刷新重试!",
  1970. type: "error"
  1971. });
  1972. }
  1973. })
  1974. }
  1975. $scope.ok = function () {
  1976. if (!$scope.assign.duty){
  1977. Alert.swal({
  1978. title: "操作失败",
  1979. text: "请选择责任科室!",
  1980. type: "error"
  1981. });
  1982. return;
  1983. }
  1984. $rootScope.isMask = true;
  1985. api_bpm_domain.changeIncidentDuty({orderId: model.id, dutyId: $scope.assign.duty.id}).then(function (response) {
  1986. console.log(response)
  1987. $rootScope.isMask = false;
  1988. if (response.status == 200) {
  1989. Alert.swal({
  1990. title: "操作成功!",
  1991. confirmButtonColor: "#007AFF",
  1992. type: "success"
  1993. });
  1994. $modalInstance.close('success');
  1995. } else {
  1996. Alert.swal({
  1997. title: "操作失败",
  1998. text: "操作失败, 请稍后再试!",
  1999. type: "error"
  2000. });
  2001. }
  2002. });
  2003. }
  2004. $scope.cancel = function () {
  2005. $modalInstance.dismiss('cancel');
  2006. }
  2007. },
  2008. size: 'sm',
  2009. resolve: {
  2010. api_bpm: function () {
  2011. return api_bpm;
  2012. },
  2013. modelData: function () {
  2014. return model;
  2015. },
  2016. currentUserId: function () {
  2017. return loginUser.id;
  2018. },
  2019. Alert: function () {
  2020. return SweetAlert;
  2021. },
  2022. api_user_data: function () {
  2023. return api_user_data;
  2024. }
  2025. }
  2026. });
  2027. modalInstance.result.then(function (selectedItem) {
  2028. if (selectedItem == 'success') {
  2029. $scope.refreshData('expand-right', defaultFilterData);
  2030. }
  2031. });
  2032. }
  2033. if ($stateParams.model) {
  2034. if (JSON.parse($stateParams.model).searchType && JSON.parse($stateParams.model).searchType != null) {
  2035. $scope.searchstate = JSON.parse($stateParams.model).searchType;
  2036. } else {
  2037. $scope.searchstate = "todo";
  2038. }
  2039. } else {
  2040. $scope.searchstate = "todo";
  2041. }
  2042. if ($rootScope.user.group) {
  2043. var defaultFilterData = {
  2044. "idx": 0,
  2045. "sum": mun
  2046. };
  2047. } else {
  2048. var defaultFilterData = {
  2049. "idx": 0,
  2050. "sum": mun
  2051. };
  2052. }
  2053. if (angular.isDefined($rootScope.search) && angular.isDefined($rootScope.search.incident)) {
  2054. $scope.searchstate = $rootScope.search.incident;
  2055. }
  2056. $scope.ldloading = {};
  2057. //事件类型筛选
  2058. console.log($state);
  2059. if($state.params.tab){
  2060. $scope.searchstate = $state.params.tab;
  2061. }else{
  2062. $scope.searchstate = 'todo';
  2063. }
  2064. $scope.onChange = function (searchstate, isInit) {
  2065. $scope.isDisabledState = false;
  2066. $scope.searchstate = searchstate;
  2067. $scope.chiceIncident($scope.searchkeys,$scope.othcode.state, isInit);
  2068. }
  2069. // 是否逾期下拉框选择
  2070. $scope.selectTypeChange = function(isInit){
  2071. console.log($scope.searchkeys.selectType,66666);
  2072. if(window.sessionStorage.getItem('isGoyuqi') == 'yes'){
  2073. $scope.searchkeys.selectType = $scope.selectType.find(v => v.value == 'unresolved');
  2074. }
  2075. var ids = $scope.searchkeys.selectType.id
  2076. if(defaultFilterData.incident){
  2077. defaultFilterData.incident.selectType = ids;
  2078. }else{
  2079. defaultFilterData.incident = {
  2080. selectType:ids
  2081. };
  2082. }
  2083. console.log(defaultFilterData,2222)
  2084. $scope.onChange('all', isInit);
  2085. }
  2086. //获取列表数据
  2087. $scope.refreshData = _.debounce(function (style, filterData, isInit) {
  2088. $scope.ldloading[style.replace('-', '_')] = true;
  2089. if (angular.isUndefined(filterData)) {
  2090. filterData = defaultFilterData;
  2091. if(isInit){
  2092. if($state.params.tab){
  2093. $scope.searchstate = $state.params.tab;
  2094. filterData.idx = 0;
  2095. $scope.gridOptions.paginationCurrentPage = 1 + filterData.idx;
  2096. }
  2097. if($state.params.date == 'today'){
  2098. $scope.othcode = {};
  2099. $scope.searchkeys.acceptDate = new Date();
  2100. $scope.searchkeys.acceptDateEnd = new Date();
  2101. if(filterData.incident){
  2102. filterData.incident.acceptDate = moment().format('YYYY-MM-DD 00:00:00');
  2103. filterData.incident.acceptDateEnd = moment().format('YYYY-MM-DD 23:59:59');
  2104. }else{
  2105. filterData.incident = {
  2106. acceptDate: moment().format('YYYY-MM-DD 00:00:00'),
  2107. acceptDateEnd: moment().format('YYYY-MM-DD 23:59:59'),
  2108. }
  2109. }
  2110. }else{
  2111. $scope.searchkeys.acceptDate = undefined;
  2112. $scope.searchkeys.acceptDateEnd = undefined;
  2113. }
  2114. if($state.params.state){
  2115. var obj = $scope.state.find(function(v){return $state.params.state == v.id});
  2116. $scope.othcode = {state:obj};
  2117. if(filterData.incident){
  2118. filterData.incident.statusId = $state.params.state;
  2119. }else{
  2120. filterData.incident = {
  2121. statusId: $state.params.state,
  2122. }
  2123. }
  2124. }
  2125. }
  2126. }
  2127. $scope.myData = [];
  2128. $scope.memoryfilterData = filterData;
  2129. $scope.gridOptions['sum'] = filterData.sum;
  2130. // 请求参数调整
  2131. if(!filterData.incident){
  2132. filterData.incident = {};
  2133. }
  2134. if($scope.searchstate === 'all' || $scope.searchstate === 'callback'){
  2135. if($rootScope.user.duty){
  2136. // 当前的所属责任科室
  2137. filterData.incident.duty = $rootScope.user.duty;
  2138. }else if($rootScope.user.branch){
  2139. // 当前的所属院区
  2140. filterData.incident.branch = $rootScope.user.branch.id;
  2141. }
  2142. }else{
  2143. delete filterData.incident.duty;
  2144. delete filterData.incident.branch;
  2145. }
  2146. filterData.incident.queryTask = $scope.searchstate;
  2147. filterData.incident.assignee = loginUser.id;
  2148. if($scope.searchstate === 'todo' || $scope.searchstate === 'owns'){
  2149. filterData.incident.candidateGroups = loginuserGroup;
  2150. }else{
  2151. delete filterData.incident.candidateGroups;
  2152. }
  2153. // 调用接口-查列表
  2154. api_user_data.fetchDataList('incident', filterData).then(function (data) {
  2155. if (data.list) {
  2156. var myData = Restangular.stripRestangular(data);
  2157. $scope.gridOptions['totalItems'] = myData.totalNum;
  2158. $scope.myData = myData.list;
  2159. for (var i = 0; i < $scope.myData.length; i++) {
  2160. $scope.myData[i]['item'] = i + 1 + filterData.idx * filterData.sum
  2161. }
  2162. } else {
  2163. SweetAlert.swal({
  2164. title: "系统错误",
  2165. text: "请稍后再试!",
  2166. type: "error"
  2167. });
  2168. }
  2169. $scope.ldloading[style.replace('-', '_')] = false;
  2170. }, function () {
  2171. $scope.ldloading[style.replace('-', '_')] = false;
  2172. });
  2173. // 获取数量
  2174. $scope.count(filterData.incident, isInit);
  2175. }, 500);
  2176. // 调用接口-查数量
  2177. $scope.count = function (incident = {}){
  2178. let postData = {
  2179. incidentList: [],
  2180. }
  2181. $scope.tabs.forEach(v => {
  2182. postData.incidentList.push({...incident, ...{queryTask: v.key}});
  2183. })
  2184. postData.incidentList.forEach(incident => {
  2185. // 请求参数调整
  2186. if(!incident){
  2187. incident = {};
  2188. }
  2189. if(incident.queryTask === 'all' || incident.queryTask === 'callback'){
  2190. if($rootScope.user.duty){
  2191. // 当前的所属责任科室
  2192. incident.duty = $rootScope.user.duty;
  2193. }else if($rootScope.user.branch){
  2194. // 当前的所属院区
  2195. incident.branch = $rootScope.user.branch.id;
  2196. }
  2197. }else{
  2198. delete incident.duty;
  2199. delete incident.branch;
  2200. }
  2201. incident.assignee = loginUser.id;
  2202. if(incident.queryTask === 'todo' || incident.queryTask === 'owns'){
  2203. incident.candidateGroups = loginuserGroup;
  2204. }else{
  2205. delete incident.candidateGroups;
  2206. }
  2207. })
  2208. api_flow.count(postData).then(function (data) {
  2209. if (data.state == 200) {
  2210. let myData = data.data || {};
  2211. $scope.tabs.forEach(v => {
  2212. v.num = myData[v.key];
  2213. })
  2214. } else {
  2215. SweetAlert.swal({
  2216. title: "系统错误",
  2217. text: "请稍后再试!",
  2218. type: "error"
  2219. });
  2220. }
  2221. });
  2222. }
  2223. // 进入页面时
  2224. $scope.getIncidentStatus();
  2225. $scope.timer = $interval(function () {
  2226. $scope.jry_refresh()
  2227. }, $rootScope.refreshTime);
  2228. $scope.$on('$destroy', function () {
  2229. $interval.cancel($scope.timer)
  2230. });
  2231. }]);
  2232. //操作按钮权限控制
  2233. app.controller('IncidentOperCtrl', ['$rootScope', '$scope', '$state', function ($rootScope, $scope, $state) {
  2234. var loginUser = $rootScope.user;
  2235. $scope.user = $rootScope.user;
  2236. $scope.chuli = false;
  2237. $scope.allFlag = false;
  2238. $scope.qiangdan = false;
  2239. $scope.huifang = false;
  2240. $scope.delFlag = false;
  2241. $scope.storageFlag = false;
  2242. $scope.editFlag = false;//编辑
  2243. $scope.assignFlag = false;//指派
  2244. $scope.transferFlag = false;//转派
  2245. $scope.shijianliebiao_duty = false;//设置责任科室
  2246. for (var i = 0; i < loginUser.menu.length; i++) {
  2247. if (loginUser.menu[i].link == "shijianliebiao_all") {
  2248. $scope.allFlag = true
  2249. }
  2250. if (loginUser.menu[i].link == "shijianliebiao_chuli") {
  2251. $scope.chuli = true
  2252. }
  2253. if (loginUser.menu[i].link == "shijianliebiao_qiangdan") {
  2254. $scope.qiangdan = true
  2255. }
  2256. if (loginUser.menu[i].link == "shijianliebiao_huifang") {
  2257. $scope.huifang = true
  2258. }
  2259. if (loginUser.menu[i].link == "shijianliebiao_del") {
  2260. $scope.delFlag = true
  2261. }
  2262. if (loginUser.menu[i].link == "shijianliebiao_build") {
  2263. $scope.storageFlag = true
  2264. }
  2265. if (loginUser.menu[i].link == "shijianliebiao_edit") {
  2266. $scope.editFlag = true
  2267. }
  2268. if (loginUser.menu[i].link == "shijianliebiao_assign") {
  2269. $scope.assignFlag = true
  2270. }
  2271. if (loginUser.menu[i].link == "shijianliebiao_transfer") {
  2272. $scope.transferFlag = true
  2273. }
  2274. if (loginUser.menu[i].link == "shijianliebiao_duty") {
  2275. $scope.shijianliebiao_duty = true
  2276. }
  2277. }
  2278. $scope.up = true;
  2279. $scope.fuwutaiRenYuan = false;//服务台人员
  2280. for (var i = 0; i < $rootScope.user.role.length; i++) {
  2281. if ($rootScope.user.role[i].role == '事件经理') {
  2282. $scope.up = false;
  2283. }
  2284. if ($rootScope.user.role[i].id == 29701) {
  2285. $scope.fuwutaiRenYuan = true;
  2286. }
  2287. }
  2288. $rootScope.callid = $scope.item.callID;
  2289. if ($scope.item.callID) {
  2290. $scope.item.listen = true;
  2291. } else {
  2292. $scope.item.listen = false;
  2293. }
  2294. $rootScope.user.group.forEach(function (item, v) {
  2295. if($scope.item.currentLog){
  2296. if (item.id == $scope.item.currentLog.groupId) {
  2297. $scope.item.tiquPower = true;
  2298. }
  2299. }
  2300. })
  2301. //修改页面显示判断
  2302. $scope.jry_modify = function (item, user) {
  2303. // 待接单的时候,处理人或处理组
  2304. let flag1 = item.state && item.state.value == 'pending' && ((item.currentLog && item.currentLog.workerId == user.id) || item.tiquPower);
  2305. // 处理中的时候,处理人或处理组
  2306. let flag2 = item.state && item.state.value == 'handler' && item.handlingPersonnelUser && item.handlingPersonnelUser.id == user.id;
  2307. // 已关闭,且不是已删除
  2308. let flag3 = item.deleteFlag !== 1 && item.state.value !== 'close';
  2309. return flag3 && (($scope.editFlag && $scope.allFlag) || flag1 || flag2 || (item.acceptUser ? item.acceptUser.id == user.id : false));
  2310. }
  2311. // 回访操作权限
  2312. for (var obj in $rootScope.user.role) {
  2313. if ($rootScope.user.role[obj].rolecode == 'call center') {
  2314. if ($scope.item.state && $scope.item.state.value == 'close') {
  2315. $scope.item.huifang = true;
  2316. } else {}
  2317. }
  2318. }
  2319. $scope.edit = function () {
  2320. $scope.colobject.grid.appScope.selectRowFunction($scope.item);
  2321. }
  2322. $scope.changeCenter = function () {
  2323. $scope.colobject.grid.appScope.changeClick($scope.item);
  2324. }
  2325. $scope.visit = function () {
  2326. $scope.colobject.grid.appScope.visit($scope.item);
  2327. }
  2328. // 指派
  2329. $scope.toAssign = function () {
  2330. $scope.colobject.grid.appScope.toAssign($scope.item);
  2331. }
  2332. // 转派
  2333. $scope.toTransfer = function () {
  2334. $scope.colobject.grid.appScope.toTransfer($scope.item);
  2335. }
  2336. // 删除事件
  2337. $scope.delSj = function () {
  2338. $scope.colobject.grid.appScope.delSj($scope.item);
  2339. }
  2340. // 继续创建
  2341. $scope.storageSj = function () {
  2342. $scope.colobject.grid.appScope.storageSj($scope.item);
  2343. }
  2344. // 新增延期处理
  2345. $scope.toHandlerLog = function () {
  2346. $scope.colobject.grid.appScope.toHandlerLog($scope.item);
  2347. }
  2348. // 设置责任科室
  2349. $scope.setDuty = function () {
  2350. $scope.colobject.grid.appScope.setDuty($scope.item);
  2351. }
  2352. $scope.play = function () { //record
  2353. $scope.colobject.grid.appScope.play($scope.item);
  2354. }
  2355. $scope.handler = function () {
  2356. $scope.colobject.grid.appScope.acceptTaskAction($scope.item);
  2357. }
  2358. //查看
  2359. $scope.toDetail = function (data) {
  2360. console.log(data,$rootScope.isFuwutai);
  2361. if($rootScope.isFuwutai){
  2362. //角色是服务台人员
  2363. $state.go('app.incident.incidentDetail', {
  2364. id: data.id,
  2365. });
  2366. }else{
  2367. window.open(location.origin+'/#/app/incident/incidentDetail/'+data.id);
  2368. }
  2369. };
  2370. }]);
  2371. //操作按钮
  2372. app.directive('incidentoperator', function () {
  2373. return {
  2374. restrict: 'E',
  2375. scope: {
  2376. item: '=',
  2377. colobject: '='
  2378. },
  2379. controller: 'IncidentOperCtrl',
  2380. template: '<div><div class="cl-effect-1 ui-grid-cell-contents pull-left" style="text-align:left;">' +
  2381. '<a ng-click="toDetail(item)" class="bianjifont" >查看</a>' +
  2382. '<a ng-click="changeCenter()" ng-show="jry_modify(item, user)" class="luyinfont">编辑</a>' +
  2383. '<a ng-click="delSj()" ng-show="{{delFlag && item.deleteFlag !== 1}}" class="assign" >删除</a>' +
  2384. '<a ng-click="storageSj()" ng-show="{{storageFlag && item.state.value === \'storage\' && item.deleteFlag !== 1}}" class="assign" >继续创建</a><br>' +
  2385. '<a ng-click="edit()" ng-show="{{item.state.value == \'handler\' && item.handlingPersonnelUser && item.handlingPersonnelUser.id == user.id && chuli && item.deleteFlag !== 1}}" class="bianjifont">处理</a>' +
  2386. '<a ng-click="handler()" ng-show="{{item.state.value == \'pending\' && ((item.currentLog && item.currentLog.workerId == user.id) || item.tiquPower) && qiangdan && item.deleteFlag !== 1}}" class="bianjifont" >接单</a>' +
  2387. '<a ng-click="visit()" ng-show="{{item.state.value == \'close\' && huifang && item.deleteFlag !== 1}}" class="bianjifont">回访</a>' +
  2388. '<a ng-click="toAssign()" ng-show="{{(item.state.value == \'pending\' || item.state.value == \'handler\' || item.state.value == \'reassign\') && assignFlag && item.deleteFlag !== 1}}" class="assign" >指派</a>' +
  2389. '<a ng-click="toTransfer()" ng-show="{{item.state.value == \'handler\' && item.handlingPersonnelUser && item.handlingPersonnelUser.id == user.id && !assignFlag && transferFlag && item.deleteFlag !== 1}}" class="assign" >转派</a>' +
  2390. '<a ng-click="toHandlerLog()" ng-show="{{item.state.value == \'handler\' && item.handlingPersonnelUser && item.handlingPersonnelUser.id == user.id && item.deleteFlag !== 1}}" class="assign" >延期处理</a>' +
  2391. '<a ng-click="setDuty()" ng-show="{{shijianliebiao_duty && (item.state.value == \'resolved\' || item.state.value == \'close\') && item.deleteFlag !== 1}}" class="assign" >设置责任科室</a>' +
  2392. '</div></div>'
  2393. };
  2394. });