seimin il y a 2 ans
Parent
commit
e6dd43f620

+ 8 - 0
assets/js/controllers/desk/recordCtrl.js

@@ -231,10 +231,12 @@ app.controller("recordCtrl", [
231 231
                 "assets/views/customform/tpl/modal-add-callrequester.html",
232 232
               controller: function (
233 233
                 $scope,
234
+                SweetAlert,
234 235
                 $modalInstance,
235 236
                 api_user_data,
236 237
                 api_wechatfile
237 238
               ) {
239
+                $modalInstance.SweetAlert = SweetAlert;
238 240
                 $scope.title = "新增报修人";
239 241
                 $scope.requester = {};
240 242
                 $scope.branchs = [];
@@ -471,6 +473,12 @@ app.controller("recordCtrl", [
471 473
                       $state.go("app.incident.title", {
472 474
                         model: JSON.stringify(data),
473 475
                       });
476
+                    }else{
477
+                      modalInstance.SweetAlert.swal({
478
+                        title: "系统错误",
479
+                        text: "账号重复!",
480
+                        type: "error",
481
+                      });
474 482
                     }
475 483
                   });
476 484
               }

+ 13 - 1
assets/js/controllers/mainCtrl.js

@@ -1026,6 +1026,7 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
1026 1026
                                                                 backdrop: "static",
1027 1027
                                                                 templateUrl: 'assets/views/customform/tpl/modal-add-callrequester.html',
1028 1028
                                                                 controller: function($scope, $modalInstance, api_user_data, api_wechatfile, SweetAlert) {
1029
+                                                                    $modalInstance.SweetAlert = SweetAlert;
1029 1030
                                                                     $scope.title = "新增报修人";
1030 1031
                                                                     $scope.requester = {};
1031 1032
                                                                     $scope.onChangeadd = function(searchData) {
@@ -1255,7 +1256,11 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
1255 1256
                                                                             };
1256 1257
                                                                             $state.go('app.incident.title', { 'model': JSON.stringify(data) });
1257 1258
                                                                         }else{
1258
-                                                                            SweetAlert.swal("操作失败!", "添加报修人失败", "error");
1259
+                                                                          modalInstance.SweetAlert.swal({
1260
+                                                                            title: "系统错误",
1261
+                                                                            text: "账号重复!",
1262
+                                                                            type: "error",
1263
+                                                                          });
1259 1264
                                                                         }
1260 1265
                                                                     })
1261 1266
                                                                 }
@@ -1474,6 +1479,7 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
1474 1479
                     var modalInstance = $modal.open({
1475 1480
                       templateUrl: 'assets/views/customform/tpl/modal-add-callrequester.html',
1476 1481
                       controller: function ($scope, $modalInstance, api_user_data, SweetAlert, api_wechatfile) {
1482
+                        $modalInstance.SweetAlert = SweetAlert;
1477 1483
                         $scope.title = "新增报修人";
1478 1484
                         $scope.requester = {};
1479 1485
                         $scope.onChangeadd = function (searchData) {
@@ -1649,6 +1655,12 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
1649 1655
                             $state.go('app.incident.title', {
1650 1656
                               'model': JSON.stringify(data)
1651 1657
                             });
1658
+                          }else{
1659
+                            modalInstance.SweetAlert.swal({
1660
+                              title: "系统错误",
1661
+                              text: "账号重复!",
1662
+                              type: "error",
1663
+                            });
1652 1664
                           }
1653 1665
                         })
1654 1666
                       }

+ 8 - 4
assets/views/customform/tpl/modal-add-callrequester.html

@@ -77,7 +77,7 @@
77 77
             </div>
78 78
             <div class="margin-bottom-15 anline">
79 79
                 <div class="pull-left openaddlable control-label fontcolor-two fontsizes-14">区域:</div>
80
-                <div class="pull-right openaddinput">
80
+                <div class="pull-right openaddinput" style="position:relative;">
81 81
                     <ui-select ng-model="requester.place.area" theme="bootstrap" ng-change="onChange(requester.place.area)">
82 82
                         <ui-select-match placeholder="区域">
83 83
                             {{$select.selected.area}}
@@ -86,12 +86,14 @@
86 86
                             <div ng-bind-html="item.area | highlight: $select.search"></div>
87 87
                         </ui-select-choices>
88 88
                     </ui-select>
89
-
89
+                    <button style="position:absolute;right:-24px;top:0;padding: 4px;" ng-click="requester.place = undefined" class="btn btn-default">
90
+                        <span class="glyphicon glyphicon-trash"></span>
91
+                    </button>
90 92
                 </div>
91 93
             </div>
92 94
             <div class="margin-bottom-15 anline">
93 95
                 <div class="pull-left openaddlable control-label fontcolor-two fontsizes-14">地点:</div>
94
-                <div class="pull-right openaddinput">
96
+                <div class="pull-right openaddinput" style="position:relative;">
95 97
                     <ui-select ng-model="requester.place" theme="bootstrap" ng-change="onChangePlace(requester.place)">
96 98
                         <ui-select-match placeholder="地点">
97 99
                             {{$select.selected.place}}
@@ -100,7 +102,9 @@
100 102
                             <div ng-bind-html="item.place | highlight: $select.search"></div>
101 103
                         </ui-select-choices>
102 104
                     </ui-select>
103
-
105
+                    <button style="position:absolute;right:-24px;top:0;padding: 4px;" ng-click="requester.place = undefined" class="btn btn-default">
106
+                        <span class="glyphicon glyphicon-trash"></span>
107
+                    </button>
104 108
                 </div>
105 109
             </div>
106 110
             <div class="margin-bottom-15 anline" ng-if="isRoom">