processNodeCtrl.js 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. 'use strict';
  2. /**
  3. * controller for User Profile Example
  4. */
  5. app.controller('processNodeCtr', ["$rootScope", "$scope", "$state", "$timeout", "$interval", "$modal", "SweetAlert", "i18nService", "uiGridConstants", "uiGridGroupingConstants", "Restangular", "api_user_data", "api_login","api_configure_data","api_wechatfile","api_sysinfo", function($rootScope, $scope, $state, $timeout, $interval, $modal, SweetAlert, i18nService, uiGridConstants, uiGridGroupingConstants, Restangular, api_user_data, api_login,api_configure_data,api_wechatfile,api_sysinfo) {
  6. // $scope.ceshi="哈哈"
  7. $scope.leftListIdx=0;
  8. $scope.tableName="报修流程提示设置";
  9. $scope.listData=[
  10. {"name":"报修端"},
  11. {"name":"处理端"}
  12. ]
  13. $scope.leftListCli=function(idx,value){
  14. $scope.leftListIdx=idx;
  15. $scope.tableName=value.name;
  16. if(value.name=="报修端"){
  17. $scope.tableName="报修流程提示设置";
  18. }else if(value.name=="处理端"){
  19. $scope.tableName="处理流程提示设置";
  20. }
  21. }
  22. $scope.rRowscatergry=[
  23. {
  24. "guding":"",
  25. "gaidong":"",
  26. }
  27. ,
  28. {
  29. "guding":"",
  30. "gaidong":""
  31. }
  32. ,
  33. {
  34. "guding":"",
  35. "gaidong":""
  36. }
  37. ,
  38. {
  39. "guding":"",
  40. "gaidong":""
  41. }
  42. ,
  43. {
  44. "guding":"",
  45. "gaidong":""
  46. }
  47. ]
  48. $scope.getbaoxiu_guding=function(){
  49. api_wechatfile.getDictionary({
  50. "key":"wxincident_task",
  51. "type":"list"
  52. }).then(function(res){
  53. for(var i=0;i<5;i++){
  54. $scope.rRowscatergry[i].guding=res[i];
  55. }
  56. })
  57. }
  58. $scope.getbaoxiu_guding();
  59. $scope.getbaoxiu_gaidong=function(){
  60. api_sysinfo.fetchDataList("dictionary",{
  61. "idx":0,
  62. "sum":10,
  63. "dictionary":{
  64. "key":"wxincident_task_default"
  65. }
  66. }).then(function(res){
  67. for(var i=0;i<5;i++){
  68. $scope.rRowscatergry[i].gaidong=res.list[i];
  69. }
  70. })
  71. }
  72. $scope.getbaoxiu_gaidong();
  73. $scope.rRowscatergry2=[
  74. {
  75. "guding":"",
  76. "gaidong":"",
  77. }
  78. ,
  79. {
  80. "guding":"",
  81. "gaidong":""
  82. }
  83. ,
  84. {
  85. "guding":"",
  86. "gaidong":""
  87. }
  88. ,
  89. {
  90. "guding":"",
  91. "gaidong":""
  92. }
  93. ,
  94. {
  95. "guding":"",
  96. "gaidong":""
  97. }
  98. ,
  99. {
  100. "guding":"",
  101. "gaidong":""
  102. }
  103. ]
  104. $scope.getchuli_guding=function(){
  105. api_wechatfile.getDictionary({
  106. "key":"incident_task_default",
  107. "type":"list"
  108. }).then(function(res){
  109. for(var i=0;i<6;i++){
  110. $scope.rRowscatergry2[i].guding=res[i];
  111. }
  112. })
  113. }
  114. // $scope.getchuli_guding();
  115. $scope.getchuli_gaidong=function(){
  116. api_sysinfo.fetchDataList("dictionary",{
  117. "idx":0,
  118. "sum":10,
  119. "dictionary":{
  120. "key":"incident_log_type"
  121. }
  122. }).then(function(res){
  123. $scope.rRowscatergry2 = res.list.map(v => ({
  124. guding:'',
  125. gaidong: v,
  126. }))
  127. })
  128. }
  129. $scope.getchuli_gaidong();
  130. $scope.bxBianji=function(data){
  131. var modalInstance = $modal.open({
  132. templateUrl: 'assets/views/system/tpl/processNodeBj.html',
  133. controller: function($scope, $modalInstance, api_bpm_data) {
  134. $scope.process=data.guding.name;
  135. $scope.processTis=data.guding.desc;
  136. $scope.processBj=data.gaidong.name;
  137. $scope.processTisBj=data.gaidong.desc;
  138. $scope.cancel = function() {
  139. $modalInstance.dismiss('cancel');
  140. };
  141. $scope.savercode = function(prioritymatrixdata) {
  142. if($scope.processBj&&$scope.processTisBj){
  143. var model={
  144. "gaidongAll":data.gaidong,
  145. "gaidongName":$scope.processBj,
  146. "gaidongDesc":$scope.processTisBj
  147. };
  148. data.gaidong.name=$scope.processBj;
  149. data.gaidong.desc=$scope.processTisBj;
  150. $modalInstance.close(data.gaidong);
  151. }else{
  152. SweetAlert.swal({
  153. title: "提交失败",
  154. text: "提交值不能为空!",
  155. type: "error",
  156. confirmButtonColor: "#DD6B55"
  157. });
  158. }
  159. };
  160. }
  161. });
  162. modalInstance.result.then(function(data) {
  163. console.log(data);
  164. api_sysinfo.addData("dictionary",data).then(function(res){
  165. if(res.status==200){
  166. SweetAlert.swal({
  167. title: "修改成功!",
  168. type: "success",
  169. confirmButtonColor: "#007AFF"
  170. }, function() {
  171. $scope.getbaoxiu_gaidong();
  172. $scope.getchuli_gaidong();
  173. });
  174. }
  175. })
  176. });
  177. }
  178. $scope.bxBianji2=function(data){
  179. var modalInstance = $modal.open({
  180. templateUrl: 'assets/views/system/tpl/processNodeBj2.html',
  181. controller: function($scope, $modalInstance, api_bpm_data) {
  182. $scope.process=data.guding.name;
  183. $scope.processTis=data.guding.desc;
  184. $scope.processBj=data.gaidong.name;
  185. $scope.processTisBj=data.gaidong.desc;
  186. $scope.cancel = function() {
  187. $modalInstance.dismiss('cancel');
  188. };
  189. $scope.savercode = function(prioritymatrixdata) {
  190. if($scope.processBj&&$scope.processTisBj){
  191. var model={
  192. "gaidongAll":data.gaidong,
  193. "gaidongName":$scope.processBj,
  194. "gaidongDesc":$scope.processTisBj
  195. };
  196. data.gaidong.name=$scope.processBj;
  197. data.gaidong.desc=$scope.processTisBj;
  198. $modalInstance.close(data.gaidong);
  199. }else{
  200. SweetAlert.swal({
  201. title: "提交失败",
  202. text: "提交值不能为空!",
  203. type: "error",
  204. confirmButtonColor: "#DD6B55"
  205. });
  206. }
  207. };
  208. }
  209. });
  210. modalInstance.result.then(function(data) {
  211. console.log(data);
  212. api_sysinfo.addData("dictionary",data).then(function(res){
  213. if(res.status==200){
  214. SweetAlert.swal({
  215. title: "修改成功!",
  216. type: "success",
  217. confirmButtonColor: "#007AFF"
  218. }, function() {
  219. $scope.getbaoxiu_gaidong();
  220. $scope.getchuli_gaidong();
  221. });
  222. }
  223. })
  224. });
  225. }
  226. }]);