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) { var loginUser = $rootScope.user; $scope.xinzeng=false; $scope.shanchu=false; $scope.bianji=false; for(var i=0;i x.id !== id) newTree.forEach(x => x.children && (x.children = $scope.filterTree(x.children,id))) return newTree } var childdata = {}; $scope.thisParent={};//当前点击节点的父节点 $scope.userOrGroupType={type:0};//当前节点运维组/运维人员 $scope.dataSave = [];//储存$scope.tree_data $scope.my_tree_handler = function(branch) { console.log($scope.dataSave) if($scope.dataSave.length === 0){ $scope.dataSave = angular.copy($scope.tree_data); } console.log(branch) if(branch.parent){ $scope.tree_data = $scope.filterTree($scope.dataSave,branch.id); console.log($scope.tree_data,'过滤后'); } $scope.changecate = true; $scope.addcate = false; filterData.treeIds = branch.id; // $scope.selectedTreeNode = branch; $scope.output = branch; $scope.thisParent=branch.parent||null; if($scope.thisParent){ $scope.thisParent.label=$scope.thisParent.category; $scope.thisParent.isExpanded=true; $scope.thisParent.selected=true; $scope.subdata['parent']=$scope.thisParent }; // console.log($scope.thisParent,$scope.subdata) if(branch.hasPlace==1){ $scope.subdata.hasPlace=true }else{ $scope.subdata.hasPlace=false } convertchildToTree(branch,'故障现象'); console.log(branch) if(branch.managerUser){ $scope.subdata.managerUser = branch.managerUser } if(branch.userOrGroupType){ $scope.userOrGroupType['type']=branch.userOrGroupType; $scope.userGroupChecked['groupCheck']=branch.group||{}; $scope.userGroupChecked['userCheck']=branch.handleUser||{}; }else{ $scope.userOrGroupType['type']=0; $scope.userGroupChecked={} } // $scope.subdata=branch; $scope.subdata.category=branch.label; var eqflag = false; angular.forEach($scope.outdata, function(item) { if (item.id == $scope.output.id) eqflag = true; }); if (eqflag) { } else { $scope.outdata.push({ 'name': $scope.output.label, 'id': $scope.output.id }); var postData = { typeList: [] }; if ($scope.outdata.length > 0) { angular.forEach($scope.outdata, function(data) { postData.typeList.push({ id: data.id }); }) } // api_solution.findSolutionTypesUser(postData).then(function(response){ // //Restangular. // $scope.userdata = response.data; // }); } }; $scope.thisParent={};//当前点击节点的父节点 // $scope.userOrGroupType1={};//当前节点运维组/运维人员 $scope.group_user = { // offlineGroup:{},//线下组 // onlineUser:{}//线上人 } $scope.dataSave1 = [];//储存$scope.tree_data $scope.my_tree_1handler = function(branch) { console.log($scope.dataSave1) if($scope.dataSave1.length === 0){ $scope.dataSave1 = angular.copy($scope.tree_1data); } console.log(branch) if(branch.parent){ $scope.tree_1data = $scope.filterTree($scope.dataSave1,branch.id); console.log($scope.tree_1data,'过滤后'); } $scope.changecate = true; $scope.add1cate = false; filterData.treeIds = branch.id; // $scope.selectedTreeNode = branch; $scope.output = branch; $scope.thisParent=branch.parent||null; if($scope.thisParent){ $scope.thisParent.label=$scope.thisParent.type; $scope.thisParent.isExpanded=true; $scope.thisParent.selected=true; $scope.sub1data['parent']=$scope.thisParent }; convertchildToTree(branch,'巡检范围');//2022年5月27日,暂存,明明 console.log(branch); if(branch.user){ $scope.group_user['onlineUser']=branch.user||{}; }else{ $scope.group_user['onlineUser']={} } if(branch.group){ $scope.group_user['offlineGroup']=branch.group||{}; }else{ $scope.group_user['offlineGroup']={} } $scope.sub1data.type=branch.label; var eqflag = false; angular.forEach($scope.outdata, function(item) { if (item.id == $scope.output.id) eqflag = true; }); if (eqflag) { } else { $scope.outdata.push({ 'name': $scope.output.label, 'id': $scope.output.id }); var postData = { typeList: [] }; if ($scope.outdata.length > 0) { angular.forEach($scope.outdata, function(data) { postData.typeList.push({ id: data.id }); }) } } }; $scope.addType = function(element) { $scope.tree_data = $scope.dataSave.length?angular.copy($scope.dataSave):$scope.tree_data; $scope.addcate = true $scope.changecate = false // var modalInstance = $modal.open({ // templateUrl: 'assets/views/system/tpl/systemclose.html', // controller: function($scope, $modalInstance, api_bpm_data){ // // api_bpm_data.fetchDataList('closecode',filterData).then(function(data){ // // var myData = Restangular.stripRestangular(data); // // } // } // }); } $scope.addType1 = function(element) { $scope.tree_1data = $scope.dataSave1.length?angular.copy($scope.dataSave1):$scope.tree_1data; $scope.add1cate = true $scope.changecate = false } /* -----start remove incidet category----- */ $scope.remove = function(element) { var modalInstance = $modal.open({ templateUrl: 'assets/views/delete.html', controller: function($scope, scope, $modalInstance, api_bpm_data) { // $scope.title = '优先级删除'; // $scope.connect = '确定要删除此优先级?'; $scope.title = "故障现象删除?"; $scope.connect = "确定要删除此故障现象?"; $scope.ok = function() { $modalInstance.close(element); }; $scope.cancel = function() { $modalInstance.dismiss('cancel'); }; }, size: 'sm', resolve: { scope: function() { return $scope; } } }); modalInstance.result.then(function(selectedItem) { if (selectedItem) { var rmvList = []; rmvList.push(selectedItem.id); if (selectedItem.children.length > 0) { SweetAlert.swal({ title: "删除失败!", text: "请先删除选中的分类的子级", type: "error" }) } else { api_bpm_data.rmvData('incidentcategory', rmvList).then(function(response) { if (response.data) { SweetAlert.swal({ title: "删除成功!", type: "success", confirmButtonColor: "#007AFF" }, function() { $scope.try_async_load(); $scope.$apply($scope.my_data); }); } else { SweetAlert.swal({ title: "操作异常!", text: "系统异常,请稍后重试,或者联系管理员!", type: "error" }); } }) } } }) } $scope.remove1 = function(element) { var modalInstance = $modal.open({ templateUrl: 'assets/views/delete.html', controller: function($scope, scope, $modalInstance, api_bpm_data) { $scope.title = "巡检范围删除?"; $scope.connect = "确定要删除此巡检范围?"; $scope.ok = function() { $modalInstance.close(element); }; $scope.cancel = function() { $modalInstance.dismiss('cancel'); }; }, size: 'sm', resolve: { scope: function() { return $scope; } } }); modalInstance.result.then(function(selectedItem) { if (selectedItem) { var rmvList = []; rmvList.push(selectedItem.id); if (selectedItem.children.length > 0) { SweetAlert.swal({ title: "删除失败!", text: "请先删除选中的范围的子级", type: "error" }) } else { api_bpm_data.rmvData('inspectionType', rmvList).then(function(response) { if (response.data) { SweetAlert.swal({ title: "删除成功!", type: "success", confirmButtonColor: "#007AFF" }, function() { $scope.try_async_1load(); $scope.$apply($scope.my_1data); }); } else { SweetAlert.swal({ title: "操作异常!", text: "系统异常,请稍后重试,或者联系管理员!", type: "error" }); } }) } } }) } /* -----end remove incidet category----- */ function convertchildToTree(datum,type) { if(type === '故障现象'){ $scope.subdata = {}; if(datum.branchUserGroups){ for (var i = 0; i < datum.branchUserGroups.length; i++) { if(datum.branchUserGroups[i].userId){ datum.branchUserGroups[i].user = {id:datum.branchUserGroups[i].userId,name:datum.branchUserGroups[i].userName}; delete datum.branchUserGroups[i].userId; delete datum.branchUserGroups[i].userName; } if(datum.branchUserGroups[i].groupId){ datum.branchUserGroups[i].group = {id:datum.branchUserGroups[i].groupId,groupName:datum.branchUserGroups[i].groupName}; delete datum.branchUserGroups[i].groupId; delete datum.branchUserGroups[i].groupName; } } } if (datum.parent) { $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, branchType:datum.branchType,branchUserGroups:datum.branchUserGroups||[] } } else { $scope.subdata = { 'id': datum.id, 'category': datum.label, 'group': datum.group||{}, 'hasSimple': datum.hasSimple, 'hasPlace': datum.hasPlace, 'priority': datum.priority, 'complexity': datum.complexity, branchType:datum.branchType,branchUserGroups:datum.branchUserGroups||[] } } }else if(type === '巡检范围'){ $scope.sub1data = {}; if (datum.parent) { $scope.sub1data = { 'id': datum.id, 'type': datum.label, 'parent': datum.parent } } else { $scope.sub1data = { 'id': datum.id, 'type': datum.label } } } } function convertListToTree(data, treeMap) { var idToNodeMap = {}; //Keeps track of nodes using id as key, for fast lookup var root = null; //Initially set our loop to null //loop over data for (var i = 0; i < data.length; i++) { var datum = data[i]; //each node will have children, so let's give it a "children" poperty datum.children = []; //add an entry for this node to the map so that any future children can //lookup the parent idToNodeMap[datum.id] = datum; //Does this node have a parent? // console.log("datum="+JSON.stringify(datum)) if (typeof datum.parent === "undefined") { //Doesn't look like it, so this node is the root of the tree root = datum; treeMap[datum.id] = root; } else { //This node has a parent, so let's look it up using the id parentNode = idToNodeMap[datum.parent.id]; //We don't need this property, so let's delete it. // delete datum.parent; //Let's add the current node as a child of the parent node. parentNode.children.push(datum); } } return root; } function convertParentToChildList(data) { var treeMap = {}; var list = []; convertListToTree(data, treeMap); angular.forEach(treeMap, function(item) { list.push(item); }); return list; } $scope.onFilterCallback = function(item){ // $scope.addcategory.parent=item.label; $scope.selectedChangeCategory=item; console.log(item) } // $scope.parentdata = {}; $scope.try_async_load = function() { $scope.my_data = []; $scope.doing_async = true; api_bpm_data.fetchDataList('branch', { "idx": 0, "sum": 1000 }).then(function(result) { result = result.list || []; $scope.adddata = {branchType:0,branchUserGroups:result.map(v=>({branchName:v.hosName,branchId:v.id}))} api_bpm_data.fetchDataList('incidentcategory', { "idx": 0, "sum": 1000 }).then(function(response) { var data = response.list; var objects = []; // $scope.parentdata = data; for (var i = 0; i < data.length; i++) { var object = {}; object.id = data[i].id; if (angular.isDefined(data[i].parent)) { object.parent = data[i].parent; } if (angular.isDefined(data[i].hasPlace)) { object.hasPlace = data[i].hasPlace; } if (angular.isDefined(data[i].hasSimple)) { object.hasSimple = data[i].hasSimple; } if (angular.isDefined(data[i].group)) { object.group = data[i].group||{}; } if (angular.isDefined(data[i].priority)) { object.priority = data[i].priority; } if (angular.isDefined(data[i].complexity)) { object.complexity = data[i].complexity; } if (angular.isDefined(data[i].handleUser)) { object.handleUser = data[i].handleUser||{}; } if(angular.isDefined(data[i].userOrGroupType)){ object.userOrGroupType=data[i].userOrGroupType; } if(angular.isDefined(data[i].managerUser)){ object.managerUser=data[i].managerUser||{}; } if(angular.isDefined(data[i].branchType)){ object.branchType=data[i].branchType||0; } if(angular.isDefined(data[i].branchUserGroups)){ data[i].branchUserGroups = data[i].branchUserGroups|| []; if(data[i].branchUserGroups.length){ var arr_b = result.map(v=>({branchName:v.hosName,branchId:v.id,categoryId:data[i].id})); for (var j = 0; j < arr_b.length; j++) { for (var p = 0; p < data[i].branchUserGroups.length; p++) { if(arr_b[j].branchId == data[i].branchUserGroups[p].branchId){ arr_b[j] = data[i].branchUserGroups[p]; } } } object.branchUserGroups=arr_b; }else{ object.branchUserGroups = result.map(v=>({branchName:v.hosName,branchId:v.id,categoryId:data[i].id})) } }else{ object.branchUserGroups = result.map(v=>({branchName:v.hosName,branchId:v.id,categoryId:data[i].id})) } object.label = data[i].category; object.state = { "opened": true }; object.typeName = "type"; $scope.showAddSolutionType = true; $scope.showReviewKnowledgeType = true; objects.push(object); } $scope.my_data = convertParentToChildList(objects); $scope.tree_data = angular.copy($scope.my_data); $scope.doing_async = false; }); }); }; $scope.try_async_1load = function() { $scope.my_1data = []; $scope.doing_async = true; var data = { "idx": 0, "sum": 1000,inspectionType:{deleteFlag:0} }; api_bpm_data.fetchDataList('inspectionType', data).then(function(response) { var data = response.list; var objects = []; for (var i = 0; i < data.length; i++) { var object = {}; object.id = data[i].id; if (angular.isDefined(data[i].user)) { object.user = data[i].user||{}; } if (angular.isDefined(data[i].group)) { object.group = data[i].group||{}; } if (angular.isDefined(data[i].parent)) { object.parent = data[i].parent; } object.label = data[i].type; objects.push(object); } $scope.my_1data = convertParentToChildList(objects); $scope.tree_1data = angular.copy($scope.my_1data); $scope.doing_async = false; }); }; $scope.closethis = function(formdata) { formdata.category = ""; formdata.parent.category = ""; }; /* -----start submit incidet category----- */ $scope.userGroupChecked={};//选中人/组数据 $scope.submitchange = function(formdata1) { var formdata = angular.copy(formdata1); // if (formdata.hasArea) { // formdata.hasArea = 1; // formdata.hasPlace = 1; // } else { // formdata.hasArea = 0; // formdata.hasPlace = 0; // } if (formdata.hasPlace==true) { formdata.hasPlace = 1; } else { formdata.hasPlace = 0; } // } if (formdata.hasSimple == true) { formdata.hasSimple = 1; } else { formdata.hasSimple = 0; } // if ($scope.selectedTreeNode.parent) { // formdata.parent = { "id": $scope.selectedTreeNode.parent.id }; // } // console.log($scope.thisParent) if($scope.selectedChangeCategory){ formdata['parentCategory'] ={'id':$scope.selectedChangeCategory.id}; delete formdata.parent }else if($scope.thisParent){ formdata['parentCategory'] ={'id':$scope.thisParent.id}; delete formdata.parent } // console.log(formdata) // if($scope.userOrGroupType.type){ // formdata.userOrGroupType=$scope.userOrGroupType.type // } // if($scope.userGroupChecked&&$scope.userGroupChecked.groupCheck){ // formdata.group={id:$scope.userGroupChecked.groupCheck.id}; // // delete formdata.handleUser; // } // if($scope.userGroupChecked&&$scope.userGroupChecked.userCheck){ // formdata.handleUser={id:$scope.userGroupChecked.userCheck.id}; // // delete formdata.group; // } // ------------------------ start---------------------------- if($scope.subdata.branchType == 1){ delete formdata.handleUser; delete formdata.group; delete formdata.userOrGroupType; for (var i = 0; i < formdata.branchUserGroups.length; i++) { if(formdata.branchUserGroups[i].branchUserOrGroupType){ formdata.branchUserGroups[i].branchUserOrGroupType = Number(formdata.branchUserGroups[i].branchUserOrGroupType); } if(formdata.branchUserGroups[i].user && formdata.branchUserGroups[i].branchUserOrGroupType == 1){ formdata.branchUserGroups[i].userId=formdata.branchUserGroups[i].user.id; delete formdata.branchUserGroups[i].user; delete formdata.branchUserGroups[i].groupId; } if(formdata.branchUserGroups[i].group && formdata.branchUserGroups[i].branchUserOrGroupType == 2){ formdata.branchUserGroups[i].groupId=formdata.branchUserGroups[i].group.id; delete formdata.branchUserGroups[i].group; delete formdata.branchUserGroups[i].userId; } } }else if($scope.subdata.branchType == 0){ formdata.branchUserGroups = []; if($scope.userOrGroupType.type){ formdata.userOrGroupType=$scope.userOrGroupType.type } if($scope.userGroupChecked&&$scope.userGroupChecked.groupCheck){ formdata.group={id:$scope.userGroupChecked.groupCheck.id}; delete formdata.handleUser; } if($scope.userGroupChecked&&$scope.userGroupChecked.userCheck){ formdata.handleUser={id:$scope.userGroupChecked.userCheck.id}; delete formdata.group; } } // ------------------------ end---------------------------- if($scope.subdata.complexity){ formdata.complexity=$scope.subdata.complexity } if($scope.subdata.priority){ formdata.priority=$scope.subdata.priority } if($scope.subdata.managerUser){ formdata.managerUser=$scope.subdata.managerUser } var filedata = { "incidentcategory": formdata } filedata.incidentcategory.branchType = Number(filedata.incidentcategory.branchType); console.log(filedata,$scope.userGroupChecked); // return; api_bpm_data.updData('incidentcategory', filedata).then(function(response) { if (response) { if (response.status == 200) { $scope.try_async_load() SweetAlert.swal({ title: "修改成功!", type: "success" }, function() { $scope.$apply($scope.my_data); }) } else { SweetAlert.swal({ title: "修改失败!", type: "error" }) } } }); }; $scope.submit1change = function(formdata) { console.log($scope.output) if($scope.selectedChangeCategory){ formdata['parent'] ={'id':$scope.selectedChangeCategory.id}; }else if($scope.thisParent){ formdata['parent'] ={'id':$scope.thisParent.id}; } if($scope.group_user.offlineGroup&&$scope.group_user.offlineGroup.id){ formdata.group={id:$scope.group_user.offlineGroup.id}; } if($scope.group_user.onlineUser&&$scope.group_user.onlineUser.id){ formdata.user={id:$scope.group_user.onlineUser.id}; } // if($scope.userGroupChecked&&$scope.userGroupChecked.groupCheck){ // formdata.group={id:$scope.userGroupChecked.groupCheck.id}; // } // if($scope.userGroupChecked&&$scope.userGroupChecked.userCheck){ // formdata.handleUser={id:$scope.userGroupChecked.userCheck.id}; // } // if($scope.subdata.complexity){ // formdata.complexity=$scope.subdata.complexity // } // if($scope.subdata.priority){ // formdata.priority=$scope.subdata.priority // } // if($scope.subdata.managerUser){ // formdata.managerUser=$scope.subdata.managerUser // } var filedata = { "inspectionType": formdata } console.log(filedata,$scope.group_user); // return; api_bpm_data.updData('inspectionType', filedata).then(function(response) { if (response) { if (response.status == 200) { $scope.try_async_1load() SweetAlert.swal({ title: "修改成功!", type: "success" }, function() { $scope.$apply($scope.my_1data); }) } else { SweetAlert.swal({ title: "修改失败!", type: "error" }) } } }); }; $scope.adddata = {}; $scope.add1data = {}; $scope.addparent = false; // 新增保存提交 $scope.userGroupCheckedAdd={};//选中人/组数据 $scope.group_user_Add={};//选中人/组数据 $scope.userOrGroupTypeAdd={type:0};//运维组/运维人员 $scope.submitadd = function(formdata1) { var formdata = angular.copy(formdata1); console.log(formdata) // var paret = {}; // var filedata = {}; // filedata = angular.copy(formdata); // delete filedata.addp // if (angular.isDefined(formdata.parent) && addparent) { // angular.forEach($scope.parentdata, function(data) { // if (formdata.parent.category.id == data.id) { // filedata = { "incidentcategory": { "category": formdata.category, "parent": { "id": data.id } } } // } // }) // } else { // filedata = { "incidentcategory": { "category": formdata.category } } // } // filedata = { "incidentcategory": { "category": formdata.category, "parent": { "id": formdata.parentNode.id } } } // if (formdata.hasArea && formdata.hasArea == true) { // if (formdata.hasArea) { // formdata.hasArea = 1; // formdata.hasPlace = 1; // } else { // formdata.hasArea = 0; // formdata.hasPlace = 0; // } if (formdata.hasPlace == true) { formdata.hasPlace = 1; } else { formdata.hasPlace = 0; } if (formdata.hasSimple == true) { formdata.hasSimple = 1; } else { formdata.hasSimple = 0; } if (formdata.parent) { formdata['parentCategory'] = { "id": formdata.parent.id }; delete formdata.parent } if($scope.adddata.branchType == 1){ delete formdata.handleUser; delete formdata.group; delete formdata.userOrGroupType; for (var i = 0; i < formdata.branchUserGroups.length; i++) { if(formdata.branchUserGroups[i].branchUserOrGroupType){ formdata.branchUserGroups[i].branchUserOrGroupType = Number(formdata.branchUserGroups[i].branchUserOrGroupType); } if(formdata.branchUserGroups[i].user && formdata.branchUserGroups[i].branchUserOrGroupType == 1){ formdata.branchUserGroups[i].userId=formdata.branchUserGroups[i].user.id; delete formdata.branchUserGroups[i].user; delete formdata.branchUserGroups[i].groupId; } if(formdata.branchUserGroups[i].group && formdata.branchUserGroups[i].branchUserOrGroupType == 2){ formdata.branchUserGroups[i].groupId=formdata.branchUserGroups[i].group.id; delete formdata.branchUserGroups[i].group; delete formdata.branchUserGroups[i].userId; } } }else if($scope.adddata.branchType == 0){ formdata.branchUserGroups = []; if($scope.userOrGroupTypeAdd.type){ formdata.userOrGroupType=$scope.userOrGroupTypeAdd.type } if($scope.userGroupCheckedAdd&&$scope.userGroupCheckedAdd.groupCheck){ formdata.group={id:$scope.userGroupCheckedAdd.groupCheck.id}; delete formdata.handleUser; } if($scope.userGroupCheckedAdd&&$scope.userGroupCheckedAdd.userCheck){ formdata.handleUser={id:$scope.userGroupCheckedAdd.userCheck.id}; delete formdata.group; } } var filedata = { "incidentcategory": formdata } console.log(filedata); // return; api_bpm_data.addData('incidentcategory', filedata).then(function(response) { if (response) { if (response.status == 200) { $scope.userdata = []; $scope.outdata = []; $scope.try_async_load(); SweetAlert.swal({ title: "增加成功!", type: "success" }) } else if (response.status == 408) { SweetAlert.swal({ title: "增加失败!", text: response.error, type: "error" }) } else { SweetAlert.swal({ title: "增加失败!", type: "error" }) } } }); }; $scope.submit1add = function(formdata) {//lmm console.log(formdata) if($scope.group_user_Add&&$scope.group_user_Add.group&&$scope.group_user_Add.group.id){ formdata.group={id:$scope.group_user_Add.group.id}; } if($scope.group_user_Add&&$scope.group_user_Add.user&&$scope.group_user_Add.user.id){ formdata.user={id:$scope.group_user_Add.user.id}; } formdata.deleteFlag = 0; formdata.formUiName = 'inspection_LinHu_detail'; formdata.formUiEdit = 'inspection_LinHu_confirm'; formdata.processKey = 'bpm_inspection'; var filedata = { "inspectionType": formdata } console.log(filedata); // return; api_bpm_data.addData('inspectionType', filedata).then(function(response) { if (response) { if (response.status == 200) { $scope.userdata = []; $scope.outdata = []; $scope.try_async_1load(); SweetAlert.swal({ title: "增加成功!", type: "success" }) } else if (response.status == 408) { SweetAlert.swal({ title: "增加失败!", text: response.error, type: "error" }) } else { SweetAlert.swal({ title: "增加失败!", type: "error" }) } } }); }; /* -----end submit incidet category----- */ // $scope.try_async_load(); $scope.try_async_1load(); // $scope.ldloading={}; var filterData = { key: 'null', status: 0, pageIndex: 0, pageSum: 10, //treeIds:'[]', userId: loginUser.id } // 故障现象结束 // 事件紧急度开始 $scope.incident_emergencyData=[]; $scope.getIncident_emergency=function(){ var data={ "key":"incident_emergency", "type":"list" } api_wechatfile.getDictionary(data).then(function(res){ $scope.incident_emergencyData=res; }) } $scope.getIncident_emergency(); $scope.incident_emergencySave=function(){ for(var i=0;i<$scope.incident_emergencyData.length;i++){ api_sysinfo.addData('dictionary', $scope.incident_emergencyData[i]).then(function(res) { }) } SweetAlert.swal({ title: "保存成功!", type: "success", confirmButtonColor: "#007AFF" }); $timeout(function(){ $scope.getIncident_emergency(); },2000) } $scope.incident_emergencyReturn=function(){ $scope.incident_emergencyData[0].name="紧急"; $scope.incident_emergencyData[1].name="高"; $scope.incident_emergencyData[2].name="中"; $scope.incident_emergencyData[3].name="低"; for(var i=0;i<$scope.incident_emergencyData.length;i++){ api_sysinfo.addData('dictionary', $scope.incident_emergencyData[i]).then(function(res) { }) } SweetAlert.swal({ title: "恢复成功!", type: "success", confirmButtonColor: "#007AFF" }); $timeout(function(){ $scope.getIncident_emergency(); },2000) } // 事件紧急度结束 // 事件影响度开始 $scope.incident_influenceData=[]; $scope.getIncident_influence=function(){ var data={ "key":"incident_influence", "type":"list" } api_wechatfile.getDictionary(data).then(function(res){ $scope.incident_influenceData=res; }) } $scope.getIncident_influence(); $scope.incident_influenceSave=function(){ for(var i=0;i<$scope.incident_influenceData.length;i++){ api_sysinfo.addData('dictionary', $scope.incident_influenceData[i]).then(function(res) { }) } SweetAlert.swal({ title: "保存成功!", type: "success", confirmButtonColor: "#007AFF" }); $timeout(function(){ $scope.getIncident_influence(); },2000) } $scope.incident_influenceReturn=function(){ $scope.incident_influenceData[0].name="高"; $scope.incident_influenceData[1].name="中"; $scope.incident_influenceData[2].name="低"; for(var i=0;i<$scope.incident_influenceData.length;i++){ api_sysinfo.addData('dictionary', $scope.incident_influenceData[i]).then(function(res) { }) } SweetAlert.swal({ title: "恢复成功!", type: "success", confirmButtonColor: "#007AFF" }); $timeout(function(){ $scope.getIncident_influence(); },2000) } // 事件影响度结束 // 事件状态开始 $scope.incident_classificationData=[]; $scope.getIncident_classification=function(){ var data={ "key":"incident_status", "type":"list" } api_wechatfile.getDictionary(data).then(function(res){ $scope.incident_classificationData=res; }) } $scope.getIncident_classification(); $scope.incident_classificationSave=function(){ for(var i=0;i<$scope.incident_classificationData.length;i++){ api_sysinfo.addData('dictionary', $scope.incident_classificationData[i]).then(function(res) { }) } SweetAlert.swal({ title: "保存成功!", type: "success", confirmButtonColor: "#007AFF" }); $timeout(function(){ $scope.getIncident_classification(); },2000) } $scope.incident_classificationReturn=function(){ $scope.incident_classificationData[0].name="待接单"; $scope.incident_classificationData[1].name="处理中"; $scope.incident_classificationData[2].name="已解决"; $scope.incident_classificationData[3].name="已关闭"; $scope.incident_classificationData[4].name="暂存"; $scope.incident_classificationData[5].name="重新指派"; for(var i=0;i<$scope.incident_classificationData.length;i++){ api_sysinfo.addData('dictionary', $scope.incident_classificationData[i]).then(function(res) { }) } SweetAlert.swal({ title: "恢复成功!", type: "success", confirmButtonColor: "#007AFF" }); $timeout(function(){ $scope.getIncident_classification(); },2000) } // 事件状态结束 // 满意度评价开始 $scope.incident_evaluateData=[]; $scope.getIncident_evaluate=function(){ var data={ "key":"incident_degree", "type":"list" } api_wechatfile.getDictionary(data).then(function(res){ $scope.incident_evaluateData=res; }) } $scope.getIncident_evaluate(); $scope.incident_evaluateSave=function(){ for(var i=0;i<$scope.incident_evaluateData.length;i++){ api_sysinfo.addData('dictionary', $scope.incident_evaluateData[i]).then(function(res) { }) } SweetAlert.swal({ title: "保存成功!", type: "success", confirmButtonColor: "#007AFF" }); $timeout(function(){ $scope.getIncident_evaluate(); },2000) } $scope.incident_evaluateReturn=function(){ $scope.incident_evaluateData[0].name="非常满意"; $scope.incident_evaluateData[1].name="较满意"; $scope.incident_evaluateData[2].name="满意"; $scope.incident_evaluateData[3].name="一般"; $scope.incident_evaluateData[4].name="不满意"; for(var i=0;i<$scope.incident_evaluateData.length;i++){ api_sysinfo.addData('dictionary', $scope.incident_evaluateData[i]).then(function(res) { }) } SweetAlert.swal({ title: "恢复成功!", type: "success", confirmButtonColor: "#007AFF" }); $timeout(function(){ $scope.getIncident_evaluate(); },2000) } // 满意度评价结束 // 结果类型开始 $scope.incident_resultData=[]; $scope.getIncident_result=function(){ var data={ "key":"incident_handleresult", "type":"list" } api_wechatfile.getDictionary(data).then(function(res){ $scope.incident_resultData=res; }) } $scope.getIncident_result(); $scope.incident_resultSave=function(){ for(var i=0;i<$scope.incident_resultData.length;i++){ api_sysinfo.addData('dictionary', $scope.incident_resultData[i]).then(function(res) { }) } SweetAlert.swal({ title: "保存成功!", type: "success", confirmButtonColor: "#007AFF" }); $timeout(function(){ $scope.getIncident_result(); },2000) } $scope.incident_resultReturn=function(){ $scope.incident_resultData[0].name="全部解决"; $scope.incident_resultData[1].name="部分解决"; $scope.incident_resultData[2].name="未解决"; $scope.incident_resultData[3].name="其它"; for(var i=0;i<$scope.incident_resultData.length;i++){ api_sysinfo.addData('dictionary', $scope.incident_resultData[i]).then(function(res) { }) } SweetAlert.swal({ title: "恢复成功!", type: "success", confirmButtonColor: "#007AFF" }); $timeout(function(){ $scope.getIncident_result(); },2000) } // 结果类型结束 // 事件优先级开始 $scope.incident_priorityData=[]; $scope.getIncident_priority=function(){ var data={ "key":"incident_priority", "type":"list" } api_wechatfile.getDictionary(data).then(function(res){ $scope.incident_priorityData=res; }) } $scope.getIncident_priority(); $scope.incident_prioritySave=function(){ for(var i=0;i<$scope.incident_priorityData.length;i++){ api_sysinfo.addData('dictionary', $scope.incident_priorityData[i]).then(function(res) { }) } SweetAlert.swal({ title: "保存成功!", type: "success", confirmButtonColor: "#007AFF" }); $timeout(function(){ $scope.getIncident_priority(); },2000) } $scope.incident_priorityReturn=function(){ $scope.incident_priorityData[0].name="重大"; $scope.incident_priorityData[1].name="高"; $scope.incident_priorityData[2].name="较高"; $scope.incident_priorityData[3].name="普通"; for(var i=0;i<$scope.incident_priorityData.length;i++){ api_sysinfo.addData('dictionary', $scope.incident_priorityData[i]).then(function(res) { }) } SweetAlert.swal({ title: "恢复成功!", type: "success", confirmButtonColor: "#007AFF" }); $timeout(function(){ $scope.getIncident_priority(); },2000) } // 事件优先级结束 // 事件工时开始 $scope.incident_complexityData=[]; $scope.getIncident_complexity=function(){ var data={ "key":"incident_complexity", "type":"list" } api_wechatfile.getDictionary(data).then(function(res){ $scope.incident_complexityData=res; }) } $scope.getIncident_complexity(); $scope.incident_complexitySave=function(){ for(var i=0;i<$scope.incident_complexityData.length;i++){ api_sysinfo.addData('dictionary', $scope.incident_complexityData[i]).then(function(res) { }) } SweetAlert.swal({ title: "保存成功!", type: "success", confirmButtonColor: "#007AFF" }); $timeout(function(){ $scope.getIncident_complexity(); },2000) } // 没有恢复默认 // $scope.incident_complexityReturn=function(){ // $scope.incident_complexityData[0].name="重大"; // $scope.incident_complexityData[1].name="高"; // $scope.incident_complexityData[2].name="较高"; // $scope.incident_complexityData[3].name="普通"; // for(var i=0;i<$scope.incident_complexityData.length;i++){ // api_sysinfo.addData('dictionary', $scope.incident_complexityData[i]).then(function(res) { // }) // } // SweetAlert.swal({ // title: "恢复成功!", // type: "success", // confirmButtonColor: "#007AFF" // }); // $timeout(function(){ // $scope.getIncident_complexity(); // },2000) // } // 事件工时结束 // 服务级别协议开始 $scope.incident_SLA_Data=[]; $scope.getIncident_SLA=function(){ var data={ "idx":0, "sum":10 }; jry_api_bpm.jry_getFetchDataList(data,"servicelevelagreement").then(function(res){ $scope.incident_SLA_Data=res.list }) }; $scope.getIncident_SLA(); $scope.incident_SLASave=function(){ for(var i=0;i<$scope.incident_SLA_Data.length;i++){ $scope.incident_SLA_Data[i].availabilityDate=$scope.incident_SLA_Data[i].availabilityDate+" 08:00:00"; $scope.incident_SLA_Data[i].terminationDate=$scope.incident_SLA_Data[i].terminationDate+" 08:00:00"; var data={ "servicelevelagreement":$scope.incident_SLA_Data[i] } jry_api_bpm.jry_editFn(data,"servicelevelagreement").then(function(){ }) SweetAlert.swal({ title: "保存成功!", type: "success", confirmButtonColor: "#007AFF" }); $timeout(function(){ $scope.getIncident_SLA(); },2000) } } $scope.incident_SLAReturn=function(){ $scope.incident_SLA_Data[0].resolveTime=450; $scope.incident_SLA_Data[1].resolveTime=480; $scope.incident_SLA_Data[2].resolveTime=480; $scope.incident_SLA_Data[3].resolveTime=960; $scope.incident_SLA_Data[0].responseTime=30; $scope.incident_SLA_Data[1].responseTime=45; $scope.incident_SLA_Data[2].responseTime=60; $scope.incident_SLA_Data[3].responseTime=240; for(var i=0;i<$scope.incident_SLA_Data.length;i++){ $scope.incident_SLA_Data[i].availabilityDate=$scope.incident_SLA_Data[i].availabilityDate+" 08:00:00"; $scope.incident_SLA_Data[i].terminationDate=$scope.incident_SLA_Data[i].terminationDate+" 08:00:00"; var data={ "servicelevelagreement":$scope.incident_SLA_Data[i] } jry_api_bpm.jry_editFn(data,"servicelevelagreement").then(function(){ }) SweetAlert.swal({ title: "保存成功!", type: "success", confirmButtonColor: "#007AFF" }); $timeout(function(){ $scope.getIncident_SLA(); },2000) } } // 服务级别协议结束 // 事件来源开始 $scope.incident_sourceData=[]; $scope.getIncident_source=function(){ var data={ "key":"incident_source", "type":"list" } api_wechatfile.getDictionary(data).then(function(res){ $scope.incident_sourceData=res; }) } $scope.getIncident_source(); $scope.incident_sourceSave=function(){ for(var i=0;i<$scope.incident_sourceData.length;i++){ api_sysinfo.addData('dictionary', $scope.incident_sourceData[i]).then(function(res) { }) } SweetAlert.swal({ title: "保存成功!", type: "success", confirmButtonColor: "#007AFF" }); $timeout(function(){ $scope.getIncident_source(); },2000) } $scope.incident_sourceReturn=function(){ $scope.incident_sourceData[0].name="电话"; $scope.incident_sourceData[1].name="留言"; $scope.incident_sourceData[2].name="微信/web"; $scope.incident_sourceData[3].name="主动发现"; $scope.incident_sourceData[4].name="领导指派"; $scope.incident_sourceData[5].name="其他"; $scope.incident_sourceData[0].value="phone"; $scope.incident_sourceData[1].value="record"; $scope.incident_sourceData[2].value="im"; $scope.incident_sourceData[3].value="discover"; $scope.incident_sourceData[4].value="leader"; $scope.incident_sourceData[5].value="other"; for(var i=0;i<$scope.incident_sourceData.length;i++){ api_sysinfo.addData('dictionary', $scope.incident_sourceData[i]).then(function(res) { }) } SweetAlert.swal({ title: "恢复成功!", type: "success", confirmButtonColor: "#007AFF" }); $timeout(function(){ $scope.getIncident_source(); },2000) } // 事件来源结束 // 关闭代码开始 $scope.incident_closecodeData=[]; $scope.getIncident_closecode=function(){ var data={ "key":"incident_closecode", "type":"list" } api_wechatfile.getDictionary(data).then(function(res){ $scope.incident_closecodeData=res; }) } $scope.getIncident_closecode(); $scope.incident_closecodeSave=function(){ for(var i=0;i<$scope.incident_closecodeData.length;i++){ api_sysinfo.addData('dictionary', $scope.incident_closecodeData[i]).then(function(res) { }) } SweetAlert.swal({ title: "保存成功!", type: "success", confirmButtonColor: "#007AFF" }); $timeout(function(){ $scope.getIncident_closecode(); },2000) } $scope.incident_closecodeReturn=function(){ $scope.incident_closecodeData[0].value="060"; $scope.incident_closecodeData[1].value="061"; $scope.incident_closecodeData[2].value="062"; $scope.incident_closecodeData[3].value="063"; $scope.incident_closecodeData[4].value="064"; $scope.incident_closecodeData[5].value="065"; $scope.incident_closecodeData[0].desc="事件已经完全解决"; $scope.incident_closecodeData[1].desc="事件未能完全解决"; $scope.incident_closecodeData[2].desc="由服务提供商对事件进行处理"; $scope.incident_closecodeData[3].desc="事件自行消失"; $scope.incident_closecodeData[4].desc="事件请求不在服务范围内"; $scope.incident_closecodeData[5].desc="通过问题或变更流程处理"; $scope.incident_closecodeData[0].desc="完全解决"; $scope.incident_closecodeData[1].desc="临时解决"; $scope.incident_closecodeData[2].desc="供应商解决"; $scope.incident_closecodeData[3].desc="事件消失"; $scope.incident_closecodeData[4].desc="拒绝"; $scope.incident_closecodeData[5].desc="进入其他流程处理"; for(var i=0;i<$scope.incident_closecodeData.length;i++){ api_sysinfo.addData('dictionary', $scope.incident_closecodeData[i]).then(function(res) { }) } SweetAlert.swal({ title: "恢复成功!", type: "success", confirmButtonColor: "#007AFF" }); $timeout(function(){ $scope.getIncident_closecode(); },2000) } // 关闭代码结束 // 优先级规则开始 $scope.incident_prioritymatrixAdd=function(){ var modalInstance = $modal.open({ templateUrl: 'assets/views/system/tpl/systemprioritymatrix.html', controller: function($scope, $modalInstance, api_bpm_data) { $scope.prioritymatrixdata={}; var prioritymatrixInfluenceData={ "key":"incident_influence", "type":"list" } $scope.prioritymatrixInfluenceData=[]; api_wechatfile.getDictionary(prioritymatrixInfluenceData).then(function(res){ $scope.prioritymatrixInfluenceData=res; }) var prioritymatrixEmergencyData={ "key":"incident_emergency", "type":"list" } $scope.prioritymatrixEmergencyData=[]; api_wechatfile.getDictionary(prioritymatrixEmergencyData).then(function(res){ $scope.prioritymatrixEmergencyData=res; }) var prioritymatrixPriorityData={ "key":"incident_priority", "type":"list" } $scope.prioritymatrixPriorityData=[]; api_wechatfile.getDictionary(prioritymatrixPriorityData).then(function(res){ $scope.prioritymatrixPriorityData=res; }) $scope.cancel = function() { $modalInstance.dismiss('cancel'); }; $scope.savercode = function(prioritymatrixdata) { $modalInstance.close(prioritymatrixdata); }; } }); modalInstance.result.then(function(selectedItem) { // console.log('selectedItem='+JSON.stringify(selectedItem)); if (selectedItem) { console.log(selectedItem); var fildata = { "prioritymatrix": { "priority": { "id": selectedItem.priority.id }, "emergency": { "id": selectedItem.emergency.id }, "influence": { "id": selectedItem.influence.id } } } api_bpm_data.addData('prioritymatrix', fildata).then(function(response) { if (response) { if (response.status == 200) { SweetAlert.swal({ title: "新增成功!", type: "success" }, function() { $scope.getPrioritymatrix() }) } else { SweetAlert.swal({ title: "新增失败!", text: "已有此类优先级规则!", type: "error" }) } } }) } }); } $scope.prioritymatrixData=[]; $scope.getPrioritymatrix=function(){ var data={ "idx":0, "sum":999 } api_statistic.tableData(data,"prioritymatrix").then(function(res){ $scope.prioritymatrixData=res.list }) } $scope.incident_prioritymatrixSave=function(){ SweetAlert.swal({ title: "修改成功!", type: "success" }) for(var i=0;i<$scope.prioritymatrixData.length;i++){ api_bpm.updData("prioritymatrix",{"prioritymatrix":$scope.prioritymatrixData[i]}).then(function(res){ if(res.status!=200){ SweetAlert.swal({ title: "修改失败!", text: "已有此类优先级规则,或者规则不合理!", type: "error" }) } }) } $timeout(function(){ $scope.getPrioritymatrix() },2000) } $scope.removePrioritymatrix=function(data){ SweetAlert.swal({ title: "确认删除?", text: "删除的数据不可恢复,请确认继续操作!", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "继续删除", cancelButtonText: "取消操作", closeOnConfirm: false, closeOnCancel: false }, function (isConfirm) { if (isConfirm) { api_bpm_data.rmvData("prioritymatrix",[data.id]).then(function(res){ console.log(res); if(res.status==200){ SweetAlert.swal({ title: "删除成功!", type: "success", confirmButtonColor: "#007AFF" }, function() { $scope.getPrioritymatrix() }); }else{ SweetAlert.swal({ title: "删除失败", text: "系统错误,请稍后重试!", type: "error", confirmButtonColor: "#DD6B55" }); } }) } else { SweetAlert.swal("操作取消", "数据安全", "error"); } }); } $scope.getPrioritymatrix() // 优先级规则结束 // 维修记录开始 $scope.incident_prioritymatrixAdd=function(){ var modalInstance = $modal.open({ templateUrl: 'assets/views/system/tpl/systemprocessingLog.html', controller: function($scope, $modalInstance, api_bpm_data) { $scope.processingLogdata={description:''}; $scope.cancel = function() { $modalInstance.dismiss('cancel'); }; $scope.savercode = function(processingLogdata) { $modalInstance.close(processingLogdata); }; } }); modalInstance.result.then(function(selectedItem) { console.log(selectedItem); if (selectedItem.description.trim()) { console.log(selectedItem); var fildata = { "dictionary": { key:'processingLog',name:1,value:selectedItem.description.trim(),deleted:false,system:0 } } api_bpm_data.addData('dictionary', fildata).then(function(response) { $scope.getProcessingLogList() if (response) { if (response.status == 200 && response.data.value) { SweetAlert.swal({ title: "新增成功!", type: "success" }) } else { SweetAlert.swal({ title: "新增失败!", text: "内容重复!", type: "error" }) } } }) }else{ SweetAlert.swal({ title: "新增失败!", text: "请填写内容!", type: "error" }) } }); } $scope.processingLogList=[]; $scope.getProcessingLogList=function(){ var data={ "idx":0, "sum":999, dictionary:{key:'processingLog'} } api_statistic.tableData(data,"dictionary").then(function(res){ $scope.processingLogList=res.list }) } $scope.incident_processingLogListSave=function(){ var n = 0; for(var i=0;i<$scope.processingLogList.length;i++){ n++; api_bpm.updData("dictionary",{"dictionary":$scope.processingLogList[i]}).then(function(res){ if(res.status==200 && res.data.value){ if(--n == 0){ SweetAlert.swal({ title: "修改成功!", type: "success" }) $scope.getProcessingLogList() } }else{ SweetAlert.swal({ title: "修改失败!", text: "内容重复!", type: "error" }) } }) } // $timeout(function(){ // $scope.getProcessingLogList() // },2000) } $scope.removePrioritymatrix=function(data){ SweetAlert.swal({ title: "确认删除?", text: "删除的数据不可恢复,请确认继续操作!", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "继续删除", cancelButtonText: "取消操作", closeOnConfirm: false, closeOnCancel: false }, function (isConfirm) { if (isConfirm) { api_bpm_data.rmvData("dictionary",[data.id]).then(function(res){ console.log(res); $scope.getProcessingLogList(); if(res.status==200){ SweetAlert.swal({ title: "删除成功!", type: "success", confirmButtonColor: "#007AFF" }); }else{ SweetAlert.swal({ title: "删除失败", text: "系统错误,请稍后重试!", type: "error", confirmButtonColor: "#DD6B55" }); } }) } else { SweetAlert.swal("操作取消", "数据安全", "error"); } }); } $scope.getProcessingLogList() // 维修记录结束 // 维修方式开始 $scope.incident_maintenanceModeAdd=function(){ var modalInstance = $modal.open({ templateUrl: 'assets/views/system/tpl/systemmaintenanceMode.html', controller: function($scope, $modalInstance, api_bpm_data) { $scope.processingLogdata={description:''}; $scope.cancel = function() { $modalInstance.dismiss('cancel'); }; $scope.savercode = function(processingLogdata) { $modalInstance.close(processingLogdata); }; } }); modalInstance.result.then(function(selectedItem) { console.log(selectedItem); if (selectedItem.description.trim()) { console.log(selectedItem); var fildata = { "dictionary": { key:'repair_type',name:selectedItem.description.trim(),value:new Date().getTime().toString(36),deleted:false,system:0 } } api_bpm_data.addData('dictionary', fildata).then(function(response) { $scope.getMaintenanceModList() if (response) { if (response.status == 200 && response.data.value) { SweetAlert.swal({ title: "新增成功!", type: "success" }) } else { SweetAlert.swal({ title: "新增失败!", text: "内容重复!", type: "error" }) } } }) }else{ SweetAlert.swal({ title: "新增失败!", text: "请填写内容!", type: "error" }) } }); } $scope.maintenanceModList=[]; $scope.getMaintenanceModList=function(){ var data={ "idx":0, "sum":999, dictionary:{key:'repair_type'} } api_statistic.tableData(data,"dictionary").then(function(res){ $scope.maintenanceModList=res.list }) } $scope.incident_maintenanceModeListSave=function(){ var n = 0; for(var i=0;i<$scope.maintenanceModList.length;i++){ n++; api_bpm.updData("dictionary",{"dictionary":$scope.maintenanceModList[i]}).then(function(res){ if(res.status==200 && res.data.value){ if(--n == 0){ SweetAlert.swal({ title: "修改成功!", type: "success" }) $scope.getMaintenanceModList() } }else{ SweetAlert.swal({ title: "修改失败!", text: "内容重复!", type: "error" }) } }) } } $scope.removeMaintenanceMode=function(data){ SweetAlert.swal({ title: "确认删除?", text: "删除的数据不可恢复,请确认继续操作!", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "继续删除", cancelButtonText: "取消操作", closeOnConfirm: false, closeOnCancel: false }, function (isConfirm) { if (isConfirm) { api_bpm_data.rmvData("dictionary",[data.id]).then(function(res){ console.log(res); $scope.getMaintenanceModList(); if(res.status==200){ SweetAlert.swal({ title: "删除成功!", type: "success", confirmButtonColor: "#007AFF" }); }else{ SweetAlert.swal({ title: "删除失败", text: "系统错误,请稍后重试!", type: "error", confirmButtonColor: "#DD6B55" }); } }) } else { SweetAlert.swal("操作取消", "数据安全", "error"); } }); } $scope.getMaintenanceModList() // 维修方式结束 // 获取组数据 $scope.getGroupList=function(){ var postData={ idx: 0, sum: 1000, group: {selectType: "nouser"} } api_user_data.fetchDataList('group',postData).then(res=>{ $scope.groupList=res.list; }) } $scope.getGroupList() // 获取人数据 $scope.getUserList=function(){ var postData={ idx: 0, sum: 1000, user: { roledata: {rolecode: "first-line support"}, name:'', selectType: "pinyin_qs", engineer: 1, } } api_user_data.fetchDataList('user',postData).then(res=>{ $scope.userList=res.list; }) } $scope.getUserList() // 获取故障现象人员 $scope.getUserList1=function(){ var postData={ idx: 0, sum: 1000, user: { name:'', selectType: "pinyin_qs", roledata:{ rolecode:'incident-category-manager' }, engineer: 1, } } api_user_data.fetchDataList('user',postData).then(res=>{ $scope.userList1=res.list; }) } $scope.getUserList1() }]);