浏览代码

查号信息增加别名

seimin 2 年之前
父节点
当前提交
50e366bce2

+ 17 - 10
assets/js/controllers/system/phoneListCtrl.js

@@ -104,10 +104,11 @@ app.controller('phoneListCtrl', ["$rootScope", "$scope", "$http", "$state", "$ti
104 104
                     $modalInstance.dismiss('cancel');
105 105
                 };
106 106
                 $scope.areaName = data.unit;
107
-                $scope.ok = function (areaName) {
108
-                    if (areaName != data.unit) {
107
+                $scope.unitAlias = data.unitAlias;
108
+                $scope.ok = function (areaName, unitAlias) {
109
+                    // if (areaName != data.unit) {
109 110
                         if ($scope.areaName) {
110
-                            $modalInstance.close(areaName);
111
+                            $modalInstance.close({areaName, unitAlias});
111 112
                         } else {
112 113
                             SweetAlert.swal({
113 114
                                 title: "修改失败!",
@@ -115,9 +116,9 @@ app.controller('phoneListCtrl', ["$rootScope", "$scope", "$http", "$state", "$ti
115 116
                                 type: "error"
116 117
                             })
117 118
                         }
118
-                    } else {
119
-                        $modalInstance.dismiss('cancel');
120
-                    }
119
+                    // } else {
120
+                    //     $modalInstance.dismiss('cancel');
121
+                    // }
121 122
                 }
122 123
             },
123 124
             resolve: {
@@ -132,7 +133,8 @@ app.controller('phoneListCtrl', ["$rootScope", "$scope", "$http", "$state", "$ti
132 133
                     "phoneUnit": {
133 134
                         "id": data.id,
134 135
                         "deleteFlag": 0,
135
-                        "unit": selectedItem
136
+                        "unit": selectedItem.areaName,
137
+                        "unitAlias": selectedItem.unitAlias
136 138
                     }
137 139
                 }
138 140
                 api_user_data.addData('phoneUnit', fildata).then(function (response) {
@@ -163,12 +165,13 @@ app.controller('phoneListCtrl', ["$rootScope", "$scope", "$http", "$state", "$ti
163 165
             controller: function ($scope, scope, $modalInstance, api_user_data) {
164 166
                 $scope.title = "新增单位";
165 167
                 $scope.areaName = "";
168
+                $scope.unitAlias = "";
166 169
                 $scope.cancel = function () {
167 170
                     $modalInstance.dismiss('cancel');
168 171
                 };
169
-                $scope.ok = function (areaName) {
172
+                $scope.ok = function (areaName, unitAlias) {
170 173
                     if ($scope.areaName) {
171
-                        $modalInstance.close(areaName);
174
+                        $modalInstance.close({areaName, unitAlias});
172 175
                     } else {
173 176
                         SweetAlert.swal({
174 177
                             title: "新增失败!",
@@ -188,7 +191,8 @@ app.controller('phoneListCtrl', ["$rootScope", "$scope", "$http", "$state", "$ti
188 191
             if (selectedItem) {
189 192
                 var fildata = {
190 193
                     "phoneUnit": {
191
-                        "unit": selectedItem
194
+                        "unit": selectedItem.areaName,
195
+                        "unitAlias": selectedItem.unitAlias
192 196
                     }
193 197
                 }
194 198
                 api_user_data.addData('phoneUnit', fildata).then(function (response) {
@@ -270,6 +274,7 @@ app.controller('phoneListCtrl', ["$rootScope", "$scope", "$http", "$state", "$ti
270 274
                 $scope.check = {
271 275
                     unit: data.unit,
272 276
                     dept: data.dept,
277
+                    deptAlias: data.deptAlias,
273 278
                     phone: data.phone,
274 279
                     address: data.address
275 280
                 }
@@ -304,6 +309,7 @@ app.controller('phoneListCtrl', ["$rootScope", "$scope", "$http", "$state", "$ti
304 309
                 var fildata = {
305 310
                     "phoneDirectory": {
306 311
                         "dept": check.dept,
312
+                        "deptAlias": check.deptAlias,
307 313
                         "address": check.address,
308 314
                         "phone": check.phone,
309 315
                         "unit": {
@@ -373,6 +379,7 @@ app.controller('phoneListCtrl', ["$rootScope", "$scope", "$http", "$state", "$ti
373 379
                 var fildata = {
374 380
                     "phoneDirectory": {
375 381
                         "dept": check.dept,
382
+                        "deptAlias": check.deptAlias,
376 383
                         "phone": check.phone,
377 384
                         "address": check.address
378 385
                     }

+ 8 - 1
assets/views/system/tpl/company.html

@@ -16,6 +16,13 @@
16 16
                 <input class="form-control" ng-model="areaName" placeholder="请输入单位名称" />
17 17
             </div>
18 18
         </div>
19
+        <div class="row form-group">
20
+            <label class="col-md-3 col-md-offset-1 control-label">单位别名:</label>
21
+            <div class="col-md-7">
22
+                <textarea rows="5" class="form-control" style="word-break:break-all;resize:none;" ng-model="unitAlias" placeholder="请输入单位别名" />
23
+                <div class="red">多个单位别名请使用【英文逗号】拼接!</div>
24
+            </div>
25
+        </div>
19 26
         <!--<div class="row form-group">
20 27
             <label class="col-md-3 col-md-offset-1 control-label">角色代码:</label>
21 28
             <div class="col-md-7">
@@ -23,7 +30,7 @@
23 30
             </div>
24 31
         </div>-->
25 32
         <div class="panel-footer text-center">
26
-            <a ng-click="ok(areaName)" data-dismiss="modal" class="btn btn-primary">保存</a>
33
+            <a ng-click="ok(areaName, unitAlias)" data-dismiss="modal" class="btn btn-primary">保存</a>
27 34
             <button class="btn btn-primary btn-o" ng-click="cancel()" translate="modal.button.CANCEL">取消</button>
28 35
         </div>
29 36
     </div>

+ 7 - 0
assets/views/system/tpl/department.html

@@ -35,6 +35,13 @@
35 35
             </div>
36 36
         </div>
37 37
         <div class="row form-group">
38
+            <label class="col-md-3 col-md-offset-1 control-label">部门别名:</label>
39
+            <div class="col-md-7">
40
+                <textarea rows="5" class="form-control" style="word-break:break-all;resize:none;" ng-model="check.deptAlias" placeholder="请输入部门别名" />
41
+                <div class="red">多个部门别名请使用【英文逗号】拼接!</div>
42
+            </div>
43
+        </div>
44
+        <div class="row form-group">
38 45
             <label class="col-md-3 col-md-offset-1 control-label">电话*:</label>
39 46
             <div class="col-md-7">
40 47
                 <input class="form-control" ng-model="check.phone" maxlength="12" placeholder="请输入电话" />