Procházet zdrojové kódy

在区域地点管理中增加所属院区字段

seimin před 3 roky
rodič
revize
9f364ef842

+ 29 - 10
assets/js/controllers/system/organizationdesign/placeCtrl.js

@@ -23,6 +23,7 @@ app.controller('placeCtrl', ["$rootScope", "$scope", "$http", "$state", "$timeou
23 23
     };
24 24
     $scope.choice = false;
25 25
     $scope.backcolor = [];
26
+    $scope.outhospital = [];
26 27
     $scope.outarea = [];
27 28
     $scope.outplace = [];
28 29
     $scope.pla = {};
@@ -30,6 +31,16 @@ app.controller('placeCtrl', ["$rootScope", "$scope", "$http", "$state", "$timeou
30 31
     $scope.areaname = "";
31 32
     $scope.area = {};
32 33
     $scope.areaplace = true;
34
+    $scope.freshenHospital = function () {
35
+        api_user_data.fetchDataList('branch', fildata).then(function (response) {
36
+            if (response) {
37
+                if (response.status = 200) {
38
+                    $scope.outhospital = response.list;
39
+                }
40
+            }
41
+        })
42
+    }
43
+    $scope.freshenHospital();
33 44
     $scope.freshenarea = function () {
34 45
         api_user_data.fetchDataList('area', fildata).then(function (response) {
35 46
             if (response) {
@@ -103,11 +114,13 @@ app.controller('placeCtrl', ["$rootScope", "$scope", "$http", "$state", "$timeou
103 114
                 $scope.cancel = function () {
104 115
                     $modalInstance.dismiss('cancel');
105 116
                 };
117
+                $scope.outhospital = scope.outhospital;
106 118
                 $scope.areaName = data.area;
119
+                $scope.search = {hospital:{id:data.branch,hosName:data.branchName}};
107 120
                 $scope.ok = function (areaName) {
108
-                    if (areaName != data.area) {
109
-                        if ($scope.areaName) {
110
-                            $modalInstance.close(areaName);
121
+                    // if (areaName != data.area) {
122
+                        if ($scope.areaName && $scope.search.hospital.id) {
123
+                            $modalInstance.close({areaName:areaName,hospital:$scope.search.hospital});
111 124
                         } else {
112 125
                             SweetAlert.swal({
113 126
                                 title: "修改失败!",
@@ -115,9 +128,9 @@ app.controller('placeCtrl', ["$rootScope", "$scope", "$http", "$state", "$timeou
115 128
                                 type: "error"
116 129
                             })
117 130
                         }
118
-                    } else {
119
-                        $modalInstance.dismiss('cancel');
120
-                    }
131
+                    // } else {
132
+                    //     $modalInstance.dismiss('cancel');
133
+                    // }
121 134
                 }
122 135
             },
123 136
             resolve: {
@@ -132,7 +145,9 @@ app.controller('placeCtrl', ["$rootScope", "$scope", "$http", "$state", "$timeou
132 145
                     "area": {
133 146
                         "id": data.id,
134 147
                         "deleteFlag": 0,
135
-                        "area": selectedItem
148
+                        "area": selectedItem.areaName,
149
+                        branch: selectedItem.hospital.id,
150
+                        branchName: selectedItem.hospital.hosName
136 151
                     }
137 152
                 }
138 153
                 api_user_data.updData('area', fildata).then(function (response) {
@@ -163,12 +178,14 @@ app.controller('placeCtrl', ["$rootScope", "$scope", "$http", "$state", "$timeou
163 178
             controller: function ($scope, scope, $modalInstance, api_user_data) {
164 179
                 $scope.title = "新增区域";
165 180
                 $scope.areaName = "";
181
+                $scope.search = {hospital:{}};
182
+                $scope.outhospital = scope.outhospital;
166 183
                 $scope.cancel = function () {
167 184
                     $modalInstance.dismiss('cancel');
168 185
                 };
169 186
                 $scope.ok = function (areaName) {
170
-                    if ($scope.areaName) {
171
-                        $modalInstance.close(areaName);
187
+                    if ($scope.areaName&&$scope.search.hospital.id) {
188
+                        $modalInstance.close({areaName:areaName,hospital:$scope.search.hospital});
172 189
                     } else {
173 190
                         SweetAlert.swal({
174 191
                             title: "新增失败!",
@@ -188,7 +205,9 @@ app.controller('placeCtrl', ["$rootScope", "$scope", "$http", "$state", "$timeou
188 205
             if (selectedItem) {
189 206
                 var fildata = {
190 207
                     "area": {
191
-                        "area": selectedItem
208
+                        "area": selectedItem.areaName,
209
+                        branch: selectedItem.hospital.id,
210
+                        branchName: selectedItem.hospital.hosName
192 211
                     }
193 212
                 }
194 213
                 api_user_data.addData('area', fildata).then(function (response) {

+ 1 - 1
assets/views/system/organization/place.html

@@ -307,7 +307,7 @@
307 307
                 <div class="mainDiv-body-2" style="cursor: pointer;" ng-repeat="area in outarea"
308 308
                     ng-click="ckickrow(area)">
309 309
                     <div class="" ng-hide="editShow">
310
-                        <span>{{ (area.area || '添加区域') | uppercase }}</span>
310
+                        <span>{{area.branchName}} - {{ area.area }}</span>
311 311
                         <div class="mainDiv-head-right">
312 312
                             <span class="mainDivLeft-span-1 span-1 pointfont bluefont" ng-click="editArea(area)"
313 313
                                 ng-show="bianji">

+ 15 - 1
assets/views/system/tpl/area.html

@@ -11,7 +11,21 @@
11 11
 <div class="modal-body">
12 12
     <div class="well-lg"><br/>
13 13
         <div class="row form-group">
14
-            <label class="col-md-3 col-md-offset-1 control-label">区域:</label>
14
+            <label class="col-md-3 col-md-offset-1 control-label">所属院区*:</label>
15
+            <div class="col-md-7">
16
+                <ui-select style="width: 100%;" ng-model="search.hospital"
17
+                    theme="bootstrap">
18
+                    <ui-select-match placeholder="">
19
+                        {{$select.selected.hosName}}
20
+                    </ui-select-match>
21
+                    <ui-select-choices repeat="item in outhospital | filter: $select.search">
22
+                        <div ng-bind-html="item.hosName | highlight: $select.search"></div>
23
+                    </ui-select-choices>
24
+                </ui-select>
25
+            </div>
26
+        </div>
27
+        <div class="row form-group">
28
+            <label class="col-md-3 col-md-offset-1 control-label">区域*:</label>
15 29
             <div class="col-md-7">
16 30
                 <input class="form-control" ng-model="areaName" placeholder="请输入区域名称" />
17 31
             </div>