incidentCtrl.js 100 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498
  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. if(fildata.incident&&fildata.incident.selectType){
  695. fildata.incident.selectType = fildata.incident.selectType.id;
  696. }
  697. // /seimin
  698. $scope.refreshData('expand-right', fildata, isInit);
  699. $interval.cancel($scope.timer);
  700. $scope.timer = $interval(function () {
  701. $scope.jry_refresh()
  702. }, $rootScope.refreshTime);
  703. }
  704. //区域地点过滤
  705. api_user_data.fetchDataList('area', {
  706. "idx": 0,
  707. "sum": 1000
  708. }).then(function (response) {
  709. if (response) {
  710. if (response.status = 200) {
  711. $scope.outarea = response.list;
  712. }
  713. }
  714. })
  715. //报修人
  716. var getRequester = function () {
  717. api_user_data.fetchDataList('user', {
  718. idx: 0,
  719. sum: 100,
  720. user:{
  721. engineer: undefined,
  722. }
  723. }).then(function (data) {
  724. // console.log(data);
  725. $scope.requester = data.list
  726. });
  727. }
  728. $scope.repairMain.valueconfig == 1 && getRequester();
  729. //受理人,处理人
  730. var getUser = function (fieldatas, it) {
  731. api_user_data.fetchDataList('user', fieldatas).then(function (data) {
  732. if (it == 1) {
  733. $scope.acceptUser = data.list;
  734. } else if (it == 2) {
  735. $scope.handlingPersonnelUser = data.list;
  736. }
  737. });
  738. }
  739. //受理人过滤
  740. $scope.onChangeacceptUser = function (key) {
  741. console.log(key)
  742. var filuser = {
  743. "idx": 0,
  744. "sum": 10,
  745. "user": {
  746. "name": key,
  747. 'selectType': "pinyin_qs",
  748. engineer: 1,
  749. }
  750. }
  751. getUser(filuser, 1);
  752. }
  753. //处理人过滤
  754. $scope.onChangehandling = function (key) {
  755. var filuser = {
  756. "idx": 0,
  757. "sum": 10,
  758. "user": {
  759. "name": key,
  760. 'selectType': "pinyin_qs",
  761. engineer: 1,
  762. }
  763. }
  764. getUser(filuser, 2);
  765. }
  766. //报修科室过滤
  767. $scope.onChangeDept = function (key) {
  768. $scope.getDept(key)
  769. }
  770. //地点区域过滤
  771. $scope.onChangearea = function (data) {
  772. delete $scope.searchkeys.place;
  773. if ($scope.memoryfilterData.incident) {
  774. delete $scope.memoryfilterData.incident.place;
  775. }
  776. var fildata = {
  777. "idx": 0,
  778. "sum": 1000,
  779. "place": {
  780. area: {
  781. id: data.area.id
  782. }
  783. }
  784. };
  785. api_user_data.fetchDataList('place', fildata).then(function (response) {
  786. if (response) {
  787. if (response.status = 200) {
  788. $scope.outplace = response.list;
  789. }
  790. }
  791. })
  792. };
  793. $scope.starttime = function (data) {
  794. return moment(new Date(data)).format('YYYY-MM-DD')
  795. }
  796. $scope.overtime = function (data) {
  797. return moment(new Date(data)).format('YYYY-MM-DD HH:mm')
  798. }
  799. $scope.areaplace = function (data) {
  800. var str = '';
  801. str += '<strong>' + data.branchName + '</strong>';
  802. str += (data.place ? (data.place.area ? data.place.area.area : '') : '');
  803. str += (data.place ? (data.place.place ? data.place.place : '') : '');
  804. str += (data.houseNumber ? data.houseNumber : '');
  805. return str || '无';
  806. }
  807. //录音
  808. $scope.play = function (data) {
  809. console.log(data.callID)
  810. var modalInstance = $modal.open({
  811. backdrop: "static",
  812. templateUrl: 'assets/views/incident/tpl/audio.html',
  813. controller: function ($rootScope, $scope, $modalInstance, $sce, $http, api_bpm_data) {
  814. // $rootScope.setbusy();
  815. $scope.datasurl = "";
  816. api_bpm_data.fetchDataList("callrecord", {idx: 0, sum: 1, callrecord: {callAccept: data.callID}}).then(function(data) {
  817. if(data.status == 200){
  818. data.list = data.list || [];
  819. if(data.list.length){
  820. $scope.audioUrl = $sce.trustAsResourceUrl(callIp+data.list[0].recordingFileName);
  821. }
  822. }
  823. });
  824. $scope.download = function (contentId, filename) {
  825. $http({
  826. url: "http://" + $scope.datasurl,
  827. method: 'GET',
  828. headers: {
  829. 'Content-type': 'application/octet-stream',
  830. },
  831. responseType: 'arraybuffer'
  832. }).success(function (data, status, headers, config) {
  833. var file = new Blob([data], {
  834. type: 'application/octet-stream'
  835. });
  836. //trick to download store a file having its URL
  837. var fileURL = URL.createObjectURL(file);
  838. var a = document.createElement('a');
  839. a.href = fileURL;
  840. a.target = '_blank';
  841. a.download = filename;
  842. document.body.appendChild(a);
  843. a.click();
  844. }).error(function (data, status, headers, config) {
  845. // console.log(data);
  846. });
  847. }
  848. $scope.cancel = function () {
  849. $modalInstance.dismiss('cancel');
  850. };
  851. $modalInstance.close();
  852. },
  853. });
  854. modalInstance.result.then(function (result) {}, function (reason) {});
  855. };
  856. //列表排序
  857. $scope.gridOptions.onRegisterApi = function (gridApi) {
  858. $scope.gridApi = gridApi;
  859. var index = 0;
  860. var oldheader = {};
  861. gridApi.grid.sortColumn = function (gridApi) {
  862. if (oldheader.field) {
  863. if (oldheader.field == gridApi.field) {
  864. } else {
  865. index = 0;
  866. }
  867. }
  868. index++;
  869. oldheader = gridApi;
  870. var fildata = $scope.memoryfilterData;
  871. if (index % 3 == 0) {
  872. delete $scope.memoryfilterData.incident;
  873. fildata = $scope.memoryfilterData;
  874. } else if (index % 3 == 1) {
  875. if (fildata.incident) {
  876. if (gridApi.field == "acceptDate") {
  877. angular.extend(fildata.incident, {
  878. "sort": gridApi.field
  879. });
  880. } else {
  881. angular.extend(fildata.incident, {
  882. "sort": gridApi.field + " desc , _incident.acceptDate"
  883. });
  884. }
  885. } else {
  886. if (gridApi.field == "acceptDate") {
  887. angular.extend(fildata, {
  888. 'incident': {
  889. "sort": gridApi.field
  890. }
  891. });
  892. } else {
  893. angular.extend(fildata, {
  894. 'incident': {
  895. "sort": gridApi.field + " desc , _incident.acceptDate"
  896. }
  897. });
  898. }
  899. }
  900. } else if (index % 3 == 2) {
  901. if (fildata.incident) {
  902. if (gridApi.field == "acceptDate") {
  903. angular.extend(fildata.incident, {
  904. "sort": gridApi.field,
  905. "order": "asc"
  906. });
  907. } else {
  908. angular.extend(fildata.incident, {
  909. "sort": gridApi.field + " asc , _incident.acceptDate"
  910. });
  911. }
  912. } else {
  913. if (gridApi.field == "acceptDate") {
  914. angular.extend(fildata, {
  915. 'incident': {
  916. "sort": gridApi.field,
  917. "order": "asc"
  918. }
  919. });
  920. } else {
  921. angular.extend(fildata.incident, {
  922. "sort": gridApi.field + " asc , _incident.acceptDate"
  923. });
  924. }
  925. }
  926. }
  927. $scope.refreshData('expand-right', fildata);
  928. }
  929. $scope.jry_idx = 0;
  930. $scope.jry_sum = 10;
  931. gridApi.pagination.on.paginationChanged($scope, function (newPage, pageSize) {
  932. var filtersData = $scope.memoryfilterData;
  933. filtersData.idx = newPage - 1;
  934. $scope.jry_idx = newPage - 1;
  935. filtersData.sum = pageSize;
  936. $scope.jry_sum = pageSize;
  937. $scope.refreshData('expand-right', filtersData);
  938. });
  939. $scope.Change = function (upTypes) {
  940. if (angular.isDefined($scope.selected.items)) {
  941. if (angular.isDefined(upTypes) && upTypes == 'upincident') {
  942. var data = {
  943. cancelUrl: 'app.incident.list',
  944. model: {
  945. problem: {
  946. title: $scope.selected.items.title,
  947. des: $scope.selected.items.description,
  948. proposePerson: $scope.selected.items.handlerUser,
  949. source: {
  950. id: 1,
  951. code: 1,
  952. name: ' 事件 '
  953. },
  954. incident: $scope.selected.items
  955. }
  956. }
  957. }
  958. $state.go('app.problem.incident', {
  959. pdKey: 'incident',
  960. dataId: $scope.selected.items.id,
  961. processInstanceId: $scope.selected.items.processInstanceId,
  962. 'model': JSON.stringify(data)
  963. });
  964. } else if (angular.isDefined(upTypes) && upTypes == 'upchange') {
  965. var data = {
  966. cancelUrl: 'app.incident.list',
  967. model: {
  968. change: {
  969. title: $scope.selected.items.title,
  970. description: $scope.selected.items.description,
  971. requestingPerson: $scope.selected.items.handlerUser,
  972. source: {
  973. id: 1,
  974. code: 1,
  975. name: ' 事件 '
  976. },
  977. incident: $scope.selected.items
  978. }
  979. }
  980. }
  981. // var data={cancelUrl:'app.incident.list'}
  982. $state.go('app.change.incident', {
  983. pdKey: 'incident',
  984. dataId: $scope.selected.items.id,
  985. processInstanceId: $scope.selected.items.processInstanceId,
  986. 'model': JSON.stringify(data)
  987. });
  988. }
  989. }
  990. }
  991. $scope.selected = {
  992. items: []
  993. }
  994. gridApi.core.on.filterChanged($scope, function () {
  995. var grid = this.grid;
  996. if ($rootScope.user.group) {
  997. var filtersData = {
  998. idx: 0,
  999. sum: mun
  1000. };
  1001. } else {
  1002. var filtersData = {
  1003. idx: 0,
  1004. sum: mun
  1005. };
  1006. }
  1007. angular.forEach(grid.columns, function (item) {
  1008. if (item.enableFiltering) {
  1009. if (angular.isDefined(item.filters[0].term) && item.filters[0].term != '') {
  1010. filtersData = $scope.memoryfilterData
  1011. if (angular.isUndefined(filtersData['incident'])) {
  1012. filtersData['incident'] = {};
  1013. }
  1014. if (item.field == 'department.dept') {
  1015. filtersData['incident']['department'] = {};
  1016. filtersData.incident.department['department'] = item.filters[0].term;
  1017. } else if (item.field == 'handlingPersonnelUser.name') {
  1018. filtersData['incident']['handlingPersonnelUser'] = {};
  1019. filtersData.incident.handlingPersonnelUser['name'] = item.filters[0].term;
  1020. } else if (item.field == 'requester.account') {
  1021. filtersData['incident']['requester'] = {};
  1022. filtersData.incident.requester['account'] = item.filters[0].term;
  1023. } else if (item.field == 'acceptUser.name') {
  1024. filtersData['incident']['acceptUser'] = {};
  1025. filtersData.incident.acceptUser['name'] = item.filters[0].term;
  1026. } else {
  1027. filtersData['incident'][item.field] = item.filters[0].term;
  1028. }
  1029. }
  1030. }
  1031. });
  1032. filtersData.idx = 0;
  1033. $scope.memoryfilterData = filtersData;
  1034. $scope.refreshData('expand-right', filtersData);
  1035. });
  1036. };
  1037. //处理
  1038. $scope.selectRowFunction = function (model) {
  1039. console.log(model)
  1040. var modalInstance = $modal.open({
  1041. backdrop: false,
  1042. templateUrl: 'assets/views/incident/tpl/doing.tpl.html',
  1043. controller: function ($scope,$rootScope, $modalInstance, api_bpm_domain, modelData, currentUserId, Alert, api_user_data,api_category) {
  1044. console.log(model,loginUser);
  1045. $scope.model = model;
  1046. $scope.postData = {
  1047. handleCategory: undefined,
  1048. closecode: undefined,
  1049. handleDescription: '',
  1050. synergetic: [],
  1051. }
  1052. $scope.incidentHandleCategoryList = [];
  1053. $scope.incidentClosecodeList = [];
  1054. $scope.synergeticList = [];
  1055. // 获取处理方式
  1056. $scope.getIncidentHandleCategory = function(){
  1057. api_wechatfile.getDictionary({"key":"incident_handleCategory","type":"list"}).then(function (data) {
  1058. $scope.incidentHandleCategoryList = data || [];
  1059. if(!$scope.postData.handleCategory){
  1060. let handleCategory = $scope.incidentHandleCategoryList.find(v => v.value == 'SUPPORT');
  1061. $scope.postData.handleCategory = handleCategory || undefined;
  1062. }
  1063. })
  1064. }
  1065. // 获取处理结果
  1066. $scope.getIncidentClosecode = function(){
  1067. api_wechatfile.getDictionary({"key":"incident_closecode","type":"list"}).then(function (data) {
  1068. $scope.incidentClosecodeList = data || [];
  1069. if(!$scope.postData.closecode){
  1070. let closecode = $scope.incidentClosecodeList.find(v => v.value == '060');
  1071. $scope.postData.closecode = closecode || undefined;
  1072. }
  1073. })
  1074. }
  1075. // 获取协同人
  1076. $scope.getSynergeticList = function(keyword = ''){
  1077. let postData = {
  1078. "idx":0,
  1079. "sum":10,
  1080. "user":{
  1081. currentDuty: model.duty ? model.duty.id : undefined,
  1082. name: keyword,
  1083. selectType: "pinyin_qs",
  1084. engineer: 1,
  1085. roledata: {
  1086. "rolecode": "first-line support"
  1087. },
  1088. }
  1089. };
  1090. api_simple.fetchDataList("user", postData).then(result => {
  1091. if(result.status == 200){
  1092. $scope.synergeticList = result.list || [];
  1093. }else{
  1094. $scope.synergeticList = [];
  1095. }
  1096. })
  1097. }
  1098. // 初始化
  1099. $scope.getIncidentHandleCategory();
  1100. $scope.getIncidentClosecode();
  1101. $scope.getSynergeticList();
  1102. $scope.ok = function () {
  1103. if (!$scope.postData.handleCategory){
  1104. Alert.swal({
  1105. title: "操作失败",
  1106. text: "请选择处理方式!",
  1107. type: "error"
  1108. });
  1109. return;
  1110. }
  1111. if ($scope.model.category.hasSimple != 1 &&!$scope.postData.closecode){
  1112. Alert.swal({
  1113. title: "操作失败",
  1114. text: "请选择处理结果!",
  1115. type: "error"
  1116. });
  1117. return;
  1118. }
  1119. if ($scope.model.category.hasSimple != 1 &&!$scope.postData.handleDescription){
  1120. Alert.swal({
  1121. title: "操作失败",
  1122. text: "请填写处理方案!",
  1123. type: "error"
  1124. });
  1125. return;
  1126. }
  1127. let postData = {incident: {...model, ...{
  1128. handleCategory: $scope.postData.handleCategory,
  1129. closecode: $scope.postData.closecode,
  1130. handleDescription: $scope.postData.handleDescription,
  1131. synergetic: $scope.postData.synergetic.length ? $scope.postData.synergetic : undefined,
  1132. }}};
  1133. $rootScope.isMask = true;
  1134. api_flow.accept("doing", postData).then(function (response) {
  1135. console.log(response)
  1136. $rootScope.isMask = false;
  1137. if (response.state == 200) {
  1138. Alert.swal({
  1139. title: "操作成功!",
  1140. confirmButtonColor: "#007AFF",
  1141. type: "success"
  1142. });
  1143. $modalInstance.close('success');
  1144. } else {
  1145. Alert.swal({
  1146. title: "操作失败",
  1147. text: "操作失败, 请稍后再试!",
  1148. type: "error"
  1149. });
  1150. }
  1151. });
  1152. }
  1153. $scope.cancel = function () {
  1154. $modalInstance.dismiss('cancel');
  1155. }
  1156. },
  1157. size: 'sm',
  1158. resolve: {
  1159. api_bpm: function () {
  1160. return api_bpm;
  1161. },
  1162. modelData: function () {
  1163. return model;
  1164. },
  1165. currentUserId: function () {
  1166. return loginUser.id;
  1167. },
  1168. Alert: function () {
  1169. return SweetAlert;
  1170. },
  1171. api_user_data: function () {
  1172. return api_user_data;
  1173. }
  1174. }
  1175. });
  1176. modalInstance.result.then(function (selectedItem) {
  1177. if (selectedItem == 'success') {
  1178. $scope.refreshData('expand-right', defaultFilterData);
  1179. }
  1180. });
  1181. };
  1182. //修改
  1183. $scope.changeClick = function (data) {
  1184. // $state.go('app.incident.detail', {
  1185. // formKey: 'incident_change',
  1186. // pdKey: 'incident',
  1187. // dataId: data.id,
  1188. // taskId: data.taskId,
  1189. // processInstanceId: data.processInstanceId
  1190. // });
  1191. $rootScope.newOrder({
  1192. incident: data,
  1193. },'edit')
  1194. };
  1195. //回访
  1196. $scope.visit = function (model) {
  1197. console.log(model)
  1198. var modalInstance = $modal.open({
  1199. backdrop: false,
  1200. templateUrl: 'assets/views/incident/tpl/callback.tpl.html',
  1201. controller: function ($scope,$rootScope, $modalInstance, api_bpm_domain, modelData, currentUserId, Alert, api_user_data,api_category) {
  1202. console.log(model,loginUser);
  1203. $scope.model = model;
  1204. $scope.postData = {
  1205. degree: undefined,
  1206. visitRemarks: '',
  1207. }
  1208. $scope.degreeList = [];
  1209. // 获取满意度评价
  1210. $scope.getDegree = function(){
  1211. api_wechatfile.getDictionary({"key":"incident_degree","type":"list"}).then(function (data) {
  1212. $scope.degreeList = data || [];
  1213. })
  1214. }
  1215. // 获取结果类型
  1216. $scope.getHandleResult = function(){
  1217. api_wechatfile.getDictionary({"key":"incident_handleresult","type":"list"}).then(function (data) {
  1218. $scope.handleResultList = data || [];
  1219. })
  1220. }
  1221. // 初始化
  1222. $scope.getDegree();
  1223. $scope.getHandleResult();
  1224. $scope.ok = function () {
  1225. if (!$scope.postData.degree){
  1226. Alert.swal({
  1227. title: "操作失败",
  1228. text: "请选择满意度评价!",
  1229. type: "error"
  1230. });
  1231. return;
  1232. }
  1233. if (!$scope.postData.handleResult){
  1234. Alert.swal({
  1235. title: "操作失败",
  1236. text: "请选择结果类型!",
  1237. type: "error"
  1238. });
  1239. return;
  1240. }
  1241. let postData = {incident: {...model, ...{
  1242. degree: $scope.postData.degree,
  1243. handleResult: $scope.postData.handleResult,
  1244. visitRemarks: $scope.postData.visitRemarks,
  1245. }}};
  1246. $rootScope.isMask = true;
  1247. api_flow.accept("callback", postData).then(function (response) {
  1248. console.log(response)
  1249. $rootScope.isMask = false;
  1250. if (response.state == 200) {
  1251. Alert.swal({
  1252. title: "操作成功!",
  1253. confirmButtonColor: "#007AFF",
  1254. type: "success"
  1255. });
  1256. $modalInstance.close('success');
  1257. } else {
  1258. Alert.swal({
  1259. title: "操作失败",
  1260. text: "操作失败, 请稍后再试!",
  1261. type: "error"
  1262. });
  1263. }
  1264. });
  1265. }
  1266. $scope.cancel = function () {
  1267. $modalInstance.dismiss('cancel');
  1268. }
  1269. },
  1270. size: 'sm',
  1271. resolve: {
  1272. api_bpm: function () {
  1273. return api_bpm;
  1274. },
  1275. modelData: function () {
  1276. return model;
  1277. },
  1278. currentUserId: function () {
  1279. return loginUser.id;
  1280. },
  1281. Alert: function () {
  1282. return SweetAlert;
  1283. },
  1284. api_user_data: function () {
  1285. return api_user_data;
  1286. }
  1287. }
  1288. });
  1289. modalInstance.result.then(function (selectedItem) {
  1290. if (selectedItem == 'success') {
  1291. $scope.refreshData('expand-right', defaultFilterData);
  1292. }
  1293. });
  1294. };
  1295. //导出
  1296. $scope.export = function () {
  1297. $rootScope.isMask = true;
  1298. console.log($scope.memoryfilterData)
  1299. var filadata = angular.copy($scope.memoryfilterData);
  1300. filadata.sum = 10000;
  1301. console.log($scope.filadata)
  1302. $http({
  1303. url: api_bpm_data.downDataModel("incident", 3).getRequestedUrl(),
  1304. method: 'POST',
  1305. data: JSON.stringify(filadata),
  1306. headers: {
  1307. 'Accept': '*/*'
  1308. },
  1309. responseType: 'arraybuffer'
  1310. }).success(function (data, status, headers, config) {
  1311. $rootScope.isMask = false;
  1312. var file = new Blob([data], {
  1313. type: 'application/vnd.ms-excel'
  1314. });
  1315. //trick to download store a file having its URL
  1316. var fileURL = URL.createObjectURL(file);
  1317. var a = document.createElement('a');
  1318. a.href = fileURL;
  1319. a.target = '_blank';
  1320. a.download = '工单列表.xls';
  1321. document.body.appendChild(a);
  1322. a.click();
  1323. }).error(function (data, status, headers, config) {
  1324. // $scope.ldloading.zoom_in = false;
  1325. console.log(data);
  1326. $rootScope.isMask = false;
  1327. });
  1328. }
  1329. //接单
  1330. $scope.acceptTaskAction = function (model) {
  1331. var modalInstance = $modal.open({
  1332. templateUrl: 'assets/views/incident/tpl/acceptTask.tpl.html',
  1333. controller: function ($scope, $modalInstance, modelData, currentUserId, Alert) {
  1334. $scope.title = "提示";
  1335. $scope.connect = "确认接单?";
  1336. $scope.ok = function () {
  1337. console.log(model);
  1338. $rootScope.isMask = true;
  1339. api_flow.accept("receive", {incident: model}).then(function (response) {
  1340. $rootScope.isMask = false;
  1341. if (response.state == 200) {
  1342. Alert.swal({
  1343. title: "操作成功!",
  1344. confirmButtonColor: "#007AFF",
  1345. type: "success"
  1346. });
  1347. $modalInstance.close('success');
  1348. } else {
  1349. Alert.swal({
  1350. title: "操作失败",
  1351. text: "操作失败, 请稍后再试!",
  1352. type: "error"
  1353. });
  1354. }
  1355. });
  1356. }
  1357. $scope.cancel = function () {
  1358. $modalInstance.dismiss('cancel');
  1359. }
  1360. },
  1361. size: 'sm',
  1362. resolve: {
  1363. modelData: function () {
  1364. return model;
  1365. },
  1366. currentUserId: function () {
  1367. return loginUser.id;
  1368. },
  1369. Alert: function () {
  1370. return SweetAlert;
  1371. }
  1372. }
  1373. });
  1374. modalInstance.result.then(function (selectedItem) {
  1375. if (selectedItem == 'success') {
  1376. $scope.refreshData('expand-right', defaultFilterData);
  1377. }
  1378. });
  1379. }
  1380. // 指派弹窗
  1381. $scope.toAssign = function (model) {
  1382. console.log(model)
  1383. var modalInstance = $modal.open({
  1384. backdrop: false,
  1385. templateUrl: 'assets/views/incident/tpl/toAssign.tpl.html',
  1386. controller: function ($scope,$rootScope, $modalInstance, api_bpm_domain, modelData, currentUserId, Alert, api_user_data,api_category) {
  1387. console.log(model,loginUser);
  1388. //获取组下面的用户
  1389. $scope.getUsers = function(groupId){
  1390. $scope.user = [];
  1391. var postData = {};
  1392. if(groupId){
  1393. postData = {
  1394. "idx": 0,
  1395. "sum": 100,
  1396. user: {
  1397. groupdata:{id:groupId},
  1398. roledata: { rolecode: "first-line support" },
  1399. roledata2: { rolecode: "second-line support" },
  1400. selectType: "1",
  1401. selectDetails:1,
  1402. simple: true,
  1403. }
  1404. }
  1405. }else{
  1406. postData = {
  1407. "idx": 0,
  1408. "sum": 100,
  1409. user: {
  1410. roledata: { rolecode: "first-line support" },
  1411. roledata2: { rolecode: "second-line support" },
  1412. selectType: "1",
  1413. selectDetails:1,
  1414. simple: true,
  1415. engineer: 1,
  1416. }
  1417. }
  1418. }
  1419. api_user_data.fetchDataList('user', postData).then(function (data) {
  1420. $scope.user = data.list;
  1421. })
  1422. }
  1423. $scope.assign = {
  1424. branch:undefined,
  1425. duty:undefined,
  1426. user:undefined,
  1427. group:undefined,
  1428. isRadioUser: 0,
  1429. }
  1430. $scope.hospitalList = [];
  1431. $scope.dutyDeptList = [];
  1432. $scope.user = [];
  1433. $scope.group = [];
  1434. $scope.isShowRadioUser = false;
  1435. // 修改是否指派到人
  1436. $scope.changeRadioUser = function(){
  1437. $scope.assign.user = undefined;
  1438. }
  1439. // 获取院区
  1440. $scope.getHospitals = function(){
  1441. //跨科室转派
  1442. api_user_data.fetchDataList('branch', {
  1443. "idx": 0,
  1444. "sum": 100
  1445. }).then(function (data) {
  1446. if(data.status == 200){
  1447. $scope.hospitalList = data.list;
  1448. if($scope.assign.duty){
  1449. $scope.assign.branch = $scope.hospitalList.find(v=>v.id == $scope.assign.duty.branch);
  1450. }else{
  1451. if($rootScope.user.duty){
  1452. // 当前的所属责任科室
  1453. $scope.assign.branch = $scope.hospitalList.find(v=>v.id == $rootScope.user.duty.branch);
  1454. $scope.assign.duty = $rootScope.user.duty;
  1455. $scope.changeDuty();
  1456. }else if($rootScope.user.branch){
  1457. // 当前的所属院区
  1458. $scope.assign.branch = $scope.hospitalList.find(v=>v.id == $rootScope.user.branch.id);
  1459. }
  1460. }
  1461. }else{
  1462. SweetAlert.swal({
  1463. title: "系统错误!",
  1464. text: "请刷新重试!",
  1465. type: "error"
  1466. });
  1467. }
  1468. })
  1469. }
  1470. $scope.getHospitals();
  1471. // 修改院区
  1472. $scope.changeBranch = function(keyword){
  1473. if(keyword === undefined){
  1474. $scope.assign.duty = undefined;
  1475. $scope.dutyDeptList = [];
  1476. $scope.assign.group = undefined;
  1477. $scope.group = [];
  1478. $scope.assign.user = undefined;
  1479. $scope.user = [];
  1480. }
  1481. if(!$scope.assign.branch){
  1482. $scope.dutyDeptList = [];
  1483. return;
  1484. }
  1485. api_user_data.fetchDataList('dutyDepartment', {
  1486. "idx": 0,
  1487. "sum": 100,
  1488. "dutyDepartment":{
  1489. branch:$scope.assign.branch.id,
  1490. dept:keyword,
  1491. selectType: "pinyin_qs"
  1492. }
  1493. }).then(function (data) {
  1494. if(data.status == 200){
  1495. $scope.dutyDeptList = data.list;
  1496. }else{
  1497. SweetAlert.swal({
  1498. title: "系统错误!",
  1499. text: "请刷新重试!",
  1500. type: "error"
  1501. });
  1502. }
  1503. })
  1504. }
  1505. // 修改责任科室
  1506. $scope.changeDuty = function(keyword){
  1507. if(keyword === undefined){
  1508. $scope.assign.user = undefined;
  1509. $scope.user = [];
  1510. $scope.assign.group = undefined;
  1511. $scope.group = [];
  1512. }
  1513. api_user_data.fetchDataList('group', {
  1514. "idx": 0,
  1515. "sum": 9999,
  1516. "group":{
  1517. duty:$scope.assign.duty,
  1518. selectType: "nouser"
  1519. }
  1520. }).then(function (data) {
  1521. if(data.status == 200){
  1522. $scope.group = data.list;
  1523. }else{
  1524. SweetAlert.swal({
  1525. title: "系统错误!",
  1526. text: "请刷新重试!",
  1527. type: "error"
  1528. });
  1529. }
  1530. })
  1531. }
  1532. $scope.changeGroup = function(item){
  1533. // $scope.assign.group = item.id;
  1534. $scope.assign.user = undefined;
  1535. $scope.user = [];
  1536. $scope.getUsers(item.id)
  1537. }
  1538. $scope.ok = function () {
  1539. if ($scope.assign.isRadioUser == 1 && !$scope.assign.user){
  1540. Alert.swal({
  1541. title: "操作失败",
  1542. text: "请选择转派对象信息!",
  1543. type: "error"
  1544. });
  1545. return;
  1546. }
  1547. if ($scope.assign.isRadioUser == 0 && !$scope.assign.group){
  1548. Alert.swal({
  1549. title: "操作失败",
  1550. text: "请选择工作组!",
  1551. type: "error"
  1552. });
  1553. return;
  1554. }
  1555. let postData = {};
  1556. if($scope.assign.user && $scope.assign.user.id){
  1557. // 派人
  1558. postData ={ incident: {...model, ...{assignee: $scope.assign.user.id, duty: $scope.assign.duty}} };
  1559. } else if($scope.assign.group && $scope.assign.group.id){
  1560. // 派组
  1561. postData ={ incident: {...model, ...{candidateGroups: $scope.assign.group.id, duty: $scope.assign.duty}} };
  1562. }
  1563. $rootScope.isMask = true;
  1564. api_flow.accept("assign", postData).then(function (response) {
  1565. console.log(response)
  1566. $rootScope.isMask = false;
  1567. if (response.state == 200) {
  1568. Alert.swal({
  1569. title: "操作成功!",
  1570. confirmButtonColor: "#007AFF",
  1571. type: "success"
  1572. });
  1573. $modalInstance.close('success');
  1574. } else {
  1575. Alert.swal({
  1576. title: "操作失败",
  1577. text: "操作失败, 请稍后再试!",
  1578. type: "error"
  1579. });
  1580. }
  1581. });
  1582. }
  1583. $scope.cancel = function () {
  1584. $modalInstance.dismiss('cancel');
  1585. }
  1586. },
  1587. size: 'sm',
  1588. resolve: {
  1589. api_bpm: function () {
  1590. return api_bpm;
  1591. },
  1592. modelData: function () {
  1593. return model;
  1594. },
  1595. currentUserId: function () {
  1596. return loginUser.id;
  1597. },
  1598. Alert: function () {
  1599. return SweetAlert;
  1600. },
  1601. api_user_data: function () {
  1602. return api_user_data;
  1603. }
  1604. }
  1605. });
  1606. modalInstance.result.then(function (selectedItem) {
  1607. if (selectedItem == 'success') {
  1608. $scope.refreshData('expand-right', defaultFilterData);
  1609. }
  1610. });
  1611. }
  1612. // 转派弹窗
  1613. $scope.toTransfer = function (model) {
  1614. console.log(model)
  1615. var modalInstance = $modal.open({
  1616. backdrop: false,
  1617. templateUrl: 'assets/views/incident/tpl/toTransfer.tpl.html',
  1618. controller: function ($scope,$rootScope, $modalInstance, api_bpm_domain, modelData, currentUserId, Alert, api_user_data,api_category) {
  1619. console.log(model,loginUser);
  1620. $scope.assign = {
  1621. duty:model.duty,
  1622. user:undefined,
  1623. group:undefined,
  1624. isRadioGroup: 0,
  1625. }
  1626. $scope.user = [];
  1627. $scope.group = [];
  1628. //获取责任科室下面的用户
  1629. $scope.getUsers = function(){
  1630. $scope.user = [];
  1631. var postData = {
  1632. "idx": 0,
  1633. "sum": 9999,
  1634. user: {
  1635. currentDuty: $scope.assign.duty.id,
  1636. roledata: { rolecode: "first-line support" },
  1637. roledata2: { rolecode: "second-line support" },
  1638. selectType: "1",
  1639. selectDetails:1,
  1640. simple: true,
  1641. engineer: 1,
  1642. }
  1643. }
  1644. api_user_data.fetchDataList('user', postData).then(function (data) {
  1645. $scope.user = data.list;
  1646. })
  1647. }
  1648. $scope.getUsers();
  1649. //获取责任科室下面的组
  1650. $scope.getGroups = function(){
  1651. $scope.group = [];
  1652. var postData = {
  1653. "idx": 0,
  1654. "sum": 9999,
  1655. group: {
  1656. duty: $scope.assign.duty,
  1657. selectType: "nouser",
  1658. }
  1659. }
  1660. api_user_data.fetchDataList('group', postData).then(function (data) {
  1661. $scope.group = data.list;
  1662. })
  1663. }
  1664. $scope.getGroups();
  1665. // 修改是否转派到组
  1666. $scope.changeRadioGroup = function(){
  1667. $scope.assign.group = undefined;
  1668. $scope.assign.user = undefined;
  1669. }
  1670. $scope.ok = function () {
  1671. if ($scope.assign.isRadioGroup == 0 && !$scope.assign.user){
  1672. Alert.swal({
  1673. title: "操作失败",
  1674. text: "请选择转派对象信息!",
  1675. type: "error"
  1676. });
  1677. return;
  1678. }
  1679. if ($scope.assign.isRadioGroup == 1 && !$scope.assign.group){
  1680. Alert.swal({
  1681. title: "操作失败",
  1682. text: "请选择工作组!",
  1683. type: "error"
  1684. });
  1685. return;
  1686. }
  1687. let postData = {};
  1688. if($scope.assign.user && $scope.assign.user.id){
  1689. // 派人
  1690. postData ={ incident: {...model, ...{assignee: $scope.assign.user.id}} };
  1691. } else if($scope.assign.group && $scope.assign.group.id){
  1692. // 派组
  1693. postData ={ incident: {...model, ...{candidateGroups: $scope.assign.group.id}} };
  1694. }
  1695. $rootScope.isMask = true;
  1696. api_flow.accept("redeploy", postData).then(function (response) {
  1697. console.log(response)
  1698. $rootScope.isMask = false;
  1699. if (response.state == 200) {
  1700. Alert.swal({
  1701. title: "操作成功!",
  1702. confirmButtonColor: "#007AFF",
  1703. type: "success"
  1704. });
  1705. $modalInstance.close('success');
  1706. } else {
  1707. Alert.swal({
  1708. title: "操作失败",
  1709. text: "操作失败, 请稍后再试!",
  1710. type: "error"
  1711. });
  1712. }
  1713. });
  1714. }
  1715. $scope.cancel = function () {
  1716. $modalInstance.dismiss('cancel');
  1717. }
  1718. },
  1719. size: 'sm',
  1720. resolve: {
  1721. api_bpm: function () {
  1722. return api_bpm;
  1723. },
  1724. modelData: function () {
  1725. return model;
  1726. },
  1727. currentUserId: function () {
  1728. return loginUser.id;
  1729. },
  1730. Alert: function () {
  1731. return SweetAlert;
  1732. },
  1733. api_user_data: function () {
  1734. return api_user_data;
  1735. }
  1736. }
  1737. });
  1738. modalInstance.result.then(function (selectedItem) {
  1739. if (selectedItem == 'success') {
  1740. $scope.refreshData('expand-right', defaultFilterData);
  1741. }
  1742. });
  1743. }
  1744. // 删除事件
  1745. $scope.delSj = function(model){
  1746. console.log(model);
  1747. SweetAlert.swal({
  1748. title: "确认删除?",
  1749. text: "删除的数据不可恢复,请确认继续操作!",
  1750. type: "warning",
  1751. showCancelButton: true,
  1752. confirmButtonColor: "#DD6B55",
  1753. confirmButtonText: "继续删除",
  1754. cancelButtonText: "取消操作",
  1755. closeOnConfirm: false,
  1756. closeOnCancel: false
  1757. }, function (isConfirm) {
  1758. if (isConfirm) {
  1759. api_bpm_schedule.del(model.id).then(function (response) {
  1760. if (response.status == 200) {
  1761. SweetAlert.swal("操作成功!", "数据已经被删除.", "success");
  1762. $scope.refreshData('expand-right');
  1763. } else {
  1764. SweetAlert.swal("操作失败!", "数据暂时无法被删除,请稍候重试", "error");
  1765. }
  1766. });
  1767. } else {
  1768. SweetAlert.swal("操作取消", "数据安全", "error");
  1769. }
  1770. });
  1771. }
  1772. // 继续创建
  1773. $scope.storageSj = function(model){
  1774. console.log(model);
  1775. $rootScope.newOrder({incident: model});
  1776. }
  1777. // 新增延期处理弹窗
  1778. $scope.toHandlerLog = function (model) {
  1779. console.log(model)
  1780. var modalInstance = $modal.open({
  1781. backdrop: false,
  1782. templateUrl: 'assets/views/incident/tpl/toHandlerLog.tpl.html',
  1783. controller: function ($scope, $modalInstance, api_bpm_domain,api_bpm_data, modelData, currentUserId, Alert, api_user_data,api_statistic) {
  1784. console.log(model,loginUser);
  1785. $scope.f = {
  1786. maintenanceMode: '',
  1787. estimatedNumberOfDays: ''
  1788. }
  1789. $scope.handlerLog = '';
  1790. $scope.user = [];
  1791. $scope.logs = [];
  1792. $scope.modes = [];
  1793. $scope.getModes=function(){
  1794. var data={
  1795. "idx":0,
  1796. "sum":999,
  1797. dictionary:{key:'repair_type'}
  1798. }
  1799. api_statistic.tableData(data,"dictionary").then(function(res){
  1800. $scope.modes=res.list
  1801. })
  1802. }
  1803. $scope.getModes();
  1804. $scope.getLogs=function(){
  1805. var data={
  1806. "idx":0,
  1807. "sum":999,
  1808. dictionary:{key:'processingLog'}
  1809. }
  1810. api_statistic.tableData(data,"dictionary").then(function(res){
  1811. $scope.logs=res.list
  1812. })
  1813. }
  1814. $scope.getLogs();
  1815. $scope.copyTo = function(value){
  1816. $scope.handlerLog += value;
  1817. }
  1818. $scope.ok = function () {
  1819. if (!$scope.f.maintenanceMode){
  1820. Alert.swal({
  1821. title: "操作失败",
  1822. text: "请选择延期原因!",
  1823. type: "error"
  1824. });
  1825. return;
  1826. }
  1827. if (!$scope.f.estimatedNumberOfDays){
  1828. Alert.swal({
  1829. title: "操作失败",
  1830. text: "请选择延期天数!",
  1831. type: "error"
  1832. });
  1833. return;
  1834. }
  1835. if (!$scope.handlerLog.trim()){
  1836. Alert.swal({
  1837. title: "操作失败",
  1838. text: "请填写延期说明!",
  1839. type: "error"
  1840. });
  1841. return;
  1842. }
  1843. $rootScope.isMask = true;
  1844. api_flow.accept("overtime", {
  1845. incident: {
  1846. ...model,
  1847. ...{
  1848. currentLog: {
  1849. remark: $scope.handlerLog,
  1850. extra1: $scope.f.maintenanceMode.id,
  1851. extra2: $scope.f.estimatedNumberOfDays,
  1852. }
  1853. }
  1854. }
  1855. }).then(function(response){
  1856. console.log(response)
  1857. $rootScope.isMask = false;
  1858. if (response.state == 200) {
  1859. Alert.swal({
  1860. title: "操作成功!",
  1861. confirmButtonColor: "#007AFF",
  1862. type: "success"
  1863. });
  1864. $modalInstance.close('success');
  1865. } else {
  1866. Alert.swal({
  1867. title: "操作失败",
  1868. text: "操作失败, 请稍后再试!",
  1869. type: "error"
  1870. });
  1871. }
  1872. });
  1873. }
  1874. $scope.cancel = function () {
  1875. $modalInstance.dismiss('cancel');
  1876. }
  1877. },
  1878. size: 'lg',
  1879. resolve: {
  1880. api_bpm: function () {
  1881. return api_bpm;
  1882. },
  1883. modelData: function () {
  1884. return model;
  1885. },
  1886. currentUserId: function () {
  1887. return loginUser.id;
  1888. },
  1889. Alert: function () {
  1890. return SweetAlert;
  1891. },
  1892. api_user_data: function () {
  1893. return api_user_data;
  1894. },
  1895. api_statistic: function () {
  1896. return api_statistic;
  1897. }
  1898. }
  1899. });
  1900. modalInstance.result.then(function (selectedItem) {
  1901. if (selectedItem == 'success') {
  1902. $scope.refreshData('expand-right', defaultFilterData);
  1903. }
  1904. });
  1905. }
  1906. // 设置责任科室
  1907. $scope.setDuty = function (model) {
  1908. console.log(model)
  1909. var modalInstance = $modal.open({
  1910. backdrop: false,
  1911. templateUrl: 'assets/views/incident/tpl/setDuty.tpl.html',
  1912. controller: function ($scope,$rootScope, $modalInstance, api_bpm_domain, modelData, currentUserId, Alert, api_user_data,api_category) {
  1913. console.log(model,loginUser);
  1914. $scope.assign = {
  1915. branch:undefined,
  1916. duty:undefined,
  1917. }
  1918. $scope.hospitalList = [];
  1919. $scope.dutyDeptList = [];
  1920. // 获取院区
  1921. $scope.getHospitals = function(){
  1922. //跨科室转派
  1923. api_user_data.fetchDataList('branch', {
  1924. "idx": 0,
  1925. "sum": 100
  1926. }).then(function (data) {
  1927. if(data.status == 200){
  1928. $scope.hospitalList = data.list;
  1929. if($scope.assign.duty){
  1930. $scope.assign.branch = $scope.hospitalList.find(v=>v.id == $scope.assign.duty.branch);
  1931. }else{
  1932. if($rootScope.user.duty){
  1933. // 当前的所属责任科室
  1934. $scope.assign.branch = $scope.hospitalList.find(v=>v.id == $rootScope.user.duty.branch);
  1935. $scope.assign.duty = $rootScope.user.duty;
  1936. }else if($rootScope.user.branch){
  1937. // 当前的所属院区
  1938. $scope.assign.branch = $scope.hospitalList.find(v=>v.id == $rootScope.user.branch.id);
  1939. }
  1940. }
  1941. }else{
  1942. SweetAlert.swal({
  1943. title: "系统错误!",
  1944. text: "请刷新重试!",
  1945. type: "error"
  1946. });
  1947. }
  1948. })
  1949. }
  1950. $scope.getHospitals();
  1951. // 修改院区
  1952. $scope.changeBranch = function(keyword){
  1953. if(keyword === undefined){
  1954. $scope.assign.duty = undefined;
  1955. $scope.dutyDeptList = [];
  1956. }
  1957. if(!$scope.assign.branch){
  1958. $scope.dutyDeptList = [];
  1959. return;
  1960. }
  1961. api_user_data.fetchDataList('dutyDepartment', {
  1962. "idx": 0,
  1963. "sum": 100,
  1964. "dutyDepartment":{
  1965. branch:$scope.assign.branch.id,
  1966. dept:keyword,
  1967. selectType: "pinyin_qs"
  1968. }
  1969. }).then(function (data) {
  1970. if(data.status == 200){
  1971. $scope.dutyDeptList = data.list;
  1972. }else{
  1973. SweetAlert.swal({
  1974. title: "系统错误!",
  1975. text: "请刷新重试!",
  1976. type: "error"
  1977. });
  1978. }
  1979. })
  1980. }
  1981. $scope.ok = function () {
  1982. if (!$scope.assign.duty){
  1983. Alert.swal({
  1984. title: "操作失败",
  1985. text: "请选择责任科室!",
  1986. type: "error"
  1987. });
  1988. return;
  1989. }
  1990. $rootScope.isMask = true;
  1991. api_bpm_domain.changeIncidentDuty({orderId: model.id, dutyId: $scope.assign.duty.id}).then(function (response) {
  1992. console.log(response)
  1993. $rootScope.isMask = false;
  1994. if (response.status == 200) {
  1995. Alert.swal({
  1996. title: "操作成功!",
  1997. confirmButtonColor: "#007AFF",
  1998. type: "success"
  1999. });
  2000. $modalInstance.close('success');
  2001. } else {
  2002. Alert.swal({
  2003. title: "操作失败",
  2004. text: "操作失败, 请稍后再试!",
  2005. type: "error"
  2006. });
  2007. }
  2008. });
  2009. }
  2010. $scope.cancel = function () {
  2011. $modalInstance.dismiss('cancel');
  2012. }
  2013. },
  2014. size: 'sm',
  2015. resolve: {
  2016. api_bpm: function () {
  2017. return api_bpm;
  2018. },
  2019. modelData: function () {
  2020. return model;
  2021. },
  2022. currentUserId: function () {
  2023. return loginUser.id;
  2024. },
  2025. Alert: function () {
  2026. return SweetAlert;
  2027. },
  2028. api_user_data: function () {
  2029. return api_user_data;
  2030. }
  2031. }
  2032. });
  2033. modalInstance.result.then(function (selectedItem) {
  2034. if (selectedItem == 'success') {
  2035. $scope.refreshData('expand-right', defaultFilterData);
  2036. }
  2037. });
  2038. }
  2039. if ($stateParams.model) {
  2040. if (JSON.parse($stateParams.model).searchType && JSON.parse($stateParams.model).searchType != null) {
  2041. $scope.searchstate = JSON.parse($stateParams.model).searchType;
  2042. } else {
  2043. $scope.searchstate = "todo";
  2044. }
  2045. } else {
  2046. $scope.searchstate = "todo";
  2047. }
  2048. if ($rootScope.user.group) {
  2049. var defaultFilterData = {
  2050. "idx": 0,
  2051. "sum": mun
  2052. };
  2053. } else {
  2054. var defaultFilterData = {
  2055. "idx": 0,
  2056. "sum": mun
  2057. };
  2058. }
  2059. if (angular.isDefined($rootScope.search) && angular.isDefined($rootScope.search.incident)) {
  2060. $scope.searchstate = $rootScope.search.incident;
  2061. }
  2062. $scope.ldloading = {};
  2063. //事件类型筛选
  2064. console.log($state);
  2065. if($state.params.tab){
  2066. $scope.searchstate = $state.params.tab;
  2067. }else{
  2068. $scope.searchstate = 'todo';
  2069. }
  2070. $scope.onChange = function (searchstate, isInit) {
  2071. $scope.isDisabledState = false;
  2072. $scope.searchstate = searchstate;
  2073. $scope.chiceIncident($scope.searchkeys,$scope.othcode.state, isInit);
  2074. }
  2075. // 是否逾期下拉框选择
  2076. $scope.selectTypeChange = function(isInit){
  2077. console.log($scope.searchkeys.selectType,66666);
  2078. if(window.sessionStorage.getItem('isGoyuqi') == 'yes'){
  2079. $scope.searchkeys.selectType = $scope.selectType.find(v => v.value == 'unresolved');
  2080. }
  2081. var ids = $scope.searchkeys.selectType.id
  2082. if(defaultFilterData.incident){
  2083. defaultFilterData.incident.selectType = ids;
  2084. }else{
  2085. defaultFilterData.incident = {
  2086. selectType:ids
  2087. };
  2088. }
  2089. console.log(defaultFilterData,2222)
  2090. $scope.onChange('all', isInit);
  2091. }
  2092. //获取列表数据
  2093. $scope.refreshData = _.debounce(function (style, filterData, isInit) {
  2094. $scope.ldloading[style.replace('-', '_')] = true;
  2095. if (angular.isUndefined(filterData)) {
  2096. filterData = defaultFilterData;
  2097. if(isInit){
  2098. if($state.params.tab){
  2099. $scope.searchstate = $state.params.tab;
  2100. filterData.idx = 0;
  2101. $scope.gridOptions.paginationCurrentPage = 1 + filterData.idx;
  2102. }
  2103. if($state.params.date == 'today'){
  2104. $scope.othcode = {};
  2105. $scope.searchkeys.acceptDate = new Date();
  2106. $scope.searchkeys.acceptDateEnd = new Date();
  2107. if(filterData.incident){
  2108. filterData.incident.acceptDate = moment().format('YYYY-MM-DD 00:00:00');
  2109. filterData.incident.acceptDateEnd = moment().format('YYYY-MM-DD 23:59:59');
  2110. }else{
  2111. filterData.incident = {
  2112. acceptDate: moment().format('YYYY-MM-DD 00:00:00'),
  2113. acceptDateEnd: moment().format('YYYY-MM-DD 23:59:59'),
  2114. }
  2115. }
  2116. }else{
  2117. $scope.searchkeys.acceptDate = undefined;
  2118. $scope.searchkeys.acceptDateEnd = undefined;
  2119. }
  2120. if($state.params.state){
  2121. var obj = $scope.state.find(function(v){return $state.params.state == v.id});
  2122. $scope.othcode = {state:obj};
  2123. if(filterData.incident){
  2124. filterData.incident.statusId = $state.params.state;
  2125. }else{
  2126. filterData.incident = {
  2127. statusId: $state.params.state,
  2128. }
  2129. }
  2130. }
  2131. }
  2132. }
  2133. $scope.myData = [];
  2134. $scope.memoryfilterData = filterData;
  2135. $scope.gridOptions['sum'] = filterData.sum;
  2136. // 请求参数调整
  2137. if(!filterData.incident){
  2138. filterData.incident = {};
  2139. }
  2140. if($scope.searchstate === 'all' || $scope.searchstate === 'callback'){
  2141. if($rootScope.user.duty){
  2142. // 当前的所属责任科室
  2143. filterData.incident.duty = $rootScope.user.duty;
  2144. }else if($rootScope.user.branch){
  2145. // 当前的所属院区
  2146. filterData.incident.branch = $rootScope.user.branch.id;
  2147. }
  2148. }else{
  2149. delete filterData.incident.duty;
  2150. delete filterData.incident.branch;
  2151. }
  2152. filterData.incident.queryTask = $scope.searchstate;
  2153. filterData.incident.assignee = loginUser.id;
  2154. if($scope.searchstate === 'todo' || $scope.searchstate === 'owns'){
  2155. filterData.incident.candidateGroups = loginuserGroup;
  2156. }else{
  2157. delete filterData.incident.candidateGroups;
  2158. }
  2159. // 调用接口-查列表
  2160. api_user_data.fetchDataList('incident', filterData).then(function (data) {
  2161. if (data.list) {
  2162. var myData = Restangular.stripRestangular(data);
  2163. $scope.gridOptions['totalItems'] = myData.totalNum;
  2164. $scope.myData = myData.list;
  2165. for (var i = 0; i < $scope.myData.length; i++) {
  2166. $scope.myData[i]['item'] = i + 1 + filterData.idx * filterData.sum
  2167. }
  2168. } else {
  2169. SweetAlert.swal({
  2170. title: "系统错误",
  2171. text: "请稍后再试!",
  2172. type: "error"
  2173. });
  2174. }
  2175. $scope.ldloading[style.replace('-', '_')] = false;
  2176. }, function () {
  2177. $scope.ldloading[style.replace('-', '_')] = false;
  2178. });
  2179. // 获取数量
  2180. $scope.count(filterData.incident, isInit);
  2181. }, 500);
  2182. // 调用接口-查数量
  2183. $scope.count = function (incident = {}){
  2184. let postData = {
  2185. incidentList: [],
  2186. }
  2187. $scope.tabs.forEach(v => {
  2188. postData.incidentList.push({...incident, ...{queryTask: v.key}});
  2189. })
  2190. postData.incidentList.forEach(incident => {
  2191. // 请求参数调整
  2192. if(!incident){
  2193. incident = {};
  2194. }
  2195. if(incident.queryTask === 'all' || incident.queryTask === 'callback'){
  2196. if($rootScope.user.duty){
  2197. // 当前的所属责任科室
  2198. incident.duty = $rootScope.user.duty;
  2199. }else if($rootScope.user.branch){
  2200. // 当前的所属院区
  2201. incident.branch = $rootScope.user.branch.id;
  2202. }
  2203. }else{
  2204. delete incident.duty;
  2205. delete incident.branch;
  2206. }
  2207. incident.assignee = loginUser.id;
  2208. if(incident.queryTask === 'todo' || incident.queryTask === 'owns'){
  2209. incident.candidateGroups = loginuserGroup;
  2210. }else{
  2211. delete incident.candidateGroups;
  2212. }
  2213. })
  2214. api_flow.count(postData).then(function (data) {
  2215. if (data.state == 200) {
  2216. let myData = data.data || {};
  2217. $scope.tabs.forEach(v => {
  2218. v.num = myData[v.key];
  2219. })
  2220. } else {
  2221. SweetAlert.swal({
  2222. title: "系统错误",
  2223. text: "请稍后再试!",
  2224. type: "error"
  2225. });
  2226. }
  2227. });
  2228. }
  2229. // 进入页面时
  2230. $scope.getIncidentStatus();
  2231. $scope.timer = $interval(function () {
  2232. $scope.jry_refresh()
  2233. }, $rootScope.refreshTime);
  2234. $scope.$on('$destroy', function () {
  2235. $interval.cancel($scope.timer)
  2236. });
  2237. }]);
  2238. //操作按钮权限控制
  2239. app.controller('IncidentOperCtrl', ['$rootScope', '$scope', '$state', function ($rootScope, $scope, $state) {
  2240. var loginUser = $rootScope.user;
  2241. $scope.user = $rootScope.user;
  2242. $scope.chuli = false;
  2243. $scope.allFlag = false;
  2244. $scope.qiangdan = false;
  2245. $scope.huifang = false;
  2246. $scope.delFlag = false;
  2247. $scope.storageFlag = false;
  2248. $scope.editFlag = false;//编辑
  2249. $scope.assignFlag = false;//指派
  2250. $scope.transferFlag = false;//转派
  2251. $scope.shijianliebiao_duty = false;//设置责任科室
  2252. for (var i = 0; i < loginUser.menu.length; i++) {
  2253. if (loginUser.menu[i].link == "shijianliebiao_all") {
  2254. $scope.allFlag = true
  2255. }
  2256. if (loginUser.menu[i].link == "shijianliebiao_chuli") {
  2257. $scope.chuli = true
  2258. }
  2259. if (loginUser.menu[i].link == "shijianliebiao_qiangdan") {
  2260. $scope.qiangdan = true
  2261. }
  2262. if (loginUser.menu[i].link == "shijianliebiao_huifang") {
  2263. $scope.huifang = true
  2264. }
  2265. if (loginUser.menu[i].link == "shijianliebiao_del") {
  2266. $scope.delFlag = true
  2267. }
  2268. if (loginUser.menu[i].link == "shijianliebiao_build") {
  2269. $scope.storageFlag = true
  2270. }
  2271. if (loginUser.menu[i].link == "shijianliebiao_edit") {
  2272. $scope.editFlag = true
  2273. }
  2274. if (loginUser.menu[i].link == "shijianliebiao_assign") {
  2275. $scope.assignFlag = true
  2276. }
  2277. if (loginUser.menu[i].link == "shijianliebiao_transfer") {
  2278. $scope.transferFlag = true
  2279. }
  2280. if (loginUser.menu[i].link == "shijianliebiao_duty") {
  2281. $scope.shijianliebiao_duty = true
  2282. }
  2283. }
  2284. $scope.up = true;
  2285. $scope.fuwutaiRenYuan = false;//服务台人员
  2286. for (var i = 0; i < $rootScope.user.role.length; i++) {
  2287. if ($rootScope.user.role[i].role == '事件经理') {
  2288. $scope.up = false;
  2289. }
  2290. if ($rootScope.user.role[i].id == 29701) {
  2291. $scope.fuwutaiRenYuan = true;
  2292. }
  2293. }
  2294. $rootScope.callid = $scope.item.callID;
  2295. if ($scope.item.callID) {
  2296. $scope.item.listen = true;
  2297. } else {
  2298. $scope.item.listen = false;
  2299. }
  2300. $rootScope.user.group.forEach(function (item, v) {
  2301. if($scope.item.currentLog){
  2302. if (item.id == $scope.item.currentLog.groupId) {
  2303. $scope.item.tiquPower = true;
  2304. }
  2305. }
  2306. })
  2307. //修改页面显示判断
  2308. $scope.jry_modify = function (item, user) {
  2309. // 待接单的时候,处理人或处理组
  2310. let flag1 = item.state && item.state.value == 'pending' && ((item.currentLog && item.currentLog.workerId == user.id) || item.tiquPower);
  2311. // 处理中的时候,处理人或处理组
  2312. let flag2 = item.state && item.state.value == 'handler' && item.handlingPersonnelUser && item.handlingPersonnelUser.id == user.id;
  2313. // 不是已关闭,且不是已删除,且不是暂存
  2314. let flag3 = item.deleteFlag !== 1 && item.state.value !== 'close' && item.state.value !== 'storage';
  2315. return flag3 && (($scope.editFlag && $scope.allFlag) || flag1 || flag2 || (item.acceptUser ? item.acceptUser.id == user.id : false));
  2316. }
  2317. // 回访操作权限
  2318. for (var obj in $rootScope.user.role) {
  2319. if ($rootScope.user.role[obj].rolecode == 'call center') {
  2320. if ($scope.item.state && $scope.item.state.value == 'close') {
  2321. $scope.item.huifang = true;
  2322. } else {}
  2323. }
  2324. }
  2325. $scope.edit = function () {
  2326. $scope.colobject.grid.appScope.selectRowFunction($scope.item);
  2327. }
  2328. $scope.changeCenter = function () {
  2329. $scope.colobject.grid.appScope.changeClick($scope.item);
  2330. }
  2331. $scope.visit = function () {
  2332. $scope.colobject.grid.appScope.visit($scope.item);
  2333. }
  2334. // 指派
  2335. $scope.toAssign = function () {
  2336. $scope.colobject.grid.appScope.toAssign($scope.item);
  2337. }
  2338. // 转派
  2339. $scope.toTransfer = function () {
  2340. $scope.colobject.grid.appScope.toTransfer($scope.item);
  2341. }
  2342. // 删除事件
  2343. $scope.delSj = function () {
  2344. $scope.colobject.grid.appScope.delSj($scope.item);
  2345. }
  2346. // 继续创建
  2347. $scope.storageSj = function () {
  2348. $scope.colobject.grid.appScope.storageSj($scope.item);
  2349. }
  2350. // 新增延期处理
  2351. $scope.toHandlerLog = function () {
  2352. $scope.colobject.grid.appScope.toHandlerLog($scope.item);
  2353. }
  2354. // 设置责任科室
  2355. $scope.setDuty = function () {
  2356. $scope.colobject.grid.appScope.setDuty($scope.item);
  2357. }
  2358. $scope.play = function () { //record
  2359. $scope.colobject.grid.appScope.play($scope.item);
  2360. }
  2361. $scope.handler = function () {
  2362. $scope.colobject.grid.appScope.acceptTaskAction($scope.item);
  2363. }
  2364. //查看
  2365. $scope.toDetail = function (data) {
  2366. console.log(data,$rootScope.isFuwutai);
  2367. if($rootScope.isFuwutai){
  2368. //角色是服务台人员
  2369. $state.go('app.incident.incidentDetail', {
  2370. id: data.id,
  2371. });
  2372. }else{
  2373. window.open(location.origin+'/#/app/incident/incidentDetail/'+data.id);
  2374. }
  2375. };
  2376. }]);
  2377. //操作按钮
  2378. app.directive('incidentoperator', function () {
  2379. return {
  2380. restrict: 'E',
  2381. scope: {
  2382. item: '=',
  2383. colobject: '='
  2384. },
  2385. controller: 'IncidentOperCtrl',
  2386. template: '<div><div class="cl-effect-1 ui-grid-cell-contents pull-left" style="text-align:left;">' +
  2387. '<a ng-click="toDetail(item)" class="bianjifont" >查看</a>' +
  2388. '<a ng-click="changeCenter()" ng-show="jry_modify(item, user)" class="luyinfont">编辑</a>' +
  2389. '<a ng-click="delSj()" ng-show="{{delFlag && item.deleteFlag !== 1}}" class="assign" >删除</a>' +
  2390. '<a ng-click="storageSj()" ng-show="{{storageFlag && item.state.value === \'storage\' && item.deleteFlag !== 1}}" class="assign" >继续创建</a><br>' +
  2391. '<a ng-click="edit()" ng-show="{{item.state.value == \'handler\' && item.handlingPersonnelUser && item.handlingPersonnelUser.id == user.id && chuli && item.deleteFlag !== 1}}" class="bianjifont">处理</a>' +
  2392. '<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>' +
  2393. '<a ng-click="visit()" ng-show="{{item.state.value == \'close\' && huifang && item.deleteFlag !== 1}}" class="bianjifont">回访</a>' +
  2394. '<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>' +
  2395. '<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>' +
  2396. '<a ng-click="toHandlerLog()" ng-show="{{item.state.value == \'handler\' && item.handlingPersonnelUser && item.handlingPersonnelUser.id == user.id && item.deleteFlag !== 1}}" class="assign" >延期处理</a>' +
  2397. '<a ng-click="setDuty()" ng-show="{{shijianliebiao_duty && (item.state.value == \'resolved\' || item.state.value == \'close\') && item.deleteFlag !== 1}}" class="assign" >设置责任科室</a>' +
  2398. '</div></div>'
  2399. };
  2400. });