|
@@ -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) {
|