Browse Source

区域地点加别名

seimin 2 years ago
parent
commit
ee168a4f04

+ 25 - 14
assets/js/controllers/system/organizationdesign/placeCtrl.js

@@ -114,13 +114,16 @@ app.controller('placeCtrl', ["$rootScope", "$scope", "$http", "$state", "$timeou
114
                 $scope.cancel = function () {
114
                 $scope.cancel = function () {
115
                     $modalInstance.dismiss('cancel');
115
                     $modalInstance.dismiss('cancel');
116
                 };
116
                 };
117
+                $scope.check = {
118
+                    areaName: data.area,
119
+                    areaAlias: data.alias ? data.alias.split(',') : []
120
+                }
117
                 $scope.outhospital = scope.outhospital;
121
                 $scope.outhospital = scope.outhospital;
118
-                $scope.areaName = data.area;
119
                 $scope.search = {hospital:{id:data.branch,hosName:data.branchName}};
122
                 $scope.search = {hospital:{id:data.branch,hosName:data.branchName}};
120
-                $scope.ok = function (areaName) {
123
+                $scope.ok = function (check) {
121
                     // if (areaName != data.area) {
124
                     // if (areaName != data.area) {
122
-                        if ($scope.areaName && $scope.search.hospital.id) {
123
-                            $modalInstance.close({areaName:areaName,hospital:$scope.search.hospital});
125
+                        if ($scope.check.areaName && $scope.search.hospital.id) {
126
+                            $modalInstance.close({areaName:check.areaName,hospital:$scope.search.hospital,areaAlias:check.areaAlias});
124
                         } else {
127
                         } else {
125
                             SweetAlert.swal({
128
                             SweetAlert.swal({
126
                                 title: "修改失败!",
129
                                 title: "修改失败!",
@@ -147,7 +150,8 @@ app.controller('placeCtrl', ["$rootScope", "$scope", "$http", "$state", "$timeou
147
                         "deleteFlag": 0,
150
                         "deleteFlag": 0,
148
                         "area": selectedItem.areaName,
151
                         "area": selectedItem.areaName,
149
                         branch: selectedItem.hospital.id,
152
                         branch: selectedItem.hospital.id,
150
-                        branchName: selectedItem.hospital.hosName
153
+                        branchName: selectedItem.hospital.hosName,
154
+                        alias: String(selectedItem.areaAlias)
151
                     }
155
                     }
152
                 }
156
                 }
153
                 api_user_data.updData('area', fildata).then(function (response) {
157
                 api_user_data.updData('area', fildata).then(function (response) {
@@ -177,15 +181,18 @@ app.controller('placeCtrl', ["$rootScope", "$scope", "$http", "$state", "$timeou
177
             templateUrl: 'assets/views/system/tpl/area.html',
181
             templateUrl: 'assets/views/system/tpl/area.html',
178
             controller: function ($scope, scope, $modalInstance, api_user_data) {
182
             controller: function ($scope, scope, $modalInstance, api_user_data) {
179
                 $scope.title = "新增区域";
183
                 $scope.title = "新增区域";
180
-                $scope.areaName = "";
184
+                $scope.check = {
185
+                    areaName: "",
186
+                    areaAlias: []
187
+                }
181
                 $scope.search = {hospital:{}};
188
                 $scope.search = {hospital:{}};
182
                 $scope.outhospital = scope.outhospital;
189
                 $scope.outhospital = scope.outhospital;
183
                 $scope.cancel = function () {
190
                 $scope.cancel = function () {
184
                     $modalInstance.dismiss('cancel');
191
                     $modalInstance.dismiss('cancel');
185
                 };
192
                 };
186
-                $scope.ok = function (areaName) {
187
-                    if ($scope.areaName&&$scope.search.hospital.id) {
188
-                        $modalInstance.close({areaName:areaName,hospital:$scope.search.hospital});
193
+                $scope.ok = function (check) {
194
+                    if ($scope.check.areaName&&$scope.search.hospital.id) {
195
+                        $modalInstance.close({areaName:check.areaName,hospital:$scope.search.hospital,areaAlias:check.areaAlias});
189
                     } else {
196
                     } else {
190
                         SweetAlert.swal({
197
                         SweetAlert.swal({
191
                             title: "新增失败!",
198
                             title: "新增失败!",
@@ -207,7 +214,8 @@ app.controller('placeCtrl', ["$rootScope", "$scope", "$http", "$state", "$timeou
207
                     "area": {
214
                     "area": {
208
                         "area": selectedItem.areaName,
215
                         "area": selectedItem.areaName,
209
                         branch: selectedItem.hospital.id,
216
                         branch: selectedItem.hospital.id,
210
-                        branchName: selectedItem.hospital.hosName
217
+                        branchName: selectedItem.hospital.hosName,
218
+                        alias: String(selectedItem.areaAlias)
211
                     }
219
                     }
212
                 }
220
                 }
213
                 api_user_data.addData('area', fildata).then(function (response) {
221
                 api_user_data.addData('area', fildata).then(function (response) {
@@ -288,7 +296,8 @@ app.controller('placeCtrl', ["$rootScope", "$scope", "$http", "$state", "$timeou
288
                 $scope.title = "修改地点";
296
                 $scope.title = "修改地点";
289
                 $scope.check = {
297
                 $scope.check = {
290
                     area: data.area,
298
                     area: data.area,
291
-                    place: data.place
299
+                    place: data.place,
300
+                    placeAlias: data.alias ? data.alias.split(',') : [],
292
                 }
301
                 }
293
                 $scope.outarea = scope.outarea;
302
                 $scope.outarea = scope.outarea;
294
                 $scope.cancel = function () {
303
                 $scope.cancel = function () {
@@ -321,6 +330,7 @@ app.controller('placeCtrl', ["$rootScope", "$scope", "$http", "$state", "$timeou
321
                 var fildata = {
330
                 var fildata = {
322
                     "place": {
331
                     "place": {
323
                         "place": check.place,
332
                         "place": check.place,
333
+                        alias: String(check.placeAlias),
324
                         "area": {
334
                         "area": {
325
                             "id": check.area.id
335
                             "id": check.area.id
326
                         },
336
                         },
@@ -356,9 +366,9 @@ app.controller('placeCtrl', ["$rootScope", "$scope", "$http", "$state", "$timeou
356
             controller: function ($scope, scope, $modalInstance, api_user_data) {
366
             controller: function ($scope, scope, $modalInstance, api_user_data) {
357
                 $scope.title = "新增地点";
367
                 $scope.title = "新增地点";
358
                 if (area !== undefined) {
368
                 if (area !== undefined) {
359
-                    $scope.check = { area: area }
369
+                    $scope.check = { area: area, placeAlias: [] }
360
                 } else {
370
                 } else {
361
-                    $scope.check = {}
371
+                    $scope.check = {placeAlias: []}
362
                 }
372
                 }
363
                 $scope.outarea = scope.outarea;
373
                 $scope.outarea = scope.outarea;
364
                 $scope.cancel = function () {
374
                 $scope.cancel = function () {
@@ -387,7 +397,8 @@ app.controller('placeCtrl', ["$rootScope", "$scope", "$http", "$state", "$timeou
387
             if (check) {
397
             if (check) {
388
                 var fildata = {
398
                 var fildata = {
389
                     "place": {
399
                     "place": {
390
-                        "place": check.place
400
+                        "place": check.place,
401
+                        "alias": String(check.placeAlias),
391
                     }
402
                     }
392
                 }
403
                 }
393
                 if (check.area) {
404
                 if (check.area) {

+ 14 - 2
assets/views/system/tpl/area.html

@@ -27,7 +27,19 @@
27
         <div class="row form-group">
27
         <div class="row form-group">
28
             <label class="col-md-3 col-md-offset-1 control-label">区域*:</label>
28
             <label class="col-md-3 col-md-offset-1 control-label">区域*:</label>
29
             <div class="col-md-7">
29
             <div class="col-md-7">
30
-                <input class="form-control" ng-model="areaName" placeholder="请输入区域名称" />
30
+                <input class="form-control" ng-model="check.areaName" placeholder="请输入区域名称" />
31
+            </div>
32
+        </div>
33
+        <div class="row form-group">
34
+            <label class="col-md-3 col-md-offset-1 control-label">区域别名:</label>
35
+            <div class="col-md-7">
36
+                <ui-select multiple tagging tagging-label="false" ng-model="check.areaAlias" theme="bootstrap" style="text-align:left;min-height: 100px;">
37
+                    <ui-select-match placeholder="请输入区域别名">{{$item}}</ui-select-match>
38
+                    <ui-select-choices repeat="color in check.areaAlias | filter:$select.search">
39
+                        {{color}}
40
+                    </ui-select-choices>
41
+                </ui-select>
42
+                <div class="red">填写区域别名后按Tab键自动填入!</div>
31
             </div>
43
             </div>
32
         </div>
44
         </div>
33
         <!--<div class="row form-group">
45
         <!--<div class="row form-group">
@@ -37,7 +49,7 @@
37
             </div>
49
             </div>
38
         </div>-->
50
         </div>-->
39
         <div class="panel-footer text-center">
51
         <div class="panel-footer text-center">
40
-            <a ng-click="ok(areaName)" data-dismiss="modal" class="btn btn-primary">保存</a>
52
+            <a ng-click="ok(check)" data-dismiss="modal" class="btn btn-primary">保存</a>
41
             <button class="btn btn-primary btn-o" ng-click="cancel()" translate="modal.button.CANCEL">取消</button>
53
             <button class="btn btn-primary btn-o" ng-click="cancel()" translate="modal.button.CANCEL">取消</button>
42
         </div>
54
         </div>
43
     </div>
55
     </div>

+ 12 - 0
assets/views/system/tpl/place.html

@@ -34,6 +34,18 @@
34
                 
34
                 
35
             </div>
35
             </div>
36
         </div>
36
         </div>
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
+                <ui-select multiple tagging tagging-label="false" ng-model="check.placeAlias" theme="bootstrap" style="text-align:left;min-height: 100px;">
41
+                    <ui-select-match placeholder="请输入地点别名">{{$item}}</ui-select-match>
42
+                    <ui-select-choices repeat="color in check.placeAlias | filter:$select.search">
43
+                        {{color}}
44
+                    </ui-select-choices>
45
+                </ui-select>
46
+                <div class="red">填写地点别名后按Tab键自动填入!</div>
47
+            </div>
48
+        </div>
37
         <!--<div class="row form-group">
49
         <!--<div class="row form-group">
38
             <label class="col-md-3 col-md-offset-1 control-label">角色代码:</label>
50
             <label class="col-md-3 col-md-offset-1 control-label">角色代码:</label>
39
             <div class="col-md-7">
51
             <div class="col-md-7">