Browse Source

一堆改

seimin 2 years ago
parent
commit
e6dd43f620

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

@@ -231,10 +231,12 @@ app.controller("recordCtrl", [
231
                 "assets/views/customform/tpl/modal-add-callrequester.html",
231
                 "assets/views/customform/tpl/modal-add-callrequester.html",
232
               controller: function (
232
               controller: function (
233
                 $scope,
233
                 $scope,
234
+                SweetAlert,
234
                 $modalInstance,
235
                 $modalInstance,
235
                 api_user_data,
236
                 api_user_data,
236
                 api_wechatfile
237
                 api_wechatfile
237
               ) {
238
               ) {
239
+                $modalInstance.SweetAlert = SweetAlert;
238
                 $scope.title = "新增报修人";
240
                 $scope.title = "新增报修人";
239
                 $scope.requester = {};
241
                 $scope.requester = {};
240
                 $scope.branchs = [];
242
                 $scope.branchs = [];
@@ -471,6 +473,12 @@ app.controller("recordCtrl", [
471
                       $state.go("app.incident.title", {
473
                       $state.go("app.incident.title", {
472
                         model: JSON.stringify(data),
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
                                                                 backdrop: "static",
1026
                                                                 backdrop: "static",
1027
                                                                 templateUrl: 'assets/views/customform/tpl/modal-add-callrequester.html',
1027
                                                                 templateUrl: 'assets/views/customform/tpl/modal-add-callrequester.html',
1028
                                                                 controller: function($scope, $modalInstance, api_user_data, api_wechatfile, SweetAlert) {
1028
                                                                 controller: function($scope, $modalInstance, api_user_data, api_wechatfile, SweetAlert) {
1029
+                                                                    $modalInstance.SweetAlert = SweetAlert;
1029
                                                                     $scope.title = "新增报修人";
1030
                                                                     $scope.title = "新增报修人";
1030
                                                                     $scope.requester = {};
1031
                                                                     $scope.requester = {};
1031
                                                                     $scope.onChangeadd = function(searchData) {
1032
                                                                     $scope.onChangeadd = function(searchData) {
@@ -1255,7 +1256,11 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
1255
                                                                             };
1256
                                                                             };
1256
                                                                             $state.go('app.incident.title', { 'model': JSON.stringify(data) });
1257
                                                                             $state.go('app.incident.title', { 'model': JSON.stringify(data) });
1257
                                                                         }else{
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
                     var modalInstance = $modal.open({
1479
                     var modalInstance = $modal.open({
1475
                       templateUrl: 'assets/views/customform/tpl/modal-add-callrequester.html',
1480
                       templateUrl: 'assets/views/customform/tpl/modal-add-callrequester.html',
1476
                       controller: function ($scope, $modalInstance, api_user_data, SweetAlert, api_wechatfile) {
1481
                       controller: function ($scope, $modalInstance, api_user_data, SweetAlert, api_wechatfile) {
1482
+                        $modalInstance.SweetAlert = SweetAlert;
1477
                         $scope.title = "新增报修人";
1483
                         $scope.title = "新增报修人";
1478
                         $scope.requester = {};
1484
                         $scope.requester = {};
1479
                         $scope.onChangeadd = function (searchData) {
1485
                         $scope.onChangeadd = function (searchData) {
@@ -1649,6 +1655,12 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
1649
                             $state.go('app.incident.title', {
1655
                             $state.go('app.incident.title', {
1650
                               'model': JSON.stringify(data)
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
             </div>
77
             </div>
78
             <div class="margin-bottom-15 anline">
78
             <div class="margin-bottom-15 anline">
79
                 <div class="pull-left openaddlable control-label fontcolor-two fontsizes-14">区域:</div>
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
                     <ui-select ng-model="requester.place.area" theme="bootstrap" ng-change="onChange(requester.place.area)">
81
                     <ui-select ng-model="requester.place.area" theme="bootstrap" ng-change="onChange(requester.place.area)">
82
                         <ui-select-match placeholder="区域">
82
                         <ui-select-match placeholder="区域">
83
                             {{$select.selected.area}}
83
                             {{$select.selected.area}}
@@ -86,12 +86,14 @@
86
                             <div ng-bind-html="item.area | highlight: $select.search"></div>
86
                             <div ng-bind-html="item.area | highlight: $select.search"></div>
87
                         </ui-select-choices>
87
                         </ui-select-choices>
88
                     </ui-select>
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
                 </div>
92
                 </div>
91
             </div>
93
             </div>
92
             <div class="margin-bottom-15 anline">
94
             <div class="margin-bottom-15 anline">
93
                 <div class="pull-left openaddlable control-label fontcolor-two fontsizes-14">地点:</div>
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
                     <ui-select ng-model="requester.place" theme="bootstrap" ng-change="onChangePlace(requester.place)">
97
                     <ui-select ng-model="requester.place" theme="bootstrap" ng-change="onChangePlace(requester.place)">
96
                         <ui-select-match placeholder="地点">
98
                         <ui-select-match placeholder="地点">
97
                             {{$select.selected.place}}
99
                             {{$select.selected.place}}
@@ -100,7 +102,9 @@
100
                             <div ng-bind-html="item.place | highlight: $select.search"></div>
102
                             <div ng-bind-html="item.place | highlight: $select.search"></div>
101
                         </ui-select-choices>
103
                         </ui-select-choices>
102
                     </ui-select>
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
                 </div>
108
                 </div>
105
             </div>
109
             </div>
106
             <div class="margin-bottom-15 anline" ng-if="isRoom">
110
             <div class="margin-bottom-15 anline" ng-if="isRoom">