incidentSetUpCtrl.js 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305
  1. app.controller('incidentSetUp', ["$rootScope", "$scope", "$state", "$timeout", "$interval", "SweetAlert", "$modal", "Restangular", "api_bpm_data", "api_solution", "api_user_data","api_wechatfile","api_sysinfo","api_statistic","api_bpm","jry_api_bpm", function($rootScope, $scope, $state, $timeout, $interval, SweetAlert, $modal, Restangular, api_bpm_data, api_solution, api_user_data,api_wechatfile,api_sysinfo,api_statistic,api_bpm,jry_api_bpm) {
  2. var loginUser = $rootScope.user;
  3. $scope.xinzeng=false;
  4. $scope.shanchu=false;
  5. $scope.bianji=false;
  6. for(var i=0;i<loginUser.menu.length;i++){
  7. if(loginUser.menu[i].link=="shijianshezhi_xinzeng"){
  8. $scope.xinzeng=true
  9. }
  10. if(loginUser.menu[i].link=="shijianshezhi_shanchu"){
  11. $scope.shanchu=true
  12. }
  13. if(loginUser.menu[i].link=="shijianshezhi_bianji"){
  14. $scope.bianji=true
  15. }
  16. }
  17. $scope.listData=[
  18. {"name":"事件分类"},
  19. {"name":"巡检范围"},
  20. {"name":"事件紧急度"},
  21. {"name":"事件影响度"},
  22. {"name":"事件优先级"},
  23. {"name":"优先级规则"},
  24. {"name":"工单权重"},
  25. {"name":"服务级别协议"},
  26. {"name":"事件来源"},
  27. {"name":"关闭代码"},
  28. {"name":"事件状态"},
  29. {"name":"满意度评价"},
  30. {"name":"结果类型"}
  31. ]
  32. $scope.leftListIdx=0;
  33. $scope.leftListName="事件分类";
  34. $scope.leftListCli=function(idx,data){
  35. $scope.leftListIdx=idx;
  36. $scope.leftListName=data.name
  37. }
  38. // 事件分类开始
  39. // $scope.langs=i18nService.getAllLangs();
  40. // $scope.lang = 'zh-cn';
  41. var loginUser = $rootScope.user;
  42. //组
  43. api_user_data.fetchDataList('group', { "idx": 0, "sum": 1000 }).then(function(data) {
  44. $scope.group = data.list;
  45. });
  46. //优先级
  47. // api_bpm_data.fetchDataList('priority', { "idx": 0, "sum": 10 }).then(function(data) {
  48. // $scope.priority = data.list;
  49. // });
  50. api_wechatfile.getDictionary({"key":"incident_priority","type":"list"}).then(function(data){
  51. $scope.priority=data
  52. })
  53. // 工单权重
  54. api_wechatfile.getDictionary({"key":"incident_complexity","type":"list"}).then(function(data){
  55. $scope.complexity=data
  56. })
  57. /* ----- tree----- */
  58. var apple_selected, tree, treedata_avm, treedata_geography;
  59. //$scope.selectedTreeNode = {};ssss
  60. var i = 0;
  61. $scope.out = [];
  62. $scope.outdata = [];
  63. var systemtype = [];
  64. $scope.subdata={};
  65. $scope.addcate = false;
  66. $scope.changecate = false;
  67. // $scope.refreshListData = function(){
  68. // var data ={"idx":0,"sum":1000};
  69. // api_bpm_data.fetchDataList('incidentcategory',data).then(function(response){
  70. // if(response){
  71. // if(response.status=200){
  72. // $scope.outdata = response.list;
  73. // }
  74. // }
  75. // })
  76. // }
  77. // $scope.refreshListData();
  78. $scope.filterTree = function (data,id) {
  79. data = angular.copy(data);
  80. var newTree = data.filter(x => x.id !== id)
  81. newTree.forEach(x => x.children && (x.children = $scope.filterTree(x.children,id)))
  82. return newTree
  83. }
  84. var childdata = {};
  85. $scope.thisParent={};//当前点击节点的父节点
  86. $scope.userOrGroupType={};//当前节点运维组/运维人员
  87. $scope.dataSave = [];//储存$scope.tree_data
  88. $scope.my_tree_handler = function(branch) {
  89. console.log($scope.dataSave)
  90. if($scope.dataSave.length === 0){
  91. $scope.dataSave = angular.copy($scope.tree_data);
  92. }
  93. console.log(branch)
  94. if(branch.parent){
  95. $scope.tree_data = $scope.filterTree($scope.dataSave,branch.id);
  96. console.log($scope.tree_data,'过滤后');
  97. }
  98. $scope.changecate = true;
  99. $scope.addcate = false;
  100. filterData.treeIds = branch.id;
  101. $scope.selectedTreeNode = branch;
  102. $scope.output = branch;
  103. $scope.thisParent=branch.parent||null;
  104. if($scope.thisParent){
  105. $scope.thisParent.label=$scope.thisParent.category;
  106. $scope.thisParent.isExpanded=true;
  107. $scope.thisParent.selected=true;
  108. $scope.subdata['parent']=$scope.thisParent
  109. };
  110. // console.log($scope.thisParent,$scope.subdata)
  111. if(branch.hasPlace==1){
  112. $scope.subdata.hasPlace=true
  113. }else{
  114. $scope.subdata.hasPlace=false
  115. }
  116. convertchildToTree(branch,'事件分类');
  117. console.log(branch)
  118. if(branch.managerUser){
  119. $scope.subdata.managerUser = branch.managerUser
  120. }
  121. if(branch.userOrGroupType){
  122. $scope.userOrGroupType['type']=branch.userOrGroupType;
  123. $scope.userGroupChecked['groupCheck']=branch.group||{};
  124. $scope.userGroupChecked['userCheck']=branch.handleUser||{};
  125. }else{
  126. $scope.userOrGroupType['type']=0;
  127. $scope.userGroupChecked={}
  128. }
  129. // $scope.subdata=branch;
  130. $scope.subdata.category=branch.label;
  131. var eqflag = false;
  132. angular.forEach($scope.outdata, function(item) {
  133. if (item.id == $scope.output.id) eqflag = true;
  134. });
  135. if (eqflag) {
  136. } else {
  137. $scope.outdata.push({
  138. 'name': $scope.output.label,
  139. 'id': $scope.output.id
  140. });
  141. var postData = {
  142. typeList: []
  143. };
  144. if ($scope.outdata.length > 0) {
  145. angular.forEach($scope.outdata, function(data) {
  146. postData.typeList.push({ id: data.id });
  147. })
  148. }
  149. // api_solution.findSolutionTypesUser(postData).then(function(response){
  150. // //Restangular.
  151. // $scope.userdata = response.data;
  152. // });
  153. }
  154. };
  155. // $scope.thisParent1={};//当前点击节点的父节点
  156. // $scope.userOrGroupType1={};//当前节点运维组/运维人员
  157. $scope.dataSave1 = [];//储存$scope.tree_data
  158. $scope.my_tree_1handler = function(branch) {
  159. console.log($scope.dataSave1)
  160. if($scope.dataSave1.length === 0){
  161. $scope.dataSave1 = angular.copy($scope.tree_1data);
  162. }
  163. console.log(branch)
  164. if(branch.parent){
  165. $scope.tree_1data = $scope.filterTree($scope.dataSave1,branch.id);
  166. console.log($scope.tree_1data,'过滤后');
  167. }
  168. $scope.changecate = true;
  169. $scope.addcate = false;
  170. filterData.treeIds = branch.id;
  171. $scope.selectedTreeNode = branch;
  172. $scope.output = branch;
  173. $scope.thisParent=branch.parent||null;
  174. if($scope.thisParent){
  175. $scope.thisParent.label=$scope.thisParent.type;
  176. $scope.thisParent.isExpanded=true;
  177. $scope.thisParent.selected=true;
  178. $scope.subdata['parent']=$scope.thisParent
  179. };
  180. convertchildToTree(branch,'巡检范围');//2022年5月27日,暂存,明明
  181. console.log(branch)
  182. if(branch.managerUser){
  183. $scope.subdata.managerUser = branch.managerUser
  184. }
  185. if(branch.userOrGroupType){
  186. $scope.userOrGroupType['type']=branch.userOrGroupType;
  187. $scope.userGroupChecked['groupCheck']=branch.group||{};
  188. $scope.userGroupChecked['userCheck']=branch.handleUser||{};
  189. }else{
  190. $scope.userOrGroupType['type']=0;
  191. $scope.userGroupChecked={}
  192. }
  193. $scope.subdata.category=branch.label;
  194. var eqflag = false;
  195. angular.forEach($scope.outdata, function(item) {
  196. if (item.id == $scope.output.id) eqflag = true;
  197. });
  198. if (eqflag) {
  199. } else {
  200. $scope.outdata.push({
  201. 'name': $scope.output.label,
  202. 'id': $scope.output.id
  203. });
  204. var postData = {
  205. typeList: []
  206. };
  207. if ($scope.outdata.length > 0) {
  208. angular.forEach($scope.outdata, function(data) {
  209. postData.typeList.push({ id: data.id });
  210. })
  211. }
  212. }
  213. };
  214. $scope.addType = function(element) {
  215. $scope.tree_data = $scope.dataSave.length?angular.copy($scope.dataSave):$scope.tree_data;
  216. $scope.addcate = true
  217. $scope.changecate = false
  218. // var modalInstance = $modal.open({
  219. // templateUrl: 'assets/views/system/tpl/systemclose.html',
  220. // controller: function($scope, $modalInstance, api_bpm_data){
  221. // // api_bpm_data.fetchDataList('closecode',filterData).then(function(data){
  222. // // var myData = Restangular.stripRestangular(data);
  223. // // }
  224. // }
  225. // });
  226. }
  227. /* -----start remove incidet category----- */
  228. $scope.remove = function(element) {
  229. var modalInstance = $modal.open({
  230. templateUrl: 'assets/views/delete.html',
  231. controller: function($scope, scope, $modalInstance, api_bpm_data) {
  232. // $scope.title = '优先级删除';
  233. // $scope.connect = '确定要删除此优先级?';
  234. $scope.title = "事件分类删除?";
  235. $scope.connect = "确定要删除此事件分类?";
  236. $scope.ok = function() {
  237. $modalInstance.close(element);
  238. };
  239. $scope.cancel = function() {
  240. $modalInstance.dismiss('cancel');
  241. };
  242. },
  243. size: 'sm',
  244. resolve: {
  245. scope: function() {
  246. return $scope;
  247. }
  248. }
  249. });
  250. modalInstance.result.then(function(selectedItem) {
  251. if (selectedItem) {
  252. var rmvList = [];
  253. rmvList.push(selectedItem.id);
  254. if (selectedItem.children.length > 0) {
  255. SweetAlert.swal({
  256. title: "删除失败!",
  257. text: "请先删除选中的分类的子级",
  258. type: "error"
  259. })
  260. } else {
  261. api_bpm_data.rmvData('incidentcategory', rmvList).then(function(response) {
  262. if (response.data) {
  263. SweetAlert.swal({
  264. title: "删除成功!",
  265. type: "success",
  266. confirmButtonColor: "#007AFF"
  267. }, function() {
  268. $scope.try_async_load();
  269. $scope.$apply($scope.my_data);
  270. });
  271. } else {
  272. SweetAlert.swal({
  273. title: "操作异常!",
  274. text: "系统异常,请稍后重试,或者联系管理员!",
  275. type: "error"
  276. });
  277. }
  278. })
  279. }
  280. }
  281. })
  282. }
  283. /* -----end remove incidet category----- */
  284. function convertchildToTree(datum,type) {
  285. $scope.subdata = {};
  286. if(type === '事件分类'){
  287. if (datum.parent) {
  288. $scope.subdata = { 'id': datum.id, 'category': datum.label, 'group': datum.group||{}, 'hasPlace': datum.hasPlace, 'hasSimple': datum.hasSimple, 'priority': datum.priority, 'complexity': datum.complexity, 'parent': datum.parent }
  289. } else {
  290. $scope.subdata = { 'id': datum.id, 'category': datum.label, 'group': datum.group||{}, 'hasSimple': datum.hasSimple, 'hasPlace': datum.hasPlace, 'priority': datum.priority, 'complexity': datum.complexity }
  291. }
  292. }else if(type === '巡检范围'){
  293. if (datum.parent) {
  294. $scope.subdata = { 'id': datum.id, 'type': datum.label, 'parent': datum.parent }
  295. } else {
  296. $scope.subdata = { 'id': datum.id, 'type': datum.label }
  297. }
  298. }
  299. }
  300. function convertListToTree(data, treeMap) {
  301. var idToNodeMap = {}; //Keeps track of nodes using id as key, for fast lookup
  302. var root = null; //Initially set our loop to null
  303. //loop over data
  304. for (var i = 0; i < data.length; i++) {
  305. var datum = data[i];
  306. //each node will have children, so let's give it a "children" poperty
  307. datum.children = [];
  308. //add an entry for this node to the map so that any future children can
  309. //lookup the parent
  310. idToNodeMap[datum.id] = datum;
  311. //Does this node have a parent?
  312. // console.log("datum="+JSON.stringify(datum))
  313. if (typeof datum.parent === "undefined") {
  314. //Doesn't look like it, so this node is the root of the tree
  315. root = datum;
  316. treeMap[datum.id] = root;
  317. } else {
  318. //This node has a parent, so let's look it up using the id
  319. parentNode = idToNodeMap[datum.parent.id];
  320. //We don't need this property, so let's delete it.
  321. // delete datum.parent;
  322. //Let's add the current node as a child of the parent node.
  323. parentNode.children.push(datum);
  324. }
  325. }
  326. return root;
  327. }
  328. function convertParentToChildList(data) {
  329. var treeMap = {};
  330. var list = [];
  331. convertListToTree(data, treeMap);
  332. angular.forEach(treeMap, function(item) {
  333. list.push(item);
  334. });
  335. return list;
  336. }
  337. $scope.onFilterCallback = function(item){
  338. // $scope.addcategory.parent=item.label;
  339. $scope.selectedChangeCategory=item;
  340. console.log(item)
  341. }
  342. // $scope.parentdata = {};
  343. $scope.try_async_load = function() {
  344. $scope.my_data = [];
  345. $scope.doing_async = true;
  346. var data = { "idx": 0, "sum": 1000 };
  347. api_bpm_data.fetchDataList('incidentcategory', data).then(function(response) {
  348. var data = response.list;
  349. var objects = [];
  350. // $scope.parentdata = data;
  351. for (var i = 0; i < data.length; i++) {
  352. var object = {};
  353. object.id = data[i].id;
  354. if (angular.isDefined(data[i].parent)) {
  355. object.parent = data[i].parent;
  356. }
  357. if (angular.isDefined(data[i].hasPlace)) {
  358. object.hasPlace = data[i].hasPlace;
  359. }
  360. if (angular.isDefined(data[i].hasSimple)) {
  361. object.hasSimple = data[i].hasSimple;
  362. }
  363. if (angular.isDefined(data[i].group)) {
  364. object.group = data[i].group||{};
  365. }
  366. if (angular.isDefined(data[i].priority)) {
  367. object.priority = data[i].priority;
  368. }
  369. if (angular.isDefined(data[i].complexity)) {
  370. object.complexity = data[i].complexity;
  371. }
  372. if (angular.isDefined(data[i].handleUser)) {
  373. object.handleUser = data[i].handleUser||{};
  374. }
  375. if(angular.isDefined(data[i].userOrGroupType)){
  376. object.userOrGroupType=data[i].userOrGroupType;
  377. }
  378. if(angular.isDefined(data[i].managerUser)){
  379. object.managerUser=data[i].managerUser||{};
  380. }
  381. object.label = data[i].category;
  382. object.state = {
  383. "opened": true
  384. };
  385. object.typeName = "type";
  386. $scope.showAddSolutionType = true;
  387. $scope.showReviewKnowledgeType = true;
  388. objects.push(object);
  389. }
  390. $scope.my_data = convertParentToChildList(objects);
  391. $scope.tree_data = angular.copy($scope.my_data);
  392. if ($scope.my_data.length > 0) {
  393. $scope.doing_async = false;
  394. }
  395. });
  396. };
  397. $scope.try_async_1load = function() {
  398. $scope.my_1data = [];
  399. $scope.doing_async = true;
  400. var data = { "idx": 0, "sum": 1000 };
  401. api_bpm_data.fetchDataList('inspectionType', data).then(function(response) {
  402. var data = response.list;
  403. var objects = [];
  404. for (var i = 0; i < data.length; i++) {
  405. var object = {};
  406. object.id = data[i].id;
  407. if (angular.isDefined(data[i].parent)) {
  408. object.parent = data[i].parent;
  409. }
  410. object.label = data[i].type;
  411. objects.push(object);
  412. }
  413. $scope.my_1data = convertParentToChildList(objects);
  414. $scope.tree_1data = angular.copy($scope.my_1data);
  415. if ($scope.my_1data.length > 0) {
  416. $scope.doing_async = false;
  417. }
  418. });
  419. };
  420. $scope.closethis = function(formdata) {
  421. formdata.category = "";
  422. formdata.parent.category = "";
  423. };
  424. /* -----start submit incidet category----- */
  425. $scope.userGroupChecked={};//选中人/组数据
  426. $scope.submitchange = function(formdata) {
  427. // if (formdata.hasArea) {
  428. // formdata.hasArea = 1;
  429. // formdata.hasPlace = 1;
  430. // } else {
  431. // formdata.hasArea = 0;
  432. // formdata.hasPlace = 0;
  433. // }
  434. if (formdata.hasPlace==true) {
  435. formdata.hasPlace = 1;
  436. } else {
  437. formdata.hasPlace = 0;
  438. }
  439. // }
  440. if (formdata.hasSimple == true) {
  441. formdata.hasSimple = 1;
  442. } else {
  443. formdata.hasSimple = 0;
  444. }
  445. // if ($scope.selectedTreeNode.parent) {
  446. // formdata.parent = { "id": $scope.selectedTreeNode.parent.id };
  447. // }
  448. // console.log($scope.thisParent)
  449. if($scope.selectedChangeCategory){
  450. formdata['parentCategory'] ={'id':$scope.selectedChangeCategory.id};
  451. delete formdata.parent
  452. }else if($scope.thisParent){
  453. formdata['parentCategory'] ={'id':$scope.thisParent.id};
  454. delete formdata.parent
  455. }
  456. // console.log(formdata)
  457. if($scope.userOrGroupType.type){
  458. formdata.userOrGroupType=$scope.userOrGroupType.type
  459. }
  460. if($scope.userGroupChecked&&$scope.userGroupChecked.groupCheck){
  461. formdata.group={id:$scope.userGroupChecked.groupCheck.id};
  462. // delete formdata.handleUser;
  463. }
  464. if($scope.userGroupChecked&&$scope.userGroupChecked.userCheck){
  465. formdata.handleUser={id:$scope.userGroupChecked.userCheck.id};
  466. // delete formdata.group;
  467. }
  468. if($scope.subdata.complexity){
  469. formdata.complexity=$scope.subdata.complexity
  470. }
  471. if($scope.subdata.priority){
  472. formdata.priority=$scope.subdata.priority
  473. }
  474. if($scope.subdata.managerUser){
  475. formdata.managerUser=$scope.subdata.managerUser
  476. }
  477. var filedata = { "incidentcategory": formdata }
  478. console.log(filedata);
  479. // return;
  480. api_bpm_data.updData('incidentcategory', filedata).then(function(response) {
  481. if (response) {
  482. if (response.status == 200) {
  483. $scope.try_async_load()
  484. SweetAlert.swal({
  485. title: "修改成功!",
  486. type: "success"
  487. }, function() {
  488. $scope.$apply($scope.my_data);
  489. })
  490. } else {
  491. SweetAlert.swal({
  492. title: "修改失败!",
  493. type: "error"
  494. })
  495. }
  496. }
  497. });
  498. };
  499. $scope.adddata = {};
  500. $scope.addparent = false;
  501. // 新增保存提交
  502. $scope.userGroupCheckedAdd={};//选中人/组数据
  503. $scope.userOrGroupTypeAdd={};//运维组/运维人员
  504. $scope.submitadd = function(formdata) {
  505. console.log(formdata)
  506. // var paret = {};
  507. // var filedata = {};
  508. // filedata = angular.copy(formdata);
  509. // delete filedata.addp
  510. // if (angular.isDefined(formdata.parent) && addparent) {
  511. // angular.forEach($scope.parentdata, function(data) {
  512. // if (formdata.parent.category.id == data.id) {
  513. // filedata = { "incidentcategory": { "category": formdata.category, "parent": { "id": data.id } } }
  514. // }
  515. // })
  516. // } else {
  517. // filedata = { "incidentcategory": { "category": formdata.category } }
  518. // }
  519. // filedata = { "incidentcategory": { "category": formdata.category, "parent": { "id": formdata.parentNode.id } } }
  520. // if (formdata.hasArea && formdata.hasArea == true) {
  521. // if (formdata.hasArea) {
  522. // formdata.hasArea = 1;
  523. // formdata.hasPlace = 1;
  524. // } else {
  525. // formdata.hasArea = 0;
  526. // formdata.hasPlace = 0;
  527. // }
  528. if (formdata.hasPlace == true) {
  529. formdata.hasPlace = 1;
  530. } else {
  531. formdata.hasPlace = 0;
  532. }
  533. if (formdata.hasSimple == true) {
  534. formdata.hasSimple = 1;
  535. } else {
  536. formdata.hasSimple = 0;
  537. }
  538. if (formdata.parent) {
  539. formdata['parentCategory'] = { "id": formdata.parent.id };
  540. delete formdata.parent
  541. }
  542. if($scope.userOrGroupTypeAdd.type){
  543. formdata.userOrGroupType=$scope.userOrGroupTypeAdd.type
  544. }
  545. if($scope.userGroupCheckedAdd&&$scope.userGroupCheckedAdd.groupCheck){
  546. formdata.group={id:$scope.userGroupCheckedAdd.groupCheck.id};
  547. // delete formdata.handleUser;
  548. }
  549. if($scope.userGroupCheckedAdd&&$scope.userGroupCheckedAdd.userCheck){
  550. formdata.handleUser={id:$scope.userGroupCheckedAdd.userCheck.id};
  551. // delete formdata.group;
  552. }
  553. var filedata = { "incidentcategory": formdata }
  554. console.log(filedata);
  555. // return;
  556. api_bpm_data.addData('incidentcategory', filedata).then(function(response) {
  557. if (response) {
  558. if (response.status == 200) {
  559. $scope.userdata = [];
  560. $scope.outdata = [];
  561. $scope.try_async_load();
  562. SweetAlert.swal({
  563. title: "增加成功!",
  564. type: "success"
  565. })
  566. } else if (response.status == 408) {
  567. SweetAlert.swal({
  568. title: "增加失败!",
  569. text: response.error,
  570. type: "error"
  571. })
  572. } else {
  573. SweetAlert.swal({
  574. title: "增加失败!",
  575. type: "error"
  576. })
  577. }
  578. }
  579. });
  580. };
  581. /* -----end submit incidet category----- */
  582. $scope.try_async_load();
  583. $scope.try_async_1load();
  584. // $scope.ldloading={};
  585. var filterData = {
  586. key: 'null',
  587. status: 0,
  588. pageIndex: 0,
  589. pageSum: 10,
  590. //treeIds:'[]',
  591. userId: loginUser.id
  592. }
  593. // 事件分类结束
  594. // 事件紧急度开始
  595. $scope.incident_emergencyData=[];
  596. $scope.getIncident_emergency=function(){
  597. var data={
  598. "key":"incident_emergency",
  599. "type":"list"
  600. }
  601. api_wechatfile.getDictionary(data).then(function(res){
  602. $scope.incident_emergencyData=res;
  603. })
  604. }
  605. $scope.getIncident_emergency();
  606. $scope.incident_emergencySave=function(){
  607. for(var i=0;i<$scope.incident_emergencyData.length;i++){
  608. api_sysinfo.addData('dictionary', $scope.incident_emergencyData[i]).then(function(res) {
  609. })
  610. }
  611. SweetAlert.swal({
  612. title: "保存成功!",
  613. type: "success",
  614. confirmButtonColor: "#007AFF"
  615. });
  616. $timeout(function(){
  617. $scope.getIncident_emergency();
  618. },2000)
  619. }
  620. $scope.incident_emergencyReturn=function(){
  621. $scope.incident_emergencyData[0].name="紧急";
  622. $scope.incident_emergencyData[1].name="高";
  623. $scope.incident_emergencyData[2].name="中";
  624. $scope.incident_emergencyData[3].name="低";
  625. for(var i=0;i<$scope.incident_emergencyData.length;i++){
  626. api_sysinfo.addData('dictionary', $scope.incident_emergencyData[i]).then(function(res) {
  627. })
  628. }
  629. SweetAlert.swal({
  630. title: "恢复成功!",
  631. type: "success",
  632. confirmButtonColor: "#007AFF"
  633. });
  634. $timeout(function(){
  635. $scope.getIncident_emergency();
  636. },2000)
  637. }
  638. // 事件紧急度结束
  639. // 事件影响度开始
  640. $scope.incident_influenceData=[];
  641. $scope.getIncident_influence=function(){
  642. var data={
  643. "key":"incident_influence",
  644. "type":"list"
  645. }
  646. api_wechatfile.getDictionary(data).then(function(res){
  647. $scope.incident_influenceData=res;
  648. })
  649. }
  650. $scope.getIncident_influence();
  651. $scope.incident_influenceSave=function(){
  652. for(var i=0;i<$scope.incident_influenceData.length;i++){
  653. api_sysinfo.addData('dictionary', $scope.incident_influenceData[i]).then(function(res) {
  654. })
  655. }
  656. SweetAlert.swal({
  657. title: "保存成功!",
  658. type: "success",
  659. confirmButtonColor: "#007AFF"
  660. });
  661. $timeout(function(){
  662. $scope.getIncident_influence();
  663. },2000)
  664. }
  665. $scope.incident_influenceReturn=function(){
  666. $scope.incident_influenceData[0].name="高";
  667. $scope.incident_influenceData[1].name="中";
  668. $scope.incident_influenceData[2].name="低";
  669. for(var i=0;i<$scope.incident_influenceData.length;i++){
  670. api_sysinfo.addData('dictionary', $scope.incident_influenceData[i]).then(function(res) {
  671. })
  672. }
  673. SweetAlert.swal({
  674. title: "恢复成功!",
  675. type: "success",
  676. confirmButtonColor: "#007AFF"
  677. });
  678. $timeout(function(){
  679. $scope.getIncident_influence();
  680. },2000)
  681. }
  682. // 事件影响度结束
  683. // 事件状态开始
  684. $scope.incident_classificationData=[];
  685. $scope.getIncident_classification=function(){
  686. var data={
  687. "key":"incident_status",
  688. "type":"list"
  689. }
  690. api_wechatfile.getDictionary(data).then(function(res){
  691. $scope.incident_classificationData=res;
  692. })
  693. }
  694. $scope.getIncident_classification();
  695. $scope.incident_classificationSave=function(){
  696. for(var i=0;i<$scope.incident_classificationData.length;i++){
  697. api_sysinfo.addData('dictionary', $scope.incident_classificationData[i]).then(function(res) {
  698. })
  699. }
  700. SweetAlert.swal({
  701. title: "保存成功!",
  702. type: "success",
  703. confirmButtonColor: "#007AFF"
  704. });
  705. $timeout(function(){
  706. $scope.getIncident_classification();
  707. },2000)
  708. }
  709. $scope.incident_classificationReturn=function(){
  710. $scope.incident_classificationData[0].name="待接单";
  711. $scope.incident_classificationData[1].name="处理中";
  712. $scope.incident_classificationData[2].name="已解决";
  713. $scope.incident_classificationData[3].name="已关闭";
  714. $scope.incident_classificationData[4].name="暂存";
  715. $scope.incident_classificationData[5].name="重新指派";
  716. for(var i=0;i<$scope.incident_classificationData.length;i++){
  717. api_sysinfo.addData('dictionary', $scope.incident_classificationData[i]).then(function(res) {
  718. })
  719. }
  720. SweetAlert.swal({
  721. title: "恢复成功!",
  722. type: "success",
  723. confirmButtonColor: "#007AFF"
  724. });
  725. $timeout(function(){
  726. $scope.getIncident_classification();
  727. },2000)
  728. }
  729. // 事件状态结束
  730. // 满意度评价开始
  731. $scope.incident_evaluateData=[];
  732. $scope.getIncident_evaluate=function(){
  733. var data={
  734. "key":"incident_degree",
  735. "type":"list"
  736. }
  737. api_wechatfile.getDictionary(data).then(function(res){
  738. $scope.incident_evaluateData=res;
  739. })
  740. }
  741. $scope.getIncident_evaluate();
  742. $scope.incident_evaluateSave=function(){
  743. for(var i=0;i<$scope.incident_evaluateData.length;i++){
  744. api_sysinfo.addData('dictionary', $scope.incident_evaluateData[i]).then(function(res) {
  745. })
  746. }
  747. SweetAlert.swal({
  748. title: "保存成功!",
  749. type: "success",
  750. confirmButtonColor: "#007AFF"
  751. });
  752. $timeout(function(){
  753. $scope.getIncident_evaluate();
  754. },2000)
  755. }
  756. $scope.incident_evaluateReturn=function(){
  757. $scope.incident_evaluateData[0].name="非常满意";
  758. $scope.incident_evaluateData[1].name="较满意";
  759. $scope.incident_evaluateData[2].name="满意";
  760. $scope.incident_evaluateData[3].name="一般";
  761. $scope.incident_evaluateData[4].name="不满意";
  762. for(var i=0;i<$scope.incident_evaluateData.length;i++){
  763. api_sysinfo.addData('dictionary', $scope.incident_evaluateData[i]).then(function(res) {
  764. })
  765. }
  766. SweetAlert.swal({
  767. title: "恢复成功!",
  768. type: "success",
  769. confirmButtonColor: "#007AFF"
  770. });
  771. $timeout(function(){
  772. $scope.getIncident_evaluate();
  773. },2000)
  774. }
  775. // 满意度评价结束
  776. // 结果类型开始
  777. $scope.incident_resultData=[];
  778. $scope.getIncident_result=function(){
  779. var data={
  780. "key":"incident_handleresult",
  781. "type":"list"
  782. }
  783. api_wechatfile.getDictionary(data).then(function(res){
  784. $scope.incident_resultData=res;
  785. })
  786. }
  787. $scope.getIncident_result();
  788. $scope.incident_resultSave=function(){
  789. for(var i=0;i<$scope.incident_resultData.length;i++){
  790. api_sysinfo.addData('dictionary', $scope.incident_resultData[i]).then(function(res) {
  791. })
  792. }
  793. SweetAlert.swal({
  794. title: "保存成功!",
  795. type: "success",
  796. confirmButtonColor: "#007AFF"
  797. });
  798. $timeout(function(){
  799. $scope.getIncident_result();
  800. },2000)
  801. }
  802. $scope.incident_resultReturn=function(){
  803. $scope.incident_resultData[0].name="全部解决";
  804. $scope.incident_resultData[1].name="部分解决";
  805. $scope.incident_resultData[2].name="未解决";
  806. $scope.incident_resultData[3].name="其它";
  807. for(var i=0;i<$scope.incident_resultData.length;i++){
  808. api_sysinfo.addData('dictionary', $scope.incident_resultData[i]).then(function(res) {
  809. })
  810. }
  811. SweetAlert.swal({
  812. title: "恢复成功!",
  813. type: "success",
  814. confirmButtonColor: "#007AFF"
  815. });
  816. $timeout(function(){
  817. $scope.getIncident_result();
  818. },2000)
  819. }
  820. // 结果类型结束
  821. // 事件优先级开始
  822. $scope.incident_priorityData=[];
  823. $scope.getIncident_priority=function(){
  824. var data={
  825. "key":"incident_priority",
  826. "type":"list"
  827. }
  828. api_wechatfile.getDictionary(data).then(function(res){
  829. $scope.incident_priorityData=res;
  830. })
  831. }
  832. $scope.getIncident_priority();
  833. $scope.incident_prioritySave=function(){
  834. for(var i=0;i<$scope.incident_priorityData.length;i++){
  835. api_sysinfo.addData('dictionary', $scope.incident_priorityData[i]).then(function(res) {
  836. })
  837. }
  838. SweetAlert.swal({
  839. title: "保存成功!",
  840. type: "success",
  841. confirmButtonColor: "#007AFF"
  842. });
  843. $timeout(function(){
  844. $scope.getIncident_priority();
  845. },2000)
  846. }
  847. $scope.incident_priorityReturn=function(){
  848. $scope.incident_priorityData[0].name="重大";
  849. $scope.incident_priorityData[1].name="高";
  850. $scope.incident_priorityData[2].name="较高";
  851. $scope.incident_priorityData[3].name="普通";
  852. for(var i=0;i<$scope.incident_priorityData.length;i++){
  853. api_sysinfo.addData('dictionary', $scope.incident_priorityData[i]).then(function(res) {
  854. })
  855. }
  856. SweetAlert.swal({
  857. title: "恢复成功!",
  858. type: "success",
  859. confirmButtonColor: "#007AFF"
  860. });
  861. $timeout(function(){
  862. $scope.getIncident_priority();
  863. },2000)
  864. }
  865. // 事件优先级结束
  866. // 事件工单权重开始
  867. $scope.incident_complexityData=[];
  868. $scope.getIncident_complexity=function(){
  869. var data={
  870. "key":"incident_complexity",
  871. "type":"list"
  872. }
  873. api_wechatfile.getDictionary(data).then(function(res){
  874. $scope.incident_complexityData=res;
  875. })
  876. }
  877. $scope.getIncident_complexity();
  878. $scope.incident_complexitySave=function(){
  879. for(var i=0;i<$scope.incident_complexityData.length;i++){
  880. api_sysinfo.addData('dictionary', $scope.incident_complexityData[i]).then(function(res) {
  881. })
  882. }
  883. SweetAlert.swal({
  884. title: "保存成功!",
  885. type: "success",
  886. confirmButtonColor: "#007AFF"
  887. });
  888. $timeout(function(){
  889. $scope.getIncident_complexity();
  890. },2000)
  891. }
  892. // 没有恢复默认
  893. // $scope.incident_complexityReturn=function(){
  894. // $scope.incident_complexityData[0].name="重大";
  895. // $scope.incident_complexityData[1].name="高";
  896. // $scope.incident_complexityData[2].name="较高";
  897. // $scope.incident_complexityData[3].name="普通";
  898. // for(var i=0;i<$scope.incident_complexityData.length;i++){
  899. // api_sysinfo.addData('dictionary', $scope.incident_complexityData[i]).then(function(res) {
  900. // })
  901. // }
  902. // SweetAlert.swal({
  903. // title: "恢复成功!",
  904. // type: "success",
  905. // confirmButtonColor: "#007AFF"
  906. // });
  907. // $timeout(function(){
  908. // $scope.getIncident_complexity();
  909. // },2000)
  910. // }
  911. // 事件工单权重结束
  912. // 服务级别协议开始
  913. $scope.incident_SLA_Data=[];
  914. $scope.getIncident_SLA=function(){
  915. var data={
  916. "idx":0,
  917. "sum":10
  918. };
  919. jry_api_bpm.jry_getFetchDataList(data,"servicelevelagreement").then(function(res){
  920. $scope.incident_SLA_Data=res.list
  921. })
  922. };
  923. $scope.getIncident_SLA();
  924. $scope.incident_SLASave=function(){
  925. for(var i=0;i<$scope.incident_SLA_Data.length;i++){
  926. $scope.incident_SLA_Data[i].availabilityDate=$scope.incident_SLA_Data[i].availabilityDate+" 08:00:00";
  927. $scope.incident_SLA_Data[i].terminationDate=$scope.incident_SLA_Data[i].terminationDate+" 08:00:00";
  928. var data={
  929. "servicelevelagreement":$scope.incident_SLA_Data[i]
  930. }
  931. jry_api_bpm.jry_editFn(data,"servicelevelagreement").then(function(){
  932. })
  933. SweetAlert.swal({
  934. title: "保存成功!",
  935. type: "success",
  936. confirmButtonColor: "#007AFF"
  937. });
  938. $timeout(function(){
  939. $scope.getIncident_SLA();
  940. },2000)
  941. }
  942. }
  943. $scope.incident_SLAReturn=function(){
  944. $scope.incident_SLA_Data[0].resolveTime=450;
  945. $scope.incident_SLA_Data[1].resolveTime=480;
  946. $scope.incident_SLA_Data[2].resolveTime=480;
  947. $scope.incident_SLA_Data[3].resolveTime=960;
  948. $scope.incident_SLA_Data[0].responseTime=30;
  949. $scope.incident_SLA_Data[1].responseTime=45;
  950. $scope.incident_SLA_Data[2].responseTime=60;
  951. $scope.incident_SLA_Data[3].responseTime=240;
  952. for(var i=0;i<$scope.incident_SLA_Data.length;i++){
  953. $scope.incident_SLA_Data[i].availabilityDate=$scope.incident_SLA_Data[i].availabilityDate+" 08:00:00";
  954. $scope.incident_SLA_Data[i].terminationDate=$scope.incident_SLA_Data[i].terminationDate+" 08:00:00";
  955. var data={
  956. "servicelevelagreement":$scope.incident_SLA_Data[i]
  957. }
  958. jry_api_bpm.jry_editFn(data,"servicelevelagreement").then(function(){
  959. })
  960. SweetAlert.swal({
  961. title: "保存成功!",
  962. type: "success",
  963. confirmButtonColor: "#007AFF"
  964. });
  965. $timeout(function(){
  966. $scope.getIncident_SLA();
  967. },2000)
  968. }
  969. }
  970. // 服务级别协议结束
  971. // 事件来源开始
  972. $scope.incident_sourceData=[];
  973. $scope.getIncident_source=function(){
  974. var data={
  975. "key":"incident_source",
  976. "type":"list"
  977. }
  978. api_wechatfile.getDictionary(data).then(function(res){
  979. $scope.incident_sourceData=res;
  980. })
  981. }
  982. $scope.getIncident_source();
  983. $scope.incident_sourceSave=function(){
  984. for(var i=0;i<$scope.incident_sourceData.length;i++){
  985. api_sysinfo.addData('dictionary', $scope.incident_sourceData[i]).then(function(res) {
  986. })
  987. }
  988. SweetAlert.swal({
  989. title: "保存成功!",
  990. type: "success",
  991. confirmButtonColor: "#007AFF"
  992. });
  993. $timeout(function(){
  994. $scope.getIncident_source();
  995. },2000)
  996. }
  997. $scope.incident_sourceReturn=function(){
  998. $scope.incident_sourceData[0].name="电话";
  999. $scope.incident_sourceData[1].name="留言";
  1000. $scope.incident_sourceData[2].name="微信/web";
  1001. $scope.incident_sourceData[3].name="主动发现";
  1002. $scope.incident_sourceData[4].name="领导指派";
  1003. $scope.incident_sourceData[5].name="其他";
  1004. $scope.incident_sourceData[0].value="phone";
  1005. $scope.incident_sourceData[1].value="record";
  1006. $scope.incident_sourceData[2].value="im";
  1007. $scope.incident_sourceData[3].value="discover";
  1008. $scope.incident_sourceData[4].value="leader";
  1009. $scope.incident_sourceData[5].value="other";
  1010. for(var i=0;i<$scope.incident_sourceData.length;i++){
  1011. api_sysinfo.addData('dictionary', $scope.incident_sourceData[i]).then(function(res) {
  1012. })
  1013. }
  1014. SweetAlert.swal({
  1015. title: "恢复成功!",
  1016. type: "success",
  1017. confirmButtonColor: "#007AFF"
  1018. });
  1019. $timeout(function(){
  1020. $scope.getIncident_source();
  1021. },2000)
  1022. }
  1023. // 事件来源结束
  1024. // 关闭代码开始
  1025. $scope.incident_closecodeData=[];
  1026. $scope.getIncident_closecode=function(){
  1027. var data={
  1028. "key":"incident_closecode",
  1029. "type":"list"
  1030. }
  1031. api_wechatfile.getDictionary(data).then(function(res){
  1032. $scope.incident_closecodeData=res;
  1033. })
  1034. }
  1035. $scope.getIncident_closecode();
  1036. $scope.incident_closecodeSave=function(){
  1037. for(var i=0;i<$scope.incident_closecodeData.length;i++){
  1038. api_sysinfo.addData('dictionary', $scope.incident_closecodeData[i]).then(function(res) {
  1039. })
  1040. }
  1041. SweetAlert.swal({
  1042. title: "保存成功!",
  1043. type: "success",
  1044. confirmButtonColor: "#007AFF"
  1045. });
  1046. $timeout(function(){
  1047. $scope.getIncident_closecode();
  1048. },2000)
  1049. }
  1050. $scope.incident_closecodeReturn=function(){
  1051. $scope.incident_closecodeData[0].value="060";
  1052. $scope.incident_closecodeData[1].value="061";
  1053. $scope.incident_closecodeData[2].value="062";
  1054. $scope.incident_closecodeData[3].value="063";
  1055. $scope.incident_closecodeData[4].value="064";
  1056. $scope.incident_closecodeData[5].value="065";
  1057. $scope.incident_closecodeData[0].desc="事件已经完全解决";
  1058. $scope.incident_closecodeData[1].desc="事件未能完全解决";
  1059. $scope.incident_closecodeData[2].desc="由服务提供商对事件进行处理";
  1060. $scope.incident_closecodeData[3].desc="事件自行消失";
  1061. $scope.incident_closecodeData[4].desc="事件请求不在服务范围内";
  1062. $scope.incident_closecodeData[5].desc="通过问题或变更流程处理";
  1063. $scope.incident_closecodeData[0].desc="完全解决";
  1064. $scope.incident_closecodeData[1].desc="临时解决";
  1065. $scope.incident_closecodeData[2].desc="供应商解决";
  1066. $scope.incident_closecodeData[3].desc="事件消失";
  1067. $scope.incident_closecodeData[4].desc="拒绝";
  1068. $scope.incident_closecodeData[5].desc="进入其他流程处理";
  1069. for(var i=0;i<$scope.incident_closecodeData.length;i++){
  1070. api_sysinfo.addData('dictionary', $scope.incident_closecodeData[i]).then(function(res) {
  1071. })
  1072. }
  1073. SweetAlert.swal({
  1074. title: "恢复成功!",
  1075. type: "success",
  1076. confirmButtonColor: "#007AFF"
  1077. });
  1078. $timeout(function(){
  1079. $scope.getIncident_closecode();
  1080. },2000)
  1081. }
  1082. // 关闭代码结束
  1083. // 优先级规则开始
  1084. $scope.incident_prioritymatrixAdd=function(){
  1085. var modalInstance = $modal.open({
  1086. templateUrl: 'assets/views/system/tpl/systemprioritymatrix.html',
  1087. controller: function($scope, $modalInstance, api_bpm_data) {
  1088. $scope.prioritymatrixdata={};
  1089. var prioritymatrixInfluenceData={
  1090. "key":"incident_influence",
  1091. "type":"list"
  1092. }
  1093. $scope.prioritymatrixInfluenceData=[];
  1094. api_wechatfile.getDictionary(prioritymatrixInfluenceData).then(function(res){
  1095. $scope.prioritymatrixInfluenceData=res;
  1096. })
  1097. var prioritymatrixEmergencyData={
  1098. "key":"incident_emergency",
  1099. "type":"list"
  1100. }
  1101. $scope.prioritymatrixEmergencyData=[];
  1102. api_wechatfile.getDictionary(prioritymatrixEmergencyData).then(function(res){
  1103. $scope.prioritymatrixEmergencyData=res;
  1104. })
  1105. var prioritymatrixPriorityData={
  1106. "key":"incident_priority",
  1107. "type":"list"
  1108. }
  1109. $scope.prioritymatrixPriorityData=[];
  1110. api_wechatfile.getDictionary(prioritymatrixPriorityData).then(function(res){
  1111. $scope.prioritymatrixPriorityData=res;
  1112. })
  1113. $scope.cancel = function() {
  1114. $modalInstance.dismiss('cancel');
  1115. };
  1116. $scope.savercode = function(prioritymatrixdata) {
  1117. $modalInstance.close(prioritymatrixdata);
  1118. };
  1119. }
  1120. });
  1121. modalInstance.result.then(function(selectedItem) {
  1122. // console.log('selectedItem='+JSON.stringify(selectedItem));
  1123. if (selectedItem) {
  1124. console.log(selectedItem);
  1125. var fildata = { "prioritymatrix": { "priority": { "id": selectedItem.priority.id }, "emergency": { "id": selectedItem.emergency.id }, "influence": { "id": selectedItem.influence.id } } }
  1126. api_bpm_data.addData('prioritymatrix', fildata).then(function(response) {
  1127. if (response) {
  1128. if (response.status == 200) {
  1129. SweetAlert.swal({
  1130. title: "新增成功!",
  1131. type: "success"
  1132. }, function() {
  1133. $scope.getPrioritymatrix()
  1134. })
  1135. } else {
  1136. SweetAlert.swal({
  1137. title: "新增失败!",
  1138. text: "已有此类优先级规则!",
  1139. type: "error"
  1140. })
  1141. }
  1142. }
  1143. })
  1144. }
  1145. });
  1146. }
  1147. $scope.prioritymatrixData=[];
  1148. $scope.getPrioritymatrix=function(){
  1149. var data={
  1150. "idx":0,
  1151. "sum":999
  1152. }
  1153. api_statistic.tableData(data,"prioritymatrix").then(function(res){
  1154. $scope.prioritymatrixData=res.list
  1155. })
  1156. }
  1157. $scope.incident_prioritymatrixSave=function(){
  1158. SweetAlert.swal({
  1159. title: "修改成功!",
  1160. type: "success"
  1161. })
  1162. for(var i=0;i<$scope.prioritymatrixData.length;i++){
  1163. api_bpm.updData("prioritymatrix",{"prioritymatrix":$scope.prioritymatrixData[i]}).then(function(res){
  1164. if(res.status!=200){
  1165. SweetAlert.swal({
  1166. title: "修改失败!",
  1167. text: "已有此类优先级规则,或者规则不合理!",
  1168. type: "error"
  1169. })
  1170. }
  1171. })
  1172. }
  1173. $timeout(function(){
  1174. $scope.getPrioritymatrix()
  1175. },2000)
  1176. }
  1177. $scope.removePrioritymatrix=function(data){
  1178. SweetAlert.swal({
  1179. title: "确认删除?",
  1180. text: "删除的数据不可恢复,请确认继续操作!",
  1181. type: "warning",
  1182. showCancelButton: true,
  1183. confirmButtonColor: "#DD6B55",
  1184. confirmButtonText: "继续删除",
  1185. cancelButtonText: "取消操作",
  1186. closeOnConfirm: false,
  1187. closeOnCancel: false
  1188. }, function (isConfirm) {
  1189. if (isConfirm) {
  1190. api_bpm_data.rmvData("prioritymatrix",[data.id]).then(function(res){
  1191. console.log(res);
  1192. if(res.status==200){
  1193. SweetAlert.swal({
  1194. title: "删除成功!",
  1195. type: "success",
  1196. confirmButtonColor: "#007AFF"
  1197. }, function() {
  1198. $scope.getPrioritymatrix()
  1199. });
  1200. }else{
  1201. SweetAlert.swal({
  1202. title: "删除失败",
  1203. text: "系统错误,请稍后重试!",
  1204. type: "error",
  1205. confirmButtonColor: "#DD6B55"
  1206. });
  1207. }
  1208. })
  1209. } else {
  1210. SweetAlert.swal("操作取消", "数据安全", "error");
  1211. }
  1212. });
  1213. }
  1214. $scope.getPrioritymatrix()
  1215. // 优先级规则结束
  1216. // 获取组数据
  1217. $scope.getGroupList=function(){
  1218. var postData={
  1219. idx: 0,
  1220. sum: 1000,
  1221. group: {selectType: "nouser"}
  1222. }
  1223. api_user_data.fetchDataList('group',postData).then(res=>{
  1224. $scope.groupList=res.list;
  1225. })
  1226. }
  1227. $scope.getGroupList()
  1228. // 获取人数据
  1229. $scope.getUserList=function(){
  1230. var postData={
  1231. idx: 0,
  1232. sum: 1000,
  1233. user: {
  1234. name:'',
  1235. selectType: "pinyin_qs",
  1236. }
  1237. }
  1238. api_user_data.fetchDataList('user',postData).then(res=>{
  1239. $scope.userList=res.list;
  1240. })
  1241. }
  1242. $scope.getUserList()
  1243. // 获取事件分类人员
  1244. $scope.getUserList1=function(){
  1245. var postData={
  1246. idx: 0,
  1247. sum: 1000,
  1248. user: {
  1249. name:'',
  1250. selectType: "pinyin_qs",
  1251. roledata:{
  1252. rolecode:'incident-category-manager'
  1253. }
  1254. }
  1255. }
  1256. api_user_data.fetchDataList('user',postData).then(res=>{
  1257. $scope.userList1=res.list;
  1258. })
  1259. }
  1260. $scope.getUserList1()
  1261. }]);