|
@@ -21916,6 +21916,9 @@ appFormly.controller("CustomformCtrl", [
|
21916
|
21916
|
} else {
|
21917
|
21917
|
console.log($scope.formData.url, "zzzz");
|
21918
|
21918
|
var integralMechanism = sessionStorage.getItem('integralMechanism');
|
|
21919
|
+ let integralRoles = [];
|
|
21920
|
+ let currentUserRoles = [];
|
|
21921
|
+ let intersection = [];
|
21919
|
21922
|
switch ($scope.formData.url) {
|
21920
|
21923
|
case "start":
|
21921
|
21924
|
vm.model["initUser"] = $rootScope.user.id;
|
|
@@ -21998,13 +22001,21 @@ appFormly.controller("CustomformCtrl", [
|
21998
|
22001
|
}
|
21999
|
22002
|
// --------------------------- start----------------------------------------
|
22000
|
22003
|
// 积分机制,直接处理
|
22001
|
|
- if(vm.model.start_code == "close"&&(integralMechanism == 1 || (integralMechanism == 2 && $rootScope.user.userType.value == 2))){
|
|
22004
|
+ // let integralRoles = [];
|
|
22005
|
+ // let currentUserRoles = [];
|
|
22006
|
+ // let intersection = [];
|
|
22007
|
+ if(integralMechanism == 1){
|
|
22008
|
+ integralRoles = sessionStorage.getItem("integralRole") ? sessionStorage.getItem("integralRole").split(',') : [];
|
|
22009
|
+ currentUserRoles = $rootScope.user.role ? $rootScope.user.role.map(v=>String(v.id)) : [];
|
|
22010
|
+ intersection = integralRoles.filter(function (val) { return currentUserRoles.indexOf(val) > -1 })
|
|
22011
|
+ }
|
|
22012
|
+ if(vm.model.start_code == "close"&&((integralMechanism == 1 && intersection.length) || (integralMechanism == 2 && $rootScope.user.userType.value == 2))){
|
22002
|
22013
|
$modal.open({
|
22003
|
22014
|
templateUrl: 'assets/views/incident/tpl/toIntegralMechanism.tpl.html',
|
22004
|
22015
|
controller: function ($scope, $modalInstance, api_bpm_domain, incidentData, currentUserId, Alert, api_user_data,api_wechatfile,scope,api_bpm_data) {
|
22005
|
22016
|
console.log(incidentData,currentUserId);
|
22006
|
22017
|
$scope.flag = false;
|
22007
|
|
- $scope.complexityConfirm = {complexity:null,updateReason:''};
|
|
22018
|
+ $scope.complexityConfirm = {complexity:null,updateReason:'', auditor: undefined};
|
22008
|
22019
|
$scope.complexityFn = function(category){
|
22009
|
22020
|
if(category.complexity){
|
22010
|
22021
|
return category.complexity.value;
|
|
@@ -22026,6 +22037,25 @@ appFormly.controller("CustomformCtrl", [
|
22026
|
22037
|
})
|
22027
|
22038
|
}
|
22028
|
22039
|
})
|
|
22040
|
+ $scope.onChangehandling = function(key = ''){
|
|
22041
|
+ api_user_data.fetchDataList('user', {
|
|
22042
|
+ "idx": 0,
|
|
22043
|
+ "sum": 9999,
|
|
22044
|
+ "user": {
|
|
22045
|
+ "name": key,
|
|
22046
|
+ 'selectType': "pinyin_qs",
|
|
22047
|
+ "roledata": { rolecode: "incident manager" }
|
|
22048
|
+ }
|
|
22049
|
+ }).then(function(response) {
|
|
22050
|
+ if (response) {
|
|
22051
|
+ if (response.status = 200) {
|
|
22052
|
+ $scope.auditors = response.list;
|
|
22053
|
+ }
|
|
22054
|
+ }
|
|
22055
|
+ })
|
|
22056
|
+ }
|
|
22057
|
+ $scope.auditors = [];
|
|
22058
|
+ $scope.onChangehandling();
|
22029
|
22059
|
$scope.onChangeComplexity = function(item){
|
22030
|
22060
|
|
22031
|
22061
|
}
|
|
@@ -22038,6 +22068,14 @@ appFormly.controller("CustomformCtrl", [
|
22038
|
22068
|
});
|
22039
|
22069
|
return;
|
22040
|
22070
|
}
|
|
22071
|
+ if (!$scope.complexityConfirm.auditor){
|
|
22072
|
+ Alert.swal({
|
|
22073
|
+ title: "操作失败",
|
|
22074
|
+ text: "请选择审核人!",
|
|
22075
|
+ type: "error"
|
|
22076
|
+ });
|
|
22077
|
+ return;
|
|
22078
|
+ }
|
22041
|
22079
|
if ($scope.complexityConfirm.complexity.value != $scope.complexity&&!$scope.complexityConfirm.updateReason.trim()){
|
22042
|
22080
|
Alert.swal({
|
22043
|
22081
|
title: "操作失败",
|
|
@@ -22122,7 +22160,15 @@ appFormly.controller("CustomformCtrl", [
|
22122
|
22160
|
}
|
22123
|
22161
|
}
|
22124
|
22162
|
}
|
22125
|
|
- if(vm.model.start_code == "close"&&(integralMechanism == 1 || (integralMechanism == 2 && $rootScope.user.userType.value == 2))){
|
|
22163
|
+ let integralRoles = [];
|
|
22164
|
+ let currentUserRoles = [];
|
|
22165
|
+ let intersection = [];
|
|
22166
|
+ if(integralMechanism == 1){
|
|
22167
|
+ integralRoles = sessionStorage.getItem("integralRole") ? sessionStorage.getItem("integralRole").split(',') : [];
|
|
22168
|
+ currentUserRoles = $rootScope.user.role ? $rootScope.user.role.map(v=>String(v.id)) : [];
|
|
22169
|
+ intersection = integralRoles.filter(function (val) { return currentUserRoles.indexOf(val) > -1 })
|
|
22170
|
+ }
|
|
22171
|
+ if(vm.model.start_code == "close"&&((integralMechanism == 1 && intersection.length) || (integralMechanism == 2 && $rootScope.user.userType.value == 2))){
|
22126
|
22172
|
api_wechatfile.getDictionary({"key":"incident_integral_state","type":"list"}).then(function(res){
|
22127
|
22173
|
var auditState = res.find(v=>v.value == 0);
|
22128
|
22174
|
var postData = {
|
|
@@ -22134,6 +22180,7 @@ appFormly.controller("CustomformCtrl", [
|
22134
|
22180
|
sourceScore:$scope.complexity,
|
22135
|
22181
|
currentScore:$scope.complexityConfirm.complexity.value,
|
22136
|
22182
|
updateReason:$scope.complexityConfirm.updateReason.trim() || undefined,
|
|
22183
|
+ auditUser: $scope.complexityConfirm.auditor.id
|
22137
|
22184
|
}
|
22138
|
22185
|
}
|
22139
|
22186
|
console.log(postData)
|
|
@@ -22222,13 +22269,21 @@ appFormly.controller("CustomformCtrl", [
|
22222
|
22269
|
}
|
22223
|
22270
|
console.log(vm);
|
22224
|
22271
|
// 积分机制,事件状态是“处理中”
|
22225
|
|
- if($scope.formData.name === 'handlerform'&&(integralMechanism == 1 || (integralMechanism == 2 && $rootScope.user.userType.value == 2))){
|
|
22272
|
+ // let integralRoles = [];
|
|
22273
|
+ // let currentUserRoles = [];
|
|
22274
|
+ // let intersection = [];
|
|
22275
|
+ if(integralMechanism == 1){
|
|
22276
|
+ integralRoles = sessionStorage.getItem("integralRole") ? sessionStorage.getItem("integralRole").split(',') : [];
|
|
22277
|
+ currentUserRoles = $rootScope.user.role ? $rootScope.user.role.map(v=>String(v.id)) : [];
|
|
22278
|
+ intersection = integralRoles.filter(function (val) { return currentUserRoles.indexOf(val) > -1 })
|
|
22279
|
+ }
|
|
22280
|
+ if($scope.formData.name === 'handlerform'&&((integralMechanism == 1 && intersection.length) || (integralMechanism == 2 && $rootScope.user.userType.value == 2))){
|
22226
|
22281
|
$modal.open({
|
22227
|
22282
|
templateUrl: 'assets/views/incident/tpl/toIntegralMechanism.tpl.html',
|
22228
|
22283
|
controller: function ($scope, $modalInstance, api_bpm_domain, incidentData, currentUserId, Alert, api_user_data,api_wechatfile,scope,api_bpm_data) {
|
22229
|
22284
|
console.log(incidentData,currentUserId);
|
22230
|
22285
|
$scope.flag = true;
|
22231
|
|
- $scope.complexityConfirm = {complexity:null,updateReason:''};
|
|
22286
|
+ $scope.complexityConfirm = {complexity:null,updateReason:'', auditor: undefined};
|
22232
|
22287
|
$scope.complexityFn = function(category){
|
22233
|
22288
|
if(category.complexity){
|
22234
|
22289
|
return category.complexity.value;
|
|
@@ -22250,6 +22305,25 @@ appFormly.controller("CustomformCtrl", [
|
22250
|
22305
|
})
|
22251
|
22306
|
}
|
22252
|
22307
|
})
|
|
22308
|
+ $scope.onChangehandling = function(key = ''){
|
|
22309
|
+ api_user_data.fetchDataList('user', {
|
|
22310
|
+ "idx": 0,
|
|
22311
|
+ "sum": 9999,
|
|
22312
|
+ "user": {
|
|
22313
|
+ "name": key,
|
|
22314
|
+ 'selectType': "pinyin_qs",
|
|
22315
|
+ "roledata": { rolecode: "incident manager" }
|
|
22316
|
+ }
|
|
22317
|
+ }).then(function(response) {
|
|
22318
|
+ if (response) {
|
|
22319
|
+ if (response.status = 200) {
|
|
22320
|
+ $scope.auditors = response.list;
|
|
22321
|
+ }
|
|
22322
|
+ }
|
|
22323
|
+ })
|
|
22324
|
+ }
|
|
22325
|
+ $scope.auditors = [];
|
|
22326
|
+ $scope.onChangehandling();
|
22253
|
22327
|
$scope.onChangeComplexity = function(item){
|
22254
|
22328
|
if($scope.complexityConfirm.complexity.value == $scope.complexity){
|
22255
|
22329
|
$scope.complexityConfirm.updateReason = '';
|
|
@@ -22264,6 +22338,14 @@ appFormly.controller("CustomformCtrl", [
|
22264
|
22338
|
});
|
22265
|
22339
|
return;
|
22266
|
22340
|
}
|
|
22341
|
+ if (!$scope.complexityConfirm.auditor){
|
|
22342
|
+ Alert.swal({
|
|
22343
|
+ title: "操作失败",
|
|
22344
|
+ text: "请选择审核人!",
|
|
22345
|
+ type: "error"
|
|
22346
|
+ });
|
|
22347
|
+ return;
|
|
22348
|
+ }
|
22267
|
22349
|
if ($scope.complexityConfirm.complexity.value != $scope.complexity&&!$scope.complexityConfirm.updateReason.trim()){
|
22268
|
22350
|
Alert.swal({
|
22269
|
22351
|
title: "操作失败",
|
|
@@ -22284,6 +22366,7 @@ appFormly.controller("CustomformCtrl", [
|
22284
|
22366
|
sourceScore:$scope.complexity,
|
22285
|
22367
|
currentScore:$scope.complexityConfirm.complexity.value,
|
22286
|
22368
|
updateReason:$scope.complexityConfirm.updateReason.trim() || undefined,
|
|
22369
|
+ auditUser: $scope.complexityConfirm.auditor.id
|
22287
|
22370
|
}
|
22288
|
22371
|
}
|
22289
|
22372
|
console.log(postData)
|