|
@@ -212,13 +212,21 @@ app.controller('woketimeCtrl', ["$rootScope", "$scope", "$state", "$timeout", "$
|
212
|
212
|
api_bpm_data.updData('scheduleclass', fildata).then(function(response) {
|
213
|
213
|
if (response) {
|
214
|
214
|
if (response.status == 200) {
|
215
|
|
- SweetAlert.swal({
|
216
|
|
- title: "修改成功!",
|
217
|
|
- type: "success"
|
218
|
|
- }, function() {
|
219
|
|
- scope.refreshData('expand-right');
|
220
|
|
- $modalInstance.close();
|
221
|
|
- })
|
|
215
|
+ if(response.data && !response.data.priority && !response.data.type){
|
|
216
|
+ SweetAlert.swal({
|
|
217
|
+ title: "操作异常!",
|
|
218
|
+ text: "优先级重复!",
|
|
219
|
+ type: "error"
|
|
220
|
+ });
|
|
221
|
+ }else{
|
|
222
|
+ SweetAlert.swal({
|
|
223
|
+ title: "修改成功!",
|
|
224
|
+ type: "success"
|
|
225
|
+ }, function() {
|
|
226
|
+ scope.refreshData('expand-right');
|
|
227
|
+ $modalInstance.close();
|
|
228
|
+ })
|
|
229
|
+ }
|
222
|
230
|
} else {
|
223
|
231
|
SweetAlert.swal({
|
224
|
232
|
title: "修改失败!",
|
|
@@ -347,12 +355,20 @@ app.controller('woketimeCtrl', ["$rootScope", "$scope", "$state", "$timeout", "$
|
347
|
355
|
var fildata = selectedItem
|
348
|
356
|
api_bpm_data.addData('scheduleclass', fildata).then(function(response) {
|
349
|
357
|
if (response.status == 200) {
|
350
|
|
- SweetAlert.swal({
|
351
|
|
- title: "新增成功!",
|
352
|
|
- type: "success"
|
353
|
|
- }, function() {
|
354
|
|
- $scope.refreshData('expand-right', defaultFilterData);
|
355
|
|
- })
|
|
358
|
+ if(response.data && !response.data.priority && !response.data.type){
|
|
359
|
+ SweetAlert.swal({
|
|
360
|
+ title: "操作异常!",
|
|
361
|
+ text: "优先级重复!",
|
|
362
|
+ type: "error"
|
|
363
|
+ });
|
|
364
|
+ }else{
|
|
365
|
+ SweetAlert.swal({
|
|
366
|
+ title: "新增成功!",
|
|
367
|
+ type: "success"
|
|
368
|
+ }, function() {
|
|
369
|
+ $scope.refreshData('expand-right', defaultFilterData);
|
|
370
|
+ })
|
|
371
|
+ }
|
356
|
372
|
} else {
|
357
|
373
|
SweetAlert.swal({
|
358
|
374
|
title: "新增失败!",
|
|
@@ -391,19 +407,28 @@ app.controller('woketimeCtrl', ["$rootScope", "$scope", "$state", "$timeout", "$
|
391
|
407
|
if (selectedItem.length > 0) {
|
392
|
408
|
api_bpm_data.rmvData('scheduleclass', selectedItem).then(function(response) {
|
393
|
409
|
if (response.status == 200) {
|
394
|
|
- SweetAlert.swal({
|
395
|
|
- title: "删除成功!",
|
396
|
|
- type: "success",
|
397
|
|
- confirmButtonColor: "#007AFF"
|
398
|
|
- }, function() {
|
399
|
|
- $scope.refreshData('expand-right', defaultFilterData);
|
400
|
|
- // $scope.myData = _.reject($scope.myData, function(o) { return _.includes(selectedItem, o.id); });
|
401
|
|
- // $scope.selected = {
|
402
|
|
- // items: []
|
403
|
|
- // };
|
404
|
|
- // $scope.gridOptions.totalItems = $scope.gridOptions.totalItems - selectedItem.length
|
405
|
|
- $scope.gridApi.grid.selection.selectedCount = 0;
|
406
|
|
- });
|
|
410
|
+ if(response.data && !response.data.priority && !response.data.type){
|
|
411
|
+ SweetAlert.swal({
|
|
412
|
+ title: "操作异常!",
|
|
413
|
+ text: "优先级重复!",
|
|
414
|
+ type: "error"
|
|
415
|
+ });
|
|
416
|
+ }else{
|
|
417
|
+ SweetAlert.swal({
|
|
418
|
+ title: "删除成功!",
|
|
419
|
+ type: "success",
|
|
420
|
+ confirmButtonColor: "#007AFF"
|
|
421
|
+ }, function() {
|
|
422
|
+ $scope.refreshData('expand-right', defaultFilterData);
|
|
423
|
+ // $scope.myData = _.reject($scope.myData, function(o) { return _.includes(selectedItem, o.id); });
|
|
424
|
+ // $scope.selected = {
|
|
425
|
+ // items: []
|
|
426
|
+ // };
|
|
427
|
+ // $scope.gridOptions.totalItems = $scope.gridOptions.totalItems - selectedItem.length
|
|
428
|
+ $scope.gridApi.grid.selection.selectedCount = 0;
|
|
429
|
+ });
|
|
430
|
+ }
|
|
431
|
+
|
407
|
432
|
|
408
|
433
|
} else {
|
409
|
434
|
SweetAlert.swal({
|